From a6d660c4a3ad9108a936bfd92ff8aff3c787dd7b Mon Sep 17 00:00:00 2001 From: David Dias Date: Tue, 22 Aug 2017 07:56:58 +0100 Subject: [PATCH 01/11] feat: mix in IPFS --- .gitignore | 2 + app/extensions.js | 24 +- .../locales/bn-BD/preferences.properties | 1 + .../locales/bn-IN/preferences.properties | 1 + .../brave/locales/cs/preferences.properties | 1 + .../locales/de-DE/preferences.properties | 1 + .../locales/en-US/preferences.properties | 1 + .../brave/locales/es/preferences.properties | 1 + .../brave/locales/eu/preferences.properties | 1 + .../locales/fr-FR/preferences.properties | 1 + .../locales/hi-IN/preferences.properties | 1 + .../locales/id-ID/preferences.properties | 1 + .../locales/it-IT/preferences.properties | 1 + .../locales/ja-JP/preferences.properties | 1 + .../locales/ko-KR/preferences.properties | 1 + .../locales/ms-MY/preferences.properties | 1 + .../locales/nl-NL/preferences.properties | 1 + .../locales/pl-PL/preferences.properties | 1 + .../locales/pt-BR/preferences.properties | 1 + .../brave/locales/ru/preferences.properties | 1 + .../brave/locales/sl/preferences.properties | 1 + .../brave/locales/ta/preferences.properties | 1 + .../brave/locales/te/preferences.properties | 1 + .../locales/tr-TR/preferences.properties | 1 + .../brave/locales/uk/preferences.properties | 1 + .../locales/zh-CN/preferences.properties | 1 + .../ipfs/_locales/en/app.properties | 1 + app/extensions/ipfs/_locales/en/messages.json | 1 + app/extensions/ipfs/ext/l20n.min.js | 3 + app/extensions/ipfs/img/favicon.ico | Bin 0 -> 370070 bytes app/extensions/ipfs/img/ipfs-128.png | Bin 0 -> 12863 bytes app/extensions/ipfs/img/ipfs-16.png | Bin 0 -> 1284 bytes app/extensions/ipfs/img/ipfs-48.png | Bin 0 -> 4326 bytes app/extensions/ipfs/img/ipfs.png | Bin 0 -> 29357 bytes app/extensions/ipfs/js/ipfs.min.js | 240 ++++++++++++++++++ app/extensions/ipfs/js/main.js | 11 + app/extensions/ipfs/js/some-other.js | 1 + app/extensions/ipfs/manifest.json | 21 ++ docs/state.md | 1 + js/about/preferences.js | 1 + js/constants/appConfig.js | 7 +- js/constants/config.js | 1 + js/constants/settings.js | 1 + js/lib/appUrlUtil.js | 53 ++++ package.json | 1 + 45 files changed, 386 insertions(+), 7 deletions(-) create mode 100644 app/extensions/ipfs/_locales/en/app.properties create mode 100644 app/extensions/ipfs/_locales/en/messages.json create mode 100644 app/extensions/ipfs/ext/l20n.min.js create mode 100644 app/extensions/ipfs/img/favicon.ico create mode 100644 app/extensions/ipfs/img/ipfs-128.png create mode 100644 app/extensions/ipfs/img/ipfs-16.png create mode 100644 app/extensions/ipfs/img/ipfs-48.png create mode 100644 app/extensions/ipfs/img/ipfs.png create mode 100644 app/extensions/ipfs/js/ipfs.min.js create mode 100644 app/extensions/ipfs/js/main.js create mode 100644 app/extensions/ipfs/js/some-other.js create mode 100644 app/extensions/ipfs/manifest.json diff --git a/.gitignore b/.gitignore index 3c78948b128..a6b436cfc9f 100644 --- a/.gitignore +++ b/.gitignore @@ -54,6 +54,8 @@ Brave.tar.bz2 app/extensions/gen app/extensions/brave/gen app/extensions/torrent/gen +app/extensions/ipfs/gen + *.pfx buildConfig.js diff --git a/app/extensions.js b/app/extensions.js index 6ca455fb2b5..a2b8fe2a2be 100644 --- a/app/extensions.js +++ b/app/extensions.js @@ -415,13 +415,17 @@ module.exports.init = () => { return object } - let loadExtension = (extensionId, extensionPath, manifest = {}, manifestLocation = 'unpacked') => { - if (extensionId === config.PDFJSExtensionId) { + const loadExtension = (extensionId, extensionPath, manifest = {}, manifestLocation = 'unpacked') => { + if (extensionId === config.PDFJSExtensionId || + extensionId === config.ipfsExtensionId) { manifestLocation = 'component' } - if (!extensionInfo.isLoaded(extensionId) && !extensionInfo.isLoading(extensionId)) { + if (!extensionInfo.isLoaded(extensionId) && + !extensionInfo.isLoading(extensionId)) { extensionInfo.setState(extensionId, extensionStates.LOADING) - if (extensionId === config.braveExtensionId || extensionId === config.torrentExtensionId || extensionId === config.syncExtensionId) { + if (extensionId === config.braveExtensionId || + extensionId === config.torrentExtensionId || + extensionId === config.syncExtensionId) { session.defaultSession.extensions.load(extensionPath, manifest, manifestLocation) return } @@ -430,6 +434,7 @@ module.exports.init = () => { // just a safety net. fs.exists(path.join(extensionPath, 'manifest.json'), (exists) => { if (exists) { + console.log('Loading:', extensionId, manifestLocation) session.defaultSession.extensions.load(extensionPath, manifest, manifestLocation) } else { // This is an error condition, but we can recover. @@ -454,18 +459,21 @@ module.exports.init = () => { const extensions = extensionState.getExtensions(appStore.getState()) const extensionPath = extensions.getIn([extensionId, 'filePath']) if (extensionPath) { - // Otheriwse just install it + // Otherwise just install it loadExtension(extensionId, extensionPath) } } } - // Manually install the braveExtension and torrentExtension + // Manually install the braveExtension, torrentExtension and ipfsExtension + + // braveExtension extensionInfo.setState(config.braveExtensionId, extensionStates.REGISTERED) loadExtension(config.braveExtensionId, getExtensionsPath('brave'), generateBraveManifest(), 'component') extensionInfo.setState(config.syncExtensionId, extensionStates.REGISTERED) loadExtension(config.syncExtensionId, getExtensionsPath('brave'), generateSyncManifest(), 'unpacked') + // torrentExtension if (getSetting(settings.TORRENT_VIEWER_ENABLED)) { extensionInfo.setState(config.torrentExtensionId, extensionStates.REGISTERED) loadExtension(config.torrentExtensionId, getExtensionsPath('torrent'), generateTorrentManifest(), 'component') @@ -474,6 +482,10 @@ module.exports.init = () => { extensionActions.extensionDisabled(config.torrentExtensionId) } + // ipfsExtension + extensionInfo.setState(config.ipfsExtensionId, extensionStates.REGISTERED) + loadExtension(config.ipfsExtensionId, getExtensionsPath('ipfs')) + let registerComponents = (diff) => { if (getSetting(settings.PDFJS_ENABLED)) { registerComponent(config.PDFJSExtensionId, config.PDFJSExtensionPublicKey) diff --git a/app/extensions/brave/locales/bn-BD/preferences.properties b/app/extensions/brave/locales/bn-BD/preferences.properties index d2555ef62c0..3a04a77be01 100644 --- a/app/extensions/brave/locales/bn-BD/preferences.properties +++ b/app/extensions/brave/locales/bn-BD/preferences.properties @@ -384,3 +384,4 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short +useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/bn-IN/preferences.properties b/app/extensions/brave/locales/bn-IN/preferences.properties index e51a0afcccd..dad5e7bdcb9 100644 --- a/app/extensions/brave/locales/bn-IN/preferences.properties +++ b/app/extensions/brave/locales/bn-IN/preferences.properties @@ -384,3 +384,4 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short +useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/cs/preferences.properties b/app/extensions/brave/locales/cs/preferences.properties index d7850d2cc18..268570bf9db 100644 --- a/app/extensions/brave/locales/cs/preferences.properties +++ b/app/extensions/brave/locales/cs/preferences.properties @@ -384,3 +384,4 @@ tabPreviewTiming=Time to wait before previewing a tab long=Dlouhý normal=Normal short=Krátký +useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/de-DE/preferences.properties b/app/extensions/brave/locales/de-DE/preferences.properties index 204861c0100..1184b1a7891 100644 --- a/app/extensions/brave/locales/de-DE/preferences.properties +++ b/app/extensions/brave/locales/de-DE/preferences.properties @@ -384,3 +384,4 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short +useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/en-US/preferences.properties b/app/extensions/brave/locales/en-US/preferences.properties index f75d5fc05b7..b88cb44a5a8 100644 --- a/app/extensions/brave/locales/en-US/preferences.properties +++ b/app/extensions/brave/locales/en-US/preferences.properties @@ -384,3 +384,4 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short +useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/es/preferences.properties b/app/extensions/brave/locales/es/preferences.properties index fca0ab16870..98158386022 100644 --- a/app/extensions/brave/locales/es/preferences.properties +++ b/app/extensions/brave/locales/es/preferences.properties @@ -384,3 +384,4 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short +useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/eu/preferences.properties b/app/extensions/brave/locales/eu/preferences.properties index 92e272c4b47..67e5d034793 100644 --- a/app/extensions/brave/locales/eu/preferences.properties +++ b/app/extensions/brave/locales/eu/preferences.properties @@ -384,3 +384,4 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short +useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/fr-FR/preferences.properties b/app/extensions/brave/locales/fr-FR/preferences.properties index 8e8b33519b2..fc02d655dba 100644 --- a/app/extensions/brave/locales/fr-FR/preferences.properties +++ b/app/extensions/brave/locales/fr-FR/preferences.properties @@ -384,3 +384,4 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short +useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/hi-IN/preferences.properties b/app/extensions/brave/locales/hi-IN/preferences.properties index d483d829c62..fc856aee491 100644 --- a/app/extensions/brave/locales/hi-IN/preferences.properties +++ b/app/extensions/brave/locales/hi-IN/preferences.properties @@ -384,3 +384,4 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short +useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/id-ID/preferences.properties b/app/extensions/brave/locales/id-ID/preferences.properties index 19dc6c03e70..34eeaf51f93 100644 --- a/app/extensions/brave/locales/id-ID/preferences.properties +++ b/app/extensions/brave/locales/id-ID/preferences.properties @@ -384,3 +384,4 @@ tabPreviewTiming=Waktunya menunggu sebelum meninjau tab baru long=Panjang normal=Normal short=Pendek +useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/it-IT/preferences.properties b/app/extensions/brave/locales/it-IT/preferences.properties index e34969492fb..4c9be169c23 100644 --- a/app/extensions/brave/locales/it-IT/preferences.properties +++ b/app/extensions/brave/locales/it-IT/preferences.properties @@ -384,3 +384,4 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short +useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/ja-JP/preferences.properties b/app/extensions/brave/locales/ja-JP/preferences.properties index 0bd5a40101c..1cc62bd0e61 100644 --- a/app/extensions/brave/locales/ja-JP/preferences.properties +++ b/app/extensions/brave/locales/ja-JP/preferences.properties @@ -384,3 +384,4 @@ tabPreviewTiming=Time to wait before previewing a tab long=長い normal=Normal short=短い +useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/ko-KR/preferences.properties b/app/extensions/brave/locales/ko-KR/preferences.properties index 14406b59ad7..a5e6c7200b2 100644 --- a/app/extensions/brave/locales/ko-KR/preferences.properties +++ b/app/extensions/brave/locales/ko-KR/preferences.properties @@ -384,3 +384,4 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short +useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/ms-MY/preferences.properties b/app/extensions/brave/locales/ms-MY/preferences.properties index 6081b1a195d..dcc7974a585 100644 --- a/app/extensions/brave/locales/ms-MY/preferences.properties +++ b/app/extensions/brave/locales/ms-MY/preferences.properties @@ -384,3 +384,4 @@ tabPreviewTiming=Tempoh menunggu sebelum previu tab long=Panjang normal=Normal short=Pendek +useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/nl-NL/preferences.properties b/app/extensions/brave/locales/nl-NL/preferences.properties index e5ff8ec123a..ffedf56ca93 100644 --- a/app/extensions/brave/locales/nl-NL/preferences.properties +++ b/app/extensions/brave/locales/nl-NL/preferences.properties @@ -384,3 +384,4 @@ tabPreviewTiming=Time to wait before previewing a tab long=Lang normal=Normal short=Kort +useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/pl-PL/preferences.properties b/app/extensions/brave/locales/pl-PL/preferences.properties index b76f5ba2ff4..677a195c56f 100644 --- a/app/extensions/brave/locales/pl-PL/preferences.properties +++ b/app/extensions/brave/locales/pl-PL/preferences.properties @@ -384,3 +384,4 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short +useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/pt-BR/preferences.properties b/app/extensions/brave/locales/pt-BR/preferences.properties index b5fad2a85e9..a505600df0d 100644 --- a/app/extensions/brave/locales/pt-BR/preferences.properties +++ b/app/extensions/brave/locales/pt-BR/preferences.properties @@ -384,3 +384,4 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short +useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/ru/preferences.properties b/app/extensions/brave/locales/ru/preferences.properties index dc53bf6ce1b..1449b708faa 100644 --- a/app/extensions/brave/locales/ru/preferences.properties +++ b/app/extensions/brave/locales/ru/preferences.properties @@ -384,3 +384,4 @@ tabPreviewTiming=Время ожидания перед просмотром в long=Длинное normal=Normal short=Короткое +useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/sl/preferences.properties b/app/extensions/brave/locales/sl/preferences.properties index 891f11db0f5..9f161937011 100644 --- a/app/extensions/brave/locales/sl/preferences.properties +++ b/app/extensions/brave/locales/sl/preferences.properties @@ -384,3 +384,4 @@ tabPreviewTiming=Time to wait before previewing a tab long=Dolga normal=Normal short=Kratka +useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/ta/preferences.properties b/app/extensions/brave/locales/ta/preferences.properties index 0c96e9ea1aa..1f2a931a21a 100644 --- a/app/extensions/brave/locales/ta/preferences.properties +++ b/app/extensions/brave/locales/ta/preferences.properties @@ -384,3 +384,4 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short +useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/te/preferences.properties b/app/extensions/brave/locales/te/preferences.properties index dd9b7842482..3cd754db4f4 100644 --- a/app/extensions/brave/locales/te/preferences.properties +++ b/app/extensions/brave/locales/te/preferences.properties @@ -384,3 +384,4 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short +useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/tr-TR/preferences.properties b/app/extensions/brave/locales/tr-TR/preferences.properties index 22a0a127618..1f7fc7ce63b 100644 --- a/app/extensions/brave/locales/tr-TR/preferences.properties +++ b/app/extensions/brave/locales/tr-TR/preferences.properties @@ -384,3 +384,4 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short +useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/uk/preferences.properties b/app/extensions/brave/locales/uk/preferences.properties index 5189fc1f210..523619d2476 100644 --- a/app/extensions/brave/locales/uk/preferences.properties +++ b/app/extensions/brave/locales/uk/preferences.properties @@ -384,3 +384,4 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short +useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/zh-CN/preferences.properties b/app/extensions/brave/locales/zh-CN/preferences.properties index ba91eff9ec9..6cff44d41bf 100644 --- a/app/extensions/brave/locales/zh-CN/preferences.properties +++ b/app/extensions/brave/locales/zh-CN/preferences.properties @@ -384,3 +384,4 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short +useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/ipfs/_locales/en/app.properties b/app/extensions/ipfs/_locales/en/app.properties new file mode 100644 index 00000000000..4626a38b584 --- /dev/null +++ b/app/extensions/ipfs/_locales/en/app.properties @@ -0,0 +1 @@ +ipfs=Distributed Web diff --git a/app/extensions/ipfs/_locales/en/messages.json b/app/extensions/ipfs/_locales/en/messages.json new file mode 100644 index 00000000000..0967ef424bc --- /dev/null +++ b/app/extensions/ipfs/_locales/en/messages.json @@ -0,0 +1 @@ +{} diff --git a/app/extensions/ipfs/ext/l20n.min.js b/app/extensions/ipfs/ext/l20n.min.js new file mode 100644 index 00000000000..0c16a3f1cd0 --- /dev/null +++ b/app/extensions/ipfs/ext/l20n.min.js @@ -0,0 +1,3 @@ +// https://github.com/l20n/l20n.js/releases/tag/v3.5.0 +"use strict";function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}!function(){function a(a,b,c){this.name="L10nError",this.message=a,this.id=b,this.lang=c}function b(b,c){return new Promise(function(d,e){var f=new XMLHttpRequest;f.overrideMimeType&&f.overrideMimeType(b),f.open("GET",c,!0),"application/json"===b&&(f.responseType="json"),f.addEventListener("load",function(b){b.target.status===ga||0===b.target.status?d(b.target.response):e(new a("Not found: "+c))}),f.addEventListener("error",e),f.addEventListener("timeout",e);try{f.send(null)}catch(g){if("NS_ERROR_FILE_NOT_FOUND"!==g.name)throw g;e(new a("Not found: "+c))}})}function c(a,b){var c=b.code,d=b.src,e=b.ver,f=a.replace("{locale}",c),g=a.endsWith(".json")?"json":"text";return ha[d](c,e,f,g)}function d(a){for(var b=this,c=arguments.length,d=Array(c>1?c-1:0),e=1;c>e;e++)d[e-1]=arguments[e];var f=d.shift();a["*"]&&a["*"].slice().forEach(function(a){return a.apply(b,d)}),a[f]&&a[f].slice().forEach(function(a){return a.apply(b,d)})}function e(a,b,c){b in a||(a[b]=[]),a[b].push(c)}function f(a,b,c){var d=a[b],e=d.indexOf(c);-1!==e&&d.splice(e,1)}function g(a,b){Array.from(this.ctxs.keys()).forEach(function(c){return c.emit(a,b)})}function h(b,c,d,e){if("string"==typeof e)return[{},e];if(na.has(e))throw new a("Cyclic reference detected");na.add(e);var f=void 0;try{f=m({},b,c,d,e.value,e.index)}finally{na.delete(e)}return f}function i(b,c,d,e){if(ja.indexOf(e)>-1)return[{},b._getMacro(c,e)];if(d&&d.hasOwnProperty(e)){if("string"==typeof d[e]||"number"==typeof d[e]&&!isNaN(d[e]))return[{},d[e]];throw new a("Arg must be a string or a number: "+e)}if("__proto__"===e)throw new a("Illegal id: "+e);var f=b._getEntity(c,e);if(f)return h(b,c,d,f);throw new a("Unknown reference: "+e)}function j(b,c,d,e,f){var g=void 0,h=void 0;try{var j=i(c,d,e,f);g=j[0],h=j[1]}catch(k){return[{error:k},la+"{{ "+f+" }}"+ma]}if("number"==typeof h){var l=c._getNumberFormatter(d);return[g,l.format(h)]}if("string"==typeof h){if(h.length>=ka)throw new a("Too many characters in placeable ("+h.length+", max allowed is "+ka+")");return[g,la+h+ma]}return[{},la+"{{ "+f+" }}"+ma]}function k(a,b,c,d,e){return e.reduce(function(e,f){var g=e[0],h=e[1];if("string"==typeof f)return[g,h+f];var i=j(a,b,c,d,f.name),k=i[1];return[g,h+k]},[a,""])}function l(a,b,c,d,e){var f=void 0;f="call"===e[0].type&&"prop"===e[0].expr.type&&"cldr"===e[0].expr.expr.name?"plural":e[0].name;var g=i(a,b,c,f)[1];if("function"!=typeof g)return g;var h=e[0].args?i(a,b,c,e[0].args[0].name)[1]:void 0;if("plural"===f){if(0===h&&"zero"in d)return"zero";if(1===h&&"one"in d)return"one";if(2===h&&"two"in d)return"two"}return g(h)}function m(b,c,d,e,f,g){if(!f)return[b,f];if("string"==typeof f||"boolean"==typeof f||"number"==typeof f)return[b,f];if(Array.isArray(f))return k(b,c,d,e,f);if(g){var h=l(c,d,e,f,g);if(h in f)return m(b,c,d,e,f[h])}var i=f.__default||"other";if(i in f)return m(b,c,d,e,f[i]);throw new a("Unresolvable value")}function n(a,b){return-1!==b.indexOf(a)}function o(a,b,c){return typeof a==typeof b&&a>=b&&c>=a}function p(a){var b=oa[a.replace(/-.*$/,"")];return b in pa?pa[b]:function(){return"other"}}function q(b,c,d){var e=this,f=new Set;return b.forEach(function(a,b){if(!d||void 0===d[b]){var g=Array.isArray(a)?a[0]:a;f.add(g),d[b]=c===e._formatValue?g:{value:g,attrs:null}}}),this.emit("notfounderror",new a('"'+Array.from(f).join(", ")+'" not found in any language',f)),d}function r(a,b){if("string"==typeof a)return b(a);var c=Object.create(null);if(a.value&&(c.value=s(a.value,b)),a.index&&(c.index=a.index),a.attrs){c.attrs=Object.create(null);for(var d in a.attrs)c.attrs[d]=r(a.attrs[d],b)}return c}function s(a,b){if("string"==typeof a)return b(a);if(a.type)return a;for(var c=Array.isArray(a)?[]:Object.create(null),d=Object.keys(a),e=0,f=void 0;f=d[e];e++)c[f]=s(a[f],b);return c}function t(a,b){var c=null;return function(){if(c)return c;var d=/[a-zA-Z]/g,e=/[aeiouAEIOU]/g,f=/[^\W0-9_]+/g,g=/(%[EO]?\w|\{\s*.+?\s*\}|&[#\w]+;|<\s*.+?\s*>)/,h={"fr-x-psaccent":"ȦƁƇḒḖƑƓĦĪĴĶĿḾȠǾƤɊŘŞŦŬṼẆẊẎẐ[\\]^_`ȧƀƈḓḗƒɠħīĵķŀḿƞǿƥɋřşŧŭṽẇẋẏẑ","ar-x-psbidi":"∀ԐↃpƎɟפHIſӼ˥WNOԀÒᴚS⊥∩ɅMXʎZ[\\]ᵥ_,ɐqɔpǝɟƃɥıɾʞʅɯuodbɹsʇnʌʍxʎz"},i={"fr-x-psaccent":function(a){return a.replace(e,function(a){return a+a.toLowerCase()})},"ar-x-psbidi":function(a){return a.replace(f,function(a){return"‮"+a+"‬"})}},j=65,k=function(a,b){return b.replace(d,function(b){return a.charAt(b.charCodeAt(0)-j)})},l=function(b){return k(h[a],i[a](b))},m=function(a,b){if(!b)return b;var c=b.split(g),d=c.map(function(b){return g.test(b)?b:a(b)});return d.join("")};return c={name:l(b),process:function(a){return m(l,a)}}}}function u(a,b){return b.lang=a,b}function v(a,b,c){for(var d=void 0,e=0;eb[d]))return"extra"}return d in wa&&!(d in b)?"pseudo":"app"}function A(){return"loading"!==document.readyState?Promise.resolve():new Promise(function(a){document.addEventListener("readystatechange",function b(){document.removeEventListener("readystatechange",b),a()})})}function B(a){var b=a.split("-")[0];return["ar","he","fa","ps","ur"].indexOf(b)>=0?"rtl":"ltr"}function C(a){return Array.prototype.map.call(a.querySelectorAll('link[rel="localization"]'),function(a){return a.getAttribute("href")})}function D(a){for(var b=Object.create(null),c=null,d=null,e=Array.from(a.querySelectorAll('meta[name="availableLanguages"],meta[name="defaultLanguage"],meta[name="appVersion"]')),f=e,g=Array.isArray(f),h=0,f=g?f:f[Symbol.iterator]();;){var i;if(g){if(h>=f.length)break;i=f[h++]}else{if(h=f.next(),h.done)break;i=h.value}var j=i,k=j.getAttribute("name"),l=j.getAttribute("content").trim();switch(k){case"availableLanguages":b=E(b,l);break;case"defaultLanguage":var m=F(l),n=m[0],o=m[1];c=n,n in b||(b[n]=o);break;case"appVersion":d=l}}return{defaultLang:c,availableLangs:b,appVersion:d}}function E(a,b){return b.split(",").reduce(function(a,b){var c=F(b),d=c[0],e=c[1];return a[d]=e,a},a)}function F(a){var b=a.trim().split(":"),c=b[0],d=b[1];return[c,parseInt(d)]}function G(a,b){var c=b.value;if("string"==typeof c)if(za.test(c)){var d=a.ownerDocument.createElement("template");d.innerHTML=c,H(a,d.content)}else a.textContent=c;for(var e in b.attrs){var f=M(e);J({name:f},a)&&a.setAttribute(f,b.attrs[e])}}function H(a,b){for(var c=b.ownerDocument.createDocumentFragment(),d=void 0,e=void 0,f=void 0;f=b.childNodes[0];)if(b.removeChild(f),f.nodeType!==f.TEXT_NODE){var g=L(f),h=K(a,f,g);if(h)H(h,f),c.appendChild(h);else if(I(f)){var i=f.ownerDocument.createElement(f.nodeName);H(i,f),c.appendChild(i)}else c.appendChild(b.ownerDocument.createTextNode(f.textContent))}else c.appendChild(f);if(a.textContent="",a.appendChild(c),b.attributes)for(d=0,e;e=b.attributes[d];d++)J(e,a)&&a.setAttribute(e.name,e.value)}function I(a){return-1!==Aa.elements.indexOf(a.tagName.toLowerCase())}function J(a,b){var c=a.name.toLowerCase(),d=b.tagName.toLowerCase();if(-1!==Aa.attributes.global.indexOf(c))return!0;if(!Aa.attributes[d])return!1;if(-1!==Aa.attributes[d].indexOf(c))return!0;if("input"===d&&"value"===c){var e=b.type.toLowerCase();if("submit"===e||"button"===e||"reset"===e)return!0}return!1}function K(a,b,c){for(var d=0,e=0,f=void 0;f=a.children[e];e++)if(f.nodeType===f.ELEMENT_NODE&&f.tagName===b.tagName){if(d===c)return f;d++}return null}function L(a){for(var b=0,c=void 0;c=a.previousElementSibling;)c.tagName===a.tagName&&b++;return b}function M(a){return"ariaValueText"===a?"aria-valuetext":a.replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()}).replace(/^-/,"")}function N(a,b,c){a.setAttribute("data-l10n-id",b),c&&a.setAttribute("data-l10n-args",JSON.stringify(c))}function O(a){return{id:a.getAttribute("data-l10n-id"),args:JSON.parse(a.getAttribute("data-l10n-args"))}}function P(a){var b=Array.from(a.querySelectorAll("[data-l10n-id]"));return"function"==typeof a.hasAttribute&&a.hasAttribute("data-l10n-id")&&b.push(a),b}function Q(a,b){for(var c=new Set,d=b,e=Array.isArray(d),f=0,d=e?d:d[Symbol.iterator]();;){var g;if(e){if(f>=d.length)break;g=d[f++]}else{if(f=d.next(),f.done)break;g=f.value}var h=g;switch(h.type){case"attributes":c.add(h.target);break;case"childList":for(var i=h.addedNodes,j=Array.isArray(i),k=0,i=j?i:i[Symbol.iterator]();;){var l;if(j){if(k>=i.length)break;l=i[k++]}else{if(k=i.next(),k.done)break;l=k.value}var m=l;m.nodeType===m.ELEMENT_NODE&&(m.childElementCount?P(m).forEach(c.add.bind(c)):m.hasAttribute("data-l10n-id")&&c.add(m))}}}0!==c.size&&T(a,Array.from(c))}function R(a,b){return T(a,P(b))}function S(a,b){var c=b.map(function(a){var b=a.getAttribute("data-l10n-id"),c=a.getAttribute("data-l10n-args");return c?[b,JSON.parse(c.replace(Ba,function(a){return Ca[a]}))]:b});return a.formatEntities.apply(a,c)}function T(a,b){return S(a,b).then(function(c){return U(a,b,c)})}function U(a,b,c){Y(a,null,!0);for(var d=0;dd;d++)b[d]=arguments[d];return e.apply(void 0,[c].concat(b))},this.emit=function(){for(var a=arguments.length,b=Array(a),e=0;a>e;e++)b[e]=arguments[e];return d.apply(void 0,[c].concat(b))}}return a.prototype.method=function(a){for(var b,c=arguments.length,d=Array(c>1?c-1:0),e=1;c>e;e++)d[e-1]=arguments[e];return(b=this.remote)[a].apply(b,d)},a}(),ja=["plural"],ka=2500,la="⁨",ma="⁩",na=new WeakSet,oa={af:3,ak:4,am:4,ar:1,asa:3,az:0,be:11,bem:3,bez:3,bg:3,bh:4,bm:0,bn:3,bo:0,br:20,brx:3,bs:11,ca:3,cgg:3,chr:3,cs:12,cy:17,da:3,de:3,dv:3,dz:0,ee:3,el:3,en:3,eo:3,es:3,et:3,eu:3,fa:0,ff:5,fi:3,fil:4,fo:3,fr:5,fur:3,fy:3,ga:8,gd:24,gl:3,gsw:3,gu:3,guw:4,gv:23,ha:3,haw:3,he:2,hi:4,hr:11,hu:0,id:0,ig:0,ii:0,is:3,it:3,iu:7,ja:0,jmc:3,jv:0,ka:0,kab:5,kaj:3,kcg:3,kde:0,kea:0,kk:3,kl:3,km:0,kn:0,ko:0,ksb:3,ksh:21,ku:3,kw:7,lag:18,lb:3,lg:3,ln:4,lo:0,lt:10,lv:6,mas:3,mg:4,mk:16,ml:3,mn:3,mo:9,mr:3,ms:0,mt:15,my:0,nah:3,naq:7,nb:3,nd:3,ne:3,nl:3,nn:3,no:3,nr:3,nso:4,ny:3,nyn:3,om:3,or:3,pa:3,pap:3,pl:13,ps:3,pt:3,rm:3,ro:9,rof:3,ru:11,rwk:3,sah:0,saq:3,se:7,seh:3,ses:0,sg:0,sh:11,shi:19,sk:12,sl:14,sma:7,smi:7,smj:7,smn:7,sms:7,sn:3,so:3,sq:3,sr:11,ss:3,ssy:3,st:3,sv:3,sw:3,syr:3,ta:3,te:3,teo:3,th:0,ti:4,tig:3,tk:3,tl:4,tn:3,to:0,tr:0,ts:3,tzm:22,uk:11,ur:3,ve:3,vi:0,vun:3,wa:4,wae:3,wo:0,xh:3,xog:3,yo:0,zh:0,zu:3},pa={0:function(){return"other"},1:function(a){return o(a%100,3,10)?"few":0===a?"zero":o(a%100,11,99)?"many":2===a?"two":1===a?"one":"other"},2:function(a){return 0!==a&&a%10===0?"many":2===a?"two":1===a?"one":"other"},3:function(a){return 1===a?"one":"other"},4:function(a){return o(a,0,1)?"one":"other"},5:function(a){return o(a,0,2)&&2!==a?"one":"other"},6:function(a){return 0===a?"zero":a%10===1&&a%100!==11?"one":"other"},7:function(a){return 2===a?"two":1===a?"one":"other"},8:function(a){return o(a,3,6)?"few":o(a,7,10)?"many":2===a?"two":1===a?"one":"other"},9:function(a){return 0===a||1!==a&&o(a%100,1,19)?"few":1===a?"one":"other"},10:function(a){return o(a%10,2,9)&&!o(a%100,11,19)?"few":a%10!==1||o(a%100,11,19)?"other":"one"},11:function(a){return o(a%10,2,4)&&!o(a%100,12,14)?"few":a%10===0||o(a%10,5,9)||o(a%100,11,14)?"many":a%10===1&&a%100!==11?"one":"other"},12:function(a){return o(a,2,4)?"few":1===a?"one":"other"},13:function(a){return o(a%10,2,4)&&!o(a%100,12,14)?"few":1!==a&&o(a%10,0,1)||o(a%10,5,9)||o(a%100,12,14)?"many":1===a?"one":"other"},14:function(a){return o(a%100,3,4)?"few":a%100===2?"two":a%100===1?"one":"other"},15:function(a){return 0===a||o(a%100,2,10)?"few":o(a%100,11,19)?"many":1===a?"one":"other"},16:function(a){return a%10===1&&11!==a?"one":"other"},17:function(a){return 3===a?"few":0===a?"zero":6===a?"many":2===a?"two":1===a?"one":"other"},18:function(a){return 0===a?"zero":o(a,0,2)&&0!==a&&2!==a?"one":"other"},19:function(a){return o(a,2,10)?"few":o(a,0,1)?"one":"other"},20:function(a){return!o(a%10,3,4)&&a%10!==9||o(a%100,10,19)||o(a%100,70,79)||o(a%100,90,99)?a%1e6===0&&0!==a?"many":a%10!==2||n(a%100,[12,72,92])?a%10!==1||n(a%100,[11,71,91])?"other":"one":"two":"few"},21:function(a){return 0===a?"zero":1===a?"one":"other"},22:function(a){return o(a,0,1)||o(a,11,99)?"one":"other"},23:function(a){return o(a%10,1,2)||a%20===0?"one":"other"},24:function(a){return o(a,3,10)||o(a,13,19)?"few":n(a,[2,12])?"two":n(a,[1,11])?"one":"other"}},qa="undefined"!=typeof Intl?Intl:{NumberFormat:function(){return{format:function(a){return a}}}},ra=function(){function b(a,c,d){var e=this;_classCallCheck(this,b),this.langs=c,this.resIds=d,this.env=a,this.emit=function(b,c){return a.emit(b,c,e)}}return b.prototype._formatTuple=function(a,b,c,d,e){try{return h(this,a,b,c)}catch(f){return f.id=e?d+"::"+e:d,f.lang=a,this.emit("resolveerror",f),[{error:f},f.id]}},b.prototype._formatEntity=function(a,b,c,d){var e=this._formatTuple(a,b,c,d),f=e[1],g={value:f,attrs:null};if(c.attrs){g.attrs=Object.create(null);for(var h in c.attrs){var i=this._formatTuple(a,b,c.attrs[h],d,h),j=i[1];g.attrs[h]=j}}return g},b.prototype._formatValue=function(a,b,c,d){return this._formatTuple(a,b,c,d)[1]},b.prototype.fetch=function(){var a=this,b=arguments.length<=0||void 0===arguments[0]?this.langs:arguments[0];return 0===b.length?Promise.resolve(b):Promise.all(this.resIds.map(function(c){return a.env._getResource(b[0],c)})).then(function(){return b})},b.prototype._resolve=function(b,c,d,e){var f=this,g=b[0];if(!g)return q.call(this,c,d,e);var h=!1,i=c.map(function(b,c){if(e&&void 0!==e[c])return e[c];var i=Array.isArray(b)?b:[b,void 0],j=i[0],k=i[1],l=f._getEntity(g,j);return l?d.call(f,g,k,l,j):(f.emit("notfounderror",new a('"'+j+'" not found in '+g.code,j,g)),void(h=!0))});return h?this.fetch(b.slice(1)).then(function(a){return f._resolve(a,c,d,i)}):i},b.prototype.formatEntities=function(){for(var a=this,b=arguments.length,c=Array(b),d=0;b>d;d++)c[d]=arguments[d];return this.fetch().then(function(b){return a._resolve(b,c,a._formatEntity)})},b.prototype.formatValues=function(){for(var a=this,b=arguments.length,c=Array(b),d=0;b>d;d++)c[d]=arguments[d];return this.fetch().then(function(b){return a._resolve(b,c,a._formatValue)})},b.prototype._getEntity=function(b,c){for(var d=this.env.resCache,e=0,f=void 0;f=this.resIds[e];e++){var g=d.get(f+b.code+b.src);if(!(g instanceof a)&&c in g)return g[c]}return void 0},b.prototype._getNumberFormatter=function(a){if(this.env.numberFormatters||(this.env.numberFormatters=new Map),!this.env.numberFormatters.has(a)){var b=qa.NumberFormat(a);return this.env.numberFormatters.set(a,b),b}return this.env.numberFormatters.get(a)},b.prototype._getMacro=function(a,b){switch(b){case"plural":return p(a.code);default:return void 0}},b}(),sa=100,ta={patterns:null,entryIds:null,emit:null,init:function(){this.patterns={comment:/^\s*#|^\s*$/,entity:/^([^=\s]+)\s*=\s*(.*)$/,multiline:/[^\\]\\$/,index:/\{\[\s*(\w+)(?:\(([^\)]*)\))?\s*\]\}/i,unicode:/\\u([0-9a-fA-F]{1,4})/g,entries:/[^\r\n]+/g,controlChars:/\\([\\\n\r\t\b\f\{\}\"\'])/g,placeables:/\{\{\s*([^\s]*?)\s*\}\}/}},parse:function(a,b){this.patterns||this.init(),this.emit=a;var c={},d=b.match(this.patterns.entries);if(!d)return c;for(var e=0;e2)throw this.error('Error in ID: "'+d+'". Nested attributes are not supported.');var h=void 0;if(g.length>1){if(d=g[0],h=g[1],"$"===h[0])throw this.error('Attribute can\'t start with "$"')}else h=null;this.setEntityValue(d,h,e,this.unescapeString(b),c)},setEntityValue:function(a,b,c,d,e){var f=d.indexOf("{{")>-1?this.parseString(d):d,g="string"==typeof f,h=e,i="string"==typeof e[a];if(e[a]||!b&&!c&&g||(e[a]=Object.create(null),i=!1),b){if(i){var j=e[a];e[a]=Object.create(null),e[a].value=j}e[a].attrs||(e[a].attrs=Object.create(null)),e[a].attrs||g||(e[a].attrs[b]=Object.create(null)),h=e[a].attrs,a=b}if(c){if(i=!1,"string"==typeof h[a]){var j=h[a];h[a]=Object.create(null),h[a].index=this.parseIndex(j),h[a].value=Object.create(null)}h=h[a].value,a=c,g=!0}if(g){if(a in h)throw this.error("Duplicated id: "+a);h[a]=f}else h[a]||(h[a]=Object.create(null)),h[a].value=f},parseString:function(a){var b=a.split(this.patterns.placeables),c=[],d=b.length,e=(d-1)/2;if(e>=sa)throw this.error("Too many placeables ("+e+", max allowed is "+sa+")");for(var f=0;f"===c)throw this.error('Expected ">"');f=this.getAttributes()}else{var g=this.getRequiredWS();if(">"!==this._source[this._index]){if(!g)throw this.error('Expected ">"');f=this.getAttributes()}}if(++this._index,a in this.entries)throw this.error('Duplicate entry ID "'+a,"duplicateerror");f||b||"string"!=typeof e?this.entries[a]={value:e,attrs:f,index:b}:this.entries[a]=e},getValue:function(){var a=arguments.length<=0||void 0===arguments[0]?this._source[this._index]:arguments[0],b=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],c=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];switch(a){case"'":case'"':return this.getString(a,1);case"{":return this.getHash(b)}if(c)throw this.error("Unknown value type");return void 0},getWS:function(){for(var a=this._source.charCodeAt(this._index);32===a||10===a||9===a||13===a;)a=this._source.charCodeAt(++this._index)},getRequiredWS:function(){for(var a=this._index,b=this._source.charCodeAt(a);32===b||10===b||9===b||13===b;)b=this._source.charCodeAt(++this._index);return this._index!==a},getIdentifier:function(){var a=this._index,b=this._source.charCodeAt(this._index);if(!(b>=97&&122>=b||b>=65&&90>=b||95===b))throw this.error("Identifier has to start with [a-zA-Z_]");for(b=this._source.charCodeAt(++this._index);b>=97&&122>=b||b>=65&&90>=b||b>=48&&57>=b||95===b;)b=this._source.charCodeAt(++this._index);return this._source.slice(a,this._index)},getUnicodeChar:function(){for(var a=0;4>a;a++){var b=this._source.charCodeAt(++this._index);if(!(b>96&&103>b||b>64&&71>b||b>47&&58>b))throw this.error("Illegal unicode escape sequence")}return this._index++,String.fromCharCode(parseInt(this._source.slice(this._index-4,this._index),16))},stringRe:/"|'|{{|\\/g,getString:function(a,b){var c=[],d=0;this._index+=b;for(var e=this._index,f=e,g="";;){this.stringRe.lastIndex=this._index;var h=this.stringRe.exec(this._source);if(!h)throw this.error("Unclosed string literal");if('"'===h[0]||"'"===h[0]){if(h[0]!==a){this._index+=b;continue}this._index=h.index+b;break}if("{{"!==h[0]){if("\\"===h[0]){this._index=h.index+1;var i=this._source[this._index];if("u"===i)g+=this._source.slice(f,h.index)+this.getUnicodeChar();else if(i===a||"\\"===i)g+=this._source.slice(f,h.index)+i,this._index++;else{if(!this._source.startsWith("{{",this._index))throw this.error("Illegal escape sequence");g+=this._source.slice(f,h.index)+"{{",this._index+=2}f=this._index}}else{if(d>ua-1)throw this.error("Too many placeables, maximum allowed is "+ua);d++,(h.index>f||g.length>0)&&(c.push(g+this._source.slice(f,h.index)),g=""),this._index=h.index+2,this.getWS(),c.push(this.getExpression()),this.getWS(),this._index+=2,f=this._index}}return 0===c.length?g+this._source.slice(f,this._index-b):((this._index-b>f||g.length>0)&&c.push(g+this._source.slice(f,this._index-b)),c)},getAttributes:function(){for(var a=Object.create(null);;){this.getAttribute(a);var b=this.getRequiredWS(),c=this._source.charAt(this._index);if(">"===c)break;if(!b)throw this.error('Expected ">"')}return a},getAttribute:function(a){var b=this.getIdentifier(),c=void 0;if("["===this._source[this._index]&&(++this._index,this.getWS(),c=this.getItemList(this.getExpression,"]")),this.getWS(),":"!==this._source[this._index])throw this.error('Expected ":"');++this._index,this.getWS();var d=void 0!==c,e=this.getValue(void 0,d);if(b in a)throw this.error('Duplicate attribute "'+b,"duplicateerror");c||"string"!=typeof e?a[b]={value:e,index:c}:a[b]=e},getHash:function(a){var b=Object.create(null);++this._index,this.getWS();for(var c=void 0;;){var d=this.getHashItem(),e=d[0],f=d[1],g=d[2];if(b[e]=f,g){if(c)throw this.error("Default item redefinition forbidden");c=e}this.getWS();var h=","===this._source[this._index];if(h&&(++this._index,this.getWS()),"}"===this._source[this._index]){++this._index;break}if(!h)throw this.error('Expected "}"')}if(c)b.__default=c;else if(!a)throw this.error("Unresolvable Hash Value");return b},getHashItem:function(){var a=!1;"*"===this._source[this._index]&&(++this._index,a=!0);var b=this.getIdentifier();if(this.getWS(),":"!==this._source[this._index])throw this.error('Expected ":"');return++this._index,this.getWS(),[b,this.getValue(),a]},getComment:function(){this._index+=2;var a=this._index,b=this._source.indexOf("*/",a);if(-1===b)throw this.error("Comment without a closing tag");this._index=b+2},getExpression:function(){for(var a=this.getPrimaryExpression();;){var b=this._source[this._index];if("."===b||"["===b)++this._index,a=this.getPropertyExpression(a,"["===b);else{if("("!==b)break;++this._index,a=this.getCallExpression(a)}}return a},getPropertyExpression:function(a,b){var c=void 0;if(b){if(this.getWS(),c=this.getExpression(),this.getWS(),"]"!==this._source[this._index])throw this.error('Expected "]"');++this._index}else c=this.getIdentifier();return{type:"prop",expr:a,prop:c,cmpt:b}},getCallExpression:function(a){return this.getWS(),{type:"call",expr:a,args:this.getItemList(this.getExpression,")")}},getPrimaryExpression:function(){var a=this._source[this._index];switch(a){case"$":return++this._index,{type:"var",name:this.getIdentifier()};case"@":return++this._index,{type:"glob",name:this.getIdentifier()};default:return{type:"id",name:this.getIdentifier()}}},getItemList:function(a,b){var c=[],d=!1;for(this.getWS(),this._source[this._index]===b&&(++this._index,d=!0);!d;){c.push(a.call(this)),this.getWS();var e=this._source.charAt(this._index);switch(e){case",":++this._index,this.getWS();break;case b:++this._index,d=!0;break;default:throw this.error('Expected "," or "'+b+'"')}}return c},getJunkEntry:function(){var a=this._index,b=this._source.indexOf("<",a),c=this._source.indexOf("/*",a);-1===b&&(b=this._length),-1===c&&(c=this._length);var d=Math.min(b,c);this._index=d},error:function(b){var c=arguments.length<=1||void 0===arguments[1]?"parsererror":arguments[1],d=this._index,e=this._source.lastIndexOf("<",d-1),f=this._source.lastIndexOf(">",d-1);e=f>e?f+1:e;var g=this._source.slice(e,d+10),h=b+" at pos "+d+": `"+g+"`",i=new a(h);return this.emit&&this.emit(c,i),i}},wa=Object.defineProperties(Object.create(null),{"fr-x-psaccent":{enumerable:!0,get:t("fr-x-psaccent","Runtime Accented")},"ar-x-psbidi":{enumerable:!0,get:t("ar-x-psbidi","Runtime Bidi")}}),xa=function(){function a(b){_classCallCheck(this,a),this.fetchResource=b,this.resCache=new Map,this.resRefs=new Map,this.numberFormatters=null,this.parsers={properties:ta,l20n:va};var c={};this.emit=d.bind(this,c),this.addEventListener=e.bind(this,c),this.removeEventListener=f.bind(this,c)}return a.prototype.createContext=function(a,b){var c=this,d=new ra(this,a,b);return b.forEach(function(a){var b=c.resRefs.get(a)||0;c.resRefs.set(a,b+1)}),d},a.prototype.destroyContext=function(a){var b=this;a.resIds.forEach(function(a){var c=b.resRefs.get(a)||0;return c>1?b.resRefs.set(a,c-1):(b.resRefs.delete(a),void b.resCache.forEach(function(c,d){return d.startsWith(a)?b.resCache.delete(d):null}))})},a.prototype._parse=function(a,b,c){var d=this,e=this.parsers[a];if(!e)return c;var f=function(a,c){return d.emit(a,u(b,c))};return e.parse(f,c)},a.prototype._create=function(a,b){if("pseudo"!==a.src)return b;var c=Object.create(null);for(var d in b)c[d]=r(b[d],wa[a.code].process);return c},a.prototype._getResource=function(a,b){var c=this,d=this.resCache,e=b+a.code+a.src;if(d.has(e))return d.get(e);var f=b.substr(b.lastIndexOf(".")+1),g=function(b){var g=c._parse(f,a,b);d.set(e,c._create(a,g))},h=function(b){b.lang=a,c.emit("fetcherror",b),d.set(e,b)},i="pseudo"===a.src?{code:"en-US",src:"app",ver:a.ver}:a,j=this.fetchResource(b,i).then(g,h);return d.set(e,j),j},a}(),ya=function(){function a(b,c){_classCallCheck(this,a),this.broadcast=c,this.env=new xa(b),this.ctxs=new Map}return a.prototype.registerView=function(a,b,c,d,e){var f=w(c,d,[],e),g=f.langs;return this.ctxs.set(a,this.env.createContext(g,b)),g},a.prototype.unregisterView=function(a){return this.ctxs.delete(a),!0},a.prototype.formatEntities=function(a,b){var c;return(c=this.ctxs.get(a)).formatEntities.apply(c,b)},a.prototype.formatValues=function(a,b){var c;return(c=this.ctxs.get(a)).formatValues.apply(c,b)},a.prototype.changeLanguages=function(a,b,c,d){var e=this.ctxs.get(a),f=e.langs,g=w(b,c,f,d);return this.ctxs.set(a,this.env.createContext(g.langs,e.resIds)),g},a.prototype.requestLanguages=function(a){this.broadcast("languageschangerequest",a)},a.prototype.getName=function(a){return wa[a].name},a.prototype.processString=function(a,b){return wa[a].process(b)},a}();"function"!=typeof NodeList||NodeList.prototype[Symbol.iterator]||(NodeList.prototype[Symbol.iterator]=Array.prototype[Symbol.iterator]),void 0===navigator.languages&&(navigator.languages=[navigator.language]);var za=/<|&#?\w+;/,Aa={elements:["a","em","strong","small","s","cite","q","dfn","abbr","data","time","code","var","samp","kbd","sub","sup","i","b","u","mark","ruby","rt","rp","bdi","bdo","span","br","wbr"],attributes:{global:["title","aria-label","aria-valuetext","aria-moz-hint"],a:["download"],area:["download","alt"],input:["alt","placeholder"],menuitem:["label"],menu:["label"],optgroup:["label"],option:["label"],track:["label"],img:["alt"],textarea:["placeholder"],th:["abbr"]}},Ba=/[&<>]/g,Ca={"&":"&","<":"<",">":">"},Da={attributes:!0,characterData:!1,childList:!0,subtree:!0,attributeFilter:["data-l10n-id","data-l10n-args"]},Ea=new WeakMap,Fa=new WeakMap,Ga=function(){function a(b,c){var d=this;_classCallCheck(this,a),this.pseudo={"fr-x-psaccent":$(this,"fr-x-psaccent"),"ar-x-psbidi":$(this,"ar-x-psbidi")};var e=A().then(function(){return _(d,b)});this._interactive=e.then(function(){return b}),this.ready=e.then(function(a){return ca(d,a)}),V(this),Fa.set(this,{doc:c,ready:!1}),b.on("languageschangerequest",function(a){return d.requestLanguages(a)})}return a.prototype.requestLanguages=function(a,b){var c=this,d=b?function(b){return b.method("requestLanguages",a)}:function(b){return aa(c,b,a)};return this._interactive.then(d)},a.prototype.handleEvent=function(){return this.requestLanguages(navigator.languages)},a.prototype.formatEntities=function(){for(var a=arguments.length,b=Array(a),c=0;a>c;c++)b[c]=arguments[c];return this._interactive.then(function(a){return a.method("formatEntities",a.id,b)})},a.prototype.formatValue=function(a,b){return this._interactive.then(function(c){return c.method("formatValues",c.id,[[a,b]])}).then(function(a){return a[0]})},a.prototype.formatValues=function(){for(var a=arguments.length,b=Array(a),c=0;a>c;c++)b[c]=arguments[c];return this._interactive.then(function(a){return a.method("formatValues",a.id,b)})},a.prototype.translateFragment=function(a){return R(this,a)},a.prototype.observeRoot=function(a){X(this,a)},a.prototype.disconnectRoot=function(a){Y(this,a)},a}();Ga.prototype.setAttributes=N,Ga.prototype.getAttributes=O;var Ha=new ya(c,g),Ia=new ia(Ha);document.l10n=new Ga(Ia,document),window.addEventListener("languagechange",document.l10n),document.addEventListener("additionallanguageschange",document.l10n); +}(); diff --git a/app/extensions/ipfs/img/favicon.ico b/app/extensions/ipfs/img/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..c0f392f2680f77c6ad6df0893380e2e6520720a6 GIT binary patch literal 370070 zcmeFa36Nw-THl!&kyo5q-PJtDns<+?I{e2NH zBI9_G8If^$T17>~i}&2W>+kO0=byWGbaZy~bnw^N@wSe)zpbm|XXW$3gZ}rv&W;br zweS62|NB4d=va7rcgH{chxYsMH*|Eo_Ve8xZ+n~neP2h%Z~b0($3A(dyr1jp==iq7 z-5qb2GUY-?N5o#|Ye$Ft=>FPL0%uS6MmE-yQJD80e_ik8i#_k0nM(W}FFtdP-?)c+ z`Rx9j1e^q#TLM=vbw{QrW6_^`$3A+4jw=^Czi(|hadB)U%_V`CZbUn`HoBv$OT7m7_wRPSeRI8gY-%Fm9X*`%4j)QAI(j(un3w&W z^!SZ?xEF4DmNF=-xwv=KItjF|1lE@OA`7!AGuHp~Cp-Gjp6dOrxtYZ02aZ|XA31EW zFYQ1o^Wqxq0QYb&&+sf#q%6v8Ux_--odgB5zRYKQf`>dy8I(ntluaGfMV)+ie@+5U0`-%?@?u}~ zV;@eMKKb=~>A%0ZmiVan@n1T2B#n;`?(y@(;y(XAe1eCRMVXXM9dJvX)LlQ$UCmAc z?JI$kn~BKkijB{I_7ffPGpD=WC4T##4-FXHgL%R2j&Yx92mCU`CrCY_Z0evc>O}g` z04?pS3CFpUz}`vV@`c{W?6jT7r`9W%`hIkIF@AewIOQFFA>-p$GS<&vz05el#1E*0 zx~P-7m2+rY?O zuTC2yoE6GWqy(O@=+83Ri>N0)npS<3)|Mbb8-l2ZDEt^W zW|N;B9`xt&L(J!u8Pn%uy5jG4zA*I&nxG9DJuhJr+@T#Fb|(e*w39%4N#Npz-p;w1 z?yhIw^Q0L^OMd<{D@*YUHfJ|8)~|(+Uormu_9Zi42#wGR&1elC;02!AON)+MCxOZ( zu)dOro;=ZSu=48t*w=2XC5ETQlY;e3&Tdg3-^S{bii2du>fwCwQ8p@PwatOH( znxP#YkODlxTjdgQPdEv*z62!iUSfMa1|NU&pgX;_+4XBPQ}H(jk7efZi{|cuNnS5} zT;}_Z?DGbX?UT=G)0daQYsvmzpQS9yq-^TY`m}v0@XmbULuiKwc!4Lh2#@gE`Wkf{ zIti4Qz?oD1k@a;ue@>q5#dEQLH9woWcYMg^?%`h-z*h#hU{T_5<~1{w@~&QvdpEDg zz15Y3H(+ysGWV7$r_gVLVN(WWQ6^73-zPWMF*zYsBF{p(jdzk6k=cOx%nx8zt~ux0vro;i0W=H0v7<=uZJD(_Kw z@A7WE*e7^>5*$|C27vwP$tO%1lx54L>@HImbuuoX>@w|unJ=Ur;2C&?S2POm$N*Wi zo`xMqP6CA`AQ*@qef}xa_dU4(r^kEs zUetT#<*v-@?wv00^;aX_m5Xt~sPzSk_0xr}^UURoF)1VJQC6^Q>Y`5ShK7*7hG_?& zA70@Z-jNWpKqiHy<*qsjw1xy$m--@$vv$n;se8S#Q(Ha1JU5g4YcNE9t@M#a$NJ#L zZy!uwzBr%qUb^0!!F@hP!7Kf?#Nmtd{lxN~FfZbD+uHz(f5sC*?DJXcq8)$+XyJLr z3`*zr^6WkE2(R!A@5lgIpkZW#j9Nq6jteIND}hs|dLrYac3m!4E?tcL@X~zp*2s{F z?diJQqVstM_cG2tEPejeL`pCn7i@Q%F}Y%~5Jt=4f8gj-93@(0-H;GDD@Z_APZ!o_JXXCnSOWgP6Ev+fpcf#olEnn==6Bf__voX^nAwymIfAks} zp*4(80PivukTFmCF)~3m$Ov5{Gh~Mhn^E_U=JuAr%5qP1_;||nVRv5c-oJ4o_JPUq zgyig+KA*T=(b%4jox#xH(Uf;$E#cj{sXl)3{x~=W0F!%xf34HDMN!iZKr1vuyS4+$ zQ;~O*H-K!A5wb#NSP(KqmhEj#j{9bjz{XlCvM_Jg=Y94sdU{T6#(#cxI{v3a1L1OZ z)yF6PhF^W-TAyHw_+`M)eLCa$qombouKwpY@}mwQZqIWd;@ zE?tP3{+sxl?OStW@QSx$@AbmJ(qrql^N{cYPmBfNQT>`CZGn*$GPCQ96W5R>)`V=4 zF|uwi>vG&SsswIck9DrDMx%=}`wi}ITuFb!%0g;*VvL+!6B8$oX@jFC0gh3wHm>sy-Ru#qINwULzd?RM`i z$!G08d%EW*=VnrWGCaiEo6H_O#-}aRw}E^7Ve)9_X42lZD?9V?6<>wk8wvkPA2exf z0G{F9<`S133*a|ME^+!XGDg|#!r@)VxwB`jf{VIglAqhHqdQkf^3ixVTNHs{??Gd(n2CKKWB4xUw=KG+BnhoE7H&W)!;EReh-zi`+|)1 zCC7z5GbLYE=kaZ9tXg=_FQ?J*uk=DEpKUI2kC73wLT0o9rP={}0@?v|flkm3I>PeM z8Mx@5}Tfr?$F&SoXet<+$5dXWw70J1`6A!7rX`9gGqj?k6b3pzxX`rW-d36zq+>8;+**_rO>#CVq( z>z_Z}`|S&Jsin~oStBEPEc7{yKZ}e@O@DnktFe~w+!_TKpU-8P_?zgV3#Q#9@ zR{WgZ();Y{IMw?2DR1*c%zOE^j`jDZ&)2?Gv9y=@zrnh9``NaUb}WDlk)>T{96B~2 z`w~lRKy-%=(Iu9RZqadjTe;&tUjnlJOzgt0KfiycyKiH?>)*>hH-Bc%(s?1=y48(*nn9#6+Si~x50&J1Ac74o@b11(J@wz&e1(K&|X&WxV><8f9Jw%IyydS=kYI|jlX?iE%p=*8!0fGpj?pzb z2MO2!wt!7IWVF5n=0(>d$L%?F*Kc$_abmUmKTnROKaamCal4T7`0R(9^43>VvM$%o zNW6?Rf#|E%^Yy#V8eFU^8hwH0d zk%c*%7xMVcukPA9@x)KdobjiI2I9eUGYjVIVpF^r>mQN6W^q0#`(hH?V-KF%&f}}y zSNh(n_*Xf=pY;j4jV{m$x3 zaBuW|@B2#Y<8LJYr}>%KnbF~X=JP68mz$EkDRf;f>st3drmwai=DpSNuQITFT79t2 z7#)S2FSNQB8^9K@iA}K$5P+>Jk z$5)vjVsBY#*Xi#|&g08HCWg#DRTt0iZtpF%!+O5AGyYZXRt9ztGIUz$9%R@KHiRu< zQ&>AThOJ?9jbZ)mO~w3dPjqg^#%u51ihb46eE)ND&eWF&WbauY_a$@n>Gv5Q4iBbf ze=1#-tCvf$M@q$*h{nFJ)d5O z|6CoaPSG*CM(0Nlhl>r+kBDC=v4OOliJ15cYz>>k`msT5v3^KsubS7Fdm~2=KN0=$ zpXe~-uZ{KY|9xsQbz^ui{64$t<4;fadsi>Td>_BD=kxOMUGBTXe=h!2UdY9+Gww3F z#|A20XN;|3bJ!l}!xphgY_q-4xOd#Huf{sZM|+|ZV|GsV^j7D$Nj~@d=<&FT?S>ia zTOXgC-L$_hx4Yrz@zriCeRudTjDMA*l@GbZ-NqKM348)wu{s7m_*php&J!}wL z1PRzCHj1t89Wq+KCK+=@4}ILmT`!)E?3k$S@CodB$>rODwB!;eWe>9C7qLlf6EtG0*lg<~ zv$h?DxD#8%Cb3Oy6kEk+v0ZGK&+ae01lCr2BEtj8=&%2p zU7vSiHTHe7Z^I>Wx+_YGzCBN)(Q|gy9;@;0@E;!kDsL+@J07@tsn^&JHWb1q z@aLFWXPox1RcscE$A+^0{!aE4?rm`;CdQ#NYVqa>?HbnX{Yr)>g>b?US5c z;ydc+?aUtPiQ(PU?eM=leIq~Qj}2i<*c7%{K`ybs2U+58uw`r-1YqOXdTBJY&#$x7 zeG!SDn6Z)f<)4kp9@+m&{HWL2@2y{OSNwf|JBF8${X48*~SJq z&zQJiC9whW2H2lG_Bk*B7QjB(03)r|4lFNrOFqO?8NQYm5@ekp9ff85DRoHjnLt0k8lj6!%~S%;@)K zeV?9AbPf(AqR)N!DKnq9vbgU%B@VL6n5mL^e8yK}BmLg_vq?EKwsmuM)vl`X?(koG z{Hva{bN5bbtZip^rX73@J~ zVgq0VtbiGC4~D=}v$O%S1|l*%6g6X)@!5U7(^Gx_Ue-?kIeRn>R7? zy|t9|Zr%_d->l1ZxUZy*aQNR_{Htz|JNf0J;A9%N>}fj>9c z5e$KSFa@?6wH;Vqh((5mQ_*+*j6F+7)=2+=;Qo5vJbuwVc#sR@CH$w^>7@AhHdi12 z%F47p`c%C(+q=VmeeDJLXJZ3>#-=rwxJ(=1#|CWP02l&G;2vy&F|gK1?ZA8AorsQ) z*s=cdV#l}2zG-uu#T;g=ACv_#(X*$;$A6_Ovo67*AXK|938E5yGU zFAy`AcEGGN25Sd@BmE=b-t+9-+FrK-zw}PKHuoF8@rl$2{=f8J4aweUGDrWW;Jc)c zUk?B5+Z>da`@A!GIQ;KSZnd;GYjeY|RD{bZQp8vbzU(Q}KvA=4{yj{z3_-{P?6W7MZcQXDDU`F=B zNU{~vqK;{W$Q_;gxwo!;>2t9b0sa~A(;Z)1(TUN_%YjW)~Szp?O- zKCo?UoZLXazYIGU5WLS|49tN&Ft1o_R{YZjkl%mq4Do+EXHpFev~w8_|BZyTwv4VU$H-Syx+Scd#f`h3TxNyzHoN!@E=Z2^|Gh? zuSC3;UfeHxguGS8z!kLtO^tu``8iYN`ipV1&i56wXF_A^t6p}p(|R5L8{3}L54d#U zY3cu;tfUQSTKsFje|%`4e@=(<`FD!%a?d&ZH#Yv!-(7hT_qurg3E3B5zr+JWjRTqv z|KOfjA9J2l6Z<3wLi&A|=T}po$Kk*6@o(AyKQH*orMGw^!^8vFH^=UsQ)F(S$?%^v zxTg)+SeLUpMyt>QBVZFXP{5P)+Is7-T?&^j2{CXY!o7aXM z{+m~K`8cfCcZdJxwIPT9=G9%j@Sb0MkFL_4@Ac-@G>D@ZY?;s~6t$ z>vi~VUK?`wZ(iNy$}5$^V*QZ zfAi|DUU<*1*Wtf;ZOGxjd3BeM!+L#p_-|eta`-F8?zjv`JN!4V4LSTbukPxF_xySt{+ri^9R8bEclkK1*LR2i=CvV*|K`PRoP-|xTD64 zdnWsK+}rCsbLCRZltEd$rN=!VUWN|;;brCQDpytpt9R}BaW}8Wz4;kAPx^(@STEED z96pqiXZLwGuXBEz)FEZMb|6>QwX!{j|GklOt@Kx~aGg0rwt9{=1DCfqeW!%5*?8u7z0M4DH z49cQR%6|1;)U^R}MsKb3NVyLGwUuuzbyttF75f*@$ECkcc`s}~Gqxh!=lcV+1C&YG z)ZyBI+S;eXe{JPk4~*8TPHg4A^vM^_CFPvx-S_$V*w^nm7N8F5qE70r6<_UKuEW2x zt1$L&?IbGmba8LsNWU4YD_(2$jz2(M)ak|nwXsu&|Jukk45pgtp8Kyvy_a6>@rDO1 z_UWT*g?lYm#{twy-O$iXGHV7}9sV8u!`SJ)yWQUOWcB@h#d@)KjR#OSG=!nm-4ouX z9sa}1svYgh+DDgn=2TMRa+T-y6vK6;*QpyC$Pa*~cGN{Jcy{=Awp7lpUcTMqjUG>% zIr>U*Tdn)a4}b<}DMzpSJ-kgj{D+rSyV;esji`72Y)r6UzrJ7F5NLoF7YnSO%{u&7 zPnNCNK9GkuKfCvSzhYkBH4XqR(A0{ut_M#J|IU_*+1H|R2tM|IyJU|uJ2B@Bw7x#IGw&!v`MprWT^2YCf@ac4i{C(`XeVx4T z<)79G4bbA-kD-mv)-KZC)(O`y6vFb(u0_Sq?(r68pAh|%?_2wPpK|Sj)pOF&1Z}Up z?0kTo={DQvIs9j3v0GWT+Vl5h9sb-*qT%{~Xo9v@lXpG%ark$3RLt%S{-@)Ohkv2T z;lDa|>+oM4ITpiEGhes;KY4$@cpq(hku9vLT%LDJ5leo zd%ZIEzrW%9e`ta>Xe>m#yB6N29sa}1svYbKd!XNEKhLX|_j$*Mo|5^$LVNbsCmskb z&;)JJ2(8fE4!WrYj}HINcCagpp{U8Nz4cPBx4xQ?wfF4H*ErZ$KLMJc4H}`9d|>7R zTsu&?Ej#>IF0)#+!}Tf?{aYIVKfT_mt%T&*^&6jG@z$vC#3i5=nxS3S1-Nz~yiGg& zhnH2oFj}j6(LH-=kWYU}_S%~m1NXJt*Q?s?2=PF2f}t7O;Q?OY$+ZFD?AqZ!oSbTf z!FrTyv0=yhH(u=X7U#i{UEkXXc|Mi46VS~1V0eHRcyc~LIJJ&8Fw~6L*S13Gw|fVt4R7#h&J(H9Tv@I3QO|N6{#zga=$IGdV%E)_ zKilVxjo5KBF zxHmIp$I6VC!{DCzw!vdhc|!wlt@(bR+Lsr5=M2$fNA?LFv;pPY0eIvE&+v{6kcDdl zvNrGVpOr<6rOfmKNB*$Hw(_tXvFd_PVV3Il9jq8vF`*y~R5!`*4@O ze=qU@(t`gd{Bwk%r+ga#ulNM;jtp*yEL?0LYx55OSy}7`Z;ke>@$qG^yv-AwrDJ`3 z@LR6Wx4AxP>F?iSu%GR3_X6Kx>Hza;X#@8A?Eue|ZwKIAV*|*9eFR->K<9qDJ-7b1 z`P%{7a_i%F%egr*IY$rNhnvsS96vkO{|bYzFyrj{j0wOyYm)m7os0=A9p&2rjSV0h zWW=808XIV|HheGWas7X5;GP&44xgHJ!tW@#ZIXL7~7>(^q^hmt##Js&{twQWp!%yXZO)u&Ba z*RSk zE?B(32TzJMFmZf{^S8ifcAd>Dj6?j~IysZ^@?VUTFkensE7s-(TZCTvsw+oiHY;2&yyaACdGDg;n1zI&W z;PBtr_(wmqHx`OLVqUzNrNm@l+>1Msio zAmuavUHupMN7k1AKBEJ4p*jiEzc%_k@WNioZvL;a+5z-pbwmHxW6r)jK7`#@GM^Xl z@x}gae_y`Ow`2FT?ETsAUB7DgR1Vw!Dc#`Nj#q4a68r{V{HB=anQ}PMdnn_^i*d>2 zfe-OD#D`G4=Hoc`JNMhz0Dgh}t-LJMCqVX`KdR%DET83RFUMOwe}@l;|HjfGIPJRZd|dF zdEdo)oUClRjNdRlDY7ByuiUX?eZ_0NZ8X1r zrHipZc5D|jZixP#vaOGw_Ewiu;^X%=m5+<<;zJm@NqpkOYFzw$+;T>Nyr)ZmHPO^sGc@)ePUd; zzb|jYI^RA!o$_A1sxj{7?8lI!#u~^SSeV5hV7?(tY`~8H?R+6QgyHiB)L%kp=#H_Q z&KKIYseZOq4Db2Z9scX1qpZz#c~>PKJ~OE~Fk$;Ga(40Yna_L5#$~#9 zc>M02ZtwKTK9jp}NPGhDAFdtPX)dv?1D&E<>k~BgngZnI;(xWb{h(d4_H^?^La-Qq z9@~!Vv-5ez$FIOwW$tTbDIxRjJ#uyi{5G~-?zTP9HqGWubes4_Wos4i3+(#BO6Ch` zV~DAsTXbyK8CzK^O}pi-n$J7@?+y0Ne4dQ8&qZ!k+hvVaw>Iwcv4MTt*g&_$Ir_ZW8RWv8Vc4;N&7VT&e!GIJ}51*#I(t|3)&tu1mI+$X>(-umNm=Txx8i5qvO* z|LS2sXkX;eoZgB{?8*9rVeBj4$FF2vF5}tk{`bv2pI7TP0zH8};vlR;SXrWP51VI2 zTcNQ5%^}ol#pf7;?K3ukZ8SojmBW8^@Q)mIz38P2eX_Q#^6@3}cy#!eQr^t$z#%DP%fVc^M zRG2ZF<_qeYg6!TywBLot1K0#F9kXFGcAb^%Prk?J8N<8t|HIph_Em~8ay{y1K zfov`@YcI5IC}sz_`edE8#B9WtpaFTRjnz`N4*!*5KWHbk)n`w~q`wI7<6E0ZdxNq* zhp~R;IlC!Ymz$P-w=~aeZ|tO&HrPmI8_Z?aVD-v*f{f9^<`QchAh-uvxORXxf_5ES z!lrZ`nA%&dWaRK49{+`JMu>tnp;#`eN*5xucW%i}qNXovHjlC|n7WP@sGSR!m2R71e z;w;2l$lan%XZ&8i%`ddhxO{BD#vjtg*04G26I9>FbNDZgf2)6geW|SR+*q&tES=2W zTe>bcM1PN6Ss!24x`?J&*AW20RMiwPfYmU-Co&yGMR}9hgnNz=kbF%yOpoYos&FOn=fYf z1W_BT7Y1Ctb}V4$3%gAGWq#J*dq~FY;l={GzHleG#KZ>D#ul+jY}44pF8ukIV_<^JU{d<;Qyk*5!ui^VP>68zE;`ef;X^*kLzU$GepWHez!vA_wB>i={7WbB>>e}vZZQnhgwHLGFp{YGp!xYjd_UfL1=@T~b2FJ6%~;T7r1=I#v~3!ax7ZlB$tuFjpY zIUX9vfu=C}a`!a0oHBii?48a!W80@#oQ8`L5=&&A@l!jC4Tvpc)3if2mzXhSahbIe z{uu|EF_4@SQ;289m|2(mQn$CZoRF~^b1dQai#>K!*5wW`k6-z^TS)bq0n z(d(`i)?=f~1v|62Vx4iXiR)Cd*OT=Lm}9hO7G>8IlpYJ%d1J{z7XJg=z9lyP>b+jS z9VjkK&N5hD*k|S%^V+D#b`CQA#_xad>2!zueeAh?oxJbmpVkQtg4H+t7`&lP$JES| zF3tBFe(%2$F}PA}1@(dLoIV+^C{~lRE*IR3UdpY{Lyo-27ejyKk-qez^YI%UyVa!6 z_BS?0c=LL%#CaI!hmR@Sc3|gwkPQzeWlh0X$$kUzBKx{`n|A8;SECZQ=r{WyG$a1~ z_Q2$6Ps<*x7tY0{&CAY_Y7XV43vqv4Ze`;!yT5keES(VZd73Lq-sly#F1O%#teRMB zF>lW{-#K*Ela1d4!+Gr_X2nRq1)ToK4GE zggnu+r((wL@x^ou(#Uq|Xe&NO-mPp@|HOOn%g>z�Em=5^HRL^9%JHQ`&;keu2iF zCdQwXv&+(gdCrrK$hcsi?0xdIJpY70PTf{c)8U_XkC*1nFV5RNukrDZ%60Q9A+IAZ zFz@f5mn-M#@R@6+WUS@dTupynt~nFN+LIjz*3PzeYn$%*z0-~Qq{OM1v)eFdJ=s13 z8#`9QHmwcrESDHe*uIgo%bxNsp4;b5jJ`#1V%I0~djT77I{YgS@MGJ(aASS-@ppQb z4rjtG&U0S8&Bw5@*S)hVhvDXuwe|_@z44NqBUsrw<9weW{CURUL)!u7p^M;N+k&RW zf3O|U&xPMbmNM4ooLsXWU(eDB;p1!jGBK8vaaGKWs~B6UZXG6@3zPNG7q((^iMzyx z?7ndZpF29Uh_lPW#RdvvVcQs>>G5Bj&)uGvYxj;l$+}!QXU67UIqcU1L(N_%Z2&K9 z2wu*f?lbWtXMxCl*zqzxNmk0 zHUj-RZX{mJzHaNQ#GtchM3u*E<*|V>Wws#x?fN`B)_+oB1f}Dr$cOgV`b_M-m6UU2 z+Vd=(M!-lr&_FwoU1!|8ZBN}O+$X^E94 zB(H$In!Am^ren5tut&#Zec~9{STHs)F&2J(islfKOPpO#P!j8f+Ju(Gf9du!>u=$I zaX!q}MxXQXOXQHd_Mvv|gZ48TUpl#&s3><;+ktX6U*z|;!aw~zFXr))$I?Q-tjo1$ z>0smN!r8i$K|O3hZI87p+_uDI_918sxgMqs-s^$)Vs+9E zV3Xtx5Qmzbu4G^0irave$A8erXMeS`r`=gP#ca=AZ=AM}c0hB9*)MKl)Q$znNx`Oz zjOQ!8-tzdz#~(bFlKoZVne%epKD&)$=dR5ut_#`#UN$z+yBr5J1pYtz5xeKW2jBm6 zTGlJP;kRpsww>_D^Tha;7gOdO_TBEG>g+Ms9-TbuBM;gEn>P^kuF1Y~ljHl$8kn76 z#DC^7SOIfjk3ByWi+j2M#|s~~_QZk^n# zCwKJ;*wf?6CGgKW;T?|yOdkv8J}lS+^M`ya?j`(sIf_-~d*$&!($6ySsfw^z_<|k5M z{@w4gSlmneQ+Rkjv$*r;E zX8nMO>@7{dult0A9|M3Xum#2hYk&Ix2<9vX-?Ha>{{`Ebi|1md{_|&g_Rq~EJ}@$z z_yYTP%Dz6d0guAA1B(AG$)$4re`DFMYfE;gkL>tA;$1xdR>6jzFBA&@(x0Xuf+?^C z#=sgFRO|)uSdY)Y@}6XLd?Xg3?xn@Zw@ytY=8g~9H9Y=Uplmx}@t=}?P@Z)8{4TGz zC2~3y_h!Ao-EOnL*zjQJ_+Mrm4VJ(Z*aBnYBk{rfpd~5)D@?t#2 zIEgczZ{O@Ka)wf2eK|XJa;b(5=-89<#j!zb5u3EOS*FkT=kW(+P0-j#>@NfZ?>={S zzwzh%MsRt8EtZ@v&|0ku~jKo}KCY$i;I#e-DhTE++){ z$;|k;7;akW`pROeb9iW9^tXN|V*Hz}_2hR=O~h9Hyn(Xwg??LMWX~RK7teFHp!LJF zeXd4Z@5*pv25bPEGCsc87`9fyzJD28w)6PCt82^A?*z*qd#Z=U%)rMp(|^D~L)*l5&@fv#MM zrWfaXe_hV-`J5jcV7{%!M8sJ)V--fSe6< z$m9=|oG+y9JtXbG@u9SL<`nyexpRP86{EG_3*7UvIcMF*hOi}U3fn5x-^=fhuu*Ik zo5gmqVeB89#|J6{om^_?ZD=G_xH}t#4jEnV%=0)eS)I7#OO%c zUo%ddo=llFmo_%we1ckFrd7%W_i87s)5Ufe>tjo0aPQk>`Y|?&tzxs_7aPWwvFUcj z^G^9*m`y~cCXz;O|Lqg;u9fBVPfLvO)8tj*S24z-O)m5b`UI@ET$oGAIl!zfwmzYb z?^?xn9UnXQ_0<-z4QvEk!DhmY^|3*05u3y|u~BRlo5yys;hoyQd(KK=b}AM<`hsmg zuU(4lTb$qb+mbW!dHgYHpYaFE`UK3;uy4Y~dQ$cjwYkJ@O~KAF(+cg4#eLL_^|1+T z0~-lDpNH*XgV-WAiEU!B*eW*b@LN3zoZLuvPEMqvBf~Zya$`OEO>@(+$+6>{uPCtr zI~FL}4#+)5x9ll?&g?0k%_Y`8pcU-e@ld*5L)W~R&m%sBEnpMi9vdk$);H^Nu{mrH z8^ji|bZiqF#a63l`L3j(1Wv5QBE!d$(VuyTjSZaI=>5Uj>D2XMyWfEN1SMkwI$tbJ!lXi7jH2*k;gH-RIg# zU}mZ}BIkdaG1ko+9lfhd@&9{rJo#UlYh_&Kj|W1;2GVkF6X%Azb;hlN@j`sq@tqy( zqib{?T$fv_&&QUqDQpWH!`84ltQ#A|7HeneuH;e@Se%VTCnh?K{BPapczSsu@gbRW zeUtGSYbwLU24pW~b4CMu58HLdc6?}Urak(_LYQfVYv_;{u|0H)j=?cHr(Z9Hdu#_A z!j`ZpYzrI19B(sH=rOww>eQ@9Y6&ZW%@ci* z(V;HWCVO5-=gE!uzmOb^mxl+LFU+(9Az}l};ik;KO`PfIVgt=J1_Jli$L}^eM3;vT z;pdm_?~RX-tza|Q4mN}>VT0HfHWt<%-F@|uz=G_LHs$+dcVF&EE-&`HdvZJ>XB3z{ z*cb^wd;fsc=kU@O=Rwu1#@OW0I> ztl8DNQwc0g$D^Y|Ha2thO7yFj7kZD5k0u5GW}b(3prlVAzndJ8;lX}6$1x#(B)P=+ zlWyOUMrsehJvyn#7wt~%JJJ`@p?aw_|e+isC+1WWU z+86!6@4nTH;ZAS${NshWV5i|(-jYyq3V&ae?|r5ZNp z%4j?ZEX~EElOuMIr5jh%Y4H&ciof@_gObN-$AP7N0_KA3I^%wCeZ{Ubwrj;)JFpk+ zPS(d~@2wuAgMp)(t4}Uy;c=Wlwj(d(5xPd_=pGxuO0fxSqwy@(QB(^F%uV;nISO{) zm5b+N-?X&YHz9kjKRzaYK$vy_d!ij+|EJR@V`fau+A-^kHdnlSFL1ltI#jO6n6i+$ z-Fqv%kB@HAF}g zC~bvl2c{-;zR<2A)qZNXcJH3IZ7R4YzQGxK@q6y2g@tP-80du*Vw zt<+IhYYE6XL$Y4W?#c4n{f?g1mA;>wnNIxa(14vU6gw+BUx@F?yaHzyW!D+Id4k=v zU$zakaeZWpY>_dt2KS|~kItCSLx<=RouXT830QU%A)u z))Q+ze;|J17yNa`p>m1omvo)+%eQUbz+LhNFg%PJkUdntjfjV{UWOhhNg?HbOD7rMTEc_F???&y&hB!|q71w!Nv zaAuLLGd>eDa|Gm}st?;vSgwRul@GFFUIp19!_e#TO_rlZ-8OzA!{Caa!_7i4DYz|LSsy3y*`qer8>+ z$O@S;&JUlno07e^QXV=&S893a5MAnb_wFQ6i3C=bdn3zBDPuo>_Q_;&YoqtQvS;~U z4aq(+_?JgR#0KyQm@imfOnNV6&NFuNg^UfXk56nbYGi|qbZ(`bkB{t)k1x7FC+G$p zpyVpsem;`30QqlkNfp0VRbpOti2i8~O&rgiA&X|5G+&W|00nU5d+8~#> zz0Wh&u|Bv*7RUtIXj@q-wkPd_zb;qy*A^Y13v`0+&=I;Srbl<(NnocExO_1#bH$11 zM?Unl@gpx?==-k4`PhlE5wrhTD4&2iD{OpXEahEl(=&^}zFn8wWn_RXkO{IWgL{8I zFZCFiBYSj!KG6xfK}S2)uY1l(AdCb~ZN?)fR_r=ZSsNNTeX8gGnw^T@J8sq)%O3D0 zd;-R{{+L1RUFM`^ZR+)Fc3EA!B5X%#l6%LKo;H zjPBe$P6E}Ez{;YWRWfOF$L`+jNNueresg9j{kL|$(D(#p^9G1*b3bRu-jaQ(UXwYm zpkG``{Jc@`RUaST;1OQo8Qy6N%k=r;<8zh{an$tRB4cEY4v{@NsFprmIZgsQk-*AQ zUvzc;Ni*)ebEE(3SCYtA0OU^2P^XN&AMD$8=_eFp6H|<_A=TGaFJA8ZmX)R0jO;UI@&?1_4Wzx1VgEd1lQ&@70L5IrFi*YEz>8e{ zSA;gsT!z-rIlDG@Le9`iK1Mdk2pu3ZWQPo^sS{V0lfYg};LMpwMAi{Sf9Rjv{iGzX z{eN3pNZuG3t}Jihu*AzJ$NIfX7ucViadx<|fMOK9GB)SA+!yCyiGLBu#|zV@P%h;_ z3p7C+G*&W?j|`9nGC?oM2w5Ssz1EYf&q<(`5?EhNM3xurJoTS{x;uXMbmX0LGqKN- z_eLITsk{N5Cu6Q0e|mAATw?Yk1-pgY0r1Ih+`|j3vYzhFtw`Y2DWAK|oP%9sA2o5i zV4IQO76i+M251TT_@&1B@Mv;&g=ct22FL=rBO7E?OC7kfodoJFf#vyBbm)kU4cxoe z@%Q8`i4RMk_a$&s&L<#$$mYk(nMJZ!_0|bFv&hdS)^@=5%NFx|zI?IITVIV!-b~UP zmGyM=xg*1j)AhxY~0fG+!UmBeB3m*osv)9;qeC05*4iuYpo zQ=T0U*me13%9pWz`Vq83Gql44yuuT_7314ocM@celgj>@LrD8ycZ?XI#3coCKT%N=e|-#m>moL^Ar* z|MEKw#x9?a|DddeziHPQm*1Co7wtf1?=9+*82-)67ZN`Rtv~sHex2;E9gkkR+#9U z2{T`4$NK321 zB`!1;pwEBAJ>1JPJPUV}MVXDqsiVkAz)7H(1Wv4_qMPe6Gfsc-TF2L)-0T^hmNi00 z4|A@$@dwBuB%e^)gQV=em6ZL5dq%mJGI^FVik0uKI|(=mG`0jTU+U{zTkem(=ND}| zaN}y<_pPs{&X14E+TBAkUnnm=bB*8NhI@I2XB(S4N1c;^lRy{=oIl$gIk}~|#HpSu z7nA>XZYKT)FFt!-%H-^F5BG*C)7{hj67X{W9zUD=J^$Mm59D9T{r;dg_j~@ggPr+T za=&+UFmU;nzJqd(_D-j@d*9VH1o*wImnz{lwO*}O6XU%$xj2Lc!J zJ_>my3EbrOXx>ACul!s>LWaB&1RC;65ct3pUtB^5?e9e;WPdJ7peWD&JriIl@X<(z zJBp}q(>`5PLI?Ht!UX!#;ihK;wPrs0(&6_5nTvrB5BSCY6||vE{j~^z*`EtaC?g&2 zdnQn?|1m&bK>{BH%P&CS!Qk)PB@~bjH$IzBKn{5Y2+SzYRUDk3BTz4A-*d{(lMZ)16TBf$I{cm^p$A;a{mUWn zVD4{x3#xFNbhzQ!ECJi3!|w;OzZW1chrmtl&;JWZDE}w>JyU)`@&W`FBribVgTm!! zBy_Ow?->ad{yBrf0?M;bJYzX1C>`$bRk&&I-u}NYp@Z9hu~#gCMWn+m&q6>E>G1mj zet*EH!hc3Wn}vVlsv+=T@!t)B?)Rbsa`F-TbN1ovqlg3?J{&$=`%nZNa@pa-;lts> z;iH%YT>IeK2iHCnLx<}>tI|Gf7MHJy4?HOTyNNH9i%*n`ZxlCh!=C3ACD4zrl#9=l zi|=^F7?j4x{2eTOgHK-32uvnERYXDu{NlYL5_(pDFG67E=fV>5rNdnXB@_ri79{XM zw)}zwKAZi$kP0)>;kF0cC76*8zZW1dK%VCnP~kH?m-*XXehVKe`RfONRwLH_SK zM{~~#(v-Szm~u42miuBdqWZOG7>5%9g6T(c)%}i+nX<;XSe;J z7i|6dZTtHsHx!W$cbjIQh;;bf5O{!3h5rnJ&ldj8Ts@dOZ?f&q2W94mg}@Tz85BOV ztjZgB|zG+{Q|Jpe= zlIr>ozxdx7A)MTZ{h+LY`xGxeBOQL@9`5D4`)dseOisvJ>SIZh`*iVa?>Ej)#V3Xb zGiNkD<}=s$4UV~&XIg{%_T^$>t}iNQVHrK%ekqb(n2Y~sIV0-}tdE!VaIBRvdGh{e z&d>S+_i!&#<5|jRUkNrR=c~)9$mnsqzQOZ4B69xlPmYZwKk4szj@}FHugbb;+2cIr zaWBvCEE1qB%4|+)v=7y1PR8Vn*;Mq<^LD+w?5FwNQxl2vtbG&Rf_3y>YJY8W5BKs6 z&r${wq)f`Dj`opg^Kd#nk%~U|;in8nFP%?)m7Gs<5DJ_&L!&+sf| zP!?q(4eFq-=8;TmQ@XsEh#vm<6Gk6@_L<(;(tP~Aqr=HJ1m~)E)7Bq)-t4Vib}wC7 zGv{$H&x_4q1Lk?kq-^RyqSQ&SRyn#8|THkN+rc z`r$Jt?b9zD3S3{Lt~C zu;^GBlZ{C8hz+ST>d*#9c=+8f%(iyq#jT}CGZN7=JH zF1qVB7|uW6T=l=aSX}?hdHPoy;91%N%BBwLvTcaz6KH?@u|e_%G{QGDLpwa|Ru1j> zyo|G=M-JJT?dh$=H;L~(<@fR6&$RXQ%d-EKoI#uLUb=4Edes^4!PidpuVwH&pRoh# zqE71e#|9>*M4teS&0is%@}L1)psCQ<03P5a z8%s_`;kCFV+Uu9qrDW%r=>6j#Pnv#GVk-Yw+RF>u`*`b%udgP&JGX2fk1o)I>ZH`W z>Z{WJzg(I8PM-ix(1yMGaRdCtz}O&h0p8FqyuvfQx0kkaxh0-HdOT*ZaB`#jfSi9Z zApNI_+2;50GM<)xx5vo(-rdq|eIcFILjPJ1WkZu48}!I|c}2$tkKqwskp#RWgIuY! z{3b~&AxnT-FMjFtaJbgq89@vmu5C9dLKzSw8_Tl}!Fcvs!%doA@J zti$@9U4~|8hX=-mxnqOG-@r4xqitk?Oj=#@()LDPFPKYO8ntw-zPJ3PQk;juyTRb-%gM>fbvzqiW!)<(Q@WVpZU4}O22 z>F?xRqwg3SO>P9|WyJh&>>f;rMh2B*s)$IQZ)uY$cR&{IuPwOGXCB z0-2z1WQ44cSu5yY+Q8`1BQ|Dxa}1?nVMr=)W+!(kO8tlCfmmbN%9RAkR^IY zw#XP+Hg7oBYSkP*LE;FmFOHEOhkYC zx87pfp@sRx_sSgj6~B+C9}CROro0WAGky7X;dxn=L9O3a#(U-eRmu%x_ z2F3=&k{@#oStE1wjtPWqv*9~()G`+j`EdD)vc_O6dFCG$qt zztRq!e8vutU9ov)6E_gqqXYDgPS8!QY+&?wJUTpR=Vdq6Q)$V=c%Sq`pAYu&vgf>a z=;LYTzs=m}YcfZAugtux@?GoqX3@XO0eX=gGPLu|R<_94_Y;i2hz`&NIzjj72whdn z4*v81n~KO8BBs16pX=zH8c+O$#4|rB@d?w%i~bEAv{Pb#-r3WY&C4pkwSI3l{i{5b zZemEt78&c<0NLX&q6>6_ZqO0BM`!46w{|di>?u>;%v9{VWxR35AKMv!PU`2~xSu@ZYT4yrTDJqZ_TWKl>IkHzh_&UK3 zB&L*njLzQs?(|dW{*V5^>ar3$_}FvlF7E&1KT7{PWlH&9l9y@g19ci2poQE>rLz&= zTS5OSS7cp4|7r{9=u7Af-JwI(C7;9o$+`!lf0?Uz*4Ou!gL>yP?F}|KIi4_c97Z9nrBtc|)a?NPP#RI74YMgLj(^vK*$zt{ll*mA~!*g#G7PknYw zm^L{L<#O+{G}q5gT1o%P%hk)GheJ<@zPH&x&GfHhKGwxvI2SX%2=p|9j!V&?GHXWv zzYt%RAJ!f)Z@f?Nm}3Jq(?9c*%uijFwJ(~NS%|(yyVh#@N4|IO5DSP(?iB0J`pw+2 zKNhUI{ss4MGTvBOvc7&ZwE00BY(@QB8?bAj?%e8=xuQ&7Vb%4|m;(J@yVBECxK|r! zRsF*s`xU(YYSg=YA!gbDuu3~n?eV|$^?IHDMdoT(jqt9veg15`=K8;K(doYtbRMKZ z^?%`<(|=Gd!OtqARvG^n;?3#5c)RTMUrF>g8~+c+f9d~S`(NC~f|%UP&uZHa|HXBq zGIH&IxOPCWZsz|S{)^kxUShmdU25A7|HXBsGIIEL_$Pm|(Eg8w_J1pdyGHpG>&(f7%#+*wxcqr?&6hLzO#CK$x@Ych z7CUhI->!FXgj`rt&3ana)-&$+*D_@E9<&2~;~wtinceI+w-X%i^ckoB!ukjE=y75U zz1sB(L46ncZ2N+gd4^{xW2buAtLL2l3+o8{&dpfdqt`Zyk-{e9|4DbBe>fxWVUY9Z{yVh;_PRduCZ|CtJ zGBA57%H9|^WS`}!3D!ndKJL%&11N*CDAVj`wS%)KcB0cto@r<% z?V^A9)V7{880Tm0SqlEX*`g=(ZqM}{IJ#fvb@%1yPW4#sUGZ-3BcFzHa_xXR$%luA za%WH0qRkJM+3Na-KVG{3-HA0lgVo0N6!Tyey$>8!+}kzrido)sb(=dr4B|WgUYjR? z9c0e`_45X7j0l>TFM>v;H>jgper{#`D{t&E!~U0fdt)2CqmzN7PkIB#1oK8e*}V`B zeT@B*Q*x$IB6AK?A-{lY+P`y-pPWnOef(otU2B`6XNG6LXU7KA1C7wSmtzB!Q7iTT z@T7a=U%QMyC-Zm`&-3@c_4O`z7OWe+n||8r9UP-e>;kenQU1@y}UTx!SRv z^zowiVtqX4DzP`3JrjDnk4_!*#mo=lL)e$SroU-l&3EoIeuk83^GIwCQMN5W=ec&E zztIN41H2SFmtO1I%{z3`-!yCcuk<5p=G*1W8)r?xmRvbtwUL7UQd z?{2prXRv2BW$lvoK>LJTpF_u<@C0wxo~qjxD1FVQf9R%drro72o|&>Sd&XiGL)M=I z>%l%=|cl%~-<8sgnMxphN)FtOGn6V}phgQY>u_I~+x&9(NF&_z!@M`;- z?d{V}+JR=%e^!>+^RIIIc=Vd>R$G?k!}oa-}f>3xX-Qf4{5 zRr`19)UgA!jE&^?S*r7W(l%trh}urTbGFa2V+@r~rL=X+N#r!4CPmoRwJXu~a3phbQi5?4{>9T6a!vv%2A&+3>}TAf5is8+_@EqrO22qJ6;0ch5b3~gEn$%LiQTH+*h$o!pN=K_XKVI z+Lc~E|1@ap+AdgsQO5=3P}QKA!%M=j>dn9W!XTD${0sS03>9Z{Fz6 zKhIJ0pF2h@HqUHjQ#i)4SNdm6bLEoFg{Mw^p?Bs!Ppo0%ne)v3m`JdXr>%$Ipg+g? zK}pG_U|&(&eyGfvQQyUAh9`|B+w&ar{h!>if%SW{VFo~`1#p{!~t^WWh;?gE8UA7*c=BN8!0x=oQ);t z#*dIaGM$;)C$X`8Mi+kjQ8WEhK6=Lv^t0{H)sHXK$EQtvl(=6j_whTmP3%C&2A3}M z$~<%Uu>m^34)*H&7vH`z{S@Ev=LQAy!B{=l@#lz#p4_bdyzEY8-KfuD1HA0mpv%l< z69dSd8v%3bFXqlO=jo-U_|L0LXtI4g*R@Z;S6E$+Njx-s9IH`vvzK&X1Js94MGTO6 zX5^~e-yI=WF(tejc|5@t>_q0>h&b``8IX7}$*Z?oa2FQ48BWC8pRsIFu zcYXe|o*7>5{CDcc2f2FLo(tBfYor@lzhP-pJ9zL~m&`F|=MwVtpE>{i!@D^D{X>6{ z>ZFzUm3OC}8W~O;9z2$MOq(Mw%6}BB)97DfLBunlF)TmszRF~!vV9=y6P6bG{rR%Y zIN%YwK}YBco&D;2l24&S)g_-R{Tn>?q_KnPsn~bPoa|ZVu%wR1qJQjwcZ2`sML8Ez z<^XIPW!o#K-^%n`OkS#Y6EDoHOUaD=jV{m$xVA>wWrjz4# z&f4skQDn~A>Atk?(fd7-9Wu1@g*Fx>vL?oYtPSqa0lGM~^<)Yiqa$>+TYVRMUiy`& z*p{(_h1tZ{jvY^qNPnaL2zKyDpusKQ^E}dQ)DHX$!cvv0lHm z(amCK=$)75QXn&AhYXP=G8Mf)vVDBw((H8aKS8H|_y^sc!-MH4I;p0P!<02SmWT`w z#*NLr`DRCSW-|V7h6j_M5n5>vumjUZ!2|hxnOrlF_k|*q*fYh4fwM+WKl==jic7 z^o5V_H}<%)lzzL!DrW|dB{Tk_v{GDCLg6j>ruWZMWj4nu>?0Y(On?K5rErylh5%uXl% z!||cyUj+LEKEpe68m*oig6?f@e3#)>=W&n$<0SRxkP)&%X2=;CBFiu`Z^V11#*>5$0mD04a*4H^Qoa}n;!%rAHSX=J>?`6&72|sRN;+MkjV|-llTiC<1*6aDh zwAZ`2NBc3_dU(-&Nqs*)6SGAI$O4%lS7d~&kXfa2ZuI+?7vhoO0ox})tHdsTME1qF zC%WI}FOoNQYRjI*g>R&N=WcYe7tbo48ncB5c%h#QwDl%t3-8E4^@ePak$!L0_u1)K z^w9H9n6~ZuwZ8c5RQy+mhmxN|KJbn?UBA@7UAMQ8yeqz1vtEVR8#{?^8o|%48WR{5~+r070*GBIZ<~3J~ z_1n-|C}s<9@CdKS1m2NBG5NH^b;%p*9FzFbq38FR{%&o#?|USsbv}P=V0|RJN1v{L z(zbRlbX=$ot)D*Lu76`4N7kRih6VfL$8(-s@;tnuQ+S1Ecy9+Chv9K{Ixew|w84Vs zbws2e{3+=lKUHXKp!3Z2j3uLcjoD`BWefK4pMn>7LJsf`Ik6&WJu!Qlq3CU_u@kQ7bHgVS-(%% zHqU(i4EtU=j{Z&r_ z(-X<4?15n9di84jDakweL+NL~OrIdHOf1=~L6Uu=u3gb}#x{P0Z?1DMtgX6pOZM`V zce^*Q9nYy9=(=3Wn3l2v^Rk&dTk3`eXn{*;gU0G{>`Ka)z?n1APKlFuedLdyGyO(i`++wv-{ShjQ+K$-SZu>Qb(t0b2CCd*53L zEX^mPgGa2t_+LL2?OU9S|FYyryy1@xGO=VZjLy*~zvaL5I``%E@g`)D+KNele)qYL>@zsLa;fvHB%Xfg_+XO08oisbLB7rlefRO6?c=44+3CJRlu6yx z;rjSuTBz^!Gh4kfHoy)NrXN1F)%{)4FP{zOpoz{IBW%OJf6a^^#9mD9)s#GY`ect; zOY{75DN{Ce)R#+FdpQZLt@K1D#%$Y6+;wfG_g~AoAfE)=qT5W)MV=j)+$-+kUY^mI z?S#Z{D6?F>?)S!$z`|T#ROi=j-{?=t9*XZ1U;PV5>^w7e0N$Bze8e?=;~wsXlZnw( zbaB4V_3@3R){3c_n&^uT9J4uS7tY1LUh?b4@Cj(=dGVQR{6^v2%QF>M~@ck#e_zdCv#y#BIu#8lhFwg!ye%AlszkTsQ?)L}1x!*UV zx!(!Q2L2v)bUYLI>V2`J<3RBHgN}}z0uOd{bOwHZ43p1hFGz7Y1^zYP`?J4q@;yKi zUjr1G;sON7ZLoBa-pK6Cb>P?VvDDZN9dDEWqELe^hb8QzBm{AZkcDh!;8-l#c$lh zy>%h7MwN~XC8IJIVd4xYR%2f&YlJ=~^BE==TKp8&gFoaNzd-``@=T4$*|TCNMiUW< zyBI!hUQhH+O(cFvZFC+eW#!u%n*Z7TlxECUMmNNE?;3`!#H=XE|^)AtO{FL2e zX=Xa{&&AH~`tyyCMAy1bDig2dn(%A#qPdr6Acrz2i!!T3Ud@V;`7U-y3IoDKiFS2XwX49`*q zWu1^RA&)w!YZs(e^--ZMgYi$i-rXf}`hP3)=%4jze!}DkR9)`(X56gd04w{or9n|IH>+{e6ExsHi$GZA$gX~8n z7}p&BCp#q{@+YJ%{-ox}Zmh>1X3jzPbMBP(LhqIGPZ_3d@G)V}-HMsHUub|9X!1PU z-$E-imr-ZgpT*uf2aYDAAN`2kgJ)_Y{#}w=bPgQKI-tigr|?kraw>@NLVWABo$#;E zDxSaubwdNRKohhmpt~iebqj6;ArAor9Ih@@r8^} z%o?vZU%cA$nA}0=*18Ju74}-S`PX`(jk2K?nuT}v7GsYw+Q>>V| z_#>vBxhr<2P27l3#Yacg5`8Y z{EP0<`$O81YU*9(u^0TS4B$cRKw@oXy?!YD(_YG%o~EBynydM~SNuaWYa`@bHqn0t z{0shXyx47gnQHQ_W$iWpvOiB{{EPluiT~@@9RC&B{~qXH#vqya7oWj|;-i}H;J=ad zZ~LXF#EIfE9_#lGOAJu*ack1gBF9GJUwLP5NcK9QpXJ48t`Xy@c7NL_{44LQ>lc68 z@Xa{WA8VRxcFlivWzZ=6gKy5vW34-}8pasPKcBhAZ`@POwxALCNB8*VnI`$7Ks zje9b&WdHfy^oRB0AHFqa&)(k>voFefz6`jxT6?PRHUIEU`vr#C4_xM|1oO1_%w^hh zj@1Te2lT}?`a)T2ZSLh6p0#_5?>zRlSNy{_b_(AzXD53 z;+r$Vp&R?=Y(ZXp<{IaROWfY@%`?bA_uZ0Mra2!ke=fP43~I?gd{aJgmJ8?l$X777 z&bhhp%{z9CZiD+ELo@P1pS-N>v@GHk!95189Ka7Ur4H(%PU0t~s=#GkZp~<=4>P)+`|4s^ym1GWo3!Rf$J!MN}q#OzMbNDkIR8QJ{`tSxBUK)(SErRHU-#XmHm z7i4YqV%soujn1uo+BQ3kUh?%+=sR@=?M&m@`E3LHHb4{iLZix$GIzv(ApXTTOy~5o zxMb{}i*e=}WNzNvOPxU)3h`FSHOkVt&TKnF9z<^2Ao(!TcF;E1Ge<1#%mq~*|B?RY zA#Dt{o^6-S9E#C5eK~C#eHLT(YL3|o$p#tl(zby*^ZQHFHb|dq_Y|dVu=iIQ{{++0 zZaoB7>?;D!6yw-BpXuA#TSVf-Mn=$FO`R8#L9h<=Ld*afGUJRuf62INbvY@1M33|r zmBqi|S7iB+_S=p}axqT68ooO6E!FlG6Jm9VsSgAJor)?`+#(;tXZye{@bzY=2Gp=N&9yOY5uI zv%Z3MSPfn7whUyz{4AKr?$?^*YbyUm=Rb8$SnPh)=bt%avwj%+Vjii{_|BJ`wm+}> zZ3Fw7N!t)={#){mO`ed=e@JbhbK##n+&5(|(BwZf1OIjm&?S30_DCL3n!HIr{~@)Z z`42LVD4P={<81O@?)$b-)%=%yz3uk9>RrdBdHFB*;UzfNUF!2OlmBFM{bVo9nB)__ zSMtc-piRlmf2!^nXQwjI_7A=1=07FhkTKbN7Uq&M_?7lh&MOI@FFYu@=F;|=oCw(q zj{LX7-~l=8Hves>yau0xZyggB$bUNw&F~Em@WSUx|D>On9KuxBM?cbU@FKZ{|D)`2 zf7Tyw`1y~8bDV>;R`YYv)@AHvXpr%k&3_cypbg-sLqK2f}x-kE2d$qs@8|lm99-K^wF~Yb|o)Wu7Yf!Xeu>Y^?Q? z|NK6Yv7i5(dMM+MQ2Ec5+Jj=;ALB^=b0)`;{O9*U3w%QxH1fHYf8uXu+J^bL_}7jc z59YroB>%m)Wd3_t{^484xRfblT+MOysFS+k6O2PsEqTr_duB@3KM1~l@BKFCT4F$f z^$+PsvNw9s^$+Fv4`Q7450oY2vdsDi>Vh8Xh6ZTKr*E&mk4xU9;Lynalb?)4rM>w% z)~e7?2yKs8|5C^|Hh2cp{tKDtXZmrT;aSR{EXt&8>VP-ur0%`qvs^vWKV~qov6gsJ z+MmGsr{u#6=d$_Y@QNP~pS*}Oa83I&?v*i%<}sV~Pm~D_*gAEUqo*FfudgIJWesEW z`Hxz?$lA4U5k8iLW_(lDwmoEx8+`@7+QxdHiJg#R3Ge>;H~2PZrSL3ezzbzkHg(j4 zw@T`qn@-A_#Z>g){X(W~_#v6odRf;$ieJJSKjW|Sj(lWom&w`Y9_|&4{}6Rj24zuZ zB{Vd`z2Fm_LCfu%5n2Ble-~?989xb6>~D>4f{$hTaem{T+c!JS`d6N9B#iG=rr=fA zM#{eFtbhKfv}@$18{Lba_2#%-+g$H8>z^BKjpI)F4nB8cwO87PRM&_8(C%d^al7x5 zvC3^;eCFN{{b4`$(#5^OXKVRcwhz!f19UHezxH=L(7gxzJqdKL0^P&lfxoxGLA&RH z?u8(?nN1DMZVpn?Cf{XGg@e3z>aGyaN-6vu@Hc(vZ`XH~LuPM^gNQ{ok=W#2NJLD>=ACyoajb!l-&pT^&Z_1)`#OUA^UaZbuE(!3)N7+_(6 zvf$_tJGs%wCg_sSrsvz=+HHEE_0Jb10K3c`W>LQJwnLJ>C zr3_`k0XyIX_ZC=dSoFv86=81yG<|+xm-P23@o*!FNn%e>=RWbX2OIwK#dZEk$9cfw z6QC?Ozy(flLjzi*JMoi^k*>qm*80)cuS<{rAstxL`Dp1%?<#AJzeZ~=p0oV(&evhU zCeN$j02esH4Gs9#yB=t_TLy3g=M7L)F)Z+&$fh z{}_%mIKTx?a6?0J*AKuqwBZ3>TB(O@xOB}o`P#r9J^z%x$UZdZheWf&x(0bVKYr(3 z9{yu^aDfxt(0~>+p$*^a^WE^&tPYF=oQ(!fezYO!;iFo2e5f_{+Qn(}VbMQp@*VTj z3jc9AaH}q>(1Iqk;Q?OY3Etq5bfcg2?kj4yCAB4IUMpHx1|3&>*OIyOz`a%ZXUpid&V$-jePYm9tG3*j!wBW1k&kL7*7p58C&c{~xk8vdaHRAzZ;0fN~ zk$O1Kq^lj0)VKBL!3{#_>TzqdpG zA2+1$G1&Mz6Z0IWRmT}(RMckrHqPd;G0(g0;2*jRbG@r)P7l!zb@@N~e0heLH1%2e zHa|N2Co);p_j1aIUGOa6@6 z#IX^##zmTUTkKP-+s!}x;j@>$Vth0Ab5RH0k=ITgZkGJ9BmeYfpV^PjyWg=X$pa?O zI2^;=4E}wt*WQr%&zUQo_rxZ#IC=D_O`Bv}^vCrfu^BCXn|U(JKkrWeoVdl-<0`jH z{@}$v!B&*bzNT-D$-W}S&g?9!Lt?X-Kbt(o$`~wVnyn>VhdRwa_|RkeS_fsN~cj>!*Ew{L8Pf696r6XS}{Ce{_Ljr3osVW0AEnYA%xz3%7)Y1cbq z;^i-~v6i+#r@&n+j+SzgL(}mG+ek412Fn=dGGpA6(ICD~h+wL*1SsnIg zVB#_!Zw~)n4`@Nt+YVmx@E`2w(%RyDkNFwiRSY?C+~AFM{M;n*wvgXP zw#R_ltZ!9&#SQIetsQOss4{#zFC7o%pCpDb(cSj#uts&FJ&-eUS?_1-I;H;=_gLjk z>la@OvwlzJeED6%89B}=v@>Tm;&ZQ{L?4If0gq(ic7Wqg5bXzGXK@72H$^F9LAT`Zr9MIR{e*y_{sau<<6MI7~=jz z>BBX6Le`Cb_(l~YVE)lxy*Av{d|rZ@=S@OL8d zFE^@(+DZQNun&6nwL$#nKVeKe`AT#Dd6utc&+yHdBbf*PxoAKOn$U*N7mkkP@}I|b z^8Je^5AHPIsQSofrBBiRMc;~Ow%s=(UD5tU-^zyl3(bzlBFF9MacxT=-xqi63||#1Duk_8b(yR<3Bx zTVegEc2fMn;KRT|Lu1T;C4L}VKlD|+S-+b)-+!x~4~ze0$=TNOqeusE59(aG&IUg-hQ~usQ#^!#eY!_!(gH;LHOP!o&y#BYcQE;Y8dC zFXEnD7Jj6(g(K;{NO+R&2MAXx6hin?p%B8E3WX5fR452cfd9L9uZP#m>*@7Q<=}F0 zIl0_YIl5e3&V*?d3JhL*bnVlX#%b-;Lz}->PZ3+g*`6@QO3&|=UHfM)(x4>|7+~8Z zQ?r4kF_2sV=Nd`@GI`s)B^>)AhE(cD`VefdU)@vjjZ zv_c**z)}X9;LtNMC%M{0GEM)FMgN6+m&WN=wNBt0BYd}>^E!%|3O0??_h<5e0hTh9 z1qXcae=Oi8UF%1lWM}z0TRfsRJgEO|zdk)>>udJ=ZSN3T*d5$s`u>jh37@N!1qZmm z30-K^<3s&M?LGWe<^P@iO3kmx+V)(XE_9q$mVTT^nzG;k7dXKUjkx}rE3I9mC!bL} z%^)}8`Y9{>#ANMw<9n_8$N8jz0SCCiiEkDf(1Hh@2}*TB{LRYGgpXnQ+Cqp4&Tv*qZg`cH4{joGEe+tRuh3imU% zT~+_VjwSZ1uFu+Wwn`s(aH}2E2IZ@TLWofea`+7c>B9dn%$kgWW6Q&*zM>Pwj&olCEndE`m|;6wVN(kI*-n5wf@vuec8UTt})H# zKFQMdV>lB;UZZ~7E`6_?##Qrs5sRX6G^J0Pcj{l}+om17Oxz}|(gz0@YfJDjp8x1X zS+N>Bt=$z{NnciaNbiF09vEOL-)y!5@C;0=%dU(3G9HF1P*RfT&Sv!W4Qceaf-WO##tOb~rWjte@re22{rfS%P)9C@ClB8|x~jf==lYw2>bZx-s~^{Yj%);pIEvYNOf0g$G3m(dXBgWZIT5DXL z(GBZQ%{99r;B(#q&XiWbn_WB3cx+_ZCMVfcy0RwDYR%_sWI(zVr&gw94 zGtb*z2fhO?jT`u=SI7efSjvFo(3880YU_Dy1ogFL^>>x^)>?@iDLS z8pZKXjFx1h%waDGCf#454D%D0mrur)D*aor5Od>q?=9UiI;Qf)g=GG>H43ySlck@O zx3e5mzb-A@IW}6l^A6}27r^Pf!wd7H>SY)B68;P(p}%mK%7Vk`3%|wCQ$P8dtPj!; znO_q5Fn5|ACH}4a=pL*8g4UtXv^6>Q1@J9GgUU?sDKvAv_Ed&Wmg$bxhD zvMKZ*o8dc})L(687wOq|d(8#|CY;$X&D}G;wS|&d4i~nc2G37g2yg+;vM=6OtEj=bl=O;7c@7d{YU-dX~jQWN9J6ldFTB{X9Cmy0}uSf zkM&>0fh7I6Z2ec`wEAz^`tOCL{{kCI$q)S9LgD(y<^RW^N<1-ljtRS3zhzkKKCkT!{ z8}RlL8cqNJBF29O0+61G`w7snP*!(VmzCi%va?|@Ft#%^VQ{yx|3m`-Jnmedq>YKQ z0m$9P+SZB7otN}~5L}=1e{3)*=zk#2R=lL@vI-z!J4X``8v`o?BPkyO2n6DBG&be> zAtLsFx_`EKNzI*|?YY2UH#av1Hx>pvM>8-JCnqPEkr~X)O#g|Xck-}xHgKo6bt3y; zA^$%)A|_5oju!UL7IwCv|Ku7N+POIMl9K+X=>H!7Yp1h?>HlAot<(Q;>(fE-e^lGjJmCKu zHa-NIUMdX$fYDDx(-?f9i1Hy7{}UC_!nz@ zJe%*!>TTl}SZg5bXV?=-5N)=H12a)!5j2zfM(p z(Q<&~=KJolU~=wo5VL2qseYb$qUAz|T^T#D%~kpSyfBm=qfCd&sD~t)HwXw2(aMl4 z9OLLMiCHviTK7y{f#kt(oNV@t88~B-1=Oh1soTj+kzCgLw=_1B6Woz13FF$X1_|8aNYjxj<8q#ZX`)f z0Inf^=GqD4Eb3k)uMZm1;HOXPM}R=Yn>z?IA~;VGt@i?ovfBKNo`bjY;9y}+lwI3R zC(|r9$Eb|J2|8DCg>(CYo5F%iH8_7d7QrU`{vMf&05YVe^I5J5sS#2Ge87Fjfr1xrmp0!NA zP{_l88dV~U`_h_meP#xN{$Hagq;z)6)gX3|dPy2LNA>=)Ro3Hh*@$6>#V!T_SaSdO z38vw}_p3fwv`EdRzP>smB52H>HjTO39rDp@}2dU^h{8v&Jcxl}>;cvmNA1*r)P?VHX z`G?^$K0du6Jqa*U2fB@xYE|k?y!t}Yf)mBT>N2hFAXFeFMtJV7`%$xl>A!jl zSl({diw!%?`*XHx7hFL#Z;SrEYuTp)$s+4s=%7W$XuA#*O%$Sf5hw_94@!8FkO7iE zA9_$EPA?c7>yJfK$976rzgrHlqp2a|GIN?NlxSgBl9bGDX`&+q?`^hfXRbx0Ba=R& zHc^L}(8R6|OO#~)F4iQUA#Rbz8S_j~+ct{C=?9mE2?L)DWP0>*ce=v?*%rLc!>s4a zCS2+1NFpG^>Ssaf3SxcfqU3^fe5;cymZ{3kL9`;`C?v??gqyhs?>9f#gui>kPfDle z>_tH&glLW?gDU=yj$$>a*;09B7S&`c6|ZJidu=gqFvgK@ZCcsRj-Sd-@zJq4D=n^ z!=?pVoH-FgJ(k_Sc&(4V$u!Yd*&Atn;Q|*1qKhq>^K&uluf`2Tj2B z8pNw=^7~V7SJ=c-pqC8D`y3T*oG3b!d?}06;-}Vxtj-^H+R$xxJ}OZ7?y1Iz`@Hd^ zzjfF{%!bBV*O8C8G*A&qjy1uFL`fab9E~KG3glSMO!Jm|c4;7u+oL~q47Zgq!`KOH zPS!$;)t~QvGyZbR<);Vx{QTRq@(`F?R77cPX&F^lSEjb^1r^;+rmf0{?OKIKg-3u5 z7x$tXmXe8Mc=`v-x?M+76%U^7RYk}H3K|Y$AlAYPrA9-vhlirl);tez_$jGK_%T_{ zUp5u}d4(Gg1~_i$#=f|^Ec-c_ zf9P3R*tT2w(9H|n^%1!eVMB%)%+I+wY^*yGRzK37`qqA#g@v5=`Ia0Jjj~;wHgmPJ z+1is&c5ox=o$`WvnSeBZE0dlK1y{aAeU*fb_>(WK`WE}S8GrwNkIJs&$XCSxu9q<_ zT09L9cjJ;}uq>^%+6KbyF8}r|!>+;XpflQS(-p;NCQDzo4HS;wk?x{{$}|QS*1dX+2WtwCLAe(fa2eh}Dr>vK`eJF`dPy zmlBc7`DZZwYSHmq^~i$@REOO#eD_ZahmEhRP0r=43hdA9yRY<7&(vffcmc+Y*>kPG zZdUUus@OT1#MHqg(BUvxPhX7LX{q;CM-Jh17h77gw32sJbybNY8z8Il(OrqSActKy zDw_{5;y!B4J)V&8izuK%k+r;ZVKw_|dBcm|Ep{O}*ZMGA1 z9oYR_^cwv4@lskW=F`GGbs>otlwV=X!L}emLBpy@Ej)g>pj{4#+n|O>?23hxpHlqP z)DY^HcdJb}mFi6N=s+LutCQ6J#ag2e8rBEd`3gdag_2Z} zvwtbPe(d`*R3*S|YKMpUG9lwHxKu8TCE_fzP%HyHnV1A8E zt=1(4e|66aHYb_=`*41@@`i^QrQdsPlHQ9n<~`Q*b?t2JS`)j>NsC=p1>O8Z4Bj1Y zd;wgL%pzWsWB%&Mdv)D`s;!;vasonut%u`u9&riR=$G^6px1@~vu`M=fOdsqmkkDW z-wRGwnfq5b*1Wp4rjgosS>j#}Tk%(iemAO6B$8Wn*Zb9xuvtAAsNbTo;MOe|mE9rH zhX^nJSv$zf(cIA#hO9VX%4#^>3;*Le7C1J404^c?`}s;i^o+&>{Sv2RXlMSe_l5n% z6Rmv$1^L9{x_f_X5{tos0(C&=uigp*)d|x3nLzl|oi)yQ{p7VSM8fe?&N`FYlr%U;h7$8`Vv=ukwz59rfjvL75{t0l5-rK>sYDU+kuB>n(8N{ph4%D3gYI9;29yw~#J-g?Ik!#=}pm_UR7 z$lmKv3YiS~Sn(O&?Q|p%TA(vzS`;%OTWw36esMVNFxOf4uiMKp=Ea^BAQsW zYCvUzt60!~6|?p8tVH0h?(d0(!A(5Av$7c-l*aa{Ws4zTA0lrg3Fy z%nbPyXB)TK*^Fi}(W^88KfZA5BA`HgVNDA|Z+X#MhR!_O#d;u(!~vgX_Lr(JIg{5r z`HQb}IomAIzP}yPAnN%K?fd`N5DJ9e@c|R-2!y%`zzAy}(6V!#h&~RK^UT4PX`cTyRAA8T#?AcA`+oT^`Ic6N<9h`DL_V&0z*K6eF! zh=e-$o1ugdbe`P7ZjHyw8R7oad__@kbLZ>3Xxh+1g^{QuU?wl6Kp z=)OV?$%??W6KHKxGSIk!Lt~>+6F736@cO+T%)8;QmNnJ;Xkbg7_T&LEL0gGlfzkXp6!w@gk^wkT^ zr7iLBJjBeS_@^b^SZn!5`XwvEK6T66*M|+k2Y(Q|7gyLj!qAUEU=o>K%@uwYOz$XBLck#QzEk1OsSZXFkQNUSTK#arTUrYp8#Atk=Js zIU9zH2xU|FLFNiYtEPFRM;5Dm@1NO&Om6>yq=k7ztwy$CdN-J#Y*J{P;EoBVRS7NJ zT~uJYlPIZQ73khtGOBg=sdLN@*vzpw-K4}V`H+N_8!X>hjIpk?@N9K1iTF#EN(~K? zkla0fk{F;Km3;1lc@_m&rczImNrV+F12CEC)*^H< z`)|q9uGq^Kw*%Ww?YBG#AKWf)V*v!r=6~pyj|Wf#MS6p0&4R`xiy$<>h~2IeM{snj zxxnAfK@9Iu)N0UkmxHd{RTD*#(G)sSwi-fC7mgQ17Fs0p_(%vR2v6|pp1*wI2JV6d z#@!)3&iLx&!Y~D!dsNwN+xL=_m0AVO4al^^l&Og{XW*XRh;bo|7i5J4S!qR}@-QUs z$v3J@P)cO&IxOCxX{ehB1^$E}=tSs*14%*aQr{}^(I5>A&+ZnY1s`oSK>tBl0Ppo(SQ%(6909jdRg(g4MW)TG_v6wHHR;76w?gea#s2 z#pGIXulEdMDNeYd(*F?)g}p}#(4k7BWOhi;r>|QQ@it;1rX$os(3==9yfSA%GwQu3;znJeXRvBf78YC7*(pr_HP<&LRbcOWA-CMWF zcat%?cUXb8L(slhF^`ZUjGgUcbOL^!`~iPW@;*He?MJVX7#$%@{{=LtRNR#^SS2Xs~r z9i)SXFKoT~!lpEjj0jvm4m0f1y7(MgHSXfA#+ImZjC)Z#yVPeF`~rRcz5+9i2$nm1 zi+dsX8Qo%@kf09Dz_zR?b{=z42d&L=zehd|{GwQ2tyAWpxDC(*sG*5Q3TQG}^!JWX z$}uJmDyOS1Zl80kGgd?ye!e9)7fl>!t!8;nrp}=ICXVr7hdtLR$+PqO*_3JA4I;BZ z*@EH_)h*#>7STl^^Bg7*UOKbSG0=rU_X^TwOVKl0VqNH=C~11E1WX&Phd%pNRn4ov zW{|O9Y_y3RTwYp^RXburOJZ53$|}2V4Ov1%m@2hiex)H&VHDGg97!cZmB-&h{$o|2 z+Z>xL1FtRBhm$?=dpnUJ2I@b^Ui(a6q*LDEz416Jb2iZpVpvc187u_{0rIOzH#JA4u7`A5> z^17Wc!SLP?s&UpFqunxKno#>U%ba7!GncdLg$>E5BfbO}+ZGv?ytDWeUG^JB!a5fM zwGV+tUL$=_!`@3&97QQC=xAGDTB8T;&l@TNkq5N}QKj^1RY5@wbF{J6ijqaHYr_q?Nie zU#@8U(;n6KXa4tw*<{F-0zw8&MiU;MnEZ(e}I7j^|*?s>@ZH5>(U01BObl^zxATb`d? z@{j69@i|e<8K1ub)K4WnhIE{P60fJtHm989TAHS%VsfnKGp@X)WPer*rs?i7p!Co7 z%1skPa$~_0h)x

iz=+fLWVTTdDkvCUhRkJsx-bO!mh!mqLL3@cl5fxGHL7$er)Y zC#I15X@v8QPmazE681x=dOgX60c;)F-IE#?hxkGhtWjUkd!HAeWdYFmWA z?|0{N5GGnbcs_cKhSF{nF`>RkEmvb3>lDNX=Ephtg_CMPjJ}>e`03vh+E$-#poMqg zIMwj{S}Y~4(zY9jpb#S-BN`T9L`}eUT70-3EiyQelm1+S8n5)sP^xOzv$3Hsa)psj znU_|JSUZI6bqm*c1nupx3qfO$98)%@*1MC;zN1oc+3rx?SNc4$>`zZRO(kV7HsE)` zpMabyrwZM|FrRJS{>U?Xv7Y+%uC|!2mJ~0`;F)v-bGIQOw~crAoT9p^IBaU!xb;uE z11xy}#E1|Lh==5b#_ml%c{e#>#SSa%v;I}OFK3|p?qvG?O{*%Vr9cts$xNpU1@(+m zt+v%j3Z8YPUSIK57R#bPC~LSgkKb>*Tg^{<0T0lou)m^QtdFsMT$id3gF&|-)N z{j>n4r|NdM*opN$eN@K1#!kE$i^bx4N9n?E8-$28+~x?eOkayWIk#IKa)zI!nDlVf z{x@-ZDBSW~H!@1>zJa2_0NtN4)hP4J5KPWA>vf9bYS5A|!$pb&oeM%bBw`se%gXg} ziE-epUa^zvhZWqrBW<2ahps#qcEcgsy=Y{`^){7IpX3`Qdx#DDeS#aPwja1xP}x`+ zZqRvNq4}8f5Y7-k0SKs~z!6Y7qgP{^{U9E>SoI+(nS9nEtON=kJkKw~!aXA9wtpEe zxt=1VwHFk2YwYj=16P-Ld9IE}BhX(I{ZQqUrMzfOCzx;KxR$J8TWHsox6%5kz|GyS zhY5)BFN3e>SqAudl15(N!+*z;7`!O)d;khY(WW8{u|(#-8eFI}2W9Dj+G^-ghgYHw zrBL9P7T$&`P!}^6uSsqrzTbPm0WJG%7YY!gjl%&3bnuEH8viVB;n#5_r%>dAF@i&6bf5G$ALQLGAyg~Eo`N9_qsIe+NnvXhK_pU;L)C9OQ5nEdbJt>Rz1ff&%RO_q zM~KAcK&s>gh5YpTws7YZMXntgU0dW$B0NnUb4dqyp^FjN9zC2T$|7-Gv3U31tRy!= zxoqDTOU%ZNhH+uA>v#9WpUU}2v>$hA2_+C^-XJ_+YY_=lw2PbJf(V^_akxKx(1`1T zCsltrw%QNX1-dg_ec>(EhE$V1Hr%C9ihl~lm?ugBv|9~EGv)L? z=#GTl)oHJt&;@STteH*-JSBFV$#CjSs$fQ(+0ks_k%-a%vqKotd)+hI?=0ifpGckm zo5q?>2>JFBgX?U=)4%z>ulPx9x=PP;pxpBbt1M-#8&6dNhq0=z@PpS?9(j5m!h$aU zj-}aSXtT%ZTH(3|9U$L#oACudn^V)58vx#g)K|k4P((67EWZ=9etDv{tYQ%w@I_Qv zFFu;j;KI((L4E`8tM4&NVXF-wKZ z@tF6<(K+C~6?Va?#UzGs590~NZT9v3<&xKo0o}R|^90ZsPTAS(DbA@O=+_fJNL+g$ zU~bbp@*V6F&8&*0C!>4wM4lWS$`{I>C>ivuOW!kfgxlF%dO zD?drg!$ZBxS%eg{y?%I<9~W3I_lNA%@dF%k+Qs`ZlTy%(`y35b+KpVMft<0kIGRo6 zcjK3hi|5}~%OAL_A`3XPV6=e#0IQ%fGtf#Ng+D9M$r&Eh9OFg?TgkRv@)ApEmmZ43 zmiq8ppn(+m`ltZ#M%?w>uoQAi-%~zY^UdH#EgQr+0lMxYv_qhj4x}rD5Rk*aIEH{o}Y7fwjvV4bfDLD6r%k9i-f&-l3a*LaH2K_w> zBf2sRYH1%TBj6wRp&3DfSH-Y6k`(6K&U?`Q3&0Hjr7oPTy@Utg4e;> z|K_i~&vQoPJWJaDS$9;wRIF9AoewV^EY!^W%gnI01ubJu*8%FyxK`I63FpHzpuI=j z)sAroo?lOr$mFg(ZGVkwoLQxyuk3s93e-FNlU&skv~Tdm+k*UVF zR-=QaZEYF|`|A{EKFKVbRbRnQjs8TQ9h~2wrcn3_g@hCxSZD0yo-iLqK<3rO!s)qef z`Oj@&*LUv>>I_+EcBY>xIZ_inY-4cV*_pvL|F-&NA6)m`iay82-}VFeob?8uV$RvR zwdoUUNx%s@Z!Utf{I~{Wk(n7?O!1=#C+( zkE(>ZA*kxEJSaU@u2}~3mo+6vBbxH?M5%B$*hbKIsB2*QiSxdMuH&P%gDAO zwZ?48c6#9$FK^0iqNkXySSO^VSYr6>3k&Z;@&y)&!W-t+gt*0O$nf*MT}~rcm>!OT zPoB==10~gw+U4uZCFLHAgDWretZLLK?WC}tWB=tcXP8Lc!&EiRtj5x+@6P^&~#o2rP zN7VIe0VeXWZn1@IaLY=64fU~?t5s6K>XBk~)0am*MJIoVhmj9Z7%J(&va~(jo|x}5 z#P~enxQL9Feoe>PiJ$0wrzus3%zEDUr1liow2spZM*_rYX8KVFo0M7XBj zDn)?}Qhjm_Fh>ngC|l^PEholBcZi?Ieb_ra>Hs55ru6X+U}kA6D5(1NSszPaPVXP7 zz!y4gh~J=+$%G;Lmg6aNKSD^a56QYQnM`iPs^&58sK3?V(?yH-j14EynW)VC*(wWc z1i`@DL~T5UQ}Bj%{WDzZ+-*4Gx{=;i6XfbU(aapt&;nBf0NY>p8krP;I7{+Gl^zf2 z#NQFhy5Ph2-c`X)0Gq&WfgnJAum|JTEv(?5*_DJ1!5^knUNrzIgC%MikyC}I(Av@kcgDk zo0?y*I%vml7>E7w!1e4Qc4wu0oj5ezHTNzM*`Aml^G+M^)dQnXUoY%-p{jKNesvN( zlw+pB4y(P~Z1suW?t=Z}@=$(Uwcf8K9uW=N(T5%g7xztjwp6(QsZg5gPP*-`Pt6T@ zWSB+Uc;hO6q<3^+!e!y<_B&#|n6lN)rIGm!wlMhbM)q-^!tflC#g38t`;Gf$CLzz@=}YY8s$_eI!+)wkUqmg92kPd&-}I!E6zb;#&Iv`QQMI>o0dGxb zxeT1@>-}T3ihL+zQfv!tg>h__C3xt}I@~We>t|Lc_Lcya z%aholajgIwunk&1B!QF9N{ zVFDDAUjP>T+`JDd@r_ZC2jXs5aL6TOkOg+IBl<&@c<>C3_mVw2B%BtkEWpw~jxLyn zHl^&aRk-t`Rm{C|I@injLqIIA>;2Tnp{PV;W4Y!x+X+V!u+|ZW^A$AF;sf_07Y_AC zjvxT`e5y?PmA835Eo~ zCbf1{^*APq8FH@g>T`V+SqA+SeujV+1DKKA$qM`H+sHpuS_lR0>TXOI7zfFbd}D!j zL`-KXoqk9Nad)5-)Z(TO4VV(MzDmzN5;Pq;QM`8u;3~BY(bhUGx&$996W`c5e~bxm z<>p4{OmcjDXhUMku z?H1pEzU>R-OivI*kL$r*!v18oZtzOQ}t9|!i{l?P}nVl;#w ze|5E%ulf^!?$}Q71y~Tj(Gx-S{5|x}%v=Gv8VSK_hNt1&kEPC{euH?=$p4IRdk7YJ zn8a4y?9P%jA_vpKM__~|AdBPHu1X$qs@TXTDI0mSN>^JTY@v9p0&?4;;N2_c0tXke zTfO?c+eSM~aDfWqaJI&R0vzY${s&D{P^r!wRyrC6cCJQ)5IRoaX?`f*Gwl@8X?SvS z84*I;5`r2zw@Oh_U65%{HvXz-K40QRgC&b7nCE)V)0=||x}Ax7_daU#yIaVuNsYHu zEVKf#mcGtQVf<8A{pm)VP}m-eJu|*bXU2+Nra)JwHEB*VL07RG&>c$J3RU`c-@k4E zu`ahaVcteO=3gzSN4T_}5BuaN_@R~{VNIu2OQ-3g^)*LrauB9EFjlBG4jHY=bzda% zo4({9L6b3SLS7@-oG>Nl=m(ls#bBy(`c79)n64s1xU)SiKVDBNBTtvB1%uSOh@|xhKsWky*od~7|C`Z7&)s6FvbF&+ zz)cc-Wl3<}^Suf|8t)&D@V7M8imIPwzXyy-qJYStekcyKk}wsK70)0%)Tt3RJ)K18*yRCP!+HJH~?-Ch2%&%+$Q^Vq2+QyA19uBM}K7ijh(Qr_xg>r6(uCcZk^PG4>{FPz(BOl>&5Q z$##IfxZqUfe%}Y|EPYn^gy+Zl+n_Dd;5;(G7udfZ-}6^}a)Amf8g4AC&zZ z$WeC`V%2B+)kzIuFyRLBEuGEEll9`d@Mj>ZzgJqJL^1KdIoUmy-_rUTIZ9Jua{a$| zL8PSAI=M)YalWV~J>q5f!!-_=pZ-w!-|9Dvj?b7;gj@czg7+Lfhk{^MR+6MksP4C* zjekv1p!IyYur#uRpYX-yZbmWHQuy4rLl@u&a=&ekw6;FLCiEn2UDrmMkdR~0b$p2? z!_Ex_kQyN58I->Lxt&Hu{4WnD6DM;yY>R{Jz(jEAw3HP;mPMbG6ngj7F1|W)et|)w z_=T4ftjMkJTIE?gs(>o+Oc)ku>12T#Yq)Iq$7^#(;hy<62!rBealr!(lGq|FkNo-z z$aDyHI7L2Q$YvDPKG=W+K-@O;1M*nB74j^>09wdFxeN>fp== zg?J~HUFgkq%??+aMGZu?DowU;SU|AZ(|uP0E~q#+(pMn{O42kRb5Q66PCOdWf6lb@ z?_IUU&fsAr>vGhioWyE}f_poboUBJHr{m>(0S3%{%&RlfWA~@=6K)N+tE$_))A~xMqSqtCHFT?$3wRms2)fu0)T(sndyv61OY$x&Cc zGwG&2sqUfF1|V?Vf(d+S46!1rUd6dO}_ zLalZxdcUQn(fm(vYne`sja+or`V)*V8Tj5`Vaj;9n;e<(oDB{}j#y-VRR!IC4x}gm ztGXBRtfOMhL;VXjFCgtB3uv&sL8sNI_IC9kIy9ghkqqDgxj20D)4w}*i!W?v*8brN z!?0Ig&4Q?09o0%2(-D&OA`3{ksrHKZUu<{T*#3J;c`&>Dfe}_AdZNnUqkBe-TsIM< zwVq)}2d8x`Te4LL9L93 z2fcZxYP!R-I>Pk24e9uIw{(Eg+;*r!n`o$_oCYbOhk3|)QR6vabz}zRa+n6P$!#Z+ zeM^WkJ*+PWv(yePmiNhcO|D0n=Aq)tY=V9Mfd}k6gLp9FY@_{6LJZW4rH#;_qT`0= zCiSqX$Y-Ey;`A<-CQ>RiRj`nMrUVOZO`02|($i{FI=gQA+u%fQElv*M?thj?to@b+w=u-1 zgGc+Vi%~LAl=76WiTMebKE66(nUM`%S0xeAMBXF=poJtoB^#-yR0aopnWe2FnVx?} z8ued)9ZR5)FH49A9oU$8J#r+#gVrdH;3TYu(56uM2F!IMKJ;7pPpw4(1VXBT-&%m( zj)4oJdLqz5{FPB!9v5bhnc)J!T4+5V78hvC`EqzJ{*W@O0^3+TNPFOA zXx7K+$_6hdkqq6Cn}ShNYon^i=H|(tm|q0YQ=FqePl7G{aHF8@Jf1%nX0vZ(DidXA zyh%ne0BiBOwUM&(E+j%biuqoTh<_vpvlb`eA_8dQw=hUy{`@j8Uc*LLt$U-yN^U*5B!u@q}7)B*Pj(?+ZMd zfT7VENQjUu9lgqOufwQsU3Xbj>kqMdx?VkBA`hBx3?FPivZ~)cXcsG!6I{l-|NE;$ NQdCZ)Qb<4W{{bv^z5W0I literal 0 HcmV?d00001 diff --git a/app/extensions/ipfs/img/ipfs-16.png b/app/extensions/ipfs/img/ipfs-16.png new file mode 100644 index 0000000000000000000000000000000000000000..281eb243f0d76ce79c4f5b44faa7e099a9cf6445 GIT binary patch literal 1284 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pn}NEkcg59UmvUF{9L`nl>DSry^7odplSvNn+hu+GdHy)QK2F?C$HG5 z!d3~a!V1U+3F|8Y3;nDA{o-C@9zzrKDK}xwt{K19`Se z86_nJR{Hwo<>h+i#(Mch>H3D2mX`VkM*2oZx=P7{9O-#x!EwNQn0$BtH5O0c3d|4@L;p!@;Rg)$-uzu;_2cTVj-9t z9PKm3UF2WdKW?4V@2YO9vi*rP)KK`!b!35IT$Jb6qsygob8?cLF0uQX==O@$eh^ab z4S0X>$Aih8)3=9R-r%ZgbMwloixD2Bo1-INzWdj`VYkkQ_y5nAqzRsGp6p}ve0K3Z zOCZq@xq9L5=-GzSw{K;c{l6i3>(a%m%IA%LKPWk*Zsk9->JvILvezDp1#?odQB!1SiEQ%4 z3?t$0t>0zyc54+%Mptb8`Ql@5qw7Jv^N&_t4SCcz_q?@_Xu8w#SPSJN*Fr*-5Baqo z_CMB^#QwWq_NDSBwfcE`&sN#|+i5r7bYW&zn_*Ull*~E7?XoxK92AgL$(hajylC4* zzt?^yN#BmQpY}8j2>E|{@4;g~KR0h|WDLud*s^8~&)<_OcR~)H+F87SdsF+y?HL84 z$@g6P{+fv_K0hh#%GbZ!x4vSW_^I^vLUC#754$!AeU0O1YrnT3Gg8*&R>5j6Ih*Rf zd@bz5}d43+{Y zpL{G~+kRM3NAHrNyuN^lhfB%4!X2Wb)vvQJ3i~Hj*s%8+>S*X6ziB`Jks>+kv{udNb$JY82#IxF-kPvpqk zXR1?f&7ZRCDr?uG9v3D5H5WJ5*2nA=2}`xMQ&{4EV#BhhMdhon8~B}Dxr(bmam9*| zErRVn99@fgkF=eMvH5s-@n+e}Yi<5EYVZipH}$!_KKA{cyT2#A|6_W@{;k#V?eq2@ znccsozGTJ|{`UIDEt5b literal 0 HcmV?d00001 diff --git a/app/extensions/ipfs/img/ipfs-48.png b/app/extensions/ipfs/img/ipfs-48.png new file mode 100644 index 0000000000000000000000000000000000000000..34ed19baee776ca969e255e8ab02b5d125aff993 GIT binary patch literal 4326 zcmY*dXE+>Mx1P~E(OVF`8znNjQAdrMXwe5l7-hsrln}l5NYsel34+8?hbTex8ipat zXdz01d~(jY-@SJ~&)R#fwcqu=Ywe#q*2qwsl8luM002HZiH@H&_I24D#{vp`xH=*v4HJjETH5sol%l&AL% z8URp4$=|r1Fr)()%JZ?8pFB#5`)`E&jsGVt!OitI1nHr~ZDC-2tW5&;1L;sMg)2wztTNjW(=36PY8l$6*FLd-AF z3+aFo^YY{Qhva{FG+=&CzHo0O9O1?Fhu6Uo;g3|}=Kdq}-}O(QNVv=YDtY<+JJ!vB z5`S(aB*j4z|K+|ZRs55czwZl&-6;RzSC&-#8~Oio|LQ18{1N{@&HOXz-`Sf{mB|z( z{`+joWcobr!Y5VT}eeO^oORA%k5bF(LR{O*YT=@Wq%<6J(`0uHkyB5oJVZK;Zk8(9Mol zXJ09Li<$(EzkWDd^1D6`{rz-5RI8}2YI=6~Zb`{de!Kh&ov$66)1*F&R_NI{VX;g5 z>&vU4N0Z})dvLFo^1qZv&+M9Y>@orKEoL8(6%!VA2&oztkB~>~@50B1(oT4$*L}PT zSg3Yo(X$_xBde~DPSR_Z9$MSg$%pJye`@xb zCO|aP3R5EjZ1_OhVUlQ^n|2xN9*$R<*30ZsKALkh^rtC@Y0e$heLc@BpmP-Z z$8Pk18itA2`f1N2GmY9Mo8i=SCnxR^K8)YPVbso0P#!^%V7>g})CUabqr>Ex2aSBs z-cIfY`s^;Xm7xUjSp;#VK$;h{sT*NYM9H1QD#@ZAVIp;0W3O`5_b-FgP3A_$=H!Y| z9SPFf6=D$brpQp<&%z7yUxWsCcB(&C+g+B_ijSC@1Y&)v!MIy| zxX`Ove zf=WVlvpTlkMvmb&ZUe||3~WIx)9WFc$AM*0uX7Bz_`zjaI@eJv?-k%E&63+*UFFbv>hy80OP!B8SD|z+e&|N$p>lUaXKfzl3t!FrljV0-KwfQZ1lc z4dueC>i~WSMU_^trq**D2hgdZg!@hsNRMNO-1DM+jdIbnTm_pb_zj1jjC`KAUHc1+%qwLFG1|rsRqO;L`f;Kvjm} zhH1VZqgK*Kiqz}EHimJl7!Ih7mq!UL)aD&Xf~FWB#56Qq2G2Cds;goydL*6+9St2W z<`?{hKv71%>368_H62s}y$^J$kuf_p-+5;8jIU=2cNP7K*qV~tYA*!q@ESSE zEF59^d1Sama3qc`XJm#>0Dcr1kJRqE@7gt9LgP$2Dc5M<$V^Aj`m*Jq@ckjqnx=;^ zyWW3`#JpD<)oepzOnm#VQJJC;RvLQZ%e8H#kz*&s16d^->C_<%inA+AMJ3n@uZTTNa$q<{#}hRZz5kHg&1YFN^}WC?K+#$;S-;; zva51-UX|{YLbNd>92%7~JMOIV#q|ODf~99_u)RbUsff*FGE*v5mhmhBftSkUk#Nq- z!uFzY8R+>J#1iEFL#nq|fDgw@fj`-rQmLQAKmt@_FFju1w=RjExI)yV1ZlB~5Jeb?hu|RS#(^5|C zk`X|ov2yWFRXW0INWdFOVkbtgMMLWDume`P@F*T;deyhKAVuIpYejVinaV|mZ8UXa z)S#vbldcUl9^h0uhBUH^Mq3ESA{4$N3tsDNzdEsfM$DbwFM%Vy_WU{hA+%Ie;mNo< zoyR8vzq$CX7QV{JUO)cpy$b%P+vhs%)CcUQL%LfW*;o>i=wK(=OI&ca8NkDhIcJ^- z2#Ps}z?jlTs=mFhn0V83^w=GOUA@u|3{g(JZOd15-&ZpJUYNSBU=jsqH`q(uxf+xm z2iO8b&mN3;Mqkt@1tolyo7Z6D{8%8I67Ac;(N5@c8e*+L*(M7Z+#tS&b?$Vn5zdL% zSL-=Yee_)Q)VRZLiY{8Rps2mXYuD5^47>2&bg3Zj4kD#3W;(u(tI<`60MQ!m1M8_% zBh`f*ETRD@#N8CAL=})@L?@Ds>FMFmJgw)EsqyF~`*C z`d;QyK8h4z5Rmh{caLt{5Sw&RAg5;l>JZPqQ-`t+WJ%P(t~~)NV3u#^nUVOd`Ab== z04%I%FnPry-4W^!%Go;HHrL(-MD|NEk9EvQS(t+_6Fw)@X+M7> z2ubpN$a%d4`J5lY5sxV6|Ybq!zrvhHy`O;F+obx&R{PN zsToLxFo2L$ufS{?rm&vb%Ol8I8CM&70`(oAX8RByM+HDI2_-`pGNjFq$pGP1n$z%T z^eixPvfn`$=(eW!_}lLYf{REM)n0&9mc6pS5>Xlua7wWmY>yLVcfZAruQ!|cmvPG6 z6X&5$o(WK@XaYtfJwuspy&vyW@7%qlyuvYRjzUJh-~|!%UnJ@g8mC&*kvAqP z_&mx5iMVi^vg&7>kNhfl4903`;1HU#OhiTlkFlh8@ zL{UIJ{!II6g58N^QC$g8bvr`j6Dl#@*wCDTmYOk2m+l}b921tk&odif?PKR!IJ2T|(up}yAmI*ECs2;Gf4;_;b<>C{?L&H7Gv30o0FZt3SoFhtnn{Fs-0LU$ zthuDsN6j)WvV*N4xolC76%uXz?9}QWUf2}al<7sEPhYPlx0lH!OU93u!ff=0dM0F5 zY08n!*+1_74vx(y&m#IW6WWekky-FtdE8`0(UW#`Rtcv-7A)U*ZY>MYpqX~M=C#?u z_Vt`;81}@T^PBKntIGdv-X%??rv#53sHfqrSE} zToaPGMN{oKUu!P%Td==4gYlO>375Mua1&^~sn|SUF_(T~wCcKSV37AnAV=n$P#OWn zX;d#@!^0i>AF9Of&Za7d!Nd3`qf#g`kXZX;LQ2h=(N>P&uP5#Mb3Z1?x<9U_66U*I z!3dGfiHW-FP4FIKj=3f{YKk)i$gXlH&Kj(x7Mlm5u(2hUPGO8RGTi|`N$83x$6<{suvuM*1v!^+4cNgB?-8VVXvv_OlQ?B=<+M*$GfTaJH zWj76RWr&z2`&E7{6~7TV9)Oo*>DL0{JO(b=1WLQ_{!vqth+Y4jSU{Cu@J?)`krfLR zf21Ak7@o)0V3C~XbQVkdQ)k?=-ESj4r>}>FIIalsyiNoUI(kb07i)SxpL6dU@_m4K zOwNoV!nk1!9nA?=f4*Jb0@t;HkYh6InN*D>RkTesO3^gXd5sQpX`{UHtFXf2irt_# zF!tGgTi=}(c6LE88iDJ<9};KJrU3+D6cr@5W5v;Di zQhAh=pTA_GPAW5Mz3bm;rE|wr(8gK)MEBC91d>WCCOgn>ggBo{cM2VG>zN zIeH=Q5seBe$$H=UzsFAb?-Yl>BN883vk|jq$2Lqgl+BlbZ|gk~wYyeP-ZIn-^T5~( z{dTWkZ>IDIRcU%%Kg7qCjkxuZ6zTU6^9jqkYJpH3Z+y}E?~i}~sw0Af!MM`PcLUX* zbK*y4MqQ8U2>lqMdvC2a27#Wddk1#lp42WF+pY8*)2#;H`^q*sxn;ZYx%r~YUIW8f z@!QL9rGF)PR{eVV7WPF<=k9#R?#$l$_Fcc#LKw_$v2*c~>9R2C;Cp%g^q)z~tjbL(?dSkAgm{f9n# z3S7SbM&ayh*UQ!pU zM>RHxBSK${K?qb(MLie1{tPYMS_=$pkQ+xKuj!X?Bqv)v-`OuyQu0|5geS>Bl_M!2 zh@#nWc9BWDnR)c!uFwC_ne`J>y+@5LZQScR7^nxaub#h1pg3UaZb;&vUyU_+9yEN9GbD zW~E&q(833-wbspQQ-2L(O_M64<6XbVx{YSnmU3oryFxx+$Qr(f>ZUe$=lmHbCXZL}pUgOadXm!{Z8AIGXzN_HOq~3kv)E-$Tnq zjWu6P9S)rsr(ao@t!bhq#W-|Zdph=~F4Q-ZAbNh?pG%6i+tryfl7SD=E4Bi0@epBJ zh9ZZ_?)bkhO;B4-;x#tYAbJk}ds3^?yE$J(tyM~3S$)8*d1gC>kh%NkAcY#2h@>17rEK(S2iI*mq5M zBx13iI}MbN?EWB{eqO)eu+qUlTRyWJM1a65K%vXQ(XmHTM>XsP)_T%~W6mJf`|Okcd3$ z_=~vLUskc^+ke$F+prvxH&mRkT*jx`ehdbxTJd<1*X`*dQpLGC}unB)Z6Ml3%frERB*vF zt3)MD+ocXqPG~rFmd~^-`~qFoMqST4EGL>)fzcJd2af$haq{$}dfj0_x2F6Ku|kni zpd2QvEwiid*m^r1VpC_>xw}T75(d8ZK78Qjq*-dtf0YI0@*Qr|&)w6p7tCv9JiEmu zRSoVf=W#It_ZpK!0F9~IPE)7NBLxsw20u}Tlo~a2+dD==( zedS(i9^Cs!>RITU9PD&UnG@>Z4|!^dnSA=jWM6x5G&gyEYZATYE3R&V97XpG;}5K$hwD4AJ27&L>+Pl(>$JpW^wUk#27O3ovD%N!zfQ*I^OySmg`Q9q;~@VwykS z1?fka^%(hi;r9}ZYv?PJw#PUM+gH?m2$T0{(-mByo-IAaaK5?ykg|$Lw|R`^=Fwt3 ziVAe(Q7qcW%7}2D4NvXhl{3?c@4ue0zm`e)itamBosd@Rg@D?@QR!K>Ur0*pN~5*p zb$`40-IRi`_N1zR|LrfSI{0FKDc-y-S@42>d?s`5OLsHqrXR{F6Z(^XIo;M?R=ZpK z1?&nkm%uE>a*AuL>W4_ag~)pQ^)^IuU1-k`SlK*W$)%(*+psTJHP=kx*-@Zy=D;vl zvVM)n?f6%Z*3kzd)rPOc$+M|_Jqlx^G!YKp`K$TMf-2_yk-6>xC2hlpQ|#V|$ICA) zATo;eTcwQ*e0?^FZPJ3aJJgm>mp__`7jQr5-&THi=A;4@xD*a#z{;%4MfF9A46wsf zoct+*PUf)j@uysVT;y5D>)eD1Vqb{y-Pg6t{us}_Je1rnOuI+CkQ_#x$nkwnfPC2NSmBs2_IP1ovm<8*w78%$!%l72z6Fm@RGyW%dDreoE;v(IDqJC z%?XsXo|-Qz9(@{AewVaKf!NJB;O9r-@G2@*Q-S87W5khDsI-WQbM6>_DskIc9~V>C zN+#&~s~e_P0$$C8rJOp+v>?n4yBBS&rOKO8b@F4|RF_tdIE}eh8M_lENeE+XJ3Lmh zi^Yz^foDAv$AuIMY0P`MRQ0UxqkYcweV;qi?2PlJK`4;^(O=Qre9U6Kc^*Tl>~ij2 zrM>A-eLj`!+f_>Q&T0R2!vo_9fXEh}7cE!SUnPgr=ynFVy2D*stOOTG- zee?rE zEw0YqMSu7hv`VX{J41@cFeP}ItfxZrT>;&snl>>-MSIHbiQ|pvl9{E;?4P;(8UdK9 zBrb$md%yX7UfiPnIz4uoaiDGlW3OQ$=8XoautctEfNb0vV|Uz6jD)5I)0G^vs=|u) zOZ(+$YD&KM2_#JKKY@7hVKZD&`%VYp9VPqw&ATLWAp|wBMBYL+c{v#@a%)XDkRb4+l)))lQ_#k3RerK~GKA|>b0`g>npN?!ZaPPE;OJ^R4_u*?INDj%~6|cF3061V`tI z)MAOMR$_eE&R?=mhtG08u$F9#E7+EoJw2cJ=y9k$S==woxO$%>OW)Po_1)Ri@i`p0 zfdHl}3B1N{-6VXo#7;#(1{Vj$%>ylT{a*gwKBjyv6=|b={usn+LI3%iPUapoTMAebo|TgV*r_M7IHSgrd zDsIT5t)0O2!vZ$>o-~kme&0U(9{+F3u+V&AJlAwrvUZl>t#-N^wgsdozC^Qi9=WwG zhOJ#{63N`(H-6(CNUwVk2(%j?vvVQv+l;7P1wK9bNX9P8=EUtn_uR#$crIO>g@zaM zUaoYiZcQoIaqqoCT45!}C~u$;{Q@5j7T6c!MRN&3H&p|oR_4A#$*E{j-ZF{wTp`}I{O~)Nl$*i%=ovQ zGXeyCZML>MGn0#~AGJ#to2>i8TAtrR^HnC$$X)hTZ@vnMn}()i-FN}Al%HP~eUK7zHeSMquNV#nMvmIZ&|c_WiOgzyCh_?W*9m!b4W;peM z*cBa!*|LXTbNCCk9oB1IvhTj3`!0Th@0sy94rjL!Ua}j z5g#uT6G_KQpaI+_his(otV?>Lw1G6T(2G%`7o8WvyLHq*Q}#Z(nL3hP^<6EHF<4xl zHERDUTF{gsH;uHjn%7Rb??uK}w+33R(Pl|=Llu$&lmadd>p7vpnl(PWCVi)m`l<~6 z)EPuml095g(`>(Qy;l`g-9G+2l+^U>kDgJdR?|zb3#Ra;ush9Dln623W=Gabn9k-` z*3dw+N+XQiF;gOSj2`^DefCncthzLoKAY>KM;7d2JX6odOUvAD8Os7<(MGIY<3srR z)>(WTXoC_Rk&$u0%Lk&aOxI@>dJ&$$lQ!R@iuP!to77UDvti!imXc~t9*Twb2qbG4+M3>^&3_w!&!WLK;M%vn?BHWb;{K-;vLmy|%t z^hy#}JV>j;%>moRHlLx3DIO%UabhEPFFB>hgotREO`d_2Za6jiooPVdplG>Cf5D&S z95Nsr=Z5z`y=?EVZjS>m*vRmUzw3r>Mzv{|@lYodyueI}Q%*iCz%~xbP`14({#a$| znPC*dip>ilUOiGwn`d~q&`VBI_+6f>IZzFKQ-Bi#J(iqCT~wVcwoJCP#NBGQNS}p6 zAunvcpS2BeJsu}>ml&!q_81uC2skh1B`7|2M zDAL$fb|3Jb6@VVzKFXQCM5 zV5*@fEf;_LEpOwDLi+G|As^O@*hN^`m=-#I4g&MEix$_Wd{6=$P==SK6Au|nP5l;t zVgDPcjqC1^iTRV9k@nTV0+eTuldS*nByqQ-U|&}NDZ4rSsUMlq+;8>IyA&J{hZDD^ z43Tjvldb!PM*XOklV?TjucLz~AV~l!=Gwz4sB@ss1x%C@m1(ed)s~-?|nzILDJ!?TVX?F7Eeqd(z{N;|68`<*UsQ~vOKVY!>uEN6R!?cu)t(95*e8m6<2fv41m)is z5VlM2jV+K!SJb>c^3^yJ54Gm~4(&(yc|DU&qv8!m7mF0Gc-;RKBONz$w&{c1-SJ<_ zMuqhP8-$ihY~H*}Bv7%;Ve7=h?;JzoaSOJ$wKTOW%vKq8pm&*)6hG#Lys`zcV)BKw z6-I|qf)j`my9c$^{=*L5h*0`=yV!7iI___x&Qozm#Ag4BkdyN#StIRlLrW?07gO2K z*?Ph}@sp0`?tv1>O`+q3%Etr{ka~+{)dycj6;HY%u~H<(XZt3OSO|!w3@KqpmGwcRDvYx z{U`3IFTH{*@Pk7K{$om@o+U>4h+l*~4qsu*U6 zNPGb?aOE0*#RDX30+sc^4;@sYF!+n2rW%H|i1e^Mq;<=sMsI`$odx9e@_%UP=|cN| z9B8hOev2*H&)4@#Q2T<|u@z%eJ~H{%_^+ zUkwZ@4=C*E(;)GC=0E~Kga=3E-Bau_-?fi*bAwnRybv4Pab4}fDl&J0RruS950O77 zN5bF0yG{rZMMY{EMx)@@$T2Ha z+phKg{Up4F_GF!``^1DcBSc{K6_^b)E;?Xrk?w`0Bml}moz~2qfBv`b=zH0(>sLDE zKB%&4FEV7CJJKF`W9a$(UdWy_BBPLOz}7q~>reJM+#$kppTTDu#~ zZAr(Is28x5z1FbWNqL_8BZ})xbo_^xVieTr<$ZWVgm(^@7@nOo*ral(x!h*NHTl;M!~0VEX^{N)<$Z`wi`_~W;)o`y!r|>i?)@p* z#gtnmACgsO1D}5Sc#wR^#?yAL$TWfU`M2!$B&n@i;UfyaSa27;9uQD z?%f6IhRvG6(TSHoHlIT3>l?qoyQq6U#LoXRf#mt8a7&2#cm4epC)`?D>F+!2gO4yNj$N zBxsLCBa??3XzMTY7K)#X@_qoOFgZG!Iw`aPW-XU5P#gPpBgEc>7Ci|hPMGur7M5DvQX}m4Zsy z@54OQLr%~bT=?gQYP3rNc-_5u()57@FW!APnP(4*YDx(%KQd_Y+-piwM71TFbaeHX zfcE)k^gXb6Ot%nhzIIH1|FmFwqmQGu911+cFQdP%Io_D15%eJ2$m)=&F-TOVG{4Up z@afH{I`uC;ufT4jW61aTAkG}v@Py#_H9P(*&EDIUlJ(;bDEdzwiq6kU3T?mEbPE-s zu=iWv9sm5m^=+?-O(P5Wkov*v5To}LuT7g%G2jsnVu~-_3SFhZgCmw-F>>$EJDFQc z8&uYS89A`Xd}%BJnbQYIEWrb3mWNFGf_4yKB~)Eb)WT#!m11=HY}i_IVJ9G>8D|%4 zhqg_Q736RL&3*o_#0WiU%R0h=U;>fYg*P-D6V#pAqfl1!?c;X%Lgvtl4FTKNm|-A^JrjYRV^pv76-% zg2}@LtQ9Tof=B84OBk}_MO7#Q%YUySOqn4)Yh!!(WaO^^Yya~M4^2x8qRzLH38eil zi}VxZ^!4)U508=j%^&v00gcNjFtje(#T{ReHmCa{lA&pDWqIy(JO z55~q}W8)9!w%^_>nMGn=;b-I-Dc>LFbxk+T!uSzn*IJedh3}*t9s_}|Ex>UbpJjnP zKJ;;C;IB z>WPe|18F{=Bj-CGEU=Cl&WFxTqI&mBTW+eJYRAzHc~Yb@gWIMYDRF%HQ)IrqLL%r2 zbw>ex9!A(Hn{t9fG;apW7>A1w6@s zQI0t|{e-^R;e_Q>t`a_$Ia5`z5zIzkd`}jzcT7#r`d!FbAgV&dW6{#;WqH-(REdfX z09H**tL~Y07v?A1okzh0}xO~ip z<2&CNgvjqddx5|3pS>WvmqD(SU=$v@a}ayfDa?$vqtL+Fl0@_nR1Ru16&dd zhW;bxjv+7G{#YPwc|(|k9%3MM1ykGo;{tcCDPE(pHm1RKzVIX^1ko~x&`!i0DAyavKlN!`fDwJH!I{XAymI3)Kw`1M}#nI>e;A^kf z=uObB&Gf3F(-n44{<)90kl~{0OfIb++a3wtzy1uC`_jY}T8NTl-D#2+vOFFHC{A|%hRV9k1K z6&>nZGCQ`a3<&B+wgGx1fohch!|@;OXif1QnX7IRe66L~X0VaoKS5@Z15;Y3oB9(R z))8WuJGQ3PNC6iX3ZA_{`>(T5<3Frvh+z3rP7QKgPh=gzC@b1`1ub*Up|I%FI50`F zh!$x8Vb6aqW%8crSBq$_B=c+(bu^6og?|I+8U~~D24TXwo<4oSkj;rT0zvvr~RB6@>YY1&Ni$ zDCM%B2hNhk_j6xI316Maey_B6U$SS;DMna?019Qod-b%a@ccEu05BKSgGbLkcW(8jK`i6h$A0Vs$< zD(IEj#xmX6;AGY-K|fsP?TUv4@?SVe0jfXA9+Z?E@bY#5Z{QUua7-!z5p0@`5pO4? zwuMFl7+WXtUiS$}_j!@$0yEXNWxm_fS1)nJAK6A_d#@{?Y0bp`75RR4IWt_*UW3b& zrVLjXh!Yo02`tMc{(8m--hYX5-&p|c?m9xDj36jkFGw=*ucrRy8`L*18wMltg0SP# zlEuH(lGe0S*Xd0D41fXaQjvQfj2=f#`>LS%Gl*2oasQK#0(c*d$|L{D#ZdSX9`NyG z{b->n^pkjEtSkdU^sWvG;=@k)hdYq=im|`YDK60GXo8$BBV{b-GKKmKNPk>D!kn8Q zb7Da7l}~6w1N6G$v5Wyv+bXIqAi`5nU9)#A={^=iT*FNsxj%=kFA!;9ik2F}w?*(m zSDg_R^mzLmVR@4^hPetqDAPAJGgZJB$R>Gtet!uPw`3)34oMhT@*dSR>;i{)Xt#Pl z@?rj{29=w}>1mz@7K;3#gSXJc2A&0ki0gqjPo^`)y=G2MnQzuuBBqvPm^=-^iLD0S zCo-}^zdE3JWzR|X*CcM0cQpODQOX$_(li5#+5UQNM?ya8fcczAfrZEbXC-78aY&d_86ao=_Scm@kdFV3jIR)Y!M&`2=I z6qUxtTj36SMmx5I*^Mq83u9o62jhM@`y$ZqkVFbrnJiHsuP@I|R}GJoaU5YqWHSSK zp9MOs_j}w7TET1$9C6BU@s@HgAbR0Q!*ybO9(v?Uz~oiC3Qtvgh8;EVUvv1z0gA~T zKl6wwI6KkV(V!1wUOPT>4W0R^6|*5WihStgoy&xs!8-dBcI>dGpqvD0dK*Kwqz-YR z09T=?@9nrTERLBKIHXS1jm?ooys3RlHZH<$a$f!Cv2v~0Cm$*m53o|kK_~*-6z4(HwiY&*(ZzY>foy>GA z(Kf#tKFPK)4(WSjjDv2>DG=flz5tIKWcc!$;mg3HIDMGcV@xUqMnmQ=#jja9T=&LA zb4{d?2HnQ0^P}9wg_yJgR|+~mRvpLQE-`R*lac(WHc*zw7WF<$31$4`dfkR1++-tW zgn7yYvmob%B=~Zn{n1*owD2d7V2PnFCBdb^rx2z|C&4p*mGfA9>1@?-v~xZTO^=$o zV_#Y-uJn*Gf=EH(ShywOHN&*nY4UuPNq=Xij;-iG8XV(?BL}03en?D)8@j0TI=QQ$ zsBh-(pQwC1YX59od-IZS=vn@@x~!dewbk^)GZ8un!yVg%5kX|rKlk6oWk_Cb)3!Lm z#_sOJ?Ipu&cQZ8QAZcz{H}cG72Mc6nY|W{=GI)ljt=ta1h5@-vcUA6aFyNJCjwhD09TvK=AgY9s3}EzYg-n{7Zis@u}$Z+oL9j!`o5P6@9%6UK%mm zq1~r%iQP}%3UrhCQ&S)C(}q#g(Aay(zWudGMe0($vK;NaLq&@`KifmHW{*MDsvggw zfCw*Tn6e)4y}q+<;&~>r-`;*!qpGW?XpV_)cN{KnxBD%qZllnYz`@YUp7+~q7t2pv zYFr1C?6s4p00&q<&o5%f3porr9{5Q*D29=rwCQGLzr`3m41vx_d@I8@_Bd0xT)x{| z>pSRgy%5m7R{EKeL0z|jy5Dv6T3<(%@~M0fXdoJ+p_=J6kuA9$XSoUg_fd1J&VR>) zUATQo-=e=M6c41)pvZ)s3=v2*OB}s{U>E`AU;uRYY@B>e<1(7l9+uzjzSpy2v&F6-!`d{;IMJKSepHqJuYYe&r{w zG~@A2M_(EJt12`WtpPiOyiv}p>>j4aqyNZZWuz|Ne`6|Edwyf8P!YDFdYm@^_ZN?W zSop4U5q#k%?T;W;oq8RXF*y-l*0kd3i1xtxc~H9lup>owqqE}G@;*0C!$ne0-yupW zndXx*$QXgrvq1C);&=9O29Vm;6;C!BQCUX{W^IPB)$06@7U?T}J}2Jyub_JT9rdXI z69_VxXt>n1UmQp{Hg{}2nBP-KDH%RkjnXL1F};2IsdwYBI3Q$JPip*rPLyz%tYd*q z+y8h*YfcX<<=ZA7WRhJ!{5-=+Do#T(+TH37B^9dq@_tGkL1A2X82RBuAgf&=A0>Hu zEOd{xjP0jIkFw)cYaJM)$?3!ys5tx1%~{qmu$vnzOCg_|e{vehHS0O|{wNN7HbQf- z@?1$j(x&Mod`2F|#3d92he(u>W;U&6Jk?P=)Qk>z&k<9d5V8gpsN|%J%4~$joP!EQ&2P6X) z^xMZ3bXhWymI0De04@d?uYg!cCYKwVim-sak>S8`6Dc_VM{ssIM0AkNyeMtS8G7~x znsMs%_j_@`fV>CyWuat9ev`Ak{k?!w`W<t<)3}BbBpySc2$b?Q~hcpl;0Tda0br~#f$S<& zKXY`Gu1~T}3gnbeCBU4VAoJ6+D5B>f;+iDsR%dmYwn7wJb`#%I1Ux3#bOday-|?Yo z45s_(Q|)z$3$2`~053XfCBJOfe?TzNse0wxJMP1Q>8c@tAZbSYy=m<58)n@5$-t#x zl)P;Mb-dRcF|{r5PA0;-yIc+1JNYv44XTa7i~!3d_O4uP(s;$df^IU=8Us;x@4Lzw z`9iDv4!ZxC0o8~)oNoR1yQ-n-p{(k4)m^L6>~8=0_>vpvQ~xhNAWSw!b^##?NvbaUlnD3(bKd9bGd@svK6Z17P}gH~2o09+_S= zzjW}7Q*gfQZ##IHzm1|ni7jf!MWyKg#bx`iRxh76Wfi&W?axX}Kg_7M#SZjbom{+$ z?=j2FMEC|ex^AI9^Z(Sru}HTuRXOK-4%JW>Up z5DL>L{ydN#I%`$=28ZOFkg;B8$F86Le2n9lvD$w7`}U@87efp&(Zzkq`i%d!?#KiS z091zQ$>QtfeNB?e$1CM3>oa>q>>0eOn_7^?4Ya-CmW^Iyjp+8WMWX}+ka`xPzePddU=3xGV2GA z5ppaaG`CvDb7zQ-F}vtXXq!7{M8#p^uRq87o09j=| z|8d<|Qo|Z%nZA(j#o&d!WVVqM(MsZYb@MxgY3_%9K-qvd!CJuG~|Zk03i0 zAj$l9cg?iD(I1q2?6uq$6^k62Imdu9SFGJ)=(-V=D;zTQ+8gDLlFc+?0KNo9wBJQg z69p!-5>wC^ryZ;L1Ld2FYAJd0Nt6_N-h*JN^B?DA`t`#v71yn;_z4r~bBv1{gKPZE zb!U8>MP^dQ7*TfBOox<@k4%+$4m^ zNJG1qvud#fbfC$+Pl*9bVyMJzD=ilWy3$h4&FaZ>WwG&u>U;q^7i2rLC&5r&Dq|zv zLd>L%x3OC<9l+f3ef2dnRv62t1)-i^8+SaEjF}_cvNcMhom)8Rz_5p zFPGz=--^S+wSEYd{ec_j@C{KzR1*KEj)qp(z(C_tU2cx?S)RG8C|9Mauwuzn166PDXT5tpu`5npOg z2=4+t_*c459^`EX!BH=d=Ar7EE;#j_XrONi&NhzXp2I>Bn8w+mx7PGzm zGQx$ry84$7qwOrn?%R=>BXm0 zDI(u&S749};ywNXbZ3r;ohh=N?|+n5v%}AMsCZioF-=wNpD@#dg!{o5$FD}cnnOF< zz{5k?IHW2(W_p;~_tztUGdcy>Mg!xwUZC=n;h$EScHp4t$VXp~U2aH-NmM?CsY;YR zQ6a7?{R$YfYL0hW)l-J!Y0W%Rtq|k?dX+RaT6ZMu?W_Be&K5>N$`-gM@?*Fmdf8z+x?QO%AqR9JM9md!hPeRo z`?&p>wCz06*!7AyhSNJ6pF=ymn3Th|M6{6RK8vkl^JjgSRv8;i=Gp}tSn6lsLx5KEivqu#J!cc`ALotjl?EO=ZWIZd8b$$a zv`@p{IU&J$CpW=)HDb;yo^JJoHMpz^{^jGh8MYnb<;~PzhQdaf^~3R>X$@C!bszAP z>iJ&wD_%@g4YDqjA&NkICTGh|Qo3Vj8d?o1V~-1&(1Bm$mtzC^N=cVFV#L78N03$wyI4cBL|aq4e>C{R^}dUr94?YeGTR%{7N2m!e> z)$so-#=a^p_vi+cIdY>%KaDHAPB|TYnj4rP%K#V61F5XgM%;B?_##c4(diHaYul@| zwycviEgj(COno;&zLssRbn3ACLQ4V!k3zxQJgJLzTwwj2D~BuHcrIfZ7ksuAQTd~C z+X>k4%zz9zNvt0pbUbCWKck(=MyVKothD)6QVdk(G~?>mugg)<&>{z2_PUL)@Y`}4 zqL`WOL8?~_bK+E7uwn}^;JGa0DN7R>Rxo#Zx9*U zb(xw`aHR5LllG?uHLWam-FgeV9T0rk-jxpKOD6;w2nuO?j0N(~rVKtl!}LN-sR03Q zi)tDJ=i7ino;Jv2_wNKv(8~izgvBj&MVtI50l4Hb)YLUseIB9Pco@f>$na)el}g0M z9Nl}4wyO+}y1OdGBQDP*%LGKU9!k(#UbL}lf8~AJ*m(7uNcbngcPo<0Uh7FAbsF`e zYOZGFi)mx8(S%;@i^JlwC8Yu3>?dNaM8c`T*rxrRK~*O0_Egu56dj*2@Rz3N^>U8J zaK^yx8Zau8XQ#tw6FrhzL-02<86pt!2r4eXx1&HJFo51Aw>05!TS&7FCl+(PByO@C zrVqTa*e4?n_-bBfu#Tg{>3|NP+l(2G5{*!xDc zti%}(>HOK)8~uO%z2e&TjqUzBaM9U_oUMACmzeikk8p9RW-hBg*UbJvj(YC8$b}2i=?6G&$=US{s%_u({i0Y8oKC0X&=6D-+f$3+FchUf!hr2o0>S;_? zx3tdwO+&U7E@1sQ zfRbjaKE3z~Rn%#->q0HaXGG+S+I+k8-ErgS?d=z)%x)1{*RrGj?A$!N;3|d;0r*H* zYx7^~3oo{4BtBKAY6#w_u|JmdX9&0&gL2WilQJZC{rf`Gn>H%r#4Q*qJT`|IH%aKdpWtgm+F6gh3NYTjWdTtLn0Q2_69Nqen%P=(r5$&oZ z4JT>f9Lx1FdVs2$jM8>LRq`O8f3EVlQIqQK5x?v1&&x&;Zic?%KXpY;{n+j7i3s|v|`wA@biCeV;C=i+u_Ji`nd{ZLvysjivm z!*#G^&Xvaet#_|``}{2VQ@uXA5a!zk28t! zR=Ojex3_x!^;rt&OKdkCG99!Rzay4W#5ALrA0G}bp3z!zx+HI4N84Md9|iefS`n1xJ~KKIDD;YM+J8XnTW4?>lfnNmSe-CzVMbx8Be$~K9>r4R^H9Q2JKAF_ZX2OctX z3LNS$FX}SHh}~woTgC4DXZq+k{_yfd?qyyR?dvv?0lOfFx&s>VmlICgj|h_G*-~hY z$R!aqwVE%umS~UD)@0DO`yoDRzv+S!Cxy8-NkV5G8b;gtkAh~pmX;RoAUN;!hn|dQ z?h*S>x)%4{@r$4GWs5Vdw~B9L)Sb0IcsbJNwC~cAcj0^AeFCe0c#_h$M4Rb>;&a+T zy8_C&Q9(B%QJ#BMdY=9%ek0cJDE&V~kj#9I-9|@D8%aB0x?b?4%Ps9^x{+l5yNx+$ zPSTSK|8!<6C5=(jvN4xD{AT}5rHBwX*0ZB1eUYdRh48_0s| zzjsvM4<{9*b)jkVUeqK!{J=?zK>mVZT@Ut^EhoWU>YH&?Br0p7^mqP54PIX`X$6hzQ=g*i8$S#g}HH`SEGuSAE9s;7VIaOgf4Ff;GO<0^`Onzgao18jh$n_L7x7>s;M&7bk{L61`BYTCL32qESnd25-KRJl z1an9CH!Q!s=Lo?#+v!5}IQurg(FHf{Z_jnuFmRKGyAmsrTj8P~)+eyqZa=3fsBfg} zk^*8sJ@`Asd7E8(cgp=+iY|0#D!H$iew-z)f9ZD4!}e}Z1bXG^x{>~_&T)W>&C;g0 zH?AW>Tl+A~VX#|FG&EG+qnRFCTRK|Gb~hW3m6rE1Z<-t* zl1YxXzcL`^o2y8VG_AV09GJWRYj$#FcNk}4AggWpmKT*)vjJ`J6eq#gxK=X#TMLf)F%?urj91_ZsUheZwTTc;n>h8 zYX7ILw~UMGiyDOwjD&!sba!`33xjkD0#YKkx`+6NFl_H(e9RNS9_$_>fPVgGT?Q(i=}paDxE!!+1RHLQ)a{woK#_Ly>~KP zc{wDZvJ5Y?qHD!>g`3)TWlZ~_4=p<4Dz!3hy<%Xr0ZpA~zajZQH9@d&MPe_-dj3?A^LyM7OT4TX?x zDckdi7asGJXLmpzc%4G8{;0=3-3t}w%jW0g6-S|_P{n)=Od zFK*SUy=$}$A=yyBz&IL6PqDI?5Kakp719UmKq3`!8BaYo8Dp*I`*8{T$ohv*7}5zXLx-NxobI7rRa1Q{CU!A+)r(UhX#pDO7B;<&A)zeDxhcFXMc_VZAT_? zxpYJ)Xm_(_w+eqGx^Sb+3=?Xut0O0pZ_xFj#R|tj6n*4n-`@EP9~;vL8K_C0TOem| z5v@D<#F2(iyZtT=fwm%L{`I8Li{)QK*ViIprW8IkTR)pQXCx^$%_Q6;Zn~xA5ov>7;(H^I^p@ zGU-Rc4N)0sz2%4U0WteAAhGoPhs%_!zorAOgk;9EU2fk*-o1aWv*UiR!b~g&q610r zu&%L5xhYD@`AglqI(i>ag|w|pIAq2bOrBg-%yXB|x5Em16EF~5L=lh87I?$*J%-lT z7x5zv8}3hT0`gCz(Vq*BvAARz1bWA`=;vHnOcx9id=%91*$+uNK9 zirF{Gsi3eEis|TzPEP1EY7iB8#1*ms?#|f$Gev^ZN%}bM(v8MBf+HSpux!A{?zvur z0|`&2+5Xus-LR1U_^7NM9Hwpau9wBAfYeX*g=v3SWOyIlrBOQtKEKV>H}dhZIgSlC59E%aQNiXhj*f~l|O~W zHvhk`(qK_V_fh_)zn{6kpIQ$XR=&KZUa#PDzoI#H9E}6ek-l$q}LSa`5YQdVrNV_s#rX5(to-dV0oZ+4K2Nk zU-iK!XN0lksV{k!3zh?uc>m!f@Abux9~8}nh14=LNlOZTJNmvHtvv3It{pOVqx;R< zH5L{Cl4m!NJoH}tb*~b6B^c4(^ygde&1dqX#mPYH<;n7%j+*JO4o5)Gjk!}__PWq{ zPjhwjf9Q&-P!4AY&M>y+l#)=2iRW=rbp4>T?9LaYSF&PR)c2b!<>ytNEu_ph=)llt zT@yPxDxp>|F99qPQsK@T?FlhsXcyMWD*i}cjRpE-c(H4GD&!Mah1qE3 z=MMgzV50S*q4e+b;~{AeAwlNfSawnTv`Rki*{SWw9l*2NYN7p6<+FkE6 z-|rRO)Z(|?dls)SWT$?{+DkW836kEQsrUNs=;o-j(D~JCH*{2iXgD`{!qRemqbsf@ zK#aLYQ3xU?(VoaVlNO8Od487V&0$vty&zt3hwnJj_n~%;1o*Mddl>!TaPEw1a!`DgcrE7 zE=zr($4N{hCLW7Glse|Y|7F@Ke%smgLn?`4L;*>0HMA(pB&9`_J;!#1@vW%!^=70KnlLd(dG^yiM~2(HP8hWRfXCTpB|piUE8PICp%1hi zOD4i^^gTXv_q0OFbDm`>lheO8QX+bf^V5rgrX(4^6)%38^jvU5s_{Uwt!I1N4Om_B zEEqUMotm<;8_NN_8+O-Ohx32#yIS@c>yKU$-n=KZ_ea6~ALna_z(Zlevv(ZLw{BiZ zVvvooZ)&`=6$u-+47$p-^4QCM@C$>9g{C+$*ZNoUzl@Xedo`Y?@8@IAWZy*@Yq24+ zw`Y@pYlK(7QRY@$B7DPEW6P>Ddrda9}c_$}M4&))Lt(Q@?Y_JhHCqlSkf|4AMbC~qrd{Y=2g zo=xhp7ih;Bwd~e}k$tJTBIoV`r9-A#keoVd5e`(4UY12PL?#j$2J$>+nZs(%{BhV0WfArLR zoCj^`aArZiO!sK3FD2~$)K;48je2t=jqTa%viG}zviD+!rrG((rP`>6v1@lfAan8^7Ds|-&qFyo0eV>TO&&&j(@Q$lNYieu7 z{JfpXx0bQzh;>U!y5If$^hRy;+n`y6Woxe?hM7<(llZOi!|)pW?>5%KawDHARcuru z*C{w%gwi{`aMbhvhUlxW81?X~Gen4-5A%ZDSPtceJQjOW7A4KpC2A4N>8kY0zo288xJkIimP8 ztu#wFhMpzUQFlC<|DB{kzl2C{zB~HtOG6V*U{m1L=DZm)@m&X#9d>vLub{HFDYere zX373J$^JQUZ4mAmU)p<)px)o|bFQc!pj1-4X)a^g&R(k@_LBW&puT^sMnK=C{CCw} z?LT4RAqGrUmCH;=OG9(8ipRVl>V4t^E2`)k6Q@!NFS;E=c8*)&z1T=f-FJVcDrIn{ zU#n|`b%pbWrYvlQa2^?C3E4-yVhmCel60mUYnexSqmkf-FK;Lqqd^R0heZGOjn-q~ zxer8FOkH*EB@zkIGp{4s4*qCz#G6qQ$Ts0z5iFdU*zK3?ULLh?r?NN6tP(h&z`cDnZ2V> zA%iU6XtRwScVgUfaw2hZjkKdc3#I@=XA181R%N;6#0UygZmqxF+);kvkDFd&e^3qZ zPl)rj=teey_J0HPU@h-@F-W5Iws(Y6IVs?ApMDo1A!(7|eBYxN7^u#7rI><)$Y9SS zIi#0@B%RCMB4c9qlV9stH@490NEaf>N7LXCgmB@Dnp-{Y(jiA#e1OBn#C>@pbMsXf zXH2I)`nbYPc;2ms*q zz>|eSN==DVK*nkld;9T^o09tMv=CxkIXr4+)~MmW;afmU@{-?*q2pQGk|gZ(AW!%c z6%DU7_MwHte`9cde857gkA7gubqav#>PzfYr|k3QWMO&X%4%T&5ks0La?rd)|h#>J8=;^6LvKC}Um7z=E`aXc}ENc2fG z{vBr=vW6CSLLQ`?uNQ}z;c%4)NC9vMs%*Ajh5!m>{(&C0xZ&hf8oJ-BXWT;21s1A4 zWz*JxjfIDz6k~4Qhlcyf{N~$^VY`%sgPVnO z2RTltL!`k@DGW4^Zdh2`Kq5sCtz>BfN!>||W0Sr!hp8AaqElqpkcKGKCGSU1D_xUG5B5nT0sIl-Y9VmB$AwFfEMcOhJ>(-)L8N`fA8O$suF_Y!?;ub zem~jMFr41!fTYGMVY|ue@|M~qZa^|QG=|zn-Lz2*b>5dWQ^C#O^w8}?AwK_B1TjzA zQ?-vRdA1In6lFAhbRj1A)g?1f5tC$(=YrZIc|FFs@Pk5D_g55*&_e_JtA2kYROSE0 zUTgb&3}A?8wA8TI^HES5ZJK9cVW9~xTJ1TWWk%bF*dEaen7nn5Q%F{ofjDO=TKloT z{JGpfT{CSpx{~hWSxownw>UhoyrLi>8F%&&p)Pz4S*WQ>eq;P=dnM@7cKWBJ`a!QA z@%gMK3Vk5Wy(MlC6W3hfip2|JMFH>Z6(7euVfMgtA^+dI1y%~)Cu0RxX5-TMj{;5$ ztaQ_yCwx+39;DFFK?Rw!hJ{5twS3preO(Q*g#}@^xniK*>YfdW5L|;0n9{d{>Iz~I zYl)J$I4rSa4Dtd6m~RjcQ-kLZGN9j(_Q9DvmdO@Zu5$~*)VWHgTsDl1Wtl_upp|O z4NkC1S)J^m;TMbr+l&hI358;aD(>E+N@pA=C;jmWOteUgfc7l}20|mr+k)-<9K>Zf zcj>=_(qyf5CTbfux`Ee`Nfl2XYIfN}Z(N(={o;=J@!QrS*AW+7ifGPduFR4toM?v> z3)w)wADj&n^+%ve zI`HFdm9o(G@@ilU!01Au?;*FUMwT@wLXBAp&3;&PoRyvSRG+|9YGEGLJXL3v)A4AuDR`Mbw;_>6f^0LEfzI13C z(yQ{A;O=H2nf4S{J<*8$8JD(RiBb%TKRdkPlbotNzfmColpyd+MJ zktDl;7MZW^!XR>KlxOna1Qt1|61N6J6vL$Wd^LUf8-?N`3~>zsK)SU*!Qm(hI{gJZ%EpoHSsWn+*S(g;s;-H7g)uG;}x^`W8~U)DBDTwW7$W#`!mXY_@-h zEJU8b*qZ^}*qtR%n%RL(%hDNva=z2JX}Q&Pzy@~?RU5K3!W1LB2c8ip9Wv1#xTFnb zd(xw(v=6Qng*>_{-CMt^s*?po0KK2#GVRg&rRsshk`lnayc}S^GHsnn3{q;hfXITt z%qhp}XGQT?-TZA)kKvJB{!qOMMTV!4R3y7!cax!%D-{T?!VK$_M34Rz^q;Iuo%r!r>2+r z71^I92YTECjNZg>tzL;0HE0ej?I>}GPc~1kN>Y04DTr@F@r%LED2d|8J#n*)H zvGU1O=#)Rs66ObS%}f2{BOS*T>2m5l>`XU!`zQQCJMwDJ%w4XiD7Ld564Hr7xxQ%P zMT=(=yB{HabLt7n`G?1}6X}Z-`XI&Ar`}rb3aP=tfLK#?XeFv4Uo^wj=S*xop!nfx z+!U3wC)egNl}?xmmTwpUz%lz#?*N@FJHWe&|G*_5;&E-~o{{=pY4$sJxhmMmm?M6@ z_?Lcc_hC?!c~9J!Y0GGBysE2@BzXH?0k+0cng+|D*LvUKV69!|{NDMeQ}YYXL>cJe zZfld|Xiek+Kki`W*OxzLG@hM zf7GqEZ5DMGDz@5prLYlnCdkFCW9j;u#}577RHeaC9ebOnReVW^-rq$yDI19~v?@_nz zKq=q1F-5u@5-)R=qaXAg@|aw(3vmUt3i9o}14FDw?`%WAr*RrwN;TNG(#L+4V+`+B z*DoHkewW5?9Zb%!RcGFY#=N~I*2b3u$rILmEF3qA_9`d7w;jTzepMF4vh+Yg+HXFg zgX+DvrpD?tn=7`;%V_9jHje`=GG&XzpxW9_JQ3(FFA&U4z?~k7KezL~AI@jKX>|#d zYBp1csU%`N$>cx1LK3N2oKrAS_&+wmO#}VBuX^op6X^vW6F_NRr$R->4ypv%dp%o= zyGh^0^k^DIv}#o41E)q`M9TI>o}>~#?XT$s5{VA)zmdp5IbKb8q$VJ9U%GIYnETMt zsPyZ&>%(P2MD$#f=d#x18!MlPlZb846A_SdcKV1_{&If$)os9+l>g5g)>v;!+@L8s z%`PH8yQtsIK&Ff71DF49aj$2o&*dXQGNF@Y~8LFW`n?L11 zh>y*SLV*yXZ1!T_+#vZqP;uX8|pWR%TUQ_}s{W_h7 z2F_CErd3%UtD`LGKKGR;s4^8h<`^nD?6;S{>?&I?izI$LozAjoWU+>f@$qFw`U$26 z2bD#Yq&<7BPQY;QrGExexTRC9tzv2_tE0z?ACNazvn^DY*L!sX^Mtd~*{p*}>2uAK zHyMCFMKLmvm}S1ri~N3qKtI9#Y|p|7+Y7OUV~gYI&kgnEjxTk3p=A3vpXM(FxY1M4 z++Uw9MGJbRVg4~K-BH0jZjkA&QbWmk233MxNuO4_omQZK)-MUO-x=c;hJLeh_oVvJ z3i=f`TR6;U32Ne7Tu)A0cPKENCSo9TQ~`Bx57*!9)YC7L`zhmQ8D-h~6Di7*D#<_p zm;V0pO{=0tP}d~5jTWA=Odqq2j{A;4s$0Ru0szFb=?QC*yrP+oL007znGH58uJfx) z+1V%Lm5@2obD6pyIZu&!gaMSK67!9FfO`VW`*MyiP7cMZY%-L8QDl z{}J%Po(jU15-#$~VT`o|0*c1^1o7j7YWwk*v4&%$^nbF^`^c*AOjg3xP04dW@q z<&ohs<6U7l>kM7CSfY-Mjq>yAu%eP|qK&K}E;%4kl$lj%d&i;r$ga^6N5u0mj2tyS z)2788wq0#p;n5+aQVdxio}}mI7fb?(9jqg<=;_*=`{-4TuzbbIgc z0fIyT!Q7$NhQbcvk22P?jL{W=XYK=gfB(aNwVt_KN zk5HEk8?p47fksJ|MqdKpJ??7qgJ0&+T)n9}>^F4?PXqUX$FGqi>vbnTZ}`=IJ}FGaR^w*aw9K=7@wa%3F>skylA#jU zM`Nv78+W*7_NXTI7HNwd)B>53nHZ>OnS7#ib!<2LP4v^>~!t9Izd zc6@@D6sFrmgXDOQP-9{^Tui!xjEOzB_j(%Lfe-o!Ia&09d-3v3Y@d+-2{EahTp7i+_3#%r!jqu5#*@iX z4;+Nf28hB?KMkyGn~sXTwT};-zmjk%+dA`pB5t#71w#9qk@NNa=3-SexIlgrkF}4r zHuBOXayh=l!-PQzL#YY0qh78-s<_Rw8#7nyPQd@oJ(q1!sA3X=eiNa5QsN(^C$6O< z>xV>OC|QQq6>j!BdiSlNoZF_=zFqS&G_ASn!eF3fzD+bOC?ox@>g3d?g)*&;A~-J3 zo~BBBezckbiq+cz8L&JuYkZ}s4Ks{6QP&{b@1HWhQqyIpR1Y&_DzFdy09I%s{#k=F zFehI*Nc!=S1WDh2VOKfzBtDY>!NyTpZ2$@~*lxp`uF`;r<>irRK@4m4MX8H!OsT#^NMHGjCDHL`j} zbBz79z468pxZK~GK0n40g8Vtc zj9=GZg{pjY5BuIt?}1J;E>!I!WK=!;x|&S0Fl{}^FOyC~KRNre^x2+Yp_X&h*BLx2 zdylI>dGA@R*c}^+NHjY`Y+1D%?tEpotx|e zk%~E(-$Nzq?Qysnf)&@s`mD{)M3V0g)hYmet(P9!|Ms6dS5$3{;VFJgw#9XR_nZVc zI99fv!8R*|if+@TcbCR-H~r1kgSk`4--J}^TVAbz2&R2WARcpb)6`k_^dj))@=-5J3!W``0{12!uA7wFGmr7Wdk85m zBV^A^8EOzK1Eo<4d_CW$Rx)X5QnIWFq|+L%7P+BU8SV>H3C>2CP>2pkxPJl8&$oHP zEr}cJMFF8qRE>)$$@yRT1-J8F3qg98rp<0>TJtA$*q4<+4^@`lFDb-A8cEqiQ$xKR z7L>7bfB!P;msK3#U#c%2g!Z})PBO3y5G(Tu*bFGzx%FrFoKwu3XfA*;RONnoLRNCGJe64kK^q1 z?|;+Qyi{~@j~bi54OK7q(jydBpVfd^yr1Akrj0cmofL$>jrquQN-`Kt-Wopvh@xsm{x?g$_01@g>`6B=bPbx=w5(bH3v7RUVQfrYH&n@v3ua_`RU7$j>R{*y!Gk@hGoURe7CR z)m3;G0zuLd>o^LZOS;uqV+*Ux-l8qvwWmvihG~%55;G_7%fHvz7e+p=!yDpZwjOjl zS@W++W7Terw*(UJ#CmM*ik(iror_8BvBC^T+6H^7w@bwVknsVj#=m+m_tH$8a7Uaw zDjpox2eT3@mK09aRCV>V!WIf9^ZSm0Y-}JWB=|Pw&6R`pVm;pCDC_A1-Je(I-_^2; z%h~i8&wSIzHPncl2Xru;6!~p>RAD240&Y>4=nuef^(DVDvL{;|CCxXcluCby$2z&yw*D0f&RM;UaHzcDco zkKf;b%UpC-7bIH%2mh4;2I4pr-4-Q&`+fG=Q{jSQ4;IT89#1AJhkI?lyypHZkDn>r zI$!T15}UHzr@F!8pEd7;PIEIU7Y(^o)~$~W-3frf10rM~IH!4Y$R!_hox4N3!V8O8 zyhlu8<>Yohf$_9ozTJ&PCTDhH5^A}E#MvVitUE|~zZY!Ug z=J0uJ*)+_}R21FLy8va>LrMYDhBYM&`#OYg7^=?d-lG%oUP75Qf~X`vrm5`rqK?nW zK{Y~&NzW`=(RGV=lC*FmORBX&7f5XBMxYP6+1GydRUa^=X~m$zrDNUmihPDFfj>jD ze-^8oK+qZALRH0vbP;@gA_@)0g9DF-x@B+$O% zBhhaOj!m1qp%*g=c&gZ>D>tn~o{j!na`*((e(KC~s{x+OMO(sOpW;JGlcBcvt?IWD zcMr+}nFswq{+aBHf0ta`qTLQ=ZH?h^Dt-?s6hSQLlo`^MSXqCme5r~-rrrL7 zS8zUaUHU*4*Rv&UBxgNDfZUFE1DDSsb*?QW*kb1X`-o;G)Zt6n zhxvMbkU8+~KArO^2YH%FeY=kje+_cKVk-YD+irL)q8~{G6}0PQlQjNm0BOk2NXk4V zP}xgk1*xrzH?&F*p?oaR zLf5Kq&J~Wk`5Wkr(M0-H1G7XNc~3nCkUs9@24<`g{^jeII_y?31mY^K_M3CIgISd_ zIGUbUpqmk?4l-!yU14sIV&ccI*L`)~xML{djen;7^I66?QnGYAvSfOX0m@tBi1_t? zQ`#E2!Q>V14bTRyp6mulw_oICpXGs>N|6L${;s-7Ta!HgV`kvQXn@v~--OgGWS?b{ zqg;vR3tFl3NCD#(^#8BybQ!~UY^X}NAqcetvap(w+Qc^=2213lPbRr?Kc|BVmtRTb z=8kNf@n9mnRkA6BW_%;N<`>^uviJa|-EZ&NKpC$KxWQ^imD&%>D*7;(cnQ2}Y-8So zfcHbbVgc1nPnl`6TD`tJ?QjXz*{Id0f4hHAFXi zRnO7gx%NqP3q#QAu3BZS7bGBh`q##7O0BFqHKiDgCafV<1dBMW*t zc%JN-HPzqakFQ)yJV+Ucr_cIMh~O<08ph$Txj?!u(#mjLVZ+miz{$R9U-EfBx9wz- z|8;+uEC3CMAtJ8g-C~{n>g(j>b16yn=d2+n9twk3phR?~P&yzJ@tvmkAaxHLT6B`j zEUcXNJRkh`a6KjF#>9XJmHIy$TLrjFo3%isR$f>W4}&$02WyLHoj-{z69`*7(%kI~lx*b$B)){gB` z(Qyj;d&`87{_TKyq7XgTBsOEr5hH{h0loY!ZrevDy)6#{PBR+jy(bat46*&RfMDzn z12e<+nkY-Tpo8&NjX%%iBRN_2e_Z1<5|(cfmX4GIl?$n>=)fzKp1k}&Q3es~ literal 0 HcmV?d00001 diff --git a/app/extensions/ipfs/js/ipfs.min.js b/app/extensions/ipfs/js/ipfs.min.js new file mode 100644 index 00000000000..15af7594646 --- /dev/null +++ b/app/extensions/ipfs/js/ipfs.min.js @@ -0,0 +1,240 @@ +function IPFS (modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}var installedModules={};return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.i=function(value){return value},__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module.default}:function(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=871)}([function(module,exports,__webpack_require__){"use strict";(function(global){function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(that,length){if(kMaxLength()=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|length}function SlowBuffer(length){return+length!=length&&(length=0),Buffer.alloc(+length)}function byteLength(string,encoding){if(Buffer.isBuffer(string))return string.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(string)||string instanceof ArrayBuffer))return string.byteLength;"string"!=typeof string&&(string=""+string);var len=string.length;if(0===len)return 0;for(var loweredCase=!1;;)switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":case void 0:return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*len;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase)return utf8ToBytes(string).length;encoding=(""+encoding).toLowerCase(),loweredCase=!0}}function slowToString(encoding,start,end){var loweredCase=!1;if((void 0===start||start<0)&&(start=0),start>this.length)return"";if((void 0===end||end>this.length)&&(end=this.length),end<=0)return"";if(end>>>=0,start>>>=0,end<=start)return"";for(encoding||(encoding="utf8");;)switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase(),loweredCase=!0}}function swap(b,n,m){var i=b[n];b[n]=b[m],b[m]=i}function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){if(0===buffer.length)return-1;if("string"==typeof byteOffset?(encoding=byteOffset,byteOffset=0):byteOffset>2147483647?byteOffset=2147483647:byteOffset<-2147483648&&(byteOffset=-2147483648),byteOffset=+byteOffset,isNaN(byteOffset)&&(byteOffset=dir?0:buffer.length-1),byteOffset<0&&(byteOffset=buffer.length+byteOffset),byteOffset>=buffer.length){if(dir)return-1;byteOffset=buffer.length-1}else if(byteOffset<0){if(!dir)return-1;byteOffset=0}if("string"==typeof val&&(val=Buffer.from(val,encoding)),Buffer.isBuffer(val))return 0===val.length?-1:arrayIndexOf(buffer,val,byteOffset,encoding,dir);if("number"==typeof val)return val&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?dir?Uint8Array.prototype.indexOf.call(buffer,val,byteOffset):Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset):arrayIndexOf(buffer,[val],byteOffset,encoding,dir);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){function read(buf,i){return 1===indexSize?buf[i]:buf.readUInt16BE(i*indexSize)}var indexSize=1,arrLength=arr.length,valLength=val.length;if(void 0!==encoding&&("ucs2"===(encoding=String(encoding).toLowerCase())||"ucs-2"===encoding||"utf16le"===encoding||"utf-16le"===encoding)){if(arr.length<2||val.length<2)return-1;indexSize=2,arrLength/=2,valLength/=2,byteOffset/=2}var i;if(dir){var foundIndex=-1;for(i=byteOffset;iarrLength&&(byteOffset=arrLength-valLength),i=byteOffset;i>=0;i--){for(var found=!0,j=0;jremaining&&(length=remaining):length=remaining;var strLen=string.length;if(strLen%2!=0)throw new TypeError("Invalid hex string");length>strLen/2&&(length=strLen/2);for(var i=0;i239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end){var secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:firstByte<128&&(codePoint=firstByte);break;case 2:secondByte=buf[i+1],128==(192&secondByte)&&(tempCodePoint=(31&firstByte)<<6|63&secondByte)>127&&(codePoint=tempCodePoint);break;case 3:secondByte=buf[i+1],thirdByte=buf[i+2],128==(192&secondByte)&&128==(192&thirdByte)&&(tempCodePoint=(15&firstByte)<<12|(63&secondByte)<<6|63&thirdByte)>2047&&(tempCodePoint<55296||tempCodePoint>57343)&&(codePoint=tempCodePoint);break;case 4:secondByte=buf[i+1],thirdByte=buf[i+2],fourthByte=buf[i+3],128==(192&secondByte)&&128==(192&thirdByte)&&128==(192&fourthByte)&&(tempCodePoint=(15&firstByte)<<18|(63&secondByte)<<12|(63&thirdByte)<<6|63&fourthByte)>65535&&tempCodePoint<1114112&&(codePoint=tempCodePoint)}}null===codePoint?(codePoint=65533,bytesPerSequence=1):codePoint>65535&&(codePoint-=65536,res.push(codePoint>>>10&1023|55296),codePoint=56320|1023&codePoint),res.push(codePoint),i+=bytesPerSequence}return decodeCodePointsArray(res)}function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,codePoints);for(var res="",i=0;ilen)&&(end=len);for(var out="",i=start;ilength)throw new RangeError("Trying to access beyond buffer length")}function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||valuebuf.length)throw new RangeError("Index out of range")}function objectWriteUInt16(buf,value,offset,littleEndian){value<0&&(value=65535+value+1);for(var i=0,j=Math.min(buf.length-offset,2);i>>8*(littleEndian?i:1-i)}function objectWriteUInt32(buf,value,offset,littleEndian){value<0&&(value=4294967295+value+1);for(var i=0,j=Math.min(buf.length-offset,4);i>>8*(littleEndian?i:3-i)&255}function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,value,offset,4,3.4028234663852886e38,-3.4028234663852886e38),ieee754.write(buf,value,offset,littleEndian,23,4),offset+4}function writeDouble(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,value,offset,8,1.7976931348623157e308,-1.7976931348623157e308),ieee754.write(buf,value,offset,littleEndian,52,8),offset+8}function base64clean(str){if(str=stringtrim(str).replace(INVALID_BASE64_RE,""),str.length<2)return"";for(;str.length%4!=0;)str+="=";return str}function stringtrim(str){return str.trim?str.trim():str.replace(/^\s+|\s+$/g,"")}function toHex(n){return n<16?"0"+n.toString(16):n.toString(16)}function utf8ToBytes(string,units){units=units||1/0;for(var codePoint,length=string.length,leadSurrogate=null,bytes=[],i=0;i55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){(units-=3)>-1&&bytes.push(239,191,189);continue}if(i+1===length){(units-=3)>-1&&bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){(units-=3)>-1&&bytes.push(239,191,189),leadSurrogate=codePoint;continue}codePoint=65536+(leadSurrogate-55296<<10|codePoint-56320)}else leadSurrogate&&(units-=3)>-1&&bytes.push(239,191,189);if(leadSurrogate=null,codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,63&codePoint|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,63&codePoint|128)}else{if(!(codePoint<1114112))throw new Error("Invalid code point");if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,63&codePoint|128)}}return bytes}function asciiToBytes(str){for(var byteArray=[],i=0;i>8,lo=c%256,byteArray.push(lo),byteArray.push(hi);return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i=dst.length||i>=src.length);++i)dst[i+offset]=src[i];return i}function isnan(val){return val!==val}var base64=__webpack_require__(362),ieee754=__webpack_require__(218),isArray=__webpack_require__(49);exports.Buffer=Buffer,exports.SlowBuffer=SlowBuffer,exports.INSPECT_MAX_BYTES=50,Buffer.TYPED_ARRAY_SUPPORT=void 0!==global.TYPED_ARRAY_SUPPORT?global.TYPED_ARRAY_SUPPORT:function(){try{var arr=new Uint8Array(1);return arr.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===arr.foo()&&"function"==typeof arr.subarray&&0===arr.subarray(1,1).byteLength}catch(e){return!1}}(),exports.kMaxLength=kMaxLength(),Buffer.poolSize=8192,Buffer._augment=function(arr){return arr.__proto__=Buffer.prototype,arr},Buffer.from=function(value,encodingOrOffset,length){return from(null,value,encodingOrOffset,length)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0})),Buffer.alloc=function(size,fill,encoding){return alloc(null,size,fill,encoding)},Buffer.allocUnsafe=function(size){return allocUnsafe(null,size)},Buffer.allocUnsafeSlow=function(size){return allocUnsafe(null,size)},Buffer.isBuffer=function(b){return!(null==b||!b._isBuffer)},Buffer.compare=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var x=a.length,y=b.length,i=0,len=Math.min(x,y);i0&&(str=this.toString("hex",0,max).match(/.{2}/g).join(" "),this.length>max&&(str+=" ... ")),""},Buffer.prototype.compare=function(target,start,end,thisStart,thisEnd){if(!Buffer.isBuffer(target))throw new TypeError("Argument must be a Buffer");if(void 0===start&&(start=0),void 0===end&&(end=target?target.length:0),void 0===thisStart&&(thisStart=0),void 0===thisEnd&&(thisEnd=this.length),start<0||end>target.length||thisStart<0||thisEnd>this.length)throw new RangeError("out of range index");if(thisStart>=thisEnd&&start>=end)return 0;if(thisStart>=thisEnd)return-1;if(start>=end)return 1;if(start>>>=0,end>>>=0,thisStart>>>=0,thisEnd>>>=0,this===target)return 0;for(var x=thisEnd-thisStart,y=end-start,len=Math.min(x,y),thisCopy=this.slice(thisStart,thisEnd),targetCopy=target.slice(start,end),i=0;iremaining)&&(length=remaining),string.length>0&&(length<0||offset<0)||offset>this.length)throw new RangeError("Attempt to write outside buffer bounds");encoding||(encoding="utf8");for(var loweredCase=!1;;)switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase(),loweredCase=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;Buffer.prototype.slice=function(start,end){var len=this.length;start=~~start,end=void 0===end?len:~~end,start<0?(start+=len)<0&&(start=0):start>len&&(start=len),end<0?(end+=len)<0&&(end=0):end>len&&(end=len),end0&&(mul*=256);)val+=this[offset+--byteLength]*mul;return val},Buffer.prototype.readUInt8=function(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),this[offset]},Buffer.prototype.readUInt16LE=function(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]|this[offset+1]<<8},Buffer.prototype.readUInt16BE=function(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]<<8|this[offset+1]},Buffer.prototype.readUInt32LE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+16777216*this[offset+3]},Buffer.prototype.readUInt32BE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),16777216*this[offset]+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])},Buffer.prototype.readIntLE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset],mul=1,i=0;++i=mul&&(val-=Math.pow(2,8*byteLength)),val},Buffer.prototype.readIntBE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var i=byteLength,mul=1,val=this[offset+--i];i>0&&(mul*=256);)val+=this[offset+--i]*mul;return mul*=128,val>=mul&&(val-=Math.pow(2,8*byteLength)),val},Buffer.prototype.readInt8=function(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),128&this[offset]?(255-this[offset]+1)*-1:this[offset]},Buffer.prototype.readInt16LE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt16BE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt32LE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24},Buffer.prototype.readInt32BE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]},Buffer.prototype.readFloatLE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!0,23,4)},Buffer.prototype.readFloatBE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!1,23,4)},Buffer.prototype.readDoubleLE=function(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!0,52,8)},Buffer.prototype.readDoubleBE=function(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!1,52,8)},Buffer.prototype.writeUIntLE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,byteLength|=0,!noAssert){checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength)-1,0)}var mul=1,i=0;for(this[offset]=255&value;++i=0&&(mul*=256);)this[offset+i]=value/mul&255;return offset+byteLength},Buffer.prototype.writeUInt8=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),this[offset]=255&value,offset+1},Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset+3]=value>>>24,this[offset+2]=value>>>16,this[offset+1]=value>>>8,this[offset]=255&value):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeIntLE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0,mul=1,sub=0;for(this[offset]=255&value;++i>0)-sub&255;return offset+byteLength},Buffer.prototype.writeIntBE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1,mul=1,sub=0;for(this[offset+i]=255&value;--i>=0&&(mul*=256);)value<0&&0===sub&&0!==this[offset+i+1]&&(sub=1),this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength},Buffer.prototype.writeInt8=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),value<0&&(value=255+value+1),this[offset]=255&value,offset+1},Buffer.prototype.writeInt16LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeInt16BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeInt32LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8,this[offset+2]=value>>>16,this[offset+3]=value>>>24):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeInt32BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),value<0&&(value=4294967295+value+1),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeFloatLE=function(value,offset,noAssert){return writeFloat(this,value,offset,!0,noAssert)},Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,!1,noAssert)},Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,!0,noAssert)},Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,!1,noAssert)},Buffer.prototype.copy=function(target,targetStart,start,end){if(start||(start=0),end||0===end||(end=this.length),targetStart>=target.length&&(targetStart=target.length),targetStart||(targetStart=0),end>0&&end=this.length)throw new RangeError("sourceStart out of bounds");if(end<0)throw new RangeError("sourceEnd out of bounds");end>this.length&&(end=this.length),target.length-targetStart=0;--i)target[i+targetStart]=this[i+start];else if(len<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,end=void 0===end?this.length:end>>>0,val||(val=0);var i;if("number"==typeof val)for(i=start;i1)for(var i=1;i=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(args){var useColors=this.useColors;if(args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff),useColors){var c="color: "+this.color;args.splice(1,0,c,"color: inherit");var index=0,lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){"%%"!==match&&(index++,"%c"===match&&(lastC=index))}),args.splice(lastC,0,c)}}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{null==namespaces?exports.storage.removeItem("debug"):exports.storage.debug=namespaces}catch(e){}}function load(){var r;try{r=exports.storage.debug}catch(e){}return!r&&void 0!==process&&"env"in process&&(r=process.env.DEBUG),r}exports=module.exports=__webpack_require__(391),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],exports.formatters.j=function(v){try{return JSON.stringify(v)}catch(err){return"[UnexpectedJSONParseError]: "+err.message}},exports.enable(load())}).call(exports,__webpack_require__(2))},function(module,exports){var g;g=function(){return this}();try{g=g||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(g=window)}module.exports=g},function(module,exports,__webpack_require__){"use strict";var sources=__webpack_require__(740),sinks=__webpack_require__(734),throughs=__webpack_require__(746);exports=module.exports=__webpack_require__(299),exports.pull=exports;for(var k in sources)exports[k]=sources[k];for(var k in throughs)exports[k]=throughs[k];for(var k in sinks)exports[k]=sinks[k]},function(module,exports,__webpack_require__){(function(Buffer){function isArray(arg){return Array.isArray?Array.isArray(arg):"[object Array]"===objectToString(arg)}function isBoolean(arg){return"boolean"==typeof arg}function isNull(arg){return null===arg}function isNullOrUndefined(arg){return null==arg}function isNumber(arg){return"number"==typeof arg}function isString(arg){return"string"==typeof arg}function isSymbol(arg){return"symbol"==typeof arg}function isUndefined(arg){return void 0===arg}function isRegExp(re){return"[object RegExp]"===objectToString(re)}function isObject(arg){return"object"==typeof arg&&null!==arg}function isDate(d){return"[object Date]"===objectToString(d)}function isError(e){return"[object Error]"===objectToString(e)||e instanceof Error}function isFunction(arg){return"function"==typeof arg}function isPrimitive(arg){return null===arg||"boolean"==typeof arg||"number"==typeof arg||"string"==typeof arg||"symbol"==typeof arg||void 0===arg}function objectToString(o){return Object.prototype.toString.call(o)}exports.isArray=isArray,exports.isBoolean=isBoolean,exports.isNull=isNull,exports.isNullOrUndefined=isNullOrUndefined,exports.isNumber=isNumber,exports.isString=isString,exports.isSymbol=isSymbol,exports.isUndefined=isUndefined,exports.isRegExp=isRegExp,exports.isObject=isObject,exports.isDate=isDate,exports.isError=isError,exports.isFunction=isFunction,exports.isPrimitive=isPrimitive,exports.isBuffer=Buffer.isBuffer}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(global){function compare(a,b){if(a===b)return 0;for(var x=a.length,y=b.length,i=0,len=Math.min(x,y);i=0;i--)if(ka[i]!==kb[i])return!1;for(i=ka.length-1;i>=0;i--)if(key=ka[i],!_deepEqual(a[key],b[key],strict,actualVisitedObjects))return!1;return!0}function notDeepStrictEqual(actual,expected,message){_deepEqual(actual,expected,!0)&&fail(actual,expected,message,"notDeepStrictEqual",notDeepStrictEqual)}function expectedException(actual,expected){if(!actual||!expected)return!1;if("[object RegExp]"==Object.prototype.toString.call(expected))return expected.test(actual);try{if(actual instanceof expected)return!0}catch(e){}return!Error.isPrototypeOf(expected)&&expected.call({},actual)===!0}function _tryBlock(block){var error;try{block()}catch(e){error=e}return error}function _throws(shouldThrow,block,expected,message){var actual;if("function"!=typeof block)throw new TypeError('"block" argument must be a function');"string"==typeof expected&&(message=expected,expected=null),actual=_tryBlock(block),message=(expected&&expected.name?" ("+expected.name+").":".")+(message?" "+message:"."),shouldThrow&&!actual&&fail(actual,expected,"Missing expected exception"+message);var userProvidedMessage="string"==typeof message,isUnwantedException=!shouldThrow&&util.isError(actual),isUnexpectedException=!shouldThrow&&actual&&!expected;if((isUnwantedException&&userProvidedMessage&&expectedException(actual,expected)||isUnexpectedException)&&fail(actual,expected,"Got unwanted exception"+message),shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual)throw actual}var util=__webpack_require__(10),hasOwn=Object.prototype.hasOwnProperty,pSlice=Array.prototype.slice,functionsHaveNames=function(){return"foo"===function(){}.name}(),assert=module.exports=ok,regex=/\s*function\s+([^\(\s]*)\s*/;assert.AssertionError=function(options){this.name="AssertionError",this.actual=options.actual,this.expected=options.expected,this.operator=options.operator,options.message?(this.message=options.message,this.generatedMessage=!1):(this.message=getMessage(this),this.generatedMessage=!0);var stackStartFunction=options.stackStartFunction||fail;if(Error.captureStackTrace)Error.captureStackTrace(this,stackStartFunction);else{var err=new Error;if(err.stack){var out=err.stack,fn_name=getName(stackStartFunction),idx=out.indexOf("\n"+fn_name);if(idx>=0){var next_line=out.indexOf("\n",idx+1);out=out.substring(next_line+1)}this.stack=out}}},util.inherits(assert.AssertionError,Error),assert.fail=fail,assert.ok=ok,assert.equal=function(actual,expected,message){actual!=expected&&fail(actual,expected,message,"==",assert.equal)},assert.notEqual=function(actual,expected,message){actual==expected&&fail(actual,expected,message,"!=",assert.notEqual)},assert.deepEqual=function(actual,expected,message){_deepEqual(actual,expected,!1)||fail(actual,expected,message,"deepEqual",assert.deepEqual)},assert.deepStrictEqual=function(actual,expected,message){_deepEqual(actual,expected,!0)||fail(actual,expected,message,"deepStrictEqual",assert.deepStrictEqual)},assert.notDeepEqual=function(actual,expected,message){_deepEqual(actual,expected,!1)&&fail(actual,expected,message,"notDeepEqual",assert.notDeepEqual)},assert.notDeepStrictEqual=notDeepStrictEqual,assert.strictEqual=function(actual,expected,message){actual!==expected&&fail(actual,expected,message,"===",assert.strictEqual)},assert.notStrictEqual=function(actual,expected,message){actual===expected&&fail(actual,expected,message,"!==",assert.notStrictEqual)},assert.throws=function(block,error,message){_throws(!0,block,error,message)},assert.doesNotThrow=function(block,error,message){_throws(!1,block,error,message)},assert.ifError=function(err){if(err)throw err};var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)hasOwn.call(obj,key)&&keys.push(key);return keys}}).call(exports,__webpack_require__(4))},function(module,exports){function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(arg){return"function"==typeof arg}function isNumber(arg){return"number"==typeof arg}function isObject(arg){return"object"==typeof arg&&null!==arg}function isUndefined(arg){return void 0===arg}module.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||n<0||isNaN(n))throw TypeError("n must be a positive number");return this._maxListeners=n,this},EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(this._events||(this._events={}),"error"===type&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length)){if((er=arguments[1])instanceof Error)throw er;var err=new Error('Uncaught, unspecified "error" event. ('+er+")");throw err.context=er,err}if(handler=this._events[type],isUndefined(handler))return!1;if(isFunction(handler))switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:args=Array.prototype.slice.call(arguments,1),handler.apply(this,args)}else if(isObject(handler))for(args=Array.prototype.slice.call(arguments,1),listeners=handler.slice(),len=listeners.length,i=0;i0&&this._events[type].length>m&&(this._events[type].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[type].length),"function"==typeof console.trace&&console.trace()),this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(type,listener){function g(){this.removeListener(type,g),fired||(fired=!0,listener.apply(this,arguments))}if(!isFunction(listener))throw TypeError("listener must be a function");var fired=!1;return g.listener=listener,this.on(type,g),this},EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;if(list=this._events[type],length=list.length,position=-1,list===listener||isFunction(list.listener)&&list.listener===listener)delete this._events[type],this._events.removeListener&&this.emit("removeListener",type,listener);else if(isObject(list)){for(i=length;i-- >0;)if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}if(position<0)return this;1===list.length?(list.length=0,delete this._events[type]):list.splice(position,1),this._events.removeListener&&this.emit("removeListener",type,listener)}return this},EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[type]&&delete this._events[type],this;if(0===arguments.length){for(key in this._events)"removeListener"!==key&&this.removeAllListeners(key);return this.removeAllListeners("removeListener"),this._events={},this}if(listeners=this._events[type],isFunction(listeners))this.removeListener(type,listeners);else if(listeners)for(;listeners.length;)this.removeListener(type,listeners[listeners.length-1]);return delete this._events[type],this},EventEmitter.prototype.listeners=function(type){return this._events&&this._events[type]?isFunction(this._events[type])?[this._events[type]]:this._events[type].slice():[]},EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;if(evlistener)return evlistener.length}return 0},EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)}},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(tasks,callback){function nextTask(args){var task=(0,_wrapAsync2.default)(tasks[taskIndex++]);args.push((0,_onlyOnce2.default)(next)),task.apply(null,args)}function next(err){if(err||taskIndex===tasks.length)return callback.apply(null,arguments);nextTask((0,_slice2.default)(arguments,1))}if(callback=(0,_once2.default)(callback||_noop2.default),!(0,_isArray2.default)(tasks))return callback(new Error("First argument to waterfall must be an array of functions"));if(!tasks.length)return callback();var taskIndex=0;nextTask([])};var _isArray=__webpack_require__(109),_isArray2=_interopRequireDefault(_isArray),_noop=__webpack_require__(33),_noop2=_interopRequireDefault(_noop),_once=__webpack_require__(125),_once2=_interopRequireDefault(_once),_slice=__webpack_require__(56),_slice2=_interopRequireDefault(_slice),_onlyOnce=__webpack_require__(55),_onlyOnce2=_interopRequireDefault(_onlyOnce),_wrapAsync=__webpack_require__(19),_wrapAsync2=_interopRequireDefault(_wrapAsync);module.exports=exports.default},function(module,exports,__webpack_require__){(function(global,process){function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(ctx.depth=arguments[2]),arguments.length>=4&&(ctx.colors=arguments[3]),isBoolean(opts)?ctx.showHidden=opts:opts&&exports._extend(ctx,opts),isUndefined(ctx.showHidden)&&(ctx.showHidden=!1),isUndefined(ctx.depth)&&(ctx.depth=2),isUndefined(ctx.colors)&&(ctx.colors=!1),isUndefined(ctx.customInspect)&&(ctx.customInspect=!0),ctx.colors&&(ctx.stylize=stylizeWithColor),formatValue(ctx,obj,ctx.depth)}function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];return style?"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m":str}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};return array.forEach(function(val,idx){hash[val]=!0}),hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&(!value.constructor||value.constructor.prototype!==value)){var ret=value.inspect(recurseTimes,ctx);return isString(ret)||(ret=formatValue(ctx,ret,recurseTimes)),ret}var primitive=formatPrimitive(ctx,value);if(primitive)return primitive;var keys=Object.keys(value),visibleKeys=arrayToHash(keys);if(ctx.showHidden&&(keys=Object.getOwnPropertyNames(value)),isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0))return formatError(value);if(0===keys.length){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value))return ctx.stylize(RegExp.prototype.toString.call(value),"regexp");if(isDate(value))return ctx.stylize(Date.prototype.toString.call(value),"date");if(isError(value))return formatError(value)}var base="",array=!1,braces=["{","}"];if(isArray(value)&&(array=!0,braces=["[","]"]),isFunction(value)){base=" [Function"+(value.name?": "+value.name:"")+"]"}if(isRegExp(value)&&(base=" "+RegExp.prototype.toString.call(value)),isDate(value)&&(base=" "+Date.prototype.toUTCString.call(value)),isError(value)&&(base=" "+formatError(value)),0===keys.length&&(!array||0==value.length))return braces[0]+base+braces[1];if(recurseTimes<0)return isRegExp(value)?ctx.stylize(RegExp.prototype.toString.call(value),"regexp"):ctx.stylize("[Object]","special");ctx.seen.push(value);var output;return output=array?formatArray(ctx,value,recurseTimes,visibleKeys,keys):keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)}),ctx.seen.pop(),reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}return isNumber(value)?ctx.stylize(""+value,"number"):isBoolean(value)?ctx.stylize(""+value,"boolean"):isNull(value)?ctx.stylize("null","null"):void 0}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){for(var output=[],i=0,l=value.length;i-1&&(str=array?str.split("\n").map(function(line){return" "+line}).join("\n").substr(2):"\n"+str.split("\n").map(function(line){return" "+line}).join("\n"))):str=ctx.stylize("[Circular]","special")),isUndefined(name)){if(array&&key.match(/^\d+$/))return str;name=JSON.stringify(""+key),name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(name=name.substr(1,name.length-2),name=ctx.stylize(name,"name")):(name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),name=ctx.stylize(name,"string"))}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;return output.reduce(function(prev,cur){return numLinesEst++,cur.indexOf("\n")>=0&&numLinesEst++,prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?braces[0]+(""===base?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]:braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}function isBoolean(arg){return"boolean"==typeof arg}function isNull(arg){return null===arg}function isNullOrUndefined(arg){return null==arg}function isNumber(arg){return"number"==typeof arg}function isString(arg){return"string"==typeof arg}function isSymbol(arg){return"symbol"==typeof arg}function isUndefined(arg){return void 0===arg}function isRegExp(re){return isObject(re)&&"[object RegExp]"===objectToString(re)}function isObject(arg){return"object"==typeof arg&&null!==arg}function isDate(d){return isObject(d)&&"[object Date]"===objectToString(d)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(arg){return"function"==typeof arg}function isPrimitive(arg){return null===arg||"boolean"==typeof arg||"number"==typeof arg||"string"==typeof arg||"symbol"==typeof arg||void 0===arg}function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}function timestamp(){var d=new Date,time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}exports.format=function(f){if(!isString(f)){for(var objects=[],i=0;i=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}}),x=args[i];iMAX_LEN)throw new RangeError("size is too large");var enc=encoding,_fill=fill;void 0===_fill&&(enc=void 0,_fill=0);var buf=new Buffer(size) +;if("string"==typeof _fill)for(var fillBuf=new Buffer(_fill,enc),flen=fillBuf.length,i=-1;++iMAX_LEN)throw new RangeError("size is too large");return new Buffer(size)},exports.from=function(value,encodingOrOffset,length){if("function"==typeof Buffer.from&&(!global.Uint8Array||Uint8Array.from!==Buffer.from))return Buffer.from(value,encodingOrOffset,length);if("number"==typeof value)throw new TypeError('"value" argument must not be a number');if("string"==typeof value)return new Buffer(value,encodingOrOffset);if("undefined"!=typeof ArrayBuffer&&value instanceof ArrayBuffer){var offset=encodingOrOffset;if(1===arguments.length)return new Buffer(value);void 0===offset&&(offset=0);var len=length;if(void 0===len&&(len=value.byteLength-offset),offset>=value.byteLength)throw new RangeError("'offset' is out of bounds");if(len>value.byteLength-offset)throw new RangeError("'length' is out of bounds");return new Buffer(value.slice(offset,offset+len))}if(Buffer.isBuffer(value)){var out=new Buffer(value.length);return value.copy(out,0,0,value.length),out}if(value){if(Array.isArray(value)||"undefined"!=typeof ArrayBuffer&&value.buffer instanceof ArrayBuffer||"length"in value)return new Buffer(value);if("Buffer"===value.type&&Array.isArray(value.data))return new Buffer(value.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")},exports.allocUnsafeSlow=function(size){if("function"==typeof Buffer.allocUnsafeSlow)return Buffer.allocUnsafeSlow(size);if("number"!=typeof size)throw new TypeError("size must be a number");if(size>=MAX_LEN)throw new RangeError("size is too large");return new SlowBuffer(size)}}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){"use strict";(function(process){function nextTick(fn,arg1,arg2,arg3){if("function"!=typeof fn)throw new TypeError('"callback" argument must be a function');var args,i,len=arguments.length;switch(len){case 0:case 1:return process.nextTick(fn);case 2:return process.nextTick(function(){fn.call(null,arg1)});case 3:return process.nextTick(function(){fn.call(null,arg1,arg2)});case 4:return process.nextTick(function(){fn.call(null,arg1,arg2,arg3)});default:for(args=new Array(len-1),i=0;i 3 bytes.");let code=varint.decode(buf);if(!exports.isValidCode(code))throw new Error(`multihash unknown function code: 0x${code.toString(16)}`);buf=buf.slice(varint.decode.bytes);let len=varint.decode(buf);if(len<1)throw new Error(`multihash invalid length: 0x${len.toString(16)}`);if(buf=buf.slice(varint.decode.bytes),buf.length!==len)throw new Error(`multihash length inconsistent: 0x${buf.toString("hex")}`);return{code:code,name:cs.codes[code],length:len,digest:buf}},exports.encode=function(digest,code,length){if(!digest||!code)throw new Error("multihash encode requires at least two args: digest, code");const hashfn=exports.coerceCode(code);if(!Buffer.isBuffer(digest))throw new Error("digest should be a Buffer");if(null==length&&(length=digest.length),length&&digest.length!==length)throw new Error("digest length should be equal to specified length.");return Buffer.concat([new Buffer(varint.encode(hashfn)),new Buffer(varint.encode(length)),digest])},exports.coerceCode=function(name){let code=name;if("string"==typeof name){if(!cs.names[name])throw new Error(`Unrecognized hash function named: ${name}`);code=cs.names[name]}if("number"!=typeof code)throw new Error(`Hash function code should be a number. Got: ${code}`);if(!cs.codes[code]&&!exports.isAppCode(code))throw new Error(`Unrecognized function code: ${code}`);return code},exports.isAppCode=function(code){return code>0&&code<16},exports.isValidCode=function(code){return!!exports.isAppCode(code)||!!cs.codes[code]},exports.validate=validate,exports.prefix=function(multihash){return validate(multihash),multihash.slice(0,2)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function assertEncoding(encoding){if(encoding&&!isBufferEncoding(encoding))throw new Error("Unknown encoding: "+encoding)}function passThroughWrite(buffer){return buffer.toString(this.encoding)}function utf16DetectIncompleteChar(buffer){this.charReceived=buffer.length%2,this.charLength=this.charReceived?2:0}function base64DetectIncompleteChar(buffer){this.charReceived=buffer.length%3,this.charLength=this.charReceived?3:0}var Buffer=__webpack_require__(0).Buffer,isBufferEncoding=Buffer.isEncoding||function(encoding){switch(encoding&&encoding.toLowerCase()){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":return!0;default:return!1}},StringDecoder=exports.StringDecoder=function(encoding){switch(this.encoding=(encoding||"utf8").toLowerCase().replace(/[-_]/,""),assertEncoding(encoding),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=utf16DetectIncompleteChar;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=base64DetectIncompleteChar;break;default:return void(this.write=passThroughWrite)}this.charBuffer=new Buffer(6),this.charReceived=0,this.charLength=0};StringDecoder.prototype.write=function(buffer){for(var charStr="";this.charLength;){var available=buffer.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:buffer.length;if(buffer.copy(this.charBuffer,this.charReceived,0,available),this.charReceived+=available,this.charReceived=55296&&charCode<=56319)){if(this.charReceived=this.charLength=0,0===buffer.length)return charStr;break}this.charLength+=this.surrogateSize,charStr=""}this.detectIncompleteChar(buffer);var end=buffer.length;this.charLength&&(buffer.copy(this.charBuffer,0,buffer.length-this.charReceived,end),end-=this.charReceived),charStr+=buffer.toString(this.encoding,0,end);var end=charStr.length-1,charCode=charStr.charCodeAt(end);if(charCode>=55296&&charCode<=56319){var size=this.surrogateSize;return this.charLength+=size,this.charReceived+=size,this.charBuffer.copy(this.charBuffer,size,0,size),buffer.copy(this.charBuffer,0,0,size),charStr.substring(0,end)}return charStr},StringDecoder.prototype.detectIncompleteChar=function(buffer){for(var i=buffer.length>=3?3:buffer.length;i>0;i--){var c=buffer[buffer.length-i];if(1==i&&c>>5==6){this.charLength=2;break}if(i<=2&&c>>4==14){this.charLength=3;break}if(i<=3&&c>>3==30){this.charLength=4;break}}this.charReceived=i},StringDecoder.prototype.end=function(buffer){var res="";if(buffer&&buffer.length&&(res=this.write(buffer)),this.charReceived){var cr=this.charReceived,buf=this.charBuffer,enc=this.encoding;res+=buf.slice(0,cr).toString(enc)}return res}},function(module,exports,__webpack_require__){"use strict";function isAsync(fn){return supportsSymbol&&"AsyncFunction"===fn[Symbol.toStringTag]}function wrapAsync(asyncFn){return isAsync(asyncFn)?(0,_asyncify2.default)(asyncFn):asyncFn}Object.defineProperty(exports,"__esModule",{value:!0}),exports.isAsync=void 0;var _asyncify=__webpack_require__(343),_asyncify2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_asyncify),supportsSymbol="function"==typeof Symbol;exports.default=wrapAsync,exports.isAsync=isAsync},function(module,exports,__webpack_require__){(function(module){!function(module,exports){"use strict";function assert(val,msg){if(!val)throw new Error(msg||"Assertion failed")}function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype,ctor.prototype=new TempCtor,ctor.prototype.constructor=ctor}function BN(number,base,endian){if(BN.isBN(number))return number;this.negative=0,this.words=null,this.length=0,this.red=null,null!==number&&("le"!==base&&"be"!==base||(endian=base,base=10),this._init(number||0,base||10,endian||"be"))}function parseHex(str,start,end){for(var r=0,len=Math.min(str.length,end),i=start;i=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:15&c}return r}function parseBase(str,start,end,mul){for(var r=0,len=Math.min(str.length,end),i=start;i=49?c-49+10:c>=17?c-17+10:c}return r}function toBitArray(num){for(var w=new Array(num.bitLength()),bit=0;bit>>wbit}return w}function smallMulTo(self,num,out){out.negative=num.negative^self.negative;var len=self.length+num.length|0;out.length=len,len=len-1|0;var a=0|self.words[0],b=0|num.words[0],r=a*b,lo=67108863&r,carry=r/67108864|0;out.words[0]=lo;for(var k=1;k>>26,rword=67108863&carry,maxJ=Math.min(k,num.length-1),j=Math.max(0,k-self.length+1);j<=maxJ;j++){var i=k-j|0;a=0|self.words[i],b=0|num.words[j],r=a*b+rword,ncarry+=r/67108864|0,rword=67108863&r}out.words[k]=0|rword,carry=0|ncarry}return 0!==carry?out.words[k]=0|carry:out.length--,out.strip()}function bigMulTo(self,num,out){out.negative=num.negative^self.negative,out.length=self.length+num.length;for(var carry=0,hncarry=0,k=0;k>>26)|0,hncarry+=ncarry>>>26,ncarry&=67108863}out.words[k]=rword,carry=ncarry,ncarry=hncarry}return 0!==carry?out.words[k]=carry:out.length--,out.strip()}function jumboMulTo(self,num,out){return(new FFTM).mulp(self,num,out)}function FFTM(x,y){this.x=x,this.y=y}function MPrime(name,p){this.name=name,this.p=new BN(p,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(m){if("string"==typeof m){var prime=BN._prime(m);this.m=prime.p,this.prime=prime}else assert(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}function Mont(m){Red.call(this,m),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof module?module.exports=BN:exports.BN=BN,BN.BN=BN,BN.wordSize=26;var Buffer;try{Buffer=__webpack_require__(0).Buffer}catch(e){}BN.isBN=function(num){return num instanceof BN||null!==num&&"object"==typeof num&&num.constructor.wordSize===BN.wordSize&&Array.isArray(num.words)},BN.max=function(left,right){return left.cmp(right)>0?left:right},BN.min=function(left,right){return left.cmp(right)<0?left:right},BN.prototype._init=function(number,base,endian){if("number"==typeof number)return this._initNumber(number,base,endian);if("object"==typeof number)return this._initArray(number,base,endian);"hex"===base&&(base=16),assert(base===(0|base)&&base>=2&&base<=36),number=number.toString().replace(/\s+/g,"");var start=0;"-"===number[0]&&start++,16===base?this._parseHex(number,start):this._parseBase(number,base,start),"-"===number[0]&&(this.negative=1),this.strip(),"le"===endian&&this._initArray(this.toArray(),base,endian)},BN.prototype._initNumber=function(number,base,endian){number<0&&(this.negative=1,number=-number),number<67108864?(this.words=[67108863&number],this.length=1):number<4503599627370496?(this.words=[67108863&number,number/67108864&67108863],this.length=2):(assert(number<9007199254740992),this.words=[67108863&number,number/67108864&67108863,1],this.length=3),"le"===endian&&this._initArray(this.toArray(),base,endian)},BN.prototype._initArray=function(number,base,endian){if(assert("number"==typeof number.length),number.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(number.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)w=number[i]|number[i-1]<<8|number[i-2]<<16,this.words[j]|=w<>>26-off&67108863,(off+=24)>=26&&(off-=26,j++);else if("le"===endian)for(i=0,j=0;i>>26-off&67108863,(off+=24)>=26&&(off-=26,j++);return this.strip()},BN.prototype._parseHex=function(number,start){this.length=Math.ceil((number.length-start)/6),this.words=new Array(this.length);for(var i=0;i=start;i-=6)w=parseHex(number,i,i+6),this.words[j]|=w<>>26-off&4194303,(off+=24)>=26&&(off-=26,j++);i+6!==start&&(w=parseHex(number,start,i+6),this.words[j]|=w<>>26-off&4194303),this.strip()},BN.prototype._parseBase=function(number,base,start){this.words=[0],this.length=1;for(var limbLen=0,limbPow=1;limbPow<=67108863;limbPow*=base)limbLen++;limbLen--,limbPow=limbPow/base|0;for(var total=number.length-start,mod=total%limbLen,end=Math.min(total,total-mod)+start,word=0,i=start;i1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.inspect=function(){return(this.red?""};var zeros=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],groupSizes=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],groupBases=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];BN.prototype.toString=function(base,padding){base=base||10,padding=0|padding||1;var out;if(16===base||"hex"===base){out="";for(var off=0,carry=0,i=0;i>>24-off&16777215,out=0!==carry||i!==this.length-1?zeros[6-word.length]+word+out:word+out,off+=2,off>=26&&(off-=26,i--)}for(0!==carry&&(out=carry.toString(16)+out);out.length%padding!=0;)out="0"+out;return 0!==this.negative&&(out="-"+out),out}if(base===(0|base)&&base>=2&&base<=36){var groupSize=groupSizes[base],groupBase=groupBases[base];out="";var c=this.clone();for(c.negative=0;!c.isZero();){var r=c.modn(groupBase).toString(base);c=c.idivn(groupBase),out=c.isZero()?r+out:zeros[groupSize-r.length]+r+out}for(this.isZero()&&(out="0"+out);out.length%padding!=0;)out="0"+out;return 0!==this.negative&&(out="-"+out),out}assert(!1,"Base should be between 2 and 36")},BN.prototype.toNumber=function(){var ret=this.words[0];return 2===this.length?ret+=67108864*this.words[1]:3===this.length&&1===this.words[2]?ret+=4503599627370496+67108864*this.words[1]:this.length>2&&assert(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-ret:ret},BN.prototype.toJSON=function(){return this.toString(16)},BN.prototype.toBuffer=function(endian,length){return assert(void 0!==Buffer),this.toArrayLike(Buffer,endian,length)},BN.prototype.toArray=function(endian,length){return this.toArrayLike(Array,endian,length)},BN.prototype.toArrayLike=function(ArrayType,endian,length){var byteLength=this.byteLength(),reqLength=length||Math.max(1,byteLength);assert(byteLength<=reqLength,"byte array longer than desired length"),assert(reqLength>0,"Requested array length <= 0"),this.strip();var b,i,littleEndian="le"===endian,res=new ArrayType(reqLength),q=this.clone();if(littleEndian){for(i=0;!q.isZero();i++)b=q.andln(255),q.iushrn(8),res[i]=b;for(;i=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},BN.prototype._zeroBits=function(w){if(0===w)return 26;var t=w,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},BN.prototype.bitLength=function(){var w=this.words[this.length-1],hi=this._countBits(w);return 26*(this.length-1)+hi},BN.prototype.zeroBits=function(){if(this.isZero())return 0;for(var r=0,i=0;inum.length?this.clone().ior(num):num.clone().ior(this)},BN.prototype.uor=function(num){return this.length>num.length?this.clone().iuor(num):num.clone().iuor(this)},BN.prototype.iuand=function(num){var b;b=this.length>num.length?num:this;for(var i=0;inum.length?this.clone().iand(num):num.clone().iand(this)},BN.prototype.uand=function(num){return this.length>num.length?this.clone().iuand(num):num.clone().iuand(this)},BN.prototype.iuxor=function(num){var a,b;this.length>num.length?(a=this,b=num):(a=num,b=this);for(var i=0;inum.length?this.clone().ixor(num):num.clone().ixor(this)},BN.prototype.uxor=function(num){return this.length>num.length?this.clone().iuxor(num):num.clone().iuxor(this)},BN.prototype.inotn=function(width){assert("number"==typeof width&&width>=0);var bytesNeeded=0|Math.ceil(width/26),bitsLeft=width%26;this._expand(bytesNeeded),bitsLeft>0&&bytesNeeded--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-bitsLeft),this.strip()},BN.prototype.notn=function(width){return this.clone().inotn(width)},BN.prototype.setn=function(bit,val){assert("number"==typeof bit&&bit>=0);var off=bit/26|0,wbit=bit%26;return this._expand(off+1),this.words[off]=val?this.words[off]|1<num.length?(a=this,b=num):(a=num,b=this);for(var carry=0,i=0;i>>26;for(;0!==carry&&i>>26;if(this.length=a.length,0!==carry)this.words[this.length]=carry,this.length++;else if(a!==this)for(;inum.length?this.clone().iadd(num):num.clone().iadd(this)},BN.prototype.isub=function(num){if(0!==num.negative){num.negative=0;var r=this.iadd(num);return num.negative=1,r._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(num),this.negative=1,this._normSign();var cmp=this.cmp(num);if(0===cmp)return this.negative=0,this.length=1,this.words[0]=0,this;var a,b;cmp>0?(a=this,b=num):(a=num,b=this);for(var carry=0,i=0;i>26,this.words[i]=67108863&r;for(;0!==carry&&i>26,this.words[i]=67108863&r;if(0===carry&&i>>13,a1=0|a[1],al1=8191&a1,ah1=a1>>>13,a2=0|a[2],al2=8191&a2,ah2=a2>>>13,a3=0|a[3],al3=8191&a3,ah3=a3>>>13,a4=0|a[4],al4=8191&a4,ah4=a4>>>13,a5=0|a[5],al5=8191&a5,ah5=a5>>>13,a6=0|a[6],al6=8191&a6,ah6=a6>>>13,a7=0|a[7],al7=8191&a7,ah7=a7>>>13,a8=0|a[8],al8=8191&a8,ah8=a8>>>13,a9=0|a[9],al9=8191&a9,ah9=a9>>>13,b0=0|b[0],bl0=8191&b0,bh0=b0>>>13,b1=0|b[1],bl1=8191&b1,bh1=b1>>>13,b2=0|b[2],bl2=8191&b2,bh2=b2>>>13,b3=0|b[3],bl3=8191&b3,bh3=b3>>>13,b4=0|b[4],bl4=8191&b4,bh4=b4>>>13,b5=0|b[5],bl5=8191&b5,bh5=b5>>>13,b6=0|b[6],bl6=8191&b6,bh6=b6>>>13,b7=0|b[7],bl7=8191&b7,bh7=b7>>>13,b8=0|b[8],bl8=8191&b8,bh8=b8>>>13,b9=0|b[9],bl9=8191&b9,bh9=b9>>>13;out.negative=self.negative^num.negative,out.length=19,lo=Math.imul(al0,bl0),mid=Math.imul(al0,bh0),mid=mid+Math.imul(ah0,bl0)|0,hi=Math.imul(ah0,bh0);var w0=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w0>>>26)|0,w0&=67108863,lo=Math.imul(al1,bl0),mid=Math.imul(al1,bh0),mid=mid+Math.imul(ah1,bl0)|0,hi=Math.imul(ah1,bh0),lo=lo+Math.imul(al0,bl1)|0,mid=mid+Math.imul(al0,bh1)|0,mid=mid+Math.imul(ah0,bl1)|0,hi=hi+Math.imul(ah0,bh1)|0;var w1=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w1>>>26)|0,w1&=67108863,lo=Math.imul(al2,bl0),mid=Math.imul(al2,bh0),mid=mid+Math.imul(ah2,bl0)|0,hi=Math.imul(ah2,bh0),lo=lo+Math.imul(al1,bl1)|0,mid=mid+Math.imul(al1,bh1)|0,mid=mid+Math.imul(ah1,bl1)|0,hi=hi+Math.imul(ah1,bh1)|0,lo=lo+Math.imul(al0,bl2)|0,mid=mid+Math.imul(al0,bh2)|0,mid=mid+Math.imul(ah0,bl2)|0,hi=hi+Math.imul(ah0,bh2)|0;var w2=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w2>>>26)|0,w2&=67108863,lo=Math.imul(al3,bl0),mid=Math.imul(al3,bh0),mid=mid+Math.imul(ah3,bl0)|0,hi=Math.imul(ah3,bh0),lo=lo+Math.imul(al2,bl1)|0,mid=mid+Math.imul(al2,bh1)|0,mid=mid+Math.imul(ah2,bl1)|0,hi=hi+Math.imul(ah2,bh1)|0,lo=lo+Math.imul(al1,bl2)|0,mid=mid+Math.imul(al1,bh2)|0,mid=mid+Math.imul(ah1,bl2)|0,hi=hi+Math.imul(ah1,bh2)|0,lo=lo+Math.imul(al0,bl3)|0,mid=mid+Math.imul(al0,bh3)|0,mid=mid+Math.imul(ah0,bl3)|0,hi=hi+Math.imul(ah0,bh3)|0;var w3=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w3>>>26)|0,w3&=67108863,lo=Math.imul(al4,bl0),mid=Math.imul(al4,bh0),mid=mid+Math.imul(ah4,bl0)|0,hi=Math.imul(ah4,bh0),lo=lo+Math.imul(al3,bl1)|0,mid=mid+Math.imul(al3,bh1)|0,mid=mid+Math.imul(ah3,bl1)|0,hi=hi+Math.imul(ah3,bh1)|0,lo=lo+Math.imul(al2,bl2)|0,mid=mid+Math.imul(al2,bh2)|0,mid=mid+Math.imul(ah2,bl2)|0,hi=hi+Math.imul(ah2,bh2)|0,lo=lo+Math.imul(al1,bl3)|0,mid=mid+Math.imul(al1,bh3)|0,mid=mid+Math.imul(ah1,bl3)|0,hi=hi+Math.imul(ah1,bh3)|0,lo=lo+Math.imul(al0,bl4)|0,mid=mid+Math.imul(al0,bh4)|0,mid=mid+Math.imul(ah0,bl4)|0,hi=hi+Math.imul(ah0,bh4)|0;var w4=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w4>>>26)|0,w4&=67108863,lo=Math.imul(al5,bl0),mid=Math.imul(al5,bh0),mid=mid+Math.imul(ah5,bl0)|0,hi=Math.imul(ah5,bh0),lo=lo+Math.imul(al4,bl1)|0,mid=mid+Math.imul(al4,bh1)|0,mid=mid+Math.imul(ah4,bl1)|0,hi=hi+Math.imul(ah4,bh1)|0,lo=lo+Math.imul(al3,bl2)|0,mid=mid+Math.imul(al3,bh2)|0,mid=mid+Math.imul(ah3,bl2)|0,hi=hi+Math.imul(ah3,bh2)|0,lo=lo+Math.imul(al2,bl3)|0,mid=mid+Math.imul(al2,bh3)|0,mid=mid+Math.imul(ah2,bl3)|0,hi=hi+Math.imul(ah2,bh3)|0,lo=lo+Math.imul(al1,bl4)|0,mid=mid+Math.imul(al1,bh4)|0,mid=mid+Math.imul(ah1,bl4)|0,hi=hi+Math.imul(ah1,bh4)|0,lo=lo+Math.imul(al0,bl5)|0,mid=mid+Math.imul(al0,bh5)|0,mid=mid+Math.imul(ah0,bl5)|0,hi=hi+Math.imul(ah0,bh5)|0;var w5=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w5>>>26)|0,w5&=67108863,lo=Math.imul(al6,bl0),mid=Math.imul(al6,bh0),mid=mid+Math.imul(ah6,bl0)|0,hi=Math.imul(ah6,bh0),lo=lo+Math.imul(al5,bl1)|0,mid=mid+Math.imul(al5,bh1)|0,mid=mid+Math.imul(ah5,bl1)|0,hi=hi+Math.imul(ah5,bh1)|0,lo=lo+Math.imul(al4,bl2)|0,mid=mid+Math.imul(al4,bh2)|0,mid=mid+Math.imul(ah4,bl2)|0,hi=hi+Math.imul(ah4,bh2)|0,lo=lo+Math.imul(al3,bl3)|0,mid=mid+Math.imul(al3,bh3)|0,mid=mid+Math.imul(ah3,bl3)|0,hi=hi+Math.imul(ah3,bh3)|0,lo=lo+Math.imul(al2,bl4)|0,mid=mid+Math.imul(al2,bh4)|0,mid=mid+Math.imul(ah2,bl4)|0,hi=hi+Math.imul(ah2,bh4)|0,lo=lo+Math.imul(al1,bl5)|0,mid=mid+Math.imul(al1,bh5)|0,mid=mid+Math.imul(ah1,bl5)|0,hi=hi+Math.imul(ah1,bh5)|0,lo=lo+Math.imul(al0,bl6)|0,mid=mid+Math.imul(al0,bh6)|0,mid=mid+Math.imul(ah0,bl6)|0,hi=hi+Math.imul(ah0,bh6)|0;var w6=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w6>>>26)|0,w6&=67108863,lo=Math.imul(al7,bl0),mid=Math.imul(al7,bh0),mid=mid+Math.imul(ah7,bl0)|0,hi=Math.imul(ah7,bh0),lo=lo+Math.imul(al6,bl1)|0,mid=mid+Math.imul(al6,bh1)|0,mid=mid+Math.imul(ah6,bl1)|0,hi=hi+Math.imul(ah6,bh1)|0,lo=lo+Math.imul(al5,bl2)|0,mid=mid+Math.imul(al5,bh2)|0,mid=mid+Math.imul(ah5,bl2)|0,hi=hi+Math.imul(ah5,bh2)|0,lo=lo+Math.imul(al4,bl3)|0,mid=mid+Math.imul(al4,bh3)|0,mid=mid+Math.imul(ah4,bl3)|0,hi=hi+Math.imul(ah4,bh3)|0,lo=lo+Math.imul(al3,bl4)|0,mid=mid+Math.imul(al3,bh4)|0,mid=mid+Math.imul(ah3,bl4)|0,hi=hi+Math.imul(ah3,bh4)|0,lo=lo+Math.imul(al2,bl5)|0,mid=mid+Math.imul(al2,bh5)|0,mid=mid+Math.imul(ah2,bl5)|0,hi=hi+Math.imul(ah2,bh5)|0,lo=lo+Math.imul(al1,bl6)|0,mid=mid+Math.imul(al1,bh6)|0,mid=mid+Math.imul(ah1,bl6)|0,hi=hi+Math.imul(ah1,bh6)|0,lo=lo+Math.imul(al0,bl7)|0,mid=mid+Math.imul(al0,bh7)|0,mid=mid+Math.imul(ah0,bl7)|0,hi=hi+Math.imul(ah0,bh7)|0;var w7=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w7>>>26)|0,w7&=67108863,lo=Math.imul(al8,bl0),mid=Math.imul(al8,bh0),mid=mid+Math.imul(ah8,bl0)|0,hi=Math.imul(ah8,bh0),lo=lo+Math.imul(al7,bl1)|0,mid=mid+Math.imul(al7,bh1)|0,mid=mid+Math.imul(ah7,bl1)|0,hi=hi+Math.imul(ah7,bh1)|0,lo=lo+Math.imul(al6,bl2)|0,mid=mid+Math.imul(al6,bh2)|0,mid=mid+Math.imul(ah6,bl2)|0,hi=hi+Math.imul(ah6,bh2)|0,lo=lo+Math.imul(al5,bl3)|0,mid=mid+Math.imul(al5,bh3)|0,mid=mid+Math.imul(ah5,bl3)|0,hi=hi+Math.imul(ah5,bh3)|0,lo=lo+Math.imul(al4,bl4)|0,mid=mid+Math.imul(al4,bh4)|0,mid=mid+Math.imul(ah4,bl4)|0,hi=hi+Math.imul(ah4,bh4)|0,lo=lo+Math.imul(al3,bl5)|0,mid=mid+Math.imul(al3,bh5)|0,mid=mid+Math.imul(ah3,bl5)|0,hi=hi+Math.imul(ah3,bh5)|0,lo=lo+Math.imul(al2,bl6)|0,mid=mid+Math.imul(al2,bh6)|0,mid=mid+Math.imul(ah2,bl6)|0,hi=hi+Math.imul(ah2,bh6)|0,lo=lo+Math.imul(al1,bl7)|0,mid=mid+Math.imul(al1,bh7)|0,mid=mid+Math.imul(ah1,bl7)|0,hi=hi+Math.imul(ah1,bh7)|0,lo=lo+Math.imul(al0,bl8)|0,mid=mid+Math.imul(al0,bh8)|0,mid=mid+Math.imul(ah0,bl8)|0,hi=hi+Math.imul(ah0,bh8)|0;var w8=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w8>>>26)|0,w8&=67108863,lo=Math.imul(al9,bl0),mid=Math.imul(al9,bh0),mid=mid+Math.imul(ah9,bl0)|0,hi=Math.imul(ah9,bh0),lo=lo+Math.imul(al8,bl1)|0,mid=mid+Math.imul(al8,bh1)|0,mid=mid+Math.imul(ah8,bl1)|0,hi=hi+Math.imul(ah8,bh1)|0,lo=lo+Math.imul(al7,bl2)|0,mid=mid+Math.imul(al7,bh2)|0,mid=mid+Math.imul(ah7,bl2)|0,hi=hi+Math.imul(ah7,bh2)|0,lo=lo+Math.imul(al6,bl3)|0,mid=mid+Math.imul(al6,bh3)|0,mid=mid+Math.imul(ah6,bl3)|0,hi=hi+Math.imul(ah6,bh3)|0,lo=lo+Math.imul(al5,bl4)|0,mid=mid+Math.imul(al5,bh4)|0,mid=mid+Math.imul(ah5,bl4)|0,hi=hi+Math.imul(ah5,bh4)|0,lo=lo+Math.imul(al4,bl5)|0,mid=mid+Math.imul(al4,bh5)|0,mid=mid+Math.imul(ah4,bl5)|0,hi=hi+Math.imul(ah4,bh5)|0,lo=lo+Math.imul(al3,bl6)|0,mid=mid+Math.imul(al3,bh6)|0,mid=mid+Math.imul(ah3,bl6)|0,hi=hi+Math.imul(ah3,bh6)|0,lo=lo+Math.imul(al2,bl7)|0,mid=mid+Math.imul(al2,bh7)|0,mid=mid+Math.imul(ah2,bl7)|0,hi=hi+Math.imul(ah2,bh7)|0,lo=lo+Math.imul(al1,bl8)|0,mid=mid+Math.imul(al1,bh8)|0,mid=mid+Math.imul(ah1,bl8)|0,hi=hi+Math.imul(ah1,bh8)|0,lo=lo+Math.imul(al0,bl9)|0,mid=mid+Math.imul(al0,bh9)|0,mid=mid+Math.imul(ah0,bl9)|0,hi=hi+Math.imul(ah0,bh9)|0;var w9=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w9>>>26)|0,w9&=67108863,lo=Math.imul(al9,bl1),mid=Math.imul(al9,bh1),mid=mid+Math.imul(ah9,bl1)|0,hi=Math.imul(ah9,bh1),lo=lo+Math.imul(al8,bl2)|0, +mid=mid+Math.imul(al8,bh2)|0,mid=mid+Math.imul(ah8,bl2)|0,hi=hi+Math.imul(ah8,bh2)|0,lo=lo+Math.imul(al7,bl3)|0,mid=mid+Math.imul(al7,bh3)|0,mid=mid+Math.imul(ah7,bl3)|0,hi=hi+Math.imul(ah7,bh3)|0,lo=lo+Math.imul(al6,bl4)|0,mid=mid+Math.imul(al6,bh4)|0,mid=mid+Math.imul(ah6,bl4)|0,hi=hi+Math.imul(ah6,bh4)|0,lo=lo+Math.imul(al5,bl5)|0,mid=mid+Math.imul(al5,bh5)|0,mid=mid+Math.imul(ah5,bl5)|0,hi=hi+Math.imul(ah5,bh5)|0,lo=lo+Math.imul(al4,bl6)|0,mid=mid+Math.imul(al4,bh6)|0,mid=mid+Math.imul(ah4,bl6)|0,hi=hi+Math.imul(ah4,bh6)|0,lo=lo+Math.imul(al3,bl7)|0,mid=mid+Math.imul(al3,bh7)|0,mid=mid+Math.imul(ah3,bl7)|0,hi=hi+Math.imul(ah3,bh7)|0,lo=lo+Math.imul(al2,bl8)|0,mid=mid+Math.imul(al2,bh8)|0,mid=mid+Math.imul(ah2,bl8)|0,hi=hi+Math.imul(ah2,bh8)|0,lo=lo+Math.imul(al1,bl9)|0,mid=mid+Math.imul(al1,bh9)|0,mid=mid+Math.imul(ah1,bl9)|0,hi=hi+Math.imul(ah1,bh9)|0;var w10=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w10>>>26)|0,w10&=67108863,lo=Math.imul(al9,bl2),mid=Math.imul(al9,bh2),mid=mid+Math.imul(ah9,bl2)|0,hi=Math.imul(ah9,bh2),lo=lo+Math.imul(al8,bl3)|0,mid=mid+Math.imul(al8,bh3)|0,mid=mid+Math.imul(ah8,bl3)|0,hi=hi+Math.imul(ah8,bh3)|0,lo=lo+Math.imul(al7,bl4)|0,mid=mid+Math.imul(al7,bh4)|0,mid=mid+Math.imul(ah7,bl4)|0,hi=hi+Math.imul(ah7,bh4)|0,lo=lo+Math.imul(al6,bl5)|0,mid=mid+Math.imul(al6,bh5)|0,mid=mid+Math.imul(ah6,bl5)|0,hi=hi+Math.imul(ah6,bh5)|0,lo=lo+Math.imul(al5,bl6)|0,mid=mid+Math.imul(al5,bh6)|0,mid=mid+Math.imul(ah5,bl6)|0,hi=hi+Math.imul(ah5,bh6)|0,lo=lo+Math.imul(al4,bl7)|0,mid=mid+Math.imul(al4,bh7)|0,mid=mid+Math.imul(ah4,bl7)|0,hi=hi+Math.imul(ah4,bh7)|0,lo=lo+Math.imul(al3,bl8)|0,mid=mid+Math.imul(al3,bh8)|0,mid=mid+Math.imul(ah3,bl8)|0,hi=hi+Math.imul(ah3,bh8)|0,lo=lo+Math.imul(al2,bl9)|0,mid=mid+Math.imul(al2,bh9)|0,mid=mid+Math.imul(ah2,bl9)|0,hi=hi+Math.imul(ah2,bh9)|0;var w11=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w11>>>26)|0,w11&=67108863,lo=Math.imul(al9,bl3),mid=Math.imul(al9,bh3),mid=mid+Math.imul(ah9,bl3)|0,hi=Math.imul(ah9,bh3),lo=lo+Math.imul(al8,bl4)|0,mid=mid+Math.imul(al8,bh4)|0,mid=mid+Math.imul(ah8,bl4)|0,hi=hi+Math.imul(ah8,bh4)|0,lo=lo+Math.imul(al7,bl5)|0,mid=mid+Math.imul(al7,bh5)|0,mid=mid+Math.imul(ah7,bl5)|0,hi=hi+Math.imul(ah7,bh5)|0,lo=lo+Math.imul(al6,bl6)|0,mid=mid+Math.imul(al6,bh6)|0,mid=mid+Math.imul(ah6,bl6)|0,hi=hi+Math.imul(ah6,bh6)|0,lo=lo+Math.imul(al5,bl7)|0,mid=mid+Math.imul(al5,bh7)|0,mid=mid+Math.imul(ah5,bl7)|0,hi=hi+Math.imul(ah5,bh7)|0,lo=lo+Math.imul(al4,bl8)|0,mid=mid+Math.imul(al4,bh8)|0,mid=mid+Math.imul(ah4,bl8)|0,hi=hi+Math.imul(ah4,bh8)|0,lo=lo+Math.imul(al3,bl9)|0,mid=mid+Math.imul(al3,bh9)|0,mid=mid+Math.imul(ah3,bl9)|0,hi=hi+Math.imul(ah3,bh9)|0;var w12=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w12>>>26)|0,w12&=67108863,lo=Math.imul(al9,bl4),mid=Math.imul(al9,bh4),mid=mid+Math.imul(ah9,bl4)|0,hi=Math.imul(ah9,bh4),lo=lo+Math.imul(al8,bl5)|0,mid=mid+Math.imul(al8,bh5)|0,mid=mid+Math.imul(ah8,bl5)|0,hi=hi+Math.imul(ah8,bh5)|0,lo=lo+Math.imul(al7,bl6)|0,mid=mid+Math.imul(al7,bh6)|0,mid=mid+Math.imul(ah7,bl6)|0,hi=hi+Math.imul(ah7,bh6)|0,lo=lo+Math.imul(al6,bl7)|0,mid=mid+Math.imul(al6,bh7)|0,mid=mid+Math.imul(ah6,bl7)|0,hi=hi+Math.imul(ah6,bh7)|0,lo=lo+Math.imul(al5,bl8)|0,mid=mid+Math.imul(al5,bh8)|0,mid=mid+Math.imul(ah5,bl8)|0,hi=hi+Math.imul(ah5,bh8)|0,lo=lo+Math.imul(al4,bl9)|0,mid=mid+Math.imul(al4,bh9)|0,mid=mid+Math.imul(ah4,bl9)|0,hi=hi+Math.imul(ah4,bh9)|0;var w13=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w13>>>26)|0,w13&=67108863,lo=Math.imul(al9,bl5),mid=Math.imul(al9,bh5),mid=mid+Math.imul(ah9,bl5)|0,hi=Math.imul(ah9,bh5),lo=lo+Math.imul(al8,bl6)|0,mid=mid+Math.imul(al8,bh6)|0,mid=mid+Math.imul(ah8,bl6)|0,hi=hi+Math.imul(ah8,bh6)|0,lo=lo+Math.imul(al7,bl7)|0,mid=mid+Math.imul(al7,bh7)|0,mid=mid+Math.imul(ah7,bl7)|0,hi=hi+Math.imul(ah7,bh7)|0,lo=lo+Math.imul(al6,bl8)|0,mid=mid+Math.imul(al6,bh8)|0,mid=mid+Math.imul(ah6,bl8)|0,hi=hi+Math.imul(ah6,bh8)|0,lo=lo+Math.imul(al5,bl9)|0,mid=mid+Math.imul(al5,bh9)|0,mid=mid+Math.imul(ah5,bl9)|0,hi=hi+Math.imul(ah5,bh9)|0;var w14=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w14>>>26)|0,w14&=67108863,lo=Math.imul(al9,bl6),mid=Math.imul(al9,bh6),mid=mid+Math.imul(ah9,bl6)|0,hi=Math.imul(ah9,bh6),lo=lo+Math.imul(al8,bl7)|0,mid=mid+Math.imul(al8,bh7)|0,mid=mid+Math.imul(ah8,bl7)|0,hi=hi+Math.imul(ah8,bh7)|0,lo=lo+Math.imul(al7,bl8)|0,mid=mid+Math.imul(al7,bh8)|0,mid=mid+Math.imul(ah7,bl8)|0,hi=hi+Math.imul(ah7,bh8)|0,lo=lo+Math.imul(al6,bl9)|0,mid=mid+Math.imul(al6,bh9)|0,mid=mid+Math.imul(ah6,bl9)|0,hi=hi+Math.imul(ah6,bh9)|0;var w15=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w15>>>26)|0,w15&=67108863,lo=Math.imul(al9,bl7),mid=Math.imul(al9,bh7),mid=mid+Math.imul(ah9,bl7)|0,hi=Math.imul(ah9,bh7),lo=lo+Math.imul(al8,bl8)|0,mid=mid+Math.imul(al8,bh8)|0,mid=mid+Math.imul(ah8,bl8)|0,hi=hi+Math.imul(ah8,bh8)|0,lo=lo+Math.imul(al7,bl9)|0,mid=mid+Math.imul(al7,bh9)|0,mid=mid+Math.imul(ah7,bl9)|0,hi=hi+Math.imul(ah7,bh9)|0;var w16=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w16>>>26)|0,w16&=67108863,lo=Math.imul(al9,bl8),mid=Math.imul(al9,bh8),mid=mid+Math.imul(ah9,bl8)|0,hi=Math.imul(ah9,bh8),lo=lo+Math.imul(al8,bl9)|0,mid=mid+Math.imul(al8,bh9)|0,mid=mid+Math.imul(ah8,bl9)|0,hi=hi+Math.imul(ah8,bh9)|0;var w17=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w17>>>26)|0,w17&=67108863,lo=Math.imul(al9,bl9),mid=Math.imul(al9,bh9),mid=mid+Math.imul(ah9,bl9)|0,hi=Math.imul(ah9,bh9);var w18=(c+lo|0)+((8191&mid)<<13)|0;return c=(hi+(mid>>>13)|0)+(w18>>>26)|0,w18&=67108863,o[0]=w0,o[1]=w1,o[2]=w2,o[3]=w3,o[4]=w4,o[5]=w5,o[6]=w6,o[7]=w7,o[8]=w8,o[9]=w9,o[10]=w10,o[11]=w11,o[12]=w12,o[13]=w13,o[14]=w14,o[15]=w15,o[16]=w16,o[17]=w17,o[18]=w18,0!==c&&(o[19]=c,out.length++),out};Math.imul||(comb10MulTo=smallMulTo),BN.prototype.mulTo=function(num,out){var len=this.length+num.length;return 10===this.length&&10===num.length?comb10MulTo(this,num,out):len<63?smallMulTo(this,num,out):len<1024?bigMulTo(this,num,out):jumboMulTo(this,num,out)},FFTM.prototype.makeRBT=function(N){for(var t=new Array(N),l=BN.prototype._countBits(N)-1,i=0;i>=1;return rb},FFTM.prototype.permute=function(rbt,rws,iws,rtws,itws,N){for(var i=0;i>>=1)i++;return 1<>>=13,rws[2*i+1]=8191&carry,carry>>>=13;for(i=2*len;i>=26,carry+=w/67108864|0,carry+=lo>>>26,this.words[i]=67108863&lo}return 0!==carry&&(this.words[i]=carry,this.length++),this},BN.prototype.muln=function(num){return this.clone().imuln(num)},BN.prototype.sqr=function(){return this.mul(this)},BN.prototype.isqr=function(){return this.imul(this.clone())},BN.prototype.pow=function(num){var w=toBitArray(num);if(0===w.length)return new BN(1);for(var res=this,i=0;i=0);var i,r=bits%26,s=(bits-r)/26,carryMask=67108863>>>26-r<<26-r;if(0!==r){var carry=0;for(i=0;i>>26-r}carry&&(this.words[i]=carry,this.length++)}if(0!==s){for(i=this.length-1;i>=0;i--)this.words[i+s]=this.words[i];for(i=0;i=0);var h;h=hint?(hint-hint%26)/26:0;var r=bits%26,s=Math.min((bits-r)/26,this.length),mask=67108863^67108863>>>r<s)for(this.length-=s,i=0;i=0&&(0!==carry||i>=h);i--){var word=0|this.words[i];this.words[i]=carry<<26-r|word>>>r,carry=word&mask}return maskedWords&&0!==carry&&(maskedWords.words[maskedWords.length++]=carry),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},BN.prototype.ishrn=function(bits,hint,extended){return assert(0===this.negative),this.iushrn(bits,hint,extended)},BN.prototype.shln=function(bits){return this.clone().ishln(bits)},BN.prototype.ushln=function(bits){return this.clone().iushln(bits)},BN.prototype.shrn=function(bits){return this.clone().ishrn(bits)},BN.prototype.ushrn=function(bits){return this.clone().iushrn(bits)},BN.prototype.testn=function(bit){assert("number"==typeof bit&&bit>=0);var r=bit%26,s=(bit-r)/26,q=1<=0);var r=bits%26,s=(bits-r)/26;if(assert(0===this.negative,"imaskn works only with positive numbers"),this.length<=s)return this;if(0!==r&&s++,this.length=Math.min(s,this.length),0!==r){var mask=67108863^67108863>>>r<=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},BN.prototype.isubn=function(num){if(assert("number"==typeof num),assert(num<67108864),num<0)return this.iaddn(-num);if(0!==this.negative)return this.negative=0,this.iaddn(num),this.negative=1,this;if(this.words[0]-=num,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var i=0;i>26)-(right/67108864|0),this.words[i+shift]=67108863&w}for(;i>26,this.words[i+shift]=67108863&w;if(0===carry)return this.strip();for(assert(carry===-1),carry=0,i=0;i>26,this.words[i]=67108863&w;return this.negative=1,this.strip()},BN.prototype._wordDiv=function(num,mode){var shift=this.length-num.length,a=this.clone(),b=num,bhi=0|b.words[b.length-1];0!==(shift=26-this._countBits(bhi))&&(b=b.ushln(shift),a.iushln(shift),bhi=0|b.words[b.length-1]);var q,m=a.length-b.length;if("mod"!==mode){q=new BN(null),q.length=m+1,q.words=new Array(q.length);for(var i=0;i=0;j--){var qj=67108864*(0|a.words[b.length+j])+(0|a.words[b.length+j-1]);for(qj=Math.min(qj/bhi|0,67108863),a._ishlnsubmul(b,qj,j);0!==a.negative;)qj--,a.negative=0,a._ishlnsubmul(b,1,j),a.isZero()||(a.negative^=1);q&&(q.words[j]=qj)}return q&&q.strip(),a.strip(),"div"!==mode&&0!==shift&&a.iushrn(shift),{div:q||null,mod:a}},BN.prototype.divmod=function(num,mode,positive){if(assert(!num.isZero()),this.isZero())return{div:new BN(0),mod:new BN(0)};var div,mod,res;return 0!==this.negative&&0===num.negative?(res=this.neg().divmod(num,mode),"mod"!==mode&&(div=res.div.neg()),"div"!==mode&&(mod=res.mod.neg(),positive&&0!==mod.negative&&mod.iadd(num)),{div:div,mod:mod}):0===this.negative&&0!==num.negative?(res=this.divmod(num.neg(),mode),"mod"!==mode&&(div=res.div.neg()),{div:div,mod:res.mod}):0!=(this.negative&num.negative)?(res=this.neg().divmod(num.neg(),mode),"div"!==mode&&(mod=res.mod.neg(),positive&&0!==mod.negative&&mod.isub(num)),{div:res.div,mod:mod}):num.length>this.length||this.cmp(num)<0?{div:new BN(0),mod:this}:1===num.length?"div"===mode?{div:this.divn(num.words[0]),mod:null}:"mod"===mode?{div:null,mod:new BN(this.modn(num.words[0]))}:{div:this.divn(num.words[0]),mod:new BN(this.modn(num.words[0]))}:this._wordDiv(num,mode)},BN.prototype.div=function(num){return this.divmod(num,"div",!1).div},BN.prototype.mod=function(num){return this.divmod(num,"mod",!1).mod},BN.prototype.umod=function(num){return this.divmod(num,"mod",!0).mod},BN.prototype.divRound=function(num){var dm=this.divmod(num);if(dm.mod.isZero())return dm.div;var mod=0!==dm.div.negative?dm.mod.isub(num):dm.mod,half=num.ushrn(1),r2=num.andln(1),cmp=mod.cmp(half);return cmp<0||1===r2&&0===cmp?dm.div:0!==dm.div.negative?dm.div.isubn(1):dm.div.iaddn(1)},BN.prototype.modn=function(num){assert(num<=67108863);for(var p=(1<<26)%num,acc=0,i=this.length-1;i>=0;i--)acc=(p*acc+(0|this.words[i]))%num;return acc},BN.prototype.idivn=function(num){assert(num<=67108863);for(var carry=0,i=this.length-1;i>=0;i--){var w=(0|this.words[i])+67108864*carry;this.words[i]=w/num|0,carry=w%num}return this.strip()},BN.prototype.divn=function(num){return this.clone().idivn(num)},BN.prototype.egcd=function(p){assert(0===p.negative),assert(!p.isZero());var x=this,y=p.clone();x=0!==x.negative?x.umod(p):x.clone();for(var A=new BN(1),B=new BN(0),C=new BN(0),D=new BN(1),g=0;x.isEven()&&y.isEven();)x.iushrn(1),y.iushrn(1),++g;for(var yp=y.clone(),xp=x.clone();!x.isZero();){for(var i=0,im=1;0==(x.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(x.iushrn(i);i-- >0;)(A.isOdd()||B.isOdd())&&(A.iadd(yp),B.isub(xp)),A.iushrn(1),B.iushrn(1);for(var j=0,jm=1;0==(y.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(y.iushrn(j);j-- >0;)(C.isOdd()||D.isOdd())&&(C.iadd(yp),D.isub(xp)),C.iushrn(1),D.iushrn(1);x.cmp(y)>=0?(x.isub(y),A.isub(C),B.isub(D)):(y.isub(x),C.isub(A),D.isub(B))}return{a:C,b:D,gcd:y.iushln(g)}},BN.prototype._invmp=function(p){assert(0===p.negative),assert(!p.isZero());var a=this,b=p.clone();a=0!==a.negative?a.umod(p):a.clone();for(var x1=new BN(1),x2=new BN(0),delta=b.clone();a.cmpn(1)>0&&b.cmpn(1)>0;){for(var i=0,im=1;0==(a.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(a.iushrn(i);i-- >0;)x1.isOdd()&&x1.iadd(delta),x1.iushrn(1);for(var j=0,jm=1;0==(b.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(b.iushrn(j);j-- >0;)x2.isOdd()&&x2.iadd(delta),x2.iushrn(1);a.cmp(b)>=0?(a.isub(b),x1.isub(x2)):(b.isub(a),x2.isub(x1))}var res;return res=0===a.cmpn(1)?x1:x2,res.cmpn(0)<0&&res.iadd(p),res},BN.prototype.gcd=function(num){if(this.isZero())return num.abs();if(num.isZero())return this.abs();var a=this.clone(),b=num.clone();a.negative=0,b.negative=0;for(var shift=0;a.isEven()&&b.isEven();shift++)a.iushrn(1),b.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;b.isEven();)b.iushrn(1);var r=a.cmp(b);if(r<0){var t=a;a=b,b=t}else if(0===r||0===b.cmpn(1))break;a.isub(b)}return b.iushln(shift)},BN.prototype.invm=function(num){return this.egcd(num).a.umod(num)},BN.prototype.isEven=function(){return 0==(1&this.words[0])},BN.prototype.isOdd=function(){return 1==(1&this.words[0])},BN.prototype.andln=function(num){return this.words[0]&num},BN.prototype.bincn=function(bit){assert("number"==typeof bit);var r=bit%26,s=(bit-r)/26,q=1<>>26,w&=67108863,this.words[i]=w}return 0!==carry&&(this.words[i]=carry,this.length++),this},BN.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},BN.prototype.cmpn=function(num){var negative=num<0;if(0!==this.negative&&!negative)return-1;if(0===this.negative&&negative)return 1;this.strip();var res;if(this.length>1)res=1;else{negative&&(num=-num),assert(num<=67108863,"Number is too big");var w=0|this.words[0];res=w===num?0:wnum.length)return 1;if(this.length=0;i--){var a=0|this.words[i],b=0|num.words[i];if(a!==b){ab&&(res=1);break}}return res},BN.prototype.gtn=function(num){return 1===this.cmpn(num)},BN.prototype.gt=function(num){return 1===this.cmp(num)},BN.prototype.gten=function(num){return this.cmpn(num)>=0},BN.prototype.gte=function(num){return this.cmp(num)>=0},BN.prototype.ltn=function(num){return this.cmpn(num)===-1},BN.prototype.lt=function(num){return this.cmp(num)===-1},BN.prototype.lten=function(num){return this.cmpn(num)<=0},BN.prototype.lte=function(num){return this.cmp(num)<=0},BN.prototype.eqn=function(num){return 0===this.cmpn(num)},BN.prototype.eq=function(num){return 0===this.cmp(num)},BN.red=function(num){return new Red(num)},BN.prototype.toRed=function(ctx){return assert(!this.red,"Already a number in reduction context"),assert(0===this.negative,"red works only with positives"),ctx.convertTo(this)._forceRed(ctx)},BN.prototype.fromRed=function(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function(ctx){return this.red=ctx,this},BN.prototype.forceRed=function(ctx){return assert(!this.red,"Already a number in reduction context"),this._forceRed(ctx)},BN.prototype.redAdd=function(num){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,num)},BN.prototype.redIAdd=function(num){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,num)},BN.prototype.redSub=function(num){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,num)},BN.prototype.redISub=function(num){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,num)},BN.prototype.redShl=function(num){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,num)},BN.prototype.redMul=function(num){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,num),this.red.mul(this,num)},BN.prototype.redIMul=function(num){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,num),this.red.imul(this,num)},BN.prototype.redSqr=function(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function(num){return assert(this.red&&!num.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,num)};var primes={k256:null,p224:null,p192:null,p25519:null};MPrime.prototype._tmp=function(){var tmp=new BN(null);return tmp.words=new Array(Math.ceil(this.n/13)),tmp},MPrime.prototype.ireduce=function(num){var rlen,r=num;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),rlen=r.bitLength()}while(rlen>this.n);var cmp=rlen0?r.isub(this.p):r.strip(),r},MPrime.prototype.split=function(input,out){input.iushrn(this.n,0,out)},MPrime.prototype.imulK=function(num){return num.imul(this.k)},inherits(K256,MPrime),K256.prototype.split=function(input,output){for(var outLen=Math.min(input.length,9),i=0;i>>22,prev=next}prev>>>=22,input.words[i-10]=prev,0===prev&&input.length>10?input.length-=10:input.length-=9},K256.prototype.imulK=function(num){num.words[num.length]=0,num.words[num.length+1]=0,num.length+=2;for(var lo=0,i=0;i>>=26,num.words[i]=lo,carry=hi}return 0!==carry&&(num.words[num.length++]=carry),num},BN._prime=function prime(name){if(primes[name])return primes[name];var prime;if("k256"===name)prime=new K256;else if("p224"===name)prime=new P224;else if("p192"===name)prime=new P192;else{if("p25519"!==name)throw new Error("Unknown prime "+name);prime=new P25519}return primes[name]=prime,prime},Red.prototype._verify1=function(a){assert(0===a.negative,"red works only with positives"),assert(a.red,"red works only with red numbers")},Red.prototype._verify2=function(a,b){assert(0==(a.negative|b.negative),"red works only with positives"),assert(a.red&&a.red===b.red,"red works only with red numbers")},Red.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this)},Red.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},Red.prototype.add=function(a,b){this._verify2(a,b);var res=a.add(b);return res.cmp(this.m)>=0&&res.isub(this.m),res._forceRed(this)},Red.prototype.iadd=function(a,b){this._verify2(a,b);var res=a.iadd(b);return res.cmp(this.m)>=0&&res.isub(this.m),res},Red.prototype.sub=function(a,b){this._verify2(a,b);var res=a.sub(b);return res.cmpn(0)<0&&res.iadd(this.m),res._forceRed(this)},Red.prototype.isub=function(a,b){this._verify2(a,b);var res=a.isub(b);return res.cmpn(0)<0&&res.iadd(this.m),res},Red.prototype.shl=function(a,num){return this._verify1(a),this.imod(a.ushln(num))},Red.prototype.imul=function(a,b){return this._verify2(a,b),this.imod(a.imul(b))},Red.prototype.mul=function(a,b){return this._verify2(a,b),this.imod(a.mul(b))},Red.prototype.isqr=function(a){return this.imul(a,a.clone())},Red.prototype.sqr=function(a){return this.mul(a,a)},Red.prototype.sqrt=function(a){if(a.isZero())return a.clone();var mod3=this.m.andln(3);if(assert(mod3%2==1),3===mod3){var pow=this.m.add(new BN(1)).iushrn(2);return this.pow(a,pow)}for(var q=this.m.subn(1),s=0;!q.isZero()&&0===q.andln(1);)s++,q.iushrn(1);assert(!q.isZero());var one=new BN(1).toRed(this),nOne=one.redNeg(),lpow=this.m.subn(1).iushrn(1),z=this.m.bitLength();for(z=new BN(2*z*z).toRed(this);0!==this.pow(z,lpow).cmp(nOne);)z.redIAdd(nOne);for(var c=this.pow(z,q),r=this.pow(a,q.addn(1).iushrn(1)),t=this.pow(a,q),m=s;0!==t.cmp(one);){for(var tmp=t,i=0;0!==tmp.cmp(one);i++)tmp=tmp.redSqr();assert(i=0;i--){for(var word=num.words[i],j=start-1;j>=0;j--){var bit=word>>j&1;res!==wnd[0]&&(res=this.sqr(res)),0!==bit||0!==current?(current<<=1,current|=bit,(4===++currentLen||0===i&&0===j)&&(res=this.mul(res,wnd[current]),currentLen=0,current=0)):currentLen=0}start=26}return res},Red.prototype.convertTo=function(num){var r=num.umod(this.m);return r===num?r.clone():r},Red.prototype.convertFrom=function(num){var res=num.clone();return res.red=null,res},BN.mont=function(num){return new Mont(num)},inherits(Mont,Red),Mont.prototype.convertTo=function(num){return this.imod(num.ushln(this.shift))},Mont.prototype.convertFrom=function(num){var r=this.imod(num.mul(this.rinv));return r.red=null,r},Mont.prototype.imul=function(a,b){if(a.isZero()||b.isZero())return a.words[0]=0,a.length=1,a;var t=a.imul(b),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=t.isub(c).iushrn(this.shift),res=u;return u.cmp(this.m)>=0?res=u.isub(this.m):u.cmpn(0)<0&&(res=u.iadd(this.m)),res._forceRed(this)},Mont.prototype.mul=function(a,b){if(a.isZero()||b.isZero())return new BN(0)._forceRed(this);var t=a.mul(b),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=t.isub(c).iushrn(this.shift),res=u;return u.cmp(this.m)>=0?res=u.isub(this.m):u.cmpn(0)<0&&(res=u.iadd(this.m)),res._forceRed(this)},Mont.prototype.invm=function(a){return this.imod(a._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===module||module,this)}).call(exports,__webpack_require__(23)(module))},function(module,exports,__webpack_require__){"use strict";var transport=exports;transport.utils=__webpack_require__(802),transport.protocol={},transport.protocol.base=__webpack_require__(163),transport.protocol.spdy=__webpack_require__(321),transport.protocol.http2=__webpack_require__(119),transport.Window=__webpack_require__(803),transport.Priority=__webpack_require__(787),transport.Stream=__webpack_require__(801).Stream,transport.Connection=__webpack_require__(786).Connection,transport.connection=transport.Connection},function(module,exports,__webpack_require__){function Timeout(id,clearFn){this._id=id,this._clearFn=clearFn}var apply=Function.prototype.apply;exports.setTimeout=function(){return new Timeout(apply.call(setTimeout,window,arguments),clearTimeout)},exports.setInterval=function(){return new Timeout(apply.call(setInterval,window,arguments),clearInterval)},exports.clearTimeout=exports.clearInterval=function(timeout){timeout&&timeout.close()},Timeout.prototype.unref=Timeout.prototype.ref=function(){},Timeout.prototype.close=function(){this._clearFn.call(window,this._id)},exports.enroll=function(item,msecs){clearTimeout(item._idleTimeoutId),item._idleTimeout=msecs},exports.unenroll=function(item){clearTimeout(item._idleTimeoutId),item._idleTimeout=-1},exports._unrefActive=exports.active=function(item){clearTimeout(item._idleTimeoutId);var msecs=item._idleTimeout;msecs>=0&&(item._idleTimeoutId=setTimeout(function(){item._onTimeout&&item._onTimeout()},msecs))},__webpack_require__(775),exports.setImmediate=setImmediate,exports.clearImmediate=clearImmediate},function(module,exports){module.exports=function(module){return module.webpackPolyfill||(module.deprecate=function(){},module.paths=[],module.children||(module.children=[]),Object.defineProperty(module,"loaded",{enumerable:!0,get:function(){return module.l}}),Object.defineProperty(module,"id",{enumerable:!0,get:function(){return module.i}}),module.webpackPolyfill=1),module}},function(module,exports,__webpack_require__){var basex=__webpack_require__(381);module.exports=basex("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},function(module,exports,__webpack_require__){"use strict";const createCallback=(method,context)=>{return function(){const args=Array.prototype.slice.call(arguments),lastIndex=args.length-1,lastArg=args&&args.length>0?args[lastIndex]:null;return("function"==typeof lastArg?lastArg:null)?method.apply(context,args):new Promise((resolve,reject)=>{args.push((err,val)=>{if(err)return reject(err);resolve(val)}),method.apply(context,args)})}};module.exports=((methods,options)=>{options=options||{};const type=Object.prototype.toString.call(methods);if("[object Object]"===type||"[object Array]"===type){const obj=options.replace?methods:{};for(let key in methods)methods.hasOwnProperty(key)&&(obj[key]=createCallback(methods[key]));return obj}return createCallback(methods,options.context||methods)})},function(module,exports,__webpack_require__){function Stream(){EE.call(this)}module.exports=Stream;var EE=__webpack_require__(8).EventEmitter;__webpack_require__(1)(Stream,EE),Stream.Readable=__webpack_require__(166),Stream.Writable=__webpack_require__(812),Stream.Duplex=__webpack_require__(807),Stream.Transform=__webpack_require__(811),Stream.PassThrough=__webpack_require__(810),Stream.Stream=Stream,Stream.prototype.pipe=function(dest,options){function ondata(chunk){dest.writable&&!1===dest.write(chunk)&&source.pause&&source.pause()}function ondrain(){source.readable&&source.resume&&source.resume()}function onend(){didOnEnd||(didOnEnd=!0,dest.end())}function onclose(){didOnEnd||(didOnEnd=!0,"function"==typeof dest.destroy&&dest.destroy())}function onerror(er){if(cleanup(),0===EE.listenerCount(this,"error"))throw er}function cleanup(){source.removeListener("data",ondata),dest.removeListener("drain",ondrain),source.removeListener("end",onend), +source.removeListener("close",onclose),source.removeListener("error",onerror),dest.removeListener("error",onerror),source.removeListener("end",cleanup),source.removeListener("close",cleanup),dest.removeListener("close",cleanup)}var source=this;source.on("data",ondata),dest.on("drain",ondrain),dest._isStdio||options&&options.end===!1||(source.on("end",onend),source.on("close",onclose));var didOnEnd=!1;return source.on("error",onerror),dest.on("error",onerror),source.on("end",cleanup),source.on("close",cleanup),dest.on("close",cleanup),dest.emit("pipe",source),dest}},function(module,exports,__webpack_require__){"use strict";var elliptic=exports;elliptic.version=__webpack_require__(545).version,elliptic.utils=__webpack_require__(414),elliptic.rand=__webpack_require__(372),elliptic.curve=__webpack_require__(98),elliptic.curves=__webpack_require__(406),elliptic.ec=__webpack_require__(407),elliptic.eddsa=__webpack_require__(410)},function(module,exports,__webpack_require__){"use strict";const encode=__webpack_require__(726),d=__webpack_require__(725);exports.encode=encode,exports.decode=d.decode,exports.decodeFromReader=d.decodeFromReader},function(module,exports,__webpack_require__){"use strict";exports.Connection=__webpack_require__(455)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function Multihashing(buf,func,length,callback){if("function"==typeof length&&(callback=length,length=void 0),!callback)throw new Error("Missing callback");Multihashing.digest(buf,func,length,(err,digest)=>{if(err)return callback(err);callback(null,multihash.encode(digest,func,length))})}const multihash=__webpack_require__(17),crypto=__webpack_require__(687);module.exports=Multihashing,Multihashing.Buffer=Buffer,Multihashing.multihash=multihash,Multihashing.digest=function(buf,func,length,callback){if("function"==typeof length&&(callback=length,length=void 0),!callback)throw new Error("Missing callback");let cb=callback;length&&(cb=((err,digest)=>{if(err)return callback(err);callback(null,digest.slice(0,length))}));let hash;try{hash=Multihashing.createHash(func)}catch(err){return cb(err)}hash(buf,cb)},Multihashing.createHash=function(func){if(func=multihash.coerceCode(func),!Multihashing.functions[func])throw new Error("multihash function "+func+" not yet supported");return Multihashing.functions[func]},Multihashing.functions={17:crypto.sha1,18:crypto.sha2256,19:crypto.sha2512,20:crypto.sha3512,21:crypto.sha3384,22:crypto.sha3256,23:crypto.sha3224,24:crypto.shake128,25:crypto.shake256,26:crypto.keccak224,27:crypto.keccak256,28:crypto.keccak384,29:crypto.keccak512,34:crypto.murmur3128,35:crypto.murmur332},crypto.addBlake(Multihashing.functions)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function toB64Opt(val){if(val)return val.toString("base64")}const mh=__webpack_require__(17),crypto=__webpack_require__(50),assert=__webpack_require__(7),waterfall=__webpack_require__(9);class PeerId{constructor(id,privKey,pubKey){assert(Buffer.isBuffer(id),"invalid id provided"),privKey&&pubKey&&assert(privKey.public.bytes.equals(pubKey.bytes),"inconsistent arguments"),this._id=id,this._idB58String=mh.toB58String(this.id),this._privKey=privKey,this._pubKey=pubKey}get id(){return this._id}set id(val){throw new Error("Id is immutable")}get privKey(){return this._privKey}set privKey(privKey){this._privKey=privKey}get pubKey(){return this._pubKey?this._pubKey:this._privKey?this._privKey.public:void 0}set pubKey(pubKey){this._pubKey=pubKey}marshalPubKey(){if(this.pubKey)return crypto.marshalPublicKey(this.pubKey)}marshalPrivKey(){if(this.privKey)return crypto.marshalPrivateKey(this.privKey)}toPrint(){return this.toJSON()}toJSON(){return{id:this.toB58String(),privKey:toB64Opt(this.marshalPrivKey()),pubKey:toB64Opt(this.marshalPubKey())}}toHexString(){return mh.toHexString(this.id)}toBytes(){return this.id}toB58String(){return this._idB58String}isEqual(id){if(Buffer.isBuffer(id))return this.id.equals(id);if(id.id)return this.id.equals(id.id);throw new Error("not valid Id")}isValid(callback){this.privKey&&this.privKey.public&&this.privKey.public.bytes&&Buffer.isBuffer(this.pubKey.bytes)&&this.privKey.public.bytes.equals(this.pubKey.bytes)?callback():callback(new Error("Keys not match"))}}exports=module.exports=PeerId,exports.create=function(opts,callback){"function"==typeof opts&&(callback=opts,opts={}),opts=opts||{},opts.bits=opts.bits||2048,waterfall([cb=>crypto.generateKeyPair("RSA",opts.bits,cb),(privKey,cb)=>privKey.public.hash((err,digest)=>{cb(err,digest,privKey)})],(err,digest,privKey)=>{if(err)return callback(err);callback(null,new PeerId(digest,privKey))})},exports.createFromHexString=function(str){return new PeerId(mh.fromHexString(str))},exports.createFromBytes=function(buf){return new PeerId(buf)},exports.createFromB58String=function(str){return new PeerId(mh.fromB58String(str))},exports.createFromPubKey=function(key,callback){if("function"!=typeof callback)throw new Error("callback is required");let buf=key;"string"==typeof buf&&(buf=new Buffer(key,"base64"));const pubKey=crypto.unmarshalPublicKey(buf);pubKey.hash((err,digest)=>{if(err)return callback(err);callback(null,new PeerId(digest,null,pubKey))})},exports.createFromPrivKey=function(key,callback){let buf=key;if("string"==typeof buf&&(buf=new Buffer(key,"base64")),"function"!=typeof callback)throw new Error("callback is required");waterfall([cb=>crypto.unmarshalPrivateKey(buf,cb),(privKey,cb)=>privKey.public.hash((err,digest)=>{cb(err,digest,privKey)})],(err,digest,privKey)=>{if(err)return callback(err);callback(null,new PeerId(digest,privKey))})},exports.createFromJSON=function(obj,callback){if("function"!=typeof callback)throw new Error("callback is required");const id=mh.fromB58String(obj.id),rawPrivKey=obj.privKey&&new Buffer(obj.privKey,"base64"),rawPubKey=obj.pubKey&&new Buffer(obj.pubKey,"base64"),pub=rawPubKey&&crypto.unmarshalPublicKey(rawPubKey);rawPrivKey?waterfall([cb=>crypto.unmarshalPrivateKey(rawPrivKey,cb),(priv,cb)=>priv.public.hash((err,digest)=>{cb(err,digest,priv)}),(privDigest,priv,cb)=>{pub?pub.hash((err,pubDigest)=>{cb(err,privDigest,priv,pubDigest)}):cb(null,privDigest,priv)}],(err,privDigest,priv,pubDigest)=>{return err?callback(err):pub&&!privDigest.equals(pubDigest)?callback(new Error("Public and private key do not match")):id&&!privDigest.equals(id)?callback(new Error("Id and private key do not match")):void callback(null,new PeerId(id,priv,pub))}):callback(null,new PeerId(id,null,pub))},exports.isPeerId=function(peerId){return Boolean("object"==typeof peerId&&peerId._id&&peerId._idB58String)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function eachLimit(coll,iteratee,callback){(0,_eachOf2.default)(coll,(0,_withoutIndex2.default)((0,_wrapAsync2.default)(iteratee)),callback)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=eachLimit;var _eachOf=__webpack_require__(122),_eachOf2=_interopRequireDefault(_eachOf),_withoutIndex=__webpack_require__(180),_withoutIndex2=_interopRequireDefault(_withoutIndex),_wrapAsync=__webpack_require__(19),_wrapAsync2=_interopRequireDefault(_wrapAsync);module.exports=exports.default},function(module,exports){function noop(){}module.exports=noop},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function Multiaddr(addr){if(!(this instanceof Multiaddr))return new Multiaddr(addr);if((addr=addr||"")instanceof Buffer)this.buffer=codec.fromBuffer(addr);else if("string"==typeof addr||addr instanceof String)this.buffer=codec.fromString(addr);else{if(!(addr.buffer&&addr.protos&&addr.protoCodes))throw new Error("addr must be a string, Buffer, or another Multiaddr");this.buffer=codec.fromBuffer(addr.buffer)}}const map=__webpack_require__(148),extend=__webpack_require__(37),codec=__webpack_require__(679),protocols=__webpack_require__(151),varint=__webpack_require__(16),bs58=__webpack_require__(24),NotImplemented=new Error("Sorry, Not Implemented Yet.");exports=module.exports=Multiaddr,Multiaddr.prototype.toString=function(){return codec.bufferToString(this.buffer)},Multiaddr.prototype.toOptions=function(){const opts={},parsed=this.toString().split("/");return opts.family="ip4"===parsed[1]?"ipv4":"ipv6",opts.host=parsed[2],opts.transport=parsed[3],opts.port=parsed[4],opts},Multiaddr.prototype.inspect=function(){return""},Multiaddr.prototype.protos=function(){return map(this.protoCodes(),function(code){return extend(protocols(code))})},Multiaddr.prototype.protoCodes=function(){const codes=[],buf=this.buffer;let i=0;for(;i{if(tuple[0]===protocols.names.ipfs.code)return!0})[0][1],bs58.decode(b58str)}catch(e){b58str=null}return b58str},Multiaddr.prototype.equals=function(addr){return this.buffer.equals(addr.buffer)},Multiaddr.prototype.nodeAddress=function(){if(!this.isThinWaistAddress())throw new Error('Multiaddr must be "thin waist" address for nodeAddress.');const codes=this.protoCodes(),parts=this.toString().split("/").slice(1);return{family:41===codes[0]?"IPv6":"IPv4",address:parts[1],port:parts[3]}},Multiaddr.fromNodeAddress=function(addr,transport){if(!addr)throw new Error("requires node address object");if(!transport)throw new Error("requires transport protocol");return Multiaddr("/"+["IPv6"===addr.family?"ip6":"ip4",addr.address,transport,addr.port].join("/"))},Multiaddr.prototype.isThinWaistAddress=function(addr){const protos=(addr||this).protos();return 2===protos.length&&((4===protos[0].code||41===protos[0].code)&&(6===protos[1].code||17===protos[1].code))},Multiaddr.prototype.fromStupidString=function(str){throw NotImplemented},Multiaddr.protocols=protocols,Multiaddr.isMultiaddr=function(addr){return addr.constructor&&addr.constructor.name?"Multiaddr"===addr.constructor.name:Boolean(addr.fromStupidString&&addr.protos)},Multiaddr.isName=function(addr){return!!Multiaddr.isMultiaddr(addr)&&addr.protos().some(proto=>proto.resolvable)},Multiaddr.resolve=function(addr,callback){return callback(Multiaddr.isMultiaddr(addr)&&Multiaddr.isName(addr)?new Error("not implemented yet"):new Error("not a valid name"))}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){exports=module.exports,exports.raw=new Buffer("00","hex"),exports.base1=new Buffer("01","hex"),exports.base2=new Buffer("55","hex"),exports.base8=new Buffer("07","hex"),exports.base10=new Buffer("09","hex"),exports.protobuf=new Buffer("50","hex"),exports.cbor=new Buffer("51","hex"),exports.rlp=new Buffer("60","hex"),exports.bencode=new Buffer("63","hex"),exports.multicodec=new Buffer("30","hex"),exports.multihash=new Buffer("31","hex"),exports.multiaddr=new Buffer("32","hex"),exports.multibase=new Buffer("33","hex"),exports.sha1=new Buffer("11","hex"),exports["sha2-256"]=new Buffer("12","hex"),exports["sha2-512"]=new Buffer("13","hex"),exports["sha3-224"]=new Buffer("17","hex"),exports["sha3-256"]=new Buffer("16","hex"),exports["sha3-384"]=new Buffer("15","hex"),exports["sha3-512"]=new Buffer("14","hex"),exports["shake-128"]=new Buffer("18","hex"),exports["shake-256"]=new Buffer("19","hex"),exports["keccak-224"]=new Buffer("1a","hex"),exports["keccak-256"]=new Buffer("1b","hex"),exports["keccak-384"]=new Buffer("1c","hex"),exports["keccak-512"]=new Buffer("1d","hex"),exports.blake2b=new Buffer("40","hex"),exports.blake2s=new Buffer("41","hex"),exports.ip4=new Buffer("04","hex"),exports.ip6=new Buffer("29","hex"),exports.tcp=new Buffer("06","hex"),exports.udp=new Buffer("0111","hex"),exports.dccp=new Buffer("21","hex"),exports.sctp=new Buffer("84","hex"),exports.udt=new Buffer("012d","hex"),exports.utp=new Buffer("012e","hex"),exports.ipfs=new Buffer("2a","hex"),exports.http=new Buffer("01e0","hex"),exports.https=new Buffer("01bb","hex"),exports.ws=new Buffer("01dd","hex"),exports.onion=new Buffer("01bc","hex"),exports["dag-pb"]=new Buffer("70","hex"),exports["dag-cbor"]=new Buffer("71","hex"),exports["eth-block"]=new Buffer("90","hex"),exports["eth-block-list"]=new Buffer("91","hex"),exports["eth-tx-trie"]=new Buffer("92","hex"),exports["eth-tx"]=new Buffer("93","hex"),exports["eth-tx-receipt-trie"]=new Buffer("94","hex"),exports["eth-tx-receipt"]=new Buffer("95","hex"),exports["eth-state-trie"]=new Buffer("96","hex"),exports["eth-account-snapshot"]=new Buffer("97","hex"),exports["eth-storage-trie"]=new Buffer("98","hex"),exports["bitcoin-block"]=new Buffer("b0","hex"),exports["bitcoin-tx"]=new Buffer("b1","hex"),exports["stellar-block"]=new Buffer("d0","hex"),exports["stellar-tx"]=new Buffer("d1","hex"),exports["torrent-info"]=new Buffer("7b","hex"),exports["torrent-file"]=new Buffer("7c","hex")}).call(exports,__webpack_require__(0).Buffer)},function(module,exports){function pullPushable(separated,onClose){function read(_abort,_cb){_abort&&(abort=_abort,cb&&callback(abort)),cb=_cb,drain()}function end(end){ended=ended||end||!0,drain()}function push(data){if(!ended){if(cb)return void callback(abort,data);buffer.push(data),drain()}}function drain(){cb&&(abort?callback(abort):!buffer.length&&ended?callback(ended):buffer.length&&callback(null,buffer.shift()))}function callback(err,val){var _cb=cb;if(err&&onClose){var c=onClose;onClose=null,c(err===!0?null:err)}cb=null,_cb(err,val)}"function"==typeof separated&&(onClose=separated,separated=!1);var abort,cb,ended,buffer=[];return separated?{push:push,end:end,source:read}:(read.push=push,read.end=end,read)}module.exports=pullPushable},function(module,exports){function extend(){for(var target={},i=0;i{this.blockSizes.push(size)}),this.removeBlockSize=(index=>{this.blockSizes.splice(index,1)}),this.fileSize=(()=>{let sum=0;return this.blockSizes.forEach(size=>{sum+=size}),data&&(sum+=data.length),sum}),this.marshal=(()=>{let type;switch(this.type){case"raw":type=unixfsData.DataType.Raw;break;case"directory":type=unixfsData.DataType.Directory;break;case"file":type=unixfsData.DataType.File;break;case"metadata":type=unixfsData.DataType.Metadata;break;case"symlink":type=unixfsData.DataType.Symlink;break;case"hamt-sharded-directory":type=unixfsData.DataType.HAMTShard;break;default:throw new Error(`Unkown type: "${this.type}"`)}let fileSize=this.fileSize();return 0===fileSize&&(fileSize=void 0),unixfsData.encode({Type:type,Data:this.data,filesize:fileSize,blocksizes:this.blockSizes.length>0?this.blockSizes:void 0,hashType:this.hashType,fanout:this.fanout})})}const protobuf=__webpack_require__(39),pb=protobuf(__webpack_require__(498)),unixfsData=pb.Data,types=["raw","directory","file","metadata","symlink","hamt-sharded-directory"];Data.unmarshal=(marsheled=>{const decoded=unixfsData.decode(marsheled);decoded.Data||(decoded.Data=void 0);const obj=new Data(types[decoded.Type],decoded.Data);return obj.blockSizes=decoded.blocksizes,obj}),module.exports=Data},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function multibase(nameOrCode,buf){if(!buf)throw new Error("requires an encoded buffer");const base=getBase(nameOrCode),codeBuf=new Buffer(base.code);return validEncode(base.name,buf),Buffer.concat([codeBuf,buf])}function encode(nameOrCode,buf){const base=getBase(nameOrCode);return multibase(base.name,new Buffer(base.encode(buf)))}function decode(bufOrString){Buffer.isBuffer(bufOrString)&&(bufOrString=bufOrString.toString());const code=bufOrString.substring(0,1);"string"==typeof(bufOrString=bufOrString.substring(1,bufOrString.length))&&(bufOrString=new Buffer(bufOrString));const base=getBase(code);return{base:base.name,data:new Buffer(base.decode(bufOrString.toString()))}.data}function isEncoded(bufOrString){Buffer.isBuffer(bufOrString)&&(bufOrString=bufOrString.toString());const code=bufOrString.substring(0,1);try{const base=getBase(code);return base.name}catch(err){return!1}}function validEncode(name,buf){getBase(name).decode(buf.toString())}function getBase(nameOrCode){let base;if(constants.names[nameOrCode])base=constants.names[nameOrCode];else{if(!constants.codes[nameOrCode])throw errNotSupported;base=constants.codes[nameOrCode]}if(!base.isImplemented())throw new Error("Base "+nameOrCode+" is not implemented yet");return base}const constants=__webpack_require__(683);exports=module.exports=multibase,exports.encode=encode,exports.decode=decode,exports.isEncoded=isEncoded;const errNotSupported=new Error("Unsupported encoding")}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const varint=__webpack_require__(16),codecNameToCodeVarint=__webpack_require__(38),codeToCodecName=__webpack_require__(278),util=__webpack_require__(279);exports=module.exports,exports.addPrefix=((multicodecStrOrCode,data)=>{let prefix;if(Buffer.isBuffer(multicodecStrOrCode))prefix=util.varintBufferEncode(multicodecStrOrCode);else{if(!codecNameToCodeVarint[multicodecStrOrCode])throw new Error("multicodec not recognized");prefix=codecNameToCodeVarint[multicodecStrOrCode]}return Buffer.concat([prefix,data])}),exports.rmPrefix=(data=>{return varint.decode(data),data.slice(varint.decode.bytes)}),exports.getCodec=(prefixedData=>{return codeToCodecName[util.varintBufferDecode(prefixedData).toString("hex")]})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(process){function normalizeArray(parts,allowAboveRoot){for(var up=0,i=parts.length-1;i>=0;i--){var last=parts[i];"."===last?parts.splice(i,1):".."===last?(parts.splice(i,1),up++):up&&(parts.splice(i,1),up--)}if(allowAboveRoot)for(;up--;up)parts.unshift("..");return parts}function filter(xs,f){if(xs.filter)return xs.filter(f);for(var res=[],i=0;i=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if("string"!=typeof path)throw new TypeError("Arguments to path.resolve must be strings");path&&(resolvedPath=path+"/"+resolvedPath,resolvedAbsolute="/"===path.charAt(0))}return resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/"),(resolvedAbsolute?"/":"")+resolvedPath||"."},exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash="/"===substr(path,-1);return path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/"),path||isAbsolute||(path="."),path&&trailingSlash&&(path+="/"),(isAbsolute?"/":"")+path},exports.isAbsolute=function(path){return"/"===path.charAt(0)},exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if("string"!=typeof p)throw new TypeError("Arguments to path.join must be strings");return p}).join("/"))},exports.relative=function(from,to){function trim(arr){for(var start=0;start=0&&""===arr[end];end--);return start>end?[]:arr.slice(start,end-start+1)}from=exports.resolve(from).substr(1),to=exports.resolve(to).substr(1);for(var fromParts=trim(from.split("/")),toParts=trim(to.split("/")),length=Math.min(fromParts.length,toParts.length),samePartsLength=length,i=0;i{let key=keys[type.toLowerCase()];if(!key)return cb(new Error("invalid or unsupported key type"));key.generateKeyPair(bits,cb)}),exports.generateKeyPairFromSeed=((type,seed,bits,cb)=>{let key=keys[type.toLowerCase()];return key?"ed25519"!==type.toLowerCase()?cb(new Error("Seed key derivation is unimplemented for RSA or secp256k1")):void key.generateKeyPairFromSeed(seed,bits,cb):cb(new Error("invalid or unsupported key type"))}),exports.unmarshalPublicKey=(buf=>{const decoded=pbm.PublicKey.decode(buf);switch(decoded.Type){case pbm.KeyType.RSA:return keys.rsa.unmarshalRsaPublicKey(decoded.Data);case pbm.KeyType.Ed25519:return keys.ed25519.unmarshalEd25519PublicKey(decoded.Data);case pbm.KeyType.Secp256k1:if(keys.secp256k1)return keys.secp256k1.unmarshalSecp256k1PublicKey(decoded.Data);throw new Error("secp256k1 support requires libp2p-crypto-secp256k1 package");default:throw new Error("invalid or unsupported key type")}}),exports.marshalPublicKey=((key,type)=>{if(type=(type||"rsa").toLowerCase(),!isValidKeyType(type))throw new Error("invalid or unsupported key type");return key.bytes}),exports.unmarshalPrivateKey=((buf,callback)=>{const decoded=pbm.PrivateKey.decode(buf);switch(decoded.Type){case pbm.KeyType.RSA:return keys.rsa.unmarshalRsaPrivateKey(decoded.Data,callback);case pbm.KeyType.Ed25519:return keys.ed25519.unmarshalEd25519PrivateKey(decoded.Data,callback);case pbm.KeyType.Secp256k1:return keys.secp256k1?keys.secp256k1.unmarshalSecp256k1PrivateKey(decoded.Data,callback):callback(new Error("secp256k1 support requires libp2p-crypto-secp256k1 package"));default:callback(new Error("invalid or unsupported key type"))}}),exports.marshalPrivateKey=((key,type)=>{if(type=(type||"rsa").toLowerCase(),!isValidKeyType(type))throw new Error("invalid or unsupported key type");return key.bytes}),exports.randomBytes=(number=>{if(!number||"number"!=typeof number)throw new Error("first argument must be a Number bigger than 0");return c.rsa.getRandomValues(new Uint8Array(number))})},function(module,exports,__webpack_require__){"use strict";const Id=__webpack_require__(31),ensureMultiaddr=__webpack_require__(293).ensureMultiaddr,MultiaddrSet=__webpack_require__(713),assert=__webpack_require__(7);class PeerInfo{constructor(peerId){assert(peerId,"Missing peerId. Use Peer.create(cb) to create one"),this.id=peerId,this.multiaddrs=new MultiaddrSet,this.protocols=new Set,this._connectedMultiaddr=void 0}connect(ma){if(ma=ensureMultiaddr(ma),!this.multiaddrs.has(ma)&&ma.toString()!==`/ipfs/${this.id.toB58String()}`)throw new Error("can't be connected to missing multiaddr from set");this._connectedMultiaddr=ma}disconnect(){this._connectedMultiaddr=void 0}isConnected(){return this._connectedMultiaddr}}PeerInfo.create=((id,callback)=>{if("function"==typeof id)return callback=id,id=null,void Id.create((err,id)=>{if(err)return callback(err);callback(null,new PeerInfo(id))});callback(null,new PeerInfo(id))}),PeerInfo.isPeerInfo=(peerInfo=>{return Boolean("object"==typeof peerInfo&&peerInfo.id&&peerInfo.multiaddrs)}),module.exports=PeerInfo},function(module,exports,__webpack_require__){(function(Buffer){function safeParseInt(v,base){if("00"===v.slice(0,2))throw new Error("invalid RLP: extra zeros");return parseInt(v,base)}function encodeLength(len,offset){if(len<56)return new Buffer([len+offset]);var hexLength=intToHex(len);return new Buffer(intToHex(offset+55+hexLength.length/2)+hexLength,"hex")}function _decode(input){var length,llength,data,innerRemainder,d,decoded=[],firstByte=input[0];if(firstByte<=127)return{data:input.slice(0,1),remainder:input.slice(1)};if(firstByte<=183){if(length=firstByte-127,data=128===firstByte?new Buffer([]):input.slice(1,length),2===length&&data[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:data,remainder:input.slice(length)}}if(firstByte<=191){if(llength=firstByte-182,length=safeParseInt(input.slice(1,llength).toString("hex"),16),data=input.slice(llength,length+llength),data.lengthinput.length)throw new Error("invalid rlp: total length is larger than the data");if(innerRemainder=input.slice(llength,totalLength),0===innerRemainder.length)throw new Error("invalid rlp, List has a invalid length");for(;innerRemainder.length;)d=_decode(innerRemainder),decoded.push(d.data),innerRemainder=d.remainder;return{data:decoded, +remainder:input.slice(totalLength)}}function isHexPrefixed(str){return"0x"===str.slice(0,2)}function stripHexPrefix(str){return"string"!=typeof str?str:isHexPrefixed(str)?str.slice(2):str}function intToHex(i){var hex=i.toString(16);return hex.length%2&&(hex="0"+hex),hex}function padToEven(a){return a.length%2&&(a="0"+a),a}function intToBuffer(i){return new Buffer(intToHex(i),"hex")}function toBuffer(v){if(!Buffer.isBuffer(v))if("string"==typeof v)v=isHexPrefixed(v)?new Buffer(padToEven(stripHexPrefix(v)),"hex"):new Buffer(v);else if("number"==typeof v)v=v?intToBuffer(v):new Buffer([]);else if(null===v||void 0===v)v=new Buffer([]);else{if(!v.toArray)throw new Error("invalid type");v=new Buffer(v.toArray())}return v}const assert=__webpack_require__(7);exports.encode=function(input){if(input instanceof Array){for(var output=[],i=0;i`}toJSON(){return{name:this.name,size:this.size,multihash:mh.toB58String(this._multihash)}}get name(){return this._name}set name(name){throw new Error("Can't set property: 'name' is immutable")}get size(){return this._size}set size(size){throw new Error("Can't set property: 'size' is immutable")}get multihash(){return this._multihash}set multihash(multihash){throw new Error("Can't set property: 'multihash' is immutable")}}exports=module.exports=DAGLink,exports.create=__webpack_require__(501)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.DAGNode=__webpack_require__(135),exports.DAGLink=__webpack_require__(61),exports.resolver=__webpack_require__(506),exports.util=__webpack_require__(136)},function(module,exports,__webpack_require__){function Emitter(obj){if(obj)return mixin(obj)}function mixin(obj){for(var key in Emitter.prototype)obj[key]=Emitter.prototype[key];return obj}module.exports=Emitter,Emitter.prototype.on=Emitter.prototype.addEventListener=function(event,fn){return this._callbacks=this._callbacks||{},(this._callbacks["$"+event]=this._callbacks["$"+event]||[]).push(fn),this},Emitter.prototype.once=function(event,fn){function on(){this.off(event,on),fn.apply(this,arguments)}return on.fn=fn,this.on(event,on),this},Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(event,fn){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var callbacks=this._callbacks["$"+event];if(!callbacks)return this;if(1==arguments.length)return delete this._callbacks["$"+event],this;for(var cb,i=0;i1?{type:packetslist[type],data:data.substring(1)}:{type:packetslist[type]}:err}var asArray=new Uint8Array(data),type=asArray[0],rest=sliceBuffer(data,1);return Blob&&"blob"===binaryType&&(rest=new Blob([rest])),{type:packetslist[type],data:rest}},exports.decodeBase64Packet=function(msg,binaryType){var type=packetslist[msg.charAt(0)];if(!base64encoder)return{type:type,data:{base64:!0,data:msg.substr(1)}};var data=base64encoder.decode(msg.substr(1));return"blob"===binaryType&&Blob&&(data=new Blob([data])),{type:type,data:data}},exports.encodePayload=function(packets,supportsBinary,callback){function setLengthHeader(message){return message.length+":"+message}function encodeOne(packet,doneCallback){exports.encodePacket(packet,!!isBinary&&supportsBinary,!1,function(message){doneCallback(null,setLengthHeader(message))})}"function"==typeof supportsBinary&&(callback=supportsBinary,supportsBinary=null);var isBinary=hasBinary(packets);return supportsBinary&&isBinary?Blob&&!dontSendBlobs?exports.encodePayloadAsBlob(packets,callback):exports.encodePayloadAsArrayBuffer(packets,callback):packets.length?void map(packets,encodeOne,function(err,results){return callback(results.join(""))}):callback("0:")},exports.decodePayload=function(data,binaryType,callback){if("string"!=typeof data)return exports.decodePayloadAsBinary(data,binaryType,callback);"function"==typeof binaryType&&(callback=binaryType,binaryType=null);var packet;if(""===data)return callback(err,0,1);for(var n,msg,length="",i=0,l=data.length;i0;){for(var tailArray=new Uint8Array(bufferTail),isString=0===tailArray[0],msgLength="",i=1;255!==tailArray[i];i++){if(msgLength.length>310)return callback(err,0,1);msgLength+=tailArray[i]}bufferTail=sliceBuffer(bufferTail,2+msgLength.length),msgLength=parseInt(msgLength);var msg=sliceBuffer(bufferTail,0,msgLength);if(isString)try{msg=String.fromCharCode.apply(null,new Uint8Array(msg))}catch(e){var typed=new Uint8Array(msg);msg="";for(var i=0;i=8*this._finalSize&&(this._update(this._block),this._block.fill(0)),this._block.writeInt32BE(l,this._blockSize-4);var hash=this._update(this._block)||this._hash();return enc?hash.toString(enc):hash},Hash.prototype._update=function(){throw new Error("_update must be implemented by subclass")},module.exports=Hash}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function Duplex(options){if(!(this instanceof Duplex))return new Duplex(options);Readable.call(this,options),Writable.call(this,options),options&&options.readable===!1&&(this.readable=!1),options&&options.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,options&&options.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",onend)}function onend(){this.allowHalfOpen||this._writableState.ended||processNextTick(onEndNT,this)}function onEndNT(self){self.end()}var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)keys.push(key);return keys};module.exports=Duplex;var processNextTick=__webpack_require__(15),util=__webpack_require__(6);util.inherits=__webpack_require__(1);var Readable=__webpack_require__(316),Writable=__webpack_require__(318);util.inherits(Duplex,Readable);for(var keys=objectKeys(Writable.prototype),v=0;v-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}function noop(){}function once(fn){return function(){if(null!==fn){var callFn=fn;fn=null,callFn.apply(this,arguments)}}}function baseTimes(n,iteratee){for(var index=-1,result=Array(n);++index-1&&value%1==0&&valuelength?0:length+start),end=end>length?length:end,end<0&&(end+=length),length=start>end?0:end-start>>>0,start>>>=0;for(var result=Array(length);++index=length?array:baseSlice(array,start,end)}function charsEndIndex(strSymbols,chrSymbols){for(var index=strSymbols.length;index--&&baseIndexOf(chrSymbols,strSymbols[index],0)>-1;);return index}function charsStartIndex(strSymbols,chrSymbols){for(var index=-1,length=strSymbols.length;++index-1;);return index}function asciiToArray(string){return string.split("")}function hasUnicode(string){return reHasUnicode.test(string)}function unicodeToArray(string){return string.match(reUnicode)||[]}function stringToArray(string){return hasUnicode(string)?unicodeToArray(string):asciiToArray(string)}function toString(value){return null==value?"":baseToString(value)}function trim(string,chars,guard){if((string=toString(string))&&(guard||void 0===chars))return string.replace(reTrim,"");if(!string||!(chars=baseToString(chars)))return string;var strSymbols=stringToArray(string),chrSymbols=stringToArray(chars);return castSlice(strSymbols,charsStartIndex(strSymbols,chrSymbols),charsEndIndex(strSymbols,chrSymbols)+1).join("")}function parseParams(func){return func=func.toString().replace(STRIP_COMMENTS,""),func=func.match(FN_ARGS)[2].replace(" ",""),func=func?func.split(FN_ARG_SPLIT):[],func=func.map(function(arg){return trim(arg.replace(FN_ARG,""))})}function autoInject(tasks,callback){var newTasks={};baseForOwn(tasks,function(taskFn,key){function newTask(results,taskCb){var newArgs=arrayMap(params,function(name){return results[name]});newArgs.push(taskCb),wrapAsync(taskFn).apply(null,newArgs)}var params,fnIsAsync=isAsync(taskFn),hasNoDeps=!fnIsAsync&&1===taskFn.length||fnIsAsync&&0===taskFn.length;if(isArray(taskFn))params=taskFn.slice(0,-1),taskFn=taskFn[taskFn.length-1],newTasks[key]=params.concat(params.length>0?newTask:taskFn);else if(hasNoDeps)newTasks[key]=taskFn;else{if(params=parseParams(taskFn),0===taskFn.length&&!fnIsAsync&&0===params.length)throw new Error("autoInject task functions require explicit parameters.");fnIsAsync||params.pop(),newTasks[key]=params.concat(newTask)}}),auto(newTasks,callback)}function DLL(){this.head=this.tail=null,this.length=0}function setInitial(dll,node){dll.length=1,dll.head=dll.tail=node}function queue(worker,concurrency,payload){function _insert(data,insertAtFront,callback){if(null!=callback&&"function"!=typeof callback)throw new Error("task callback must be a function");if(q.started=!0,isArray(data)||(data=[data]),0===data.length&&q.idle())return setImmediate$1(function(){q.drain()});for(var i=0,l=data.length;i=0&&workersList.splice(index),task.callback.apply(task,arguments),null!=err&&q.error(err,task.data)}numRunning<=q.concurrency-q.buffer&&q.unsaturated(),q.idle()&&q.drain(),q.process()}}if(null==concurrency)concurrency=1;else if(0===concurrency)throw new Error("Concurrency must not be zero");var _worker=wrapAsync(worker),numRunning=0,workersList=[],isProcessing=!1,q={_tasks:new DLL,concurrency:concurrency,payload:payload,saturated:noop,unsaturated:noop,buffer:concurrency/4,empty:noop,drain:noop,error:noop,started:!1,paused:!1,push:function(data,callback){_insert(data,!1,callback)},kill:function(){q.drain=noop,q._tasks.empty()},unshift:function(data,callback){_insert(data,!0,callback)},remove:function(testFn){q._tasks.remove(testFn)},process:function(){if(!isProcessing){for(isProcessing=!0;!q.paused&&numRunning2&&(result=slice(arguments,1)),results[key]=result,callback(err)})},function(err){callback(err,results)})}function parallelLimit(tasks,callback){_parallel(eachOf,tasks,callback)}function parallelLimit$1(tasks,limit,callback){_parallel(_eachOfLimit(limit),tasks,callback)}function race(tasks,callback){if(callback=once(callback||noop),!isArray(tasks))return callback(new TypeError("First argument to race must be an array of functions"));if(!tasks.length)return callback();for(var i=0,l=tasks.length;ib?1:0}var _iteratee=wrapAsync(iteratee);map(coll,function(x,callback){_iteratee(x,function(err,criteria){if(err)return callback(err);callback(null,{value:x,criteria:criteria})})},function(err,results){if(err)return callback(err);callback(null,arrayMap(results.sort(comparator),baseProperty("value")))})}function timeout(asyncFn,milliseconds,info){var fn=wrapAsync(asyncFn);return initialParams(function(args,callback){function timeoutCallback(){var name=asyncFn.name||"anonymous",error=new Error('Callback function "'+name+'" timed out.');error.code="ETIMEDOUT",info&&(error.info=info),timedOut=!0,callback(error)}var timer,timedOut=!1;args.push(function(){timedOut||(callback.apply(null,arguments),clearTimeout(timer))}),timer=setTimeout(timeoutCallback,milliseconds),fn.apply(null,args)})}function baseRange(start,end,step,fromRight){for(var index=-1,length=nativeMax(nativeCeil((end-start)/(step||1)),0),result=Array(length);length--;)result[fromRight?length:++index]=start,start+=step;return result}function timeLimit(count,limit,iteratee,callback){var _iteratee=wrapAsync(iteratee);mapLimit(baseRange(0,count,1),limit,_iteratee,callback)}function transform(coll,accumulator,iteratee,callback){arguments.length<=3&&(callback=iteratee,iteratee=accumulator,accumulator=isArray(coll)?[]:{}),callback=once(callback||noop);var _iteratee=wrapAsync(iteratee);eachOf(coll,function(v,k,cb){_iteratee(accumulator,v,k,cb)},function(err){callback(err,accumulator)})}function tryEach(tasks,callback){var result,error=null;callback=callback||noop,eachSeries(tasks,function(task,callback){wrapAsync(task)(function(err,res){result=arguments.length>2?slice(arguments,1):res,error=err,callback(!err)})},function(){callback(error,result)})}function unmemoize(fn){return function(){return(fn.unmemoized||fn).apply(null,arguments)}}function whilst(test,iteratee,callback){callback=onlyOnce(callback||noop);var _iteratee=wrapAsync(iteratee);if(!test())return callback(null);var next=function(err){if(err)return callback(err);if(test())return _iteratee(next);var args=slice(arguments,1);callback.apply(null,[null].concat(args))};_iteratee(next)}function until(test,iteratee,callback){whilst(function(){return!test.apply(this,arguments)},iteratee,callback)}var _defer,initialParams=function(fn){return function(){var args=slice(arguments),callback=args.pop();fn.call(this,args,callback)}},hasSetImmediate="function"==typeof setImmediate&&setImmediate,hasNextTick="object"==typeof process&&"function"==typeof process.nextTick;_defer=hasSetImmediate?setImmediate:hasNextTick?process.nextTick:fallback;var setImmediate$1=wrap(_defer),supportsSymbol="function"==typeof Symbol,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),Symbol$1=root.Symbol,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,nativeObjectToString=objectProto.toString,symToStringTag$1=Symbol$1?Symbol$1.toStringTag:void 0,objectProto$1=Object.prototype,nativeObjectToString$1=objectProto$1.toString,nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=Symbol$1?Symbol$1.toStringTag:void 0,asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]",MAX_SAFE_INTEGER=9007199254740991,breakLoop={},iteratorSymbol="function"==typeof Symbol&&Symbol.iterator,getIterator=function(coll){return iteratorSymbol&&coll[iteratorSymbol]&&coll[iteratorSymbol]()},argsTag="[object Arguments]",objectProto$3=Object.prototype,hasOwnProperty$2=objectProto$3.hasOwnProperty,propertyIsEnumerable=objectProto$3.propertyIsEnumerable,isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty$2.call(value,"callee")&&!propertyIsEnumerable.call(value,"callee")},isArray=Array.isArray,freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,Buffer=moduleExports?root.Buffer:void 0,nativeIsBuffer=Buffer?Buffer.isBuffer:void 0,isBuffer=nativeIsBuffer||stubFalse,MAX_SAFE_INTEGER$1=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags["[object Arguments]"]=typedArrayTags["[object Array]"]=typedArrayTags["[object ArrayBuffer]"]=typedArrayTags["[object Boolean]"]=typedArrayTags["[object DataView]"]=typedArrayTags["[object Date]"]=typedArrayTags["[object Error]"]=typedArrayTags["[object Function]"]=typedArrayTags["[object Map]"]=typedArrayTags["[object Number]"]=typedArrayTags["[object Object]"]=typedArrayTags["[object RegExp]"]=typedArrayTags["[object Set]"]=typedArrayTags["[object String]"]=typedArrayTags["[object WeakMap]"]=!1;var freeExports$1="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule$1=freeExports$1&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports$1=freeModule$1&&freeModule$1.exports===freeExports$1,freeProcess=moduleExports$1&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?function(func){return function(value){return func(value)}}(nodeIsTypedArray):baseIsTypedArray,objectProto$2=Object.prototype,hasOwnProperty$1=objectProto$2.hasOwnProperty,objectProto$5=Object.prototype,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty,eachOfGeneric=doLimit(eachOfLimit,1/0),eachOf=function(coll,iteratee,callback){(isArrayLike(coll)?eachOfArrayLike:eachOfGeneric)(coll,wrapAsync(iteratee),callback)},map=doParallel(_asyncMap),applyEach=applyEach$1(map),mapLimit=doParallelLimit(_asyncMap),mapSeries=doLimit(mapLimit,1),applyEachSeries=applyEach$1(mapSeries),apply=function(fn){var args=slice(arguments,1);return function(){var callArgs=slice(arguments);return fn.apply(null,args.concat(callArgs))}},baseFor=function(fromRight){return function(object,iteratee,keysFunc){for(var index=-1,iterable=Object(object),props=keysFunc(object),length=props.length;length--;){var key=props[fromRight?length:++index];if(iteratee(iterable[key],key,iterable)===!1)break}return object}}(),auto=function(tasks,concurrency,callback){function enqueueTask(key,task){readyTasks.push(function(){runTask(key,task)})}function processQueue(){if(0===readyTasks.length&&0===runningTasks)return callback(null,results);for(;readyTasks.length&&runningTasks2&&(result=slice(arguments,1)),err){var safeResults={};baseForOwn(results,function(val,rkey){safeResults[rkey]=val}),safeResults[key]=result,hasError=!0,listeners=Object.create(null),callback(err,safeResults)}else results[key]=result,taskComplete(key)});runningTasks++;var taskFn=wrapAsync(task[task.length-1]);task.length>1?taskFn(results,taskCallback):taskFn(taskCallback)}}function getDependents(taskName){var result=[];return baseForOwn(tasks,function(task,key){isArray(task)&&baseIndexOf(task,taskName,0)>=0&&result.push(key)}),result}"function"==typeof concurrency&&(callback=concurrency,concurrency=null),callback=once(callback||noop);var keys$$1=keys(tasks),numTasks=keys$$1.length;if(!numTasks)return callback(null);concurrency||(concurrency=numTasks);var results={},runningTasks=0,hasError=!1,listeners=Object.create(null),readyTasks=[],readyToCheck=[],uncheckedDependencies={};baseForOwn(tasks,function(task,key){if(!isArray(task))return enqueueTask(key,[task]),void readyToCheck.push(key);var dependencies=task.slice(0,task.length-1),remainingDependencies=dependencies.length;if(0===remainingDependencies)return enqueueTask(key,task),void readyToCheck.push(key);uncheckedDependencies[key]=remainingDependencies,arrayEach(dependencies,function(dependencyName){if(!tasks[dependencyName])throw new Error("async.auto task `"+key+"` has a non-existent dependency `"+dependencyName+"` in "+dependencies.join(", "));addListener(dependencyName,function(){0===--remainingDependencies&&enqueueTask(key,task)})})}),function(){for(var currentTask,counter=0;readyToCheck.length;)currentTask=readyToCheck.pop(),counter++,arrayEach(getDependents(currentTask),function(dependent){0==--uncheckedDependencies[dependent]&&readyToCheck.push(dependent)});if(counter!==numTasks)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),processQueue()},symbolTag="[object Symbol]",INFINITY=1/0,symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0,reHasUnicode=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),rsCombo="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",rsFitz="\\ud83c[\\udffb-\\udfff]",rsRegional="(?:\\ud83c[\\udde6-\\uddff]){2}",rsSurrPair="[\\ud800-\\udbff][\\udc00-\\udfff]",reOptMod="(?:"+rsCombo+"|"+rsFitz+")?",rsOptJoin="(?:\\u200d(?:"+["[^\\ud800-\\udfff]",rsRegional,rsSurrPair].join("|")+")[\\ufe0e\\ufe0f]?"+reOptMod+")*",rsSeq="[\\ufe0e\\ufe0f]?"+reOptMod+rsOptJoin,rsSymbol="(?:"+["[^\\ud800-\\udfff]"+rsCombo+"?",rsCombo,rsRegional,rsSurrPair,"[\\ud800-\\udfff]"].join("|")+")",reUnicode=RegExp(rsFitz+"(?="+rsFitz+")|"+rsSymbol+rsSeq,"g"),reTrim=/^\s+|\s+$/g,FN_ARGS=/^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m,FN_ARG_SPLIT=/,/,FN_ARG=/(=.+)?(\s*)$/,STRIP_COMMENTS=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;DLL.prototype.removeLink=function(node){return node.prev?node.prev.next=node.next:this.head=node.next,node.next?node.next.prev=node.prev:this.tail=node.prev,node.prev=node.next=null,this.length-=1,node},DLL.prototype.empty=function(){for(;this.head;)this.shift();return this},DLL.prototype.insertAfter=function(node,newNode){newNode.prev=node,newNode.next=node.next,node.next?node.next.prev=newNode:this.tail=newNode,node.next=newNode,this.length+=1},DLL.prototype.insertBefore=function(node,newNode){newNode.prev=node.prev,newNode.next=node,node.prev?node.prev.next=newNode:this.head=newNode,node.prev=newNode,this.length+=1},DLL.prototype.unshift=function(node){this.head?this.insertBefore(this.head,node):setInitial(this,node)},DLL.prototype.push=function(node){this.tail?this.insertAfter(this.tail,node):setInitial(this,node)},DLL.prototype.shift=function(){return this.head&&this.removeLink(this.head)},DLL.prototype.pop=function(){return this.tail&&this.removeLink(this.tail)},DLL.prototype.toArray=function(){for(var arr=Array(this.length),curr=this.head,idx=0;idx=nextNode.priority;)nextNode=nextNode.next;for(var i=0,l=data.length;i15&&raise(id,tooManyDigits,n),num=!1):x.s=45===str.charCodeAt(0)?(str=str.slice(1),-1):1,str=convertBase(str,10,b,x.s)}else{if(n instanceof BigNumber)return x.s=n.s,x.e=n.e,x.c=(n=n.c)?n.slice():n,void(id=0);if((num="number"==typeof n)&&0*n==0){if(x.s=1/n<0?(n=-n,-1):1,n===~~n){for(e=0,i=n;i>=10;i/=10,e++);return x.e=e,x.c=[n],void(id=0)}str=n+""}else{if(!isNumeric.test(str=n+""))return parseNumeric(x,str,num);x.s=45===str.charCodeAt(0)?(str=str.slice(1),-1):1}}for((e=str.indexOf("."))>-1&&(str=str.replace(".","")),(i=str.search(/e/i))>0?(e<0&&(e=i),e+=+str.slice(i+1),str=str.substring(0,i)):e<0&&(e=str.length),i=0;48===str.charCodeAt(i);i++);for(len=str.length;48===str.charCodeAt(--len););if(str=str.slice(i,len+1))if(len=str.length,num&&ERRORS&&len>15&&(n>MAX_SAFE_INTEGER||n!==mathfloor(n))&&raise(id,tooManyDigits,x.s*n),(e=e-i-1)>MAX_EXP)x.c=x.e=null;else if(e=0&&(k=POW_PRECISION,POW_PRECISION=0,str=str.replace(".",""),y=new BigNumber(baseIn),x=y.pow(str.length-i),POW_PRECISION=k,y.c=toBaseOut(toFixedPoint(coeffToString(x.c),x.e),10,baseOut),y.e=y.c.length),xc=toBaseOut(str,baseIn,baseOut),e=k=xc.length;0==xc[--k];xc.pop());if(!xc[0])return"0";if(i<0?--e:(x.c=xc,x.e=e,x.s=sign,x=div(x,y,dp,rm,baseOut),xc=x.c,r=x.r,e=x.e),d=e+dp+1,i=xc[d],k=baseOut/2,r=r||d<0||null!=xc[d+1],r=rm<4?(null!=i||r)&&(0==rm||rm==(x.s<0?3:2)):i>k||i==k&&(4==rm||r||6==rm&&1&xc[d-1]||rm==(x.s<0?8:7)),d<1||!xc[0])str=r?toFixedPoint("1",-dp):"0";else{if(xc.length=d,r)for(--baseOut;++xc[--d]>baseOut;)xc[d]=0,d||(++e,xc.unshift(1));for(k=xc.length;!xc[--k];);for(i=0,str="";i<=k;str+=ALPHABET.charAt(xc[i++]));str=toFixedPoint(str,e)}return str}function format(n,i,rm,caller){var c0,e,ne,len,str;if(rm=null!=rm&&isValidInt(rm,0,8,caller,roundingMode)?0|rm:ROUNDING_MODE,!n.c)return n.toString();if(c0=n.c[0],ne=n.e,null==i)str=coeffToString(n.c),str=19==caller||24==caller&&ne<=TO_EXP_NEG?toExponential(str,ne):toFixedPoint(str,ne);else if(n=round(new BigNumber(n),i,rm),e=n.e,str=coeffToString(n.c),len=str.length,19==caller||24==caller&&(i<=e||e<=TO_EXP_NEG)){for(;lenlen){if(--i>0)for(str+=".";i--;str+="0");}else if((i+=e-len)>0)for(e+1==len&&(str+=".");i--;str+="0");return n.s<0&&c0?"-"+str:str}function maxOrMin(args,method){var m,n,i=0;for(isArray(args[0])&&(args=args[0]),m=new BigNumber(args[0]);++imax||n!=truncate(n))&&raise(caller,(name||"decimal places")+(nmax?" out of range":" not an integer"),n),!0}function normalise(n,c,e){for(var i=1,j=c.length;!c[--j];c.pop());for(j=c[0];j>=10;j/=10,i++);return(e=i+e*LOG_BASE-1)>MAX_EXP?n.c=n.e=null:e=10;k/=10,d++);if((i=sd-d)<0)i+=LOG_BASE,j=sd,n=xc[ni=0],rd=n/pows10[d-j-1]%10|0;else if((ni=mathceil((i+1)/LOG_BASE))>=xc.length){if(!r)break out;for(;xc.length<=ni;xc.push(0));n=rd=0,d=1,i%=LOG_BASE,j=i-LOG_BASE+1}else{for(n=k=xc[ni],d=1;k>=10;k/=10,d++);i%=LOG_BASE,j=i-LOG_BASE+d,rd=j<0?0:n/pows10[d-j-1]%10|0}if(r=r||sd<0||null!=xc[ni+1]||(j<0?n:n%pows10[d-j-1]),r=rm<4?(rd||r)&&(0==rm||rm==(x.s<0?3:2)):rd>5||5==rd&&(4==rm||r||6==rm&&(i>0?j>0?n/pows10[d-j]:0:xc[ni-1])%10&1||rm==(x.s<0?8:7)),sd<1||!xc[0])return xc.length=0,r?(sd-=x.e+1,xc[0]=pows10[(LOG_BASE-sd%LOG_BASE)%LOG_BASE],x.e=-sd||0):xc[0]=x.e=0,x;if(0==i?(xc.length=ni,k=1,ni--):(xc.length=ni+1,k=pows10[LOG_BASE-i],xc[ni]=j>0?mathfloor(n/pows10[d-j]%pows10[j])*k:0),r)for(;;){if(0==ni){for(i=1,j=xc[0];j>=10;j/=10,i++);for(j=xc[0]+=k,k=1;j>=10;j/=10,k++);i!=k&&(x.e++,xc[0]==BASE&&(xc[0]=1));break}if(xc[ni]+=k,xc[ni]!=BASE)break;xc[ni--]=0,k=1}for(i=xc.length;0===xc[--i];xc.pop());}x.e>MAX_EXP?x.c=x.e=null:x.ei)return null!=(v=a[i++])};return has(p="DECIMAL_PLACES")&&isValidInt(v,0,MAX,2,p)&&(DECIMAL_PLACES=0|v),r[p]=DECIMAL_PLACES,has(p="ROUNDING_MODE")&&isValidInt(v,0,8,2,p)&&(ROUNDING_MODE=0|v),r[p]=ROUNDING_MODE,has(p="EXPONENTIAL_AT")&&(isArray(v)?isValidInt(v[0],-MAX,0,2,p)&&isValidInt(v[1],0,MAX,2,p)&&(TO_EXP_NEG=0|v[0],TO_EXP_POS=0|v[1]):isValidInt(v,-MAX,MAX,2,p)&&(TO_EXP_NEG=-(TO_EXP_POS=0|(v<0?-v:v)))),r[p]=[TO_EXP_NEG,TO_EXP_POS],has(p="RANGE")&&(isArray(v)?isValidInt(v[0],-MAX,-1,2,p)&&isValidInt(v[1],1,MAX,2,p)&&(MIN_EXP=0|v[0],MAX_EXP=0|v[1]):isValidInt(v,-MAX,MAX,2,p)&&(0|v?MIN_EXP=-(MAX_EXP=0|(v<0?-v:v)):ERRORS&&raise(2,p+" cannot be zero",v))),r[p]=[MIN_EXP,MAX_EXP],has(p="ERRORS")&&(v===!!v||1===v||0===v?(id=0,isValidInt=(ERRORS=!!v)?intValidatorWithErrors:intValidatorNoErrors):ERRORS&&raise(2,p+notBool,v)),r[p]=ERRORS,has(p="CRYPTO")&&(v===!0||v===!1||1===v||0===v?v?(v="undefined"==typeof crypto,!v&&crypto&&(crypto.getRandomValues||crypto.randomBytes)?CRYPTO=!0:ERRORS?raise(2,"crypto unavailable",v?void 0:crypto):CRYPTO=!1):CRYPTO=!1:ERRORS&&raise(2,p+notBool,v)),r[p]=CRYPTO,has(p="MODULO_MODE")&&isValidInt(v,0,9,2,p)&&(MODULO_MODE=0|v),r[p]=MODULO_MODE,has(p="POW_PRECISION")&&isValidInt(v,0,MAX,2,p)&&(POW_PRECISION=0|v),r[p]=POW_PRECISION,has(p="FORMAT")&&("object"==typeof v?FORMAT=v:ERRORS&&raise(2,p+" not an object",v)),r[p]=FORMAT,r},BigNumber.max=function(){return maxOrMin(arguments,P.lt)},BigNumber.min=function(){return maxOrMin(arguments,P.gt)},BigNumber.random=function(){var random53bitInt=9007199254740992*Math.random()&2097151?function(){return mathfloor(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(dp){var a,b,e,k,v,i=0,c=[],rand=new BigNumber(ONE);if(dp=null!=dp&&isValidInt(dp,0,MAX,14)?0|dp:DECIMAL_PLACES,k=mathceil(dp/LOG_BASE),CRYPTO)if(crypto.getRandomValues){for(a=crypto.getRandomValues(new Uint32Array(k*=2));i>>11),v>=9e15?(b=crypto.getRandomValues(new Uint32Array(2)),a[i]=b[0],a[i+1]=b[1]):(c.push(v%1e14),i+=2);i=k/2}else if(crypto.randomBytes){for(a=crypto.randomBytes(k*=7);i=9e15?crypto.randomBytes(7).copy(a,i):(c.push(v%1e14),i+=7);i=k/7}else CRYPTO=!1,ERRORS&&raise(14,"crypto unavailable",crypto);if(!CRYPTO)for(;i=10;v/=10,i++);ibL?1:-1;else for(i=cmp=0;ib[i]?1:-1;break}return cmp}function subtract(a,b,aL,base){for(var i=0;aL--;)a[aL]-=i,i=a[aL]1;a.shift());}return function(x,y,dp,rm,base){var cmp,e,i,more,n,prod,prodL,q,qc,rem,remL,rem0,xi,xL,yc0,yL,yz,s=x.s==y.s?1:-1,xc=x.c,yc=y.c;if(!(xc&&xc[0]&&yc&&yc[0]))return new BigNumber(x.s&&y.s&&(xc?!yc||xc[0]!=yc[0]:yc)?xc&&0==xc[0]||!yc?0*s:s/0:NaN);for(q=new BigNumber(s),qc=q.c=[],e=x.e-y.e,s=dp+e+1,base||(base=BASE,e=bitFloor(x.e/LOG_BASE)-bitFloor(y.e/LOG_BASE),s=s/LOG_BASE|0),i=0;yc[i]==(xc[i]||0);i++);if(yc[i]>(xc[i]||0)&&e--,s<0)qc.push(1),more=!0;else{for(xL=xc.length,yL=yc.length,i=0,s+=2,n=mathfloor(base/(yc[0]+1)),n>1&&(yc=multiply(yc,n,base),xc=multiply(xc,n,base),yL=yc.length,xL=xc.length),xi=yL,rem=xc.slice(0,yL),remL=rem.length;remL=base/2&&yc0++;do{if(n=0,(cmp=compare(yc,rem,yL,remL))<0){if(rem0=rem[0],yL!=remL&&(rem0=rem0*base+(rem[1]||0)),(n=mathfloor(rem0/yc0))>1)for(n>=base&&(n=base-1),prod=multiply(yc,n,base),prodL=prod.length,remL=rem.length;1==compare(prod,rem,prodL,remL);)n--,subtract(prod,yL=10;s/=10,i++);round(q,dp+(q.e=i+e*LOG_BASE-1)+1,rm,more)}else q.e=e,q.r=+more;return q}}(),parseNumeric=function(){var isInfinityOrNaN=/^-?(Infinity|NaN)$/;return function(x,str,num,b){var base,s=num?str:str.replace(/^\s*\+(?=[\w.])|^\s+|\s+$/g,"");if(isInfinityOrNaN.test(s))x.s=isNaN(s)?null:s<0?-1:1;else{if(!num&&(s=s.replace(/^(-?)0([xbo])(?=\w[\w.]*$)/i,function(m,p1,p2){return base="x"==(p2=p2.toLowerCase())?16:"b"==p2?2:8,b&&b!=base?m:p1}),b&&(base=b,s=s.replace(/^([^.]+)\.$/,"$1").replace(/^\.([^.]+)$/,"0.$1")),str!=s))return new BigNumber(s,base);ERRORS&&raise(id,"not a"+(b?" base "+b:"")+" number",str),x.s=null}x.c=x.e=null,id=0}}(),P.absoluteValue=P.abs=function(){var x=new BigNumber(this);return x.s<0&&(x.s=1),x},P.ceil=function(){return round(new BigNumber(this),this.e+1,2)},P.comparedTo=P.cmp=function(y,b){return id=1,compare(this,new BigNumber(y,b))},P.decimalPlaces=P.dp=function(){var n,v,c=this.c;if(!c)return null;if(n=((v=c.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,v=c[v])for(;v%10==0;v/=10,n--);return n<0&&(n=0),n},P.dividedBy=P.div=function(y,b){return id=3,div(this,new BigNumber(y,b),DECIMAL_PLACES,ROUNDING_MODE)},P.dividedToIntegerBy=P.divToInt=function(y,b){return id=4,div(this,new BigNumber(y,b),0,1)},P.equals=P.eq=function(y,b){return id=5,0===compare(this,new BigNumber(y,b))},P.floor=function(){return round(new BigNumber(this),this.e+1,3)},P.greaterThan=P.gt=function(y,b){return id=6,compare(this,new BigNumber(y,b))>0},P.greaterThanOrEqualTo=P.gte=function(y,b){return id=7,1===(b=compare(this,new BigNumber(y,b)))||0===b},P.isFinite=function(){return!!this.c},P.isInteger=P.isInt=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},P.isNaN=function(){return!this.s},P.isNegative=P.isNeg=function(){return this.s<0},P.isZero=function(){return!!this.c&&0==this.c[0]},P.lessThan=P.lt=function(y,b){return id=8,compare(this,new BigNumber(y,b))<0},P.lessThanOrEqualTo=P.lte=function(y,b){return id=9,(b=compare(this,new BigNumber(y,b)))===-1||0===b},P.minus=P.sub=function(y,b){var i,j,t,xLTy,x=this,a=x.s;if(id=10,y=new BigNumber(y,b),b=y.s,!a||!b)return new BigNumber(NaN);if(a!=b)return y.s=-b,x.plus(y);var xe=x.e/LOG_BASE,ye=y.e/LOG_BASE,xc=x.c,yc=y.c;if(!xe||!ye){if(!xc||!yc)return xc?(y.s=-b,y):new BigNumber(yc?x:NaN);if(!xc[0]||!yc[0])return yc[0]?(y.s=-b,y):new BigNumber(xc[0]?x:3==ROUNDING_MODE?-0:0)}if(xe=bitFloor(xe),ye=bitFloor(ye),xc=xc.slice(),a=xe-ye){for((xLTy=a<0)?(a=-a,t=xc):(ye=xe,t=yc),t.reverse(),b=a;b--;t.push(0));t.reverse()}else for(j=(xLTy=(a=xc.length)<(b=yc.length))?a:b,a=b=0;b0)for(;b--;xc[i++]=0);for(b=BASE-1;j>a;){if(xc[--j]0?(ye=xe,t=yc):(a=-a,t=xc),t.reverse();a--;t.push(0));t.reverse()}for(a=xc.length,b=yc.length,a-b<0&&(t=yc,yc=xc,xc=t,b=a),a=0;b;)a=(xc[--b]=xc[b]+yc[b]+a)/BASE|0,xc[b]=BASE===xc[b]?0:xc[b]%BASE;return a&&(xc.unshift(a),++ye),normalise(y,xc,ye)},P.precision=P.sd=function(z){var n,v,x=this,c=x.c;if(null!=z&&z!==!!z&&1!==z&&0!==z&&(ERRORS&&raise(13,"argument"+notBool,z),z!=!!z&&(z=null)),!c)return null;if(v=c.length-1,n=v*LOG_BASE+1,v=c[v]){for(;v%10==0;v/=10,n--);for(v=c[0];v>=10;v/=10,n++);}return z&&x.e+1>n&&(n=x.e+1),n},P.round=function(dp,rm){var n=new BigNumber(this);return(null==dp||isValidInt(dp,0,MAX,15))&&round(n,~~dp+this.e+1,null!=rm&&isValidInt(rm,0,8,15,roundingMode)?0|rm:ROUNDING_MODE),n},P.shift=function(k){var n=this;return isValidInt(k,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER,16,"argument")?n.times("1e"+truncate(k)):new BigNumber(n.c&&n.c[0]&&(k<-MAX_SAFE_INTEGER||k>MAX_SAFE_INTEGER)?n.s*(k<0?0:1/0):n)},P.squareRoot=P.sqrt=function(){var m,n,r,rep,t,x=this,c=x.c,s=x.s,e=x.e,dp=DECIMAL_PLACES+4,half=new BigNumber("0.5");if(1!==s||!c||!c[0])return new BigNumber(!s||s<0&&(!c||c[0])?NaN:c?x:1/0);if(s=Math.sqrt(+x),0==s||s==1/0?(n=coeffToString(c),(n.length+e)%2==0&&(n+="0"),s=Math.sqrt(n),e=bitFloor((e+1)/2)-(e<0||e%2),s==1/0?n="1e"+e:(n=s.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),r=new BigNumber(n)):r=new BigNumber(s+""),r.c[0])for(e=r.e,s=e+dp,s<3&&(s=0);;)if(t=r,r=half.times(t.plus(div(x,t,dp,1))),coeffToString(t.c).slice(0,s)===(n=coeffToString(r.c)).slice(0,s)){if(r.e=0;){for(c=0,ylo=yc[i]%sqrtBase,yhi=yc[i]/sqrtBase|0,k=xcL,j=i+k;j>i;)xlo=xc[--k]%sqrtBase,xhi=xc[k]/sqrtBase|0,m=yhi*xlo+xhi*ylo,xlo=ylo*xlo+m%sqrtBase*sqrtBase+zc[j]+c,c=(xlo/base|0)+(m/sqrtBase|0)+yhi*xhi,zc[j--]=xlo%base;zc[j]=c}return c?++e:zc.shift(),normalise(y,zc,e)},P.toDigits=function(sd,rm){var n=new BigNumber(this);return sd=null!=sd&&isValidInt(sd,1,MAX,18,"precision")?0|sd:null,rm=null!=rm&&isValidInt(rm,0,8,18,roundingMode)?0|rm:ROUNDING_MODE,sd?round(n,sd,rm):n},P.toExponential=function(dp,rm){return format(this,null!=dp&&isValidInt(dp,0,MAX,19)?1+~~dp:null,rm,19)},P.toFixed=function(dp,rm){return format(this,null!=dp&&isValidInt(dp,0,MAX,20)?~~dp+this.e+1:null,rm,20)},P.toFormat=function(dp,rm){var str=format(this,null!=dp&&isValidInt(dp,0,MAX,21)?~~dp+this.e+1:null,rm,21);if(this.c){var i,arr=str.split("."),g1=+FORMAT.groupSize,g2=+FORMAT.secondaryGroupSize,groupSeparator=FORMAT.groupSeparator,intPart=arr[0],fractionPart=arr[1],isNeg=this.s<0,intDigits=isNeg?intPart.slice(1):intPart,len=intDigits.length;if(g2&&(i=g1,g1=g2,g2=i,len-=i),g1>0&&len>0){for(i=len%g1||g1,intPart=intDigits.substr(0,i);i0&&(intPart+=groupSeparator+intDigits.slice(i)),isNeg&&(intPart="-"+intPart)}str=fractionPart?intPart+FORMAT.decimalSeparator+((g2=+FORMAT.fractionGroupSize)?fractionPart.replace(new RegExp("\\d{"+g2+"}\\B","g"),"$&"+FORMAT.fractionGroupSeparator):fractionPart):intPart}return str},P.toFraction=function(md){var arr,d0,d2,e,exp,n,n0,q,s,k=ERRORS,x=this,xc=x.c,d=new BigNumber(ONE),n1=d0=new BigNumber(ONE),d1=n0=new BigNumber(ONE);if(null!=md&&(ERRORS=!1,n=new BigNumber(md),ERRORS=k,(k=n.isInt())&&!n.lt(ONE)||(ERRORS&&raise(22,"max denominator "+(k?"out of range":"not an integer"),md),md=!k&&n.c&&round(n,n.e+1,1).gte(ONE)?n:null)),!xc)return x.toString();for(s=coeffToString(xc),e=d.e=s.length-x.e-1,d.c[0]=POWS_TEN[(exp=e%LOG_BASE)<0?LOG_BASE+exp:exp],md=!md||n.cmp(d)>0?e>0?d:n1:n,exp=MAX_EXP,MAX_EXP=1/0,n=new BigNumber(s),n0.c[0]=0;q=div(n,d,0,1),d2=d0.plus(q.times(d1)),1!=d2.cmp(md);)d0=d1,d1=d2,n1=n0.plus(q.times(d2=n1)),n0=d2,d=n.minus(q.times(d2=d)),n=d2;return d2=div(md.minus(d0),d1,0,1),n0=n0.plus(d2.times(n1)),d0=d0.plus(d2.times(d1)),n0.s=n1.s=x.s,e*=2,arr=div(n1,d1,e,ROUNDING_MODE).minus(x).abs().cmp(div(n0,d0,e,ROUNDING_MODE).minus(x).abs())<1?[n1.toString(),d1.toString()]:[n0.toString(),d0.toString()],MAX_EXP=exp,arr},P.toNumber=function(){return+this},P.toPower=P.pow=function(n,m){var k,y,z,i=mathfloor(n<0?-n:+n),x=this;if(null!=m&&(id=23,m=new BigNumber(m)),!isValidInt(n,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER,23,"exponent")&&(!isFinite(n)||i>MAX_SAFE_INTEGER&&(n/=0)||parseFloat(n)!=n&&!(n=NaN))||0==n)return k=Math.pow(+x,n),new BigNumber(m?k%m:k);for(m?n>1&&x.gt(ONE)&&x.isInt()&&m.gt(ONE)&&m.isInt()?x=x.mod(m):(z=m,m=null):POW_PRECISION&&(k=mathceil(POW_PRECISION/LOG_BASE+2)),y=new BigNumber(ONE);;){if(i%2){if(y=y.times(x),!y.c)break;k?y.c.length>k&&(y.c.length=k):m&&(y=y.mod(m))}if(!(i=mathfloor(i/2)))break;x=x.times(x),k?x.c&&x.c.length>k&&(x.c.length=k):m&&(x=x.mod(m))}return m?y:(n<0&&(y=ONE.div(y)),z?y.mod(z):k?round(y,POW_PRECISION,ROUNDING_MODE):y)},P.toPrecision=function(sd,rm){return format(this,null!=sd&&isValidInt(sd,1,MAX,24,"precision")?0|sd:null,rm,24)},P.toString=function(b){var str,n=this,s=n.s,e=n.e;return null===e?s?(str="Infinity",s<0&&(str="-"+str)):str="NaN":(str=coeffToString(n.c),str=null!=b&&isValidInt(b,2,64,25,"base")?convertBase(toFixedPoint(str,e),0|b,10,s):e<=TO_EXP_NEG||e>=TO_EXP_POS?toExponential(str,e):toFixedPoint(str,e),s<0&&n.c[0]&&(str="-"+str)),str},P.truncated=P.trunc=function(){return round(new BigNumber(this),this.e+1,1)},P.valueOf=P.toJSON=function(){var str,n=this,e=n.e;return null===e?n.toString():(str=coeffToString(n.c),str=e<=TO_EXP_NEG||e>=TO_EXP_POS?toExponential(str,e):toFixedPoint(str,e),n.s<0?"-"+str:str)},null!=configObj&&BigNumber.config(configObj),BigNumber}function bitFloor(n){var i=0|n;return n>0||n===i?i:i-1}function coeffToString(a){for(var s,z,i=1,j=a.length,r=a[0]+"";il^a?1:-1;for(j=(k=xc.length)<(l=yc.length)?k:l,i=0;iyc[i]^a?1:-1;return k==l?0:k>l^a?1:-1}function intValidatorNoErrors(n,min,max){return(n=truncate(n))>=min&&n<=max}function isArray(obj){return"[object Array]"==Object.prototype.toString.call(obj)}function toBaseOut(str,baseIn,baseOut){for(var j,arrL,arr=[0],i=0,len=str.length;ibaseOut-1&&(null==arr[j+1]&&(arr[j+1]=0),arr[j+1]+=arr[j]/baseOut|0,arr[j]%=baseOut)}return arr.reverse()}function toExponential(str,e){return(str.length>1?str.charAt(0)+"."+str.slice(1):str)+(e<0?"e":"e+")+e}function toFixedPoint(str,e){var len,z;if(e<0){for(z="0.";++e;z+="0");str=z+str}else if(len=str.length,++e>len){for(z="0",e-=len;--e;z+="0");str+=z}else euint_max||x<0?(x_pos=Math.abs(x)%uint_max,x<0?uint_max-x_pos:x_pos):x}function scrub_vec(v){for(;0>>8^255&sx^99,this.SBOX[x]=sx,this.INV_SBOX[sx]=x,x2=d[x],x4=d[x2],x8=d[x4],t=257*d[sx]^16843008*sx,this.SUB_MIX[0][x]=t<<24|t>>>8,this.SUB_MIX[1][x]=t<<16|t>>>16,this.SUB_MIX[2][x]=t<<8|t>>>24,this.SUB_MIX[3][x]=t,t=16843009*x8^65537*x4^257*x2^16843008*x,this.INV_SUB_MIX[0][sx]=t<<24|t>>>8,this.INV_SUB_MIX[1][sx]=t<<16|t>>>16,this.INV_SUB_MIX[2][sx]=t<<8|t>>>24,this.INV_SUB_MIX[3][sx]=t,0===x?x=xi=1:(x=x2^d[d[d[x8^x2]]],xi^=d[d[xi]]);return!0};var G=new Global;AES.blockSize=16,AES.prototype.blockSize=AES.blockSize,AES.keySize=32,AES.prototype.keySize=AES.keySize,AES.prototype._doReset=function(){var invKsRow,keySize,keyWords,ksRow,ksRows,t;for(keyWords=this._key,keySize=keyWords.length,this._nRounds=keySize+6,ksRows=4*(this._nRounds+1),this._keySchedule=[],ksRow=0;ksRow>>24,t=G.SBOX[t>>>24]<<24|G.SBOX[t>>>16&255]<<16|G.SBOX[t>>>8&255]<<8|G.SBOX[255&t],t^=G.RCON[ksRow/keySize|0]<<24):keySize>6&&ksRow%keySize==4&&(t=G.SBOX[t>>>24]<<24|G.SBOX[t>>>16&255]<<16|G.SBOX[t>>>8&255]<<8|G.SBOX[255&t]),this._keySchedule[ksRow-keySize]^t);for(this._invKeySchedule=[],invKsRow=0;invKsRow>>24]]^G.INV_SUB_MIX[1][G.SBOX[t>>>16&255]]^G.INV_SUB_MIX[2][G.SBOX[t>>>8&255]]^G.INV_SUB_MIX[3][G.SBOX[255&t]];return!0},AES.prototype.encryptBlock=function(M){M=bufferToArray(new Buffer(M));var out=this._doCryptBlock(M,this._keySchedule,G.SUB_MIX,G.SBOX),buf=new Buffer(16);return buf.writeUInt32BE(out[0],0),buf.writeUInt32BE(out[1],4),buf.writeUInt32BE(out[2],8),buf.writeUInt32BE(out[3],12),buf},AES.prototype.decryptBlock=function(M){M=bufferToArray(new Buffer(M));var temp=[M[3],M[1]];M[1]=temp[0],M[3]=temp[1];var out=this._doCryptBlock(M,this._invKeySchedule,G.INV_SUB_MIX,G.INV_SBOX),buf=new Buffer(16);return buf.writeUInt32BE(out[0],0),buf.writeUInt32BE(out[3],4),buf.writeUInt32BE(out[2],8),buf.writeUInt32BE(out[1],12),buf},AES.prototype.scrub=function(){scrub_vec(this._keySchedule),scrub_vec(this._invKeySchedule),scrub_vec(this._key)},AES.prototype._doCryptBlock=function(M,keySchedule,SUB_MIX,SBOX){var ksRow,s0,s1,s2,s3,t0,t1,t2,t3;s0=M[0]^keySchedule[0],s1=M[1]^keySchedule[1],s2=M[2]^keySchedule[2],s3=M[3]^keySchedule[3],ksRow=4;for(var round=1;round>>24]^SUB_MIX[1][s1>>>16&255]^SUB_MIX[2][s2>>>8&255]^SUB_MIX[3][255&s3]^keySchedule[ksRow++],t1=SUB_MIX[0][s1>>>24]^SUB_MIX[1][s2>>>16&255]^SUB_MIX[2][s3>>>8&255]^SUB_MIX[3][255&s0]^keySchedule[ksRow++],t2=SUB_MIX[0][s2>>>24]^SUB_MIX[1][s3>>>16&255]^SUB_MIX[2][s0>>>8&255]^SUB_MIX[3][255&s1]^keySchedule[ksRow++],t3=SUB_MIX[0][s3>>>24]^SUB_MIX[1][s0>>>16&255]^SUB_MIX[2][s1>>>8&255]^SUB_MIX[3][255&s2]^keySchedule[ksRow++],s0=t0,s1=t1,s2=t2,s3=t3;return t0=(SBOX[s0>>>24]<<24|SBOX[s1>>>16&255]<<16|SBOX[s2>>>8&255]<<8|SBOX[255&s3])^keySchedule[ksRow++],t1=(SBOX[s1>>>24]<<24|SBOX[s2>>>16&255]<<16|SBOX[s3>>>8&255]<<8|SBOX[255&s0])^keySchedule[ksRow++],t2=(SBOX[s2>>>24]<<24|SBOX[s3>>>16&255]<<16|SBOX[s0>>>8&255]<<8|SBOX[255&s1])^keySchedule[ksRow++],t3=(SBOX[s3>>>24]<<24|SBOX[s0>>>16&255]<<16|SBOX[s1>>>8&255]<<8|SBOX[255&s2])^keySchedule[ksRow++],[fixup_uint32(t0),fixup_uint32(t1),fixup_uint32(t2),fixup_uint32(t3)]},exports.AES=AES}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function incr32(iv){for(var item,len=iv.length;len--;){if(255!==(item=iv.readUInt8(len))){item++,iv.writeUInt8(item,len);break}iv.writeUInt8(0,len)}}function getBlock(self){var out=self._cipher.encryptBlock(self._prev);return incr32(self._prev),out}var xor=__webpack_require__(74);exports.encrypt=function(self,chunk){for(;self._cache.length{b.put(this.transform.convert(key),value)},delete:key=>{b.delete(this.transform.convert(key))},commit:callback=>{b.commit(callback)}}}query(q){return pull(this.child.query(q),pull.map(e=>{return e.key=this.transform.invert(e.key),e}))}close(callback){this.child.close(callback)}}module.exports=KeyTransformDatastore},function(module,exports,__webpack_require__){(function(global){module.exports=!1;try{module.exports="[object process]"===Object.prototype.toString.call(global.process)}catch(e){}}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){"use strict";var curve=exports;curve.base=__webpack_require__(402),curve.short=__webpack_require__(405),curve.mont=__webpack_require__(404),curve.edwards=__webpack_require__(403)},function(module,exports,__webpack_require__){"use strict";(function(setImmediate){const protobuf=__webpack_require__(39),Block=__webpack_require__(60),isEqualWith=__webpack_require__(632),assert=__webpack_require__(7),each=__webpack_require__(32),CID=__webpack_require__(12),codecName=__webpack_require__(278),vd=__webpack_require__(824),multihashing=__webpack_require__(30),pbm=protobuf(__webpack_require__(465)),Entry=__webpack_require__(464);class BitswapMessage{constructor(full){this.full=full,this.wantlist=new Map,this.blocks=new Map}get empty(){return 0===this.blocks.size&&0===this.wantlist.size}addEntry(cid,priority,cancel){assert(cid&&CID.isCID(cid),"must be a valid cid");const cidStr=cid.buffer.toString(),entry=this.wantlist.get(cidStr);entry?(entry.priority=priority,entry.cancel=Boolean(cancel)):this.wantlist.set(cidStr,new Entry(cid,priority,cancel))}addBlock(block){assert(Block.isBlock(block),"must be a valid cid");const cidStr=block.cid.buffer.toString();this.blocks.set(cidStr,block)}cancel(cid){assert(CID.isCID(cid),"must be a valid cid");const cidStr=cid.buffer.toString();this.wantlist.delete(cidStr),this.addEntry(cid,0,!0)}serializeToBitswap100(){const msg={wantlist:{entries:Array.from(this.wantlist.values()).map(entry=>{return{block:entry.cid.buffer,priority:Number(entry.priority),cancel:Boolean(entry.cancel)}})},blocks:Array.from(this.blocks.values()).map(block=>block.data)};return this.full&&(msg.wantlist.full=!0),pbm.Message.encode(msg)}serializeToBitswap110(){const msg={wantlist:{entries:Array.from(this.wantlist.values()).map(entry=>{return{block:entry.cid.buffer,priority:Number(entry.priority),cancel:Boolean(entry.cancel)}})},payload:[]};return this.full&&(msg.wantlist.full=!0),this.blocks.forEach(block=>{msg.payload.push({prefix:block.cid.prefix,data:block.data})}),pbm.Message.encode(msg)}equals(other){const cmp=(a,b)=>{if(a.equals&&"function"==typeof a.equals)return a.equals(b)};return!(this.full!==other.full||!isEqualWith(this.wantlist,other.wantlist,cmp)||!isEqualWith(this.blocks,other.blocks,cmp))}get[Symbol.toStringTag](){const list=Array.from(this.wantlist.keys()),blocks=Array.from(this.blocks.keys());return`BitswapMessage `}}BitswapMessage.deserialize=((raw,callback)=>{let decoded;try{decoded=pbm.Message.decode(raw)}catch(err){return setImmediate(()=>callback(err))}const isFull=decoded.wantlist&&decoded.wantlist.full||!1,msg=new BitswapMessage(isFull);return decoded.wantlist&&decoded.wantlist.entries.forEach(entry=>{const cid=new CID(entry.block);msg.addEntry(cid,entry.priority,entry.cancel)}),decoded.blocks.length>0?each(decoded.blocks,(b,cb)=>{multihashing(b,"sha2-256",(err,hash)=>{if(err)return cb(err);const cid=new CID(hash);msg.addBlock(new Block(b,cid)),cb()})},err=>{if(err)return callback(err);callback(null,msg)}):decoded.payload.length>0?each(decoded.payload,(p,cb)=>{p.prefix&&p.data||cb();const values=vd(p.prefix),cidVersion=values[0],multicodec=values[1],hashAlg=values[2];multihashing(p.data,hashAlg,(err,hash)=>{if(err)return cb(err);const cid=new CID(cidVersion,codecName[multicodec.toString("16")],hash);msg.addBlock(new Block(p.data,cid)),cb()})},err=>{if(err)return callback(err);callback(null,msg)}):void callback(null,msg)}),BitswapMessage.Entry=Entry,module.exports=BitswapMessage}).call(exports,__webpack_require__(22).setImmediate)},function(module,exports,__webpack_require__){"use strict";const sort=__webpack_require__(637),Entry=__webpack_require__(466);class Wantlist{constructor(){this.set=new Map}get length(){return this.set.size}add(cid,priority){const cidStr=cid.buffer.toString(),entry=this.set.get(cidStr);entry?(entry.inc(),entry.priority=priority):this.set.set(cidStr,new Entry(cid,priority))}remove(cid){const cidStr=cid.buffer.toString(),entry=this.set.get(cidStr);entry&&(entry.dec(),entry.hasRefs()||this.set.delete(cidStr))}removeForce(cidStr){this.set.has(cidStr)&&this.set.delete(cidStr)}entries(){return this.set.entries()}sortedEntries(){return new Map(sort(Array.from(this.set.entries()),o=>{return o[1].key}))}contains(cid){const cidStr=cid.buffer.toString();return this.set.get(cidStr)}}Wantlist.Entry=Entry,module.exports=Wantlist},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function create(data,dagLinks,hashAlg,callback){if("function"==typeof data?(callback=data,data=void 0):"string"==typeof data&&(data=new Buffer(data)),"function"==typeof dagLinks&&(callback=dagLinks,dagLinks=[]),"function"==typeof hashAlg&&(callback=hashAlg,hashAlg=void 0),!Buffer.isBuffer(data))return callback("Passed 'data' is not a buffer or a string!");hashAlg||(hashAlg="sha2-256");const links=dagLinks.map(l=>{return l.constructor&&"DAGLink"===l.constructor.name?l:new DAGLink(l.name?l.name:l.Name,l.size?l.size:l.Size,l.hash||l.Hash||l.multihash)}),sortedLinks=sort(links,linkSort);serialize({data:data,links:sortedLinks},(err,serialized)=>{if(err)return callback(err);multihashing(serialized,hashAlg,(err,multihash)=>{if(err)return callback(err);callback(null,new DAGNode(data,sortedLinks,serialized,multihash))})})}const multihashing=__webpack_require__(30),sort=__webpack_require__(806),dagPBUtil=__webpack_require__(136),serialize=dagPBUtil.serialize,dagNodeUtil=__webpack_require__(102),linkSort=dagNodeUtil.linkSort,DAGNode=__webpack_require__(135),DAGLink=__webpack_require__(61);module.exports=create}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function cloneData(dagNode){let data;return dagNode.data&&dagNode.data.length>0?(data=new Buffer(dagNode.data.length),dagNode.data.copy(data)):data=new Buffer(0),data}function cloneLinks(dagNode){return dagNode.links.slice()}function linkSort(a,b){const aBuf=new Buffer(a.name||"","ascii"),bBuf=new Buffer(b.name||"","ascii");return aBuf.compare(bBuf)}function toDAGLink(node){return new DAGLink("",node.size,node.multihash)}const DAGLink=__webpack_require__(61);exports=module.exports,exports.cloneData=cloneData,exports.cloneLinks=cloneLinks,exports.linkSort=linkSort,exports.toDAGLink=toDAGLink}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function validate(multihash){if(!Buffer.isBuffer(multihash))throw new Error("multihash must be a Buffer");if(multihash.length<3)throw new Error("multihash too short. must be > 3 bytes.");if(multihash.length>129)throw new Error("multihash too long. must be < 129 bytes.");let code=multihash[0];if(!exports.isValidCode(code))throw new Error(`multihash unknown function code: 0x${code.toString(16)}`);if(multihash.slice(2).length!==multihash[1])throw new Error(`multihash length inconsistent: 0x${multihash.toString("hex")}`)}const bs58=__webpack_require__(24),cs=__webpack_require__(513);exports.toHexString=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return hash.toString("hex")},exports.fromHexString=function(hash){return new Buffer(hash,"hex")},exports.toB58String=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return bs58.encode(hash)},exports.fromB58String=function(hash){let encoded=hash;return Buffer.isBuffer(hash)&&(encoded=hash.toString()),new Buffer(bs58.decode(encoded))},exports.decode=function(buf){exports.validate(buf);const code=buf[0];return{code:code,name:cs.codes[code],length:buf[1],digest:buf.slice(2)}},exports.encode=function(digest,code,length){if(!digest||!code)throw new Error("multihash encode requires at least two args: digest, code");const hashfn=exports.coerceCode(code);if(!Buffer.isBuffer(digest))throw new Error("digest should be a Buffer");if(null==length&&(length=digest.length),length&&digest.length!==length)throw new Error("digest length should be equal to specified length.");if(length>127)throw new Error("multihash does not yet support digest lengths greater than 127 bytes.");return Buffer.concat([new Buffer([hashfn,length]),digest])},exports.coerceCode=function(name){let code=name;if("string"==typeof name){if(!cs.names[name])throw new Error(`Unrecognized hash function named: ${name}`);code=cs.names[name]}if("number"!=typeof code)throw new Error(`Hash function code should be a number. Got: ${code}`);if(!cs.codes[code]&&!exports.isAppCode(code))throw new Error(`Unrecognized function code: ${code}`);return code},exports.isAppCode=function(code){return code>0&&code<16},exports.isValidCode=function(code){return!!exports.isAppCode(code)||!!cs.codes[code]},exports.validate=validate,exports.prefix=function(multihash){return validate(multihash),multihash.slice(0,2)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const rlp=__webpack_require__(52),TrieNode=__webpack_require__(276),cidForHash=__webpack_require__(77).cidForHash;exports.deserialize=function(data,callback){let deserialized;try{let rawNode=rlp.decode(data);deserialized=new TrieNode(rawNode)}catch(err){return callback(err)}callback(null,deserialized)},exports.serialize=function(trieNode,callback){let serialized;try{serialized=trieNode.serialize()}catch(err){return callback(err)}callback(null,serialized)},exports.cid=function(trieIpldFormat,tx,callback){let cid;try{cid=cidForHash(trieIpldFormat,tx.hash())}catch(err){return callback(err)}callback(null,cid)}},function(module,exports,__webpack_require__){var createError=__webpack_require__(417).create,LevelUPError=createError("LevelUPError"),NotFoundError=createError("NotFoundError",LevelUPError);NotFoundError.prototype.notFound=!0,NotFoundError.prototype.status=404,module.exports={LevelUPError:LevelUPError,InitializationError:createError("InitializationError",LevelUPError),OpenError:createError("OpenError",LevelUPError),ReadError:createError("ReadError",LevelUPError),WriteError:createError("WriteError",LevelUPError),NotFoundError:NotFoundError,EncodingError:createError("EncodingError",LevelUPError)}},function(module,exports,__webpack_require__){"use strict";module.exports=function(){if("undefined"!=typeof self&&(__webpack_require__(329)(self),self.crypto))return self.crypto;if("undefined"!=typeof self&&(__webpack_require__(329)(self),self.crypto))return self.crypto;throw new Error("Please use an environment with crypto support")}},function(module,exports,__webpack_require__){"use strict";const multistream=__webpack_require__(152);module.exports=function(protocols,conn){const ms=new multistream.Listener;Object.keys(protocols).forEach(protocol=>{protocol&&ms.addHandler(protocol,protocols[protocol].handlerFunc,protocols[protocol].matchFunc)}),ms.handle(conn,err=>{})}},function(module,exports,__webpack_require__){(function(process){function useColors(){return!("undefined"==typeof window||!window||void 0===window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document&&"WebkitAppearance"in document.documentElement.style||"undefined"!=typeof window&&window&&window.console&&(console.firebug||console.exception&&console.table)||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(args){var useColors=this.useColors;if(args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff),useColors){var c="color: "+this.color;args.splice(1,0,c,"color: inherit");var index=0,lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){"%%"!==match&&(index++,"%c"===match&&(lastC=index))}),args.splice(lastC,0,c)}}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{null==namespaces?exports.storage.removeItem("debug"):exports.storage.debug=namespaces}catch(e){}}function load(){var r;try{r=exports.storage.debug}catch(e){}return!r&&void 0!==process&&"env"in process&&(r=process.env.DEBUG),r}exports=module.exports=__webpack_require__(619),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],exports.formatters.j=function(v){try{return JSON.stringify(v)}catch(err){return"[UnexpectedJSONParseError]: "+err.message}},exports.enable(load())}).call(exports,__webpack_require__(2))},function(module,exports){var isArray=Array.isArray;module.exports=isArray},function(module,exports,__webpack_require__){"use strict";function and(){function matches(a){"string"==typeof a&&(a=multiaddr(a));let out=partialMatch(a.protoNames());return null!==out&&0===out.length}function partialMatch(a){return a.lengthor(and(_Circuit,CircuitRecursive),_Circuit),Circuit=CircuitRecursive(),IPFS=or(and(Circuit,_IPFS,Circuit),and(_IPFS,Circuit),and(Circuit,_IPFS),Circuit,_IPFS);exports.DNS=DNS,exports.DNS4=DNS4,exports.DNS6=DNS6,exports.IP=IP,exports.TCP=TCP,exports.UDP=UDP,exports.UTP=UTP,exports.HTTP=HTTP,exports.WebSockets=WebSockets,exports.WebSocketsSecure=WebSocketsSecure,exports.WebRTCStar=WebRTCStar,exports.WebRTCDirect=WebRTCDirect,exports.Reliable=Reliable,exports.Circuit=Circuit,exports.IPFS=IPFS},function(module,exports){function assert(val,msg){if(!val)throw new Error(msg||"Assertion failed")}module.exports=assert,assert.equal=function(l,r,msg){if(l!=r)throw new Error(msg||"Assertion failed: "+l+" != "+r)}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function randomId(){return(~~(1e9*Math.random())).toString(36)}function encode(msg,callback){const values=Buffer.isBuffer(msg)?[msg]:[new Buffer(msg)];pull(pull.values(values),pullLP.encode(),pull.collect((err,encoded)=>{if(err)return callback(err);callback(null,encoded[0])}))}function createLogger(type){function printer(logger){return msg=>{Array.isArray(msg)&&(msg=msg.join(" ")),logger("(%s) %s",rId,msg)}}const rId=randomId(),log=printer(debug("mss:"+type));return log.error=printer(debug("mss:"+type+":error")),log}const pull=__webpack_require__(5),pullLP=__webpack_require__(28),debug=__webpack_require__(3);exports=module.exports,exports.writeEncoded=((writer,msg,callback)=>{encode(msg,(err,msg)=>{if(err)return callback(err);writer.write(msg)})}),exports.log={},exports.log.dialer=(()=>{return createLogger("dialer\t")}),exports.log.listener=(()=>{return createLogger("listener\t")})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function OffsetBuffer(){this.offset=0,this.size=0,this.buffers=[]}function signedInt8(num){return num>=128?-(255^num)-1:num}function signedInt16(num){return num>=32768?-(65535^num)-1:num}function signedInt24(num){return num>=8388608?-(16777215^num)-1:num}function signedInt32(num){return num>=2147483648?-(4294967295^num)-1:num}var Buffer=__webpack_require__(0).Buffer;module.exports=OffsetBuffer,OffsetBuffer.prototype.isEmpty=function(){return 0===this.size},OffsetBuffer.prototype.clone=function(size){var r=new OffsetBuffer;return r.offset=this.offset,r.size=size,r.buffers=this.buffers.slice(),r},OffsetBuffer.prototype.toChunks=function(){if(0===this.size)return[];0!==this.offset&&(this.buffers[0]=this.buffers[0].slice(this.offset),this.offset=0);for(var chunks=[],off=0,i=0;off<=this.size&&ithis.size&&(buf=buf.slice(0,buf.length-(off-this.size)),this.buffers[i]=buf),chunks.push(buf)}return i=n},OffsetBuffer.prototype.skip=function(n){if(0!==this.size){if(this.size-=n,this.offset+n0&&shiftleft){this.offset=left;break}left-=buf.length}this.buffers=this.buffers.slice(shift)}},OffsetBuffer.prototype.copy=function(target,targetOff,off,n){if(0!==this.size){if(0!==off)throw new Error("Unsupported offset in .copy()");var toff=targetOff,first=this.buffers[0],toCopy=Math.min(n,first.length-this.offset);first.copy(target,toff,this.offset,this.offset+toCopy),toff+=toCopy;for(var left=n-toCopy,i=1;left>0&&in){var r=this.buffers[0].slice(this.offset,this.offset+n);return this.offset+=n,r}for(var out=new Buffer(n),toOff=0,startOff=this.offset,i=0;toOff!==n&&i=2?(r=first.readUInt16LE(this.offset,!0),shift=0,this.offset+=2):(r=first[this.offset]|this.buffers[1][0]<<8,shift=1,this.offset=1),this.offset===this.buffers[shift].length&&(this.offset=0,shift++),0!==shift&&(this.buffers=this.buffers.slice(shift)),r},OffsetBuffer.prototype.readUInt24LE=function(){var r,shift,first=this.buffers[0],firstHas=first.length-this.offset;if(firstHas>=3)r=first.readUInt16LE(this.offset,!0)|first[this.offset+2]<<16,shift=0,this.offset+=3;else{if(!(firstHas>=2))return r=first[this.offset],this.offset=0,this.buffers.shift(),this.size-=1,r|=this.readUInt16LE()<<8;r=first.readUInt16LE(this.offset,!0)|this.buffers[1][0]<<16,shift=1,this.offset=1}return this.size-=3,this.offset===this.buffers[shift].length&&(this.offset=0,shift++),0!==shift&&(this.buffers=this.buffers.slice(shift)),r},OffsetBuffer.prototype.readUInt32LE=function(){var r,shift,first=this.buffers[0],firstHas=first.length-this.offset;if(firstHas>=4)r=first.readUInt32LE(this.offset,!0),shift=0,this.offset+=4;else{if(!(firstHas>=3))return firstHas>=2?(r=first.readUInt16LE(this.offset,!0),this.offset=0,this.buffers.shift(),this.size-=2,r+=65536*this.readUInt16LE()):(r=first[this.offset],this.offset=0,this.buffers.shift(),this.size-=1,r+=256*this.readUInt24LE());r=(first.readUInt16LE(this.offset,!0)|first[this.offset+2]<<16)+16777216*this.buffers[1][0],shift=1,this.offset=1}return this.size-=4,this.offset===this.buffers[shift].length&&(this.offset=0,shift++),0!==shift&&(this.buffers=this.buffers.slice(shift)),r},OffsetBuffer.prototype.readUInt16BE=function(){var r=this.readUInt16LE();return(255&r)<<8|r>>8},OffsetBuffer.prototype.readUInt24BE=function(){var r=this.readUInt24LE();return(255&r)<<16|(r>>8&255)<<8|r>>16},OffsetBuffer.prototype.readUInt32BE=function(){var r=this.readUInt32LE();return((255&r)<<24|(r>>>8&255)<<16|(r>>>16&255)<<8|r>>>24)>>>0},OffsetBuffer.prototype.peekInt8=function(){return signedInt8(this.peekUInt8())},OffsetBuffer.prototype.readInt8=function(){return signedInt8(this.readUInt8())},OffsetBuffer.prototype.readInt16BE=function(){return signedInt16(this.readUInt16BE())},OffsetBuffer.prototype.readInt16LE=function(){return signedInt16(this.readUInt16LE())},OffsetBuffer.prototype.readInt24BE=function(){return signedInt24(this.readUInt24BE())},OffsetBuffer.prototype.readInt24LE=function(){return signedInt24(this.readUInt24LE())},OffsetBuffer.prototype.readInt32BE=function(){return signedInt32(this.readUInt32BE())},OffsetBuffer.prototype.readInt32LE=function(){return signedInt32(this.readUInt32LE())}},function(module,exports,__webpack_require__){"use strict";var TYPED_OK="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;exports.assign=function(obj){for(var sources=Array.prototype.slice.call(arguments,1);sources.length;){var source=sources.shift();if(source){if("object"!=typeof source)throw new TypeError(source+"must be non-object");for(var p in source)source.hasOwnProperty(p)&&(obj[p]=source[p])}}return obj},exports.shrinkBuf=function(buf,size){return buf.length===size?buf:buf.subarray?buf.subarray(0,size):(buf.length=size,buf)};var fnTyped={ +arraySet:function(dest,src,src_offs,len,dest_offs){if(src.subarray&&dest.subarray)return void dest.set(src.subarray(src_offs,src_offs+len),dest_offs);for(var i=0;i>>2,bn.words[2]=(63&b32[22])<<20|b32[23]<<12|b32[24]<<4|b32[25]>>>4,bn.words[3]=(255&b32[19])<<18|b32[20]<<10|b32[21]<<2|b32[22]>>>6,bn.words[4]=(3&b32[15])<<24|b32[16]<<16|b32[17]<<8|b32[18],bn.words[5]=(15&b32[12])<<22|b32[13]<<14|b32[14]<<6|b32[15]>>>2,bn.words[6]=(63&b32[9])<<20|b32[10]<<12|b32[11]<<4|b32[12]>>>4,bn.words[7]=(255&b32[6])<<18|b32[7]<<10|b32[8]<<2|b32[9]>>>6,bn.words[8]=(3&b32[2])<<24|b32[3]<<16|b32[4]<<8|b32[5],bn.words[9]=b32[0]<<14|b32[1]<<6|b32[2]>>>2,bn.length=10,bn.strip()},BN.prototype.toBuffer=function(){for(var w=this.words,i=this.length;i<10;++i)w[i]=0;return new Buffer([w[9]>>>14&255,w[9]>>>6&255,(63&w[9])<<2|w[8]>>>24&3,w[8]>>>16&255,w[8]>>>8&255,255&w[8],w[7]>>>18&255,w[7]>>>10&255,w[7]>>>2&255,(3&w[7])<<6|w[6]>>>20&63,w[6]>>>12&255,w[6]>>>4&255,(15&w[6])<<4|w[5]>>>22&15,w[5]>>>14&255,w[5]>>>6&255,(63&w[5])<<2|w[4]>>>24&3,w[4]>>>16&255,w[4]>>>8&255,255&w[4],w[3]>>>18&255,w[3]>>>10&255,w[3]>>>2&255,(3&w[3])<<6|w[2]>>>20&63,w[2]>>>12&255,w[2]>>>4&255,(15&w[2])<<4|w[1]>>>22&15,w[1]>>>14&255,w[1]>>>6&255,(63&w[1])<<2|w[0]>>>24&3,w[0]>>>16&255,w[0]>>>8&255,255&w[0]])},BN.prototype.clone=function(){var r=new BN;r.words=new Array(this.length);for(var i=0;i1&&0==(0|this.words[this.length-1]);)this.length--;return this},BN.prototype.normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.isEven=function(){return 0==(1&this.words[0])},BN.prototype.isOdd=function(){return 1==(1&this.words[0])},BN.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},BN.prototype.ucmp=function(num){if(this.length!==num.length)return this.length>num.length?1:-1;for(var i=this.length-1;i>=0;--i)if(this.words[i]!==num.words[i])return this.words[i]>num.words[i]?1:-1;return 0},BN.prototype.gtOne=function(){return this.length>1||this.words[0]>1},BN.prototype.isOverflow=function(){return this.ucmp(BN.n)>=0},BN.prototype.isHigh=function(){return 1===this.ucmp(BN.nh)},BN.prototype.bitLengthGT256=function(){return this.length>10||10===this.length&&this.words[9]>4194303},BN.prototype.iuaddn=function(num){this.words[0]+=num;for(var i=0;this.words[i]>67108863&&inum.length?(a=this,b=num):(a=num,b=this);for(var i=0,carry=0;i>>26}for(;0!==carry&&i>>26;if(this.length=a.length,0!==carry)this.words[this.length++]=carry;else if(a!==this)for(;i0?(a=this,b=num):(a=num,b=this);for(var i=0,carry=0;i>26,this.words[i]=67108863&word}for(;0!==carry&&i>26,this.words[i]=67108863&word;if(0===carry&&i>>26,rword=67108863&carry,j=Math.max(0,k-num1.length+1),maxJ=Math.min(k,num2.length-1);j<=maxJ;j++){var i=k-j,a=num1.words[i],b=num2.words[j],r=a*b+rword;ncarry+=r/67108864|0,rword=67108863&r}out.words[k]=rword,carry=ncarry}return 0!==carry&&(out.words[out.length++]=carry),out.strip()},BN.umulTo10x10=Math.imul?optimized.umulTo10x10:BN.umulTo,BN.umulnTo=function(num,k,out){if(0===k)return out.words=[0],out.length=1,out;for(var i=0,carry=0;i0?(out.words[i]=carry,out.length=num.length+1):out.length=num.length,out},BN.prototype.umul=function(num){var out=new BN;return out.words=new Array(this.length+num.length),10===this.length&&10===num.length?BN.umulTo10x10(this,num,out):1===this.length?BN.umulnTo(num,this.words[0],out):1===num.length?BN.umulnTo(this,num.words[0],out):BN.umulTo(this,num,out)},BN.prototype.isplit=function(output){output.length=Math.min(this.length,9);for(var i=0;i>>22,prev=word}return prev>>>=22,this.words[i-10]=prev,0===prev&&this.length>10?this.length-=10:this.length-=9,this},BN.prototype.fireduce=function(){return this.isOverflow()&&this.isub(BN.n),this},BN.prototype.ureduce=function(){var num=this.clone().isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp);return num.bitLengthGT256()&&(num=num.isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp),num.bitLengthGT256()&&(num=num.isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp))),num.fireduce()},BN.prototype.ishrn=function(n){for(var mask=(1<=0;--i){var word=this.words[i];this.words[i]=carry<>>n,carry=word&mask}return this.length>1&&0===this.words[this.length-1]&&(this.length-=1),this},BN.prototype.uinvm=function(){for(var x=this.clone(),y=BN.n.clone(),A=BN.fromNumber(1),B=BN.fromNumber(0),C=BN.fromNumber(0),D=BN.fromNumber(1);x.isEven()&&y.isEven();){for(var k=1,m=1;0==(x.words[0]&m)&&0==(y.words[0]&m)&&k<26;++k,m<<=1);x.ishrn(k),y.ishrn(k)}for(var yp=y.clone(),xp=x.clone();!x.isZero();){for(var i=0,im=1;0==(x.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(x.ishrn(i);i-- >0;)(A.isOdd()||B.isOdd())&&(A.iadd(yp),B.isub(xp)),A.ishrn(1),B.ishrn(1);for(var j=0,jm=1;0==(y.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(y.ishrn(j);j-- >0;)(C.isOdd()||D.isOdd())&&(C.iadd(yp),D.isub(xp)),C.ishrn(1),D.ishrn(1);x.ucmp(y)>=0?(x.isub(y),A.isub(C),B.isub(D)):(y.isub(x),C.isub(A),D.isub(B))}if(1===C.negative){C.negative=0;var result=C.ureduce();return result.negative^=1,result.normSign().iadd(BN.n)}return C.ureduce()},BN.prototype.imulK=function(){this.words[this.length]=0,this.words[this.length+1]=0,this.length+=2;for(var i=0,lo=0;i0?this.isub(BN.p):this.strip(),this},BN.prototype.redNeg=function(){return this.isZero()?BN.fromNumber(0):BN.p.sub(this)},BN.prototype.redAdd=function(num){return this.clone().redIAdd(num)},BN.prototype.redIAdd=function(num){return this.iadd(num),this.ucmp(BN.p)>=0&&this.isub(BN.p),this},BN.prototype.redIAdd7=function(){return this.iuaddn(7),this.ucmp(BN.p)>=0&&this.isub(BN.p),this},BN.prototype.redSub=function(num){return this.clone().redISub(num)},BN.prototype.redISub=function(num){return this.isub(num),0!==this.negative&&this.iadd(BN.p),this},BN.prototype.redMul=function(num){return this.umul(num).redIReduce()},BN.prototype.redSqr=function(){return this.umul(this).redIReduce()},BN.prototype.redSqrt=function(){if(this.isZero())return this.clone();for(var wv2=this.redSqr(),wv4=wv2.redSqr(),wv12=wv4.redSqr().redMul(wv4),wv14=wv12.redMul(wv2),wv15=wv14.redMul(this),out=wv15,i=0;i<54;++i)out=out.redSqr().redSqr().redSqr().redSqr().redMul(wv15);for(out=out.redSqr().redSqr().redSqr().redSqr().redMul(wv14),i=0;i<5;++i)out=out.redSqr().redSqr().redSqr().redSqr().redMul(wv15);return out=out.redSqr().redSqr().redSqr().redSqr().redMul(wv12),out=out.redSqr().redSqr().redSqr().redSqr().redSqr().redSqr().redMul(wv12),0===out.redSqr().ucmp(this)?out:null},BN.prototype.redInvm=function(){for(var a=this.clone(),b=BN.p.clone(),x1=BN.fromNumber(1),x2=BN.fromNumber(0);a.gtOne()&&b.gtOne();){for(var i=0,im=1;0==(a.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(a.ishrn(i);i-- >0;)x1.isOdd()&&x1.iadd(BN.p),x1.ishrn(1);for(var j=0,jm=1;0==(b.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(b.ishrn(j);j-- >0;)x2.isOdd()&&x2.iadd(BN.p),x2.ishrn(1);a.ucmp(b)>=0?(a.isub(b),x1.isub(x2)):(b.isub(a),x2.isub(x1))}var res;return res=1===a.length&&1===a.words[0]?x1:x2,0!==res.negative&&res.iadd(BN.p),0!==res.negative?(res.negative=0,res.redIReduce().redNeg()):res.redIReduce()},BN.prototype.getNAF=function(w){for(var naf=[],ws=1<>1,k=this.clone();!k.isZero();){for(var i=0,m=1;0==(k.words[0]&m)&&i<26;++i,m<<=1)naf.push(0);if(0!==i)k.ishrn(i);else{var mod=k.words[0]&wsm1;if(mod>=ws2)naf.push(ws2-mod),k.iuaddn(mod-ws2).ishrn(1);else if(naf.push(mod),k.words[0]-=mod,!k.isZero()){for(i=w-1;i>0;--i)naf.push(0);k.ishrn(w)}}}return naf},BN.prototype.inspect=function(){if(this.isZero())return"0";for(var buffer=this.toBuffer().toString("hex"),i=0;"0"===buffer[i];++i);return buffer.slice(i)},BN.n=BN.fromBuffer(new Buffer("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","hex")),BN.nh=BN.n.clone().ishrn(1),BN.nc=BN.fromBuffer(new Buffer("000000000000000000000000000000014551231950B75FC4402DA1732FC9BEBF","hex")),BN.p=BN.fromBuffer(new Buffer("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","hex")),BN.psn=BN.p.sub(BN.n),BN.tmp=new BN,BN.tmp.words=new Array(10),function(){BN.fromNumber(1).words[3]=0}(),module.exports=BN}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.name="h2",exports.constants=__webpack_require__(793),exports.parser=__webpack_require__(796),exports.framer=__webpack_require__(794),exports.compressionPool=__webpack_require__(795)},function(module,exports,__webpack_require__){(function(process){function destroy(stream,cb){function onClose(){cleanup(),cb()}function onError(err){cleanup(),cb(err)}function cleanup(){stream.removeListener("close",onClose),stream.removeListener("error",onError)}stream.on("close",onClose),stream.on("error",onError)}function destroy(stream){stream.destroy?stream.destroy():console.error("warning, stream-to-pull-stream: \nthe wrapped node-stream does not implement `destroy`, \nthis may cause resource leaks.")}function write(read,stream,cb){function done(){did||(did=!0,cb&&cb(ended===!0?null:ended))}function onClose(){closed||(closed=!0,cleanup(),ended?done():read(ended=!0,done))}function onError(err){cleanup(),ended||read(ended=err,done)}function cleanup(){stream.on("finish",onClose),stream.removeListener("close",onClose),stream.removeListener("error",onError)}var ended,did,closed=!1;stream.on("close",onClose),stream.on("finish",onClose),stream.on("error",onError),process.nextTick(function(){looper(function(next){read(null,function(end,data){if(ended=ended||end,end===!0)return stream._isStdio?done():stream.end();if(ended=ended||end)return destroy(stream),done(ended);if(stream._isStdio)stream.write(data,function(){next()});else{stream.write(data)===!1?stream.once("drain",next):next()}})})})}function read2(stream){function read(){var data=stream.read();if(null!==data&&_cb){var cb=_cb;_cb=null,cb(null,data)}}var _cb,ended=!1,waiting=!1;return stream.on("readable",function(){waiting=!0,_cb&&read()}).on("end",function(){ended=!0,_cb&&_cb(ended)}).on("error",function(err){ended=err,_cb&&_cb(ended)}),function(end,cb){_cb=cb,ended?cb(ended):waiting&&read()}}function read1(stream){function drain(){for(;(buffer.length||ended)&&cbs.length;)cbs.shift()(buffer.length?null:ended,buffer.shift());!buffer.length&&paused&&(paused=!1,stream.resume())}var ended,buffer=[],cbs=[],paused=!1;return stream.on("data",function(data){buffer.push(data),drain(),buffer.length&&stream.pause&&(paused=!0,stream.pause())}),stream.on("end",function(){ended=!0,drain()}),stream.on("close",function(){ended=!0,drain()}),stream.on("error",function(err){ended=err,drain()}),function(abort,cb){function onAbort(){for(;cbs.length;)cbs.shift()(abort);cb(abort)}if(!cb)throw new Error("*must* provide cb");if(abort){if(ended)return onAbort();stream.once("close",onAbort),destroy(stream)}else cbs.push(cb),drain()}}var looper=(__webpack_require__(299),__webpack_require__(271)),read=read1,sink=function(stream,cb){return function(read){return write(read,stream,cb)}},source=function(stream){return read1(stream)};exports=module.exports=function(stream,cb){return stream.writable&&stream.write?stream.readable?function(_read){return write(_read,stream,cb),read1(stream)}:sink(stream,cb):source(stream)},exports.sink=sink,exports.source=source,exports.read=read,exports.read1=read1,exports.read2=read2,exports.duplex=function(stream,cb){return{source:source(stream),sink:sink(stream,cb)}},exports.transform=function(stream){return function(read){var _source=source(stream);return sink(stream)(read),_source}}}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){function v4(options,buf,offset){var i=buf&&offset||0;"string"==typeof options&&(buf="binary"==options?new Array(16):null,options=null),options=options||{};var rnds=options.random||(options.rng||rng)();if(rnds[6]=15&rnds[6]|64,rnds[8]=63&rnds[8]|128,buf)for(var ii=0;ii<16;++ii)buf[i+ii]=rnds[ii];return buf||bytesToUuid(rnds)}var rng=__webpack_require__(823),bytesToUuid=__webpack_require__(822);module.exports=v4},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function eachOfArrayLike(coll,iteratee,callback){function iteratorCallback(err,value){err?callback(err):++completed!==length&&value!==_breakLoop2.default||callback(null)}callback=(0,_once2.default)(callback||_noop2.default);var index=0,completed=0,length=coll.length;for(0===length&&callback(null);index>2,mant=(3&buf[0])<<8|buf[1],exp?31===exp?sign*(mant?NaN:Infinity):sign*Math.pow(2,exp-25)*(1024+mant):5.960464477539063e-8*sign*mant},exports.arrayBufferToBignumber=function(buf){const len=buf.byteLength;let res="";for(let i=0;i{const res=new Map,keys=Object.keys(obj),length=keys.length;for(let i=0;i{return f*SHIFT16+g}),exports.buildInt64=((f1,f2,g1,g2)=>{const f=exports.buildInt32(f1,f2),g=exports.buildInt32(g1,g2);return f>2097151?new Bignumber(f).times(SHIFT32).plus(g):f*SHIFT32+g}),exports.writeHalf=function(buf,half){const u32=new Buffer(4);u32.writeFloatBE(half,0);const u=u32.readUInt32BE(0);if(0!=(8191&u))return!1;var s16=u>>16&32768;const exp=u>>23&255,mant=8388607&u;if(exp>=113&&exp<=142)s16+=(exp-112<<10)+(mant>>13);else{if(!(exp>=103&&exp<113))return!1;if(mant&(1<<126-exp)-1)return!1;s16+=mant+8388608>>126-exp}return buf.writeUInt16BE(s16,0),!0},exports.keySorter=function(a,b){var lenA=a[0].byteLength,lenB=b[0].byteLength;return lenA>lenB?1:lenB>lenA?-1:a[0].compare(b[0])},exports.isNegativeZero=(x=>{return 0===x&&1/x<0}),exports.nextPowerOf2=(n=>{let count=0;if(n&&!(n&n-1))return n;for(;0!==n;)n>>=1,count+=1;return 1<>5]|=128<>>9<<4)]=len;for(var a=1732584193,b=-271733879,c=-1732584194,d=271733878,i=0;i>16)+(y>>16)+(lsw>>16)<<16|65535&lsw}function bit_rol(num,cnt){return num<>>32-cnt}var makeHash=__webpack_require__(382);module.exports=function(buf){return makeHash(buf,core_md5)}},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(5),Source=__webpack_require__(83),path=__webpack_require__(45),os=__webpack_require__(153),uuid=__webpack_require__(121);exports.asyncFilter=function(test){let abortCb,aborted,busy=!1;return function(read){return function next(abort,cb){if(aborted)return cb(aborted);abort?(aborted=abort,busy?read(abort,()=>{busy?abortCb=cb:cb(abort)}):read(abort,cb)):read(null,(end,data)=>{end?cb(end):aborted?cb(aborted):(busy=!0,test(data,(err,valid)=>{busy=!1,aborted?(cb(aborted),abortCb(aborted)):err?next(err,cb):valid?cb(null,data):next(null,cb)}))})}}},exports.asyncSort=function(sorter){const source=Source(),sink=pull.collect((err,ary)=>{if(err)return source.abort(err);sorter(ary,(err,res)=>{if(err)return source.abort(err);source.resolve(pull.values(ary))})});return function(read){return sink(read),source}},exports.replaceStartWith=function(s,r){const matcher=new RegExp("^"+r);return s.replace(matcher,"")},exports.tmpdir=(()=>{return path.join(os.tmpdir(),uuid())})},function(module,exports){var indexOf=[].indexOf;module.exports=function(arr,obj){if(indexOf)return arr.indexOf(obj);for(var i=0;i{busy?abortCb=cb:cb(abort)}):read(abort,cb)):read(null,(end,data)=>{end?cb(end):aborted?cb(aborted):(busy=!0,test(data,(err,valid)=>{busy=!1,aborted?(cb(aborted),abortCb(aborted)):err?next(err,cb):valid?cb(null,data):next(null,cb)}))})}}},exports.asyncSort=function(sorter){const source=Source(),sink=pull.collect((err,ary)=>{if(err)return source.abort(err);sorter(ary,(err,res)=>{if(err)return source.abort(err);source.resolve(pull.values(ary))})});return function(read){return sink(read),source}},exports.replaceStartWith=function(s,r){const matcher=new RegExp("^"+r);return s.replace(matcher,"")},exports.tmpdir=(()=>{return path.join(os.tmpdir(),uuid())})},function(module,exports,__webpack_require__){"use strict";module.exports={maxProvidersPerRequest:3,providerRequestTimeout:1e4,hasBlockTimeout:15e3,provideTimeout:15e3,kMaxPriority:Math.pow(2,31)-1,rebroadcastDelay:1e4,maxListeners:1e3}},function(module,exports,__webpack_require__){"use strict";module.exports=class Dir{}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(17),assert=__webpack_require__(7);class DAGNode{constructor(data,links,serialized,multihash){assert(serialized,"DAGNode needs its serialized format"),assert(multihash,"DAGNode needs its multihash"),"string"==typeof multihash&&(multihash=mh.fromB58String(multihash)),this._data=data||new Buffer(0),this._links=links||[],this._serialized=serialized,this._multihash=multihash,this._size=this.links.reduce((sum,l)=>sum+l.size,this.serialized.length),this._json={data:this.data,links:this.links.map(l=>l.toJSON()),multihash:mh.toB58String(this.multihash),size:this.size}}toJSON(){return this._json}toString(){return`DAGNode <${mh.toB58String(this.multihash)} - data: "${this.data.toString()}", links: ${this.links.length}, size: ${this.size}>`}get data(){return this._data}set data(data){throw new Error("Can't set property: 'data' is immutable")}get links(){return this._links}set links(links){ +throw new Error("Can't set property: 'links' is immutable")}get serialized(){return this._serialized}set serialized(serialized){throw new Error("Can't set property: 'serialized' is immutable")}get size(){return this._size}set size(size){throw new Error("Can't set property: 'size' is immutable")}get multihash(){return this._multihash}set multihash(multihash){throw new Error("Can't set property: 'multihash' is immutable")}}exports=module.exports=DAGNode,exports.create=__webpack_require__(101),exports.clone=__webpack_require__(503),exports.addLink=__webpack_require__(502),exports.rmLink=__webpack_require__(504)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function cid(node,callback){if(node.multihash)return callback(null,new CID(node.multihash));callback(new Error("not valid dagPB node"))}function serialize(node,callback){let serialized;try{const pb=toProtoBuf(node);serialized=proto.PBNode.encode(pb)}catch(err){return callback(err)}callback(null,serialized)}function deserialize(data,callback){const pbn=proto.PBNode.decode(data),links=pbn.Links.map(link=>{return new DAGLink(link.Name,link.Tsize,link.Hash)}),buf=pbn.Data||new Buffer(0);DAGNode.create(buf,links,callback)}function toProtoBuf(node){const pbn={};return node.data&&node.data.length>0?pbn.Data=node.data:pbn.Data=null,node.links&&node.links.length>0?pbn.Links=node.links.map(link=>{return{Hash:link.multihash,Name:link.name,Tsize:link.size}}):pbn.Links=null,pbn}const CID=__webpack_require__(500),protobuf=__webpack_require__(39),proto=protobuf(__webpack_require__(505)),DAGLink=__webpack_require__(61),DAGNode=__webpack_require__(135);exports=module.exports,exports.serialize=serialize,exports.deserialize=deserialize,exports.cid=cid}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function validate(multihash){if(!Buffer.isBuffer(multihash))throw new Error("multihash must be a Buffer");if(multihash.length<3)throw new Error("multihash too short. must be > 3 bytes.");if(multihash.length>129)throw new Error("multihash too long. must be < 129 bytes.");let code=multihash[0];if(!exports.isValidCode(code))throw new Error(`multihash unknown function code: 0x${code.toString(16)}`);if(multihash.slice(2).length!==multihash[1])throw new Error(`multihash length inconsistent: 0x${multihash.toString("hex")}`)}const bs58=__webpack_require__(24),cs=__webpack_require__(508);exports.toHexString=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return hash.toString("hex")},exports.fromHexString=function(hash){return new Buffer(hash,"hex")},exports.toB58String=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return bs58.encode(hash)},exports.fromB58String=function(hash){let encoded=hash;return Buffer.isBuffer(hash)&&(encoded=hash.toString()),new Buffer(bs58.decode(encoded))},exports.decode=function(buf){exports.validate(buf);const code=buf[0];return{code:code,name:cs.codes[code],length:buf[1],digest:buf.slice(2)}},exports.encode=function(digest,code,length){if(!digest||!code)throw new Error("multihash encode requires at least two args: digest, code");const hashfn=exports.coerceCode(code);if(!Buffer.isBuffer(digest))throw new Error("digest should be a Buffer");if(null==length&&(length=digest.length),length&&digest.length!==length)throw new Error("digest length should be equal to specified length.");if(length>127)throw new Error("multihash does not yet support digest lengths greater than 127 bytes.");return Buffer.concat([new Buffer([hashfn,length]),digest])},exports.coerceCode=function(name){let code=name;if("string"==typeof name){if(!cs.names[name])throw new Error(`Unrecognized hash function named: ${name}`);code=cs.names[name]}if("number"!=typeof code)throw new Error(`Hash function code should be a number. Got: ${code}`);if(!cs.codes[code]&&!exports.isAppCode(code))throw new Error(`Unrecognized function code: ${code}`);return code},exports.isAppCode=function(code){return code>0&&code<16},exports.isValidCode=function(code){return!!exports.isAppCode(code)||!!cs.codes[code]},exports.validate=validate,exports.prefix=function(multihash){return validate(multihash),multihash.slice(0,2)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function validate(multihash){if(!Buffer.isBuffer(multihash))throw new Error("multihash must be a Buffer");if(multihash.length<3)throw new Error("multihash too short. must be > 3 bytes.");if(multihash.length>129)throw new Error("multihash too long. must be < 129 bytes.");let code=multihash[0];if(!exports.isValidCode(code))throw new Error(`multihash unknown function code: 0x${code.toString(16)}`);if(multihash.slice(2).length!==multihash[1])throw new Error(`multihash length inconsistent: 0x${multihash.toString("hex")}`)}const bs58=__webpack_require__(24),cs=__webpack_require__(528);exports.toHexString=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return hash.toString("hex")},exports.fromHexString=function(hash){return new Buffer(hash,"hex")},exports.toB58String=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return bs58.encode(hash)},exports.fromB58String=function(hash){let encoded=hash;return Buffer.isBuffer(hash)&&(encoded=hash.toString()),new Buffer(bs58.decode(encoded))},exports.decode=function(buf){exports.validate(buf);const code=buf[0];return{code:code,name:cs.codes[code],length:buf[1],digest:buf.slice(2)}},exports.encode=function(digest,code,length){if(!digest||!code)throw new Error("multihash encode requires at least two args: digest, code");const hashfn=exports.coerceCode(code);if(!Buffer.isBuffer(digest))throw new Error("digest should be a Buffer");if(null==length&&(length=digest.length),length&&digest.length!==length)throw new Error("digest length should be equal to specified length.");if(length>127)throw new Error("multihash does not yet support digest lengths greater than 127 bytes.");return Buffer.concat([new Buffer([hashfn,length]),digest])},exports.coerceCode=function(name){let code=name;if("string"==typeof name){if(!cs.names[name])throw new Error(`Unrecognized hash function named: ${name}`);code=cs.names[name]}if("number"!=typeof code)throw new Error(`Hash function code should be a number. Got: ${code}`);if(!cs.codes[code]&&!exports.isAppCode(code))throw new Error(`Unrecognized function code: ${code}`);return code},exports.isAppCode=function(code){return code>0&&code<16},exports.isValidCode=function(code){return!!exports.isAppCode(code)||!!cs.codes[code]},exports.validate=validate,exports.prefix=function(multihash){return validate(multihash),multihash.slice(0,2)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function nibbleToPath(data){return data.map(num=>num.toString(16)).join("/")}function guessRemainingPath(path){let pathParts=path.split("/"),triePathLength=guessPathEndFromParts(pathParts)+1;return pathParts.slice(triePathLength).join("/")}function guessPathEndFromParts(pathParts){let matchingPart=pathParts.find(part=>part.length>1||Number.isNaN(parseInt(part,16)));return matchingPart?pathParts.indexOf(matchingPart)-1:pathParts.length-1}const async=__webpack_require__(86),TrieNode=__webpack_require__(276),util=__webpack_require__(104),cidForHash=__webpack_require__(77).cidForHash;__webpack_require__(77).isExternalLink;exports.resolve=((trieIpldFormat,block,path,callback)=>{util.deserialize(block.data,(err,ethTrieNode)=>{if(err)return callback(err);exports.resolveFromObject(trieIpldFormat,ethTrieNode,path,callback)})}),exports.resolveFromObject=((trieIpldFormat,ethTrieNode,path,callback)=>{let result;return path&&"/"!==path?"leaf"===ethTrieNode.type?(result={value:ethTrieNode.getValue(),remainderPath:guessRemainingPath(path)},callback(null,result)):void exports.treeFromObject(trieIpldFormat,ethTrieNode,{},(err,paths)=>{if(err)return callback(err);let matches=paths.filter(child=>child.path===path.slice(0,child.path.length)),sortedMatches=matches.sort((a,b)=>a.path.length{"function"==typeof options&&(callback=options,options=void 0),options||(options={}),util.deserialize(block.data,(err,trieNode)=>{if(err)return callback(err);exports.treeFromObject(trieIpldFormat,trieNode,options,callback)})}),exports.treeFromObject=((trieIpldFormat,trieNode,options,callback)=>{let paths=[];async.each(trieNode.getChildren(),(childData,next)=>{let key=nibbleToPath(childData[0]),value=childData[1];if(TrieNode.isRawNode(value)){let childNode=new TrieNode(value);paths.push({path:key,value:childNode}),exports.treeFromObject(trieIpldFormat,childNode,options,(err,subtree)=>{if(err)return next(err);subtree.forEach(path=>path.path=key+"/"+path.path),paths=paths.concat(subtree),next()})}else{let link={"/":cidForHash(trieIpldFormat,value).toBaseEncodedString()};paths.push({path:key,value:link}),next()}},err=>{if(err)return callback(err);callback(null,paths)})})},function(module,exports){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_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"}},function(module,exports,__webpack_require__){"use strict";module.exports=`enum KeyType { + RSA = 0; + Ed25519 = 1; + Secp256k1 = 2; +} + +message PublicKey { + required KeyType Type = 1; + required bytes Data = 2; +} + +message PrivateKey { + required KeyType Type = 1; + required bytes Data = 2; +}`},function(module,exports,__webpack_require__){"use strict";module.exports={PROTOCOL:"/ipfs/ping/1.0.0",PING_LENGTH:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const protobuf=__webpack_require__(39),PeerId=__webpack_require__(31),crypto=__webpack_require__(50),parallel=__webpack_require__(46),waterfall=__webpack_require__(9),debug=__webpack_require__(3),log=debug("libp2p:secio");log.error=debug("libp2p:secio:error");const pbm=protobuf(__webpack_require__(597)),support=__webpack_require__(144);exports.createProposal=(state=>{return state.proposal.out={rand:crypto.randomBytes(16),pubkey:state.key.local.public.bytes,exchanges:support.exchanges.join(","),ciphers:support.ciphers.join(","),hashes:support.hashes.join(",")},state.proposalEncoded.out=pbm.Propose.encode(state.proposal.out),state.proposalEncoded.out}),exports.createExchange=((state,callback)=>{crypto.generateEphemeralKeyPair(state.protocols.local.curveT,(err,res)=>{if(err)return callback(err);state.ephemeralKey.local=res.key,state.shared.generate=res.genSharedKey;const selectionOut=Buffer.concat([state.proposalEncoded.out,state.proposalEncoded.in,state.ephemeralKey.local]);state.key.local.sign(selectionOut,(err,sig)=>{if(err)return callback(err);state.exchange.out={epubkey:state.ephemeralKey.local,signature:sig},callback(null,pbm.Exchange.encode(state.exchange.out))})})}),exports.identify=((state,msg,callback)=>{log("1.1 identify"),state.proposalEncoded.in=msg,state.proposal.in=pbm.Propose.decode(msg);const pubkey=state.proposal.in.pubkey;state.key.remote=crypto.unmarshalPublicKey(pubkey),PeerId.createFromPubKey(pubkey.toString("base64"),(err,remoteId)=>{if(err)return callback(err);state.id.remote=remoteId,log("1.1 identify - %s - identified remote peer as %s",state.id.local.toB58String(),state.id.remote.toB58String()),callback()})}),exports.selectProtocols=((state,callback)=>{log("1.2 selection");const local={pubKeyBytes:state.key.local.public.bytes,exchanges:support.exchanges,hashes:support.hashes,ciphers:support.ciphers,nonce:state.proposal.out.rand},remote={pubKeyBytes:state.proposal.in.pubkey,exchanges:state.proposal.in.exchanges.split(","),hashes:state.proposal.in.hashes.split(","),ciphers:state.proposal.in.ciphers.split(","),nonce:state.proposal.in.rand};support.selectBest(local,remote,(err,selected)=>{if(err)return callback(err);state.protocols.remote={order:selected.order,curveT:selected.curveT,cipherT:selected.cipherT,hashT:selected.hashT},state.protocols.local={order:selected.order,curveT:selected.curveT,cipherT:selected.cipherT,hashT:selected.hashT},callback()})}),exports.verify=((state,msg,callback)=>{log("2.1. verify"),state.exchange.in=pbm.Exchange.decode(msg),state.ephemeralKey.remote=state.exchange.in.epubkey;const selectionIn=Buffer.concat([state.proposalEncoded.in,state.proposalEncoded.out,state.ephemeralKey.remote]);state.key.remote.verify(selectionIn,state.exchange.in.signature,(err,sigOk)=>{return err?callback(err):sigOk?(log("2.1. verify - signature verified"),void callback()):callback(new Error("Bad signature"))})}),exports.generateKeys=((state,callback)=>{log("2.2. keys"),waterfall([cb=>state.shared.generate(state.exchange.in.epubkey,cb),(secret,cb)=>{state.shared.secret=secret,crypto.keyStretcher(state.protocols.local.cipherT,state.protocols.local.hashT,state.shared.secret,cb)},(keys,cb)=>{if(state.protocols.local.order>0)state.protocols.local.keys=keys.k1,state.protocols.remote.keys=keys.k2;else{if(!(state.protocols.local.order<0))return cb(new Error("you are trying to talk to yourself"));state.protocols.local.keys=keys.k2,state.protocols.remote.keys=keys.k1}log("2.3. mac + cipher"),parallel([cb=>support.makeMacAndCipher(state.protocols.local,cb),cb=>support.makeMacAndCipher(state.protocols.remote,cb)],cb)}],callback)}),exports.verifyNonce=((state,n2)=>{const n1=state.proposal.out.rand;if(!n1.equals(n2))throw new Error(`Failed to read our encrypted nonce: ${n1.toString("hex")} != ${n2.toString("hex")}`)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function makeMac(hash,key,callback){crypto.hmac.create(hash,key,callback)}function makeCipher(cipherType,iv,key,callback){if("AES-128"===cipherType||"AES-256"===cipherType)return crypto.aes.create(key,iv,callback);callback(new Error(`unrecognized cipher type: ${cipherType}`))}const mh=__webpack_require__(30),lp=__webpack_require__(28),pull=__webpack_require__(5),crypto=__webpack_require__(50),parallel=__webpack_require__(46);exports.exchanges=["P-256","P-384","P-521"],exports.ciphers=["AES-256","AES-128"],exports.hashes=["SHA256","SHA512"],exports.theBest=((order,p1,p2)=>{let first,second;if(order<0)first=p2,second=p1;else{if(!(order>0))return p1[0];first=p1,second=p2}for(let firstCandidate of first)for(let secondCandidate of second)if(firstCandidate===secondCandidate)return firstCandidate;throw new Error("No algorithms in common!")}),exports.makeMacAndCipher=((target,callback)=>{parallel([cb=>makeMac(target.hashT,target.keys.macKey,cb),cb=>makeCipher(target.cipherT,target.keys.iv,target.keys.cipherKey,cb)],(err,macAndCipher)=>{if(err)return callback(err);target.mac=macAndCipher[0],target.cipher=macAndCipher[1],callback()})}),exports.selectBest=((local,remote,cb)=>{exports.digest(Buffer.concat([remote.pubKeyBytes,local.nonce]),(err,oh1)=>{if(err)return cb(err);exports.digest(Buffer.concat([local.pubKeyBytes,remote.nonce]),(err,oh2)=>{if(err)return cb(err);const order=Buffer.compare(oh1,oh2);if(0===order)return cb(new Error("you are trying to talk to yourself"));cb(null,{curveT:exports.theBest(order,local.exchanges,remote.exchanges),cipherT:exports.theBest(order,local.ciphers,remote.ciphers),hashT:exports.theBest(order,local.hashes,remote.hashes),order:order})})})}),exports.digest=((buf,cb)=>{mh.digest(buf,"sha2-256",buf.length,cb)}),exports.write=function(state,msg,cb){cb=cb||(()=>{}),pull(pull.values([msg]),lp.encode({fixed:!0,bytes:4}),pull.collect((err,res)=>{if(err)return cb(err);state.shake.write(res[0]),cb()}))},exports.read=function(reader,cb){lp.decodeFromReader(reader,{fixed:!0,bytes:4},cb)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function Transport(opts){this.path=opts.path,this.hostname=opts.hostname,this.port=opts.port,this.secure=opts.secure,this.query=opts.query,this.timestampParam=opts.timestampParam,this.timestampRequests=opts.timestampRequests,this.readyState="",this.agent=opts.agent||!1,this.socket=opts.socket,this.enablesXDR=opts.enablesXDR,this.pfx=opts.pfx,this.key=opts.key,this.passphrase=opts.passphrase,this.cert=opts.cert,this.ca=opts.ca,this.ciphers=opts.ciphers,this.rejectUnauthorized=opts.rejectUnauthorized,this.forceNode=opts.forceNode,this.extraHeaders=opts.extraHeaders,this.localAddress=opts.localAddress}var parser=__webpack_require__(64),Emitter=__webpack_require__(63);module.exports=Transport,Emitter(Transport.prototype),Transport.prototype.onError=function(msg,desc){var err=new Error(msg);return err.type="TransportError",err.description=desc,this.emit("error",err),this},Transport.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},Transport.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},Transport.prototype.send=function(packets){if("open"!==this.readyState)throw new Error("Transport not open");this.write(packets)},Transport.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},Transport.prototype.onData=function(data){var packet=parser.decodePacket(data,this.socket.binaryType);this.onPacket(packet)},Transport.prototype.onPacket=function(packet){this.emit("packet",packet)},Transport.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(module,exports,__webpack_require__){(function(global){var hasCORS=__webpack_require__(430);module.exports=function(opts){var xdomain=opts.xdomain,xscheme=opts.xscheme,enablesXDR=opts.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!xdomain||hasCORS))return new XMLHttpRequest}catch(e){}try{if("undefined"!=typeof XDomainRequest&&!xscheme&&enablesXDR)return new XDomainRequest}catch(e){}if(!xdomain)try{return new(global[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){function Encoder(){}function encodeAsString(obj){var str=""+obj.type;return exports.BINARY_EVENT!==obj.type&&exports.BINARY_ACK!==obj.type||(str+=obj.attachments+"-"),obj.nsp&&"/"!==obj.nsp&&(str+=obj.nsp+","),null!=obj.id&&(str+=obj.id),null!=obj.data&&(str+=JSON.stringify(obj.data)),debug("encoded %j as %s",obj,str),str}function encodeAsBinary(obj,callback){function writeEncoding(bloblessData){var deconstruction=binary.deconstructPacket(bloblessData),pack=encodeAsString(deconstruction.packet),buffers=deconstruction.buffers;buffers.unshift(pack),callback(buffers)}binary.removeBlobs(obj,writeEncoding)}function Decoder(){this.reconstructor=null}function decodeString(str){var i=0,p={type:Number(str.charAt(0))};if(null==exports.types[p.type])return error();if(exports.BINARY_EVENT===p.type||exports.BINARY_ACK===p.type){for(var buf="";"-"!==str.charAt(++i)&&(buf+=str.charAt(i),i!=str.length););if(buf!=Number(buf)||"-"!==str.charAt(i))throw new Error("Illegal attachments");p.attachments=Number(buf)}if("/"===str.charAt(i+1))for(p.nsp="";++i;){var c=str.charAt(i);if(","===c)break;if(p.nsp+=c,i===str.length)break}else p.nsp="/";var next=str.charAt(i+1);if(""!==next&&Number(next)==next){for(p.id="";++i;){var c=str.charAt(i);if(null==c||Number(c)!=c){--i;break}if(p.id+=str.charAt(i),i===str.length)break}p.id=Number(p.id)}return str.charAt(++i)&&(p=tryParse(p,str.substr(i))),debug("decoded %s as %j",str,p),p}function tryParse(p,str){try{p.data=JSON.parse(str)}catch(e){return error()}return p}function BinaryReconstructor(packet){this.reconPack=packet,this.buffers=[]}function error(){return{type:exports.ERROR,data:"parser error"}}var debug=__webpack_require__(3)("socket.io-parser"),Emitter=__webpack_require__(63),hasBin=__webpack_require__(212),binary=__webpack_require__(621),isBuf=__webpack_require__(260);exports.protocol=4,exports.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],exports.CONNECT=0,exports.DISCONNECT=1,exports.EVENT=2,exports.ACK=3,exports.ERROR=4,exports.BINARY_EVENT=5,exports.BINARY_ACK=6,exports.Encoder=Encoder,exports.Decoder=Decoder,Encoder.prototype.encode=function(obj,callback){if(obj.type!==exports.EVENT&&obj.type!==exports.ACK||!hasBin(obj.data)||(obj.type=obj.type===exports.EVENT?exports.BINARY_EVENT:exports.BINARY_ACK),debug("encoding packet %j",obj),exports.BINARY_EVENT===obj.type||exports.BINARY_ACK===obj.type)encodeAsBinary(obj,callback);else{callback([encodeAsString(obj)])}},Emitter(Decoder.prototype),Decoder.prototype.add=function(obj){var packet;if("string"==typeof obj)packet=decodeString(obj),exports.BINARY_EVENT===packet.type||exports.BINARY_ACK===packet.type?(this.reconstructor=new BinaryReconstructor(packet),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",packet)):this.emit("decoded",packet);else{if(!isBuf(obj)&&!obj.base64)throw new Error("Unknown type: "+obj);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(packet=this.reconstructor.takeBinaryData(obj))&&(this.reconstructor=null,this.emit("decoded",packet))}},Decoder.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},BinaryReconstructor.prototype.takeBinaryData=function(binData){if(this.buffers.push(binData),this.buffers.length===this.reconPack.attachments){var packet=binary.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),packet}return null},BinaryReconstructor.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(module,exports,__webpack_require__){(function(global,module){function arrayMap(array,iteratee){for(var index=-1,length=array?array.length:0,result=Array(length);++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet, +MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function values(object){return object?baseValues(object,keys(object)):[]}var MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",reIsUint=/^(?:0|[1-9]\d*)$/,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,propertyIsEnumerable=objectProto.propertyIsEnumerable,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),isArray=Array.isArray;module.exports=values},function(module,exports){function isObject(value){var type=typeof value;return null!=value&&("object"==type||"function"==type)}module.exports=isObject},function(module,exports,__webpack_require__){"use strict";function Protocols(proto){if("number"==typeof proto){if(Protocols.codes[proto])return Protocols.codes[proto];throw new Error("no protocol with code: "+proto)}if("string"==typeof proto||proto instanceof String){if(Protocols.names[proto])return Protocols.names[proto];throw new Error("no protocol with name: "+proto)}throw new Error("invalid protocol id type: "+proto)}function p(code,size,name,resolvable){return{code:code,size:size,name:name,resolvable:Boolean(resolvable)}}const map=__webpack_require__(148);Protocols.lengthPrefixedVarSize=-1,Protocols.V=-1,Protocols.table=[[4,32,"ip4"],[6,16,"tcp"],[17,16,"udp"],[33,16,"dccp"],[41,128,"ip6"],[53,-1,"dns","resolvable"],[54,-1,"dns4","resolvable"],[55,-1,"dns6","resolvable"],[132,16,"sctp"],[302,0,"utp"],[421,Protocols.lengthPrefixedVarSize,"ipfs"],[480,0,"http"],[443,0,"https"],[477,0,"ws"],[478,0,"wss"],[275,0,"libp2p-webrtc-star"],[276,0,"libp2p-webrtc-direct"],[290,0,"p2p-circuit"]],Protocols.names={},Protocols.codes={},map(Protocols.table,function(row){const proto=p.apply(null,row);Protocols.codes[proto.code]=proto,Protocols.names[proto.name]=proto}),Protocols.object=p,module.exports=Protocols},function(module,exports,__webpack_require__){"use strict";exports.Listener=exports.listener=__webpack_require__(698),exports.Dialer=exports.dialer=__webpack_require__(697),exports.matchSemver=__webpack_require__(700),exports.matchExact=__webpack_require__(287)},function(module,exports){exports.endianness=function(){return"LE"},exports.hostname=function(){return"undefined"!=typeof location?location.hostname:""},exports.loadavg=function(){return[]},exports.uptime=function(){return 0},exports.freemem=function(){return Number.MAX_VALUE},exports.totalmem=function(){return Number.MAX_VALUE},exports.cpus=function(){return[]},exports.type=function(){return"Browser"},exports.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},exports.networkInterfaces=exports.getNetworkInterfaces=function(){return{}},exports.arch=function(){return"javascript"},exports.platform=function(){return"browser"},exports.tmpdir=exports.tmpDir=function(){return"/tmp"},exports.EOL="\n"},function(module,exports){exports.encode=function(obj){var str="";for(var i in obj)obj.hasOwnProperty(i)&&(str.length&&(str+="&"),str+=encodeURIComponent(i)+"="+encodeURIComponent(obj[i]));return str},exports.decode=function(qs){for(var qry={},pairs=qs.split("&"),i=0,l=pairs.length;i=maxLength;){const end=maxLength,slice=buffered.slice(0,end);buffered=buffered.slice(end),this.queue(slice)}},function(end){buffered.length&&(this.queue(buffered),buffered=[]),this.queue(null)})}},function(module,exports){function abortAll(ary,abort,cb){function next(){--n||cb(abort)}var n=ary.length;if(!n)return cb(abort);ary.forEach(function(f){f?f(abort,next):next()}),n||next()}module.exports=function(streams){return function(abort,cb){!function next(){abort?abortAll(streams,abort,cb):streams.length?streams[0]?streams[0](null,function(err,data){err?(streams.shift(),err===!0?next():abortAll(streams,err,cb)):cb(null,data)}):(streams.shift(),next()):cb(!0)}()}}},function(module,exports,__webpack_require__){var looper=__webpack_require__(728);module.exports=function(map,width,inOrder){inOrder=void 0===inOrder||inOrder;var abort,reading=!1;return function(read){function drain(){if(_cb){var cb=_cb;if(error)return _cb=null,cb(error);if(Object.hasOwnProperty.call(seen,j)){_cb=null;var data=seen[j];delete seen[j],j++,cb(null,data),width&&start()}else j>=last&&ended&&(_cb=null,cb(ended))}}var _cb,error,i=0,j=0,last=0,seen=[],started=!1,ended=!1,start=looper(function(){if(started=!0,ended)return drain();reading||width&&i-width>=j||(reading=!0,read(abort,function(end,data){if(reading=!1,end)last=i,ended=end,drain();else{var k=i++;map(data,function(err,data){inOrder?seen[k]=data:seen.push(data),err&&(error=err),drain()}),ended||start()}}))});return function(_abort,cb){_abort?read(ended=abort=_abort,function(err){if(cb)return cb(err)}):(_cb=cb,started||start(),drain())}}}},function(module,exports,__webpack_require__){(function(setImmediate,process){function duplex(reader,read){function drain(){if(waiting=!1,read&&!busy){for(;output.length&&!s.paused;)s.emit("data",output.shift());if(!s.paused){if(_ended)return s.emit("end");busy=!0,read(null,function next(end,data){busy=!1,s.paused?(end===!0?_ended=end:end?s.emit("error",end):output.push(data),waiting=!0):end&&(ended=end)!==!0?s.emit("error",end):(ended=ended||end)?s.emit("end"):(s.emit("data",data),busy=!0,read(null,next))})}}}reader&&"object"==typeof reader&&(read=reader.source,reader=reader.sink);var ended,needDrain,cbs=[],input=[],s=new Stream;s.writable=s.readable=!0,s.write=function(data){return cbs.length?cbs.shift()(null,data):input.push(data),cbs.length||(needDrain=!0),!!cbs.length},s.end=function(){read?input.length?drain():read(ended=!0,cbs.length?cbs.shift():function(){}):cbs.length&&cbs.shift()(!0)},s.source=function(end,cb){input.length?(cb(null,input.shift()),input.length||s.emit("drain")):((ended=ended||end)?cb(ended):cbs.push(cb),needDrain&&(needDrain=!1,s.emit("drain")))};var n;reader&&(n=reader(s.source)),n&&!read&&(read=n);var output=[],_ended=!1,waiting=!1,busy=!1;if(s.sink=function(_read){read=_read,next(drain)},read){s.sink(read);var pipe=s.pipe.bind(s);s.pipe=function(dest,opts){var res=pipe(dest,opts);return s.paused&&s.resume(),res}}return s.pause=function(){return s.paused=!0,s},s.resume=function(){return s.paused=!1,drain(),s},s.destroy=function(){!ended&&read&&read(ended=!0,function(){}),ended=!0,cbs.length&&cbs.shift()(!0),s.emit("close")},s}var Stream=__webpack_require__(26);module.exports=duplex,module.exports.source=function(source){return duplex(null,source)},module.exports.sink=function(sink){return duplex(sink,null)};var next=void 0===setImmediate?process.nextTick:setImmediate}).call(exports,__webpack_require__(22).setImmediate,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";var drain=__webpack_require__(84);module.exports=function(reducer,acc,cb){cb||(cb=acc,acc=null);var sink=drain(function(data){acc=reducer(acc,data)},function(err){cb(err,acc)});return 2===arguments.length?function(source){source(null,function(end,data){if(end)return cb(end===!0?null:end);acc=data,sink(source)})}:sink}},function(module,exports,__webpack_require__){"use strict";var abortCb=__webpack_require__(302);module.exports=function(array,onAbort){if(!array)return function(abort,cb){return abort?abortCb(cb,abort,onAbort):cb(!0)};Array.isArray(array)||(array=Object.keys(array).map(function(k){return array[k]}));var i=0;return function(abort,cb){if(abort)return abortCb(cb,abort,onAbort);i>=array.length?cb(!0):cb(null,array[i++])}}},function(module,exports,__webpack_require__){"use strict";var tester=__webpack_require__(303);module.exports=function(test){return test=tester(test),function(read){return function next(end,cb){for(var sync,loop=!0;loop;)loop=!1,sync=!0,read(end,function(end,data){if(!end&&!test(data))return sync?loop=!0:next(end,cb);cb(end,data)}),sync=!1}}}},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(310)(__webpack_require__(771))},function(module,exports,__webpack_require__){"use strict";exports.utils=__webpack_require__(792),exports.constants=__webpack_require__(788),exports.Scheduler=__webpack_require__(791),exports.Parser=__webpack_require__(790),exports.Framer=__webpack_require__(789)},function(module,exports,__webpack_require__){exports=module.exports=__webpack_require__(322),exports.Stream=exports,exports.Readable=exports,exports.Writable=__webpack_require__(324),exports.Duplex=__webpack_require__(71),exports.Transform=__webpack_require__(323),exports.PassThrough=__webpack_require__(804)},function(module,exports,__webpack_require__){"use strict";(function(process,setImmediate){function nop(){}function WriteReq(chunk,encoding,cb){this.chunk=chunk,this.encoding=encoding,this.callback=cb,this.next=null}function WritableState(options,stream){Duplex=Duplex||__webpack_require__(53),options=options||{},this.objectMode=!!options.objectMode,stream instanceof Duplex&&(this.objectMode=this.objectMode||!!options.writableObjectMode);var hwm=options.highWaterMark,defaultHwm=this.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:defaultHwm,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var noDecode=options.decodeStrings===!1;this.decodeStrings=!noDecode,this.defaultEncoding=options.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(er){onwrite(stream,er)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}function Writable(options){if(Duplex=Duplex||__webpack_require__(53),!(realHasInstance.call(Writable,this)||this instanceof Duplex))return new Writable(options);this._writableState=new WritableState(options,this),this.writable=!0,options&&("function"==typeof options.write&&(this._write=options.write),"function"==typeof options.writev&&(this._writev=options.writev)),Stream.call(this)}function writeAfterEnd(stream,cb){var er=new Error("write after end");stream.emit("error",er),processNextTick(cb,er)}function validChunk(stream,state,chunk,cb){var valid=!0,er=!1;return null===chunk?er=new TypeError("May not write null values to stream"):"string"==typeof chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er&&(stream.emit("error",er),processNextTick(cb,er),valid=!1),valid}function decodeChunk(state,chunk,encoding){return state.objectMode||state.decodeStrings===!1||"string"!=typeof chunk||(chunk=bufferShim.from(chunk,encoding)),chunk}function writeOrBuffer(stream,state,isBuf,chunk,encoding,cb){isBuf||(chunk=decodeChunk(state,chunk,encoding),Buffer.isBuffer(chunk)&&(encoding="buffer"));var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length-1?setImmediate:processNextTick;Writable.WritableState=WritableState;var util=__webpack_require__(6);util.inherits=__webpack_require__(1);var internalUtil={deprecate:__webpack_require__(72)},Stream=__webpack_require__(328),Buffer=__webpack_require__(0).Buffer,bufferShim=__webpack_require__(14);util.inherits(Writable,Stream),WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(_){}}();var realHasInstance;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return!!realHasInstance.call(this,object)||object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=Buffer.isBuffer(chunk);return"function"==typeof encoding&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),"function"!=typeof cb&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,state.writing||state.corked||state.finished||state.bufferProcessing||!state.bufferedRequest||clearBuffer(this,state))},Writable.prototype.setDefaultEncoding=function(encoding){if("string"==typeof encoding&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this},Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;"function"==typeof chunk?(cb=chunk,chunk=null,encoding=null):"function"==typeof encoding&&(cb=encoding,encoding=null),null!==chunk&&void 0!==chunk&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||state.finished||endWritable(this,state,cb)}}).call(exports,__webpack_require__(2),__webpack_require__(22).setImmediate)},function(module,exports,__webpack_require__){exports=module.exports=__webpack_require__(326),exports.Stream=exports,exports.Readable=exports,exports.Writable=__webpack_require__(165),exports.Duplex=__webpack_require__(53),exports.Transform=__webpack_require__(327),exports.PassThrough=__webpack_require__(808)},function(module,exports,__webpack_require__){"use strict";function Url(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function urlParse(url,parseQueryString,slashesDenoteHost){if(url&&util.isObject(url)&&url instanceof Url)return url;var u=new Url;return u.parse(url,parseQueryString,slashesDenoteHost),u}function urlFormat(obj){return util.isString(obj)&&(obj=urlParse(obj)),obj instanceof Url?obj.format():Url.prototype.format.call(obj)}function urlResolve(source,relative){return urlParse(source,!1,!0).resolve(relative)}function urlResolveObject(source,relative){return source?urlParse(source,!1,!0).resolveObject(relative):relative}var punycode=__webpack_require__(760),util=__webpack_require__(819);exports.parse=urlParse,exports.resolve=urlResolve,exports.resolveObject=urlResolveObject,exports.format=urlFormat,exports.Url=Url;var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,simplePathPattern=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,delims=["<",">",'"',"`"," ","\r","\n","\t"],unwise=["{","}","|","\\","^","`"].concat(delims),autoEscape=["'"].concat(unwise),nonHostChars=["%","/","?",";","#"].concat(autoEscape),hostEndingChars=["/","?","#"],unsafeProtocol={javascript:!0,"javascript:":!0},hostlessProtocol={javascript:!0,"javascript:":!0},slashedProtocol={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},querystring=__webpack_require__(763);Url.prototype.parse=function(url,parseQueryString,slashesDenoteHost){if(!util.isString(url))throw new TypeError("Parameter 'url' must be a string, not "+typeof url);var queryIndex=url.indexOf("?"),splitter=queryIndex!==-1&&queryIndex127?"x":part[j];if(!newpart.match(/^[+a-z0-9A-Z_-]{0,63}$/)){var validParts=hostparts.slice(0,i),notHost=hostparts.slice(i+1),bit=part.match(/^([+a-z0-9A-Z_-]{0,63})(.*)$/);bit&&(validParts.push(bit[1]),notHost.unshift(bit[2])),notHost.length&&(rest="/"+notHost.join(".")+rest),this.hostname=validParts.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),ipv6Hostname||(this.hostname=punycode.toASCII(this.hostname));var p=this.port?":"+this.port:"",h=this.hostname||"";this.host=h+p,this.href+=this.host,ipv6Hostname&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==rest[0]&&(rest="/"+rest))}if(!unsafeProtocol[lowerProto])for(var i=0,l=autoEscape.length;i0)&&result.host.split("@");authInHost&&(result.auth=authInHost.shift(),result.host=result.hostname=authInHost.shift())}return result.search=relative.search,result.query=relative.query,util.isNull(result.pathname)&&util.isNull(result.search)||(result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")),result.href=result.format(),result}if(!srcPath.length)return result.pathname=null,result.search?result.path="/"+result.search:result.path=null,result.href=result.format(),result +;for(var last=srcPath.slice(-1)[0],hasTrailingSlash=(result.host||relative.host||srcPath.length>1)&&("."===last||".."===last)||""===last,up=0,i=srcPath.length;i>=0;i--)last=srcPath[i],"."===last?srcPath.splice(i,1):".."===last?(srcPath.splice(i,1),up++):up&&(srcPath.splice(i,1),up--);if(!mustEndAbs&&!removeAllDots)for(;up--;up)srcPath.unshift("..");!mustEndAbs||""===srcPath[0]||srcPath[0]&&"/"===srcPath[0].charAt(0)||srcPath.unshift(""),hasTrailingSlash&&"/"!==srcPath.join("/").substr(-1)&&srcPath.push("");var isAbsolute=""===srcPath[0]||srcPath[0]&&"/"===srcPath[0].charAt(0);if(psychotic){result.hostname=result.host=isAbsolute?"":srcPath.length?srcPath.shift():"";var authInHost=!!(result.host&&result.host.indexOf("@")>0)&&result.host.split("@");authInHost&&(result.auth=authInHost.shift(),result.host=result.hostname=authInHost.shift())}return mustEndAbs=mustEndAbs||result.host&&srcPath.length,mustEndAbs&&!isAbsolute&&srcPath.unshift(""),srcPath.length?result.pathname=srcPath.join("/"):(result.pathname=null,result.path=null),util.isNull(result.pathname)&&util.isNull(result.search)||(result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")),result.auth=relative.auth||result.auth,result.slashes=result.slashes||relative.slashes,result.href=result.format(),result},Url.prototype.parseHost=function(){var host=this.host,port=portPattern.exec(host);port&&(port=port[0],":"!==port&&(this.port=port.substr(1)),host=host.substr(0,host.length-port.length)),host&&(this.hostname=host)}},function(module,exports,__webpack_require__){function WBuf(){this.buffers=[],this.toReserve=0,this.size=0,this.maxSize=0,this.avail=0,this.last=null,this.offset=0,this.sliceQueue=null,this.forceReserve=!1,this.reserveRate=64}function toUnsigned16(num){return num<0?65536+num:num}function toUnsigned24(num){return num<0?16777216+num:num}function toUnsigned32(num){return num<0?4294967295+num+1:num}var assert=__webpack_require__(111),Buffer=__webpack_require__(0).Buffer;module.exports=WBuf,WBuf.prototype.reserve=function(n){this.toReserve+=n,this.forceReserve&&(this.toReserve=Math.max(this.toReserve,this.reserveRate))},WBuf.prototype._ensure=function(n){this.avail>=n||(0===this.toReserve&&(this.toReserve=this.reserveRate),this.toReserve=Math.max(n-this.avail,this.toReserve),0===this.avail&&this._next())},WBuf.prototype._next=function(){var buf;null===this.sliceQueue?buf=new Buffer(this.toReserve):(buf=this.sliceQueue.shift(),0===this.sliceQueue.length&&(this.sliceQueue=null)),this.toReserve=0,this.buffers.push(buf),this.avail=buf.length,this.offset=0,this.last=buf},WBuf.prototype._rangeCheck=function(){if(0!==this.maxSize&&this.size>this.maxSize)throw new RangeError("WBuf overflow")},WBuf.prototype._move=function(n){this.size+=n,0===this.avail&&(this.last=null),this._rangeCheck()},WBuf.prototype.slice=function(start,end){assert(0<=start&&start<=this.size),assert(0<=end&&end<=this.size),null===this.last&&this._next();var res=new WBuf;if(start>=this.size-this.offset)return res.buffers.push(this.last),res.last=this.last,res.offset=start-this.size+this.offset,res.maxSize=end-start,res.avail=res.maxSize,res;for(var startIndex=-1,startOffset=0,endIndex=-1,offset=0,i=0;i=offset&&start<=next&&(startIndex=i,startOffset=start-offset,endIndex!==-1))break;if(end>=offset&&end<=next&&(endIndex=i,startIndex!==-1))break;offset=next}return res.last=this.buffers[startIndex],res.offset=startOffset,res.maxSize=end-start,startIndex0;){var toSkip=Math.min(left,this.avail);left-=toSkip,this.size+=toSkip,toSkip===this.avail?0!==left?this._next():(this.avail-=toSkip,this.offset+=toSkip):(this.offset+=toSkip,this.avail-=toSkip)}return this._rangeCheck(),this.slice(this.size-n,this.size)},WBuf.prototype.write=function(str){for(var len=0,i=0;i255?2:1}this.reserve(len);for(var i=0;i>>8,lo=255&c;hi&&this.writeUInt8(hi),this.writeUInt8(lo)}},WBuf.prototype.copyFrom=function(buf,start,end){var off=void 0===start?0:start,len=void 0===end?buf.length:end;if(off!==len){for(this._ensure(len-off);off=2?(this.last.writeUInt16BE(v,this.offset,!0),this.offset+=2,this.avail-=2):(this.last[this.offset]=v>>>8,this._next(),this.last[this.offset++]=255&v,this.avail--),this._move(2)},WBuf.prototype.writeUInt24BE=function(v){this._ensure(3),this.avail>=3?(this.last.writeUInt16BE(v>>>8,this.offset,!0),this.last[this.offset+2]=255&v,this.offset+=3,this.avail-=3,this._move(3)):this.avail>=2?(this.last.writeUInt16BE(v>>>8,this.offset,!0),this._next(),this.last[this.offset++]=255&v,this.avail--,this._move(3)):(this.last[this.offset]=v>>>16,this._move(1),this._next(),this.writeUInt16BE(65535&v))},WBuf.prototype.writeUInt32BE=function(v){this._ensure(4),this.avail>=4?(this.last.writeUInt32BE(v,this.offset,!0),this.offset+=4,this.avail-=4,this._move(4)):this.avail>=3?(this.writeUInt24BE(v>>>8),this._next(),this.last[this.offset++]=255&v,this.avail--,this._move(1)):(this.writeUInt16BE(v>>>16),this.writeUInt16BE(65535&v))},WBuf.prototype.writeUInt16LE=function(num){var r=(255&num)<<8|num>>>8;this.writeUInt16BE(r)},WBuf.prototype.writeUInt24LE=function(num){var r=(255&num)<<16|(num>>>8&255)<<8|num>>>16;this.writeUInt24BE(r)},WBuf.prototype.writeUInt32LE=function(num){var r=(255&num)<<24|(num>>>8&255)<<16|(num>>>16&255)<<8|num>>>24;this.writeUInt32BE(r)},WBuf.prototype.render=function(){for(var left=this.size,out=[],i=0;i=0;i++){var buf=this.buffers[i];left-=buf.length,left>=0?out.push(buf):out.push(buf.slice(0,buf.length+left))}return out},WBuf.prototype.writeInt8=function(num){return num<0?this.writeUInt8(256+num):this.writeUInt8(num)},WBuf.prototype.writeInt16LE=function(num){this.writeUInt16LE(toUnsigned16(num))},WBuf.prototype.writeInt16BE=function(num){this.writeUInt16BE(toUnsigned16(num))},WBuf.prototype.writeInt24LE=function(num){this.writeUInt24LE(toUnsigned24(num))},WBuf.prototype.writeInt24BE=function(num){this.writeUInt24BE(toUnsigned24(num))},WBuf.prototype.writeInt32LE=function(num){this.writeUInt32LE(toUnsigned32(num))},WBuf.prototype.writeInt32BE=function(num){this.writeUInt32BE(toUnsigned32(num))},WBuf.prototype.writeComb=function(size,endian,value){if(1===size)return this.writeUInt8(value);"le"===endian?2===size?this.writeUInt16LE(value):3===size?this.writeUInt24LE(value):4===size&&this.writeUInt32LE(value):2===size?this.writeUInt16BE(value):3===size?this.writeUInt24BE(value):4===size&&this.writeUInt32BE(value)}},function(module,exports,__webpack_require__){"use strict";exports.OFFLINE_ERROR=new Error("This command must be run in online mode. Try running 'ipfs daemon' first.")},function(module,exports,__webpack_require__){function DecoderBuffer(base,options){if(Reporter.call(this,options),!Buffer.isBuffer(base))return void this.error("Input not Buffer");this.base=base,this.offset=0,this.length=base.length}function EncoderBuffer(value,reporter){if(Array.isArray(value))this.length=0,this.value=value.map(function(item){return item instanceof EncoderBuffer||(item=new EncoderBuffer(item,reporter)),this.length+=item.length,item},this);else if("number"==typeof value){if(!(0<=value&&value<=255))return reporter.error("non-byte EncoderBuffer value");this.value=value,this.length=1}else if("string"==typeof value)this.value=value,this.length=Buffer.byteLength(value);else{if(!Buffer.isBuffer(value))return reporter.error("Unsupported type: "+typeof value);this.value=value,this.length=value.length}}var inherits=__webpack_require__(1),Reporter=__webpack_require__(73).Reporter,Buffer=__webpack_require__(0).Buffer;inherits(DecoderBuffer,Reporter),exports.DecoderBuffer=DecoderBuffer,DecoderBuffer.prototype.save=function(){return{offset:this.offset,reporter:Reporter.prototype.save.call(this)}},DecoderBuffer.prototype.restore=function(save){var res=new DecoderBuffer(this.base);return res.offset=save.offset,res.length=this.offset,this.offset=save.offset,Reporter.prototype.restore.call(this,save.reporter),res},DecoderBuffer.prototype.isEmpty=function(){return this.offset===this.length},DecoderBuffer.prototype.readUInt8=function(fail){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(fail||"DecoderBuffer overrun")},DecoderBuffer.prototype.skip=function(bytes,fail){if(!(this.offset+bytes<=this.length))return this.error(fail||"DecoderBuffer overrun");var res=new DecoderBuffer(this.base);return res._reporterState=this._reporterState,res.offset=this.offset,res.length=this.offset+bytes,this.offset+=bytes,res},DecoderBuffer.prototype.raw=function(save){return this.base.slice(save?save.offset:this.offset,this.length)},exports.EncoderBuffer=EncoderBuffer,EncoderBuffer.prototype.join=function(out,offset){return out||(out=new Buffer(this.length)),offset||(offset=0),0===this.length?out:(Array.isArray(this.value)?this.value.forEach(function(item){item.join(out,offset),offset+=item.length}):("number"==typeof this.value?out[offset]=this.value:"string"==typeof this.value?out.write(this.value,offset):Buffer.isBuffer(this.value)&&this.value.copy(out,offset),offset+=this.length),out)}},function(module,exports,__webpack_require__){var constants=exports;constants._reverse=function(map){var res={};return Object.keys(map).forEach(function(key){(0|key)==key&&(key|=0),res[map[key]]=key}),res},constants.der=__webpack_require__(338)},function(module,exports,__webpack_require__){function DERDecoder(entity){this.enc="der",this.name=entity.name,this.entity=entity,this.tree=new DERNode,this.tree._init(entity.body)}function DERNode(parent){base.Node.call(this,"der",parent)}function derDecodeTag(buf,fail){var tag=buf.readUInt8(fail);if(buf.isError(tag))return tag;var cls=der.tagClass[tag>>6],primitive=0==(32&tag);if(31==(31&tag)){var oct=tag;for(tag=0;128==(128&oct);){if(oct=buf.readUInt8(fail),buf.isError(oct))return oct;tag<<=7,tag|=127&oct}}else tag&=31;return{cls:cls,primitive:primitive,tag:tag,tagStr:der.tag[tag]}}function derDecodeLen(buf,primitive,fail){var len=buf.readUInt8(fail);if(buf.isError(len))return len;if(!primitive&&128===len)return null;if(0==(128&len))return len;var num=127&len;if(num>4)return buf.error("length octect is too long");len=0;for(var i=0;i=31?reporter.error("Multi-octet tag encoding unsupported"):(primitive||(res|=32),res|=der.tagClassByName[cls||"universal"]<<6)}var inherits=__webpack_require__(1),Buffer=__webpack_require__(0).Buffer,asn1=__webpack_require__(54),base=asn1.base,der=asn1.constants.der;module.exports=DEREncoder,DEREncoder.prototype.encode=function(data,reporter){return this.tree._encode(data,reporter).join()},inherits(DERNode,base.Node),DERNode.prototype._encodeComposite=function(tag,primitive,cls,content){var encodedTag=encodeTag(tag,primitive,cls,this.reporter);if(content.length<128){var header=new Buffer(2);return header[0]=encodedTag,header[1]=content.length,this._createEncoderBuffer([header,content])}for(var lenOctets=1,i=content.length;i>=256;i>>=8)lenOctets++;var header=new Buffer(2+lenOctets);header[0]=encodedTag,header[1]=128|lenOctets;for(var i=1+lenOctets,j=content.length;j>0;i--,j>>=8)header[i]=255&j;return this._createEncoderBuffer([header,content])},DERNode.prototype._encodeStr=function(str,tag){if("bitstr"===tag)return this._createEncoderBuffer([0|str.unused,str.data]);if("bmpstr"===tag){for(var buf=new Buffer(2*str.length),i=0;i=40)return this.reporter.error("Second objid identifier OOB");id.splice(0,2,40*id[0]+id[1])}for(var size=0,i=0;i=128;ident>>=7)size++}for(var objid=new Buffer(size),offset=objid.length-1,i=id.length-1;i>=0;i--){var ident=id[i];for(objid[offset--]=127&ident;(ident>>=7)>0;)objid[offset--]=128|127&ident}return this._createEncoderBuffer(objid)},DERNode.prototype._encodeTime=function(time,tag){var str,date=new Date(time);return"gentime"===tag?str=[two(date.getFullYear()),two(date.getUTCMonth()+1),two(date.getUTCDate()),two(date.getUTCHours()),two(date.getUTCMinutes()),two(date.getUTCSeconds()),"Z"].join(""):"utctime"===tag?str=[two(date.getFullYear()%100),two(date.getUTCMonth()+1),two(date.getUTCDate()),two(date.getUTCHours()),two(date.getUTCMinutes()),two(date.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+tag+" time is not supported yet"),this._encodeStr(str,"octstr")},DERNode.prototype._encodeNull=function(){return this._createEncoderBuffer("")},DERNode.prototype._encodeInt=function(num,values){if("string"==typeof num){if(!values)return this.reporter.error("String int or enum given, but no values map");if(!values.hasOwnProperty(num))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(num));num=values[num]}if("number"!=typeof num&&!Buffer.isBuffer(num)){var numArray=num.toArray();!num.sign&&128&numArray[0]&&numArray.unshift(0),num=new Buffer(numArray)}if(Buffer.isBuffer(num)){var size=num.length;0===num.length&&size++;var out=new Buffer(size);return num.copy(out),0===num.length&&(out[0]=0),this._createEncoderBuffer(out)}if(num<128)return this._createEncoderBuffer(num);if(num<256)return this._createEncoderBuffer([0,num]);for(var size=1,i=num;i>=256;i>>=8)size++;for(var out=new Array(size),i=out.length-1;i>=0;i--)out[i]=255&num,num>>=8;return 128&out[0]&&out.unshift(0),this._createEncoderBuffer(new Buffer(out))},DERNode.prototype._encodeBool=function(value){return this._createEncoderBuffer(value?255:0)},DERNode.prototype._use=function(entity,obj){return"function"==typeof entity&&(entity=entity(obj)),entity._getEncoder("der").tree},DERNode.prototype._skipDefault=function(dataBuffer,reporter,parent){var i,state=this._baseState;if(null===state.default)return!1;var data=dataBuffer.join();if(void 0===state.defaultBuffer&&(state.defaultBuffer=this._encodeValue(state.default,reporter,parent).join()),data.length!==state.defaultBuffer.length)return!1;for(i=0;i2&&(result=(0,_slice2.default)(arguments,1)),results[key]=result,callback(err)})},function(err){callback(err,results)})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=_parallel;var _noop=__webpack_require__(33),_noop2=_interopRequireDefault(_noop),_isArrayLike=__webpack_require__(65),_isArrayLike2=_interopRequireDefault(_isArrayLike),_slice=__webpack_require__(56),_slice2=_interopRequireDefault(_slice),_wrapAsync=__webpack_require__(19),_wrapAsync2=_interopRequireDefault(_wrapAsync);module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _withoutIndex(iteratee){return function(value,index,callback){return iteratee(value,callback)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=_withoutIndex,module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(worker,concurrency){var _worker=(0,_wrapAsync2.default)(worker);return(0,_queue2.default)(function(items,cb){_worker(items[0],cb)},concurrency,1)};var _queue=__webpack_require__(354),_queue2=_interopRequireDefault(_queue),_wrapAsync=__webpack_require__(19),_wrapAsync2=_interopRequireDefault(_wrapAsync);module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0});var _reject=__webpack_require__(355),_reject2=_interopRequireDefault(_reject),_doParallel=__webpack_require__(88),_doParallel2=_interopRequireDefault(_doParallel);exports.default=(0,_doParallel2.default)(_reject2.default),module.exports=exports.default},function(module,exports,__webpack_require__){(function(Buffer){function normalizeInput(input){var ret;if(input instanceof Uint8Array)ret=input;else if(input instanceof Buffer)ret=new Uint8Array(input);else{if("string"!=typeof input)throw new Error(ERROR_MSG_INPUT);ret=new Uint8Array(Buffer.from(input,"utf8"))}return ret}function toHex(bytes){return Array.prototype.map.call(bytes,function(n){return(n<16?"0":"")+n.toString(16)}).join("")}function uint32ToHex(val){return(4294967296+val).toString(16).substring(1)}function debugPrint(label,arr,size){for(var msg="\n"+label+" = ",i=0;inew Date(val),1:val=>new Date(1e3*val),2:val=>utils.arrayBufferToBignumber(val),3:val=>c.NEG_ONE.minus(utils.arrayBufferToBignumber(val)),4:v=>{return c.TEN.pow(v[0]).times(v[1])},5:v=>{return c.TWO.pow(v[0]).times(v[1])},32:val=>url.parse(val),35:val=>new RegExp(val)},opts.tags),this.parser=parser(global,{log:console.log.bind(console),pushInt:this.pushInt.bind(this),pushInt32:this.pushInt32.bind(this),pushInt32Neg:this.pushInt32Neg.bind(this),pushInt64:this.pushInt64.bind(this),pushInt64Neg:this.pushInt64Neg.bind(this),pushFloat:this.pushFloat.bind(this),pushFloatSingle:this.pushFloatSingle.bind(this),pushFloatDouble:this.pushFloatDouble.bind(this),pushTrue:this.pushTrue.bind(this),pushFalse:this.pushFalse.bind(this),pushUndefined:this.pushUndefined.bind(this),pushNull:this.pushNull.bind(this),pushInfinity:this.pushInfinity.bind(this),pushInfinityNeg:this.pushInfinityNeg.bind(this),pushNaN:this.pushNaN.bind(this),pushNaNNeg:this.pushNaNNeg.bind(this),pushArrayStart:this.pushArrayStart.bind(this),pushArrayStartFixed:this.pushArrayStartFixed.bind(this),pushArrayStartFixed32:this.pushArrayStartFixed32.bind(this),pushArrayStartFixed64:this.pushArrayStartFixed64.bind(this),pushObjectStart:this.pushObjectStart.bind(this),pushObjectStartFixed:this.pushObjectStartFixed.bind(this),pushObjectStartFixed32:this.pushObjectStartFixed32.bind(this),pushObjectStartFixed64:this.pushObjectStartFixed64.bind(this),pushByteString:this.pushByteString.bind(this),pushByteStringStart:this.pushByteStringStart.bind(this),pushUtf8String:this.pushUtf8String.bind(this),pushUtf8StringStart:this.pushUtf8StringStart.bind(this),pushSimpleUnassigned:this.pushSimpleUnassigned.bind(this),pushTagUnassigned:this.pushTagUnassigned.bind(this),pushTagStart:this.pushTagStart.bind(this),pushTagStart4:this.pushTagStart4.bind(this),pushTagStart8:this.pushTagStart8.bind(this),pushBreak:this.pushBreak.bind(this)},this._heap)}get _depth(){return this._parents.length}get _currentParent(){return this._parents[this._depth-1]}get _ref(){return this._currentParent.ref}_closeParent(){var p=this._parents.pop();if(p.length>0)throw new Error(`Missing ${p.length} elements`);switch(p.type){case c.PARENT.TAG:this._push(this.createTag(p.ref[0],p.ref[1]));break;case c.PARENT.BYTE_STRING:this._push(this.createByteString(p.ref,p.length));break;case c.PARENT.UTF8_STRING:this._push(this.createUtf8String(p.ref,p.length));break;case c.PARENT.MAP:if(p.values%2>0)throw new Error("Odd number of elements in the map");this._push(this.createMap(p.ref,p.length));break;case c.PARENT.OBJECT:if(p.values%2>0)throw new Error("Odd number of elements in the map");this._push(this.createObject(p.ref,p.length));break;case c.PARENT.ARRAY:this._push(this.createArray(p.ref,p.length))}this._currentParent&&this._currentParent.type===c.PARENT.TAG&&this._dec()}_dec(){ +const p=this._currentParent;p.length<0||0===--p.length&&this._closeParent()}_push(val,hasChildren){const p=this._currentParent;switch(p.values++,p.type){case c.PARENT.ARRAY:case c.PARENT.BYTE_STRING:case c.PARENT.UTF8_STRING:p.length>-1?this._ref[this._ref.length-p.length]=val:this._ref.push(val),this._dec();break;case c.PARENT.OBJECT:null!=p.tmpKey?(this._ref[p.tmpKey]=val,p.tmpKey=null,this._dec()):(p.tmpKey=val,"string"!=typeof p.tmpKey&&(p.type=c.PARENT.MAP,p.ref=utils.buildMap(p.ref)));break;case c.PARENT.MAP:null!=p.tmpKey?(this._ref.set(p.tmpKey,val),p.tmpKey=null,this._dec()):p.tmpKey=val;break;case c.PARENT.TAG:this._ref.push(val),hasChildren||this._dec();break;default:throw new Error("Unknown parent type")}}_createParent(obj,type,len){this._parents[this._depth]={type:type,length:len,ref:obj,values:0,tmpKey:null}}_reset(){this._res=[],this._parents=[{type:c.PARENT.ARRAY,length:-1,ref:this._res,values:0,tmpKey:null}]}createTag(tagNumber,value){const typ=this._knownTags[tagNumber];return typ?typ(value):new Tagged(tagNumber,value)}createMap(obj,len){return obj}createObject(obj,len){return obj}createArray(arr,len){return arr}createByteString(raw,len){return Buffer.concat(raw)}createByteStringFromHeap(start,end){return new Buffer(start===end?0:this._heap.slice(start,end))}createInt(val){return val}createInt32(f,g){return utils.buildInt32(f,g)}createInt64(f1,f2,g1,g2){return utils.buildInt64(f1,f2,g1,g2)}createFloat(val){return val}createFloatSingle(a,b,c,d){return ieee754.read([a,b,c,d],0,!1,23,4)}createFloatDouble(a,b,c,d,e,f,g,h){return ieee754.read([a,b,c,d,e,f,g,h],0,!1,52,8)}createInt32Neg(f,g){return-1-utils.buildInt32(f,g)}createInt64Neg(f1,f2,g1,g2){const f=utils.buildInt32(f1,f2),g=utils.buildInt32(g1,g2);return f>c.MAX_SAFE_HIGH?c.NEG_ONE.sub(new Bignumber(f).times(c.SHIFT32).plus(g)):-1-(f*c.SHIFT32+g)}createTrue(){return!0}createFalse(){return!1}createNull(){return null}createUndefined(){}createInfinity(){return 1/0}createInfinityNeg(){return-(1/0)}createNaN(){return NaN}createNaNNeg(){return NaN}createUtf8String(raw,len){return raw.join("")}createUtf8StringFromHeap(start,end){return start===end?"":new Buffer(this._heap.slice(start,end)).toString("utf8")}createSimpleUnassigned(val){return new Simple(val)}pushInt(val){this._push(this.createInt(val))}pushInt32(f,g){this._push(this.createInt32(f,g))}pushInt64(f1,f2,g1,g2){this._push(this.createInt64(f1,f2,g1,g2))}pushFloat(val){this._push(this.createFloat(val))}pushFloatSingle(a,b,c,d){this._push(this.createFloatSingle(a,b,c,d))}pushFloatDouble(a,b,c,d,e,f,g,h){this._push(this.createFloatDouble(a,b,c,d,e,f,g,h))}pushInt32Neg(f,g){this._push(this.createInt32Neg(f,g))}pushInt64Neg(f1,f2,g1,g2){this._push(this.createInt64Neg(f1,f2,g1,g2))}pushTrue(){this._push(this.createTrue())}pushFalse(){this._push(this.createFalse())}pushNull(){this._push(this.createNull())}pushUndefined(){this._push(this.createUndefined())}pushInfinity(){this._push(this.createInfinity())}pushInfinityNeg(){this._push(this.createInfinityNeg())}pushNaN(){this._push(this.createNaN())}pushNaNNeg(){this._push(this.createNaNNeg())}pushArrayStart(){this._createParent([],c.PARENT.ARRAY,-1)}pushArrayStartFixed(len){this._createArrayStartFixed(len)}pushArrayStartFixed32(len1,len2){const len=utils.buildInt32(len1,len2);this._createArrayStartFixed(len)}pushArrayStartFixed64(len1,len2,len3,len4){const len=utils.buildInt64(len1,len2,len3,len4);this._createArrayStartFixed(len)}pushObjectStart(){this._createObjectStartFixed(-1)}pushObjectStartFixed(len){this._createObjectStartFixed(len)}pushObjectStartFixed32(len1,len2){const len=utils.buildInt32(len1,len2);this._createObjectStartFixed(len)}pushObjectStartFixed64(len1,len2,len3,len4){const len=utils.buildInt64(len1,len2,len3,len4);this._createObjectStartFixed(len)}pushByteStringStart(){this._parents[this._depth]={type:c.PARENT.BYTE_STRING,length:-1,ref:[],values:0,tmpKey:null}}pushByteString(start,end){this._push(this.createByteStringFromHeap(start,end))}pushUtf8StringStart(){this._parents[this._depth]={type:c.PARENT.UTF8_STRING,length:-1,ref:[],values:0,tmpKey:null}}pushUtf8String(start,end){this._push(this.createUtf8StringFromHeap(start,end))}pushSimpleUnassigned(val){this._push(this.createSimpleUnassigned(val))}pushTagStart(tag){this._parents[this._depth]={type:c.PARENT.TAG,length:1,ref:[tag]}}pushTagStart4(f,g){this.pushTagStart(utils.buildInt32(f,g))}pushTagStart8(f1,f2,g1,g2){this.pushTagStart(utils.buildInt64(f1,f2,g1,g2))}pushTagUnassigned(tagNumber){this._push(this.createTag(tagNumber))}pushBreak(){if(this._currentParent.length>-1)throw new Error("Unexpected break");this._closeParent()}_createObjectStartFixed(len){if(0===len)return void this._push(this.createObject({}));this._createParent({},c.PARENT.OBJECT,len)}_createArrayStartFixed(len){if(0===len)return void this._push(this.createArray([]));this._createParent(new Array(len),c.PARENT.ARRAY,len)}_decode(input){if(0===input.byteLength)throw new Error("Input too short");this._reset(),this._heap8.set(input);const code=this.parser.parse(input.byteLength);if(this._depth>1){for(;0===this._currentParent.length;)this._closeParent();if(this._depth>1)throw new Error("Undeterminated nesting")}if(code>0)throw new Error("Failed to parse");if(0===this._res.length)throw new Error("No valid result")}decodeFirst(input){return this._decode(input),this._res[0]}decodeAll(input){return this._decode(input),this._res}static decode(input,enc){return"string"==typeof input&&(input=new Buffer(input,enc||"hex")),new Decoder({size:input.length}).decodeFirst(input)}static decodeAll(input,enc){return"string"==typeof input&&(input=new Buffer(input,enc||"hex")),new Decoder({size:input.length}).decodeAll(input)}}Decoder.decodeFirst=Decoder.decode,module.exports=Decoder}).call(exports,__webpack_require__(4),__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const constants=__webpack_require__(92),MT=constants.MT,SIMPLE=constants.SIMPLE,SYMS=constants.SYMS;class Simple{constructor(value){if("number"!=typeof value)throw new Error("Invalid Simple type: "+typeof value);if(value<0||value>255||(0|value)!==value)throw new Error("value must be a small positive integer: "+value);this.value=value}toString(){return"simple("+this.value+")"}inspect(){return"simple("+this.value+")"}encodeCBOR(gen){return gen._pushInt(this.value,MT.SIMPLE_FLOAT)}static isSimple(obj){return obj instanceof Simple}static decode(val,hasParent){switch(null==hasParent&&(hasParent=!0),val){case SIMPLE.FALSE:return!1;case SIMPLE.TRUE:return!0;case SIMPLE.NULL:return hasParent?null:SYMS.NULL;case SIMPLE.UNDEFINED:return hasParent?void 0:SYMS.UNDEFINED;case-1:if(!hasParent)throw new Error("Invalid BREAK");return SYMS.BREAK;default:return new Simple(val)}}}module.exports=Simple},function(module,exports,__webpack_require__){"use strict";class Tagged{constructor(tag,value,err){if(this.tag=tag,this.value=value,this.err=err,"number"!=typeof this.tag)throw new Error("Invalid tag type ("+typeof this.tag+")");if(this.tag<0||(0|this.tag)!==this.tag)throw new Error("Tag must be a positive integer: "+this.tag)}toString(){return`${this.tag}(${JSON.stringify(this.value)})`}encodeCBOR(gen){return gen._pushTag(this.tag),gen.pushAny(this.value)}convert(converters){var er,f;if("function"!=typeof(f=null!=converters?converters[this.tag]:void 0)&&"function"!=typeof(f=Tagged["_tag"+this.tag]))return this;try{return f.call(Tagged,this.value)}catch(error){return er=error,this.err=er,this}}}module.exports=Tagged},function(module,exports,__webpack_require__){(function(Buffer){function StreamCipher(mode,key,iv,decrypt){if(!(this instanceof StreamCipher))return new StreamCipher(mode,key,iv);Transform.call(this),this._finID=Buffer.concat([iv,new Buffer([0,0,0,1])]),iv=Buffer.concat([iv,new Buffer([0,0,0,2])]),this._cipher=new aes.AES(key),this._prev=new Buffer(iv.length),this._cache=new Buffer(""),this._secCache=new Buffer(""),this._decrypt=decrypt,this._alen=0,this._len=0,iv.copy(this._prev),this._mode=mode;var h=new Buffer(4);h.fill(0),this._ghash=new GHASH(this._cipher.encryptBlock(h)),this._authTag=null,this._called=!1}function xorTest(a,b){var out=0;a.length!==b.length&&out++;for(var len=Math.min(a.length,b.length),i=-1;++i>i%8,self._prev=shiftIn(self._prev,decrypt?bit:value);return out}function shiftIn(buffer,value){var len=buffer.length,i=-1,out=new Buffer(buffer.length);for(buffer=Buffer.concat([buffer,new Buffer([value])]);++i>7;return out}exports.encrypt=function(self,chunk,decrypt){for(var len=chunk.length,out=new Buffer(len),i=-1;++i1&&(this._buf=new Buffer(this.toString().replace(/\/$/,"")))}less(key){const list1=this.list(),list2=key.list();for(let i=0;ic2)return!1}return list1.length{const key=new Key(path).child(new Key(SHARDING_FN));("function"==typeof store.getRaw?store.getRaw.bind(store):store.get.bind(store))(key,(err,res)=>{if(err)return callback(err);let shard;try{shard=parseShardFun((res||"").toString().trim())}catch(err){return callback(err)}callback(null,shard)})}),exports.readme=readme,exports.parseShardFun=parseShardFun,exports.Prefix=Prefix,exports.Suffix=Suffix,exports.NextToLast=NextToLast},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const pull=__webpack_require__(5),levelup=__webpack_require__(559),asyncFilter=__webpack_require__(41).utils.asyncFilter,asyncSort=__webpack_require__(41).utils.asyncSort,Key=__webpack_require__(41).Key;class LevelDatastore{constructor(path,opts){this.db=levelup(path,Object.assign(opts||{},{compression:!1,valueEncoding:"binary"}))}open(callback){this.db.open(callback)}put(key,value,callback){this.db.put(key.toString(),value,callback)}get(key,callback){this.db.get(key.toString(),callback)}has(key,callback){this.db.get(key.toString(),(err,res)=>{if(err)return err.notFound?void callback(null,!1):void callback(err);callback(null,!0)})}delete(key,callback){this.db.del(key.toString(),callback)}close(callback){this.db.close(callback)}batch(){const ops=[];return{put:(key,value)=>{ops.push({type:"put",key:key.toString(),value:value})},delete:key=>{ops.push({type:"del",key:key.toString()})},commit:callback=>{this.db.batch(ops,callback)}}}query(q){let values=!0;null!=q.keysOnly&&(values=!q.keysOnly);const iter=this.db.db.iterator({keys:!0,values:values,keyAsBuffer:!0}),rawStream=(end,cb)=>{if(end)return iter.end(err=>{cb(err||end)});iter.next((err,key,value)=>{if(err)return cb(err);if(null==err&&null==key&&null==value)return iter.end(err=>{cb(err||!0)});const res={key:new Key(key,!1)};values&&(res.value=new Buffer(value)),cb(null,res)})};let tasks=[rawStream],filters=[];if(null!=q.prefix){const prefix=q.prefix;filters.push((e,cb)=>cb(null,e.key.toString().startsWith(prefix)))}if(null!=q.filters&&(filters=filters.concat(q.filters)),tasks=tasks.concat(filters.map(f=>asyncFilter(f))),null!=q.orders&&(tasks=tasks.concat(q.orders.map(o=>asyncSort(o)))),null!=q.offset){let i=0;tasks.push(pull.filter(()=>i++>=q.offset))}return null!=q.limit&&tasks.push(pull.take(q.limit)),pull.apply(null,tasks)}}module.exports=LevelDatastore}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function isSpecificValue(val){return val instanceof Buffer||val instanceof Date||val instanceof RegExp}function cloneSpecificValue(val){if(val instanceof Buffer){var x=new Buffer(val.length);return val.copy(x),x}if(val instanceof Date)return new Date(val.getTime());if(val instanceof RegExp)return new RegExp(val);throw new Error("Unexpected situation")}function deepCloneArray(arr){var clone=[];return arr.forEach(function(item,index){"object"==typeof item&&null!==item?Array.isArray(item)?clone[index]=deepCloneArray(item):isSpecificValue(item)?clone[index]=cloneSpecificValue(item):clone[index]=deepExtend({},item):clone[index]=item}),clone}var deepExtend=module.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var val,src,target=arguments[0],args=Array.prototype.slice.call(arguments,1);return args.forEach(function(obj){"object"!=typeof obj||null===obj||Array.isArray(obj)||Object.keys(obj).forEach(function(key){return src=target[key],val=obj[key],val===target?void 0:"object"!=typeof val||null===val?void(target[key]=val):Array.isArray(val)?void(target[key]=deepCloneArray(val)):isSpecificValue(val)?void(target[key]=cloneSpecificValue(val)):"object"!=typeof src||null===src||Array.isArray(src)?void(target[key]=deepExtend({},val)):void(target[key]=deepExtend(src,val))})}),target}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(process){function AbstractChainedBatch(db){this._db=db,this._operations=[],this._written=!1}AbstractChainedBatch.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},AbstractChainedBatch.prototype.put=function(key,value){this._checkWritten();var err=this._db._checkKey(key,"key",this._db._isBuffer);if(err)throw err;return this._db._isBuffer(key)||(key=String(key)),this._db._isBuffer(value)||(value=String(value)),"function"==typeof this._put?this._put(key,value):this._operations.push({type:"put",key:key,value:value}),this},AbstractChainedBatch.prototype.del=function(key){this._checkWritten();var err=this._db._checkKey(key,"key",this._db._isBuffer);if(err)throw err;return this._db._isBuffer(key)||(key=String(key)),"function"==typeof this._del?this._del(key):this._operations.push({type:"del",key:key}),this},AbstractChainedBatch.prototype.clear=function(){return this._checkWritten(),this._operations=[],"function"==typeof this._clear&&this._clear(),this},AbstractChainedBatch.prototype.write=function(options,callback){if(this._checkWritten(),"function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("write() requires a callback argument");return"object"!=typeof options&&(options={}),this._written=!0,"function"==typeof this._write?this._write(callback):"function"==typeof this._db._batch?this._db._batch(this._operations,options,callback):void process.nextTick(callback)},module.exports=AbstractChainedBatch}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(process){function AbstractIterator(db){this.db=db,this._ended=!1,this._nexting=!1}AbstractIterator.prototype.next=function(callback){var self=this;if("function"!=typeof callback)throw new Error("next() requires a callback argument");return self._ended?callback(new Error("cannot call next() after end()")):self._nexting?callback(new Error("cannot call next() before previous next() has completed")):(self._nexting=!0,"function"==typeof self._next?self._next(function(){self._nexting=!1,callback.apply(null,arguments)}):void process.nextTick(function(){self._nexting=!1,callback()}))},AbstractIterator.prototype.end=function(callback){if("function"!=typeof callback)throw new Error("end() requires a callback argument");return this._ended?callback(new Error("end() already called on iterator")):(this._ended=!0,"function"==typeof this._end?this._end(callback):void process.nextTick(callback))},module.exports=AbstractIterator}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(process,Buffer){function AbstractLevelDOWN(location){if(!arguments.length||void 0===location)throw new Error("constructor requires at least a location argument");if("string"!=typeof location)throw new Error("constructor requires a location string argument");this.location=location,this.status="new"}var xtend=__webpack_require__(37),AbstractIterator=__webpack_require__(202),AbstractChainedBatch=__webpack_require__(201);AbstractLevelDOWN.prototype.open=function(options,callback){var self=this,oldStatus=this.status;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("open() requires a callback argument");"object"!=typeof options&&(options={}),options.createIfMissing=0!=options.createIfMissing,options.errorIfExists=!!options.errorIfExists,"function"==typeof this._open?(this.status="opening",this._open(options,function(err){if(err)return self.status=oldStatus,callback(err);self.status="open",callback()})):(this.status="open",process.nextTick(callback))},AbstractLevelDOWN.prototype.close=function(callback){var self=this,oldStatus=this.status;if("function"!=typeof callback)throw new Error("close() requires a callback argument");"function"==typeof this._close?(this.status="closing",this._close(function(err){if(err)return self.status=oldStatus,callback(err);self.status="closed",callback()})):(this.status="closed",process.nextTick(callback))},AbstractLevelDOWN.prototype.get=function(key,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("get() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),"object"!=typeof options&&(options={}),options.asBuffer=0!=options.asBuffer,"function"==typeof this._get?this._get(key,options,callback):void process.nextTick(function(){callback(new Error("NotFound"))}))},AbstractLevelDOWN.prototype.put=function(key,value,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("put() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),null==value||this._isBuffer(value)||process.browser||(value=String(value)),"object"!=typeof options&&(options={}),"function"==typeof this._put?this._put(key,value,options,callback):void process.nextTick(callback))},AbstractLevelDOWN.prototype.del=function(key,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("del() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),"object"!=typeof options&&(options={}),"function"==typeof this._del?this._del(key,options,callback):void process.nextTick(callback))},AbstractLevelDOWN.prototype.batch=function(array,options,callback){if(!arguments.length)return this._chainedBatch();if("function"==typeof options&&(callback=options),"function"==typeof array&&(callback=array),"function"!=typeof callback)throw new Error("batch(array) requires a callback argument");if(!Array.isArray(array))return callback(new Error("batch(array) requires an array argument"));options&&"object"==typeof options||(options={});for(var e,err,i=0,l=array.length;i0)if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var _e=new Error("stream.unshift() after end event");stream.emit("error",_e)}else{var skipAdd;!state.decoder||addToFront||encoding||(chunk=state.decoder.write(chunk),skipAdd=!state.objectMode&&0===chunk.length),addToFront||(state.reading=!1),skipAdd||(state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream))),maybeReadMore(stream,state)}else addToFront||(state.reading=!1);return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||0===state.length&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}function chunkInvalid(state,chunk){var er=null;return Buffer.isBuffer(chunk)||"string"==typeof chunk||null===chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function onEofChunk(stream,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?processNextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,processNextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return nstr.length?str.length:n;if(ret+=nb===str.length?str:str.slice(0,n),0===(n-=nb)){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=bufferShim.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),0===(n-=nb)){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,processNextTick(endReadableNT,state,stream))}function endReadableNT(state,stream){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}function indexOf(xs,x){for(var i=0,l=xs.length;i=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n0?fromList(n,state):null,null===ret?(state.needReadable=!0,n=0):state.length-=n,0===state.length&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),null!==ret&&this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable){debug("onunpipe"),readable===src&&cleanup()}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",cleanup),src.removeListener("data",ondata),cleanedUp=!0,!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain()}function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1,!1!==dest.write(chunk)||increasedAwaitDrain||((1===state.pipesCount&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EElistenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:cleanup;state.endEmitted?processNextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1,increasedAwaitDrain=!1;return src.on("data",ondata),prependListener(dest,"error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState;if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i-1?setImmediate:processNextTick;Writable.WritableState=WritableState;var util=__webpack_require__(6);util.inherits=__webpack_require__(1);var internalUtil={deprecate:__webpack_require__(72)},Stream=__webpack_require__(208),Buffer=__webpack_require__(0).Buffer,bufferShim=__webpack_require__(14);util.inherits(Writable,Stream),WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(_){}}();var realHasInstance;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return!!realHasInstance.call(this,object)||object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=Buffer.isBuffer(chunk);return"function"==typeof encoding&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),"function"!=typeof cb&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,state.writing||state.corked||state.finished||state.bufferProcessing||!state.bufferedRequest||clearBuffer(this,state))},Writable.prototype.setDefaultEncoding=function(encoding){if("string"==typeof encoding&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this},Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;"function"==typeof chunk?(cb=chunk,chunk=null,encoding=null):"function"==typeof encoding&&(cb=encoding,encoding=null),null!==chunk&&void 0!==chunk&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||state.finished||endWritable(this,state,cb)}}).call(exports,__webpack_require__(2),__webpack_require__(22).setImmediate)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(8).EventEmitter},function(module,exports,__webpack_require__){(function(Buffer){const utils=__webpack_require__(210),params=__webpack_require__(238),BN=utils.BN;var BlockHeader=module.exports=function(data){var fields=[{name:"parentHash",length:32,default:utils.zeros(32)},{name:"uncleHash",default:utils.SHA3_RLP_ARRAY},{name:"coinbase",length:20,default:utils.zeros(20)},{name:"stateRoot",length:32,default:utils.zeros(32)},{name:"transactionsTrie",length:32,default:utils.SHA3_RLP},{name:"receiptTrie",length:32,default:utils.SHA3_RLP},{name:"bloom",default:utils.zeros(256)},{name:"difficulty",default:new Buffer([])},{name:"number",default:utils.intToBuffer(params.homeSteadForkNumber.v)},{name:"gasLimit",default:new Buffer("ffffffffffffff","hex")},{name:"gasUsed",empty:!0,default:new Buffer([])},{name:"timestamp",default:new Buffer([])},{name:"extraData",allowZero:!0,empty:!0,default:new Buffer([])},{name:"mixHash",default:utils.zeros(32)},{name:"nonce",default:new Buffer([])}];utils.defineProperties(this,fields,data)};BlockHeader.prototype.canonicalDifficulty=function(parentBlock){const blockTs=new BN(this.timestamp),parentTs=new BN(parentBlock.header.timestamp),parentDif=new BN(parentBlock.header.difficulty),minimumDifficulty=new BN(params.minimumDifficulty.v);var dif,offset=parentDif.div(new BN(params.difficultyBoundDivisor.v));if(this.isHomestead()){var a=blockTs.sub(parentTs).idivn(10).ineg().iaddn(1),cutoff=new BN(-99);1===cutoff.cmp(a)&&(a=cutoff),dif=parentDif.add(offset.mul(a))}else dif=1===parentTs.addn(params.durationLimit.v).cmp(blockTs)?offset.add(parentDif):parentDif.sub(offset);var exp=new BN(this.number).idivn(1e5).isubn(2);return exp.isNeg()||dif.iadd(new BN(2).pow(exp)),dif.cmp(minimumDifficulty)===-1&&(dif=minimumDifficulty),dif},BlockHeader.prototype.validateDifficulty=function(parentBlock){return 0===this.canonicalDifficulty(parentBlock).cmp(new BN(this.difficulty))},BlockHeader.prototype.validateGasLimit=function(parentBlock){const pGasLimit=utils.bufferToInt(parentBlock.header.gasLimit),gasLimit=utils.bufferToInt(this.gasLimit),a=Math.floor(pGasLimit/params.gasLimitBoundDivisor.v),maxGasLimit=pGasLimit+a,minGasLimit=pGasLimit-a;return maxGasLimit>gasLimit&&minGasLimitparams.maximumExtraDataSize.v?cb("invalid amount of extra data"):void cb():cb("invalid gas limit"):cb("invalid Difficulty")})},BlockHeader.prototype.hash=function(){return utils.rlphash(this.raw)},BlockHeader.prototype.isGenesis=function(){return""===this.number.toString("hex")},BlockHeader.prototype.isHomestead=function(){return utils.bufferToInt(this.number)>=params.homeSteadForkNumber.v},BlockHeader.prototype.isHomesteadReprice=function(){return utils.bufferToInt(this.number)>=params.homesteadRepriceForkNumber.v}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){const createKeccakHash=__webpack_require__(547),secp256k1=__webpack_require__(162),assert=__webpack_require__(7),rlp=__webpack_require__(52),BN=__webpack_require__(20),createHash=__webpack_require__(75);Object.assign(exports,__webpack_require__(422)),exports.MAX_INTEGER=new BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),exports.TWO_POW256=new BN("10000000000000000000000000000000000000000000000000000000000000000",16),exports.SHA3_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",exports.SHA3_NULL=Buffer.from(exports.SHA3_NULL_S,"hex"),exports.SHA3_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",exports.SHA3_RLP_ARRAY=Buffer.from(exports.SHA3_RLP_ARRAY_S,"hex"),exports.SHA3_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",exports.SHA3_RLP=Buffer.from(exports.SHA3_RLP_S,"hex"),exports.BN=BN,exports.rlp=rlp,exports.secp256k1=secp256k1,exports.zeros=function(bytes){return Buffer.allocUnsafe(bytes).fill(0)},exports.setLengthLeft=exports.setLength=function(msg,length,right){var buf=exports.zeros(length);return msg=exports.toBuffer(msg),right?msg.length0&&"0"===first.toString();)a=a.slice(1),first=a[0];return a},exports.toBuffer=function(v){if(!Buffer.isBuffer(v))if(Array.isArray(v))v=Buffer.from(v);else if("string"==typeof v)v=exports.isHexPrefixed(v)?Buffer.from(exports.padToEven(exports.stripHexPrefix(v)),"hex"):Buffer.from(v);else if("number"==typeof v)v=exports.intToBuffer(v);else if(null===v||void 0===v)v=Buffer.allocUnsafe(0);else{if(!v.toArray)throw new Error("invalid type");v=Buffer.from(v.toArray())}return v},exports.bufferToInt=function(buf){return new BN(exports.toBuffer(buf)).toNumber()},exports.bufferToHex=function(buf){return buf=exports.toBuffer(buf),"0x"+buf.toString("hex")},exports.fromSigned=function(num){return new BN(num).fromTwos(256)},exports.toUnsigned=function(num){return Buffer.from(num.toTwos(256).toArray())},exports.sha3=function(a,bits){return a=exports.toBuffer(a),bits||(bits=256),createKeccakHash("keccak"+bits).update(a).digest()},exports.sha256=function(a){return a=exports.toBuffer(a),createHash("sha256").update(a).digest()},exports.ripemd160=function(a,padded){a=exports.toBuffer(a);var hash=createHash("rmd160").update(a).digest();return padded===!0?exports.setLength(hash,32):hash},exports.rlphash=function(a){return exports.sha3(rlp.encode(a))},exports.isValidPrivate=function(privateKey){return secp256k1.privateKeyVerify(privateKey)},exports.isValidPublic=function(publicKey,sanitize){return 64===publicKey.length?secp256k1.publicKeyVerify(Buffer.concat([Buffer.from([4]),publicKey])):!!sanitize&&secp256k1.publicKeyVerify(publicKey)},exports.pubToAddress=exports.publicToAddress=function(pubKey,sanitize){return pubKey=exports.toBuffer(pubKey),sanitize&&64!==pubKey.length&&(pubKey=secp256k1.publicKeyConvert(pubKey,!1).slice(1)),assert(64===pubKey.length),exports.sha3(pubKey).slice(-20)};var privateToPublic=exports.privateToPublic=function(privateKey){return privateKey=exports.toBuffer(privateKey),secp256k1.publicKeyCreate(privateKey,!1).slice(1)};exports.importPublic=function(publicKey){return publicKey=exports.toBuffer(publicKey),64!==publicKey.length&&(publicKey=secp256k1.publicKeyConvert(publicKey,!1).slice(1)),publicKey},exports.ecsign=function(msgHash,privateKey){var sig=secp256k1.sign(msgHash,privateKey),ret={};return ret.r=sig.signature.slice(0,32),ret.s=sig.signature.slice(32,64),ret.v=sig.recovery+27,ret},exports.hashPersonalMessage=function(message){var prefix=exports.toBuffer("Ethereum Signed Message:\n"+message.length.toString());return exports.sha3(Buffer.concat([prefix,message]))},exports.ecrecover=function(msgHash,v,r,s){var signature=Buffer.concat([exports.setLength(r,32),exports.setLength(s,32)],64),recovery=v-27;if(0!==recovery&&1!==recovery)throw new Error("Invalid signature v value");var senderPubKey=secp256k1.recover(msgHash,signature,recovery);return secp256k1.publicKeyConvert(senderPubKey,!1).slice(1)},exports.toRpcSig=function(v,r,s){if(27!==v&&28!==v)throw new Error("Invalid recovery id") +;return exports.bufferToHex(Buffer.concat([exports.setLengthLeft(r,32),exports.setLengthLeft(s,32),exports.toBuffer(v-27)]))},exports.fromRpcSig=function(sig){if(sig=exports.toBuffer(sig),65!==sig.length)throw new Error("Invalid signature length");var v=sig[64];return v<27&&(v+=27),{v:v,r:sig.slice(0,32),s:sig.slice(32,64)}},exports.privateToAddress=function(privateKey){return exports.publicToAddress(privateToPublic(privateKey))},exports.isValidAddress=function(address){return/^0x[0-9a-fA-F]{40}$/i.test(address)},exports.toChecksumAddress=function(address){address=exports.stripHexPrefix(address).toLowerCase();for(var hash=exports.sha3(address).toString("hex"),ret="0x",i=0;i=8?address[i].toUpperCase():address[i];return ret},exports.isValidChecksumAddress=function(address){return exports.isValidAddress(address)&&exports.toChecksumAddress(address)===address},exports.generateAddress=function(from,nonce){return from=exports.toBuffer(from),nonce=new BN(nonce),nonce=nonce.isZero()?null:Buffer.from(nonce.toArray()),exports.rlphash([from,nonce]).slice(-20)},exports.isPrecompiled=function(address){var a=exports.unpad(address);return 1===a.length&&a[0]>0&&a[0]<5},exports.addHexPrefix=function(str){return"string"!=typeof str?str:exports.isHexPrefixed(str)?str:"0x"+str},exports.isValidSignature=function(v,r,s,homestead){const SECP256K1_N_DIV_2=new BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),SECP256K1_N=new BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===r.length&&32===s.length&&((27===v||28===v)&&(r=new BN(r),s=new BN(s),!(r.isZero()||r.gt(SECP256K1_N)||s.isZero()||s.gt(SECP256K1_N))&&(homestead!==!1||1!==new BN(s).cmp(SECP256K1_N_DIV_2))))},exports.baToJSON=function(ba){if(Buffer.isBuffer(ba))return"0x"+ba.toString("hex");if(ba instanceof Array){for(var array=[],i=0;i=v.length,"The field "+field.name+" must not have more "+field.length+" bytes")):field.allowZero&&0===v.length||!field.length||assert(field.length===v.length,"The field "+field.name+" must have byte length of "+field.length),self.raw[i]=v}self._fields.push(field.name),Object.defineProperty(self,field.name,{enumerable:!0,configurable:!0,get:getter,set:setter}),field.default&&(self[field.name]=field.default),field.alias&&Object.defineProperty(self,field.alias,{enumerable:!1,configurable:!0,set:setter,get:getter})}),data)if("string"==typeof data&&(data=Buffer.from(exports.stripHexPrefix(data),"hex")),Buffer.isBuffer(data)&&(data=rlp.decode(data)),Array.isArray(data)){if(data.length>self._fields.length)throw new Error("wrong number of fields in data");data.forEach(function(d,i){self[self._fields[i]]=exports.toBuffer(d)})}else{if("object"!=typeof data)throw new Error("invalid data");{const keys=Object.keys(data);fields.forEach(function(field){keys.indexOf(field.name)!==-1&&(self[field.name]=data[field.name]),keys.indexOf(field.alias)!==-1&&(self[field.alias]=data[field.alias])})}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function EVP_BytesToKey(password,salt,keyLen,ivLen){Buffer.isBuffer(password)||(password=new Buffer(password,"binary")),salt&&!Buffer.isBuffer(salt)&&(salt=new Buffer(salt,"binary")),keyLen/=8,ivLen=ivLen||0;for(var md_buf,i,ki=0,ii=0,key=new Buffer(keyLen),iv=new Buffer(ivLen),addmd=0,bufs=[];;){if(addmd++>0&&bufs.push(md_buf),bufs.push(password),salt&&bufs.push(salt),md_buf=md5(Buffer.concat(bufs)),bufs=[],i=0,keyLen>0)for(;;){if(0===keyLen)break;if(i===md_buf.length)break;key[ki++]=md_buf[i],keyLen--,i++}if(ivLen>0&&i!==md_buf.length)for(;;){if(0===ivLen)break;if(i===md_buf.length)break;iv[ii++]=md_buf[i],ivLen--,i++}if(0===keyLen&&0===ivLen)break}for(i=0;i0)if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var _e=new Error("stream.unshift() after end event");stream.emit("error",_e)}else{var skipAdd;!state.decoder||addToFront||encoding||(chunk=state.decoder.write(chunk),skipAdd=!state.objectMode&&0===chunk.length),addToFront||(state.reading=!1),skipAdd||(state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream))),maybeReadMore(stream,state)}else addToFront||(state.reading=!1);return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||0===state.length&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}function chunkInvalid(state,chunk){var er=null;return Buffer.isBuffer(chunk)||"string"==typeof chunk||null===chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function onEofChunk(stream,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?processNextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,processNextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return nstr.length?str.length:n;if(ret+=nb===str.length?str:str.slice(0,n),0===(n-=nb)){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=bufferShim.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),0===(n-=nb)){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,processNextTick(endReadableNT,state,stream))}function endReadableNT(state,stream){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}function indexOf(xs,x){for(var i=0,l=xs.length;i=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n0?fromList(n,state):null,null===ret?(state.needReadable=!0,n=0):state.length-=n,0===state.length&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),null!==ret&&this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable){debug("onunpipe"),readable===src&&cleanup()}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",cleanup),src.removeListener("data",ondata),cleanedUp=!0,!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain()}function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1,!1!==dest.write(chunk)||increasedAwaitDrain||((1===state.pipesCount&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EElistenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:cleanup;state.endEmitted?processNextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1,increasedAwaitDrain=!1;return src.on("data",ondata),prependListener(dest,"error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState;if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i-1?setImmediate:processNextTick;Writable.WritableState=WritableState;var util=__webpack_require__(6);util.inherits=__webpack_require__(1);var internalUtil={deprecate:__webpack_require__(72)},Stream=__webpack_require__(216),Buffer=__webpack_require__(0).Buffer,bufferShim=__webpack_require__(14);util.inherits(Writable,Stream),WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(_){}}();var realHasInstance;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return!!realHasInstance.call(this,object)||object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=Buffer.isBuffer(chunk);return"function"==typeof encoding&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),"function"!=typeof cb&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,state.writing||state.corked||state.finished||state.bufferProcessing||!state.bufferedRequest||clearBuffer(this,state))},Writable.prototype.setDefaultEncoding=function(encoding){if("string"==typeof encoding&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this},Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;"function"==typeof chunk?(cb=chunk,chunk=null,encoding=null):"function"==typeof encoding&&(cb=encoding,encoding=null),null!==chunk&&void 0!==chunk&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||state.finished||endWritable(this,state,cb)}}).call(exports,__webpack_require__(2),__webpack_require__(22).setImmediate)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(8).EventEmitter},function(module,exports,__webpack_require__){exports=module.exports=__webpack_require__(213),exports.Stream=exports,exports.Readable=exports,exports.Writable=__webpack_require__(215),exports.Duplex=__webpack_require__(59),exports.Transform=__webpack_require__(214),exports.PassThrough=__webpack_require__(446)},function(module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=8*nBytes-mLen-1,eMax=(1<>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];for(i+=d,e=s&(1<<-nBits)-1,s>>=-nBits,nBits+=eLen;nBits>0;e=256*e+buffer[offset+i],i+=d,nBits-=8);for(m=e&(1<<-nBits)-1,e>>=-nBits,nBits+=mLen;nBits>0;m=256*m+buffer[offset+i],i+=d,nBits-=8);if(0===e)e=1-eBias;else{if(e===eMax)return m?NaN:1/0*(s?-1:1);m+=Math.pow(2,mLen),e-=eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)},exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c,eLen=8*nBytes-mLen-1,eMax=(1<>1,rt=23===mLen?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||0===value&&1/value<0?1:0;for(value=Math.abs(value),isNaN(value)||value===1/0?(m=isNaN(value)?1:0,e=eMax):(e=Math.floor(Math.log(value)/Math.LN2),value*(c=Math.pow(2,-e))<1&&(e--,c*=2),value+=e+eBias>=1?rt/c:rt*Math.pow(2,1-eBias),value*c>=2&&(e++,c/=2),e+eBias>=eMax?(m=0,e=eMax):e+eBias>=1?(m=(value*c-1)*Math.pow(2,mLen), +e+=eBias):(m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen),e=0));mLen>=8;buffer[offset+i]=255&m,i+=d,m/=256,mLen-=8);for(e=e<0;buffer[offset+i]=255&e,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=128*s}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function namespaceType(ns){const parts=ns.split(":");return parts.length<2?"":parts.slice(0,-1).join(":")}function namespaceValue(ns){const parts=ns.split(":");return parts[parts.length-1]}const path=__webpack_require__(45),uuid=__webpack_require__(121);class Key{constructor(s,clean){if("string"==typeof s?this._buf=new Buffer(s):Buffer.isBuffer(s)&&(this._buf=s),null==clean&&(clean=!0),clean&&this.clean(),0===this._buf.length||47!==this._buf[0])throw new Error(`Invalid key: ${this.toString()}`)}toString(encoding){return this._buf.toString(encoding||"utf8")}toBuffer(){return this._buf}get[Symbol.toStringTag](){return`[Key ${this.toString()}]`}static withNamespaces(list){return new Key(list.join("/"))}static random(){return new Key(uuid().replace(/-/g,""))}clean(){this._buf&&0!==this._buf.length||(this._buf=new Buffer("/")),47!==this._buf[0]&&(this._buf=Buffer.concat([new Buffer("/"),this._buf])),this._buf=new Buffer(path.normalize(this.toString())),this.toString().length>1&&(this._buf=new Buffer(this.toString().replace(/\/$/,"")))}less(key){const list1=this.list(),list2=key.list();for(let i=0;ic2)return!1}return list1.lengththis._fsStore.open(err=>{if(err&&"Already open"===err.message)return cb();cb(err)}),cb=>this.config.set(config,cb),cb=>this.version.set(5,cb)],callback)}open(callback){if(!this.closed)return callback(new Error("repo is already open"));log("opening at: %s",this.path),waterfall([cb=>this._fsStore.open(err=>{if(err&&"Already open"===err.message)return cb();cb(err)}),cb=>this._isInitialized(cb),cb=>this._locker.lock(this.path,cb),(lck,cb)=>{log("aquired repo.lock"),this.lockfile=lck,log("creating flatfs");const FsStore=this.options.fs,s=new FsStore(path.join(this.path,"blocks"),this._fsOptions);if(this.options.sharding){const shard=new core.shard.NextToLast(2);ShardingStore.createOrOpen(s,shard,cb)}else cb(null,s)},(flatfs,cb)=>{log("Flatfs store opened"),this.store=new MountStore([{prefix:new Key("blocks"),datastore:flatfs},{prefix:new Key("/"),datastore:new LevelStore(path.join(this.path,"datastore"),{db:this.options.level})}]),this.blockstore=blockstore(this),this.closed=!1,cb()}],err=>{if(err&&this.lockfile)return this.lockfile.close(err2=>{log("error removing lock",err2),callback(err)});callback(err)})}_isInitialized(callback){log("init check"),parallel([cb=>this.config.exists(cb),cb=>this.version.check(5,cb)],(err,res)=>{return log("init",err,res),err?callback(err):res[0]?void callback():callback(new Error("repo is not initialized yet"))})}close(callback){if(this.closed)return callback(new Error("repo is already closed"));log("closing at: %s",this.path),series([cb=>this._fsStore.delete(apiFile,err=>{if(err&&err.message.startsWith("ENOENT"))return cb();cb(err)}),cb=>this.store.close(cb),cb=>this._fsStore.close(cb),cb=>{log("unlocking"),this.closed=!0,this.lockfile.close(cb)},cb=>{this.lockfile=null,cb()}],err=>callback(err))}exists(callback){this.version.exists(callback)}setApiAddress(addr,callback){this._fsStore.put(apiFile,Buffer.from(addr.toString()),callback)}apiAddress(callback){this._fsStore.get(apiFile,(err,rawAddr)=>{if(err)return callback(err);callback(null,new Multiaddr(rawAddr.toString()))})}}module.exports=IpfsRepo},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),setImmediate=__webpack_require__(11),log=debug("repo:lock"),LOCKS={};exports.lock=((dir,callback)=>{const file=dir+"/repo.lock";log("locking %s",file),LOCKS[file]=!0;const closer={close(cb){LOCKS[file]&&delete LOCKS[file],setImmediate(cb)}};setImmediate(()=>{callback(null,closer)})}),exports.locked=((dir,callback)=>{const file=dir+"/repo.lock";log("checking lock: %s");const locked=LOCKS[file];setImmediate(()=>{callback(null,locked)})})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(17);module.exports=(multihash=>{return Buffer.isBuffer(multihash)?mh.toB58String(multihash):multihash})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function flattenObject(obj,delimiter){return delimiter=delimiter||"/",0===Object.keys(obj).length?[]:traverse(obj).reduce(function(acc,x){"object"==typeof x&&x["/"]&&this.update(void 0);const path=this.path.join(delimiter);return""!==path&&acc.push({path:path,value:x}),acc},[])}const util=__webpack_require__(225),traverse=__webpack_require__(817);exports=module.exports,exports.multicodec="dag-cbor",exports.resolve=((block,path,callback)=>{"function"==typeof path&&(callback=path,path=void 0),util.deserialize(block.data,(err,node)=>{if(err)return callback(err);if(!path||"/"===path)return callback(null,{value:node,remainderPath:""});const parts=path.split("/"),val=traverse(node).get(parts);if(val)return callback(null,{value:val,remainderPath:""});let value,len=parts.length;for(let i=0;i{"function"==typeof options&&(callback=options,options=void 0),options=options||{},util.deserialize(block.data,(err,node)=>{if(err)return callback(err);callback(null,flattenObject(node).map(el=>el.path))})}),exports.isLink=((block,path,callback)=>{exports.resolve(block,path,(err,result)=>{return err?callback(err):result.remainderPath.length>0?callback(new Error("path out of scope")):void("object"==typeof result.value&&result.value["/"]?callback(null,result.value):callback(null,!1))})})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function tagCID(cid){return"string"==typeof cid&&(cid=new CID(cid).buffer),new cbor.Tagged(CID_CBOR_TAG,Buffer.concat([new Buffer("00","hex"),cid]))}function replaceCIDbyTAG(dagNode){function transform(obj){if(!obj||Buffer.isBuffer(obj)||"string"==typeof obj)return obj;if(Array.isArray(obj))return obj.map(transform);const keys=Object.keys(obj);if(1===keys.length&&"/"===keys[0])return tagCID(obj["/"]);if(keys.length>0){let out={};return keys.forEach(key=>{"object"==typeof obj[key]?out[key]=transform(obj[key]):out[key]=obj[key]}),out}return obj}let circular;try{circular=isCircular(dagNode)}catch(e){circular=!1}if(circular)throw new Error("The object passed has circular references");return transform(dagNode)}const cbor=__webpack_require__(371),multihashing=__webpack_require__(30),CID=__webpack_require__(12),waterfall=__webpack_require__(9),setImmediate=__webpack_require__(11),isCircular=__webpack_require__(538),resolver=__webpack_require__(224),CID_CBOR_TAG=42,decoder=new cbor.Decoder({tags:{[CID_CBOR_TAG]:val=>{return val=val.slice(1),{"/":val}}}});exports=module.exports,exports.serialize=((dagNode,callback)=>{let serialized;try{const dagNodeTagged=replaceCIDbyTAG(dagNode);serialized=cbor.encode(dagNodeTagged)}catch(err){return setImmediate(()=>callback(err))}setImmediate(()=>callback(null,serialized))}),exports.deserialize=((data,callback)=>{let deserialized;try{deserialized=decoder.decodeFirst(data)}catch(err){return setImmediate(()=>callback(err))}setImmediate(()=>callback(null,deserialized))}),exports.cid=((dagNode,callback)=>{waterfall([cb=>exports.serialize(dagNode,cb),(serialized,cb)=>multihashing(serialized,"sha2-256",cb),(mh,cb)=>cb(null,new CID(1,resolver.multicodec,mh))],callback)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const Account=__webpack_require__(419),cidForHash=__webpack_require__(509).cidForHash;exports.deserialize=function(data,callback){let deserialized;try{deserialized=new Account(data)}catch(err){return callback(err)}callback(null,deserialized)},exports.serialize=function(account,callback){let serialized;try{serialized=account.serialize()}catch(err){return callback(err)}callback(null,serialized)},exports.cid=function(account,callback){let cid;try{cid=cidForHash("eth-account-snapshot",account.hash())}catch(err){return callback(err)}callback(null,cid)}},function(module,exports,__webpack_require__){"use strict";function cidForHash(codec,rawhash){return new CID(1,codec,multihashes.encode(rawhash,"keccak-256"))}const CID=__webpack_require__(512),multihashes=__webpack_require__(103);module.exports={cidForHash:cidForHash}},function(module,exports,__webpack_require__){"use strict";const async=__webpack_require__(86),RLP=__webpack_require__(52),multihash=__webpack_require__(516),cidForHash=__webpack_require__(227).cidForHash;exports.deserialize=function(data,callback){let deserialized;try{deserialized=RLP.decode(data)}catch(err){return callback(err)}callback(null,deserialized)},exports.serialize=function(blockList,callback){let serialized;try{serialized=RLP.encode(blockList)}catch(err){return callback(err)}callback(null,serialized)},exports.cid=function(blockList,callback){async.waterfall([cb=>exports.serialize(blockList,cb),(data,cb)=>multihash.digest(data,"keccak-256",cb),(mhash,cb)=>{let cid;try{cid=cidForHash("eth-block-list",mhash)}catch(err){return cb(err)}cb(null,cid)}],callback)}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function validate(multihash){exports.decode(multihash)}const bs58=__webpack_require__(24),cs=__webpack_require__(520),varint=__webpack_require__(16);exports.toHexString=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return hash.toString("hex")},exports.fromHexString=function(hash){return new Buffer(hash,"hex")},exports.toB58String=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return bs58.encode(hash)},exports.fromB58String=function(hash){let encoded=hash;return Buffer.isBuffer(hash)&&(encoded=hash.toString()),new Buffer(bs58.decode(encoded))},exports.decode=function(buf){if(!Buffer.isBuffer(buf))throw new Error("multihash must be a Buffer");if(buf.length<3)throw new Error("multihash too short. must be > 3 bytes.");let code=varint.decode(buf);if(!exports.isValidCode(code))throw new Error(`multihash unknown function code: 0x${code.toString(16)}`);buf=buf.slice(varint.decode.bytes);let len=varint.decode(buf);if(len<1)throw new Error(`multihash invalid length: 0x${len.toString(16)}`);if(buf=buf.slice(varint.decode.bytes),buf.length!==len)throw new Error(`multihash length inconsistent: 0x${buf.toString("hex")}`);return{code:code,name:cs.codes[code],length:len,digest:buf}},exports.encode=function(digest,code,length){if(!digest||!code)throw new Error("multihash encode requires at least two args: digest, code");const hashfn=exports.coerceCode(code);if(!Buffer.isBuffer(digest))throw new Error("digest should be a Buffer");if(null==length&&(length=digest.length),length&&digest.length!==length)throw new Error("digest length should be equal to specified length.");return Buffer.concat([new Buffer(varint.encode(hashfn)),new Buffer(varint.encode(length)),digest])},exports.coerceCode=function(name){let code=name;if("string"==typeof name){if(!cs.names[name])throw new Error(`Unrecognized hash function named: ${name}`);code=cs.names[name]}if("number"!=typeof code)throw new Error(`Hash function code should be a number. Got: ${code}`);if(!cs.codes[code]&&!exports.isAppCode(code))throw new Error(`Unrecognized function code: ${code}`);return code},exports.isAppCode=function(code){return code>0&&code<16},exports.isValidCode=function(code){return!!exports.isAppCode(code)||!!cs.codes[code]},exports.validate=validate,exports.prefix=function(multihash){return validate(multihash),multihash.slice(0,2)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function cidForHash(codec,rawhash){return new CID(1,codec,multihashes.encode(rawhash,"keccak-256"))}const CID=__webpack_require__(521),multihashes=__webpack_require__(523);module.exports={cidForHash:cidForHash}},function(module,exports,__webpack_require__){"use strict";exports.util=__webpack_require__(232),exports.resolver=__webpack_require__(524)},function(module,exports,__webpack_require__){"use strict";const EthBlockHeader=__webpack_require__(209),cidForHash=__webpack_require__(230).cidForHash;exports.deserialize=function(data,callback){let deserialized;try{deserialized=new EthBlockHeader(data)}catch(err){return callback(err)}callback(null,deserialized)},exports.serialize=function(blockHeader,callback){let serialized;try{serialized=blockHeader.serialize()}catch(err){return callback(err)}callback(null,serialized)},exports.cid=function(blockHeader,callback){let cid;try{cid=cidForHash("eth-block",blockHeader.hash())}catch(err){return callback(err)}callback(null,cid)}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function validate(multihash){exports.decode(multihash)}const bs58=__webpack_require__(24),cs=__webpack_require__(530),varint=__webpack_require__(16);exports.toHexString=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return hash.toString("hex")},exports.fromHexString=function(hash){return new Buffer(hash,"hex")},exports.toB58String=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return bs58.encode(hash)},exports.fromB58String=function(hash){let encoded=hash;return Buffer.isBuffer(hash)&&(encoded=hash.toString()),new Buffer(bs58.decode(encoded))},exports.decode=function(buf){if(!Buffer.isBuffer(buf))throw new Error("multihash must be a Buffer");if(buf.length<3)throw new Error("multihash too short. must be > 3 bytes.");let code=varint.decode(buf);if(!exports.isValidCode(code))throw new Error(`multihash unknown function code: 0x${code.toString(16)}`);buf=buf.slice(varint.decode.bytes);let len=varint.decode(buf);if(len<1)throw new Error(`multihash invalid length: 0x${len.toString(16)}`);if(buf=buf.slice(varint.decode.bytes),buf.length!==len)throw new Error(`multihash length inconsistent: 0x${buf.toString("hex")}`);return{code:code,name:cs.codes[code],length:len,digest:buf}},exports.encode=function(digest,code,length){if(!digest||!code)throw new Error("multihash encode requires at least two args: digest, code");const hashfn=exports.coerceCode(code);if(!Buffer.isBuffer(digest))throw new Error("digest should be a Buffer");if(null==length&&(length=digest.length),length&&digest.length!==length)throw new Error("digest length should be equal to specified length.");return Buffer.concat([new Buffer(varint.encode(hashfn)),new Buffer(varint.encode(length)),digest])},exports.coerceCode=function(name){let code=name;if("string"==typeof name){if(!cs.names[name])throw new Error(`Unrecognized hash function named: ${name}`);code=cs.names[name]}if("number"!=typeof code)throw new Error(`Hash function code should be a number. Got: ${code}`);if(!cs.codes[code]&&!exports.isAppCode(code))throw new Error(`Unrecognized function code: ${code}`);return code},exports.isAppCode=function(code){return code>0&&code<16},exports.isValidCode=function(code){return!!exports.isAppCode(code)||!!cs.codes[code]},exports.validate=validate,exports.prefix=function(multihash){return validate(multihash),multihash.slice(0,2)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const Transaction=__webpack_require__(421),cidForHash=__webpack_require__(534).cidForHash;exports.deserialize=function(data,callback){let deserialized;try{deserialized=new Transaction(data)}catch(err){return callback(err)}callback(null,deserialized)},exports.serialize=function(tx,callback){let serialized;try{serialized=tx.serialize()}catch(err){return callback(err)}callback(null,serialized)},exports.cid=function(tx,callback){let cid;try{cid=cidForHash("eth-tx",tx.hash())}catch(err){return callback(err)}callback(null,cid)}},function(module,exports){module.exports=function(str){if("string"!=typeof str)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof str+", while checking isHexPrefixed.");return"0x"===str.slice(0,2)}},function(module,exports){function isPromise(obj){return obj&&"function"==typeof obj.then}module.exports=isPromise},function(module,exports,__webpack_require__){(function(process,global){!function(){"use strict";function Keccak(bits,padding,outputBits){this.blocks=[],this.s=[],this.padding=padding,this.outputBits=outputBits,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(bits<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=outputBits>>5,this.extraBytes=(31&outputBits)>>3;for(var i=0;i<50;++i)this.s[i]=0}var root="object"==typeof window?window:{};!root.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(root=global);for(var COMMON_JS=!root.JS_SHA3_NO_COMMON_JS&&"object"==typeof module&&module.exports,HEX_CHARS="0123456789abcdef".split(""),SHAKE_PADDING=[31,7936,2031616,520093696],KECCAK_PADDING=[1,256,65536,16777216],PADDING=[6,1536,393216,100663296],SHIFT=[0,8,16,24],RC=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],BITS=[224,256,384,512],SHAKE_BITS=[128,256],OUTPUT_TYPES=["hex","buffer","arrayBuffer","array"],createOutputMethod=function(bits,padding,outputType){return function(message){return new Keccak(bits,padding,bits).update(message)[outputType]()}},createShakeOutputMethod=function(bits,padding,outputType){return function(message,outputBits){return new Keccak(bits,padding,outputBits).update(message)[outputType]()}},createMethod=function(bits,padding){var method=createOutputMethod(bits,padding,"hex");method.create=function(){return new Keccak(bits,padding,bits)},method.update=function(message){return method.create().update(message)};for(var i=0;i>2]|=message[index]<>2]|=code<>2]|=(192|code>>6)<>2]|=(128|63&code)<=57344?(blocks[i>>2]|=(224|code>>12)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<>2]|=(240|code>>18)<>2]|=(128|code>>12&63)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<=byteCount){for(this.start=i-byteCount,this.block=blocks[blockCount],i=0;i>2]|=this.padding[3&i],this.lastByteIndex===this.byteCount)for(blocks[0]=blocks[blockCount],i=1;i>4&15]+HEX_CHARS[15&block]+HEX_CHARS[block>>12&15]+HEX_CHARS[block>>8&15]+HEX_CHARS[block>>20&15]+HEX_CHARS[block>>16&15]+HEX_CHARS[block>>28&15]+HEX_CHARS[block>>24&15];j%blockCount==0&&(f(s),i=0)}return extraBytes&&(block=s[i],extraBytes>0&&(hex+=HEX_CHARS[block>>4&15]+HEX_CHARS[15&block]),extraBytes>1&&(hex+=HEX_CHARS[block>>12&15]+HEX_CHARS[block>>8&15]),extraBytes>2&&(hex+=HEX_CHARS[block>>20&15]+HEX_CHARS[block>>16&15])),hex},Keccak.prototype.arrayBuffer=function(){this.finalize();var buffer,blockCount=this.blockCount,s=this.s,outputBlocks=this.outputBlocks,extraBytes=this.extraBytes,i=0,j=0,bytes=this.outputBits>>3;buffer=extraBytes?new ArrayBuffer(outputBlocks+1<<2):new ArrayBuffer(bytes);for(var array=new Uint32Array(buffer);j>8&255,array[offset+2]=block>>16&255,array[offset+3]=block>>24&255;j%blockCount==0&&f(s)}return extraBytes&&(offset=j<<2,block=s[i],extraBytes>0&&(array[offset]=255&block),extraBytes>1&&(array[offset+1]=block>>8&255),extraBytes>2&&(array[offset+2]=block>>16&255)),array};var f=function(s){var h,l,n,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49;for(n=0;n<48;n+=2)c0=s[0]^s[10]^s[20]^s[30]^s[40],c1=s[1]^s[11]^s[21]^s[31]^s[41],c2=s[2]^s[12]^s[22]^s[32]^s[42],c3=s[3]^s[13]^s[23]^s[33]^s[43],c4=s[4]^s[14]^s[24]^s[34]^s[44],c5=s[5]^s[15]^s[25]^s[35]^s[45],c6=s[6]^s[16]^s[26]^s[36]^s[46],c7=s[7]^s[17]^s[27]^s[37]^s[47],c8=s[8]^s[18]^s[28]^s[38]^s[48],c9=s[9]^s[19]^s[29]^s[39]^s[49],h=c8^(c2<<1|c3>>>31),l=c9^(c3<<1|c2>>>31),s[0]^=h,s[1]^=l,s[10]^=h,s[11]^=l,s[20]^=h,s[21]^=l,s[30]^=h,s[31]^=l,s[40]^=h,s[41]^=l,h=c0^(c4<<1|c5>>>31),l=c1^(c5<<1|c4>>>31),s[2]^=h,s[3]^=l,s[12]^=h,s[13]^=l,s[22]^=h,s[23]^=l,s[32]^=h,s[33]^=l,s[42]^=h,s[43]^=l,h=c2^(c6<<1|c7>>>31),l=c3^(c7<<1|c6>>>31),s[4]^=h,s[5]^=l,s[14]^=h,s[15]^=l,s[24]^=h,s[25]^=l,s[34]^=h,s[35]^=l,s[44]^=h,s[45]^=l,h=c4^(c8<<1|c9>>>31),l=c5^(c9<<1|c8>>>31),s[6]^=h,s[7]^=l,s[16]^=h,s[17]^=l,s[26]^=h,s[27]^=l,s[36]^=h,s[37]^=l,s[46]^=h,s[47]^=l,h=c6^(c0<<1|c1>>>31),l=c7^(c1<<1|c0>>>31),s[8]^=h,s[9]^=l,s[18]^=h,s[19]^=l,s[28]^=h,s[29]^=l,s[38]^=h,s[39]^=l,s[48]^=h,s[49]^=l,b0=s[0],b1=s[1],b32=s[11]<<4|s[10]>>>28,b33=s[10]<<4|s[11]>>>28,b14=s[20]<<3|s[21]>>>29,b15=s[21]<<3|s[20]>>>29,b46=s[31]<<9|s[30]>>>23,b47=s[30]<<9|s[31]>>>23,b28=s[40]<<18|s[41]>>>14,b29=s[41]<<18|s[40]>>>14,b20=s[2]<<1|s[3]>>>31,b21=s[3]<<1|s[2]>>>31,b2=s[13]<<12|s[12]>>>20,b3=s[12]<<12|s[13]>>>20,b34=s[22]<<10|s[23]>>>22,b35=s[23]<<10|s[22]>>>22,b16=s[33]<<13|s[32]>>>19,b17=s[32]<<13|s[33]>>>19,b48=s[42]<<2|s[43]>>>30,b49=s[43]<<2|s[42]>>>30,b40=s[5]<<30|s[4]>>>2,b41=s[4]<<30|s[5]>>>2,b22=s[14]<<6|s[15]>>>26,b23=s[15]<<6|s[14]>>>26,b4=s[25]<<11|s[24]>>>21,b5=s[24]<<11|s[25]>>>21,b36=s[34]<<15|s[35]>>>17,b37=s[35]<<15|s[34]>>>17,b18=s[45]<<29|s[44]>>>3,b19=s[44]<<29|s[45]>>>3,b10=s[6]<<28|s[7]>>>4,b11=s[7]<<28|s[6]>>>4,b42=s[17]<<23|s[16]>>>9,b43=s[16]<<23|s[17]>>>9,b24=s[26]<<25|s[27]>>>7,b25=s[27]<<25|s[26]>>>7,b6=s[36]<<21|s[37]>>>11,b7=s[37]<<21|s[36]>>>11,b38=s[47]<<24|s[46]>>>8,b39=s[46]<<24|s[47]>>>8,b30=s[8]<<27|s[9]>>>5,b31=s[9]<<27|s[8]>>>5,b12=s[18]<<20|s[19]>>>12,b13=s[19]<<20|s[18]>>>12,b44=s[29]<<7|s[28]>>>25,b45=s[28]<<7|s[29]>>>25,b26=s[38]<<8|s[39]>>>24,b27=s[39]<<8|s[38]>>>24,b8=s[48]<<14|s[49]>>>18,b9=s[49]<<14|s[48]>>>18,s[0]=b0^~b2&b4,s[1]=b1^~b3&b5,s[10]=b10^~b12&b14,s[11]=b11^~b13&b15,s[20]=b20^~b22&b24,s[21]=b21^~b23&b25,s[30]=b30^~b32&b34,s[31]=b31^~b33&b35,s[40]=b40^~b42&b44,s[41]=b41^~b43&b45,s[2]=b2^~b4&b6,s[3]=b3^~b5&b7,s[12]=b12^~b14&b16,s[13]=b13^~b15&b17,s[22]=b22^~b24&b26,s[23]=b23^~b25&b27,s[32]=b32^~b34&b36,s[33]=b33^~b35&b37,s[42]=b42^~b44&b46,s[43]=b43^~b45&b47,s[4]=b4^~b6&b8,s[5]=b5^~b7&b9,s[14]=b14^~b16&b18,s[15]=b15^~b17&b19,s[24]=b24^~b26&b28,s[25]=b25^~b27&b29,s[34]=b34^~b36&b38,s[35]=b35^~b37&b39,s[44]=b44^~b46&b48,s[45]=b45^~b47&b49,s[6]=b6^~b8&b0,s[7]=b7^~b9&b1,s[16]=b16^~b18&b10,s[17]=b17^~b19&b11,s[26]=b26^~b28&b20,s[27]=b27^~b29&b21,s[36]=b36^~b38&b30,s[37]=b37^~b39&b31,s[46]=b46^~b48&b40,s[47]=b47^~b49&b41,s[8]=b8^~b0&b2,s[9]=b9^~b1&b3,s[18]=b18^~b10&b12,s[19]=b19^~b11&b13,s[28]=b28^~b20&b22,s[29]=b29^~b21&b23,s[38]=b38^~b30&b32,s[39]=b39^~b31&b33,s[48]=b48^~b40&b42,s[49]=b49^~b41&b43,s[0]^=RC[n],s[1]^=RC[n+1]};if(COMMON_JS)module.exports=methods;else for(var i=0;i>=1))break;ch+=ch}return pad+str}module.exports=leftPad;var cache=[""," "," "," "," "," "," "," "," "," "]},function(module,exports,__webpack_require__){(function(Buffer,process){function Level(location){if(!(this instanceof Level))return new Level(location);AbstractLevelDOWN.call(this,location)}module.exports=Level;var AbstractLevelDOWN=__webpack_require__(247).AbstractLevelDOWN,util=__webpack_require__(10),Iterator=__webpack_require__(556),xtend=__webpack_require__(37);util.inherits(Level,AbstractLevelDOWN),Level.prototype._open=function(options,callback){function onerror(ev){callback(ev.target.error)}function onsuccess(db){self._db=db;var exists=self._db.objectStoreNames.contains(self._idbOpts.storeName);if(options.errorIfExists&&exists)return self._db.close(),void callback(new Error("store already exists"));if(!options.createIfMissing&&!exists)return self._db.close(),void callback(new Error("store does not exist"));if(options.createIfMissing&&!exists){self._db.close();var req2=indexedDB.open(self.location,self._db.version+1);return req2.onerror=function(ev){callback(ev.target.error)},req2.onupgradeneeded=function(){req2.result.createObjectStore(self._idbOpts.storeName,self._idbOpts)},void(req2.onsuccess=function(){self._db=req2.result,callback(null,self)})}callback(null,self)}var self=this;if(this._idbOpts=xtend({storeName:this.location,keyEncoding:"none",valueEncoding:"none"},options),this._idbOpts.idb)onsuccess(this._idbOpts.idb);else{var req=indexedDB.open(this.location);req.onerror=onerror,req.onsuccess=function(){onsuccess(req.result)}}},Level.prototype._get=function(key,options,callback){options=xtend(this._idbOpts,options);var origKey=key;"binary"!==options.keyEncoding||Array.isArray(key)||(key=Array.prototype.slice.call(key));var tx=this._db.transaction(this._idbOpts.storeName),req=tx.objectStore(this._idbOpts.storeName).openCursor(IDBKeyRange.only(key));tx.onabort=function(){callback(tx.error)},req.onsuccess=function(){var cursor=req.result;if(cursor){var value=cursor.value;if(value instanceof Uint8Array&&(value=new Buffer(value)),"binary"!==options.valueEncoding||Buffer.isBuffer(value)||(value=new Buffer(value)),options.asBuffer&&!Buffer.isBuffer(value))if(null==value)value=new Buffer(0);else if("string"==typeof value)value=new Buffer(value);else if("boolean"==typeof value)value=new Buffer(String(value));else if("number"==typeof value)value=new Buffer(String(value));else if(Array.isArray(value))value=new Buffer(String(value));else{if(!(value instanceof Uint8Array))return void callback(new TypeError("can't coerce `"+value.constructor.name+"` into a Buffer"));value=new Buffer(value)}return void callback(null,value,origKey)}return void callback(new Error("NotFound"))}},Level.prototype._del=function(key,options,callback){options=xtend(this._idbOpts,options),"binary"!==options.keyEncoding||Array.isArray(key)||(key=Array.prototype.slice.call(key));var mode="readwrite";options.sync===!0&&(mode="readwriteflush");var tx=this._db.transaction(this._idbOpts.storeName,mode);tx.objectStore(this._idbOpts.storeName).delete(key);tx.onabort=function(){callback(tx.error)},tx.oncomplete=function(){callback()}},Level.prototype._put=function(key,value,options,callback){options=xtend(this._idbOpts,options),"binary"!==options.keyEncoding||Array.isArray(key)||(key=Array.prototype.slice.call(key));var mode="readwrite";options.sync===!0&&(mode="readwriteflush");var tx=this._db.transaction(this._idbOpts.storeName,mode);tx.objectStore(this._idbOpts.storeName).put(value,key);tx.onabort=function(){callback(tx.error)},tx.oncomplete=function(){callback()}},Level.prototype._iterator=function(options){return new Iterator(this,options)},Level.prototype._batch=function(array,options,callback){if(0===array.length)return process.nextTick(callback);var mode="readwrite";options.sync===!0&&(mode="readwriteflush");var tx=this._db.transaction(this._idbOpts.storeName,mode),store=tx.objectStore(this._idbOpts.storeName);tx.onabort=function(){callback(tx.error)},tx.oncomplete=function(){callback()},array.forEach(function(currentOp){"binary"!==xtend(options,currentOp).keyEncoding||Array.isArray(currentOp.key)||(currentOp.key=Array.prototype.slice.call(currentOp.key)),"del"===currentOp.type?store.delete(currentOp.key):store.put(currentOp.value,currentOp.key)})},Level.prototype._close=function(callback){this._db.close(),process.nextTick(callback)},Level.prototype._approximateSize=function(start,end,callback){var err=new Error("Not implemented");if(callback)return void process.nextTick(function(){callback(err)});throw err},Level.destroy=function(db,callback){var idbOpts;if(null!=db&&"object"==typeof db)idbOpts=xtend({location:db.location,storeName:db.location},db._idbOpts);else{if("string"!=typeof db)throw new TypeError("location must be a string or an object");idbOpts={location:db,storeName:db}}if("string"!=typeof idbOpts.location)throw new TypeError("location must be a string");if("string"!=typeof idbOpts.storeName)throw new TypeError("db.storeName must be a string");var req=indexedDB.open(idbOpts.location);req.onerror=function(ev){callback(ev.target.error)},req.onsuccess=function(){function deleteDatabase(name){var req2=indexedDB.deleteDatabase(name);req2.onerror=function(ev){callback(ev.target.error)},req2.onsuccess=function(){callback()}}var db=req.result;if(db.close(),0===db.objectStoreNames.length)return void deleteDatabase(idbOpts.location);if(!db.objectStoreNames.contains(idbOpts.storeName))return void callback();var req2=indexedDB.open(idbOpts.location,db.version+1);req2.onerror=function(ev){callback(ev.target.error)},req2.onupgradeneeded=function(){db=req2.result,db.deleteObjectStore(idbOpts.storeName)},req2.onsuccess=function(){db=req2.result,db.close(),0===db.objectStoreNames.length?deleteDatabase(idbOpts.location):callback()}}}}).call(exports,__webpack_require__(0).Buffer,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(process){function AbstractChainedBatch(db){this._db=db,this._operations=[],this._written=!1}AbstractChainedBatch.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},AbstractChainedBatch.prototype.put=function(key,value){this._checkWritten();var err=this._db._checkKey(key,"key",this._db._isBuffer);if(err)throw err;return this._db._isBuffer(key)||(key=String(key)),this._db._isBuffer(value)||(value=String(value)),"function"==typeof this._put?this._put(key,value):this._operations.push({type:"put",key:key,value:value}),this},AbstractChainedBatch.prototype.del=function(key){this._checkWritten();var err=this._db._checkKey(key,"key",this._db._isBuffer);if(err)throw err;return this._db._isBuffer(key)||(key=String(key)),"function"==typeof this._del?this._del(key):this._operations.push({type:"del",key:key}),this},AbstractChainedBatch.prototype.clear=function(){return this._checkWritten(),this._operations=[],"function"==typeof this._clear&&this._clear(),this},AbstractChainedBatch.prototype.write=function(options,callback){if(this._checkWritten(),"function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("write() requires a callback argument");return"object"!=typeof options&&(options={}),this._written=!0,"function"==typeof this._write?this._write(callback):"function"==typeof this._db._batch?this._db._batch(this._operations,options,callback):void process.nextTick(callback)},module.exports=AbstractChainedBatch}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(process){function AbstractIterator(db){this.db=db,this._ended=!1,this._nexting=!1}AbstractIterator.prototype.next=function(callback){var self=this;if("function"!=typeof callback)throw new Error("next() requires a callback argument");return self._ended?callback(new Error("cannot call next() after end()")):self._nexting?callback(new Error("cannot call next() before previous next() has completed")):(self._nexting=!0,"function"==typeof self._next?self._next(function(){self._nexting=!1,callback.apply(null,arguments)}):void process.nextTick(function(){self._nexting=!1,callback()}))},AbstractIterator.prototype.end=function(callback){if("function"!=typeof callback)throw new Error("end() requires a callback argument");return this._ended?callback(new Error("end() already called on iterator")):(this._ended=!0,"function"==typeof this._end?this._end(callback):void process.nextTick(callback))},module.exports=AbstractIterator}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(process,Buffer){function AbstractLevelDOWN(location){if(!arguments.length||void 0===location)throw new Error("constructor requires at least a location argument");if("string"!=typeof location)throw new Error("constructor requires a location string argument");this.location=location,this.status="new"}var xtend=__webpack_require__(37),AbstractIterator=__webpack_require__(245),AbstractChainedBatch=__webpack_require__(244);AbstractLevelDOWN.prototype.open=function(options,callback){var self=this,oldStatus=this.status;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("open() requires a callback argument");"object"!=typeof options&&(options={}),options.createIfMissing=0!=options.createIfMissing,options.errorIfExists=!!options.errorIfExists,"function"==typeof this._open?(this.status="opening",this._open(options,function(err){if(err)return self.status=oldStatus,callback(err);self.status="open",callback()})):(this.status="open",process.nextTick(callback))},AbstractLevelDOWN.prototype.close=function(callback){var self=this,oldStatus=this.status;if("function"!=typeof callback)throw new Error("close() requires a callback argument");"function"==typeof this._close?(this.status="closing",this._close(function(err){if(err)return self.status=oldStatus,callback(err);self.status="closed",callback()})):(this.status="closed",process.nextTick(callback))},AbstractLevelDOWN.prototype.get=function(key,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("get() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),"object"!=typeof options&&(options={}),options.asBuffer=0!=options.asBuffer,"function"==typeof this._get?this._get(key,options,callback):void process.nextTick(function(){callback(new Error("NotFound"))}))},AbstractLevelDOWN.prototype.put=function(key,value,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("put() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),null==value||this._isBuffer(value)||process.browser||(value=String(value)),"object"!=typeof options&&(options={}),"function"==typeof this._put?this._put(key,value,options,callback):void process.nextTick(callback))},AbstractLevelDOWN.prototype.del=function(key,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("del() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),"object"!=typeof options&&(options={}),"function"==typeof this._del?this._del(key,options,callback):void process.nextTick(callback))},AbstractLevelDOWN.prototype.batch=function(array,options,callback){if(!arguments.length)return this._chainedBatch();if("function"==typeof options&&(callback=options),"function"==typeof array&&(callback=array),"function"!=typeof callback)throw new Error("batch(array) requires a callback argument");if(!Array.isArray(array))return callback(new Error("batch(array) requires an array argument"));options&&"object"==typeof options||(options={});for(var e,err,i=0,l=array.length;i0&&!this.encoding){var pack=this.packetBuffer.shift();this.packet(pack)}},Manager.prototype.cleanup=function(){debug("cleanup");for(var subsLength=this.subs.length,i=0;i=this._reconnectionAttempts)debug("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var delay=this.backoff.duration();debug("will wait %dms before reconnect attempt",delay),this.reconnecting=!0;var timer=setTimeout(function(){self.skipReconnect||(debug("attempting reconnect"),self.emitAll("reconnect_attempt",self.backoff.attempts),self.emitAll("reconnecting",self.backoff.attempts),self.skipReconnect||self.open(function(err){err?(debug("reconnect attempt error"),self.reconnecting=!1,self.reconnect(),self.emitAll("reconnect_error",err.data)):(debug("reconnect success"),self.onreconnect())}))},delay);this.subs.push({destroy:function(){clearTimeout(timer)}})}},Manager.prototype.onreconnect=function(){var attempt=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",attempt)}},function(module,exports){function on(obj,ev,fn){return obj.on(ev,fn),{destroy:function(){obj.removeListener(ev,fn)}}}module.exports=on},function(module,exports,__webpack_require__){function Socket(io,nsp,opts){this.io=io,this.nsp=nsp,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,opts&&opts.query&&(this.query=opts.query),this.io.autoConnect&&this.open()}var parser=__webpack_require__(147),Emitter=__webpack_require__(63),toArray=__webpack_require__(816),on=__webpack_require__(258),bind=__webpack_require__(195),debug=__webpack_require__(108)("socket.io-client:socket");module.exports=Socket;var events={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},emit=Emitter.prototype.emit;Emitter(Socket.prototype),Socket.prototype.subEvents=function(){if(!this.subs){var io=this.io;this.subs=[on(io,"open",bind(this,"onopen")),on(io,"packet",bind(this,"onpacket")),on(io,"close",bind(this,"onclose"))]}},Socket.prototype.open=Socket.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting"),this)},Socket.prototype.send=function(){var args=toArray(arguments);return args.unshift("message"),this.emit.apply(this,args),this},Socket.prototype.emit=function(ev){if(events.hasOwnProperty(ev))return emit.apply(this,arguments),this;var args=toArray(arguments),packet={type:parser.EVENT,data:args};return packet.options={},packet.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof args[args.length-1]&&(debug("emitting packet with ack id %d",this.ids),this.acks[this.ids]=args.pop(),packet.id=this.ids++),this.connected?this.packet(packet):this.sendBuffer.push(packet),delete this.flags,this},Socket.prototype.packet=function(packet){packet.nsp=this.nsp,this.io.packet(packet)},Socket.prototype.onopen=function(){debug("transport is open - connecting"),"/"!==this.nsp&&(this.query?this.packet({type:parser.CONNECT,query:this.query}):this.packet({type:parser.CONNECT}))},Socket.prototype.onclose=function(reason){debug("close (%s)",reason),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",reason)},Socket.prototype.onpacket=function(packet){if(packet.nsp===this.nsp)switch(packet.type){case parser.CONNECT:this.onconnect();break;case parser.EVENT:this.onevent(packet);break;case parser.BINARY_EVENT:this.onevent(packet);break;case parser.ACK:this.onack(packet);break;case parser.BINARY_ACK:this.onack(packet);break;case parser.DISCONNECT:this.ondisconnect();break;case parser.ERROR:this.emit("error",packet.data)}},Socket.prototype.onevent=function(packet){var args=packet.data||[];debug("emitting event %j",args),null!=packet.id&&(debug("attaching ack callback to event"),args.push(this.ack(packet.id))),this.connected?emit.apply(this,args):this.receiveBuffer.push(args)},Socket.prototype.ack=function(id){var self=this,sent=!1;return function(){if(!sent){sent=!0;var args=toArray(arguments);debug("sending ack %j",args),self.packet({type:parser.ACK,id:id,data:args})}}},Socket.prototype.onack=function(packet){var ack=this.acks[packet.id];"function"==typeof ack?(debug("calling ack %s with %j",packet.id,packet.data),ack.apply(this,packet.data),delete this.acks[packet.id]):debug("bad ack %s",packet.id)},Socket.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},Socket.prototype.emitBuffered=function(){var i;for(i=0;i=wait||timeSinceLastCall<0||maxing&&timeSinceLastInvoke>=maxWait}function timerExpired(){var time=now();if(shouldInvoke(time))return trailingEdge(time);timerId=setTimeout(timerExpired,remainingWait(time))}function trailingEdge(time){return timerId=void 0,trailing&&lastArgs?invokeFunc(time):(lastArgs=lastThis=void 0,result)}function cancel(){void 0!==timerId&&clearTimeout(timerId),lastInvokeTime=0,lastArgs=lastCallTime=lastThis=timerId=void 0}function flush(){return void 0===timerId?result:trailingEdge(now())}function debounced(){var time=now(),isInvoking=shouldInvoke(time);if(lastArgs=arguments,lastThis=this,lastCallTime=time,isInvoking){if(void 0===timerId)return leadingEdge(lastCallTime);if(maxing)return timerId=setTimeout(timerExpired,wait),invokeFunc(lastCallTime)}return void 0===timerId&&(timerId=setTimeout(timerExpired,wait)),result}var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime=0,leading=!1,maxing=!1,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return wait=toNumber(wait)||0,isObject(options)&&(leading=!!options.leading,maxing="maxWait"in options,maxWait=maxing?nativeMax(toNumber(options.maxWait)||0,wait):maxWait,trailing="trailing"in options?!!options.trailing:trailing),debounced.cancel=cancel,debounced.flush=flush,debounced}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}var FUNC_ERROR_TEXT="Expected a function",NAN=NaN,symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),objectProto=Object.prototype,objectToString=objectProto.toString,nativeMax=Math.max,nativeMin=Math.min,now=function(){return root.Date.now()};module.exports=debounce}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){(function(global){function getValue(object,key){return null==object?void 0:object[key]}function isHostObject(value){var result=!1;if(null!=value&&"function"!=typeof value.toString)try{result=!!(value+"")}catch(e){}return result}function Hash(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index-1&&value%1==0&&value-1:!!length&&baseIndexOf(collection,value,fromIndex)>-1}function isArguments(value){return isArrayLikeObject(value)&&hasOwnProperty.call(value,"callee")&&(!propertyIsEnumerable.call(value,"callee")||objectToString.call(value)==argsTag)}function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isString(value){return"string"==typeof value||!isArray(value)&&isObjectLike(value)&&objectToString.call(value)==stringTag}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toFinite(value){if(!value)return 0===value?value:0;if((value=toNumber(value))===INFINITY||value===-INFINITY){return(value<0?-1:1)*MAX_INTEGER}return value===value?value:0}function toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function values(object){return object?baseValues(object,keys(object)):[]}var INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,MAX_INTEGER=1.7976931348623157e308,NAN=NaN,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",stringTag="[object String]",symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,reIsUint=/^(?:0|[1-9]\d*)$/,freeParseInt=parseInt,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,propertyIsEnumerable=objectProto.propertyIsEnumerable,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),nativeMax=Math.max,isArray=Array.isArray;module.exports=includes},function(module,exports,__webpack_require__){var root=__webpack_require__(268),Symbol=root.Symbol;module.exports=Symbol},function(module,exports){function arrayMap(array,iteratee){for(var index=-1,length=null==array?0:array.length,result=Array(length);++index-1&&value%1==0&&value<=MAX_SAFE_INTEGER}var MAX_SAFE_INTEGER=9007199254740991;module.exports=isLength},function(module,exports,__webpack_require__){function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}var arrayLikeKeys=__webpack_require__(641),baseKeys=__webpack_require__(646),isArrayLike=__webpack_require__(65);module.exports=keys},function(module,exports){module.exports=function(fun){!function next(){var loop=!0,sync=!1;do{sync=!0,loop=!1,fun.call(this,function(){sync?loop=!0:next()}),sync=!1}while(loop)}()}},function(module,exports,__webpack_require__){(function(process){function AbstractChainedBatch(db){this._db=db,this._operations=[],this._written=!1}AbstractChainedBatch.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},AbstractChainedBatch.prototype.put=function(key,value){this._checkWritten();var err=this._db._checkKey(key,"key",this._db._isBuffer);if(err)throw err;return this._db._isBuffer(key)||(key=String(key)),this._db._isBuffer(value)||(value=String(value)),"function"==typeof this._put?this._put(key,value):this._operations.push({type:"put",key:key,value:value}),this},AbstractChainedBatch.prototype.del=function(key){this._checkWritten();var err=this._db._checkKey(key,"key",this._db._isBuffer);if(err)throw err;return this._db._isBuffer(key)||(key=String(key)),"function"==typeof this._del?this._del(key):this._operations.push({type:"del",key:key}),this},AbstractChainedBatch.prototype.clear=function(){return this._checkWritten(),this._operations=[],"function"==typeof this._clear&&this._clear(),this},AbstractChainedBatch.prototype.write=function(options,callback){if(this._checkWritten(),"function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("write() requires a callback argument");return"object"!=typeof options&&(options={}),this._written=!0,"function"==typeof this._write?this._write(callback):"function"==typeof this._db._batch?this._db._batch(this._operations,options,callback):void process.nextTick(callback)},module.exports=AbstractChainedBatch}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(process){function AbstractIterator(db){this.db=db,this._ended=!1,this._nexting=!1}AbstractIterator.prototype.next=function(callback){var self=this;if("function"!=typeof callback)throw new Error("next() requires a callback argument");return self._ended?callback(new Error("cannot call next() after end()")):self._nexting?callback(new Error("cannot call next() before previous next() has completed")):(self._nexting=!0,"function"==typeof self._next?self._next(function(){self._nexting=!1,callback.apply(null,arguments)}):void process.nextTick(function(){self._nexting=!1,callback()}))},AbstractIterator.prototype.end=function(callback){if("function"!=typeof callback)throw new Error("end() requires a callback argument");return this._ended?callback(new Error("end() already called on iterator")):(this._ended=!0,"function"==typeof this._end?this._end(callback):void process.nextTick(callback))},module.exports=AbstractIterator}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(process,Buffer){function AbstractLevelDOWN(location){if(!arguments.length||void 0===location)throw new Error("constructor requires at least a location argument");if("string"!=typeof location)throw new Error("constructor requires a location string argument");this.location=location,this.status="new"}var xtend=__webpack_require__(37),AbstractIterator=__webpack_require__(273),AbstractChainedBatch=__webpack_require__(272);AbstractLevelDOWN.prototype.open=function(options,callback){var self=this,oldStatus=this.status;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("open() requires a callback argument");"object"!=typeof options&&(options={}),options.createIfMissing=0!=options.createIfMissing,options.errorIfExists=!!options.errorIfExists,"function"==typeof this._open?(this.status="opening",this._open(options,function(err){if(err)return self.status=oldStatus,callback(err);self.status="open",callback()})):(this.status="open",process.nextTick(callback))},AbstractLevelDOWN.prototype.close=function(callback){var self=this,oldStatus=this.status;if("function"!=typeof callback)throw new Error("close() requires a callback argument");"function"==typeof this._close?(this.status="closing",this._close(function(err){if(err)return self.status=oldStatus,callback(err);self.status="closed",callback()})):(this.status="closed",process.nextTick(callback))},AbstractLevelDOWN.prototype.get=function(key,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("get() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),"object"!=typeof options&&(options={}),options.asBuffer=0!=options.asBuffer,"function"==typeof this._get?this._get(key,options,callback):void process.nextTick(function(){callback(new Error("NotFound"))}))},AbstractLevelDOWN.prototype.put=function(key,value,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("put() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),null==value||this._isBuffer(value)||process.browser||(value=String(value)),"object"!=typeof options&&(options={}),"function"==typeof this._put?this._put(key,value,options,callback):void process.nextTick(callback))},AbstractLevelDOWN.prototype.del=function(key,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("del() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),"object"!=typeof options&&(options={}),"function"==typeof this._del?this._del(key,options,callback):void process.nextTick(callback))},AbstractLevelDOWN.prototype.batch=function(array,options,callback){if(!arguments.length)return this._chainedBatch();if("function"==typeof options&&(callback=options),"function"==typeof array&&(callback=array),"function"!=typeof callback)throw new Error("batch(array) requires a callback argument");if(!Array.isArray(array))return callback(new Error("batch(array) requires an array argument"));options&&"object"==typeof options||(options={});for(var e,err,i=0,l=array.length;i1}function stringToNibbles(key){for(var bkey=new Buffer(key),nibbles=[],i=0;i>4,++q,nibbles[q]=bkey[i]%16}return nibbles}function nibblesToBuffer(arr){for(var buf=new Buffer(arr.length/2),i=0;i>8,lo=255&c;hi?res.push(hi,lo):res.push(lo)}return res}function zero2(word){return 1===word.length?"0"+word:word}function toHex(msg){for(var res="",i=0;i{return function(input,callback){const done=(err,res)=>setImmediate(()=>{callback(err,res)});let res;try{res=doWork(input)}catch(err){return void done(err)}done(null,res)}}),exports.toBuf=((doWork,other)=>input=>{return new Buffer(doWork(input,other),"hex")}),exports.fromString=((doWork,other)=>_input=>{return doWork(Buffer.isBuffer(_input)?_input.toString():_input,other)}),exports.fromNumberTo32BitBuf=((doWork,other)=>input=>{let number=doWork(input,other);const bytes=new Array(4);for(let i=0;i<4;i++)bytes[i]=255&number,number>>=8;return Buffer.from(bytes)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(process){function prependListener(emitter,event,fn){if("function"==typeof emitter.prependListener)return emitter.prependListener(event,fn);emitter._events&&emitter._events[event]?isArray(emitter._events[event])?emitter._events[event].unshift(fn):emitter._events[event]=[fn,emitter._events[event]]:emitter.on(event,fn)}function ReadableState(options,stream){Duplex=Duplex||__webpack_require__(66),options=options||{},this.objectMode=!!options.objectMode,stream instanceof Duplex&&(this.objectMode=this.objectMode||!!options.readableObjectMode);var hwm=options.highWaterMark,defaultHwm=this.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:defaultHwm,this.highWaterMark=~~this.highWaterMark,this.buffer=new BufferList,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=options.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(StringDecoder||(StringDecoder=__webpack_require__(18).StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding)}function Readable(options){if(Duplex=Duplex||__webpack_require__(66),!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this),this.readable=!0,options&&"function"==typeof options.read&&(this._read=options.read),Stream.call(this)}function readableAddChunk(stream,state,chunk,encoding,addToFront){var er=chunkInvalid(state,chunk);if(er)stream.emit("error",er);else if(null===chunk)state.reading=!1,onEofChunk(stream,state);else if(state.objectMode||chunk&&chunk.length>0)if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var _e=new Error("stream.unshift() after end event");stream.emit("error",_e)}else{var skipAdd;!state.decoder||addToFront||encoding||(chunk=state.decoder.write(chunk),skipAdd=!state.objectMode&&0===chunk.length),addToFront||(state.reading=!1),skipAdd||(state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream))),maybeReadMore(stream,state)}else addToFront||(state.reading=!1);return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||0===state.length&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}function chunkInvalid(state,chunk){var er=null;return Buffer.isBuffer(chunk)||"string"==typeof chunk||null===chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function onEofChunk(stream,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?processNextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,processNextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return nstr.length?str.length:n;if(ret+=nb===str.length?str:str.slice(0,n),0===(n-=nb)){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=bufferShim.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),0===(n-=nb)){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,processNextTick(endReadableNT,state,stream))}function endReadableNT(state,stream){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}function indexOf(xs,x){for(var i=0,l=xs.length;i=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n0?fromList(n,state):null,null===ret?(state.needReadable=!0,n=0):state.length-=n,0===state.length&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),null!==ret&&this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable){debug("onunpipe"),readable===src&&cleanup()}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",cleanup),src.removeListener("data",ondata),cleanedUp=!0,!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain()}function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1,!1!==dest.write(chunk)||increasedAwaitDrain||((1===state.pipesCount&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EElistenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:cleanup;state.endEmitted?processNextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1,increasedAwaitDrain=!1;return src.on("data",ondata),prependListener(dest,"error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState;if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i-1?setImmediate:processNextTick;Writable.WritableState=WritableState;var util=__webpack_require__(6);util.inherits=__webpack_require__(1);var internalUtil={deprecate:__webpack_require__(72)},Stream=__webpack_require__(284),Buffer=__webpack_require__(0).Buffer,bufferShim=__webpack_require__(14);util.inherits(Writable,Stream),WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(_){}}();var realHasInstance;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return!!realHasInstance.call(this,object)||object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=Buffer.isBuffer(chunk);return"function"==typeof encoding&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),"function"!=typeof cb&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,state.writing||state.corked||state.finished||state.bufferProcessing||!state.bufferedRequest||clearBuffer(this,state))},Writable.prototype.setDefaultEncoding=function(encoding){if("string"==typeof encoding&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this},Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;"function"==typeof chunk?(cb=chunk,chunk=null,encoding=null):"function"==typeof encoding&&(cb=encoding,encoding=null),null!==chunk&&void 0!==chunk&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||state.finished||endWritable(this,state,cb)}}).call(exports,__webpack_require__(2),__webpack_require__(22).setImmediate)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(8).EventEmitter},function(module,exports,__webpack_require__){exports=module.exports=__webpack_require__(281),exports.Stream=exports,exports.Readable=exports,exports.Writable=__webpack_require__(283),exports.Duplex=__webpack_require__(66),exports.Transform=__webpack_require__(282),exports.PassThrough=__webpack_require__(688)},function(module,exports,__webpack_require__){"use strict";exports=module.exports,exports.PROTOCOL_ID="/multistream/1.0.0"},function(module,exports,__webpack_require__){"use strict";function matchExact(myProtocol,senderProtocol,callback){callback(null,myProtocol===senderProtocol)}module.exports=matchExact},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function select(multicodec,callback,log){const stream=handshake({timeout:6e4},callback),shake=stream.handshake;return log("writing multicodec: "+multicodec),writeEncoded(shake,new Buffer(multicodec+"\n"),callback),pullLP.decodeFromReader(shake,(err,data)=>{if(err)return callback(err);const protocol=data.toString().slice(0,-1);if(protocol!==multicodec)return callback(new Error(`"${multicodec}" not supported`),shake.rest());log("received ack: "+protocol),callback(null,shake.rest())}),stream}const handshake=__webpack_require__(67),pullLP=__webpack_require__(28),util=__webpack_require__(112),writeEncoded=util.writeEncoded;module.exports=select}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function adler32(adler,buf,len,pos){for(var s1=65535&adler|0,s2=adler>>>16&65535|0,n=0;0!==len;){n=len>2e3?2e3:len,len-=n;do{s1=s1+buf[pos++]|0,s2=s2+s1|0}while(--n);s1%=65521,s2%=65521}return s1|s2<<16|0}module.exports=adler32},function(module,exports,__webpack_require__){"use strict";function crc32(crc,buf,len,pos){var t=crcTable,end=pos+len;crc^=-1;for(var i=pos;i>>8^t[255&(crc^buf[i])];return crc^-1}var crcTable=function(){for(var c,table=[],n=0;n<256;n++){c=n;for(var k=0;k<8;k++)c=1&c?3988292384^c>>>1:c>>>1;table[n]=c}return table}();module.exports=crc32},function(module,exports){var re=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,parts=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];module.exports=function(str){var src=str,b=str.indexOf("["),e=str.indexOf("]");b!=-1&&e!=-1&&(str=str.substring(0,b)+str.substring(b,e).replace(/:/g,";")+str.substring(e,str.length));for(var m=re.exec(str||""),uri={},i=14;i--;)uri[parts[i]]=m[i]||"";return b!=-1&&e!=-1&&(uri.source=src,uri.host=uri.host.substring(1,uri.host.length-1).replace(/;/g,":"),uri.authority=uri.authority.replace("[","").replace("]","").replace(/;/g,":"),uri.ipv6uri=!0),uri}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function getB58Str(peer){let b58Str;if("string"==typeof peer)b58Str=peer;else if(Buffer.isBuffer(peer))b58Str=bs58.encode(peer).toString();else if(PeerId.isPeerId(peer))b58Str=peer.toB58String();else{if(!PeerInfo.isPeerInfo(peer))throw new Error("not valid PeerId or PeerInfo, or B58Str");b58Str=peer.id.toB58String()}return b58Str}const bs58=__webpack_require__(24),PeerId=__webpack_require__(31),PeerInfo=__webpack_require__(51);class PeerBook{constructor(){this._peers={}}has(peer){const b58Str=getB58Str(peer);return Boolean(this._peers[b58Str])}put(peerInfo,replace){const localPeerInfo=this._peers[peerInfo.id.toB58String()];if(!localPeerInfo||replace)return this._peers[peerInfo.id.toB58String()]=peerInfo,peerInfo;peerInfo.multiaddrs.forEach(ma=>localPeerInfo.multiaddrs.add(ma));const ma=peerInfo.isConnected();return ma&&localPeerInfo.connect(ma),peerInfo.protocols.forEach(p=>localPeerInfo.protocols.add(p)),!localPeerInfo.id.privKey&&peerInfo.id.privKey&&(localPeerInfo.id.privKey=peerInfo.id.privKey),!localPeerInfo.id.pubKey&&peerInfo.id.pubKey&&(localPeerInfo.id.pubKey=peerInfo.id.pubKey),localPeerInfo}get(peer){const b58Str=getB58Str(peer),peerInfo=this._peers[b58Str];if(peerInfo)return peerInfo;throw new Error("PeerInfo not found")}getAll(){return this._peers}getAllArray(){return Object.keys(this._peers).map(b58Str=>this._peers[b58Str])}getMultiaddrs(peer){return this.get(peer).multiaddrs.toArray()}remove(peer){const b58Str=getB58Str(peer);this._peers[b58Str]&&delete this._peers[b58Str]}}module.exports=PeerBook}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function ensureMultiaddr(ma){return multiaddr.isMultiaddr(ma)?ma:multiaddr(ma)}const multiaddr=__webpack_require__(34);module.exports={ensureMultiaddr:ensureMultiaddr}},function(module,exports,__webpack_require__){var Source=__webpack_require__(83),Sink=__webpack_require__(296);module.exports=function(){var source=Source(),sink=Sink();return{source:source,sink:sink,resolve:function(duplex){source.resolve(duplex.source),sink.resolve(duplex.sink)}}}},function(module,exports,__webpack_require__){exports.source=__webpack_require__(83),exports.through=__webpack_require__(724),exports.sink=__webpack_require__(296),exports.duplex=__webpack_require__(294)},function(module,exports){module.exports=function(stream){function consume(_read){if(!_read)throw new Error("must be passed a readable");read=_read,started&&stream(read)}var read,started=!1;Math.random();return consume.resolve=consume.ready=consume.start=function(_stream){return started=!0,stream=_stream||stream,read&&stream(read),consume},consume}},function(module,exports){module.exports=function(onPause){function reader(_read){return read=_read,function(abort,cb){paused?wait=[abort,cb]:read(abort,cb)}}var wait,read,paused;return reader.pause=function(){paused||onPause&&onPause(paused=!0)},reader.resume=function(){if(paused&&(paused=!1,onPause&&onPause(paused),wait)){var _wait=wait;wait=null,read(_wait[0],_wait[1])}},reader}},function(module,exports,__webpack_require__){"use strict";function isInteger(i){return Number.isFinite(i)}function isFunction(f){return"function"==typeof f}function maxDelay(fn,delay){return delay?function(a,cb){var timer=setTimeout(function(){fn(new Error("pull-reader: read exceeded timeout"),cb)},delay);fn(a,function(err,value){clearTimeout(timer),cb(err,value)})}:fn}var State=__webpack_require__(729);module.exports=function(timeout){function drain(){for(;queue.length;)if(null==queue[0].length&&state.has(1))queue.shift().cb(null,state.get());else if(state.has(queue[0].length)){var next=queue.shift();next.cb(null,state.get(next.length))}else{if(!ended)return!!queue.length;queue.shift().cb(ended)}return queue.length||!state.has(1)||abort}function more(){drain()&&!reading&&(!read||reading||streaming||(reading=!0,readTimed(null,function(err,data){if(reading=!1,err)return ended=err,drain();state.add(data),more()})))}function reader(_read){if(abort){for(;queue.length;)queue.shift().cb(abort);return cb&&cb(abort)}readTimed=maxDelay(_read,timeout),read=_read,more()}var read,readTimed,ended,streaming,abort,queue=[],reading=!1,state=State();return reader.abort=function(err,cb){abort=err||!0,read?(reading=!0,read(abort,function(){for(;queue.length;)queue.shift().cb(abort);cb&&cb(abort)})):cb()},reader.read=function(len,_timeout,cb){if(isFunction(_timeout)&&(cb=_timeout,_timeout=timeout),!isFunction(cb))return streaming=!0,function(abort,cb){if(reading||state.has(1)){if(abort)return read(abort,cb);queue.push({length:null,cb:cb}),more()}else maxDelay(read,_timeout)(abort,function(err,data){cb(err,data)})};queue.push({length:isInteger(len)?len:null,cb:cb}),more()},reader}},function(module,exports,__webpack_require__){"use strict";module.exports=function pull(a){var length=arguments.length;if("function"==typeof a&&1===a.length){for(var args=new Array(length),i=0;i0)if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var e=new Error("stream.unshift() after end event");stream.emit("error",e)}else!state.decoder||addToFront||encoding||(chunk=state.decoder.write(chunk)),addToFront||(state.reading=!1),state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream)),maybeReadMore(stream,state);else addToFront||(state.reading=!1);return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM)n=MAX_HWM;else{n--;for(var p=1;p<32;p<<=1)n|=n>>p;n++}return n}function howMuchToRead(n,state){return 0===state.length&&state.ended?0:state.objectMode?0===n?0:1:isNaN(n)||util.isNull(n)?state.flowing&&state.buffer.length?state.buffer[0].length:state.length:n<=0?0:(n>state.highWaterMark&&(state.highWaterMark=roundUpToNextPowerOf2(n)),n>state.length?state.ended?state.length:(state.needReadable=!0,0):n)}function chunkInvalid(state,chunk){var er=null;return util.isBuffer(chunk)||util.isString(chunk)||util.isNullOrUndefined(chunk)||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function onEofChunk(stream,state){if(state.decoder&&!state.ended){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?process.nextTick(function(){emitReadable_(stream)}):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,process.nextTick(function(){maybeReadMore_(stream,state)}))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=length)ret=stringMode?list.join(""):Buffer.concat(list,length),list.length=0;else if(n0)throw new Error("endReadable called on non-empty stream");state.endEmitted||(state.ended=!0,process.nextTick(function(){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}))}function forEach(xs,f){for(var i=0,l=xs.length;i0)&&(state.emittedReadable=!1),0===n&&state.needReadable&&(state.length>=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n0?fromList(n,state):null,util.isNull(ret)&&(state.needReadable=!0,n=0),state.length-=n,0!==state.length||state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&0===state.length&&endReadable(this),util.isNull(ret)||this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable){debug("onunpipe"),readable===src&&cleanup()}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",cleanup),src.removeListener("data",ondata),!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain()}function ondata(chunk){debug("ondata"),!1===dest.write(chunk)&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EE.listenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:cleanup;state.endEmitted?process.nextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);return dest.on("drain",ondrain),src.on("data",ondata),dest._events&&dest._events.error?isArray(dest._events.error)?dest._events.error.unshift(onerror):dest._events.error=[onerror,dest._events.error]:dest.on("error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState;if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i1){for(var cbs=[],c=0;c>>32-n}function fn1(a,b,c,d,e,m,k,s){return rotl(a+(b^c^d)+m+k|0,s)+e|0}function fn2(a,b,c,d,e,m,k,s){return rotl(a+(b&c|~b&d)+m+k|0,s)+e|0}function fn3(a,b,c,d,e,m,k,s){return rotl(a+((b|~c)^d)+m+k|0,s)+e|0}function fn4(a,b,c,d,e,m,k,s){return rotl(a+(b&d|c&~d)+m+k|0,s)+e|0}function fn5(a,b,c,d,e,m,k,s){return rotl(a+(b^(c|~d))+m+k|0,s)+e|0}var inherits=__webpack_require__(1),HashBase=__webpack_require__(431);inherits(RIPEMD160,HashBase),RIPEMD160.prototype._update=function(){for(var m=new Array(16),i=0;i<16;++i)m[i]=this._block.readInt32LE(4*i);var al=this._a,bl=this._b,cl=this._c,dl=this._d,el=this._e;al=fn1(al,bl,cl,dl,el,m[0],0,11),cl=rotl(cl,10),el=fn1(el,al,bl,cl,dl,m[1],0,14),bl=rotl(bl,10),dl=fn1(dl,el,al,bl,cl,m[2],0,15),al=rotl(al,10),cl=fn1(cl,dl,el,al,bl,m[3],0,12),el=rotl(el,10),bl=fn1(bl,cl,dl,el,al,m[4],0,5),dl=rotl(dl,10),al=fn1(al,bl,cl,dl,el,m[5],0,8),cl=rotl(cl,10),el=fn1(el,al,bl,cl,dl,m[6],0,7),bl=rotl(bl,10),dl=fn1(dl,el,al,bl,cl,m[7],0,9),al=rotl(al,10),cl=fn1(cl,dl,el,al,bl,m[8],0,11),el=rotl(el,10),bl=fn1(bl,cl,dl,el,al,m[9],0,13),dl=rotl(dl,10),al=fn1(al,bl,cl,dl,el,m[10],0,14),cl=rotl(cl,10),el=fn1(el,al,bl,cl,dl,m[11],0,15),bl=rotl(bl,10),dl=fn1(dl,el,al,bl,cl,m[12],0,6),al=rotl(al,10),cl=fn1(cl,dl,el,al,bl,m[13],0,7),el=rotl(el,10),bl=fn1(bl,cl,dl,el,al,m[14],0,9),dl=rotl(dl,10),al=fn1(al,bl,cl,dl,el,m[15],0,8),cl=rotl(cl,10),el=fn2(el,al,bl,cl,dl,m[7],1518500249,7),bl=rotl(bl,10),dl=fn2(dl,el,al,bl,cl,m[4],1518500249,6),al=rotl(al,10),cl=fn2(cl,dl,el,al,bl,m[13],1518500249,8),el=rotl(el,10),bl=fn2(bl,cl,dl,el,al,m[1],1518500249,13),dl=rotl(dl,10),al=fn2(al,bl,cl,dl,el,m[10],1518500249,11),cl=rotl(cl,10),el=fn2(el,al,bl,cl,dl,m[6],1518500249,9),bl=rotl(bl,10),dl=fn2(dl,el,al,bl,cl,m[15],1518500249,7),al=rotl(al,10),cl=fn2(cl,dl,el,al,bl,m[3],1518500249,15),el=rotl(el,10),bl=fn2(bl,cl,dl,el,al,m[12],1518500249,7),dl=rotl(dl,10),al=fn2(al,bl,cl,dl,el,m[0],1518500249,12),cl=rotl(cl,10),el=fn2(el,al,bl,cl,dl,m[9],1518500249,15),bl=rotl(bl,10),dl=fn2(dl,el,al,bl,cl,m[5],1518500249,9),al=rotl(al,10),cl=fn2(cl,dl,el,al,bl,m[2],1518500249,11),el=rotl(el,10),bl=fn2(bl,cl,dl,el,al,m[14],1518500249,7),dl=rotl(dl,10),al=fn2(al,bl,cl,dl,el,m[11],1518500249,13),cl=rotl(cl,10),el=fn2(el,al,bl,cl,dl,m[8],1518500249,12),bl=rotl(bl,10),dl=fn3(dl,el,al,bl,cl,m[3],1859775393,11),al=rotl(al,10),cl=fn3(cl,dl,el,al,bl,m[10],1859775393,13),el=rotl(el,10),bl=fn3(bl,cl,dl,el,al,m[14],1859775393,6),dl=rotl(dl,10),al=fn3(al,bl,cl,dl,el,m[4],1859775393,7),cl=rotl(cl,10),el=fn3(el,al,bl,cl,dl,m[9],1859775393,14),bl=rotl(bl,10),dl=fn3(dl,el,al,bl,cl,m[15],1859775393,9),al=rotl(al,10),cl=fn3(cl,dl,el,al,bl,m[8],1859775393,13),el=rotl(el,10),bl=fn3(bl,cl,dl,el,al,m[1],1859775393,15),dl=rotl(dl,10),al=fn3(al,bl,cl,dl,el,m[2],1859775393,14),cl=rotl(cl,10),el=fn3(el,al,bl,cl,dl,m[7],1859775393,8),bl=rotl(bl,10),dl=fn3(dl,el,al,bl,cl,m[0],1859775393,13),al=rotl(al,10),cl=fn3(cl,dl,el,al,bl,m[6],1859775393,6),el=rotl(el,10),bl=fn3(bl,cl,dl,el,al,m[13],1859775393,5),dl=rotl(dl,10),al=fn3(al,bl,cl,dl,el,m[11],1859775393,12),cl=rotl(cl,10),el=fn3(el,al,bl,cl,dl,m[5],1859775393,7),bl=rotl(bl,10),dl=fn3(dl,el,al,bl,cl,m[12],1859775393,5),al=rotl(al,10),cl=fn4(cl,dl,el,al,bl,m[1],2400959708,11),el=rotl(el,10),bl=fn4(bl,cl,dl,el,al,m[9],2400959708,12),dl=rotl(dl,10),al=fn4(al,bl,cl,dl,el,m[11],2400959708,14),cl=rotl(cl,10),el=fn4(el,al,bl,cl,dl,m[10],2400959708,15),bl=rotl(bl,10),dl=fn4(dl,el,al,bl,cl,m[0],2400959708,14),al=rotl(al,10),cl=fn4(cl,dl,el,al,bl,m[8],2400959708,15),el=rotl(el,10),bl=fn4(bl,cl,dl,el,al,m[12],2400959708,9),dl=rotl(dl,10),al=fn4(al,bl,cl,dl,el,m[4],2400959708,8),cl=rotl(cl,10),el=fn4(el,al,bl,cl,dl,m[13],2400959708,9),bl=rotl(bl,10),dl=fn4(dl,el,al,bl,cl,m[3],2400959708,14),al=rotl(al,10),cl=fn4(cl,dl,el,al,bl,m[7],2400959708,5),el=rotl(el,10),bl=fn4(bl,cl,dl,el,al,m[15],2400959708,6),dl=rotl(dl,10),al=fn4(al,bl,cl,dl,el,m[14],2400959708,8),cl=rotl(cl,10),el=fn4(el,al,bl,cl,dl,m[5],2400959708,6),bl=rotl(bl,10),dl=fn4(dl,el,al,bl,cl,m[6],2400959708,5),al=rotl(al,10),cl=fn4(cl,dl,el,al,bl,m[2],2400959708,12),el=rotl(el,10),bl=fn5(bl,cl,dl,el,al,m[4],2840853838,9),dl=rotl(dl,10),al=fn5(al,bl,cl,dl,el,m[0],2840853838,15),cl=rotl(cl,10),el=fn5(el,al,bl,cl,dl,m[5],2840853838,5),bl=rotl(bl,10),dl=fn5(dl,el,al,bl,cl,m[9],2840853838,11),al=rotl(al,10),cl=fn5(cl,dl,el,al,bl,m[7],2840853838,6),el=rotl(el,10),bl=fn5(bl,cl,dl,el,al,m[12],2840853838,8),dl=rotl(dl,10),al=fn5(al,bl,cl,dl,el,m[2],2840853838,13),cl=rotl(cl,10),el=fn5(el,al,bl,cl,dl,m[10],2840853838,12),bl=rotl(bl,10),dl=fn5(dl,el,al,bl,cl,m[14],2840853838,5),al=rotl(al,10),cl=fn5(cl,dl,el,al,bl,m[1],2840853838,12),el=rotl(el,10),bl=fn5(bl,cl,dl,el,al,m[3],2840853838,13),dl=rotl(dl,10),al=fn5(al,bl,cl,dl,el,m[8],2840853838,14),cl=rotl(cl,10),el=fn5(el,al,bl,cl,dl,m[11],2840853838,11),bl=rotl(bl,10),dl=fn5(dl,el,al,bl,cl,m[6],2840853838,8),al=rotl(al,10),cl=fn5(cl,dl,el,al,bl,m[15],2840853838,5),el=rotl(el,10),bl=fn5(bl,cl,dl,el,al,m[13],2840853838,6),dl=rotl(dl,10);var ar=this._a,br=this._b,cr=this._c,dr=this._d,er=this._e;ar=fn5(ar,br,cr,dr,er,m[5],1352829926,8),cr=rotl(cr,10),er=fn5(er,ar,br,cr,dr,m[14],1352829926,9),br=rotl(br,10),dr=fn5(dr,er,ar,br,cr,m[7],1352829926,9),ar=rotl(ar,10),cr=fn5(cr,dr,er,ar,br,m[0],1352829926,11),er=rotl(er,10),br=fn5(br,cr,dr,er,ar,m[9],1352829926,13),dr=rotl(dr,10),ar=fn5(ar,br,cr,dr,er,m[2],1352829926,15),cr=rotl(cr,10),er=fn5(er,ar,br,cr,dr,m[11],1352829926,15),br=rotl(br,10),dr=fn5(dr,er,ar,br,cr,m[4],1352829926,5),ar=rotl(ar,10),cr=fn5(cr,dr,er,ar,br,m[13],1352829926,7),er=rotl(er,10),br=fn5(br,cr,dr,er,ar,m[6],1352829926,7),dr=rotl(dr,10),ar=fn5(ar,br,cr,dr,er,m[15],1352829926,8),cr=rotl(cr,10),er=fn5(er,ar,br,cr,dr,m[8],1352829926,11),br=rotl(br,10),dr=fn5(dr,er,ar,br,cr,m[1],1352829926,14),ar=rotl(ar,10),cr=fn5(cr,dr,er,ar,br,m[10],1352829926,14),er=rotl(er,10),br=fn5(br,cr,dr,er,ar,m[3],1352829926,12),dr=rotl(dr,10),ar=fn5(ar,br,cr,dr,er,m[12],1352829926,6),cr=rotl(cr,10),er=fn4(er,ar,br,cr,dr,m[6],1548603684,9),br=rotl(br,10),dr=fn4(dr,er,ar,br,cr,m[11],1548603684,13),ar=rotl(ar,10),cr=fn4(cr,dr,er,ar,br,m[3],1548603684,15),er=rotl(er,10),br=fn4(br,cr,dr,er,ar,m[7],1548603684,7),dr=rotl(dr,10),ar=fn4(ar,br,cr,dr,er,m[0],1548603684,12),cr=rotl(cr,10),er=fn4(er,ar,br,cr,dr,m[13],1548603684,8),br=rotl(br,10),dr=fn4(dr,er,ar,br,cr,m[5],1548603684,9),ar=rotl(ar,10),cr=fn4(cr,dr,er,ar,br,m[10],1548603684,11),er=rotl(er,10),br=fn4(br,cr,dr,er,ar,m[14],1548603684,7),dr=rotl(dr,10),ar=fn4(ar,br,cr,dr,er,m[15],1548603684,7),cr=rotl(cr,10),er=fn4(er,ar,br,cr,dr,m[8],1548603684,12),br=rotl(br,10),dr=fn4(dr,er,ar,br,cr,m[12],1548603684,7),ar=rotl(ar,10),cr=fn4(cr,dr,er,ar,br,m[4],1548603684,6),er=rotl(er,10),br=fn4(br,cr,dr,er,ar,m[9],1548603684,15),dr=rotl(dr,10),ar=fn4(ar,br,cr,dr,er,m[1],1548603684,13),cr=rotl(cr,10),er=fn4(er,ar,br,cr,dr,m[2],1548603684,11),br=rotl(br,10),dr=fn3(dr,er,ar,br,cr,m[15],1836072691,9),ar=rotl(ar,10),cr=fn3(cr,dr,er,ar,br,m[5],1836072691,7),er=rotl(er,10),br=fn3(br,cr,dr,er,ar,m[1],1836072691,15),dr=rotl(dr,10),ar=fn3(ar,br,cr,dr,er,m[3],1836072691,11),cr=rotl(cr,10),er=fn3(er,ar,br,cr,dr,m[7],1836072691,8),br=rotl(br,10),dr=fn3(dr,er,ar,br,cr,m[14],1836072691,6),ar=rotl(ar,10),cr=fn3(cr,dr,er,ar,br,m[6],1836072691,6),er=rotl(er,10),br=fn3(br,cr,dr,er,ar,m[9],1836072691,14),dr=rotl(dr,10),ar=fn3(ar,br,cr,dr,er,m[11],1836072691,12),cr=rotl(cr,10),er=fn3(er,ar,br,cr,dr,m[8],1836072691,13),br=rotl(br,10),dr=fn3(dr,er,ar,br,cr,m[12],1836072691,5),ar=rotl(ar,10),cr=fn3(cr,dr,er,ar,br,m[2],1836072691,14),er=rotl(er,10),br=fn3(br,cr,dr,er,ar,m[10],1836072691,13),dr=rotl(dr,10),ar=fn3(ar,br,cr,dr,er,m[0],1836072691,13),cr=rotl(cr,10),er=fn3(er,ar,br,cr,dr,m[4],1836072691,7),br=rotl(br,10),dr=fn3(dr,er,ar,br,cr,m[13],1836072691,5),ar=rotl(ar,10),cr=fn2(cr,dr,er,ar,br,m[8],2053994217,15),er=rotl(er,10),br=fn2(br,cr,dr,er,ar,m[6],2053994217,5),dr=rotl(dr,10),ar=fn2(ar,br,cr,dr,er,m[4],2053994217,8),cr=rotl(cr,10),er=fn2(er,ar,br,cr,dr,m[1],2053994217,11),br=rotl(br,10),dr=fn2(dr,er,ar,br,cr,m[3],2053994217,14),ar=rotl(ar,10),cr=fn2(cr,dr,er,ar,br,m[11],2053994217,14),er=rotl(er,10),br=fn2(br,cr,dr,er,ar,m[15],2053994217,6),dr=rotl(dr,10),ar=fn2(ar,br,cr,dr,er,m[0],2053994217,14),cr=rotl(cr,10),er=fn2(er,ar,br,cr,dr,m[5],2053994217,6),br=rotl(br,10),dr=fn2(dr,er,ar,br,cr,m[12],2053994217,9),ar=rotl(ar,10),cr=fn2(cr,dr,er,ar,br,m[2],2053994217,12),er=rotl(er,10),br=fn2(br,cr,dr,er,ar,m[13],2053994217,9),dr=rotl(dr,10),ar=fn2(ar,br,cr,dr,er,m[9],2053994217,12),cr=rotl(cr,10),er=fn2(er,ar,br,cr,dr,m[7],2053994217,5),br=rotl(br,10),dr=fn2(dr,er,ar,br,cr,m[10],2053994217,15),ar=rotl(ar,10),cr=fn2(cr,dr,er,ar,br,m[14],2053994217,8),er=rotl(er,10),br=fn1(br,cr,dr,er,ar,m[12],0,8),dr=rotl(dr,10),ar=fn1(ar,br,cr,dr,er,m[15],0,5),cr=rotl(cr,10),er=fn1(er,ar,br,cr,dr,m[10],0,12),br=rotl(br,10),dr=fn1(dr,er,ar,br,cr,m[4],0,9),ar=rotl(ar,10),cr=fn1(cr,dr,er,ar,br,m[1],0,12),er=rotl(er,10),br=fn1(br,cr,dr,er,ar,m[5],0,5),dr=rotl(dr,10),ar=fn1(ar,br,cr,dr,er,m[8],0,14),cr=rotl(cr,10),er=fn1(er,ar,br,cr,dr,m[7],0,6),br=rotl(br,10),dr=fn1(dr,er,ar,br,cr,m[6],0,8),ar=rotl(ar,10),cr=fn1(cr,dr,er,ar,br,m[2],0,13),er=rotl(er,10),br=fn1(br,cr,dr,er,ar,m[13],0,6),dr=rotl(dr,10),ar=fn1(ar,br,cr,dr,er,m[14],0,5),cr=rotl(cr,10),er=fn1(er,ar,br,cr,dr,m[0],0,15),br=rotl(br,10),dr=fn1(dr,er,ar,br,cr,m[3],0,13),ar=rotl(ar,10),cr=fn1(cr,dr,er,ar,br,m[9],0,11),er=rotl(er,10),br=fn1(br,cr,dr,er,ar,m[11],0,11),dr=rotl(dr,10);var t=this._b+cl+dr|0;this._b=this._c+dl+er|0,this._c=this._d+el+ar|0,this._d=this._e+al+br|0,this._e=this._a+bl+cr|0,this._a=t},RIPEMD160.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var buffer=new Buffer(20);return buffer.writeInt32LE(this._a,0),buffer.writeInt32LE(this._b,4),buffer.writeInt32LE(this._c,8),buffer.writeInt32LE(this._d,12),buffer.writeInt32LE(this._e,16),buffer},module.exports=RIPEMD160}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function initCompressedValue(value,defaultValue){return void 0===value?defaultValue:(assert.isBoolean(value,messages.COMPRESSED_TYPE_INVALID),value)}var assert=__webpack_require__(769),der=__webpack_require__(770),messages=__webpack_require__(140);module.exports=function(secp256k1){return{privateKeyVerify:function(privateKey){return assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),32===privateKey.length&&secp256k1.privateKeyVerify(privateKey)},privateKeyExport:function(privateKey,compressed){assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),assert.isBufferLength(privateKey,32,messages.EC_PRIVATE_KEY_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0);var publicKey=secp256k1.privateKeyExport(privateKey,compressed);return der.privateKeyExport(privateKey,publicKey,compressed)},privateKeyImport:function(privateKey){if(assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),(privateKey=der.privateKeyImport(privateKey))&&32===privateKey.length&&secp256k1.privateKeyVerify(privateKey))return privateKey;throw new Error(messages.EC_PRIVATE_KEY_IMPORT_DER_FAIL)},privateKeyTweakAdd:function(privateKey,tweak){return assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),assert.isBufferLength(privateKey,32,messages.EC_PRIVATE_KEY_LENGTH_INVALID),assert.isBuffer(tweak,messages.TWEAK_TYPE_INVALID),assert.isBufferLength(tweak,32,messages.TWEAK_LENGTH_INVALID),secp256k1.privateKeyTweakAdd(privateKey,tweak)},privateKeyTweakMul:function(privateKey,tweak){return assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),assert.isBufferLength(privateKey,32,messages.EC_PRIVATE_KEY_LENGTH_INVALID),assert.isBuffer(tweak,messages.TWEAK_TYPE_INVALID),assert.isBufferLength(tweak,32,messages.TWEAK_LENGTH_INVALID),secp256k1.privateKeyTweakMul(privateKey,tweak)},publicKeyCreate:function(privateKey,compressed){return assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),assert.isBufferLength(privateKey,32,messages.EC_PRIVATE_KEY_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0),secp256k1.publicKeyCreate(privateKey,compressed)},publicKeyConvert:function(publicKey,compressed){return assert.isBuffer(publicKey,messages.EC_PUBLIC_KEY_TYPE_INVALID),assert.isBufferLength2(publicKey,33,65,messages.EC_PUBLIC_KEY_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0),secp256k1.publicKeyConvert(publicKey,compressed)},publicKeyVerify:function(publicKey){return assert.isBuffer(publicKey,messages.EC_PUBLIC_KEY_TYPE_INVALID),secp256k1.publicKeyVerify(publicKey)},publicKeyTweakAdd:function(publicKey,tweak,compressed){return assert.isBuffer(publicKey,messages.EC_PUBLIC_KEY_TYPE_INVALID),assert.isBufferLength2(publicKey,33,65,messages.EC_PUBLIC_KEY_LENGTH_INVALID),assert.isBuffer(tweak,messages.TWEAK_TYPE_INVALID),assert.isBufferLength(tweak,32,messages.TWEAK_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0),secp256k1.publicKeyTweakAdd(publicKey,tweak,compressed)},publicKeyTweakMul:function(publicKey,tweak,compressed){return assert.isBuffer(publicKey,messages.EC_PUBLIC_KEY_TYPE_INVALID),assert.isBufferLength2(publicKey,33,65,messages.EC_PUBLIC_KEY_LENGTH_INVALID),assert.isBuffer(tweak,messages.TWEAK_TYPE_INVALID),assert.isBufferLength(tweak,32,messages.TWEAK_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0),secp256k1.publicKeyTweakMul(publicKey,tweak,compressed)},publicKeyCombine:function(publicKeys,compressed){assert.isArray(publicKeys,messages.EC_PUBLIC_KEYS_TYPE_INVALID),assert.isLengthGTZero(publicKeys,messages.EC_PUBLIC_KEYS_LENGTH_INVALID);for(var i=0;i=0||y.ucmp(BN.p)>=0?null:6!==first&&7!==first||y.isOdd()===(7===first)?0!==x.redSqr().redMul(x).redIAdd7().ucmp(y.redSqr())?null:new ECPoint(x,y):null):(x=BN.fromBuffer(publicKey.slice(1,33)),x.ucmp(BN.p)>=0?null:null===(y=x.redSqr().redMul(x).redIAdd7().redSqrt())?null:(3===first!==y.isOdd()&&(y=y.redNeg()),new ECPoint(x,y)))},ECPoint.prototype.toPublicKey=function(compressed){var publicKey,x=this.x,y=this.y;return compressed?(publicKey=new Buffer(33),publicKey[0]=y.isOdd()?3:2,x.toBuffer().copy(publicKey,1)):(publicKey=new Buffer(65),publicKey[0]=4,x.toBuffer().copy(publicKey,1),y.toBuffer().copy(publicKey,33)),publicKey},ECPoint.fromECJPoint=function(p){if(p.inf)return new ECPoint(null,null);var zinv=p.z.redInvm(),zinv2=zinv.redSqr();return new ECPoint(p.x.redMul(zinv2),p.y.redMul(zinv2).redMul(zinv))},ECPoint.prototype.toECJPoint=function(){return this.inf?new ECJPoint(null,null,null):new ECJPoint(this.x,this.y,ECJPoint.one)},ECPoint.prototype.neg=function(){return this.inf?this:new ECPoint(this.x,this.y.redNeg())},ECPoint.prototype.add=function(p){if(this.inf)return p;if(p.inf)return this;if(0===this.x.ucmp(p.x))return 0===this.y.ucmp(p.y)?this.dbl():new ECPoint(null,null);var s=this.y.redSub(p.y);s.isZero()||(s=s.redMul(this.x.redSub(p.x).redInvm()));var nx=s.redSqr().redISub(this.x).redISub(p.x);return new ECPoint(nx,s.redMul(this.x.redSub(nx)).redISub(this.y))},ECPoint.prototype.dbl=function(){if(this.inf)return this;var yy=this.y.redAdd(this.y);if(yy.isZero())return new ECPoint(null,null);var x2=this.x.redSqr(),s=x2.redAdd(x2).redIAdd(x2).redMul(yy.redInvm()),nx=s.redSqr().redISub(this.x.redAdd(this.x));return new ECPoint(nx,s.redMul(this.x.redSub(nx)).redISub(this.y))},ECPoint.prototype.mul=function(num){for(var nafPoints=this._getNAFPoints(4),points=nafPoints.points,naf=num.getNAF(nafPoints.wnd),acc=new ECJPoint(null,null,null),i=naf.length-1;i>=0;i--){for(var k=0;i>=0&&0===naf[i];i--,++k);if(i>=0&&(k+=1),acc=acc.dblp(k),i<0)break;var z=naf[i];acc=z>0?acc.mixedAdd(points[z-1>>1]):acc.mixedAdd(points[-z-1>>1].neg())}return ECPoint.fromECJPoint(acc)},ECPoint.prototype._getNAFPoints1=function(){return{wnd:1,points:[this]}},ECPoint.prototype._getNAFPoints=function(wnd){var points=new Array((1<>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10)}function sigma1(x){return(x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7)}function gamma0(x){return(x>>>7|x<<25)^(x>>>18|x<<14)^x>>>3}function gamma1(x){return(x>>>17|x<<15)^(x>>>19|x<<13)^x>>>10}var inherits=__webpack_require__(1),Hash=__webpack_require__(69),K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],W=new Array(64);inherits(Sha256,Hash),Sha256.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},Sha256.prototype._update=function(M){for(var W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,f=0|this._f,g=0|this._g,h=0|this._h,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<64;++i)W[i]=gamma1(W[i-2])+W[i-7]+gamma0(W[i-15])+W[i-16]|0;for(var j=0;j<64;++j){var T1=h+sigma1(e)+ch(e,f,g)+K[j]+W[j]|0,T2=sigma0(a)+maj(a,b,c)|0;h=g,g=f,f=e,e=d+T1|0,d=c,c=b,b=a,a=T1+T2|0}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0,this._f=f+this._f|0,this._g=g+this._g|0,this._h=h+this._h|0},Sha256.prototype._hash=function(){var H=new Buffer(32);return H.writeInt32BE(this._a,0),H.writeInt32BE(this._b,4),H.writeInt32BE(this._c,8),H.writeInt32BE(this._d,12),H.writeInt32BE(this._e,16),H.writeInt32BE(this._f,20),H.writeInt32BE(this._g,24),H.writeInt32BE(this._h,28),H},module.exports=Sha256}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Sha512(){this.init(),this._w=W,Hash.call(this,128,112)}function Ch(x,y,z){return z^x&(y^z)}function maj(x,y,z){return x&y|z&(x|y)}function sigma0(x,xl){return(x>>>28|xl<<4)^(xl>>>2|x<<30)^(xl>>>7|x<<25)}function sigma1(x,xl){return(x>>>14|xl<<18)^(x>>>18|xl<<14)^(xl>>>9|x<<23)}function Gamma0(x,xl){return(x>>>1|xl<<31)^(x>>>8|xl<<24)^x>>>7}function Gamma0l(x,xl){return(x>>>1|xl<<31)^(x>>>8|xl<<24)^(x>>>7|xl<<25)}function Gamma1(x,xl){return(x>>>19|xl<<13)^(xl>>>29|x<<3)^x>>>6}function Gamma1l(x,xl){return(x>>>19|xl<<13)^(xl>>>29|x<<3)^(x>>>6|xl<<26)}function getCarry(a,b){return a>>>0>>0?1:0}var inherits=__webpack_require__(1),Hash=__webpack_require__(69),K=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],W=new Array(160);inherits(Sha512,Hash),Sha512.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},Sha512.prototype._update=function(M){for(var W=this._w,ah=0|this._ah,bh=0|this._bh,ch=0|this._ch,dh=0|this._dh,eh=0|this._eh,fh=0|this._fh,gh=0|this._gh,hh=0|this._hh,al=0|this._al,bl=0|this._bl,cl=0|this._cl,dl=0|this._dl,el=0|this._el,fl=0|this._fl,gl=0|this._gl,hl=0|this._hl,i=0;i<32;i+=2)W[i]=M.readInt32BE(4*i),W[i+1]=M.readInt32BE(4*i+4);for(;i<160;i+=2){var xh=W[i-30],xl=W[i-30+1],gamma0=Gamma0(xh,xl),gamma0l=Gamma0l(xl,xh);xh=W[i-4],xl=W[i-4+1];var gamma1=Gamma1(xh,xl),gamma1l=Gamma1l(xl,xh),Wi7h=W[i-14],Wi7l=W[i-14+1],Wi16h=W[i-32],Wi16l=W[i-32+1],Wil=gamma0l+Wi7l|0,Wih=gamma0+Wi7h+getCarry(Wil,gamma0l)|0;Wil=Wil+gamma1l|0,Wih=Wih+gamma1+getCarry(Wil,gamma1l)|0,Wil=Wil+Wi16l|0,Wih=Wih+Wi16h+getCarry(Wil,Wi16l)|0,W[i]=Wih,W[i+1]=Wil}for(var j=0;j<160;j+=2){Wih=W[j],Wil=W[j+1];var majh=maj(ah,bh,ch),majl=maj(al,bl,cl),sigma0h=sigma0(ah,al),sigma0l=sigma0(al,ah),sigma1h=sigma1(eh,el),sigma1l=sigma1(el,eh),Kih=K[j],Kil=K[j+1],chh=Ch(eh,fh,gh),chl=Ch(el,fl,gl),t1l=hl+sigma1l|0,t1h=hh+sigma1h+getCarry(t1l,hl)|0;t1l=t1l+chl|0,t1h=t1h+chh+getCarry(t1l,chl)|0,t1l=t1l+Kil|0,t1h=t1h+Kih+getCarry(t1l,Kil)|0,t1l=t1l+Wil|0,t1h=t1h+Wih+getCarry(t1l,Wil)|0;var t2l=sigma0l+majl|0,t2h=sigma0h+majh+getCarry(t2l,sigma0l)|0;hh=gh,hl=gl,gh=fh,gl=fl,fh=eh,fl=el,el=dl+t1l|0,eh=dh+t1h+getCarry(el,dl)|0,dh=ch,dl=cl,ch=bh,cl=bl,bh=ah,bl=al,al=t1l+t2l|0,ah=t1h+t2h+getCarry(al,t1l)|0}this._al=this._al+al|0,this._bl=this._bl+bl|0,this._cl=this._cl+cl|0,this._dl=this._dl+dl|0,this._el=this._el+el|0,this._fl=this._fl+fl|0,this._gl=this._gl+gl|0,this._hl=this._hl+hl|0,this._ah=this._ah+ah+getCarry(this._al,al)|0,this._bh=this._bh+bh+getCarry(this._bl,bl)|0,this._ch=this._ch+ch+getCarry(this._cl,cl)|0,this._dh=this._dh+dh+getCarry(this._dl,dl)|0,this._eh=this._eh+eh+getCarry(this._el,el)|0,this._fh=this._fh+fh+getCarry(this._fl,fl)|0,this._gh=this._gh+gh+getCarry(this._gl,gl)|0,this._hh=this._hh+hh+getCarry(this._hl,hl)|0},Sha512.prototype._hash=function(){function writeInt64BE(h,l,offset){H.writeInt32BE(h,offset),H.writeInt32BE(l,offset+4)}var H=new Buffer(64);return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),writeInt64BE(this._gh,this._gl,48),writeInt64BE(this._hh,this._hl,56),H},module.exports=Sha512}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(process){function prependListener(emitter,event,fn){if("function"==typeof emitter.prependListener)return emitter.prependListener(event,fn);emitter._events&&emitter._events[event]?isArray(emitter._events[event])?emitter._events[event].unshift(fn):emitter._events[event]=[fn,emitter._events[event]]:emitter.on(event,fn)}function ReadableState(options,stream){Duplex=Duplex||__webpack_require__(70),options=options||{},this.objectMode=!!options.objectMode,stream instanceof Duplex&&(this.objectMode=this.objectMode||!!options.readableObjectMode);var hwm=options.highWaterMark,defaultHwm=this.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:defaultHwm,this.highWaterMark=~~this.highWaterMark,this.buffer=new BufferList,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=options.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(StringDecoder||(StringDecoder=__webpack_require__(18).StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding)}function Readable(options){if(Duplex=Duplex||__webpack_require__(70),!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this),this.readable=!0,options&&"function"==typeof options.read&&(this._read=options.read),Stream.call(this)}function readableAddChunk(stream,state,chunk,encoding,addToFront){var er=chunkInvalid(state,chunk);if(er)stream.emit("error",er);else if(null===chunk)state.reading=!1,onEofChunk(stream,state);else if(state.objectMode||chunk&&chunk.length>0)if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var _e=new Error("stream.unshift() after end event");stream.emit("error",_e)}else{var skipAdd;!state.decoder||addToFront||encoding||(chunk=state.decoder.write(chunk),skipAdd=!state.objectMode&&0===chunk.length),addToFront||(state.reading=!1),skipAdd||(state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream))),maybeReadMore(stream,state)}else addToFront||(state.reading=!1);return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||0===state.length&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}function chunkInvalid(state,chunk){var er=null;return Buffer.isBuffer(chunk)||"string"==typeof chunk||null===chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function onEofChunk(stream,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?processNextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,processNextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return nstr.length?str.length:n;if(ret+=nb===str.length?str:str.slice(0,n),0===(n-=nb)){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=bufferShim.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),0===(n-=nb)){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,processNextTick(endReadableNT,state,stream))}function endReadableNT(state,stream){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}function indexOf(xs,x){for(var i=0,l=xs.length;i=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n0?fromList(n,state):null,null===ret?(state.needReadable=!0,n=0):state.length-=n,0===state.length&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),null!==ret&&this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable){debug("onunpipe"),readable===src&&cleanup()}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",cleanup),src.removeListener("data",ondata),cleanedUp=!0,!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain()}function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1,!1!==dest.write(chunk)||increasedAwaitDrain||((1===state.pipesCount&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EElistenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:cleanup;state.endEmitted?processNextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1,increasedAwaitDrain=!1;return src.on("data",ondata),prependListener(dest,"error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState;if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i-1?setImmediate:processNextTick;Writable.WritableState=WritableState;var util=__webpack_require__(6);util.inherits=__webpack_require__(1);var internalUtil={deprecate:__webpack_require__(72)},Stream=__webpack_require__(319),Buffer=__webpack_require__(0).Buffer,bufferShim=__webpack_require__(14);util.inherits(Writable,Stream),WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(_){}}();var realHasInstance;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return!!realHasInstance.call(this,object)||object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=Buffer.isBuffer(chunk);return"function"==typeof encoding&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),"function"!=typeof cb&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){ +var state=this._writableState;state.corked&&(state.corked--,state.writing||state.corked||state.finished||state.bufferProcessing||!state.bufferedRequest||clearBuffer(this,state))},Writable.prototype.setDefaultEncoding=function(encoding){if("string"==typeof encoding&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this},Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;"function"==typeof chunk?(cb=chunk,chunk=null,encoding=null):"function"==typeof encoding&&(cb=encoding,encoding=null),null!==chunk&&void 0!==chunk&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||state.finished||endWritable(this,state,cb)}}).call(exports,__webpack_require__(2),__webpack_require__(22).setImmediate)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(8).EventEmitter},function(module,exports,__webpack_require__){"use strict";var transport=__webpack_require__(21),base=transport.protocol.base;exports.FRAME_HEADER_SIZE=8,exports.PING_OPAQUE_SIZE=4,exports.MAX_CONCURRENT_STREAMS=1/0,exports.DEFAULT_MAX_HEADER_LIST_SIZE=1/0,exports.DEFAULT_WEIGHT=16,exports.frameType={SYN_STREAM:1,SYN_REPLY:2,RST_STREAM:3,SETTINGS:4,PING:6,GOAWAY:7,HEADERS:8,WINDOW_UPDATE:9,X_FORWARDED_FOR:61440},exports.flags={FLAG_FIN:1,FLAG_COMPRESSED:2,FLAG_UNIDIRECTIONAL:2},exports.error={PROTOCOL_ERROR:1,INVALID_STREAM:2,REFUSED_STREAM:3,UNSUPPORTED_VERSION:4,CANCEL:5,INTERNAL_ERROR:6,FLOW_CONTROL_ERROR:7,STREAM_IN_USE:8,STREAM_CLOSED:9,INVALID_CREDENTIALS:10,FRAME_TOO_LARGE:11},exports.errorByCode=base.utils.reverse(exports.error),exports.settings={FLAG_SETTINGS_PERSIST_VALUE:1,FLAG_SETTINGS_PERSISTED:2,SETTINGS_UPLOAD_BANDWIDTH:1,SETTINGS_DOWNLOAD_BANDWIDTH:2,SETTINGS_ROUND_TRIP_TIME:3,SETTINGS_MAX_CONCURRENT_STREAMS:4,SETTINGS_CURRENT_CWND:5,SETTINGS_DOWNLOAD_RETRANS_RATE:6,SETTINGS_INITIAL_WINDOW_SIZE:7,SETTINGS_CLIENT_CERTIFICATE_VECTOR_SIZE:8},exports.settingsIndex=[null,"upload_bandwidth","download_bandwidth","round_trip_time","max_concurrent_streams","current_cwnd","download_retrans_rate","initial_window_size","client_certificate_vector_size"],exports.DEFAULT_WINDOW=65536,exports.MAX_INITIAL_WINDOW_SIZE=2147483647,exports.goaway={OK:0,PROTOCOL_ERROR:1,INTERNAL_ERROR:2},exports.goawayByCode=base.utils.reverse(exports.goaway),exports.statusReason={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},function(module,exports,__webpack_require__){"use strict";exports.name="spdy",exports.dictionary=__webpack_require__(797),exports.constants=__webpack_require__(320),exports.parser=__webpack_require__(799),exports.framer=__webpack_require__(798),exports.compressionPool=__webpack_require__(800)},function(module,exports,__webpack_require__){"use strict";(function(process){function prependListener(emitter,event,fn){if("function"==typeof emitter.prependListener)return emitter.prependListener(event,fn);emitter._events&&emitter._events[event]?isArray(emitter._events[event])?emitter._events[event].unshift(fn):emitter._events[event]=[fn,emitter._events[event]]:emitter.on(event,fn)}function ReadableState(options,stream){Duplex=Duplex||__webpack_require__(71),options=options||{},this.objectMode=!!options.objectMode,stream instanceof Duplex&&(this.objectMode=this.objectMode||!!options.readableObjectMode);var hwm=options.highWaterMark,defaultHwm=this.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:defaultHwm,this.highWaterMark=~~this.highWaterMark,this.buffer=new BufferList,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=options.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(StringDecoder||(StringDecoder=__webpack_require__(18).StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding)}function Readable(options){if(Duplex=Duplex||__webpack_require__(71),!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this),this.readable=!0,options&&"function"==typeof options.read&&(this._read=options.read),Stream.call(this)}function readableAddChunk(stream,state,chunk,encoding,addToFront){var er=chunkInvalid(state,chunk);if(er)stream.emit("error",er);else if(null===chunk)state.reading=!1,onEofChunk(stream,state);else if(state.objectMode||chunk&&chunk.length>0)if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var _e=new Error("stream.unshift() after end event");stream.emit("error",_e)}else{var skipAdd;!state.decoder||addToFront||encoding||(chunk=state.decoder.write(chunk),skipAdd=!state.objectMode&&0===chunk.length),addToFront||(state.reading=!1),skipAdd||(state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream))),maybeReadMore(stream,state)}else addToFront||(state.reading=!1);return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||0===state.length&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}function chunkInvalid(state,chunk){var er=null;return Buffer.isBuffer(chunk)||"string"==typeof chunk||null===chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function onEofChunk(stream,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?processNextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,processNextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return nstr.length?str.length:n;if(ret+=nb===str.length?str:str.slice(0,n),0===(n-=nb)){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=bufferShim.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),0===(n-=nb)){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,processNextTick(endReadableNT,state,stream))}function endReadableNT(state,stream){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}function indexOf(xs,x){for(var i=0,l=xs.length;i=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n0?fromList(n,state):null,null===ret?(state.needReadable=!0,n=0):state.length-=n,0===state.length&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),null!==ret&&this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable){debug("onunpipe"),readable===src&&cleanup()}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",cleanup),src.removeListener("data",ondata),cleanedUp=!0,!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain()}function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1,!1!==dest.write(chunk)||increasedAwaitDrain||((1===state.pipesCount&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EElistenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:cleanup;state.endEmitted?processNextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1,increasedAwaitDrain=!1;return src.on("data",ondata),prependListener(dest,"error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState;if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i-1?setImmediate:processNextTick;Writable.WritableState=WritableState;var util=__webpack_require__(6);util.inherits=__webpack_require__(1);var internalUtil={deprecate:__webpack_require__(72)},Stream=__webpack_require__(325),Buffer=__webpack_require__(0).Buffer,bufferShim=__webpack_require__(14);util.inherits(Writable,Stream),WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(_){}}();var realHasInstance;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return!!realHasInstance.call(this,object)||object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=Buffer.isBuffer(chunk);return"function"==typeof encoding&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),"function"!=typeof cb&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,state.writing||state.corked||state.finished||state.bufferProcessing||!state.bufferedRequest||clearBuffer(this,state))},Writable.prototype.setDefaultEncoding=function(encoding){if("string"==typeof encoding&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this},Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;"function"==typeof chunk?(cb=chunk,chunk=null,encoding=null):"function"==typeof encoding&&(cb=encoding,encoding=null),null!==chunk&&void 0!==chunk&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||state.finished||endWritable(this,state,cb)}}).call(exports,__webpack_require__(2),__webpack_require__(22).setImmediate)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(8).EventEmitter},function(module,exports,__webpack_require__){"use strict";(function(process){function prependListener(emitter,event,fn){if("function"==typeof emitter.prependListener)return emitter.prependListener(event,fn);emitter._events&&emitter._events[event]?isArray(emitter._events[event])?emitter._events[event].unshift(fn):emitter._events[event]=[fn,emitter._events[event]]:emitter.on(event,fn)}function ReadableState(options,stream){Duplex=Duplex||__webpack_require__(53),options=options||{},this.objectMode=!!options.objectMode,stream instanceof Duplex&&(this.objectMode=this.objectMode||!!options.readableObjectMode);var hwm=options.highWaterMark,defaultHwm=this.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:defaultHwm,this.highWaterMark=~~this.highWaterMark,this.buffer=new BufferList,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=options.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(StringDecoder||(StringDecoder=__webpack_require__(18).StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding)}function Readable(options){if(Duplex=Duplex||__webpack_require__(53),!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this),this.readable=!0,options&&"function"==typeof options.read&&(this._read=options.read),Stream.call(this)}function readableAddChunk(stream,state,chunk,encoding,addToFront){var er=chunkInvalid(state,chunk);if(er)stream.emit("error",er);else if(null===chunk)state.reading=!1,onEofChunk(stream,state);else if(state.objectMode||chunk&&chunk.length>0)if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var _e=new Error("stream.unshift() after end event");stream.emit("error",_e)}else{var skipAdd;!state.decoder||addToFront||encoding||(chunk=state.decoder.write(chunk),skipAdd=!state.objectMode&&0===chunk.length),addToFront||(state.reading=!1),skipAdd||(state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream))),maybeReadMore(stream,state)}else addToFront||(state.reading=!1);return needMoreData(state)}function needMoreData(state){ +return!state.ended&&(state.needReadable||state.length=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||0===state.length&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}function chunkInvalid(state,chunk){var er=null;return Buffer.isBuffer(chunk)||"string"==typeof chunk||null===chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function onEofChunk(stream,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?processNextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,processNextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return nstr.length?str.length:n;if(ret+=nb===str.length?str:str.slice(0,n),0===(n-=nb)){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=bufferShim.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),0===(n-=nb)){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,processNextTick(endReadableNT,state,stream))}function endReadableNT(state,stream){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}function indexOf(xs,x){for(var i=0,l=xs.length;i=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n0?fromList(n,state):null,null===ret?(state.needReadable=!0,n=0):state.length-=n,0===state.length&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),null!==ret&&this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable){debug("onunpipe"),readable===src&&cleanup()}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",cleanup),src.removeListener("data",ondata),cleanedUp=!0,!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain()}function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1,!1!==dest.write(chunk)||increasedAwaitDrain||((1===state.pipesCount&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EElistenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:cleanup;state.endEmitted?processNextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1,increasedAwaitDrain=!1;return src.on("data",ondata),prependListener(dest,"error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState;if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i2&&(prv=!0,info.shift());var jwk={ext:!0};switch(info[0][0]){case"1.2.840.113549.1.1.1":var rsaComp=["n","e","d","p","q","dp","dq","qi"],rsaKey=b2der(info[1]);prv&&rsaKey.shift();for(var i=0;i2&&(prv=!0,rsaKey.unshift(new Uint8Array([0]))),info[0][0]="1.2.840.113549.1.1.1",key=rsaKey;break;default:throw new TypeError("Unsupported key type")}return info.push(new Uint8Array(der2b(key)).buffer),prv?info.unshift(new Uint8Array([0])):info[1]={tag:3,value:info[1]},new Uint8Array(der2b(info)).buffer}function b2der(buf,ctx){if(buf instanceof ArrayBuffer&&(buf=new Uint8Array(buf)),ctx||(ctx={pos:0,end:buf.length}),ctx.end-ctx.pos<2||ctx.end>buf.length)throw new RangeError("Malformed DER");var tag=buf[ctx.pos++],len=buf[ctx.pos++];if(len>=128){if(len&=127,ctx.end-ctx.pos=128){var xlen=len,len=4;for(buf.splice(pos,0,xlen>>24&255,xlen>>16&255,xlen>>8&255,255&xlen);len>1&&!(xlen>>24);)xlen<<=8,len--;len<4&&buf.splice(pos,4-len),len|=128}return buf.splice(pos-2,2,tag,len),buf}function CryptoKey(key,alg,ext,use){Object.defineProperties(this,{_key:{value:key},type:{value:key.type,enumerable:!0},extractable:{value:void 0===ext?key.extractable:ext,enumerable:!0},algorithm:{value:void 0===alg?key.algorithm:alg,enumerable:!0},usages:{value:void 0===use?key.usages:use,enumerable:!0}})}function isPubKeyUse(u){return"verify"===u||"encrypt"===u||"wrapKey"===u}function isPrvKeyUse(u){return"sign"===u||"decrypt"===u||"unwrapKey"===u}if("function"!=typeof Promise)throw"Promise support required";var _crypto=global.crypto||global.msCrypto;if(_crypto){var _subtle=_crypto.subtle||_crypto.webkitSubtle;if(_subtle){var _Crypto=global.Crypto||_crypto.constructor||Object,_SubtleCrypto=global.SubtleCrypto||_subtle.constructor||Object,isEdge=(global.CryptoKey||global.Key||Object,global.navigator.userAgent.indexOf("Edge/")>-1),isIE=!!global.msCrypto&&!isEdge,isWebkit=!!_crypto.webkitSubtle;if(isIE||isWebkit){var oid2str={KoZIhvcNAQEB:"1.2.840.113549.1.1.1"},str2oid={"1.2.840.113549.1.1.1":"KoZIhvcNAQEB"};if(["generateKey","importKey","unwrapKey"].forEach(function(m){var _fn=_subtle[m];_subtle[m]=function(a,b,c){var ka,kx,ku,args=[].slice.call(arguments);switch(m){case"generateKey":ka=alg(a),kx=b,ku=c;break;case"importKey":ka=alg(c),kx=args[3],ku=args[4],"jwk"===a&&(b=b2jwk(b),b.alg||(b.alg=jwkAlg(ka)),b.key_ops||(b.key_ops="oct"!==b.kty?"d"in b?ku.filter(isPrvKeyUse):ku.filter(isPubKeyUse):ku.slice()),args[1]=jwk2b(b));break;case"unwrapKey":ka=args[4],kx=args[5],ku=args[6],args[2]=c._key}if("generateKey"===m&&"HMAC"===ka.name&&ka.hash)return ka.length=ka.length||{"SHA-1":512,"SHA-256":512,"SHA-384":1024,"SHA-512":1024}[ka.hash.name],_subtle.importKey("raw",_crypto.getRandomValues(new Uint8Array(ka.length+7>>3)),ka,kx,ku);if(isWebkit&&"generateKey"===m&&"RSASSA-PKCS1-v1_5"===ka.name&&(!ka.modulusLength||ka.modulusLength>=2048))return a=alg(a),a.name="RSAES-PKCS1-v1_5",delete a.hash,_subtle.generateKey(a,!0,["encrypt","decrypt"]).then(function(k){return Promise.all([_subtle.exportKey("jwk",k.publicKey),_subtle.exportKey("jwk",k.privateKey)])}).then(function(keys){return keys[0].alg=keys[1].alg=jwkAlg(ka),keys[0].key_ops=ku.filter(isPubKeyUse),keys[1].key_ops=ku.filter(isPrvKeyUse),Promise.all([_subtle.importKey("jwk",keys[0],ka,!0,keys[0].key_ops),_subtle.importKey("jwk",keys[1],ka,kx,keys[1].key_ops)])}).then(function(keys){return{publicKey:keys[0],privateKey:keys[1]}});if((isWebkit||isIE&&"SHA-1"===(ka.hash||{}).name)&&"importKey"===m&&"jwk"===a&&"HMAC"===ka.name&&"oct"===b.kty)return _subtle.importKey("raw",s2b(a2s(b.k)),c,args[3],args[4]);if(isWebkit&&"importKey"===m&&("spki"===a||"pkcs8"===a))return _subtle.importKey("jwk",pkcs2jwk(b),c,args[3],args[4]);if(isIE&&"unwrapKey"===m)return _subtle.decrypt(args[3],c,b).then(function(k){return _subtle.importKey(a,k,args[4],args[5],args[6])});var op;try{op=_fn.apply(_subtle,args)}catch(e){return Promise.reject(e)}return isIE&&(op=new Promise(function(res,rej){op.onabort=op.onerror=function(e){rej(e)},op.oncomplete=function(r){res(r.target.result)}})),op=op.then(function(k){return"HMAC"===ka.name&&(ka.length||(ka.length=8*k.algorithm.length)),0==ka.name.search("RSA")&&(ka.modulusLength||(ka.modulusLength=(k.publicKey||k).algorithm.modulusLength),ka.publicExponent||(ka.publicExponent=(k.publicKey||k).algorithm.publicExponent)),k=k.publicKey&&k.privateKey?{publicKey:new CryptoKey(k.publicKey,ka,kx,ku.filter(isPubKeyUse)),privateKey:new CryptoKey(k.privateKey,ka,kx,ku.filter(isPrvKeyUse))}:new CryptoKey(k,ka,kx,ku)})}}),["exportKey","wrapKey"].forEach(function(m){var _fn=_subtle[m];_subtle[m]=function(a,b,c){var args=[].slice.call(arguments);switch(m){case"exportKey":args[1]=b._key;break;case"wrapKey":args[1]=b._key,args[2]=c._key}if((isWebkit||isIE&&"SHA-1"===(b.algorithm.hash||{}).name)&&"exportKey"===m&&"jwk"===a&&"HMAC"===b.algorithm.name&&(args[0]="raw"),!isWebkit||"exportKey"!==m||"spki"!==a&&"pkcs8"!==a||(args[0]="jwk"),isIE&&"wrapKey"===m)return _subtle.exportKey(a,b).then(function(k){return"jwk"===a&&(k=s2b(unescape(encodeURIComponent(JSON.stringify(b2jwk(k)))))),_subtle.encrypt(args[3],c,k)});var op;try{op=_fn.apply(_subtle,args)}catch(e){return Promise.reject(e)}return isIE&&(op=new Promise(function(res,rej){op.onabort=op.onerror=function(e){rej(e)},op.oncomplete=function(r){res(r.target.result)}})),"exportKey"===m&&"jwk"===a&&(op=op.then(function(k){return(isWebkit||isIE&&"SHA-1"===(b.algorithm.hash||{}).name)&&"HMAC"===b.algorithm.name?{kty:"oct",alg:jwkAlg(b.algorithm),key_ops:b.usages.slice(),ext:!0,k:s2a(b2s(k))}:(k=b2jwk(k),k.alg||(k.alg=jwkAlg(b.algorithm)),k.key_ops||(k.key_ops="public"===b.type?b.usages.filter(isPubKeyUse):"private"===b.type?b.usages.filter(isPrvKeyUse):b.usages.slice()),k)})),!isWebkit||"exportKey"!==m||"spki"!==a&&"pkcs8"!==a||(op=op.then(function(k){return k=jwk2pkcs(b2jwk(k))})),op}}),["encrypt","decrypt","sign","verify"].forEach(function(m){var _fn=_subtle[m];_subtle[m]=function(a,b,c,d){if(isIE&&(!c.byteLength||d&&!d.byteLength))throw new Error("Empy input is not allowed");var args=[].slice.call(arguments),ka=alg(a);if(isIE&&"decrypt"===m&&"AES-GCM"===ka.name){var tl=a.tagLength>>3;args[2]=(c.buffer||c).slice(0,c.byteLength-tl),a.tag=(c.buffer||c).slice(c.byteLength-tl)}args[1]=b._key;var op;try{op=_fn.apply(_subtle,args)}catch(e){return Promise.reject(e)}return isIE&&(op=new Promise(function(res,rej){op.onabort=op.onerror=function(e){rej(e)},op.oncomplete=function(r){var r=r.target.result;if("encrypt"===m&&r instanceof AesGcmEncryptResult){var c=r.ciphertext,t=r.tag;r=new Uint8Array(c.byteLength+t.byteLength),r.set(new Uint8Array(c),0),r.set(new Uint8Array(t),c.byteLength),r=r.buffer}res(r)}})),op}}),isIE){var _digest=_subtle.digest;_subtle.digest=function(a,b){if(!b.byteLength)throw new Error("Empy input is not allowed");var op;try{op=_digest.call(_subtle,a,b)}catch(e){return Promise.reject(e)}return op=new Promise(function(res,rej){op.onabort=op.onerror=function(e){rej(e)},op.oncomplete=function(r){res(r.target.result)}})},global.crypto=Object.create(_crypto,{getRandomValues:{value:function(a){return _crypto.getRandomValues(a)}},subtle:{value:_subtle}}),global.CryptoKey=CryptoKey}isWebkit&&(_crypto.subtle=_subtle,global.Crypto=_Crypto,global.SubtleCrypto=_SubtleCrypto,global.CryptoKey=CryptoKey)}}}}},function(module,exports){function wrappy(fn,cb){function wrapper(){for(var args=new Array(arguments.length),i=0;i0);return encoded}function decode(str){var decoded=0;for(i=0;ibytes&&(end=bytes),start>=bytes||start>=end||0===bytes)return new ArrayBuffer(0);for(var abv=new Uint8Array(arraybuffer),result=new Uint8Array(end-start),i=start,ii=0;i=0&&workersList.splice(index),task.callback.apply(task,arguments),null!=err&&q.error(err,task.data)}numRunning<=q.concurrency-q.buffer&&q.unsaturated(),q.idle()&&q.drain(),q.process()}}if(null==concurrency)concurrency=1;else if(0===concurrency)throw new Error("Concurrency must not be zero");var _worker=(0,_wrapAsync2.default)(worker),numRunning=0,workersList=[],isProcessing=!1,q={_tasks:new _DoublyLinkedList2.default,concurrency:concurrency,payload:payload,saturated:_noop2.default,unsaturated:_noop2.default,buffer:concurrency/4,empty:_noop2.default,drain:_noop2.default,error:_noop2.default,started:!1,paused:!1,push:function(data,callback){_insert(data,!1,callback)},kill:function(){q.drain=_noop2.default,q._tasks.empty()},unshift:function(data,callback){_insert(data,!0,callback)},remove:function(testFn){q._tasks.remove(testFn)},process:function(){if(!isProcessing){for(isProcessing=!0;!q.paused&&numRunning0&&opts.jitter<=1?opts.jitter:0,this.attempts=0}module.exports=Backoff,Backoff.prototype.duration=function(){var ms=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var rand=Math.random(),deviation=Math.floor(rand*this.jitter*ms);ms=0==(1&Math.floor(10*rand))?ms-deviation:ms+deviation}return 0|Math.min(ms,this.max)},Backoff.prototype.reset=function(){this.attempts=0},Backoff.prototype.setMin=function(min){this.ms=min},Backoff.prototype.setMax=function(max){this.max=max},Backoff.prototype.setJitter=function(jitter){this.jitter=jitter}},function(module,exports,__webpack_require__){(function(Buffer){module.exports=function(ALPHABET){function encode(source){if(0===source.length)return"";for(var digits=[0],i=0;i0;)digits.push(carry%BASE),carry=carry/BASE|0}for(var string="",k=0;0===source[k]&&k=0;--q)string+=ALPHABET[digits[q]];return string}function decodeUnsafe(string){if(0===string.length)return Buffer.allocUnsafe(0);for(var bytes=[0],i=0;i>=8;for(;carry>0;)bytes.push(255&carry),carry>>=8}for(var k=0;string[k]===LEADER&&k>2],base64+=chars[(3&bytes[i])<<4|bytes[i+1]>>4],base64+=chars[(15&bytes[i+1])<<2|bytes[i+2]>>6],base64+=chars[63&bytes[i+2]];return len%3==2?base64=base64.substring(0,base64.length-1)+"=":len%3==1&&(base64=base64.substring(0,base64.length-2)+"=="),base64},exports.decode=function(base64){var i,encoded1,encoded2,encoded3,encoded4,bufferLength=.75*base64.length,len=base64.length,p=0;"="===base64[base64.length-1]&&(bufferLength--,"="===base64[base64.length-2]&&bufferLength--);var arraybuffer=new ArrayBuffer(bufferLength),bytes=new Uint8Array(arraybuffer);for(i=0;i>4,bytes[p++]=(15&encoded2)<<4|encoded3>>2,bytes[p++]=(3&encoded3)<<6|63&encoded4;return arraybuffer}}()},function(module,exports,__webpack_require__){"use strict";function placeHoldersCount(b64){var len=b64.length;if(len%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===b64[len-2]?2:"="===b64[len-1]?1:0}function byteLength(b64){return 3*b64.length/4-placeHoldersCount(b64)}function toByteArray(b64){var i,j,l,tmp,placeHolders,arr,len=b64.length;placeHolders=placeHoldersCount(b64),arr=new Arr(3*len/4-placeHolders),l=placeHolders>0?len-4:len;var L=0;for(i=0,j=0;i>16&255,arr[L++]=tmp>>8&255,arr[L++]=255&tmp;return 2===placeHolders?(tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4,arr[L++]=255&tmp):1===placeHolders&&(tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2,arr[L++]=tmp>>8&255,arr[L++]=255&tmp),arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[63&num]}function encodeChunk(uint8,start,end){for(var tmp,output=[],i=start;ilen2?len2:i+16383));return 1===extraBytes?(tmp=uint8[len-1],output+=lookup[tmp>>2],output+=lookup[tmp<<4&63],output+="=="):2===extraBytes&&(tmp=(uint8[len-2]<<8)+uint8[len-1],output+=lookup[tmp>>10],output+=lookup[tmp>>4&63],output+=lookup[tmp<<2&63],output+="="),parts.push(output),parts.join("")}exports.byteLength=byteLength,exports.toByteArray=toByteArray,exports.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i72)return!1;if(48!==buffer[0])return!1;if(buffer[1]!==buffer.length-2)return!1;if(2!==buffer[2])return!1;var lenR=buffer[3];if(0===lenR)return!1;if(5+lenR>=buffer.length)return!1;if(2!==buffer[4+lenR])return!1;var lenS=buffer[5+lenR];return 0!==lenS&&(6+lenR+lenS===buffer.length&&(!(128&buffer[4])&&(!(lenR>1&&0===buffer[4]&&!(128&buffer[5]))&&(!(128&buffer[lenR+6])&&!(lenS>1&&0===buffer[lenR+6]&&!(128&buffer[lenR+7]))))))}function decode(buffer){if(buffer.length<8)throw new Error("DER sequence length is too short");if(buffer.length>72)throw new Error("DER sequence length is too long");if(48!==buffer[0])throw new Error("Expected DER sequence");if(buffer[1]!==buffer.length-2)throw new Error("DER sequence length is invalid");if(2!==buffer[2])throw new Error("Expected DER integer");var lenR=buffer[3];if(0===lenR)throw new Error("R length is zero");if(5+lenR>=buffer.length)throw new Error("R length is too long");if(2!==buffer[4+lenR])throw new Error("Expected DER integer (2)");var lenS=buffer[5+lenR];if(0===lenS)throw new Error("S length is zero");if(6+lenR+lenS!==buffer.length)throw new Error("S length is invalid");if(128&buffer[4])throw new Error("R value is negative");if(lenR>1&&0===buffer[4]&&!(128&buffer[5]))throw new Error("R value excessively padded");if(128&buffer[lenR+6])throw new Error("S value is negative");if(lenS>1&&0===buffer[lenR+6]&&!(128&buffer[lenR+7]))throw new Error("S value excessively padded");return{r:buffer.slice(4,4+lenR),s:buffer.slice(6+lenR)}}function encode(r,s){var lenR=r.length,lenS=s.length;if(0===lenR)throw new Error("R length is zero");if(0===lenS)throw new Error("S length is zero");if(lenR>33)throw new Error("R length is too long");if(lenS>33)throw new Error("S length is too long");if(128&r[0])throw new Error("R value is negative");if(128&s[0])throw new Error("S value is negative");if(lenR>1&&0===r[0]&&!(128&r[1]))throw new Error("R value excessively padded");if(lenS>1&&0===s[0]&&!(128&s[1]))throw new Error("S value excessively padded");var signature=Buffer.allocUnsafe(6+lenR+lenS);return signature[0]=48,signature[1]=signature.length-2,signature[2]=2,signature[3]=r.length,r.copy(signature,4),signature[4+lenR]=2,signature[5+lenR]=s.length,s.copy(signature,6+lenR),signature}var Buffer=__webpack_require__(13).Buffer;module.exports={check:check,decode:decode,encode:encode}},function(module,exports,__webpack_require__){function ADD64AA(v,a,b){var o0=v[a]+v[b],o1=v[a+1]+v[b+1];o0>=4294967296&&o1++,v[a]=o0,v[a+1]=o1}function ADD64AC(v,a,b0,b1){var o0=v[a]+b0;b0<0&&(o0+=4294967296);var o1=v[a+1]+b1;o0>=4294967296&&o1++,v[a]=o0,v[a+1]=o1}function B2B_GET32(arr,i){return arr[i]^arr[i+1]<<8^arr[i+2]<<16^arr[i+3]<<24}function B2B_G(a,b,c,d,ix,iy){var x0=m[ix],x1=m[ix+1],y0=m[iy],y1=m[iy+1];ADD64AA(v,a,b),ADD64AC(v,a,x0,x1);var xor0=v[d]^v[a],xor1=v[d+1]^v[a+1];v[d]=xor1,v[d+1]=xor0,ADD64AA(v,c,d),xor0=v[b]^v[c],xor1=v[b+1]^v[c+1],v[b]=xor0>>>24^xor1<<8,v[b+1]=xor1>>>24^xor0<<8,ADD64AA(v,a,b),ADD64AC(v,a,y0,y1),xor0=v[d]^v[a],xor1=v[d+1]^v[a+1],v[d]=xor0>>>16^xor1<<16,v[d+1]=xor1>>>16^xor0<<16,ADD64AA(v,c,d),xor0=v[b]^v[c],xor1=v[b+1]^v[c+1],v[b]=xor1>>>31^xor0<<1,v[b+1]=xor0>>>31^xor1<<1}function blake2bCompress(ctx,last){var i=0;for(i=0;i<16;i++)v[i]=ctx.h[i],v[i+16]=BLAKE2B_IV32[i];for(v[24]=v[24]^ctx.t,v[25]=v[25]^ctx.t/4294967296,last&&(v[28]=~v[28],v[29]=~v[29]),i=0;i<32;i++)m[i]=B2B_GET32(ctx.b,4*i);for(i=0;i<12;i++)B2B_G(0,8,16,24,SIGMA82[16*i+0],SIGMA82[16*i+1]),B2B_G(2,10,18,26,SIGMA82[16*i+2],SIGMA82[16*i+3]),B2B_G(4,12,20,28,SIGMA82[16*i+4],SIGMA82[16*i+5]),B2B_G(6,14,22,30,SIGMA82[16*i+6],SIGMA82[16*i+7]),B2B_G(0,10,20,30,SIGMA82[16*i+8],SIGMA82[16*i+9]),B2B_G(2,12,22,24,SIGMA82[16*i+10],SIGMA82[16*i+11]),B2B_G(4,14,16,26,SIGMA82[16*i+12],SIGMA82[16*i+13]),B2B_G(6,8,18,28,SIGMA82[16*i+14],SIGMA82[16*i+15]);for(i=0;i<16;i++)ctx.h[i]=ctx.h[i]^v[i]^v[i+16]}function blake2bInit(outlen,key){if(0===outlen||outlen>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(key&&key.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");for(var ctx={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:outlen},i=0;i<16;i++)ctx.h[i]=BLAKE2B_IV32[i];var keylen=key?key.length:0;return ctx.h[0]^=16842752^keylen<<8^outlen,key&&(blake2bUpdate(ctx,key),ctx.c=128),ctx}function blake2bUpdate(ctx,input){for(var i=0;i>2]>>8*(3&i);return out}function blake2b(input,key,outlen){outlen=outlen||64,input=util.normalizeInput(input);var ctx=blake2bInit(outlen,key);return blake2bUpdate(ctx,input),blake2bFinal(ctx)}function blake2bHex(input,key,outlen){var output=blake2b(input,key,outlen);return util.toHex(output)}var util=__webpack_require__(183),BLAKE2B_IV32=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),SIGMA8=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],SIGMA82=new Uint8Array(SIGMA8.map(function(x){return 2*x})),v=new Uint32Array(32),m=new Uint32Array(32);module.exports={blake2b:blake2b,blake2bHex:blake2bHex,blake2bInit:blake2bInit,blake2bUpdate:blake2bUpdate,blake2bFinal:blake2bFinal}},function(module,exports,__webpack_require__){function B2S_GET32(v,i){return v[i]^v[i+1]<<8^v[i+2]<<16^v[i+3]<<24}function B2S_G(a,b,c,d,x,y){v[a]=v[a]+v[b]+x,v[d]=ROTR32(v[d]^v[a],16),v[c]=v[c]+v[d],v[b]=ROTR32(v[b]^v[c],12),v[a]=v[a]+v[b]+y,v[d]=ROTR32(v[d]^v[a],8),v[c]=v[c]+v[d],v[b]=ROTR32(v[b]^v[c],7)}function ROTR32(x,y){return x>>>y^x<<32-y}function blake2sCompress(ctx,last){var i=0;for(i=0;i<8;i++)v[i]=ctx.h[i],v[i+8]=BLAKE2S_IV[i];for(v[12]^=ctx.t,v[13]^=ctx.t/4294967296,last&&(v[14]=~v[14]),i=0;i<16;i++)m[i]=B2S_GET32(ctx.b,4*i);for(i=0;i<10;i++)B2S_G(0,4,8,12,m[SIGMA[16*i+0]],m[SIGMA[16*i+1]]),B2S_G(1,5,9,13,m[SIGMA[16*i+2]],m[SIGMA[16*i+3]]),B2S_G(2,6,10,14,m[SIGMA[16*i+4]],m[SIGMA[16*i+5]]),B2S_G(3,7,11,15,m[SIGMA[16*i+6]],m[SIGMA[16*i+7]]),B2S_G(0,5,10,15,m[SIGMA[16*i+8]],m[SIGMA[16*i+9]]),B2S_G(1,6,11,12,m[SIGMA[16*i+10]],m[SIGMA[16*i+11]]),B2S_G(2,7,8,13,m[SIGMA[16*i+12]],m[SIGMA[16*i+13]]),B2S_G(3,4,9,14,m[SIGMA[16*i+14]],m[SIGMA[16*i+15]]);for(i=0;i<8;i++)ctx.h[i]^=v[i]^v[i+8]}function blake2sInit(outlen,key){if(!(outlen>0&&outlen<=32))throw new Error("Incorrect output length, should be in [1, 32]");var keylen=key?key.length:0;if(key&&!(keylen>0&&keylen<=32))throw new Error("Incorrect key length, should be in [1, 32]");var ctx={h:new Uint32Array(BLAKE2S_IV),b:new Uint32Array(64),c:0,t:0,outlen:outlen};return ctx.h[0]^=16842752^keylen<<8^outlen,keylen>0&&(blake2sUpdate(ctx,key),ctx.c=64),ctx}function blake2sUpdate(ctx,input){for(var i=0;i>2]>>8*(3&i)&255;return out}function blake2s(input,key,outlen){outlen=outlen||32,input=util.normalizeInput(input);var ctx=blake2sInit(outlen,key);return blake2sUpdate(ctx,input),blake2sFinal(ctx)}function blake2sHex(input,key,outlen){var output=blake2s(input,key,outlen);return util.toHex(output)}var util=__webpack_require__(183),BLAKE2S_IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SIGMA=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),v=new Uint32Array(16),m=new Uint32Array(16);module.exports={blake2s:blake2s,blake2sHex:blake2sHex,blake2sInit:blake2sInit,blake2sUpdate:blake2sUpdate,blake2sFinal:blake2sFinal}},function(module,exports,__webpack_require__){var b2b=__webpack_require__(364),b2s=__webpack_require__(365);module.exports={blake2b:b2b.blake2b,blake2bHex:b2b.blake2bHex,blake2bInit:b2b.blake2bInit,blake2bUpdate:b2b.blake2bUpdate,blake2bFinal:b2b.blake2bFinal,blake2s:b2s.blake2s,blake2sHex:b2s.blake2sHex,blake2sInit:b2s.blake2sInit,blake2sUpdate:b2s.blake2sUpdate,blake2sFinal:b2s.blake2sFinal}},function(module,exports,__webpack_require__){(function(global){function mapArrayBufferViews(ary){for(var i=0;i0){break}}return code|0}function checkOffset(n){n=n|0;if(((offset|0)+(n|0)|0)<(inputLength|0)){return 0}return 1}function readUInt16(n){n=n|0;return heap[n|0]<<8|heap[n+1|0]|0}function INT_P(octet){octet=octet|0;pushInt(octet|0);offset=offset+1|0;return 0}function UINT_P_8(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushInt(heap[offset+1|0]|0);offset=offset+2|0;return 0}function UINT_P_16(octet){octet=octet|0;if(checkOffset(2)|0){return 1}pushInt(readUInt16(offset+1|0)|0);offset=offset+3|0;return 0}function UINT_P_32(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushInt32(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function UINT_P_64(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushInt64(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function INT_N(octet){octet=octet|0;pushInt(-1-(octet-32|0)|0);offset=offset+1|0;return 0}function UINT_N_8(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushInt(-1-(heap[offset+1|0]|0)|0);offset=offset+2|0;return 0}function UINT_N_16(octet){octet=octet|0;var val=0;if(checkOffset(2)|0){return 1}val=readUInt16(offset+1|0)|0;pushInt(-1-(val|0)|0);offset=offset+3|0;return 0}function UINT_N_32(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushInt32Neg(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function UINT_N_64(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushInt64Neg(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function BYTE_STRING(octet){octet=octet|0;var start=0;var end=0;var step=0;step=octet-64|0;if(checkOffset(step|0)|0){return 1}start=offset+1|0;end=(offset+1|0)+(step|0)|0;pushByteString(start|0,end|0);offset=end|0;return 0}function BYTE_STRING_8(octet){octet=octet|0;var start=0;var end=0;var length=0;if(checkOffset(1)|0){return 1}length=heap[offset+1|0]|0;start=offset+2|0;end=(offset+2|0)+(length|0)|0;if(checkOffset(length+1|0)|0){return 1}pushByteString(start|0,end|0);offset=end|0;return 0}function BYTE_STRING_16(octet){octet=octet|0;var start=0;var end=0;var length=0;if(checkOffset(2)|0){return 1}length=readUInt16(offset+1|0)|0;start=offset+3|0;end=(offset+3|0)+(length|0)|0;if(checkOffset(length+2|0)|0){return 1}pushByteString(start|0,end|0);offset=end|0;return 0}function BYTE_STRING_32(octet){octet=octet|0;return 1}function BYTE_STRING_64(octet){octet=octet|0;return 1}function BYTE_STRING_BREAK(octet){octet=octet|0;pushByteStringStart();offset=offset+1|0;return 0}function UTF8_STRING(octet){octet=octet|0;var start=0;var end=0;var step=0;step=octet-96|0;if(checkOffset(step|0)|0){return 1}start=offset+1|0;end=(offset+1|0)+(step|0)|0;pushUtf8String(start|0,end|0);offset=end|0;return 0}function UTF8_STRING_8(octet){octet=octet|0;var start=0;var end=0;var length=0;if(checkOffset(1)|0){return 1}length=heap[offset+1|0]|0;start=offset+2|0;end=(offset+2|0)+(length|0)|0;if(checkOffset(length+1|0)|0){return 1}pushUtf8String(start|0,end|0);offset=end|0;return 0}function UTF8_STRING_16(octet){octet=octet|0;var start=0;var end=0;var length=0;if(checkOffset(2)|0){return 1}length=readUInt16(offset+1|0)|0;start=offset+3|0;end=(offset+3|0)+(length|0)|0;if(checkOffset(length+2|0)|0){return 1}pushUtf8String(start|0,end|0);offset=end|0;return 0}function UTF8_STRING_32(octet){octet=octet|0;return 1}function UTF8_STRING_64(octet){octet=octet|0;return 1}function UTF8_STRING_BREAK(octet){octet=octet|0;pushUtf8StringStart();offset=offset+1|0;return 0}function ARRAY(octet){octet=octet|0;pushArrayStartFixed(octet-128|0);offset=offset+1|0;return 0}function ARRAY_8(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushArrayStartFixed(heap[offset+1|0]|0);offset=offset+2|0;return 0}function ARRAY_16(octet){octet=octet|0;if(checkOffset(2)|0){return 1}pushArrayStartFixed(readUInt16(offset+1|0)|0);offset=offset+3|0;return 1}function ARRAY_32(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushArrayStartFixed32(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function ARRAY_64(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushArrayStartFixed64(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function ARRAY_BREAK(octet){octet=octet|0;pushArrayStart();offset=offset+1|0;return 0}function MAP(octet){octet=octet|0;var step=0;step=octet-160|0;if(checkOffset(step|0)|0){return 1}pushObjectStartFixed(step|0);offset=offset+1|0;return 0}function MAP_8(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushObjectStartFixed(heap[offset+1|0]|0);offset=offset+2|0;return 0}function MAP_16(octet){octet=octet|0;if(checkOffset(2)|0){return 1}pushObjectStartFixed(readUInt16(offset+1|0)|0);offset=offset+3|0;return 0}function MAP_32(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushObjectStartFixed32(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function MAP_64(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushObjectStartFixed64(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function MAP_BREAK(octet){octet=octet|0;pushObjectStart();offset=offset+1|0;return 0}function TAG_KNOWN(octet){octet=octet|0;pushTagStart(octet-192|0|0);offset=offset+1|0;return 0}function TAG_BIGNUM_POS(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_BIGNUM_NEG(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_FRAC(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_BIGNUM_FLOAT(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_UNASSIGNED(octet){octet=octet|0;pushTagStart(octet-192|0|0);offset=offset+1|0;return 0}function TAG_BASE64_URL(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_BASE64(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_BASE16(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_MORE_1(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushTagStart(heap[offset+1|0]|0);offset=offset+2|0;return 0}function TAG_MORE_2(octet){octet=octet|0;if(checkOffset(2)|0){return 1}pushTagStart(readUInt16(offset+1|0)|0);offset=offset+3|0;return 0}function TAG_MORE_4(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushTagStart4(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function TAG_MORE_8(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushTagStart8(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function SIMPLE_UNASSIGNED(octet){octet=octet|0;pushSimpleUnassigned((octet|0)-224|0);offset=offset+1|0;return 0}function SIMPLE_FALSE(octet){octet=octet|0;pushFalse();offset=offset+1|0;return 0}function SIMPLE_TRUE(octet){octet=octet|0;pushTrue();offset=offset+1|0;return 0}function SIMPLE_NULL(octet){octet=octet|0;pushNull();offset=offset+1|0;return 0}function SIMPLE_UNDEFINED(octet){octet=octet|0;pushUndefined();offset=offset+1|0;return 0}function SIMPLE_BYTE(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushSimpleUnassigned(heap[offset+1|0]|0);offset=offset+2|0;return 0}function SIMPLE_FLOAT_HALF(octet){octet=octet|0;var f=0;var g=0;var sign=1;var exp=0;var mant=0;var r=0;if(checkOffset(2)|0){return 1}f=heap[offset+1|0]|0;g=heap[offset+2|0]|0;if((f|0)&128){sign=-1}exp=+(((f|0)&124)>>2);mant=+(((f|0)&3)<<8|g);if(+exp==0){pushFloat(+(+sign*+5.960464477539063e-8*+mant))}else if(+exp==31){if(+sign==1){if(+mant>0){pushNaN()}else{pushInfinity()}}else{if(+mant>0){pushNaNNeg()}else{pushInfinityNeg()}}}else{pushFloat(+(+sign*pow(+2,+(+exp-25))*+(1024+mant)))}offset=offset+3|0;return 0}function SIMPLE_FLOAT_SINGLE(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushFloatSingle(heap[offset+1|0]|0,heap[offset+2|0]|0,heap[offset+3|0]|0,heap[offset+4|0]|0);offset=offset+5|0;return 0}function SIMPLE_FLOAT_DOUBLE(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushFloatDouble(heap[offset+1|0]|0,heap[offset+2|0]|0,heap[offset+3|0]|0,heap[offset+4|0]|0,heap[offset+5|0]|0,heap[offset+6|0]|0,heap[offset+7|0]|0,heap[offset+8|0]|0);offset=offset+9|0;return 0}function ERROR(octet){octet=octet|0;return 1}function BREAK(octet){octet=octet|0;pushBreak();offset=offset+1|0;return 0}var jumpTable=[INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,UINT_P_8,UINT_P_16,UINT_P_32,UINT_P_64,ERROR,ERROR,ERROR,ERROR,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,UINT_N_8,UINT_N_16,UINT_N_32,UINT_N_64,ERROR,ERROR,ERROR,ERROR,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING_8,BYTE_STRING_16,BYTE_STRING_32,BYTE_STRING_64,ERROR,ERROR,ERROR,BYTE_STRING_BREAK,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING_8,UTF8_STRING_16,UTF8_STRING_32,UTF8_STRING_64,ERROR,ERROR,ERROR,UTF8_STRING_BREAK,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY_8,ARRAY_16,ARRAY_32,ARRAY_64,ERROR,ERROR,ERROR,ARRAY_BREAK,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP_8,MAP_16,MAP_32,MAP_64,ERROR,ERROR,ERROR,MAP_BREAK,TAG_KNOWN,TAG_KNOWN,TAG_KNOWN,TAG_KNOWN,TAG_KNOWN,TAG_KNOWN,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_MORE_1,TAG_MORE_2,TAG_MORE_4,TAG_MORE_8,ERROR,ERROR,ERROR,ERROR,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_FALSE,SIMPLE_TRUE,SIMPLE_NULL,SIMPLE_UNDEFINED,SIMPLE_BYTE,SIMPLE_FLOAT_HALF,SIMPLE_FLOAT_SINGLE,SIMPLE_FLOAT_DOUBLE,ERROR,ERROR,ERROR,BREAK];return{parse:parse}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function collectObject(val){return(acc,key)=>{return acc?`${acc}, ${key}: ${val[key]}`:`${key}: ${val[key]}`}}const Decoder=__webpack_require__(184),utils=__webpack_require__(127);class Diagnose extends Decoder{createTag(tagNumber,value){return`${tagNumber}(${value})`}createInt(val){return super.createInt(val).toString()}createInt32(f,g){return super.createInt32(f,g).toString()}createInt64(f1,f2,g1,g2){return super.createInt64(f1,f2,g1,g2).toString()}createInt32Neg(f,g){return super.createInt32Neg(f,g).toString()}createInt64Neg(f1,f2,g1,g2){return super.createInt64Neg(f1,f2,g1,g2).toString()}createTrue(){return"true"}createFalse(){return"false"}createFloat(val){const fl=super.createFloat(val);return utils.isNegativeZero(val)?"-0_1":`${fl}_1`}createFloatSingle(a,b,c,d){return`${super.createFloatSingle(a,b,c,d)}_2`}createFloatDouble(a,b,c,d,e,f,g,h){return`${super.createFloatDouble(a,b,c,d,e,f,g,h)}_3`}createByteString(raw,len){const val=raw.join(", ");return len===-1?`(_ ${val})`:`h'${val}`}createByteStringFromHeap(start,end){return`h'${new Buffer(super.createByteStringFromHeap(start,end)).toString("hex")}'`}createInfinity(){return"Infinity_1"}createInfinityNeg(){return"-Infinity_1"}createNaN(){return"NaN_1"}createNaNNeg(){return"-NaN_1"}createNull(){return"null"}createUndefined(){return"undefined"}createSimpleUnassigned(val){return`simple(${val})`}createArray(arr,len){const val=super.createArray(arr,len);return len===-1?`[_ ${val.join(", ")}]`:`[${val.join(", ")}]`}createMap(map,len){const val=super.createMap(map),list=Array.from(val.keys()).reduce(collectObject(val),"");return len===-1?`{_ ${list}}`:`{${list}}`}createObject(obj,len){const val=super.createObject(obj),map=Object.keys(val).reduce(collectObject(val),"");return len===-1?`{_ ${map}}`:`{${map}}`}createUtf8String(raw,len){const val=raw.join(", ");return len===-1?`(_ ${val})`:`"${val}"`}createUtf8StringFromHeap(start,end){return`"${new Buffer(super.createUtf8StringFromHeap(start,end)).toString("utf8")}"`}static diagnose(input,enc){return"string"==typeof input&&(input=new Buffer(input,enc||"hex")),(new Diagnose).decodeFirst(input)}}module.exports=Diagnose}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function toType(obj){return{}.toString.call(obj).slice(8,-1)}const url=__webpack_require__(167),Bignumber=__webpack_require__(91),utils=__webpack_require__(127),constants=__webpack_require__(92),MT=constants.MT,NUMBYTES=constants.NUMBYTES,SHIFT32=constants.SHIFT32,SYMS=constants.SYMS,TAG=constants.TAG,HALF=constants.MT.SIMPLE_FLOAT<<5|constants.NUMBYTES.TWO,FLOAT=constants.MT.SIMPLE_FLOAT<<5|constants.NUMBYTES.FOUR,DOUBLE=constants.MT.SIMPLE_FLOAT<<5|constants.NUMBYTES.EIGHT,TRUE=constants.MT.SIMPLE_FLOAT<<5|constants.SIMPLE.TRUE,FALSE=constants.MT.SIMPLE_FLOAT<<5|constants.SIMPLE.FALSE,UNDEFINED=constants.MT.SIMPLE_FLOAT<<5|constants.SIMPLE.UNDEFINED,NULL=constants.MT.SIMPLE_FLOAT<<5|constants.SIMPLE.NULL,MAXINT_BN=new Bignumber("0x20000000000000"),BUF_NAN=new Buffer("f97e00","hex"),BUF_INF_NEG=new Buffer("f9fc00","hex"),BUF_INF_POS=new Buffer("f97c00","hex");class Encoder{constructor(options){options=options||{},this.streaming="function"==typeof options.stream,this.onData=options.stream,this.semanticTypes=[[url.Url,this._pushUrl],[Bignumber,this._pushBigNumber]];const addTypes=options.genTypes||[],len=addTypes.length;for(let i=0;i[k,obj[k]]))}_pushRawMap(len,map){map=map.map(function(a){return a[0]=Encoder.encode(a[0]),a}).sort(utils.keySorter);for(var j=0;j16)return out=this.cache.slice(0,16),this.cache=this.cache.slice(16),out}else if(this.cache.length>=16)return out=this.cache.slice(0,16),this.cache=this.cache.slice(16),out;return null},Splitter.prototype.flush=function(){if(this.cache.length)return this.cache};var modelist={ECB:__webpack_require__(192),CBC:__webpack_require__(188),CFB:__webpack_require__(189),CFB8:__webpack_require__(191),CFB1:__webpack_require__(190),OFB:__webpack_require__(193),CTR:__webpack_require__(94),GCM:__webpack_require__(94)};exports.createDecipher=createDecipher,exports.createDecipheriv=createDecipheriv}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Cipher(mode,key,iv){if(!(this instanceof Cipher))return new Cipher(mode,key,iv);Transform.call(this),this._cache=new Splitter,this._cipher=new aes.AES(key),this._prev=new Buffer(iv.length),iv.copy(this._prev),this._mode=mode,this._autopadding=!0}function Splitter(){if(!(this instanceof Splitter))return new Splitter;this.cache=new Buffer("")}function createCipheriv(suite,password,iv){var config=modes[suite.toLowerCase()];if(!config)throw new TypeError("invalid suite type");if("string"==typeof iv&&(iv=new Buffer(iv)),"string"==typeof password&&(password=new Buffer(password)),password.length!==config.key/8)throw new TypeError("invalid key length "+password.length);if(iv.length!==config.iv)throw new TypeError("invalid iv length "+iv.length);return"stream"===config.type?new StreamCipher(modelist[config.mode],password,iv):"auth"===config.type?new AuthCipher(modelist[config.mode],password,iv):new Cipher(modelist[config.mode],password,iv)}function createCipher(suite,password){var config=modes[suite.toLowerCase()];if(!config)throw new TypeError("invalid suite type");var keys=ebtk(password,!1,config.key,config.iv);return createCipheriv(suite,keys.key,keys.iv)}var aes=__webpack_require__(93),Transform=__webpack_require__(47),inherits=__webpack_require__(1),modes=__webpack_require__(128),ebtk=__webpack_require__(211),StreamCipher=__webpack_require__(194),AuthCipher=__webpack_require__(187);inherits(Cipher,Transform),Cipher.prototype._update=function(data){this._cache.add(data);for(var chunk,thing,out=[];chunk=this._cache.get();)thing=this._mode.encrypt(this,chunk),out.push(thing);return Buffer.concat(out)},Cipher.prototype._final=function(){var chunk=this._cache.flush();if(this._autopadding)return chunk=this._mode.encrypt(this,chunk),this._cipher.scrub(),chunk;if("10101010101010101010101010101010"!==chunk.toString("hex"))throw this._cipher.scrub(),new Error("data not multiple of block length")},Cipher.prototype.setAutoPadding=function(setTo){return this._autopadding=!!setTo,this},Splitter.prototype.add=function(data){this.cache=Buffer.concat([this.cache,data])},Splitter.prototype.get=function(){if(this.cache.length>15){var out=this.cache.slice(0,16);return this.cache=this.cache.slice(16),out}return null},Splitter.prototype.flush=function(){for(var len=16-this.cache.length,padBuff=new Buffer(len),i=-1;++iuint_max||x<0?(x_pos=Math.abs(x)%uint_max,x<0?uint_max-x_pos:x_pos):x}function xor(a,b){return[a[0]^b[0],a[1]^b[1],a[2]^b[2],a[3]^b[3]]}var zeros=new Buffer(16);zeros.fill(0),module.exports=GHASH,GHASH.prototype.ghash=function(block){for(var i=-1;++i0;j--)Vi[j]=Vi[j]>>>1|(1&Vi[j-1])<<31;Vi[0]=Vi[0]>>>1,lsb_Vi&&(Vi[0]=Vi[0]^225<<24)}this.state=fromArray(Zi)},GHASH.prototype.update=function(buf){this.cache=Buffer.concat([this.cache,buf]);for(var chunk;this.cache.length>=16;)chunk=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(chunk)},GHASH.prototype.final=function(abl,bl){return this.cache.length&&this.ghash(Buffer.concat([this.cache,zeros],16)),this.ghash(fromArray([0,abl,0,bl])),this.state};var uint_max=Math.pow(2,32)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){const Sha3=__webpack_require__(378),hashLengths=[224,256,384,512];var hash=function(bitcount){if(void 0!==bitcount&&hashLengths.indexOf(bitcount)==-1)throw new Error("Unsupported hash length");this.content=[],this.bitcount=bitcount?"keccak_"+bitcount:"keccak_512"};hash.prototype.update=function(i){if(Buffer.isBuffer(i))this.content.push(i);else{if("string"!=typeof i)throw new Error("Unsupported argument to update");this.content.push(new Buffer(i))}return this},hash.prototype.digest=function(encoding){var result=Sha3[this.bitcount](Buffer.concat(this.content));if("hex"===encoding)return result;if("binary"===encoding||void 0===encoding)return new Buffer(result,"hex").toString("binary");throw new Error("Unsupported encoding for digest: "+encoding)},module.exports={SHA3Hash:hash}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(global){!function(root,undefined){"use strict";var NODE_JS=void 0!==module;NODE_JS&&(root=global,root.JS_SHA3_TEST&&(root.navigator={userAgent:"Chrome"}));var CHROME=(root.JS_SHA3_TEST||!NODE_JS)&&navigator.userAgent.indexOf("Chrome")!=-1,HEX_CHARS="0123456789abcdef".split(""),KECCAK_PADDING=[1,256,65536,16777216],PADDING=[6,1536,393216,100663296],SHIFT=[0,8,16,24],RC=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],blocks=[],s=[],keccak_224=function(message){return keccak(message,224,KECCAK_PADDING)},keccak_256=function(message){return keccak(message,256,KECCAK_PADDING)},keccak_384=function(message){return keccak(message,384,KECCAK_PADDING)},sha3_224=function(message){return keccak(message,224,PADDING)},sha3_256=function(message){return keccak(message,256,PADDING)},sha3_384=function(message){return keccak(message,384,PADDING)},sha3_512=function(message){return keccak(message,512,PADDING)},keccak=function(message,bits,padding){var notString="string"!=typeof message;notString&&message.constructor==root.ArrayBuffer&&(message=new Uint8Array(message)),void 0===bits&&(bits=512,padding=KECCAK_PADDING);var block,code,n,i,h,l,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49,end=!1,index=0,start=0,length=message.length,blockCount=(1600-2*bits)/32,byteCount=4*blockCount;for(i=0;i<50;++i)s[i]=0;block=0;do{for(blocks[0]=block,i=1;i>2]|=message[index]<>2]|=code<>2]|=(192|code>>6)<>2]|=(128|63&code)<=57344?(blocks[i>>2]|=(224|code>>12)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<>2]|=(240|code>>18)<>2]|=(128|code>>12&63)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<>2]|=padding[3&i],++index),block=blocks[blockCount],index>length&&i>>31),l=c9^(c3<<1|c2>>>31),s[0]^=h,s[1]^=l,s[10]^=h,s[11]^=l,s[20]^=h,s[21]^=l,s[30]^=h,s[31]^=l,s[40]^=h,s[41]^=l,h=c0^(c4<<1|c5>>>31),l=c1^(c5<<1|c4>>>31),s[2]^=h,s[3]^=l,s[12]^=h,s[13]^=l,s[22]^=h,s[23]^=l,s[32]^=h,s[33]^=l,s[42]^=h,s[43]^=l,h=c2^(c6<<1|c7>>>31),l=c3^(c7<<1|c6>>>31),s[4]^=h,s[5]^=l,s[14]^=h,s[15]^=l,s[24]^=h,s[25]^=l,s[34]^=h,s[35]^=l,s[44]^=h,s[45]^=l,h=c4^(c8<<1|c9>>>31),l=c5^(c9<<1|c8>>>31),s[6]^=h,s[7]^=l,s[16]^=h,s[17]^=l,s[26]^=h,s[27]^=l,s[36]^=h,s[37]^=l,s[46]^=h,s[47]^=l,h=c6^(c0<<1|c1>>>31),l=c7^(c1<<1|c0>>>31),s[8]^=h,s[9]^=l,s[18]^=h,s[19]^=l,s[28]^=h,s[29]^=l,s[38]^=h,s[39]^=l,s[48]^=h,s[49]^=l,b0=s[0],b1=s[1],b32=s[11]<<4|s[10]>>>28,b33=s[10]<<4|s[11]>>>28,b14=s[20]<<3|s[21]>>>29,b15=s[21]<<3|s[20]>>>29,b46=s[31]<<9|s[30]>>>23,b47=s[30]<<9|s[31]>>>23,b28=s[40]<<18|s[41]>>>14,b29=s[41]<<18|s[40]>>>14,b20=s[2]<<1|s[3]>>>31,b21=s[3]<<1|s[2]>>>31,b2=s[13]<<12|s[12]>>>20,b3=s[12]<<12|s[13]>>>20,b34=s[22]<<10|s[23]>>>22,b35=s[23]<<10|s[22]>>>22,b16=s[33]<<13|s[32]>>>19,b17=s[32]<<13|s[33]>>>19,b48=s[42]<<2|s[43]>>>30,b49=s[43]<<2|s[42]>>>30,b40=s[5]<<30|s[4]>>>2,b41=s[4]<<30|s[5]>>>2,b22=s[14]<<6|s[15]>>>26,b23=s[15]<<6|s[14]>>>26,b4=s[25]<<11|s[24]>>>21,b5=s[24]<<11|s[25]>>>21,b36=s[34]<<15|s[35]>>>17,b37=s[35]<<15|s[34]>>>17,b18=s[45]<<29|s[44]>>>3,b19=s[44]<<29|s[45]>>>3,b10=s[6]<<28|s[7]>>>4,b11=s[7]<<28|s[6]>>>4,b42=s[17]<<23|s[16]>>>9,b43=s[16]<<23|s[17]>>>9,b24=s[26]<<25|s[27]>>>7,b25=s[27]<<25|s[26]>>>7,b6=s[36]<<21|s[37]>>>11,b7=s[37]<<21|s[36]>>>11,b38=s[47]<<24|s[46]>>>8,b39=s[46]<<24|s[47]>>>8,b30=s[8]<<27|s[9]>>>5,b31=s[9]<<27|s[8]>>>5,b12=s[18]<<20|s[19]>>>12,b13=s[19]<<20|s[18]>>>12,b44=s[29]<<7|s[28]>>>25,b45=s[28]<<7|s[29]>>>25,b26=s[38]<<8|s[39]>>>24,b27=s[39]<<8|s[38]>>>24,b8=s[48]<<14|s[49]>>>18,b9=s[49]<<14|s[48]>>>18,s[0]=b0^~b2&b4,s[1]=b1^~b3&b5,s[10]=b10^~b12&b14,s[11]=b11^~b13&b15,s[20]=b20^~b22&b24,s[21]=b21^~b23&b25,s[30]=b30^~b32&b34,s[31]=b31^~b33&b35,s[40]=b40^~b42&b44,s[41]=b41^~b43&b45,s[2]=b2^~b4&b6,s[3]=b3^~b5&b7,s[12]=b12^~b14&b16,s[13]=b13^~b15&b17,s[22]=b22^~b24&b26,s[23]=b23^~b25&b27,s[32]=b32^~b34&b36,s[33]=b33^~b35&b37,s[42]=b42^~b44&b46,s[43]=b43^~b45&b47,s[4]=b4^~b6&b8,s[5]=b5^~b7&b9,s[14]=b14^~b16&b18,s[15]=b15^~b17&b19,s[24]=b24^~b26&b28,s[25]=b25^~b27&b29,s[34]=b34^~b36&b38,s[35]=b35^~b37&b39,s[44]=b44^~b46&b48,s[45]=b45^~b47&b49,s[6]=b6^~b8&b0,s[7]=b7^~b9&b1,s[16]=b16^~b18&b10,s[17]=b17^~b19&b11,s[26]=b26^~b28&b20,s[27]=b27^~b29&b21,s[36]=b36^~b38&b30,s[37]=b37^~b39&b31,s[46]=b46^~b48&b40,s[47]=b47^~b49&b41,s[8]=b8^~b0&b2,s[9]=b9^~b1&b3,s[18]=b18^~b10&b12,s[19]=b19^~b11&b13,s[28]=b28^~b20&b22,s[29]=b29^~b21&b23,s[38]=b38^~b30&b32,s[39]=b39^~b31&b33,s[48]=b48^~b40&b42,s[49]=b49^~b41&b43,s[0]^=RC[n],s[1]^=RC[n+1]}while(!end);var hex="";if(CHROME)b0=s[0],b1=s[1],b2=s[2],b3=s[3],b4=s[4],b5=s[5],b6=s[6],b7=s[7],b8=s[8],b9=s[9],b10=s[10],b11=s[11],b12=s[12],b13=s[13],b14=s[14],b15=s[15],hex+=HEX_CHARS[b0>>4&15]+HEX_CHARS[15&b0]+HEX_CHARS[b0>>12&15]+HEX_CHARS[b0>>8&15]+HEX_CHARS[b0>>20&15]+HEX_CHARS[b0>>16&15]+HEX_CHARS[b0>>28&15]+HEX_CHARS[b0>>24&15]+HEX_CHARS[b1>>4&15]+HEX_CHARS[15&b1]+HEX_CHARS[b1>>12&15]+HEX_CHARS[b1>>8&15]+HEX_CHARS[b1>>20&15]+HEX_CHARS[b1>>16&15]+HEX_CHARS[b1>>28&15]+HEX_CHARS[b1>>24&15]+HEX_CHARS[b2>>4&15]+HEX_CHARS[15&b2]+HEX_CHARS[b2>>12&15]+HEX_CHARS[b2>>8&15]+HEX_CHARS[b2>>20&15]+HEX_CHARS[b2>>16&15]+HEX_CHARS[b2>>28&15]+HEX_CHARS[b2>>24&15]+HEX_CHARS[b3>>4&15]+HEX_CHARS[15&b3]+HEX_CHARS[b3>>12&15]+HEX_CHARS[b3>>8&15]+HEX_CHARS[b3>>20&15]+HEX_CHARS[b3>>16&15]+HEX_CHARS[b3>>28&15]+HEX_CHARS[b3>>24&15]+HEX_CHARS[b4>>4&15]+HEX_CHARS[15&b4]+HEX_CHARS[b4>>12&15]+HEX_CHARS[b4>>8&15]+HEX_CHARS[b4>>20&15]+HEX_CHARS[b4>>16&15]+HEX_CHARS[b4>>28&15]+HEX_CHARS[b4>>24&15]+HEX_CHARS[b5>>4&15]+HEX_CHARS[15&b5]+HEX_CHARS[b5>>12&15]+HEX_CHARS[b5>>8&15]+HEX_CHARS[b5>>20&15]+HEX_CHARS[b5>>16&15]+HEX_CHARS[b5>>28&15]+HEX_CHARS[b5>>24&15]+HEX_CHARS[b6>>4&15]+HEX_CHARS[15&b6]+HEX_CHARS[b6>>12&15]+HEX_CHARS[b6>>8&15]+HEX_CHARS[b6>>20&15]+HEX_CHARS[b6>>16&15]+HEX_CHARS[b6>>28&15]+HEX_CHARS[b6>>24&15],bits>=256&&(hex+=HEX_CHARS[b7>>4&15]+HEX_CHARS[15&b7]+HEX_CHARS[b7>>12&15]+HEX_CHARS[b7>>8&15]+HEX_CHARS[b7>>20&15]+HEX_CHARS[b7>>16&15]+HEX_CHARS[b7>>28&15]+HEX_CHARS[b7>>24&15]),bits>=384&&(hex+=HEX_CHARS[b8>>4&15]+HEX_CHARS[15&b8]+HEX_CHARS[b8>>12&15]+HEX_CHARS[b8>>8&15]+HEX_CHARS[b8>>20&15]+HEX_CHARS[b8>>16&15]+HEX_CHARS[b8>>28&15]+HEX_CHARS[b8>>24&15]+HEX_CHARS[b9>>4&15]+HEX_CHARS[15&b9]+HEX_CHARS[b9>>12&15]+HEX_CHARS[b9>>8&15]+HEX_CHARS[b9>>20&15]+HEX_CHARS[b9>>16&15]+HEX_CHARS[b9>>28&15]+HEX_CHARS[b9>>24&15]+HEX_CHARS[b10>>4&15]+HEX_CHARS[15&b10]+HEX_CHARS[b10>>12&15]+HEX_CHARS[b10>>8&15]+HEX_CHARS[b10>>20&15]+HEX_CHARS[b10>>16&15]+HEX_CHARS[b10>>28&15]+HEX_CHARS[b10>>24&15]+HEX_CHARS[b11>>4&15]+HEX_CHARS[15&b11]+HEX_CHARS[b11>>12&15]+HEX_CHARS[b11>>8&15]+HEX_CHARS[b11>>20&15]+HEX_CHARS[b11>>16&15]+HEX_CHARS[b11>>28&15]+HEX_CHARS[b11>>24&15]),512==bits&&(hex+=HEX_CHARS[b12>>4&15]+HEX_CHARS[15&b12]+HEX_CHARS[b12>>12&15]+HEX_CHARS[b12>>8&15]+HEX_CHARS[b12>>20&15]+HEX_CHARS[b12>>16&15]+HEX_CHARS[b12>>28&15]+HEX_CHARS[b12>>24&15]+HEX_CHARS[b13>>4&15]+HEX_CHARS[15&b13]+HEX_CHARS[b13>>12&15]+HEX_CHARS[b13>>8&15]+HEX_CHARS[b13>>20&15]+HEX_CHARS[b13>>16&15]+HEX_CHARS[b13>>28&15]+HEX_CHARS[b13>>24&15]+HEX_CHARS[b14>>4&15]+HEX_CHARS[15&b14]+HEX_CHARS[b14>>12&15]+HEX_CHARS[b14>>8&15]+HEX_CHARS[b14>>20&15]+HEX_CHARS[b14>>16&15]+HEX_CHARS[b14>>28&15]+HEX_CHARS[b14>>24&15]+HEX_CHARS[b15>>4&15]+HEX_CHARS[15&b15]+HEX_CHARS[b15>>12&15]+HEX_CHARS[b15>>8&15]+HEX_CHARS[b15>>20&15]+HEX_CHARS[b15>>16&15]+HEX_CHARS[b15>>28&15]+HEX_CHARS[b15>>24&15]);else for(i=0,n=bits/32;i>4&15]+HEX_CHARS[15&h]+HEX_CHARS[h>>12&15]+HEX_CHARS[h>>8&15]+HEX_CHARS[h>>20&15]+HEX_CHARS[h>>16&15]+HEX_CHARS[h>>28&15]+HEX_CHARS[h>>24&15];return hex};!root.JS_SHA3_TEST&&NODE_JS?module.exports={sha3_512:sha3_512,sha3_384:sha3_384,sha3_256:sha3_256,sha3_224:sha3_224,keccak_512:keccak,keccak_384:keccak_384,keccak_256:keccak_256,keccak_224:keccak_224}:root&&(root.sha3_512=sha3_512,root.sha3_384=sha3_384,root.sha3_256=sha3_256,root.sha3_224=sha3_224,root.keccak_512=keccak,root.keccak_384=keccak_384,root.keccak_256=keccak_256,root.keccak_224=keccak_224)}(this)}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){"use strict";(function(Buffer,process){function Zlib(mode){if("number"!=typeof mode||modeexports.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=mode,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}var assert=__webpack_require__(7),Zstream=__webpack_require__(711),zlib_deflate=__webpack_require__(705),zlib_inflate=__webpack_require__(707),constants=__webpack_require__(704);for(var key in constants)exports[key]=constants[key];exports.NONE=0,exports.DEFLATE=1,exports.INFLATE=2,exports.GZIP=3,exports.GUNZIP=4,exports.DEFLATERAW=5,exports.INFLATERAW=6,exports.UNZIP=7;Zlib.prototype.close=function(){if(this.write_in_progress)return void(this.pending_close=!0);this.pending_close=!1,assert(this.init_done,"close before init"),assert(this.mode<=exports.UNZIP),this.mode===exports.DEFLATE||this.mode===exports.GZIP||this.mode===exports.DEFLATERAW?zlib_deflate.deflateEnd(this.strm):this.mode!==exports.INFLATE&&this.mode!==exports.GUNZIP&&this.mode!==exports.INFLATERAW&&this.mode!==exports.UNZIP||zlib_inflate.inflateEnd(this.strm),this.mode=exports.NONE,this.dictionary=null},Zlib.prototype.write=function(flush,input,in_off,in_len,out,out_off,out_len){return this._write(!0,flush,input,in_off,in_len,out,out_off,out_len)},Zlib.prototype.writeSync=function(flush,input,in_off,in_len,out,out_off,out_len){return this._write(!1,flush,input,in_off,in_len,out,out_off,out_len)},Zlib.prototype._write=function(async,flush,input,in_off,in_len,out,out_off,out_len){if(assert.equal(arguments.length,8),assert(this.init_done,"write before init"),assert(this.mode!==exports.NONE,"already finalized"),assert.equal(!1,this.write_in_progress,"write already in progress"),assert.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,assert.equal(!1,void 0===flush,"must provide flush value"),this.write_in_progress=!0,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)throw new Error("Invalid flush value");if(null==input&&(input=new Buffer(0),in_len=0,in_off=0),this.strm.avail_in=in_len,this.strm.input=input,this.strm.next_in=in_off,this.strm.avail_out=out_len,this.strm.output=out,this.strm.next_out=out_off,this.flush=flush,async){var self=this;return process.nextTick(function(){self._process(),self._after()}),this}if(this._process(),this._checkError())return this._afterSync()},Zlib.prototype._afterSync=function(){var avail_out=this.strm.avail_out,avail_in=this.strm.avail_in;return this.write_in_progress=!1,[avail_in,avail_out]},Zlib.prototype._process=function(){var next_expected_header_byte=null;switch(this.mode){case exports.DEFLATE:case exports.GZIP:case exports.DEFLATERAW:this.err=zlib_deflate.deflate(this.strm,this.flush);break;case exports.UNZIP:switch(this.strm.avail_in>0&&(next_expected_header_byte=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===next_expected_header_byte)break;if(31!==this.strm.input[next_expected_header_byte]){this.mode=exports.INFLATE;break}if(this.gzip_id_bytes_read=1,next_expected_header_byte++,1===this.strm.avail_in)break;case 1:if(null===next_expected_header_byte)break;139===this.strm.input[next_expected_header_byte]?(this.gzip_id_bytes_read=2,this.mode=exports.GUNZIP):this.mode=exports.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case exports.INFLATE:case exports.GUNZIP:case exports.INFLATERAW:for(this.err=zlib_inflate.inflate(this.strm,this.flush),this.err===exports.Z_NEED_DICT&&this.dictionary&&(this.err=zlib_inflate.inflateSetDictionary(this.strm,this.dictionary),this.err===exports.Z_OK?this.err=zlib_inflate.inflate(this.strm,this.flush):this.err===exports.Z_DATA_ERROR&&(this.err=exports.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===exports.GUNZIP&&this.err===exports.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=zlib_inflate.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},Zlib.prototype._checkError=function(){switch(this.err){case exports.Z_OK:case exports.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===exports.Z_FINISH)return this._error("unexpected end of file"),!1;break;case exports.Z_STREAM_END:break;case exports.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},Zlib.prototype._after=function(){if(this._checkError()){var avail_out=this.strm.avail_out,avail_in=this.strm.avail_in;this.write_in_progress=!1,this.callback(avail_in,avail_out),this.pending_close&&this.close()}},Zlib.prototype._error=function(message){this.strm.msg&&(message=this.strm.msg),this.onerror(message,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},Zlib.prototype.init=function(windowBits,level,memLevel,strategy,dictionary){assert(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),assert(windowBits>=8&&windowBits<=15,"invalid windowBits"),assert(level>=-1&&level<=9,"invalid compression level"),assert(memLevel>=1&&memLevel<=9,"invalid memlevel"),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"),this._init(level,windowBits,memLevel,strategy,dictionary),this._setDictionary()},Zlib.prototype.params=function(){throw new Error("deflateParams Not supported")},Zlib.prototype.reset=function(){this._reset(),this._setDictionary()},Zlib.prototype._init=function(level,windowBits,memLevel,strategy,dictionary){switch(this.level=level,this.windowBits=windowBits,this.memLevel=memLevel,this.strategy=strategy,this.flush=exports.Z_NO_FLUSH,this.err=exports.Z_OK,this.mode!==exports.GZIP&&this.mode!==exports.GUNZIP||(this.windowBits+=16),this.mode===exports.UNZIP&&(this.windowBits+=32),this.mode!==exports.DEFLATERAW&&this.mode!==exports.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new Zstream,this.mode){case exports.DEFLATE:case exports.GZIP:case exports.DEFLATERAW:this.err=zlib_deflate.deflateInit2(this.strm,this.level,exports.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case exports.INFLATE:case exports.GUNZIP:case exports.INFLATERAW:case exports.UNZIP:this.err=zlib_inflate.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==exports.Z_OK&&this._error("Init error"),this.dictionary=dictionary,this.write_in_progress=!1,this.init_done=!0},Zlib.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=exports.Z_OK,this.mode){case exports.DEFLATE:case exports.DEFLATERAW:this.err=zlib_deflate.deflateSetDictionary(this.strm,this.dictionary)}this.err!==exports.Z_OK&&this._error("Failed to set dictionary")}},Zlib.prototype._reset=function(){switch(this.err=exports.Z_OK,this.mode){case exports.DEFLATE:case exports.DEFLATERAW:case exports.GZIP:this.err=zlib_deflate.deflateReset(this.strm);break;case exports.INFLATE:case exports.INFLATERAW:case exports.GUNZIP:this.err=zlib_inflate.inflateReset(this.strm)}this.err!==exports.Z_OK&&this._error("Failed to reset stream")},exports.Zlib=Zlib}).call(exports,__webpack_require__(0).Buffer,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";(function(process){function zlibBuffer(engine,buffer,callback){function flow(){for(var chunk;null!==(chunk=engine.read());)buffers.push(chunk),nread+=chunk.length;engine.once("readable",flow)}function onError(err){ +engine.removeListener("end",onEnd),engine.removeListener("readable",flow),callback(err)}function onEnd(){var buf,err=null;nread>=kMaxLength?err=new RangeError(kRangeErrorMessage):buf=Buffer.concat(buffers,nread),buffers=[],engine.close(),callback(err,buf)}var buffers=[],nread=0;engine.on("error",onError),engine.on("end",onEnd),engine.end(buffer),flow()}function zlibBufferSync(engine,buffer){if("string"==typeof buffer&&(buffer=Buffer.from(buffer)),!Buffer.isBuffer(buffer))throw new TypeError("Not a string or buffer");var flushFlag=engine._finishFlushFlag;return engine._processChunk(buffer,flushFlag)}function Deflate(opts){if(!(this instanceof Deflate))return new Deflate(opts);Zlib.call(this,opts,binding.DEFLATE)}function Inflate(opts){if(!(this instanceof Inflate))return new Inflate(opts);Zlib.call(this,opts,binding.INFLATE)}function Gzip(opts){if(!(this instanceof Gzip))return new Gzip(opts);Zlib.call(this,opts,binding.GZIP)}function Gunzip(opts){if(!(this instanceof Gunzip))return new Gunzip(opts);Zlib.call(this,opts,binding.GUNZIP)}function DeflateRaw(opts){if(!(this instanceof DeflateRaw))return new DeflateRaw(opts);Zlib.call(this,opts,binding.DEFLATERAW)}function InflateRaw(opts){if(!(this instanceof InflateRaw))return new InflateRaw(opts);Zlib.call(this,opts,binding.INFLATERAW)}function Unzip(opts){if(!(this instanceof Unzip))return new Unzip(opts);Zlib.call(this,opts,binding.UNZIP)}function isValidFlushFlag(flag){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}function Zlib(opts,mode){var _this=this;if(this._opts=opts=opts||{},this._chunkSize=opts.chunkSize||exports.Z_DEFAULT_CHUNK,Transform.call(this,opts),opts.flush&&!isValidFlushFlag(opts.flush))throw new Error("Invalid flush flag: "+opts.flush);if(opts.finishFlush&&!isValidFlushFlag(opts.finishFlush))throw new Error("Invalid flush flag: "+opts.finishFlush);if(this._flushFlag=opts.flush||binding.Z_NO_FLUSH,this._finishFlushFlag=void 0!==opts.finishFlush?opts.finishFlush:binding.Z_FINISH,opts.chunkSize&&(opts.chunkSizeexports.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+opts.chunkSize);if(opts.windowBits&&(opts.windowBitsexports.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+opts.windowBits);if(opts.level&&(opts.levelexports.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+opts.level);if(opts.memLevel&&(opts.memLevelexports.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+opts.memLevel);if(opts.strategy&&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)throw new Error("Invalid strategy: "+opts.strategy);if(opts.dictionary&&!Buffer.isBuffer(opts.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new binding.Zlib(mode);var self=this;this._hadError=!1,this._handle.onerror=function(message,errno){_close(self),self._hadError=!0;var error=new Error(message);error.errno=errno,error.code=exports.codes[errno],self.emit("error",error)};var level=exports.Z_DEFAULT_COMPRESSION;"number"==typeof opts.level&&(level=opts.level);var strategy=exports.Z_DEFAULT_STRATEGY;"number"==typeof opts.strategy&&(strategy=opts.strategy),this._handle.init(opts.windowBits||exports.Z_DEFAULT_WINDOWBITS,level,opts.memLevel||exports.Z_DEFAULT_MEMLEVEL,strategy,opts.dictionary),this._buffer=Buffer.allocUnsafe(this._chunkSize),this._offset=0,this._level=level,this._strategy=strategy,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!_this._handle},configurable:!0,enumerable:!0})}function _close(engine,callback){callback&&process.nextTick(callback),engine._handle&&(engine._handle.close(),engine._handle=null)}function emitCloseNT(self){self.emit("close")}var Buffer=__webpack_require__(0).Buffer,Transform=__webpack_require__(26).Transform,binding=__webpack_require__(379),util=__webpack_require__(10),assert=__webpack_require__(7).ok,kMaxLength=__webpack_require__(0).kMaxLength,kRangeErrorMessage="Cannot create final Buffer. It would be larger than 0x"+kMaxLength.toString(16)+" bytes";binding.Z_MIN_WINDOWBITS=8,binding.Z_MAX_WINDOWBITS=15,binding.Z_DEFAULT_WINDOWBITS=15,binding.Z_MIN_CHUNK=64,binding.Z_MAX_CHUNK=1/0,binding.Z_DEFAULT_CHUNK=16384,binding.Z_MIN_MEMLEVEL=1,binding.Z_MAX_MEMLEVEL=9,binding.Z_DEFAULT_MEMLEVEL=8,binding.Z_MIN_LEVEL=-1,binding.Z_MAX_LEVEL=9,binding.Z_DEFAULT_LEVEL=binding.Z_DEFAULT_COMPRESSION;for(var bkeys=Object.keys(binding),bk=0;bkexports.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+level);if(strategy!=exports.Z_FILTERED&&strategy!=exports.Z_HUFFMAN_ONLY&&strategy!=exports.Z_RLE&&strategy!=exports.Z_FIXED&&strategy!=exports.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+strategy);if(this._level!==level||this._strategy!==strategy){var self=this;this.flush(binding.Z_SYNC_FLUSH,function(){assert(self._handle,"zlib binding closed"),self._handle.params(level,strategy),self._hadError||(self._level=level,self._strategy=strategy,callback&&callback())})}else process.nextTick(callback)},Zlib.prototype.reset=function(){return assert(this._handle,"zlib binding closed"),this._handle.reset()},Zlib.prototype._flush=function(callback){this._transform(Buffer.alloc(0),"",callback)},Zlib.prototype.flush=function(kind,callback){var _this2=this,ws=this._writableState;("function"==typeof kind||void 0===kind&&!callback)&&(callback=kind,kind=binding.Z_FULL_FLUSH),ws.ended?callback&&process.nextTick(callback):ws.ending?callback&&this.once("end",callback):ws.needDrain?callback&&this.once("drain",function(){return _this2.flush(kind,callback)}):(this._flushFlag=kind,this.write(Buffer.alloc(0),"",callback))},Zlib.prototype.close=function(callback){_close(this,callback),process.nextTick(emitCloseNT,this)},Zlib.prototype._transform=function(chunk,encoding,cb){var flushFlag,ws=this._writableState,ending=ws.ending||ws.ended,last=ending&&(!chunk||ws.length===chunk.length);return null===chunk||Buffer.isBuffer(chunk)?this._handle?(last?flushFlag=this._finishFlushFlag:(flushFlag=this._flushFlag,chunk.length>=ws.length&&(this._flushFlag=this._opts.flush||binding.Z_NO_FLUSH)),void this._processChunk(chunk,flushFlag,cb)):cb(new Error("zlib binding closed")):cb(new Error("invalid input"))},Zlib.prototype._processChunk=function(chunk,flushFlag,cb){function callback(availInAfter,availOutAfter){if(this&&(this.buffer=null,this.callback=null),!self._hadError){var have=availOutBefore-availOutAfter;if(assert(have>=0,"have should not go down"),have>0){var out=self._buffer.slice(self._offset,self._offset+have);self._offset+=have,async?self.push(out):(buffers.push(out),nread+=out.length)}if((0===availOutAfter||self._offset>=self._chunkSize)&&(availOutBefore=self._chunkSize,self._offset=0,self._buffer=Buffer.allocUnsafe(self._chunkSize)),0===availOutAfter){if(inOff+=availInBefore-availInAfter,availInBefore=availInAfter,!async)return!0;var newReq=self._handle.write(flushFlag,chunk,inOff,availInBefore,self._buffer,self._offset,self._chunkSize);return newReq.callback=callback,void(newReq.buffer=chunk)}if(!async)return!1;cb()}}var availInBefore=chunk&&chunk.length,availOutBefore=this._chunkSize-this._offset,inOff=0,self=this,async="function"==typeof cb;if(!async){var error,buffers=[],nread=0;this.on("error",function(er){error=er}),assert(this._handle,"zlib binding closed");do{var res=this._handle.writeSync(flushFlag,chunk,inOff,availInBefore,this._buffer,this._offset,availOutBefore)}while(!this._hadError&&callback(res[0],res[1]));if(this._hadError)throw error;if(nread>=kMaxLength)throw _close(this),new RangeError(kRangeErrorMessage);var buf=Buffer.concat(buffers,nread);return _close(this),buf}assert(this._handle,"zlib binding closed");var req=this._handle.write(flushFlag,chunk,inOff,availInBefore,this._buffer,this._offset,availOutBefore);req.buffer=chunk,req.callback=callback},util.inherits(Deflate,Zlib),util.inherits(Inflate,Zlib),util.inherits(Gzip,Zlib),util.inherits(Gunzip,Zlib),util.inherits(DeflateRaw,Zlib),util.inherits(InflateRaw,Zlib),util.inherits(Unzip,Zlib)}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){var Buffer=__webpack_require__(13).Buffer;module.exports=function(ALPHABET){function encode(source){if(0===source.length)return"";for(var digits=[0],i=0;i0;)digits.push(carry%BASE),carry=carry/BASE|0}for(var string="",k=0;0===source[k]&&k=0;--q)string+=ALPHABET[digits[q]];return string}function decodeUnsafe(string){if(0===string.length)return Buffer.allocUnsafe(0);for(var bytes=[0],i=0;i>=8;for(;carry>0;)bytes.push(255&carry),carry>>=8}for(var k=0;string[k]===LEADER&&k>>2),i=0,j=0;iblocksize){key=("rmd160"===alg?new RIPEMD160:sha(alg)).update(key).digest()}else key.lengthblocksize?key=alg(key):key.length{return err?callback(err):exists?void callback(null,this.data[key.toString()]):callback(new Error("No value"))})}has(key,callback){setImmediate(()=>{callback(null,void 0!==this.data[key.toString()])})}delete(key,callback){delete this.data[key.toString()],setImmediate(()=>{callback()})}batch(){let puts=[],dels=[];return{put(key,value){puts.push([key,value])},delete(key){dels.push(key)},commit:callback=>{puts.forEach(v=>{this.data[v[0].toString()]=v[1]}),puts=[],dels.forEach(key=>{delete this.data[key.toString()]}),dels=[],setImmediate(callback)}}}query(q){let tasks=[pull.keys(this.data),pull.map(k=>({key:new Key(k),value:this.data[k]}))],filters=[];if(null!=q.prefix){const prefix=q.prefix;filters.push((e,cb)=>cb(null,e.key.toString().startsWith(prefix)))}if(null!=q.filters&&(filters=filters.concat(q.filters)),tasks=tasks.concat(filters.map(f=>asyncFilter(f))),null!=q.orders&&(tasks=tasks.concat(q.orders.map(o=>asyncSort(o)))),null!=q.offset){let i=0;tasks.push(pull.filter(()=>i++>=q.offset))}return null!=q.limit&&tasks.push(pull.take(q.limit)),q.keysOnly===!0&&tasks.push(pull.map(e=>({key:e.key}))),pull.apply(null,tasks)}close(callback){setImmediate(callback)}}module.exports=MemoryDatastore},function(module,exports,__webpack_require__){"use strict";const each=__webpack_require__(32),many=__webpack_require__(727),pull=__webpack_require__(5),Key=__webpack_require__(76).Key,utils=__webpack_require__(76).utils,asyncFilter=utils.asyncFilter,asyncSort=utils.asyncSort,replaceStartWith=utils.replaceStartWith,Keytransform=__webpack_require__(96);class MountDatastore{constructor(mounts){this.mounts=mounts.slice()}open(callback){each(this.mounts,(m,cb)=>{m.datastore.open(cb)},callback)}_lookup(key){for(let mount of this.mounts)if(mount.prefix.toString()===key.toString()||mount.prefix.isAncestorOf(key)){const s=replaceStartWith(key.toString(),mount.prefix.toString());return{datastore:mount.datastore,mountpoint:mount.prefix,rest:new Key(s)}}}put(key,value,callback){const match=this._lookup(key);if(null==match)return void callback(new Error("No datastore mounted for this key"));match.datastore.put(match.rest,value,callback)}get(key,callback){const match=this._lookup(key);if(null==match)return void callback(new Error("No datastore mounted for this key"));match.datastore.get(match.rest,callback)}has(key,callback){const match=this._lookup(key);if(null==match)return void callback(null,!1);match.datastore.has(match.rest,callback)}delete(key,callback){const match=this._lookup(key);if(null==match)return void callback(new Error("No datastore mounted for this key"));match.datastore.delete(match.rest,callback)}close(callback){each(this.mounts,(m,cb)=>{m.datastore.close(cb)},callback)}batch(){const batchMounts={},lookup=key=>{const match=this._lookup(key);if(null==match)throw new Error("No datastore mounted for this key");const m=match.mountpoint.toString();return null==batchMounts[m]&&(batchMounts[m]=match.datastore.batch()),{batch:batchMounts[m],rest:match.rest}};return{put:(key,value)=>{const match=lookup(key);match.batch.put(match.rest,value)},delete:key=>{const match=lookup(key);match.batch.delete(match.rest)},commit:callback=>{each(Object.keys(batchMounts),(p,cb)=>{batchMounts[p].commit(cb)},callback)}}}query(q){const qs=this.mounts.map(m=>{const ks=new Keytransform(m.datastore,{convert:key=>{throw new Error("should never be called")},invert:key=>{return m.prefix.child(key)}});let prefix;return null!=q.prefix&&(prefix=replaceStartWith(q.prefix,m.prefix.toString())),ks.query({prefix:prefix,filters:q.filters,keysOnly:q.keysOnly})});let tasks=[many(qs)];if(null!=q.filters&&(tasks=tasks.concat(q.filters.map(f=>asyncFilter(f)))),null!=q.orders&&(tasks=tasks.concat(q.orders.map(o=>asyncSort(o)))),null!=q.offset){let i=0;tasks.push(pull.filter(()=>i++>=q.offset))}return null!=q.limit&&tasks.push(pull.take(q.limit)),pull.apply(null,tasks)}}module.exports=MountDatastore},function(module,exports,__webpack_require__){"use strict";const Key=__webpack_require__(76).Key,KeytransformDatastore=__webpack_require__(96);class NamespaceDatastore extends KeytransformDatastore{constructor(child,prefix){super(child,{convert(key){return prefix.child(key)},invert(key){if("/"===prefix.toString())return key;if(!prefix.isAncestorOf(key))throw new Error(`Expected prefix: (${prefix.toString()}) in key: ${key.toString()}`);return new Key(key.toString().slice(prefix.toString().length),!1)}}),this.prefix=prefix}query(q){return q.prefix&&"/"!==this.prefix.toString()?super.query(Object.assign({},q,{prefix:this.prefix.child(new Key(q.prefix)).toString()})):super.query(q)}}module.exports=NamespaceDatastore},function(module,exports,__webpack_require__){"use strict";module.exports=`This is a repository of IPLD objects. Each IPLD object is in a single file, +named .data. Where is the +"base32" encoding of the CID (as specified in +https://github.com/multiformats/multibase) without the 'B' prefix. +All the object files are placed in a tree of directories, based on a +function of the CID. This is a form of sharding similar to +the objects directory in git repositories. Previously, we used +prefixes, we now use the next-to-last two charters. + func NextToLast(base32cid string) { + nextToLastLen := 2 + offset := len(base32cid) - nextToLastLen - 1 + return str[offset : offset+nextToLastLen] + } +For example, an object with a base58 CIDv1 of + zb2rhYSxw4ZjuzgCnWSt19Q94ERaeFhu9uSqRgjSdx9bsgM6f +has a base32 CIDv1 of + BAFKREIA22FLID5AJ2KU7URG47MDLROZIH6YF2KALU2PWEFPVI37YLKRSCA +and will be placed at + SC/AFKREIA22FLID5AJ2KU7URG47MDLROZIH6YF2KALU2PWEFPVI37YLKRSCA.data +with 'SC' being the last-to-next two characters and the 'B' at the +beginning of the CIDv1 string is the multibase prefix that is not +stored in the filename. +`},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const waterfall=__webpack_require__(9),parallel=__webpack_require__(46),pull=__webpack_require__(5),Key=__webpack_require__(76).Key,sh=__webpack_require__(198),KeytransformStore=__webpack_require__(96),shardKey=new Key(sh.SHARDING_FN),shardReadmeKey=new Key(sh.README_FN);class ShardingDatastore{constructor(store,shard){this.child=new KeytransformStore(store,{convert:this._convertKey.bind(this),invert:this._invertKey.bind(this)}),this.shard=shard}open(callback){this.child.open(callback)}_convertKey(key){const s=key.toString();return s===shardKey.toString()||s===shardReadmeKey.toString()?key:new Key(this.shard.fun(s)).child(key)}_invertKey(key){const s=key.toString();return s===shardKey.toString()||s===shardReadmeKey.toString()?key:Key.withNamespaces(key.list().slice(1))}static createOrOpen(store,shard,callback){ShardingDatastore.create(store,shard,err=>{if(err&&"datastore exists"!==err.message)return callback(err);ShardingDatastore.open(store,callback)})}static open(store,callback){waterfall([cb=>sh.readShardFun("/",store,cb),(shard,cb)=>{cb(null,new ShardingDatastore(store,shard))}],callback)}static create(store,shard,callback){store.has(shardKey,(err,exists)=>{if(err)return callback(err);if(!exists){const put="function"==typeof store.putRaw?store.putRaw.bind(store):store.put.bind(store);return parallel([cb=>put(shardKey,new Buffer(shard.toString()+"\n"),cb),cb=>put(shardReadmeKey,new Buffer(sh.readme),cb)],err=>callback(err))}sh.readShardFun("/",store,(err,diskShard)=>{if(err)return callback(err);const a=(diskShard||"").toString(),b=shard.toString();if(a!==b)return callback(new Error(`specified fun ${b} does not match repo shard fun ${a}`));callback(new Error("datastore exists"))})})}put(key,val,callback){this.child.put(key,val,callback)}get(key,callback){this.child.get(key,callback)}has(key,callback){this.child.has(key,callback)}delete(key,callback){this.child.delete(key,callback)}batch(){return this.child.batch()}query(q){const tq={keysOnly:q.keysOnly};return null!=q.prefix&&(tq.prefix=q.prefix),null!=q.filters&&(tq.filters=q.filters.map(f=>(e,cb)=>{f(Object.assign({},e,{key:this._invertKey(e.key)}),cb)})),null!=q.orders&&(tq.orders=q.orders.map(o=>(res,cb)=>{o(res.map(e=>{return Object.assign({},e,{key:this._invertKey(e.key)})}),cb)})),null!=q.offset&&(tq.offset=q.offset+2),null!=q.limit&&(tq.limit=q.limit+2),pull(this.child.query(tq),pull.filter(e=>{return e.key.toString()!==shardKey.toString()&&e.key.toString()!==shardReadmeKey.toString()}))}close(callback){this.child.close(callback)}}module.exports=ShardingDatastore}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const each=__webpack_require__(32),whilst=__webpack_require__(90);class TieredDatastore{constructor(stores){this.stores=stores.slice()}open(callback){each(this.stores,(store,cb)=>{store.open(cb)},callback)}put(key,value,callback){each(this.stores,(store,cb)=>{store.put(key,value,cb)},callback)}get(key,callback){const storeLength=this.stores.length;let done=!1,i=0;whilst(()=>!done&&i{this.stores[i++].get(key,(err,res)=>{if(null==err)return done=!0,cb(null,res);cb()})},callback)}has(key,callback){const storeLength=this.stores.length;let done=!1,i=0;whilst(()=>!done&&i{this.stores[i++].has(key,(err,exists)=>{if(null==err)return done=!0,cb(null,exists);cb()})},callback)}delete(key,callback){each(this.stores,(store,cb)=>{store.delete(key,cb)},callback)}close(callback){each(this.stores,(store,cb)=>{store.close(cb)},callback)}batch(){const batches=this.stores.map(store=>store.batch());return{put:(key,value)=>{batches.forEach(b=>b.put(key,value))},delete:key=>{batches.forEach(b=>b.delete(key))},commit:callback=>{each(batches,(b,cb)=>{b.commit(cb)},callback)}}}query(q){return this.stores[this.stores.length-1].query(q)}}module.exports=TieredDatastore},function(module,exports,__webpack_require__){function selectColor(namespace){var i,hash=0;for(i in namespace)hash=(hash<<5)-hash+namespace.charCodeAt(i),hash|=0;return exports.colors[Math.abs(hash)%exports.colors.length]}function createDebug(namespace){function debug(){if(debug.enabled){var self=debug,curr=+new Date,ms=curr-(prevTime||curr);self.diff=ms,self.prev=prevTime,self.curr=curr,prevTime=curr;for(var args=new Array(arguments.length),i=0;ithis._reseedInterval)throw new Error("Reseed is required");add&&0===add.length&&(add=void 0),add&&this._update(add);for(var temp=new Buffer(0);temp.length0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};0===this.length&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(0!==this.length){var ret=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s){if(0===this.length)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s+p.data;return ret},BufferList.prototype.concat=function(n){if(0===this.length)return bufferShim.alloc(0);if(1===this.length)return this.head.data;for(var ret=bufferShim.allocUnsafe(n>>>0),p=this.head,i=0;p;)p.data.copy(ret,i),i+=p.data.length,p=p.next;return ret}},function(module,exports,__webpack_require__){exports=module.exports=__webpack_require__(205),exports.Stream=exports,exports.Readable=exports,exports.Writable=__webpack_require__(207),exports.Duplex=__webpack_require__(57),exports.Transform=__webpack_require__(206),exports.PassThrough=__webpack_require__(399)},function(module,exports,__webpack_require__){"use strict";function BaseCurve(type,conf){this.type=type,this.p=new BN(conf.p,16),this.red=conf.prime?BN.red(conf.prime):BN.mont(this.p),this.zero=new BN(0).toRed(this.red),this.one=new BN(1).toRed(this.red),this.two=new BN(2).toRed(this.red),this.n=conf.n&&new BN(conf.n,16),this.g=conf.g&&this.pointFromJSON(conf.g,conf.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var adjustCount=this.n&&this.p.div(this.n);!adjustCount||adjustCount.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function BasePoint(curve,type){this.curve=curve,this.type=type,this.precomputed=null}var BN=__webpack_require__(20),elliptic=__webpack_require__(27),utils=elliptic.utils,getNAF=utils.getNAF,getJSF=utils.getJSF,assert=utils.assert;module.exports=BaseCurve,BaseCurve.prototype.point=function(){throw new Error("Not implemented")},BaseCurve.prototype.validate=function(){throw new Error("Not implemented")},BaseCurve.prototype._fixedNafMul=function(p,k){assert(p.precomputed);var doubles=p._getDoubles(),naf=getNAF(k,1),I=(1<=j;k--)nafW=(nafW<<1)+naf[k];repr.push(nafW)}for(var a=this.jpoint(null,null,null),b=this.jpoint(null,null,null),i=I;i>0;i--){for(var j=0;j=0;i--){for(var k=0;i>=0&&0===naf[i];i--)k++;if(i>=0&&k++,acc=acc.dblp(k),i<0)break;var z=naf[i];assert(0!==z),acc="affine"===p.type?z>0?acc.mixedAdd(wnd[z-1>>1]):acc.mixedAdd(wnd[-z-1>>1].neg()):z>0?acc.add(wnd[z-1>>1]):acc.add(wnd[-z-1>>1].neg())}return"affine"===p.type?acc.toP():acc},BaseCurve.prototype._wnafMulAdd=function(defW,points,coeffs,len,jacobianResult){for(var wndWidth=this._wnafT1,wnd=this._wnafT2,naf=this._wnafT3,max=0,i=0;i=1;i-=2){var a=i-1,b=i;if(1===wndWidth[a]&&1===wndWidth[b]){var comb=[points[a],null,null,points[b]];0===points[a].y.cmp(points[b].y)?(comb[1]=points[a].add(points[b]),comb[2]=points[a].toJ().mixedAdd(points[b].neg())):0===points[a].y.cmp(points[b].y.redNeg())?(comb[1]=points[a].toJ().mixedAdd(points[b]),comb[2]=points[a].add(points[b].neg())):(comb[1]=points[a].toJ().mixedAdd(points[b]),comb[2]=points[a].toJ().mixedAdd(points[b].neg()));var index=[-3,-1,-5,-7,0,7,5,1,3],jsf=getJSF(coeffs[a],coeffs[b]);max=Math.max(jsf[0].length,max),naf[a]=new Array(max),naf[b]=new Array(max);for(var j=0;j=0;i--){for(var k=0;i>=0;){for(var zero=!0,j=0;j=0&&k++,acc=acc.dblp(k),i<0)break;for(var j=0;j0?p=wnd[j][z-1>>1]:z<0&&(p=wnd[j][-z-1>>1].neg()),acc="affine"===p.type?acc.mixedAdd(p):acc.add(p))}}for(var i=0;i=Math.ceil((k.bitLength()+1)/doubles.step)},BasePoint.prototype._getDoubles=function(step,power){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var doubles=[this],acc=this,i=0;i":""},Point.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},Point.prototype._extDbl=function(){var a=this.x.redSqr(),b=this.y.redSqr(),c=this.z.redSqr();c=c.redIAdd(c);var d=this.curve._mulA(a),e=this.x.redAdd(this.y).redSqr().redISub(a).redISub(b),g=d.redAdd(b),f=g.redSub(c),h=d.redSub(b),nx=e.redMul(f),ny=g.redMul(h),nt=e.redMul(h),nz=f.redMul(g);return this.curve.point(nx,ny,nz,nt)},Point.prototype._projDbl=function(){var nx,ny,nz,b=this.x.redAdd(this.y).redSqr(),c=this.x.redSqr(),d=this.y.redSqr();if(this.curve.twisted){var e=this.curve._mulA(c),f=e.redAdd(d);if(this.zOne)nx=b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two)),ny=f.redMul(e.redSub(d)),nz=f.redSqr().redSub(f).redSub(f);else{var h=this.z.redSqr(),j=f.redSub(h).redISub(h);nx=b.redSub(c).redISub(d).redMul(j),ny=f.redMul(e.redSub(d)),nz=f.redMul(j)}}else{var e=c.redAdd(d),h=this.curve._mulC(this.c.redMul(this.z)).redSqr(),j=e.redSub(h).redSub(h);nx=this.curve._mulC(b.redISub(e)).redMul(j),ny=this.curve._mulC(e).redMul(c.redISub(d)),nz=e.redMul(j)}return this.curve.point(nx,ny,nz)},Point.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Point.prototype._extAdd=function(p){var a=this.y.redSub(this.x).redMul(p.y.redSub(p.x)),b=this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)),c=this.t.redMul(this.curve.dd).redMul(p.t),d=this.z.redMul(p.z.redAdd(p.z)),e=b.redSub(a),f=d.redSub(c),g=d.redAdd(c),h=b.redAdd(a),nx=e.redMul(f),ny=g.redMul(h),nt=e.redMul(h),nz=f.redMul(g);return this.curve.point(nx,ny,nz,nt)},Point.prototype._projAdd=function(p){var ny,nz,a=this.z.redMul(p.z),b=a.redSqr(),c=this.x.redMul(p.x),d=this.y.redMul(p.y),e=this.curve.d.redMul(c).redMul(d),f=b.redSub(e),g=b.redAdd(e),tmp=this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d),nx=a.redMul(f).redMul(tmp);return this.curve.twisted?(ny=a.redMul(g).redMul(d.redSub(this.curve._mulA(c))),nz=f.redMul(g)):(ny=a.redMul(g).redMul(d.redSub(c)),nz=this.curve._mulC(f).redMul(g)),this.curve.point(nx,ny,nz)},Point.prototype.add=function(p){return this.isInfinity()?p:p.isInfinity()?this:this.curve.extended?this._extAdd(p):this._projAdd(p)},Point.prototype.mul=function(k){return this._hasDoubles(k)?this.curve._fixedNafMul(this,k):this.curve._wnafMul(this,k)},Point.prototype.mulAdd=function(k1,p,k2){return this.curve._wnafMulAdd(1,[this,p],[k1,k2],2,!1)},Point.prototype.jmulAdd=function(k1,p,k2){return this.curve._wnafMulAdd(1,[this,p],[k1,k2],2,!0)},Point.prototype.normalize=function(){if(this.zOne)return this;var zi=this.z.redInvm();return this.x=this.x.redMul(zi),this.y=this.y.redMul(zi),this.t&&(this.t=this.t.redMul(zi)),this.z=this.curve.one,this.zOne=!0,this},Point.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Point.prototype.getY=function(){return this.normalize(),this.y.fromRed()},Point.prototype.eq=function(other){return this===other||0===this.getX().cmp(other.getX())&&0===this.getY().cmp(other.getY())},Point.prototype.eqXToP=function(x){var rx=x.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(rx))return!0;for(var xc=x.clone(),t=this.curve.redN.redMul(this.z);;){if(xc.iadd(this.curve.n),xc.cmp(this.curve.p)>=0)return!1;if(rx.redIAdd(t),0===this.x.cmp(rx))return!0}return!1},Point.prototype.toP=Point.prototype.normalize,Point.prototype.mixedAdd=Point.prototype.add},function(module,exports,__webpack_require__){"use strict";function MontCurve(conf){Base.call(this,"mont",conf),this.a=new BN(conf.a,16).toRed(this.red),this.b=new BN(conf.b,16).toRed(this.red),this.i4=new BN(4).toRed(this.red).redInvm(),this.two=new BN(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function Point(curve,x,z){Base.BasePoint.call(this,curve,"projective"),null===x&&null===z?(this.x=this.curve.one, +this.z=this.curve.zero):(this.x=new BN(x,16),this.z=new BN(z,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var curve=__webpack_require__(98),BN=__webpack_require__(20),inherits=__webpack_require__(1),Base=curve.base,elliptic=__webpack_require__(27),utils=elliptic.utils;inherits(MontCurve,Base),module.exports=MontCurve,MontCurve.prototype.validate=function(point){var x=point.normalize().x,x2=x.redSqr(),rhs=x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);return 0===rhs.redSqrt().redSqr().cmp(rhs)},inherits(Point,Base.BasePoint),MontCurve.prototype.decodePoint=function(bytes,enc){return this.point(utils.toArray(bytes,enc),1)},MontCurve.prototype.point=function(x,z){return new Point(this,x,z)},MontCurve.prototype.pointFromJSON=function(obj){return Point.fromJSON(this,obj)},Point.prototype.precompute=function(){},Point.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Point.fromJSON=function(curve,obj){return new Point(curve,obj[0],obj[1]||curve.one)},Point.prototype.inspect=function(){return this.isInfinity()?"":""},Point.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Point.prototype.dbl=function(){var a=this.x.redAdd(this.z),aa=a.redSqr(),b=this.x.redSub(this.z),bb=b.redSqr(),c=aa.redSub(bb),nx=aa.redMul(bb),nz=c.redMul(bb.redAdd(this.curve.a24.redMul(c)));return this.curve.point(nx,nz)},Point.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.diffAdd=function(p,diff){var a=this.x.redAdd(this.z),b=this.x.redSub(this.z),c=p.x.redAdd(p.z),d=p.x.redSub(p.z),da=d.redMul(a),cb=c.redMul(b),nx=diff.z.redMul(da.redAdd(cb).redSqr()),nz=diff.x.redMul(da.redISub(cb).redSqr());return this.curve.point(nx,nz)},Point.prototype.mul=function(k){for(var t=k.clone(),a=this,b=this.curve.point(null,null),c=this,bits=[];0!==t.cmpn(0);t.iushrn(1))bits.push(t.andln(1));for(var i=bits.length-1;i>=0;i--)0===bits[i]?(a=a.diffAdd(b,c),b=b.dbl()):(b=a.diffAdd(b,c),a=a.dbl());return b},Point.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.eq=function(other){return 0===this.getX().cmp(other.getX())},Point.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(module,exports,__webpack_require__){"use strict";function ShortCurve(conf){Base.call(this,"short",conf),this.a=new BN(conf.a,16).toRed(this.red),this.b=new BN(conf.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(conf),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function Point(curve,x,y,isRed){Base.BasePoint.call(this,curve,"affine"),null===x&&null===y?(this.x=null,this.y=null,this.inf=!0):(this.x=new BN(x,16),this.y=new BN(y,16),isRed&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function JPoint(curve,x,y,z){Base.BasePoint.call(this,curve,"jacobian"),null===x&&null===y&&null===z?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN(0)):(this.x=new BN(x,16),this.y=new BN(y,16),this.z=new BN(z,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}var curve=__webpack_require__(98),elliptic=__webpack_require__(27),BN=__webpack_require__(20),inherits=__webpack_require__(1),Base=curve.base,assert=elliptic.utils.assert;inherits(ShortCurve,Base),module.exports=ShortCurve,ShortCurve.prototype._getEndomorphism=function(conf){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var beta,lambda;if(conf.beta)beta=new BN(conf.beta,16).toRed(this.red);else{var betas=this._getEndoRoots(this.p);beta=betas[0].cmp(betas[1])<0?betas[0]:betas[1],beta=beta.toRed(this.red)}if(conf.lambda)lambda=new BN(conf.lambda,16);else{var lambdas=this._getEndoRoots(this.n);0===this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta))?lambda=lambdas[0]:(lambda=lambdas[1],assert(0===this.g.mul(lambda).x.cmp(this.g.x.redMul(beta))))}var basis;return basis=conf.basis?conf.basis.map(function(vec){return{a:new BN(vec.a,16),b:new BN(vec.b,16)}}):this._getEndoBasis(lambda),{beta:beta,lambda:lambda,basis:basis}}},ShortCurve.prototype._getEndoRoots=function(num){var red=num===this.p?this.red:BN.mont(num),tinv=new BN(2).toRed(red).redInvm(),ntinv=tinv.redNeg(),s=new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);return[ntinv.redAdd(s).fromRed(),ntinv.redSub(s).fromRed()]},ShortCurve.prototype._getEndoBasis=function(lambda){for(var a0,b0,a1,b1,a2,b2,prevR,r,x,aprxSqrt=this.n.ushrn(Math.floor(this.n.bitLength()/2)),u=lambda,v=this.n.clone(),x1=new BN(1),y1=new BN(0),x2=new BN(0),y2=new BN(1),i=0;0!==u.cmpn(0);){var q=v.div(u);r=v.sub(q.mul(u)),x=x2.sub(q.mul(x1));var y=y2.sub(q.mul(y1));if(!a1&&r.cmp(aprxSqrt)<0)a0=prevR.neg(),b0=x1,a1=r.neg(),b1=x;else if(a1&&2==++i)break;prevR=r,v=u,u=r,x2=x1,x1=x,y2=y1,y1=y}a2=r.neg(),b2=x;var len1=a1.sqr().add(b1.sqr());return a2.sqr().add(b2.sqr()).cmp(len1)>=0&&(a2=a0,b2=b0),a1.negative&&(a1=a1.neg(),b1=b1.neg()),a2.negative&&(a2=a2.neg(),b2=b2.neg()),[{a:a1,b:b1},{a:a2,b:b2}]},ShortCurve.prototype._endoSplit=function(k){var basis=this.endo.basis,v1=basis[0],v2=basis[1],c1=v2.b.mul(k).divRound(this.n),c2=v1.b.neg().mul(k).divRound(this.n),p1=c1.mul(v1.a),p2=c2.mul(v2.a),q1=c1.mul(v1.b),q2=c2.mul(v2.b);return{k1:k.sub(p1).sub(p2),k2:q1.add(q2).neg()}},ShortCurve.prototype.pointFromX=function(x,odd){x=new BN(x,16),x.red||(x=x.toRed(this.red));var y2=x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b),y=y2.redSqrt();if(0!==y.redSqr().redSub(y2).cmp(this.zero))throw new Error("invalid point");var isOdd=y.fromRed().isOdd();return(odd&&!isOdd||!odd&&isOdd)&&(y=y.redNeg()),this.point(x,y)},ShortCurve.prototype.validate=function(point){if(point.inf)return!0;var x=point.x,y=point.y,ax=this.a.redMul(x),rhs=x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);return 0===y.redSqr().redISub(rhs).cmpn(0)},ShortCurve.prototype._endoWnafMulAdd=function(points,coeffs,jacobianResult){for(var npoints=this._endoWnafT1,ncoeffs=this._endoWnafT2,i=0;i":""},Point.prototype.isInfinity=function(){return this.inf},Point.prototype.add=function(p){if(this.inf)return p;if(p.inf)return this;if(this.eq(p))return this.dbl();if(this.neg().eq(p))return this.curve.point(null,null);if(0===this.x.cmp(p.x))return this.curve.point(null,null);var c=this.y.redSub(p.y);0!==c.cmpn(0)&&(c=c.redMul(this.x.redSub(p.x).redInvm()));var nx=c.redSqr().redISub(this.x).redISub(p.x),ny=c.redMul(this.x.redSub(nx)).redISub(this.y);return this.curve.point(nx,ny)},Point.prototype.dbl=function(){if(this.inf)return this;var ys1=this.y.redAdd(this.y);if(0===ys1.cmpn(0))return this.curve.point(null,null);var a=this.curve.a,x2=this.x.redSqr(),dyinv=ys1.redInvm(),c=x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv),nx=c.redSqr().redISub(this.x.redAdd(this.x)),ny=c.redMul(this.x.redSub(nx)).redISub(this.y);return this.curve.point(nx,ny)},Point.prototype.getX=function(){return this.x.fromRed()},Point.prototype.getY=function(){return this.y.fromRed()},Point.prototype.mul=function(k){return k=new BN(k,16),this._hasDoubles(k)?this.curve._fixedNafMul(this,k):this.curve.endo?this.curve._endoWnafMulAdd([this],[k]):this.curve._wnafMul(this,k)},Point.prototype.mulAdd=function(k1,p2,k2){var points=[this,p2],coeffs=[k1,k2];return this.curve.endo?this.curve._endoWnafMulAdd(points,coeffs):this.curve._wnafMulAdd(1,points,coeffs,2)},Point.prototype.jmulAdd=function(k1,p2,k2){var points=[this,p2],coeffs=[k1,k2];return this.curve.endo?this.curve._endoWnafMulAdd(points,coeffs,!0):this.curve._wnafMulAdd(1,points,coeffs,2,!0)},Point.prototype.eq=function(p){return this===p||this.inf===p.inf&&(this.inf||0===this.x.cmp(p.x)&&0===this.y.cmp(p.y))},Point.prototype.neg=function(_precompute){if(this.inf)return this;var res=this.curve.point(this.x,this.y.redNeg());if(_precompute&&this.precomputed){var pre=this.precomputed,negate=function(p){return p.neg()};res.precomputed={naf:pre.naf&&{wnd:pre.naf.wnd,points:pre.naf.points.map(negate)},doubles:pre.doubles&&{step:pre.doubles.step,points:pre.doubles.points.map(negate)}}}return res},Point.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},inherits(JPoint,Base.BasePoint),ShortCurve.prototype.jpoint=function(x,y,z){return new JPoint(this,x,y,z)},JPoint.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var zinv=this.z.redInvm(),zinv2=zinv.redSqr(),ax=this.x.redMul(zinv2),ay=this.y.redMul(zinv2).redMul(zinv);return this.curve.point(ax,ay)},JPoint.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},JPoint.prototype.add=function(p){if(this.isInfinity())return p;if(p.isInfinity())return this;var pz2=p.z.redSqr(),z2=this.z.redSqr(),u1=this.x.redMul(pz2),u2=p.x.redMul(z2),s1=this.y.redMul(pz2.redMul(p.z)),s2=p.y.redMul(z2.redMul(this.z)),h=u1.redSub(u2),r=s1.redSub(s2);if(0===h.cmpn(0))return 0!==r.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h2=h.redSqr(),h3=h2.redMul(h),v=u1.redMul(h2),nx=r.redSqr().redIAdd(h3).redISub(v).redISub(v),ny=r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)),nz=this.z.redMul(p.z).redMul(h);return this.curve.jpoint(nx,ny,nz)},JPoint.prototype.mixedAdd=function(p){if(this.isInfinity())return p.toJ();if(p.isInfinity())return this;var z2=this.z.redSqr(),u1=this.x,u2=p.x.redMul(z2),s1=this.y,s2=p.y.redMul(z2).redMul(this.z),h=u1.redSub(u2),r=s1.redSub(s2);if(0===h.cmpn(0))return 0!==r.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h2=h.redSqr(),h3=h2.redMul(h),v=u1.redMul(h2),nx=r.redSqr().redIAdd(h3).redISub(v).redISub(v),ny=r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)),nz=this.z.redMul(h);return this.curve.jpoint(nx,ny,nz)},JPoint.prototype.dblp=function(pow){if(0===pow)return this;if(this.isInfinity())return this;if(!pow)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var r=this,i=0;i=0)return!1;if(rx.redIAdd(t),0===this.x.cmp(rx))return!0}return!1},JPoint.prototype.inspect=function(){return this.isInfinity()?"":""},JPoint.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(module,exports,__webpack_require__){"use strict";function PresetCurve(options){"short"===options.type?this.curve=new elliptic.curve.short(options):"edwards"===options.type?this.curve=new elliptic.curve.edwards(options):this.curve=new elliptic.curve.mont(options),this.g=this.curve.g,this.n=this.curve.n,this.hash=options.hash,assert(this.g.validate(),"Invalid curve"),assert(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function defineCurve(name,options){Object.defineProperty(curves,name,{configurable:!0,enumerable:!0,get:function(){var curve=new PresetCurve(options);return Object.defineProperty(curves,name,{configurable:!0,enumerable:!0,value:curve}),curve}})}var curves=exports,hash=__webpack_require__(48),elliptic=__webpack_require__(27),assert=elliptic.utils.assert;curves.PresetCurve=PresetCurve,defineCurve("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:hash.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),defineCurve("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:hash.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),defineCurve("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:hash.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),defineCurve("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:hash.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),defineCurve("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:hash.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),defineCurve("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hash.sha256,gRed:!1,g:["9"]}),defineCurve("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hash.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var pre;try{pre=__webpack_require__(413)}catch(e){pre=void 0}defineCurve("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:hash.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",pre]})},function(module,exports,__webpack_require__){"use strict";function EC(options){if(!(this instanceof EC))return new EC(options);"string"==typeof options&&(assert(elliptic.curves.hasOwnProperty(options),"Unknown curve "+options),options=elliptic.curves[options]),options instanceof elliptic.curves.PresetCurve&&(options={curve:options}),this.curve=options.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=options.curve.g,this.g.precompute(options.curve.n.bitLength()+1),this.hash=options.hash||options.curve.hash}var BN=__webpack_require__(20),HmacDRBG=__webpack_require__(437),elliptic=__webpack_require__(27),utils=elliptic.utils,assert=utils.assert,KeyPair=__webpack_require__(408),Signature=__webpack_require__(409);module.exports=EC,EC.prototype.keyPair=function(options){return new KeyPair(this,options)},EC.prototype.keyFromPrivate=function(priv,enc){return KeyPair.fromPrivate(this,priv,enc)},EC.prototype.keyFromPublic=function(pub,enc){return KeyPair.fromPublic(this,pub,enc)},EC.prototype.genKeyPair=function(options){options||(options={});for(var drbg=new HmacDRBG({hash:this.hash,pers:options.pers,persEnc:options.persEnc||"utf8",entropy:options.entropy||elliptic.rand(this.hash.hmacStrength),entropyEnc:options.entropy&&options.entropyEnc||"utf8",nonce:this.n.toArray()}),bytes=this.n.byteLength(),ns2=this.n.sub(new BN(2));;){var priv=new BN(drbg.generate(bytes));if(!(priv.cmp(ns2)>0))return priv.iaddn(1),this.keyFromPrivate(priv)}},EC.prototype._truncateToN=function(msg,truncOnly){var delta=8*msg.byteLength()-this.n.bitLength();return delta>0&&(msg=msg.ushrn(delta)),!truncOnly&&msg.cmp(this.n)>=0?msg.sub(this.n):msg},EC.prototype.sign=function(msg,key,enc,options){"object"==typeof enc&&(options=enc,enc=null),options||(options={}),key=this.keyFromPrivate(key,enc),msg=this._truncateToN(new BN(msg,16));for(var bytes=this.n.byteLength(),bkey=key.getPrivate().toArray("be",bytes),nonce=msg.toArray("be",bytes),drbg=new HmacDRBG({hash:this.hash,entropy:bkey,nonce:nonce,pers:options.pers,persEnc:options.persEnc||"utf8"}),ns1=this.n.sub(new BN(1)),iter=0;!0;iter++){var k=options.k?options.k(iter):new BN(drbg.generate(this.n.byteLength()));if(k=this._truncateToN(k,!0),!(k.cmpn(1)<=0||k.cmp(ns1)>=0)){var kp=this.g.mul(k);if(!kp.isInfinity()){var kpX=kp.getX(),r=kpX.umod(this.n);if(0!==r.cmpn(0)){var s=k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));if(s=s.umod(this.n),0!==s.cmpn(0)){var recoveryParam=(kp.getY().isOdd()?1:0)|(0!==kpX.cmp(r)?2:0);return options.canonical&&s.cmp(this.nh)>0&&(s=this.n.sub(s),recoveryParam^=1),new Signature({r:r,s:s,recoveryParam:recoveryParam})}}}}}},EC.prototype.verify=function(msg,signature,key,enc){msg=this._truncateToN(new BN(msg,16)),key=this.keyFromPublic(key,enc),signature=new Signature(signature,"hex");var r=signature.r,s=signature.s;if(r.cmpn(1)<0||r.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var sinv=s.invm(this.n),u1=sinv.mul(msg).umod(this.n),u2=sinv.mul(r).umod(this.n);if(!this.curve._maxwellTrick){var p=this.g.mulAdd(u1,key.getPublic(),u2);return!p.isInfinity()&&0===p.getX().umod(this.n).cmp(r)}var p=this.g.jmulAdd(u1,key.getPublic(),u2);return!p.isInfinity()&&p.eqXToP(r)},EC.prototype.recoverPubKey=function(msg,signature,j,enc){assert((3&j)===j,"The recovery param is more than two bits"),signature=new Signature(signature,enc);var n=this.n,e=new BN(msg),r=signature.r,s=signature.s,isYOdd=1&j,isSecondKey=j>>1;if(r.cmp(this.curve.p.umod(this.curve.n))>=0&&isSecondKey)throw new Error("Unable to find sencond key candinate");r=isSecondKey?this.curve.pointFromX(r.add(this.curve.n),isYOdd):this.curve.pointFromX(r,isYOdd);var rInv=signature.r.invm(n),s1=n.sub(e).mul(rInv).umod(n),s2=s.mul(rInv).umod(n);return this.g.mulAdd(s1,r,s2)},EC.prototype.getKeyRecoveryParam=function(e,signature,Q,enc){if(signature=new Signature(signature,enc),null!==signature.recoveryParam)return signature.recoveryParam;for(var i=0;i<4;i++){var Qprime;try{Qprime=this.recoverPubKey(e,signature,i)}catch(e){continue}if(Qprime.eq(Q))return i}throw new Error("Unable to find valid recovery factor")}},function(module,exports,__webpack_require__){"use strict";function KeyPair(ec,options){this.ec=ec,this.priv=null,this.pub=null,options.priv&&this._importPrivate(options.priv,options.privEnc),options.pub&&this._importPublic(options.pub,options.pubEnc)}var BN=__webpack_require__(20),elliptic=__webpack_require__(27),utils=elliptic.utils,assert=utils.assert;module.exports=KeyPair,KeyPair.fromPublic=function(ec,pub,enc){return pub instanceof KeyPair?pub:new KeyPair(ec,{pub:pub,pubEnc:enc})},KeyPair.fromPrivate=function(ec,priv,enc){return priv instanceof KeyPair?priv:new KeyPair(ec,{priv:priv,privEnc:enc})},KeyPair.prototype.validate=function(){var pub=this.getPublic();return pub.isInfinity()?{result:!1,reason:"Invalid public key"}:pub.validate()?pub.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},KeyPair.prototype.getPublic=function(compact,enc){return"string"==typeof compact&&(enc=compact,compact=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),enc?this.pub.encode(enc,compact):this.pub},KeyPair.prototype.getPrivate=function(enc){return"hex"===enc?this.priv.toString(16,2):this.priv},KeyPair.prototype._importPrivate=function(key,enc){this.priv=new BN(key,enc||16),this.priv=this.priv.umod(this.ec.curve.n)},KeyPair.prototype._importPublic=function(key,enc){if(key.x||key.y)return"mont"===this.ec.curve.type?assert(key.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||assert(key.x&&key.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(key.x,key.y));this.pub=this.ec.curve.decodePoint(key,enc)},KeyPair.prototype.derive=function(pub){return pub.mul(this.priv).getX()},KeyPair.prototype.sign=function(msg,enc,options){return this.ec.sign(msg,this,enc,options)},KeyPair.prototype.verify=function(msg,signature){return this.ec.verify(msg,signature,this)},KeyPair.prototype.inspect=function(){return""}},function(module,exports,__webpack_require__){"use strict";function Signature(options,enc){if(options instanceof Signature)return options;this._importDER(options,enc)||(assert(options.r&&options.s,"Signature without r or s"),this.r=new BN(options.r,16),this.s=new BN(options.s,16),void 0===options.recoveryParam?this.recoveryParam=null:this.recoveryParam=options.recoveryParam)}function Position(){this.place=0}function getLength(buf,p){var initial=buf[p.place++];if(!(128&initial))return initial;for(var octetLen=15&initial,val=0,i=0,off=p.place;i>>3);for(arr.push(128|octets);--octets;)arr.push(len>>>(octets<<3)&255);arr.push(len)}var BN=__webpack_require__(20),elliptic=__webpack_require__(27),utils=elliptic.utils,assert=utils.assert;module.exports=Signature,Signature.prototype._importDER=function(data,enc){data=utils.toArray(data,enc);var p=new Position;if(48!==data[p.place++])return!1;if(getLength(data,p)+p.place!==data.length)return!1;if(2!==data[p.place++])return!1;var rlen=getLength(data,p),r=data.slice(p.place,rlen+p.place);if(p.place+=rlen,2!==data[p.place++])return!1;var slen=getLength(data,p);if(data.length!==slen+p.place)return!1;var s=data.slice(p.place,slen+p.place);return 0===r[0]&&128&r[1]&&(r=r.slice(1)),0===s[0]&&128&s[1]&&(s=s.slice(1)),this.r=new BN(r),this.s=new BN(s),this.recoveryParam=null,!0},Signature.prototype.toDER=function(enc){var r=this.r.toArray(),s=this.s.toArray();for(128&r[0]&&(r=[0].concat(r)),128&s[0]&&(s=[0].concat(s)),r=rmPadding(r),s=rmPadding(s);!(s[0]||128&s[1]);)s=s.slice(1);var arr=[2];constructLength(arr,r.length),arr=arr.concat(r),arr.push(2),constructLength(arr,s.length);var backHalf=arr.concat(s),res=[48];return constructLength(res,backHalf.length),res=res.concat(backHalf),utils.encode(res,enc)}},function(module,exports,__webpack_require__){"use strict";function EDDSA(curve){if(assert("ed25519"===curve,"only tested with ed25519 so far"),!(this instanceof EDDSA))return new EDDSA(curve);var curve=elliptic.curves[curve].curve;this.curve=curve,this.g=curve.g,this.g.precompute(curve.n.bitLength()+1),this.pointClass=curve.point().constructor,this.encodingLength=Math.ceil(curve.n.bitLength()/8),this.hash=hash.sha512}var hash=__webpack_require__(48),elliptic=__webpack_require__(27),utils=elliptic.utils,assert=utils.assert,parseBytes=utils.parseBytes,KeyPair=__webpack_require__(411),Signature=__webpack_require__(412);module.exports=EDDSA,EDDSA.prototype.sign=function(message,secret){message=parseBytes(message);var key=this.keyFromSecret(secret),r=this.hashInt(key.messagePrefix(),message),R=this.g.mul(r),Rencoded=this.encodePoint(R),s_=this.hashInt(Rencoded,key.pubBytes(),message).mul(key.priv()),S=r.add(s_).umod(this.curve.n);return this.makeSignature({R:R,S:S,Rencoded:Rencoded})},EDDSA.prototype.verify=function(message,sig,pub){ +message=parseBytes(message),sig=this.makeSignature(sig);var key=this.keyFromPublic(pub),h=this.hashInt(sig.Rencoded(),key.pubBytes(),message),SG=this.g.mul(sig.S());return sig.R().add(key.pub().mul(h)).eq(SG)},EDDSA.prototype.hashInt=function(){for(var hash=this.hash(),i=0;i=0;){var z;if(k.isOdd()){var mod=k.andln(ws-1);z=mod>(ws>>1)-1?(ws>>1)-mod:mod,k.isubn(z)}else z=0;naf.push(z);for(var shift=0!==k.cmpn(0)&&0===k.andln(ws-1)?w+1:1,i=1;i0||k2.cmpn(-d2)>0;){var m14=k1.andln(3)+d1&3,m24=k2.andln(3)+d2&3;3===m14&&(m14=-1),3===m24&&(m24=-1);var u1;if(0==(1&m14))u1=0;else{var m8=k1.andln(7)+d1&7;u1=3!==m8&&5!==m8||2!==m24?m14:-m14}jsf[0].push(u1);var u2;if(0==(1&m24))u2=0;else{var m8=k2.andln(7)+d2&7;u2=3!==m8&&5!==m8||2!==m14?m24:-m24}jsf[1].push(u2),2*d1===u1+1&&(d1=1-d1),2*d2===u2+1&&(d2=1-d2),k1.iushrn(1),k2.iushrn(1)}return jsf}function cachedProperty(obj,name,computer){var key="_"+name;obj.prototype[name]=function(){return void 0!==this[key]?this[key]:this[key]=computer.call(this)}}function parseBytes(bytes){return"string"==typeof bytes?utils.toArray(bytes,"hex"):bytes}function intFromLE(bytes){return new BN(bytes,"hex","le")}var utils=exports,BN=__webpack_require__(20),minAssert=__webpack_require__(111),minUtils=__webpack_require__(277);utils.assert=minAssert,utils.toArray=minUtils.toArray,utils.zero2=minUtils.zero2,utils.toHex=minUtils.toHex,utils.encode=minUtils.encode,utils.getNAF=getNAF,utils.getJSF=getJSF,utils.cachedProperty=cachedProperty, +utils.parseBytes=parseBytes,utils.intFromLE=intFromLE},function(module,exports,__webpack_require__){var once=__webpack_require__(82),noop=function(){},isRequest=function(stream){return stream.setHeader&&"function"==typeof stream.abort},isChildProcess=function(stream){return stream.stdio&&Array.isArray(stream.stdio)&&3===stream.stdio.length},eos=function(stream,opts,callback){if("function"==typeof opts)return eos(stream,null,opts);opts||(opts={}),callback=once(callback||noop);var ws=stream._writableState,rs=stream._readableState,readable=opts.readable||opts.readable!==!1&&stream.readable,writable=opts.writable||opts.writable!==!1&&stream.writable,onlegacyfinish=function(){stream.writable||onfinish()},onfinish=function(){writable=!1,readable||callback.call(stream)},onend=function(){readable=!1,writable||callback.call(stream)},onexit=function(exitCode){callback.call(stream,exitCode?new Error("exited with error code: "+exitCode):null)},onclose=function(){return(!readable||rs&&rs.ended)&&(!writable||ws&&ws.ended)?void 0:callback.call(stream,new Error("premature close"))},onrequest=function(){stream.req.on("finish",onfinish)};return isRequest(stream)?(stream.on("complete",onfinish),stream.on("abort",onclose),stream.req?onrequest():stream.on("request",onrequest)):writable&&!ws&&(stream.on("end",onlegacyfinish),stream.on("close",onlegacyfinish)),isChildProcess(stream)&&stream.on("exit",onexit),stream.on("end",onend),stream.on("finish",onfinish),opts.error!==!1&&stream.on("error",callback),stream.on("close",onclose),function(){stream.removeListener("complete",onfinish),stream.removeListener("abort",onclose),stream.removeListener("request",onrequest),stream.req&&stream.req.removeListener("finish",onfinish),stream.removeListener("end",onlegacyfinish),stream.removeListener("close",onlegacyfinish),stream.removeListener("finish",onfinish),stream.removeListener("exit",onexit),stream.removeListener("end",onend),stream.removeListener("error",callback),stream.removeListener("close",onclose)}};module.exports=eos},function(module,exports,__webpack_require__){function init(type,message,cause){prr(this,{type:type,name:type,cause:"string"!=typeof message?message:cause,message:message&&"string"!=typeof message?message.message:message},"ewr")}function CustomError(message,cause){Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,arguments.callee),init.call(this,"CustomError",message,cause)}function createError(errno,type,proto){var err=function(message,cause){init.call(this,type,message,cause),"FilesystemError"==type&&(this.code=this.cause.code,this.path=this.cause.path,this.errno=this.cause.errno,this.message=(errno.errno[this.cause.errno]?errno.errno[this.cause.errno].description:this.cause.message)+(this.cause.path?" ["+this.cause.path+"]":"")),Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,arguments.callee)};return err.prototype=proto?new proto:new CustomError,err}var prr=__webpack_require__(418);CustomError.prototype=new Error,module.exports=function(errno){var ce=function(type,proto){return createError(errno,type,proto)};return{CustomError:CustomError,FilesystemError:ce("FilesystemError"),createError:ce}}},function(module,exports,__webpack_require__){var all=module.exports.all=[{errno:-2,code:"ENOENT",description:"no such file or directory"},{errno:-1,code:"UNKNOWN",description:"unknown error"},{errno:0,code:"OK",description:"success"},{errno:1,code:"EOF",description:"end of file"},{errno:2,code:"EADDRINFO",description:"getaddrinfo error"},{errno:3,code:"EACCES",description:"permission denied"},{errno:4,code:"EAGAIN",description:"resource temporarily unavailable"},{errno:5,code:"EADDRINUSE",description:"address already in use"},{errno:6,code:"EADDRNOTAVAIL",description:"address not available"},{errno:7,code:"EAFNOSUPPORT",description:"address family not supported"},{errno:8,code:"EALREADY",description:"connection already in progress"},{errno:9,code:"EBADF",description:"bad file descriptor"},{errno:10,code:"EBUSY",description:"resource busy or locked"},{errno:11,code:"ECONNABORTED",description:"software caused connection abort"},{errno:12,code:"ECONNREFUSED",description:"connection refused"},{errno:13,code:"ECONNRESET",description:"connection reset by peer"},{errno:14,code:"EDESTADDRREQ",description:"destination address required"},{errno:15,code:"EFAULT",description:"bad address in system call argument"},{errno:16,code:"EHOSTUNREACH",description:"host is unreachable"},{errno:17,code:"EINTR",description:"interrupted system call"},{errno:18,code:"EINVAL",description:"invalid argument"},{errno:19,code:"EISCONN",description:"socket is already connected"},{errno:20,code:"EMFILE",description:"too many open files"},{errno:21,code:"EMSGSIZE",description:"message too long"},{errno:22,code:"ENETDOWN",description:"network is down"},{errno:23,code:"ENETUNREACH",description:"network is unreachable"},{errno:24,code:"ENFILE",description:"file table overflow"},{errno:25,code:"ENOBUFS",description:"no buffer space available"},{errno:26,code:"ENOMEM",description:"not enough memory"},{errno:27,code:"ENOTDIR",description:"not a directory"},{errno:28,code:"EISDIR",description:"illegal operation on a directory"},{errno:29,code:"ENONET",description:"machine is not on the network"},{errno:31,code:"ENOTCONN",description:"socket is not connected"},{errno:32,code:"ENOTSOCK",description:"socket operation on non-socket"},{errno:33,code:"ENOTSUP",description:"operation not supported on socket"},{errno:34,code:"ENOENT",description:"no such file or directory"},{errno:35,code:"ENOSYS",description:"function not implemented"},{errno:36,code:"EPIPE",description:"broken pipe"},{errno:37,code:"EPROTO",description:"protocol error"},{errno:38,code:"EPROTONOSUPPORT",description:"protocol not supported"},{errno:39,code:"EPROTOTYPE",description:"protocol wrong type for socket"},{errno:40,code:"ETIMEDOUT",description:"connection timed out"},{errno:41,code:"ECHARSET",description:"invalid Unicode character"},{errno:42,code:"EAIFAMNOSUPPORT",description:"address family for hostname not supported"},{errno:44,code:"EAISERVICE",description:"servname not supported for ai_socktype"},{errno:45,code:"EAISOCKTYPE",description:"ai_socktype not supported"},{errno:46,code:"ESHUTDOWN",description:"cannot send after transport endpoint shutdown"},{errno:47,code:"EEXIST",description:"file already exists"},{errno:48,code:"ESRCH",description:"no such process"},{errno:49,code:"ENAMETOOLONG",description:"name too long"},{errno:50,code:"EPERM",description:"operation not permitted"},{errno:51,code:"ELOOP",description:"too many symbolic links encountered"},{errno:52,code:"EXDEV",description:"cross-device link not permitted"},{errno:53,code:"ENOTEMPTY",description:"directory not empty"},{errno:54,code:"ENOSPC",description:"no space left on device"},{errno:55,code:"EIO",description:"i/o error"},{errno:56,code:"EROFS",description:"read-only file system"},{errno:57,code:"ENODEV",description:"no such device"},{errno:58,code:"ESPIPE",description:"invalid seek"},{errno:59,code:"ECANCELED",description:"operation canceled"}];module.exports.errno={},module.exports.code={},all.forEach(function(error){module.exports.errno[error.errno]=error,module.exports.code[error.code]=error}),module.exports.custom=__webpack_require__(416)(module.exports),module.exports.create=module.exports.custom.createError},function(module,exports){!function(name,context,definition){void 0!==module&&module.exports?module.exports=definition():context.prr=definition()}(0,this,function(){var setProperty="function"==typeof Object.defineProperty?function(obj,key,options){return Object.defineProperty(obj,key,options),obj}:function(obj,key,options){return obj[key]=options.value,obj},makeOptions=function(value,options){var oo="object"==typeof options,os=!oo&&"string"==typeof options,op=function(p){return oo?!!options[p]:!!os&&options.indexOf(p[0])>-1};return{enumerable:op("enumerable"),configurable:op("configurable"),writable:op("writable"),value:value}};return function(obj,key,value,options){var k;if(options=makeOptions(value,options),"object"==typeof key){for(k in key)Object.hasOwnProperty.call(key,k)&&(options.value=key[k],setProperty(obj,k,options));return obj}return setProperty(obj,key,options)}})},function(module,exports,__webpack_require__){(function(Buffer){const ethUtil=__webpack_require__(420),rlp=__webpack_require__(52);var Account=module.exports=function(data){var fields=[{name:"nonce",default:new Buffer([])},{name:"balance",default:new Buffer([])},{name:"stateRoot",length:32,default:ethUtil.SHA3_RLP},{name:"codeHash",length:32,default:ethUtil.SHA3_NULL}];ethUtil.defineProperties(this,fields,data)};Account.prototype.serialize=function(){return rlp.encode(this.raw)},Account.prototype.isContract=function(){return this.codeHash.toString("hex")!==ethUtil.SHA3_NULL_S},Account.prototype.getCode=function(state,cb){if(!this.isContract())return void cb(null,new Buffer([]));state.getRaw(this.codeHash,cb)},Account.prototype.setCode=function(trie,code,cb){var self=this;if(this.codeHash=ethUtil.sha3(code),this.codeHash.toString("hex")===ethUtil.SHA3_NULL_S)return void cb(null,new Buffer([]));trie.putRaw(this.codeHash,code,function(err){cb(err,self.codeHash)})},Account.prototype.getStorage=function(trie,key,cb){var t=trie.copy();t.root=this.stateRoot,t.get(key,cb)},Account.prototype.setStorage=function(trie,key,val,cb){var self=this,t=trie.copy();t.root=self.stateRoot,t.put(key,val,function(err){if(err)return cb();self.stateRoot=t.root,cb()})},Account.prototype.isEmpty=function(){return""===this.balance.toString("hex")&&""===this.nonce.toString("hex")&&this.stateRoot.toString("hex")===ethUtil.SHA3_RLP_S&&this.codeHash.toString("hex")===ethUtil.SHA3_NULL_S}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){const SHA3=__webpack_require__(241),secp256k1=__webpack_require__(162),assert=__webpack_require__(7),rlp=__webpack_require__(52),BN=__webpack_require__(20),createHash=__webpack_require__(75);exports.MAX_INTEGER=new BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),exports.TWO_POW256=new BN("10000000000000000000000000000000000000000000000000000000000000000",16),exports.SHA3_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",exports.SHA3_NULL=new Buffer(exports.SHA3_NULL_S,"hex"),exports.SHA3_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",exports.SHA3_RLP_ARRAY=new Buffer(exports.SHA3_RLP_ARRAY_S,"hex"),exports.SHA3_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",exports.SHA3_RLP=new Buffer(exports.SHA3_RLP_S,"hex"),exports.BN=BN,exports.rlp=rlp,exports.secp256k1=secp256k1,exports.zeros=function(bytes){var buf=new Buffer(bytes);return buf.fill(0),buf},exports.setLengthLeft=exports.setLength=function(msg,length,right){var buf=exports.zeros(length);return msg=exports.toBuffer(msg),right?msg.length0&&"0"===first.toString();)a=a.slice(1),first=a[0];return a},exports.toBuffer=function(v){if(!Buffer.isBuffer(v))if(Array.isArray(v))v=new Buffer(v);else if("string"==typeof v)v=exports.isHexPrefixed(v)?new Buffer(exports.padToEven(exports.stripHexPrefix(v)),"hex"):new Buffer(v);else if("number"==typeof v)v=exports.intToBuffer(v);else if(null===v||void 0===v)v=new Buffer([]);else{if(!v.toArray)throw new Error("invalid type");v=new Buffer(v.toArray())}return v},exports.intToHex=function(i){assert(i%1==0,"number is not a integer"),assert(i>=0,"number must be positive");var hex=i.toString(16);return hex.length%2&&(hex="0"+hex),"0x"+hex},exports.intToBuffer=function(i){return new Buffer(exports.intToHex(i).slice(2),"hex")},exports.bufferToInt=function(buf){return parseInt(exports.bufferToHex(buf),16)},exports.bufferToHex=function(buf){return buf=exports.toBuffer(buf),0===buf.length?0:"0x"+buf.toString("hex")},exports.fromSigned=function(num){return new BN(num).fromTwos(256)},exports.toUnsigned=function(num){return new Buffer(num.toTwos(256).toArray())},exports.sha3=function(a,bytes){a=exports.toBuffer(a),bytes||(bytes=256);var h=new SHA3(bytes);return a&&h.update(a),new Buffer(h.digest("hex"),"hex")},exports.sha256=function(a){return a=exports.toBuffer(a),createHash("sha256").update(a).digest()},exports.ripemd160=function(a,padded){a=exports.toBuffer(a);var hash=createHash("rmd160").update(a).digest();return padded===!0?exports.setLength(hash,32):hash},exports.rlphash=function(a){return exports.sha3(rlp.encode(a))},exports.isValidPrivate=function(privateKey){return secp256k1.privateKeyVerify(privateKey)},exports.isValidPublic=function(publicKey,sanitize){return 64===publicKey.length?secp256k1.publicKeyVerify(Buffer.concat([new Buffer([4]),publicKey])):!!sanitize&&secp256k1.publicKeyVerify(publicKey)},exports.pubToAddress=exports.publicToAddress=function(pubKey,sanitize){return pubKey=exports.toBuffer(pubKey),sanitize&&64!==pubKey.length&&(pubKey=secp256k1.publicKeyConvert(pubKey,!1).slice(1)),assert(64===pubKey.length),exports.sha3(pubKey).slice(-20)};var privateToPublic=exports.privateToPublic=function(privateKey){return privateKey=exports.toBuffer(privateKey),secp256k1.publicKeyCreate(privateKey,!1).slice(1)};exports.importPublic=function(publicKey){return publicKey=exports.toBuffer(publicKey),64!==publicKey.length&&(publicKey=secp256k1.publicKeyConvert(publicKey,!1).slice(1)),publicKey},exports.ecsign=function(msgHash,privateKey){var sig=secp256k1.sign(msgHash,privateKey),ret={};return ret.r=sig.signature.slice(0,32),ret.s=sig.signature.slice(32,64),ret.v=sig.recovery+27,ret},exports.ecrecover=function(msgHash,v,r,s){var signature=Buffer.concat([exports.setLength(r,32),exports.setLength(s,32)],64),recovery=exports.bufferToInt(v)-27;if(0!==recovery&&1!==recovery)throw new Error("Invalid signature v value");var senderPubKey=secp256k1.recover(msgHash,signature,recovery);return secp256k1.publicKeyConvert(senderPubKey,!1).slice(1)},exports.toRpcSig=function(v,r,s){return exports.bufferToHex(Buffer.concat([r,s,exports.toBuffer(v-27)]))},exports.fromRpcSig=function(sig){sig=exports.toBuffer(sig);var v=sig[64];return v<27&&(v+=27),{v:v,r:sig.slice(0,32),s:sig.slice(32,64)}},exports.privateToAddress=function(privateKey){return exports.publicToAddress(privateToPublic(privateKey))},exports.isValidAddress=function(address){return/^0x[0-9a-fA-F]{40}$/i.test(address)},exports.toChecksumAddress=function(address){address=exports.stripHexPrefix(address).toLowerCase();for(var hash=exports.sha3(address).toString("hex"),ret="0x",i=0;i=8?address[i].toUpperCase():address[i];return ret},exports.isValidChecksumAddress=function(address){return exports.isValidAddress(address)&&exports.toChecksumAddress(address)===address},exports.generateAddress=function(from,nonce){return from=exports.toBuffer(from),nonce=new BN(nonce),nonce=nonce.isZero()?null:new Buffer(nonce.toArray()),exports.rlphash([from,nonce]).slice(-20)},exports.isPrecompiled=function(address){var a=exports.unpad(address);return 1===a.length&&a[0]>0&&a[0]<5},exports.isHexPrefixed=function(str){return"0x"===str.slice(0,2)},exports.stripHexPrefix=function(str){return"string"!=typeof str?str:exports.isHexPrefixed(str)?str.slice(2):str},exports.addHexPrefix=function(str){return"string"!=typeof str?str:exports.isHexPrefixed(str)?str:"0x"+str},exports.padToEven=function(a){return a.length%2&&(a="0"+a),a},exports.baToJSON=function(ba){if(Buffer.isBuffer(ba))return"0x"+ba.toString("hex");if(ba instanceof Array){for(var array=[],i=0;i=v.length,"The field "+field.name+" must not have more "+field.length+" bytes")):field.allowZero&&0===v.length||!field.length||assert(field.length===v.length,"The field "+field.name+" must have byte length of "+field.length),self.raw[i]=v}self._fields.push(field.name),Object.defineProperty(self,field.name,{enumerable:!0,configurable:!0,get:getter,set:setter}),field.default&&(self[field.name]=field.default),field.alias&&Object.defineProperty(self,field.alias,{enumerable:!1,configurable:!0,set:setter,get:getter})}),data)if("string"==typeof data&&(data=new Buffer(exports.stripHexPrefix(data),"hex")),Buffer.isBuffer(data)&&(data=rlp.decode(data)),Array.isArray(data)){if(data.length>self._fields.length)throw new Error("wrong number of fields in data");data.forEach(function(d,i){self[self._fields[i]]=exports.toBuffer(d)})}else{if("object"!=typeof data)throw new Error("invalid data");for(var prop in data)self._fields.indexOf(prop)!==-1&&(self[prop]=data[prop])}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const ethUtil=__webpack_require__(210),fees=__webpack_require__(238),BN=ethUtil.BN,N_DIV_2=new BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16);class Transaction{constructor(data){data=data||{};const fields=[{name:"nonce",length:32,allowLess:!0,default:new Buffer([])},{name:"gasPrice",length:32,allowLess:!0,default:new Buffer([])},{name:"gasLimit",alias:"gas",length:32,allowLess:!0,default:new Buffer([])},{name:"to",allowZero:!0,length:20,default:new Buffer([])},{name:"value",length:32,allowLess:!0,default:new Buffer([])},{name:"data",alias:"input",allowZero:!0,default:new Buffer([])},{name:"v",default:new Buffer([28])},{name:"r",length:32,allowLess:!0,default:new Buffer([])},{name:"s",length:32,allowLess:!0,default:new Buffer([])}];ethUtil.defineProperties(this,fields,data),Object.defineProperty(this,"from",{enumerable:!0,configurable:!0,get:this.getSenderAddress.bind(this)});let sigV=ethUtil.bufferToInt(this.v),chainId=Math.floor((sigV-35)/2);chainId<0&&(chainId=0),this._chainId=chainId||data.chainId||0,this._homestead=!0}toCreationAddress(){return""===this.to.toString("hex")}hash(includeSignature){void 0===includeSignature&&(includeSignature=!0);let items;if(includeSignature)items=this.raw;else if(this._chainId>0){const raw=this.raw.slice();this.v=this._chainId,this.r=0,this.s=0,items=this.raw,this.raw=raw}else items=this.raw.slice(0,6);return ethUtil.rlphash(items)}getChainId(){return this._chainId}getSenderAddress(){if(this._from)return this._from;const pubkey=this.getSenderPublicKey();return this._from=ethUtil.publicToAddress(pubkey),this._from}getSenderPublicKey(){if(!(this._senderPubKey&&this._senderPubKey.length||this.verifySignature()))throw new Error("Invalid Signature");return this._senderPubKey}verifySignature(){const msgHash=this.hash(!1);if(this._homestead&&1===new BN(this.s).cmp(N_DIV_2))return!1;try{let v=ethUtil.bufferToInt(this.v);this._chainId>0&&(v-=2*this._chainId+8),this._senderPubKey=ethUtil.ecrecover(msgHash,v,this.r,this.s)}catch(e){return!1}return!!this._senderPubKey}sign(privateKey){const msgHash=this.hash(!1),sig=ethUtil.ecsign(msgHash,privateKey);this._chainId>0&&(sig.v+=2*this._chainId+8),Object.assign(this,sig)}getDataFee(){const data=this.raw[5],cost=new BN(0);for(let i=0;i0&&errors.push([`gas limit is too low. Need at least ${this.getBaseFee()}`]),void 0===stringError||stringError===!1?0===errors.length:errors.join(" ")}}module.exports=Transaction}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function padToEven(value){var a=value;if("string"!=typeof a)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof a+", while padToEven.");return a.length%2&&(a="0"+a),a}function intToHex(i){return"0x"+padToEven(i.toString(16))}function intToBuffer(i){return new Buffer(intToHex(i).slice(2),"hex")}function getBinarySize(str){if("string"!=typeof str)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof str+"'.");return Buffer.byteLength(str,"utf8")}function arrayContainsArray(superset,subset,some){if(Array.isArray(superset)!==!0)throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof superset+"'");if(Array.isArray(subset)!==!0)throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof subset+"'");return subset[Boolean(some)&&"some"||"every"](function(value){return superset.indexOf(value)>=0})}function toUtf8(hex){return new Buffer(padToEven(stripHexPrefix(hex).replace(/^0+|0+$/g,"")),"hex").toString("utf8")}function toAscii(hex){var str="",i=0,l=hex.length;for("0x"===hex.substring(0,2)&&(i=2);i "+str;return emitter.emit("error",err)}const leaveEv=emit._state+":leave",enterEv=nwState+":enter";return emit._state?function(){emitter._events[leaveEv]?emitter.emit(leaveEv,enter):enter()}():enter()}"object"==typeof start&&(events=start,start="START"),assert.equal(typeof start,"string"),assert.equal(typeof events,"object"),assert.ok(events[start],"invalid starting state "+start),assert.ok(fsm.validate(events));const emitter=new EventEmitter;return emit._graph=fsm.reachable(events),emit._emitter=emitter,emit._events=events,emit._state=start,emit.emit=emit,emit.on=on,emit}function reach(curr,next,reachable){if(!next)return!1;if(!curr)return!0;const here=reachable[curr];return!(!here||!here[next])&&1===here[next].length}const EventEmitter=__webpack_require__(8).EventEmitter,assert=__webpack_require__(7),fsm=__webpack_require__(424);module.exports=fsmEvent},function(module,exports){function each(obj,iter){for(var key in obj){iter(obj[key],key,obj)}}function keys(obj){return Object.keys(obj).sort()}function contains(a,v){return~a.indexOf(v)}function union(a,b){return a.filter(function(v){return contains(b,v)})}function disunion(a,b){return a.filter(function(v){return!contains(b,v)}).concat(b.filter(function(v){return!contains(a,v)})).sort()}function empty(v){for(var k in v)return!1;return!0}function events(fsm){var events=[];return each(fsm,function(state,name){each(state,function(_state,event){contains(events,event)||events.push(event)})}),events.sort()}var reachable=(exports.validate=function(fsm){Object.keys(fsm);return each(fsm,function(state,name){each(state,function(_state,event){if(!fsm[_state])throw new Error("invalid transition from state:"+name+" to state:"+_state+" on event:"+event)})}),!0},exports.reachable=function(fsm){var reachable={},added=!1;do{added=!1,each(fsm,function(state,name){var reach=reachable[name]=reachable[name]||{};each(state,function(_name,event){reach[_name]||(reach[_name]=[event],added=!0)}),each(state,function(_name,event){each(reachable[_name],function(path,_name){reach[_name]||(reach[_name]=[event].concat(path),added=!0)})})})}while(added);return reachable});exports.terminal=exports.deadlock=function(fsm){var dead=[];return each(fsm,function(state,name){empty(state)&&dead.push(name)}),dead};exports.livelock=function(fsm,terminals){var reach=reachable(fsm),locked=[];return each(reach,function(reaches,name){contains(terminals,name)||each(terminals,function(_name){reaches[_name]||contains(locked,name)||locked.push(name)})}),locked.sort()},exports.combine=function(fsm1,fsm2,start1,start2){function expand(name1,name2){var state,cName=name1+"-"+name2;combined[cName]||(combined[cName]={}),state=combined[cName];var trans1=keys(fsm1[name1]),trans2=keys(fsm2[name2]);return union(trans1,trans2).forEach(function(event){state[event]=fsm1[name1][event]+"-"+fsm2[name2][event],combined[state[event]]||expand(fsm1[name1][event],fsm2[name2][event])}),union(independent,trans1).forEach(function(event){state[event]=fsm1[name1][event]+"-"+name2,combined[state[event]]||expand(fsm1[name1][event],name2)}),union(independent,trans2).forEach(function(event){state[event]=name1+"-"+fsm2[name2][event],combined[state[event]]||expand(name1,fsm2[name2][event])}),combined[cName]}var combined={},events1=events(fsm1),events2=events(fsm2),independent=disunion(events1,events2);return expand(start1,start2),combined}},function(module,exports,__webpack_require__){"use strict";function RBNode(color,key,value,left,right,count){this._color=color,this.key=key,this.value=value,this.left=left,this.right=right,this._count=count}function cloneNode(node){return new RBNode(node._color,node.key,node.value,node.left,node.right,node._count)}function repaint(color,node){return new RBNode(color,node.key,node.value,node.left,node.right,node._count)}function recount(node){node._count=1+(node.left?node.left._count:0)+(node.right?node.right._count:0)}function RedBlackTree(compare,root){this._compare=compare,this.root=root}function doVisitFull(visit,node){if(node.left){var v=doVisitFull(visit,node.left);if(v)return v}var v=visit(node.key,node.value);return v?v:node.right?doVisitFull(visit,node.right):void 0}function doVisitHalf(lo,compare,visit,node){if(compare(lo,node.key)<=0){if(node.left){var v=doVisitHalf(lo,compare,visit,node.left);if(v)return v}var v=visit(node.key,node.value);if(v)return v}if(node.right)return doVisitHalf(lo,compare,visit,node.right)}function doVisit(lo,hi,compare,visit,node){var v,l=compare(lo,node.key),h=compare(hi,node.key);if(l<=0){if(node.left&&(v=doVisit(lo,hi,compare,visit,node.left)))return v;if(h>0&&(v=visit(node.key,node.value)))return v}if(h>0&&node.right)return doVisit(lo,hi,compare,visit,node.right)}function RedBlackTreeIterator(tree,stack){this.tree=tree,this._stack=stack}function swapNode(n,v){n.key=v.key,n.value=v.value,n.left=v.left,n.right=v.right,n._color=v._color,n._count=v._count}function fixDoubleBlack(stack){for(var n,p,s,z,i=stack.length-1;i>=0;--i){if(n=stack[i],0===i)return void(n._color=BLACK);if(p=stack[i-1],p.left===n){if(s=p.right,s.right&&s.right._color===RED){if(s=p.right=cloneNode(s),z=s.right=cloneNode(s.right),p.right=s.left,s.left=p,s.right=z,s._color=p._color,n._color=BLACK,p._color=BLACK,z._color=BLACK,recount(p),recount(s),i>1){var pp=stack[i-2];pp.left===p?pp.left=s:pp.right=s}return void(stack[i-1]=s)}if(s.left&&s.left._color===RED){if(s=p.right=cloneNode(s),z=s.left=cloneNode(s.left),p.right=z.left,s.left=z.right,z.left=p,z.right=s,z._color=p._color,p._color=BLACK,s._color=BLACK,n._color=BLACK,recount(p),recount(s),recount(z),i>1){var pp=stack[i-2];pp.left===p?pp.left=z:pp.right=z}return void(stack[i-1]=z)}if(s._color===BLACK){if(p._color===RED)return p._color=BLACK,void(p.right=repaint(RED,s));p.right=repaint(RED,s);continue}if(s=cloneNode(s),p.right=s.left,s.left=p,s._color=p._color,p._color=RED,recount(p),recount(s),i>1){var pp=stack[i-2];pp.left===p?pp.left=s:pp.right=s}stack[i-1]=s,stack[i]=p,i+11){var pp=stack[i-2];pp.right===p?pp.right=s:pp.left=s}return void(stack[i-1]=s)}if(s.right&&s.right._color===RED){if(s=p.left=cloneNode(s),z=s.right=cloneNode(s.right),p.left=z.right,s.right=z.left,z.right=p,z.left=s,z._color=p._color,p._color=BLACK,s._color=BLACK,n._color=BLACK,recount(p),recount(s),recount(z),i>1){var pp=stack[i-2];pp.right===p?pp.right=z:pp.left=z}return void(stack[i-1]=z)}if(s._color===BLACK){if(p._color===RED)return p._color=BLACK,void(p.left=repaint(RED,s));p.left=repaint(RED,s);continue}if(s=cloneNode(s),p.left=s.right,s.right=p,s._color=p._color,p._color=RED,recount(p),recount(s),i>1){var pp=stack[i-2];pp.right===p?pp.right=s:pp.left=s}stack[i-1]=s,stack[i]=p,i+1b?1:0}function createRBTree(compare){return new RedBlackTree(compare||defaultCompare,null)}module.exports=createRBTree;var RED=0,BLACK=1,proto=RedBlackTree.prototype;Object.defineProperty(proto,"keys",{get:function(){var result=[];return this.forEach(function(k,v){result.push(k)}),result}}),Object.defineProperty(proto,"values",{get:function(){var result=[];return this.forEach(function(k,v){result.push(v)}),result}}),Object.defineProperty(proto,"length",{get:function(){return this.root?this.root._count:0}}),proto.insert=function(key,value){for(var cmp=this._compare,n=this.root,n_stack=[],d_stack=[];n;){var d=cmp(key,n.key);n_stack.push(n),d_stack.push(d),n=d<=0?n.left:n.right}n_stack.push(new RBNode(RED,key,value,null,null,1));for(var s=n_stack.length-2;s>=0;--s){var n=n_stack[s];d_stack[s]<=0?n_stack[s]=new RBNode(n._color,n.key,n.value,n_stack[s+1],n.right,n._count+1):n_stack[s]=new RBNode(n._color,n.key,n.value,n.left,n_stack[s+1],n._count+1)}for(var s=n_stack.length-1;s>1;--s){var p=n_stack[s-1],n=n_stack[s];if(p._color===BLACK||n._color===BLACK)break;var pp=n_stack[s-2];if(pp.left===p)if(p.left===n){var y=pp.right;if(!y||y._color!==RED){if(pp._color=RED, +pp.left=p.right,p._color=BLACK,p.right=pp,n_stack[s-2]=p,n_stack[s-1]=n,recount(pp),recount(p),s>=3){var ppp=n_stack[s-3];ppp.left===pp?ppp.left=p:ppp.right=p}break}p._color=BLACK,pp.right=repaint(BLACK,y),pp._color=RED,s-=1}else{var y=pp.right;if(!y||y._color!==RED){if(p.right=n.left,pp._color=RED,pp.left=n.right,n._color=BLACK,n.left=p,n.right=pp,n_stack[s-2]=n,n_stack[s-1]=p,recount(pp),recount(p),recount(n),s>=3){var ppp=n_stack[s-3];ppp.left===pp?ppp.left=n:ppp.right=n}break}p._color=BLACK,pp.right=repaint(BLACK,y),pp._color=RED,s-=1}else if(p.right===n){var y=pp.left;if(!y||y._color!==RED){if(pp._color=RED,pp.right=p.left,p._color=BLACK,p.left=pp,n_stack[s-2]=p,n_stack[s-1]=n,recount(pp),recount(p),s>=3){var ppp=n_stack[s-3];ppp.right===pp?ppp.right=p:ppp.left=p}break}p._color=BLACK,pp.left=repaint(BLACK,y),pp._color=RED,s-=1}else{var y=pp.left;if(!y||y._color!==RED){if(p.left=n.right,pp._color=RED,pp.right=n.left,n._color=BLACK,n.right=p,n.left=pp,n_stack[s-2]=n,n_stack[s-1]=p,recount(pp),recount(p),recount(n),s>=3){var ppp=n_stack[s-3];ppp.right===pp?ppp.right=n:ppp.left=n}break}p._color=BLACK,pp.left=repaint(BLACK,y),pp._color=RED,s-=1}}return n_stack[0]._color=BLACK,new RedBlackTree(cmp,n_stack[0])},proto.forEach=function(visit,lo,hi){if(this.root)switch(arguments.length){case 1:return doVisitFull(visit,this.root);case 2:return doVisitHalf(lo,this._compare,visit,this.root);case 3:if(this._compare(lo,hi)>=0)return;return doVisit(lo,hi,this._compare,visit,this.root)}},Object.defineProperty(proto,"begin",{get:function(){for(var stack=[],n=this.root;n;)stack.push(n),n=n.left;return new RedBlackTreeIterator(this,stack)}}),Object.defineProperty(proto,"end",{get:function(){for(var stack=[],n=this.root;n;)stack.push(n),n=n.right;return new RedBlackTreeIterator(this,stack)}}),proto.at=function(idx){if(idx<0)return new RedBlackTreeIterator(this,[]);for(var n=this.root,stack=[];;){if(stack.push(n),n.left){if(idx=n.right._count)break;n=n.right}return new RedBlackTreeIterator(this,[])},proto.ge=function(key){for(var cmp=this._compare,n=this.root,stack=[],last_ptr=0;n;){var d=cmp(key,n.key);stack.push(n),d<=0&&(last_ptr=stack.length),n=d<=0?n.left:n.right}return stack.length=last_ptr,new RedBlackTreeIterator(this,stack)},proto.gt=function(key){for(var cmp=this._compare,n=this.root,stack=[],last_ptr=0;n;){var d=cmp(key,n.key);stack.push(n),d<0&&(last_ptr=stack.length),n=d<0?n.left:n.right}return stack.length=last_ptr,new RedBlackTreeIterator(this,stack)},proto.lt=function(key){for(var cmp=this._compare,n=this.root,stack=[],last_ptr=0;n;){var d=cmp(key,n.key);stack.push(n),d>0&&(last_ptr=stack.length),n=d<=0?n.left:n.right}return stack.length=last_ptr,new RedBlackTreeIterator(this,stack)},proto.le=function(key){for(var cmp=this._compare,n=this.root,stack=[],last_ptr=0;n;){var d=cmp(key,n.key);stack.push(n),d>=0&&(last_ptr=stack.length),n=d<0?n.left:n.right}return stack.length=last_ptr,new RedBlackTreeIterator(this,stack)},proto.find=function(key){for(var cmp=this._compare,n=this.root,stack=[];n;){var d=cmp(key,n.key);if(stack.push(n),0===d)return new RedBlackTreeIterator(this,stack);n=d<=0?n.left:n.right}return new RedBlackTreeIterator(this,[])},proto.remove=function(key){var iter=this.find(key);return iter?iter.remove():this},proto.get=function(key){for(var cmp=this._compare,n=this.root;n;){var d=cmp(key,n.key);if(0===d)return n.value;n=d<=0?n.left:n.right}};var iproto=RedBlackTreeIterator.prototype;Object.defineProperty(iproto,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(iproto,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),iproto.clone=function(){return new RedBlackTreeIterator(this.tree,this._stack.slice())},iproto.remove=function(){var stack=this._stack;if(0===stack.length)return this.tree;var cstack=new Array(stack.length),n=stack[stack.length-1];cstack[cstack.length-1]=new RBNode(n._color,n.key,n.value,n.left,n.right,n._count);for(var i=stack.length-2;i>=0;--i){var n=stack[i];n.left===stack[i+1]?cstack[i]=new RBNode(n._color,n.key,n.value,cstack[i+1],n.right,n._count):cstack[i]=new RBNode(n._color,n.key,n.value,n.left,cstack[i+1],n._count)}if(n=cstack[cstack.length-1],n.left&&n.right){var split=cstack.length;for(n=n.left;n.right;)cstack.push(n),n=n.right;var v=cstack[split-1];cstack.push(new RBNode(n._color,v.key,v.value,n.left,n.right,n._count)),cstack[split-1].key=n.key,cstack[split-1].value=n.value;for(var i=cstack.length-2;i>=split;--i)n=cstack[i],cstack[i]=new RBNode(n._color,n.key,n.value,n.left,cstack[i+1],n._count);cstack[split-1].left=cstack[split]}if(n=cstack[cstack.length-1],n._color===RED){var p=cstack[cstack.length-2];p.left===n?p.left=null:p.right===n&&(p.right=null),cstack.pop();for(var i=0;i0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(iproto,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(iproto,"index",{get:function(){var idx=0,stack=this._stack;if(0===stack.length){var r=this.tree.root;return r?r._count:0}stack[stack.length-1].left&&(idx=stack[stack.length-1].left._count);for(var s=stack.length-2;s>=0;--s)stack[s+1]===stack[s].right&&(++idx,stack[s].left&&(idx+=stack[s].left._count));return idx},enumerable:!0}),iproto.next=function(){var stack=this._stack;if(0!==stack.length){var n=stack[stack.length-1];if(n.right)for(n=n.right;n;)stack.push(n),n=n.left;else for(stack.pop();stack.length>0&&stack[stack.length-1].right===n;)n=stack[stack.length-1],stack.pop()}},Object.defineProperty(iproto,"hasNext",{get:function(){var stack=this._stack;if(0===stack.length)return!1;if(stack[stack.length-1].right)return!0;for(var s=stack.length-1;s>0;--s)if(stack[s-1].left===stack[s])return!0;return!1}}),iproto.update=function(value){var stack=this._stack;if(0===stack.length)throw new Error("Can't update empty node!");var cstack=new Array(stack.length),n=stack[stack.length-1];cstack[cstack.length-1]=new RBNode(n._color,n.key,value,n.left,n.right,n._count);for(var i=stack.length-2;i>=0;--i)n=stack[i],n.left===stack[i+1]?cstack[i]=new RBNode(n._color,n.key,n.value,cstack[i+1],n.right,n._count):cstack[i]=new RBNode(n._color,n.key,n.value,n.left,cstack[i+1],n._count);return new RedBlackTree(this.tree._compare,cstack[0])},iproto.prev=function(){var stack=this._stack;if(0!==stack.length){var n=stack[stack.length-1];if(n.left)for(n=n.left;n;)stack.push(n),n=n.right;else for(stack.pop();stack.length>0&&stack[stack.length-1].left===n;)n=stack[stack.length-1],stack.pop()}},Object.defineProperty(iproto,"hasPrev",{get:function(){var stack=this._stack;if(0===stack.length)return!1;if(stack[stack.length-1].left)return!0;for(var s=stack.length-1;s>0;--s)if(stack[s-1].right===stack[s])return!0;return!1}})},function(module,exports,__webpack_require__){var util=__webpack_require__(10),INDENT_START=/[\{\[]/,INDENT_END=/[\}\]]/;module.exports=function(){var lines=[],indent=0,push=function(str){for(var spaces="";spaces.length<2*indent;)spaces+=" ";lines.push(spaces+str)},line=function(fmt){return fmt?INDENT_END.test(fmt.trim()[0])&&INDENT_START.test(fmt[fmt.length-1])?(indent--,push(util.format.apply(util,arguments)),indent++,line):INDENT_START.test(fmt[fmt.length-1])?(push(util.format.apply(util,arguments)),indent++,line):INDENT_END.test(fmt.trim()[0])?(indent--,push(util.format.apply(util,arguments)),line):(push(util.format.apply(util,arguments)),line):line};return line.toString=function(){return lines.join("\n")},line.toFunction=function(scope){var src="return ("+line.toString()+")",keys=Object.keys(scope||{}).map(function(key){return key}),vals=keys.map(function(key){return scope[key]});return Function.apply(null,keys.concat(src)).apply(null,vals)},arguments.length&&line.apply(null,arguments),line}},function(module,exports,__webpack_require__){var isProperty=__webpack_require__(542),gen=function(obj,prop){return isProperty(prop)?obj+"."+prop:obj+"["+JSON.stringify(prop)+"]"};gen.valid=isProperty,gen.property=function(prop){return isProperty(prop)?prop:JSON.stringify(prop)},module.exports=gen},function(module,exports){module.exports=function(){if("undefined"==typeof window)return null;var wrtc={RTCPeerConnection:window.RTCPeerConnection||window.mozRTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.RTCSessionDescription||window.mozRTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.RTCIceCandidate||window.mozRTCIceCandidate||window.webkitRTCIceCandidate};return wrtc.RTCPeerConnection?wrtc:null}},function(module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return"[object Array]"==toString.call(arr)}},function(module,exports){try{module.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(err){module.exports=!1}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function HashBase(blockSize){Transform.call(this),this._block=new Buffer(blockSize),this._blockSize=blockSize,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}var Transform=__webpack_require__(26).Transform;__webpack_require__(1)(HashBase,Transform),HashBase.prototype._transform=function(chunk,encoding,callback){var error=null;try{"buffer"!==encoding&&(chunk=new Buffer(chunk,encoding)),this.update(chunk)}catch(err){error=err}callback(error)},HashBase.prototype._flush=function(callback){var error=null;try{this.push(this._digest())}catch(err){error=err}callback(error)},HashBase.prototype.update=function(data,encoding){if(!Buffer.isBuffer(data)&&"string"!=typeof data)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");Buffer.isBuffer(data)||(data=new Buffer(data,encoding||"binary"));for(var block=this._block,offset=0;this._blockOffset+data.length-offset>=this._blockSize;){for(var i=this._blockOffset;i0;++j)this._length[j]+=carry,(carry=this._length[j]/4294967296|0)>0&&(this._length[j]-=4294967296*carry);return this},HashBase.prototype._update=function(data){throw new Error("_update is not implemented")},HashBase.prototype.digest=function(encoding){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var digest=this._digest();return void 0!==encoding&&(digest=digest.toString(encoding)),digest},HashBase.prototype._digest=function(){throw new Error("_digest is not implemented")},module.exports=HashBase}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function BlockHash(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var hash=__webpack_require__(48),utils=hash.utils,assert=utils.assert;exports.BlockHash=BlockHash,BlockHash.prototype.update=function(msg,enc){if(msg=utils.toArray(msg,enc),this.pending?this.pending=this.pending.concat(msg):this.pending=msg,this.pendingTotal+=msg.length,this.pending.length>=this._delta8){msg=this.pending;var r=msg.length%this._delta8;this.pending=msg.slice(msg.length-r,msg.length),0===this.pending.length&&(this.pending=null),msg=utils.join32(msg,0,msg.length-r,this.endian);for(var i=0;i>>24&255,res[i++]=len>>>16&255,res[i++]=len>>>8&255,res[i++]=255&len}else{res[i++]=255&len,res[i++]=len>>>8&255,res[i++]=len>>>16&255,res[i++]=len>>>24&255,res[i++]=0,res[i++]=0,res[i++]=0,res[i++]=0;for(var t=8;tthis.blockSize&&(key=(new this.Hash).update(key).digest()),assert(key.length<=this.blockSize);for(var i=key.length;i>>3}function g1_256(x){return rotr32(x,17)^rotr32(x,19)^x>>>10}function ft_1(s,x,y,z){return 0===s?ch32(x,y,z):1===s||3===s?p32(x,y,z):2===s?maj32(x,y,z):void 0}function ch64_hi(xh,xl,yh,yl,zh,zl){var r=xh&yh^~xh&zh;return r<0&&(r+=4294967296),r}function ch64_lo(xh,xl,yh,yl,zh,zl){var r=xl&yl^~xl&zl;return r<0&&(r+=4294967296),r}function maj64_hi(xh,xl,yh,yl,zh,zl){var r=xh&yh^xh&zh^yh&zh;return r<0&&(r+=4294967296),r}function maj64_lo(xh,xl,yh,yl,zh,zl){var r=xl&yl^xl&zl^yl&zl;return r<0&&(r+=4294967296),r}function s0_512_hi(xh,xl){var c0_hi=rotr64_hi(xh,xl,28),c1_hi=rotr64_hi(xl,xh,2),c2_hi=rotr64_hi(xl,xh,7),r=c0_hi^c1_hi^c2_hi;return r<0&&(r+=4294967296),r}function s0_512_lo(xh,xl){var c0_lo=rotr64_lo(xh,xl,28),c1_lo=rotr64_lo(xl,xh,2),c2_lo=rotr64_lo(xl,xh,7),r=c0_lo^c1_lo^c2_lo;return r<0&&(r+=4294967296),r}function s1_512_hi(xh,xl){var c0_hi=rotr64_hi(xh,xl,14),c1_hi=rotr64_hi(xh,xl,18),c2_hi=rotr64_hi(xl,xh,9),r=c0_hi^c1_hi^c2_hi;return r<0&&(r+=4294967296),r}function s1_512_lo(xh,xl){var c0_lo=rotr64_lo(xh,xl,14),c1_lo=rotr64_lo(xh,xl,18),c2_lo=rotr64_lo(xl,xh,9),r=c0_lo^c1_lo^c2_lo;return r<0&&(r+=4294967296),r}function g0_512_hi(xh,xl){var c0_hi=rotr64_hi(xh,xl,1),c1_hi=rotr64_hi(xh,xl,8),c2_hi=shr64_hi(xh,xl,7),r=c0_hi^c1_hi^c2_hi;return r<0&&(r+=4294967296),r}function g0_512_lo(xh,xl){var c0_lo=rotr64_lo(xh,xl,1),c1_lo=rotr64_lo(xh,xl,8),c2_lo=shr64_lo(xh,xl,7),r=c0_lo^c1_lo^c2_lo;return r<0&&(r+=4294967296),r}function g1_512_hi(xh,xl){var c0_hi=rotr64_hi(xh,xl,19),c1_hi=rotr64_hi(xl,xh,29),c2_hi=shr64_hi(xh,xl,6),r=c0_hi^c1_hi^c2_hi;return r<0&&(r+=4294967296),r}function g1_512_lo(xh,xl){var c0_lo=rotr64_lo(xh,xl,19),c1_lo=rotr64_lo(xl,xh,29),c2_lo=shr64_lo(xh,xl,6),r=c0_lo^c1_lo^c2_lo;return r<0&&(r+=4294967296),r}var hash=__webpack_require__(48),utils=hash.utils,assert=utils.assert,rotr32=utils.rotr32,rotl32=utils.rotl32,sum32=utils.sum32,sum32_4=utils.sum32_4,sum32_5=utils.sum32_5,rotr64_hi=utils.rotr64_hi,rotr64_lo=utils.rotr64_lo,shr64_hi=utils.shr64_hi,shr64_lo=utils.shr64_lo,sum64=utils.sum64,sum64_hi=utils.sum64_hi,sum64_lo=utils.sum64_lo,sum64_4_hi=utils.sum64_4_hi,sum64_4_lo=utils.sum64_4_lo,sum64_5_hi=utils.sum64_5_hi,sum64_5_lo=utils.sum64_5_lo,BlockHash=hash.common.BlockHash,sha256_K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],sha512_K=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],sha1_K=[1518500249,1859775393,2400959708,3395469782];utils.inherits(SHA256,BlockHash),exports.sha256=SHA256,SHA256.blockSize=512,SHA256.outSize=256,SHA256.hmacStrength=192,SHA256.padLength=64,SHA256.prototype._update=function(msg,start){for(var W=this.W,i=0;i<16;i++)W[i]=msg[start+i];for(;i>8,lo=255&c;hi?res.push(hi,lo):res.push(lo)}else for(var i=0;i>>24|w>>>8&65280|w<<8&16711680|(255&w)<<24)>>>0}function toHex32(msg,endian){for(var res="",i=0;i>>0}return res}function split32(msg,endian){for(var res=new Array(4*msg.length),i=0,k=0;i>>24,res[k+1]=m>>>16&255,res[k+2]=m>>>8&255,res[k+3]=255&m):(res[k+3]=m>>>24,res[k+2]=m>>>16&255,res[k+1]=m>>>8&255,res[k]=255&m)}return res}function rotr32(w,b){return w>>>b|w<<32-b}function rotl32(w,b){return w<>>32-b}function sum32(a,b){return a+b>>>0}function sum32_3(a,b,c){return a+b+c>>>0}function sum32_4(a,b,c,d){return a+b+c+d>>>0}function sum32_5(a,b,c,d,e){return a+b+c+d+e>>>0}function assert(cond,msg){if(!cond)throw new Error(msg||"Assertion failed")}function sum64(buf,pos,ah,al){var bh=buf[pos],bl=buf[pos+1],lo=al+bl>>>0,hi=(lo>>0,buf[pos+1]=lo}function sum64_hi(ah,al,bh,bl){return(al+bl>>>0>>0}function sum64_lo(ah,al,bh,bl){return al+bl>>>0}function sum64_4_hi(ah,al,bh,bl,ch,cl,dh,dl){var carry=0,lo=al;return lo=lo+bl>>>0,carry+=lo>>0,carry+=lo>>0,carry+=lo>>0}function sum64_4_lo(ah,al,bh,bl,ch,cl,dh,dl){return al+bl+cl+dl>>>0}function sum64_5_hi(ah,al,bh,bl,ch,cl,dh,dl,eh,el){var carry=0,lo=al;return lo=lo+bl>>>0,carry+=lo>>0,carry+=lo>>0,carry+=lo>>0,carry+=lo>>0}function sum64_5_lo(ah,al,bh,bl,ch,cl,dh,dl,eh,el){return al+bl+cl+dl+el>>>0}function rotr64_hi(ah,al,num){return(al<<32-num|ah>>>num)>>>0}function rotr64_lo(ah,al,num){return(ah<<32-num|al>>>num)>>>0}function shr64_hi(ah,al,num){return ah>>>num}function shr64_lo(ah,al,num){return(ah<<32-num|al>>>num)>>>0}var utils=exports,inherits=__webpack_require__(1);utils.toArray=toArray,utils.toHex=toHex,utils.htonl=htonl,utils.toHex32=toHex32,utils.zero2=zero2,utils.zero8=zero8,utils.join32=join32,utils.split32=split32,utils.rotr32=rotr32,utils.rotl32=rotl32,utils.sum32=sum32,utils.sum32_3=sum32_3,utils.sum32_4=sum32_4,utils.sum32_5=sum32_5,utils.assert=assert,utils.inherits=inherits,exports.sum64=sum64,exports.sum64_hi=sum64_hi,exports.sum64_lo=sum64_lo,exports.sum64_4_hi=sum64_4_hi,exports.sum64_4_lo=sum64_4_lo,exports.sum64_5_hi=sum64_5_hi,exports.sum64_5_lo=sum64_5_lo,exports.rotr64_hi=rotr64_hi,exports.rotr64_lo=rotr64_lo,exports.shr64_hi=shr64_hi,exports.shr64_lo=shr64_lo},function(module,exports,__webpack_require__){"use strict";function HmacDRBG(options){if(!(this instanceof HmacDRBG))return new HmacDRBG(options);this.hash=options.hash,this.predResist=!!options.predResist,this.outLen=this.hash.outSize,this.minEntropy=options.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var entropy=utils.toArray(options.entropy,options.entropyEnc||"hex"),nonce=utils.toArray(options.nonce,options.nonceEnc||"hex"),pers=utils.toArray(options.pers,options.persEnc||"hex");assert(entropy.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(entropy,nonce,pers)}var hash=__webpack_require__(48),utils=__webpack_require__(277),assert=__webpack_require__(111);module.exports=HmacDRBG,HmacDRBG.prototype._init=function(entropy,nonce,pers){var seed=entropy.concat(nonce).concat(pers);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(entropy.concat(add||[])),this._reseed=1},HmacDRBG.prototype.generate=function(len,enc,add,addEnc){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof enc&&(addEnc=add,add=enc,enc=null),add&&(add=utils.toArray(add,addEnc||"hex"),this._update(add));for(var temp=[];temp.length=this._table.protocolMaxSize){size=this._table.protocolMaxSize;var enc=encoder.create();enc.encodeBits(1,3),enc.encodeInt(size);for(var data=enc.render(),i=0;i0,isIncremental=header.incremental!==!1,neverIndex=0;if(this._encoder.encodeBit(isIndexed),isIndexed)return void this._encoder.encodeInt(index);var name=utils.toArray(header.name),value=utils.toArray(header.value);this._encoder.encodeBit(isIncremental),isIncremental?this._table.add(header.name,header.value,name.length,value.length):(this._encoder.encodeBit(0),this._encoder.encodeBit(neverIndex)),this._encoder.encodeInt(-index),0===index&&this._encoder.encodeStr(name,header.huffman!==!1),this._encoder.encodeStr(value,header.huffman!==!1)}},function(module,exports,__webpack_require__){function Decoder(){this.buffer=new OffsetBuffer,this.bitOffset=0,this._huffmanNode=null}var hpack=__webpack_require__(58),utils=hpack.utils,huffman=hpack.huffman.decode,assert=utils.assert,OffsetBuffer=__webpack_require__(113);module.exports=Decoder,Decoder.create=function(){return new Decoder},Decoder.prototype.isEmpty=function(){return this.buffer.isEmpty()},Decoder.prototype.push=function(chunk){this.buffer.push(chunk)},Decoder.prototype.decodeBit=function(){assert(this.buffer.has(1),"Buffer too small for an int");var octet,offset=this.bitOffset;return 8==++this.bitOffset?(octet=this.buffer.readUInt8(),this.bitOffset=0):octet=this.buffer.peekUInt8(),octet>>>7-offset&1},Decoder.prototype.skipBits=function(n){this.bitOffset+=n,this.buffer.skip(this.bitOffset>>3),this.bitOffset&=7},Decoder.prototype.decodeInt=function(){assert(this.buffer.has(1),"Buffer too small for an int");var prefix=8-this.bitOffset;this.bitOffset=0;var max=(1<>>21|(res>>14&127)<<7|(res>>7&127)<<14|(127&res)<<21,res>>=7*(4-len),res+=max},Decoder.prototype.decodeHuffmanWord=function(input,inputBits,out){for(var root=huffman,node=this._huffmanNode,word=input,bits=inputBits;bits>0;word&=(1<>>i];if("number"!=typeof subnode){node=subnode,bits=i;break}if(0!==subnode){if(subnode>>>9==bits-i){var octet=511&subnode;assert(256!==octet,"EOS in encoding"),out.push(octet),node=root,bits=i;break}subnode=0}}if(0===subnode)break}return this._huffmanNode=node,bits},Decoder.prototype.decodeStr=function(){var isHuffman=this.decodeBit(),len=this.decodeInt();if(assert(this.buffer.has(len),"Not enough octets for string"),!isHuffman)return this.buffer.take(len);this._huffmanNode=huffman;for(var out=[],word=0,bits=0,i=0;i>bits,word&=(1<0;){var avail=Math.min(leftLen,8-this.bitOffset),toWrite=left>>>leftLen-avail;8===avail?this.buffer.writeUInt8(toWrite):(this.word<<=avail,this.word|=toWrite,this.bitOffset+=avail,8===this.bitOffset&&(this.buffer.writeUInt8(this.word),this.word=0,this.bitOffset=0)),leftLen-=avail,left&=(1<>3),this.bitOffset&=7},Encoder.prototype.encodeInt=function(num){var prefix=8-this.bitOffset;this.bitOffset=0;var max=(1<>=7,0!==left&&(octet|=128),this.buffer.writeUInt8(octet)}while(0!==left)},Encoder.prototype.encodeStr=function(value,isHuffman){if(this.encodeBit(isHuffman?1:0),isHuffman){for(var codes=[],len=0,pad=0,i=0;i>>8-pad,pad)}else{this.buffer.reserve(value.length+1),this.encodeInt(value.length);for(var i=0;i=limit;i--){var entry=this.dynamic[i];if(entry.name===name&&entry.value===value)return this.length-i;if(entry.name===name){if(staticEntry)break;return-(this.length-i)}}return staticEntry?-staticEntry.index:0},Table.prototype.add=function(name,value,nameSize,valueSize){var totalSize=nameSize+valueSize+32;this.dynamic.push({name:name,value:value,nameSize:nameSize,totalSize:totalSize}),this.size+=totalSize,this.length++,this.evict()},Table.prototype.evict=function(){for(;this.size>this.maxSize;){var entry=this.dynamic.shift();this.size-=entry.totalSize,this.length--}assert(this.size>=0,"Table size sanity check failed")},Table.prototype.updateSize=function(size){assert(size<=this.protocolMaxSize,"Table size bigger than maximum"),this.maxSize=size,this.evict()}},function(module,exports){exports.assert=function(cond,text){if(!cond)throw new Error(text)},exports.stringify=function(arr){for(var res="",i=0;i>>8,lo=255&c;hi?res.push(hi,lo):res.push(lo)}return res}},function(module,exports,__webpack_require__){"use strict";function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}module.exports=PassThrough;var Transform=__webpack_require__(214),util=__webpack_require__(6);util.inherits=__webpack_require__(1),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},function(module,exports,__webpack_require__){"use strict";function BufferList(){this.head=null,this.tail=null,this.length=0}var bufferShim=(__webpack_require__(0).Buffer,__webpack_require__(14));module.exports=BufferList,BufferList.prototype.push=function(v){var entry={data:v,next:null};this.length>0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};0===this.length&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(0!==this.length){var ret=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s){if(0===this.length)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s+p.data;return ret},BufferList.prototype.concat=function(n){if(0===this.length)return bufferShim.alloc(0);if(1===this.length)return this.head.data;for(var ret=bufferShim.allocUnsafe(n>>>0),p=this.head,i=0;p;)p.data.copy(ret,i),i+=p.data.length,p=p.next;return ret}},function(module,exports,__webpack_require__){"use strict";function idbReadableStream(db,storeName,opts){function startCursor(){function proceed(cursor){try{cursor.continue()}catch(err){"TransactionInactiveError"!==err.name||opts.snapshot?transformer.emit("error",err):startCursor()}}var lower,upper,lowerOpen,upperOpen,direction=opts.direction||"next",range=opts.range||{};lower=range.lower,upper=range.upper,lowerOpen=!!range.lowerOpen,upperOpen=!!range.upperOpen,lastIteratedKey&&("next"===direction?(lowerOpen=!0,lower=lastIteratedKey):(upperOpen=!0,upper=lastIteratedKey));var keyRange;lower&&upper?keyRange=IDBKeyRange.bound(lower,upper,lowerOpen,upperOpen):lower?keyRange=IDBKeyRange.lowerBound(lower,lowerOpen):upper&&(keyRange=IDBKeyRange.upperBound(upper,upperOpen));var tx=db.transaction(storeName,"readonly"),store=tx.objectStore(storeName);transformer._cursorsOpened++;var req=store.openCursor(keyRange,opts.direction);req.onsuccess=function(){var cursor=req.result;if(cursor){lastIteratedKey=cursor.key;var go=transformer.write({key:cursor.key,value:cursor.value});opts.snapshot||go?proceed(cursor):transformer.once("drain",function(){proceed(cursor)})}else transformer.end()},tx.onabort=function(){transformer.emit("error",tx.error)},tx.onerror=function(){transformer.emit("error",tx.error)}}if("object"!=typeof db)throw new TypeError("db must be an object");if("string"!=typeof storeName)throw new TypeError("storeName must be a string");if(null==opts&&(opts={}),"object"!=typeof opts)throw new TypeError("opts must be an object");var transformer=new stream.Transform(xtend(opts,{objectMode:!0,transform:function(obj,enc,cb){cb(null,obj)}}));opts=xtend({snapshot:!1},opts);var lastIteratedKey=null;return transformer._cursorsOpened=0,startCursor(),transformer}var stream=__webpack_require__(26),xtend=__webpack_require__(37);module.exports=idbReadableStream},function(module,exports,__webpack_require__){"use strict";function cleanUpNextTick(){draining&¤tQueue&&(draining=!1, +currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&nextTick())}function nextTick(){if(!draining){scheduled=!1,draining=!0;for(var len=queue.length,timeout=setTimeout(cleanUpNextTick);len;){for(currentQueue=queue,queue=[];currentQueue&&++queueIndex1)for(var i=1;i{return err?callback(err):exists?void callback(null,this.data[key.toString()]):callback(new Error("No value"))})}has(key,callback){setImmediate(()=>{callback(null,void 0!==this.data[key.toString()])})}delete(key,callback){delete this.data[key.toString()],setImmediate(()=>{callback()})}batch(){let puts=[],dels=[];return{put(key,value){puts.push([key,value])},delete(key){dels.push(key)},commit:callback=>{puts.forEach(v=>{this.data[v[0].toString()]=v[1]}),puts=[],dels.forEach(key=>{delete this.data[key.toString()]}),dels=[],setImmediate(callback)}}}query(q){let tasks=[pull.keys(this.data),pull.map(k=>({key:new Key(k),value:this.data[k]}))],filters=[];if(null!=q.prefix){const prefix=q.prefix;filters.push((e,cb)=>cb(null,e.key.toString().startsWith(prefix)))}if(null!=q.filters&&(filters=filters.concat(q.filters)),tasks=tasks.concat(filters.map(f=>asyncFilter(f))),null!=q.orders&&(tasks=tasks.concat(q.orders.map(o=>asyncSort(o)))),null!=q.offset){let i=0;tasks.push(pull.filter(()=>i++>=q.offset))}return null!=q.limit&&tasks.push(pull.take(q.limit)),q.keysOnly===!0&&tasks.push(pull.map(e=>({key:e.key}))),pull.apply(null,tasks)}close(callback){setImmediate(callback)}}module.exports=MemoryDatastore},function(module,exports,__webpack_require__){"use strict";function _normalizeFamily(family){return family?family.toLowerCase():"ipv4"}var ip=exports,Buffer=__webpack_require__(0).Buffer,os=__webpack_require__(153);ip.toBuffer=function(ip,buff,offset){offset=~~offset;var result;if(this.isV4Format(ip))result=buff||new Buffer(offset+4),ip.split(/\./g).map(function(byte){result[offset++]=255&parseInt(byte,10)});else if(this.isV6Format(ip)){var i,sections=ip.split(":",8);for(i=0;i0;i--)argv.push("0");sections.splice.apply(sections,argv)}for(result=buff||new Buffer(offset+16),i=0;i>8&255,result[offset++]=255&word}}if(!result)throw Error("Invalid ip address: "+ip);return result},ip.toString=function(buff,offset,length){offset=~~offset,length=length||buff.length-offset;var result=[];if(4===length){for(var i=0;i32?"ipv6":_normalizeFamily(family);var len=4;"ipv6"===family&&(len=16);for(var buff=new Buffer(len),i=0,n=buff.length;i>bits)}return ip.toString(buff)},ip.mask=function(addr,mask){addr=ip.toBuffer(addr),mask=ip.toBuffer(mask);var result=new Buffer(Math.max(addr.length,mask.length)),i=0;if(addr.length===mask.length)for(i=0;ia.length&&(buff=b,other=a);for(var offset=buff.length-other.length,i=offset;i>>0},ip.fromLong=function(ipl){return(ipl>>>24)+"."+(ipl>>16&255)+"."+(ipl>>8&255)+"."+(255&ipl)}},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),each=__webpack_require__(32),eachSeries=__webpack_require__(87),waterfall=__webpack_require__(9),map=__webpack_require__(89),debounce=__webpack_require__(261),uniqWith=__webpack_require__(640),find=__webpack_require__(628),values=__webpack_require__(149),groupBy=__webpack_require__(630),pullAllWith=__webpack_require__(635),log=debug("bitswap:engine");log.error=debug("bitswap:engine:error");const Message=__webpack_require__(99),Wantlist=__webpack_require__(100),Ledger=__webpack_require__(459);class DecisionEngine{constructor(blockstore,network){this.blockstore=blockstore,this.network=network,this.ledgerMap=new Map,this._running=!1,this._tasks=[],this._outbox=debounce(this._processTasks.bind(this),100)}_sendBlocks(env,cb){const blocks=env.blocks;if(blocks.reduce((acc,b)=>{return acc+b.data.byteLength},0)<524288)return this._sendSafeBlocks(env.peer,blocks,cb);let size=0,batch=[];eachSeries(blocks,(b,cb)=>{if(batch.push(b),(size+=b.data.byteLength)>=524288){const nextBatch=batch.slice();batch=[],this._sendSafeBlocks(env.peer,nextBatch,cb)}else cb()},cb)}_sendSafeBlocks(peer,blocks,cb){const msg=new Message(!1);blocks.forEach(b=>{msg.addBlock(b)}),this.network.sendMessage(peer,msg,err=>{err&&log("sendblock error: %s",err.message),cb()})}_processTasks(){if(this._running&&this._tasks.length){const tasks=this._tasks;this._tasks=[];const entries=tasks.map(t=>t.entry),cids=entries.map(e=>e.cid),uniqCids=uniqWith(cids,(a,b)=>a.equals(b)),groupedTasks=groupBy(tasks,task=>task.target.toB58String());waterfall([cb=>map(uniqCids,(cid,cb)=>{this.blockstore.get(cid,cb)},cb),(blocks,cb)=>each(values(groupedTasks),(tasks,cb)=>{const peer=tasks[0].target,blockList=cids.map(cid=>{return find(blocks,b=>b.cid.equals(cid))});this._sendBlocks({peer:peer,blocks:blockList},err=>{err&&log.error("failed to send",err),blockList.forEach(block=>{this.messageSent(peer,block)}),cb()})})],err=>{this._tasks=[],err&&log.error(err)})}}wantlistForPeer(peerId){const peerIdStr=peerId.toB58String();return this.ledgerMap.has(peerIdStr)?this.ledgerMap.get(peerIdStr).wantlist.sortedEntries():new Map}peers(){return Array.from(this.ledgerMap.values()).map(l=>l.partner)}receivedBlocks(cids){cids.length&&(this.ledgerMap.forEach(ledger=>{cids.map(cid=>ledger.wantlistContains(cid)).filter(Boolean).forEach(entry=>{this._tasks.push({entry:entry,target:ledger.partner})})}),this._outbox())}messageReceived(peerId,msg,cb){const ledger=this._findOrCreate(peerId);if(msg.empty)return cb();if(msg.full&&(ledger.wantlist=new Wantlist),this._processBlocks(msg.blocks,ledger),0===msg.wantlist.size)return cb();let cancels=[],wants=[];msg.wantlist.forEach(entry=>{entry.cancel?(ledger.cancelWant(entry.cid),cancels.push(entry)):(ledger.wants(entry.cid,entry.priority),wants.push(entry))}),this._cancelWants(ledger,peerId,cancels),this._addWants(ledger,peerId,wants,cb)}_cancelWants(ledger,peerId,entries){const id=peerId.toB58String();pullAllWith(this._tasks,entries,(t,e)=>{const sameTarget=t.target.toB58String()===id,sameCid=t.entry.cid.equals(e.cid);return sameTarget&&sameCid})}_addWants(ledger,peerId,entries,cb){each(entries,(entry,cb)=>{this.blockstore.has(entry.cid,(err,exists)=>{err?log.error("failed existence check"):exists&&this._tasks.push({entry:entry.entry,target:peerId}),cb()})},()=>{this._outbox(),cb()})}_processBlocks(blocks,ledger,callback){const cids=[];blocks.forEach((b,cidStr)=>{log("got block (%s bytes)",b.data.length),ledger.receivedBytes(b.data.length),cids.push(b.cid)}),this.receivedBlocks(cids)}messageSent(peerId,block){const ledger=this._findOrCreate(peerId);ledger.sentBytes(block?block.data.length:0),block&&block.cid&&ledger.wantlist.remove(block.cid)}numBytesSentTo(peerId){return this._findOrCreate(peerId).accounting.bytesSent}numBytesReceivedFrom(peerId){return this._findOrCreate(peerId).accounting.bytesRecv}peerDisconnected(peerId){}_findOrCreate(peerId){const peerIdStr=peerId.toB58String();if(this.ledgerMap.has(peerIdStr))return this.ledgerMap.get(peerIdStr);const l=new Ledger(peerId);return this.ledgerMap.set(peerIdStr,l),l}start(){this._running=!0}stop(){this._running=!1}}module.exports=DecisionEngine},function(module,exports,__webpack_require__){"use strict";const Wantlist=__webpack_require__(100);class Ledger{constructor(peerId){this.partner=peerId,this.wantlist=new Wantlist,this.exchangeCount=0,this.sentToPeer=new Map,this.accounting={bytesSent:0,bytesRecv:0}}sentBytes(n){this.exchangeCount++,this.lastExchange=(new Date).getTime(),this.accounting.bytesSent+=n}receivedBytes(n){this.exchangeCount++,this.lastExchange=(new Date).getTime(),this.accounting.bytesRecv+=n}wants(cid,priority){this.wantlist.add(cid,priority)}cancelWant(cid){this.wantlist.remove(cid)}wantlistContains(cid){return this.wantlist.contains(cid)}}module.exports=Ledger},function(module,exports,__webpack_require__){"use strict";function writeMessage(conn,msg,callback){pull(pull.values([msg]),lp.encode(),conn,pull.onEnd(callback))}const debug=__webpack_require__(3),lp=__webpack_require__(28),pull=__webpack_require__(5),setImmediate=__webpack_require__(11),Message=__webpack_require__(99),CONSTANTS=__webpack_require__(133),log=debug("bitswap:network");log.error=debug("bitswap:network:error");const BITSWAP100="/ipfs/bitswap/1.0.0",BITSWAP110="/ipfs/bitswap/1.1.0";class Network{constructor(libp2p,peerBook,bitswap,b100Only){this.libp2p=libp2p,this.peerBook=peerBook,this.bitswap=bitswap,this.b100Only=b100Only||!1,this._running=!1,this.libp2p.swarm.setMaxListeners(CONSTANTS.maxListeners)}start(){this._running=!0,this._onPeerConnect=this._onPeerConnect.bind(this),this._onPeerDisconnect=this._onPeerDisconnect.bind(this),this._onConnection=this._onConnection.bind(this),this.libp2p.handle(BITSWAP100,this._onConnection),this.b100Only||this.libp2p.handle(BITSWAP110,this._onConnection),this.libp2p.on("peer:connect",this._onPeerConnect),this.libp2p.on("peer:disconnect",this._onPeerDisconnect),Object.keys(this.peerBook.getAll()).forEach(k=>this._onPeerConnect(this.peerBook.get(k)))}stop(){this._running=!1,this.libp2p.unhandle(BITSWAP100),this.b100Only||this.libp2p.unhandle(BITSWAP110),this.libp2p.removeListener("peer:connect",this._onPeerConnect),this.libp2p.removeListener("peer:disconnect",this._onPeerDisconnect)}_onConnection(protocol,conn){this._running&&(log("incomming new bitswap connection: %s",protocol),pull(conn,lp.decode(),pull.asyncMap((data,cb)=>Message.deserialize(data,cb)),pull.asyncMap((msg,cb)=>{conn.getPeerInfo((err,peerInfo)=>{if(err)return cb(err);this.bitswap._receiveMessage(peerInfo.id,msg,cb)})}),pull.onEnd(err=>{if(log("ending connection"),err)return this.bitswap._receiveError(err)})))}_onPeerConnect(peerInfo){this._running&&this.bitswap._onPeerConnected(peerInfo.id)}_onPeerDisconnect(peerInfo){this._running&&this.bitswap._onPeerDisconnected(peerInfo.id)}connectTo(peerId,callback){const done=err=>setImmediate(()=>callback(err));if(!this._running)return done(new Error("No running network"));this.libp2p.swarm.muxedConns[peerId.toB58String()]?done():done(new Error("Could not connect to peer with peerId:",peerId.toB58String()))}sendMessage(peerId,msg,callback){if(!this._running)return callback(new Error("No running network"));const stringId=peerId.toB58String();log("sendMessage to %s",stringId,msg);let peerInfo;try{peerInfo=this.peerBook.get(stringId)}catch(err){return callback(err)}this._dialPeer(peerInfo,(err,conn,protocol)=>{if(err)return callback(err);let serialized;switch(protocol){case BITSWAP100:serialized=msg.serializeToBitswap100();break;case BITSWAP110:serialized=msg.serializeToBitswap110();break;default:return callback(new Error("Unkown protocol: "+protocol))}writeMessage(conn,serialized,err=>{err&&log(err)}),callback()})}_dialPeer(peerInfo,callback){try{this.libp2p.dial(peerInfo,BITSWAP110,(err,conn)=>{if(err)return void this.libp2p.dial(peerInfo,BITSWAP100,(err,conn)=>{if(err)return callback(err);callback(null,conn,BITSWAP100)});callback(null,conn,BITSWAP110)})}catch(err){return callback(err)}}}module.exports=Network},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),Message=__webpack_require__(99),Wantlist=__webpack_require__(100),CONSTANTS=__webpack_require__(133),MsgQueue=__webpack_require__(462),log=debug("bitswap:wantmanager");log.error=debug("bitswap:wantmanager:error"),module.exports=class WantManager{constructor(network){this.peers=new Map,this.wantlist=new Wantlist,this.network=network}_addEntries(cids,cancel,force){const entries=cids.map((cid,i)=>{return new Message.Entry(cid,CONSTANTS.kMaxPriority-i,cancel)});entries.forEach(e=>{e.cancel?force?this.wantlist.removeForce(e.cid):this.wantlist.remove(e.cid):(log("adding to wl"),this.wantlist.add(e.cid,e.priority))});for(let p of this.peers.values())p.addEntries(entries)}_startPeerHandler(peerId){let mq=this.peers.get(peerId.toB58String());if(mq)return void mq.refcnt++;mq=new MsgQueue(peerId,this.network);const fullwantlist=new Message(!0);for(let entry of this.wantlist.entries())fullwantlist.addEntry(entry[1].cid,entry[1].priority);return mq.addMessage(fullwantlist),this.peers.set(peerId.toB58String(),mq),mq}_stopPeerHandler(peerId){const mq=this.peers.get(peerId.toB58String());mq&&(--mq.refcnt>0||this.peers.delete(peerId.toB58String()))}wantBlocks(cids){this._addEntries(cids,!1)}unwantBlocks(cids){log("unwant blocks: %s",cids.length),this._addEntries(cids,!0,!0)}cancelWants(cids){log("cancel wants: %s",cids.length),this._addEntries(cids,!0)}connectedPeers(){return Array.from(this.peers.keys())}connected(peerId){this._startPeerHandler(peerId)}disconnected(peerId){this._stopPeerHandler(peerId)}run(){this.timer=setInterval(()=>{const fullwantlist=new Message(!0);for(let entry of this.wantlist.entries())fullwantlist.addEntry(entry[1].cid,entry[1].priority);this.peers.forEach(p=>{p.addMessage(fullwantlist)})},1e4)}stop(){for(let mq of this.peers.values())this.disconnected(mq.peerId);clearInterval(this.timer)}}},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),debounce=__webpack_require__(261),Message=__webpack_require__(99),log=debug("bitswap:wantmanager:queue");log.error=debug("bitswap:wantmanager:queue:error"),module.exports=class MsgQueue{constructor(peerId,network){this.peerId=peerId,this.network=network,this.refcnt=1,this._entries=[],this.sendEntries=debounce(this._sendEntries.bind(this),200)}addMessage(msg){msg.empty||this.send(msg)}addEntries(entries){this._entries=this._entries.concat(entries),this.sendEntries()}_sendEntries(){if(this._entries.length){const msg=new Message(!1);this._entries.forEach(entry=>{entry.cancel?msg.cancel(entry.cid):msg.addEntry(entry.cid,entry.priority)}),this._entries=[],this.addMessage(msg)}}send(msg){this.network.connectTo(this.peerId,err=>{if(err)return void log.error("cant connect to peer %s: %s",this.peerId.toB58String(),err.message);log("sending message"),this.network.sendMessage(this.peerId,msg,err=>{err&&log.error("send error: %s",err.message)})})}}},function(module,exports,__webpack_require__){"use strict";const waterfall=__webpack_require__(9),reject=__webpack_require__(182),each=__webpack_require__(32),EventEmitter=__webpack_require__(8).EventEmitter,debug=__webpack_require__(3),CONSTANTS=__webpack_require__(133),WantManager=__webpack_require__(461),Network=__webpack_require__(460),DecisionEngine=__webpack_require__(458),log=debug("bitswap");log.error=debug("bitswap:error");class Bitswap{constructor(libp2p,blockstore,peerBook){this.libp2p=libp2p,this.network=new Network(libp2p,peerBook,this),this.blockstore=blockstore,this.engine=new DecisionEngine(blockstore,this.network),this.wm=new WantManager(this.network),this.blocksRecvd=0,this.dupBlocksRecvd=0,this.dupDataRecvd=0,this.notifications=new EventEmitter,this.notifications.setMaxListeners(CONSTANTS.maxListeners)}_receiveMessage(peerId,incoming,callback){this.engine.messageReceived(peerId,incoming,err=>{if(err&&log("failed to receive message",incoming),0===incoming.blocks.size)return callback();const blocks=Array.from(incoming.blocks.values()),toCancel=blocks.filter(b=>this.wm.wantlist.contains(b.cid)).map(b=>b.cid);this.wm.cancelWants(toCancel),each(blocks,(b,cb)=>this._handleReceivedBlock(peerId,b,cb),callback)})}_handleReceivedBlock(peerId,block,callback){log("received block"),waterfall([cb=>this.blockstore.has(block.cid,cb),(has,cb)=>{if(this._updateReceiveCounters(block,has),has)return cb();this._putBlock(block,cb)}],callback)}_updateReceiveCounters(block,exists){this.blocksRecvd++,exists&&(this.dupBlocksRecvd++,this.dupDataRecvd+=block.data.length)}_receiveError(err){log.error("ReceiveError: %s",err.message)}_onPeerConnected(peerId){this.wm.connected(peerId)}_onPeerDisconnected(peerId){this.wm.disconnected(peerId),this.engine.peerDisconnected(peerId)}_putBlock(block,callback){this.blockstore.put(block,err=>{if(err)return callback(err);this.notifications.emit(`block:${block.cid.buffer.toString()}`,block),this.engine.receivedBlocks([block.cid]),callback()})}wantlistForPeer(peerId){return this.engine.wantlistForPeer(peerId)}get(cid,callback){const unwantListeners={},blockListeners={},cidStr=cid.buffer.toString(),unwantEvent=`unwant:${cidStr}`,blockEvent=`block:${cidStr}`;log("get: %s",cidStr);const cleanupListener=()=>{unwantListeners[cidStr]&&(this.notifications.removeListener(unwantEvent,unwantListeners[cidStr]),delete unwantListeners[cidStr]),blockListeners[cidStr]&&(this.notifications.removeListener(blockEvent,blockListeners[cidStr]),delete blockListeners[cidStr])},addListener=()=>{unwantListeners[cidStr]=(()=>{log(`manual unwant: ${cidStr}`),cleanupListener(),this.wm.cancelWants([cid]),callback()}),blockListeners[cidStr]=(block=>{this.wm.cancelWants([cid]),cleanupListener(cid),callback(null,block)}),this.notifications.once(unwantEvent,unwantListeners[cidStr]),this.notifications.once(blockEvent,blockListeners[cidStr])};this.blockstore.has(cid,(err,has)=>{return err?callback(err):has?(log("already have block: %s",cidStr),this.blockstore.get(cid,callback)):(addListener(),void this.wm.wantBlocks([cid]))})}unwant(cids){Array.isArray(cids)||(cids=[cids]),this.wm.unwantBlocks(cids),cids.forEach(cid=>{this.notifications.emit(`unwant:${cid.buffer.toString()}`)})}cancelWants(cids){Array.isArray(cids)||(cids=[cids]),this.wm.cancelWants(cids)}put(block,callback){log("putting block"),waterfall([cb=>this.blockstore.has(block.cid,cb),(has,cb)=>{if(has)return cb();this._putBlock(block,cb)}],callback)}putMany(blocks,callback){waterfall([cb=>reject(blocks,(b,cb)=>{this.blockstore.has(b.cid,cb)},cb),(newBlocks,cb)=>this.blockstore.putMany(newBlocks,err=>{if(err)return cb(err);newBlocks.forEach(block=>{this.notifications.emit(`block:${block.cid.buffer.toString()}`,block),this.engine.receivedBlocks([block.cid])}),cb()})],callback)}getWantlist(){return this.wm.wantlist.entries()}stat(){return{wantlist:this.getWantlist(),blocksReceived:this.blocksRecvd,dupBlksReceived:this.dupBlocksRecvd,dupDataReceived:this.dupDataRecvd,peers:this.engine.peers()}}start(){this.wm.run(),this.network.start(),this.engine.start()}stop(){this.wm.stop(this.libp2p.peerInfo.id),this.network.stop(),this.engine.stop()}}module.exports=Bitswap},function(module,exports,__webpack_require__){"use strict";const WantlistEntry=__webpack_require__(100).Entry,CID=__webpack_require__(12),assert=__webpack_require__(7);module.exports=class BitswapMessageEntry{constructor(cid,priority,cancel){assert(CID.isCID(cid),"needs valid cid"),this.entry=new WantlistEntry(cid,priority),this.cancel=Boolean(cancel)}get cid(){return this.entry.cid}set cid(cid){this.entry.cid=cid}get priority(){return this.entry.priority}set priority(val){this.entry.priority=val}get[Symbol.toStringTag](){return`BitswapMessageEntry ${this.cid.toBaseEncodedString()} `}equals(other){return this.cancel===other.cancel&&this.entry.equals(other.entry)}}},function(module,exports,__webpack_require__){"use strict";module.exports=` + message Message { + message Wantlist { + message Entry { + // changed from string to bytes, it makes a difference in JavaScript + optional bytes block = 1; // the block cid (cidV0 in bitswap 1.0.0, cidV1 in bitswap 1.1.0) + optional int32 priority = 2; // the priority (normalized). default to 1 + optional bool cancel = 3; // whether this revokes an entry + } + + repeated Entry entries = 1; // a list of wantlist entries + optional bool full = 2; // whether this is the full wantlist. default to false + } + + message Block { + optional bytes prefix = 1; // CID prefix (cid version, multicodec and multihash prefix (type + length) + optional bytes data = 2; + } + + optional Wantlist wantlist = 1; + repeated bytes blocks = 2; // used to send Blocks in bitswap 1.0.0 + repeated Block payload = 3; // used to send Blocks in bitswap 1.1.0 + } +`},function(module,exports,__webpack_require__){"use strict";const assert=__webpack_require__(7),CID=__webpack_require__(12);class WantListEntry{constructor(cid,priority){assert(CID.isCID(cid),"must be valid CID"),this._refCounter=1,this.cid=cid,this.priority=priority||1}inc(){this._refCounter+=1}dec(){this._refCounter=Math.max(0,this._refCounter-1)}hasRefs(){return this._refCounter>0}get[Symbol.toStringTag](){return`WantlistEntry `}equals(other){return this._refCounter===other._refCounter&&this.cid.equals(other.cid)&&this.priority===other.priority}}module.exports=WantListEntry},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(17),multibase=__webpack_require__(43),multicodec=__webpack_require__(44),codecs=__webpack_require__(35),codecVarints=__webpack_require__(38),multihash=__webpack_require__(17);class CID{constructor(version,codec,multihash){if("string"==typeof version)if(multibase.isEncoded(version)){const cid=multibase.decode(version);this.version=parseInt(cid.slice(0,1).toString("hex"),16),this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=mh.fromB58String(version),this.version=0;else if(Buffer.isBuffer(version)){const firstByte=version.slice(0,1),v=parseInt(firstByte.toString("hex"),16);if(0===v||1===v){const cid=version;this.version=v,this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=version,this.version=0}else if("number"==typeof version){if("string"!=typeof codec)throw new Error("codec must be string");if(0!==version&&1!==version)throw new Error("version must be a number equal to 0 or 1");mh.validate(multihash),this.codec=codec,this.version=version,this.multihash=multihash}}get buffer(){switch(this.version){case 0:return this.multihash;case 1:return Buffer.concat([Buffer("01","hex"),Buffer(codecVarints[this.codec]),this.multihash]);default:throw new Error("unsupported version")}}get prefix(){return Buffer.concat([new Buffer(`0${this.version}`,"hex"),codecVarints[this.codec],multihash.prefix(this.multihash)])}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");return new CID(0,this.codec,this.multihash)}toV1(){return new CID(1,this.codec,this.multihash)}toBaseEncodedString(base){switch(base=base||"base58btc",this.version){case 0:if("base58btc"!==base)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");return mh.toB58String(this.multihash);case 1:return multibase.encode(base,this.buffer).toString();default:throw new Error("Unsupported version")}}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(other){return this.codec===other.codec&&this.version===other.version&&this.multihash.equals(other.multihash)}}CID.codecs=codecs,CID.isCID=(other=>{return"CID"===other.constructor.name}),module.exports=CID}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const NamespaceStore=__webpack_require__(197).NamespaceDatastore,Key=__webpack_require__(41).Key,base32=__webpack_require__(360),Block=__webpack_require__(60),setImmediate=__webpack_require__(11),reject=__webpack_require__(182),CID=__webpack_require__(12),blockPrefix=new Key("blocks"),keyFromBuffer=rawKey=>{return new Key("/"+(new base32.Encoder).write(rawKey).finalize(),!1)},cidToDsKey=cid=>{return keyFromBuffer(cid.buffer)};module.exports=(repo=>{const store=new NamespaceStore(repo.store,blockPrefix);return{get(cid,callback){if(!CID.isCID(cid))return setImmediate(()=>{callback(new Error("Not a valid cid"))});const k=cidToDsKey(cid);store.get(k,(err,blockData)=>{if(err)return callback(err);callback(null,new Block(blockData,cid))})},put(block,callback){if(!Block.isBlock(block))return setImmediate(()=>{callback(new Error("invalid block"))});const k=cidToDsKey(block.cid);store.has(k,(err,exists)=>{return err?callback(err):exists?callback():void store.put(k,block.data,callback)})},putMany(blocks,callback){const keys=blocks.map(b=>({key:cidToDsKey(b.cid),block:b})),batch=store.batch();reject(keys,(k,cb)=>store.has(k.key,cb),(err,newKeys)=>{if(err)return callback(err);newKeys.forEach(k=>{batch.put(k.key,k.block.data)}),batch.commit(callback)})},has(cid,callback){if(!CID.isCID(cid))return setImmediate(()=>{callback(new Error("Not a valid cid"))});store.has(cidToDsKey(cid),callback)},delete(cid,callback){if(!CID.isCID(cid))return setImmediate(()=>{callback(new Error("Not a valid cid"))});store.delete(cidToDsKey(cid),callback)}}})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const Key=__webpack_require__(41).Key,configKey=new Key("config");module.exports=(store=>{return{get(callback){store.get(configKey,(err,value)=>{if(err)return callback(err);let config;try{config=JSON.parse(value.toString())}catch(err){return callback(err)}callback(null,config)})},set(config,callback){const buf=new Buffer(JSON.stringify(config,null,2));store.put(configKey,buf,callback)},exists(callback){store.has(configKey,callback)}}})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";module.exports={fs:__webpack_require__(199),sharding:!1,fsOptions:{db:__webpack_require__(243)},level:__webpack_require__(243)}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const Key=__webpack_require__(41).Key,debug=__webpack_require__(3),log=debug("repo:version"),versionKey=new Key("version");module.exports=(store=>{return{exists(callback){store.has(versionKey,callback)},get(callback){store.get(versionKey,(err,buf)=>{if(err)return callback(err);callback(null,parseInt(buf.toString().trim(),10))})},set(version,callback){store.put(versionKey,new Buffer(String(version)),callback)},check(expected,callback){this.get((err,version)=>{return err?callback(err):(log("comparing version: %s and %s",version,expected),version!==expected?callback(new Error(`version mismatch: expected v${expected}, found v${version}`)):void callback())})}}})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function isSpecificValue(val){return val instanceof Buffer||val instanceof Date||val instanceof RegExp}function cloneSpecificValue(val){if(val instanceof Buffer){var x=new Buffer(val.length);return val.copy(x),x}if(val instanceof Date)return new Date(val.getTime());if(val instanceof RegExp)return new RegExp(val);throw new Error("Unexpected situation")}function deepCloneArray(arr){var clone=[];return arr.forEach(function(item,index){"object"==typeof item&&null!==item?Array.isArray(item)?clone[index]=deepCloneArray(item):isSpecificValue(item)?clone[index]=cloneSpecificValue(item):clone[index]=deepExtend({},item):clone[index]=item}),clone}var deepExtend=module.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var val,src,target=arguments[0],args=Array.prototype.slice.call(arguments,1);return args.forEach(function(obj){"object"!=typeof obj||null===obj||Array.isArray(obj)||Object.keys(obj).forEach(function(key){return src=target[key],val=obj[key],val===target?void 0:"object"!=typeof val||null===val?void(target[key]=val):Array.isArray(val)?void(target[key]=deepCloneArray(val)):isSpecificValue(val)?void(target[key]=cloneSpecificValue(val)):"object"!=typeof src||null===src||Array.isArray(src)?void(target[key]=deepExtend({},val)):void(target[key]=deepExtend(src,val))})}),target}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(5),pushable=__webpack_require__(36),pullPair=__webpack_require__(115),batch=__webpack_require__(155);module.exports=function(reduce,options){function reduceToParents(_chunks,callback){function reduced(err,roots){err?callback(err):roots.length>1?reduceToParents(roots,callback):callback(null,roots)}let chunks=_chunks;Array.isArray(chunks)&&(chunks=pull.values(chunks)),pull(chunks,batch(options.maxChildrenPerNode),pull.asyncMap(reduce),pull.collect(reduced))}const pair=pullPair(),source=pair.source,result=pushable();return reduceToParents(source,(err,roots)=>{if(err)return void result.end(err);1===roots.length?(result.push(roots[0]),result.end()):roots.length>1?result.end(new Error("expected a maximum of 1 roots and got "+roots.length)):result.end()}),{sink:pair.sink,source:result}}},function(module,exports,__webpack_require__){"use strict";const balancedReducer=__webpack_require__(473),defaultOptions={maxChildrenPerNode:174};module.exports=function(reduce,_options){return balancedReducer(reduce,Object.assign({},defaultOptions,_options))}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const extend=__webpack_require__(472),UnixFS=__webpack_require__(42),pull=__webpack_require__(5),through=__webpack_require__(116),parallel=__webpack_require__(46),waterfall=__webpack_require__(9),dagPB=__webpack_require__(62),CID=__webpack_require__(12),reduce=__webpack_require__(479),DAGNode=dagPB.DAGNode,defaultOptions={chunkerOptions:{maxChunkSize:262144}};module.exports=function(createChunker,ipldResolver,createReducer,_options){function createAndStoreDir(item,callback){const d=new UnixFS("directory");waterfall([cb=>DAGNode.create(d.marshal(),cb),(node,cb)=>{ipldResolver.put(node,{cid:new CID(node.multihash)},err=>cb(err,node))}],(err,node)=>{if(err)return callback(err);callback(null,{path:item.path,multihash:node.multihash,size:node.size})})}function createAndStoreFile(file,callback){if(Buffer.isBuffer(file.content)&&(file.content=pull.values([file.content])),"function"!=typeof file.content)return callback(new Error("invalid content"));const reducer=createReducer(reduce(file,ipldResolver,options),options);let previous,count=0;pull(file.content,createChunker(options.chunkerOptions),pull.map(chunk=>new Buffer(chunk)),pull.map(buffer=>new UnixFS("file",buffer)),pull.asyncMap((fileNode,callback)=>{DAGNode.create(fileNode.marshal(),(err,node)=>{callback(err,{DAGNode:node,fileNode:fileNode})})}),pull.asyncMap((leaf,callback)=>{ipldResolver.put(leaf.DAGNode,{cid:new CID(leaf.DAGNode.multihash)},err=>callback(err,leaf))}),pull.map(leaf=>{return{path:file.path,multihash:leaf.DAGNode.multihash,size:leaf.DAGNode.size,leafSize:leaf.fileNode.fileSize(),name:""}}),through(function(data){count++,previous&&this.queue(previous),previous=data},function(){previous&&(1===count&&(previous.single=!0),this.queue(previous)),this.queue(null)}),reducer,pull.collect((err,roots)=>{err?callback(err):callback(null,roots[0])}))}const options=extend({},defaultOptions,_options);return function(source){return function(items,cb){parallel(items.map(item=>cb=>{if(!item.content)return createAndStoreDir(item,(err,node)=>{if(err)return cb(err);node&&source.push(node),cb()});createAndStoreFile(item,(err,node)=>{if(err)return cb(err);node&&source.push(node),cb()})}),cb)}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const pullPushable=__webpack_require__(36),pullWrite=__webpack_require__(117);module.exports=function(createStrategy,ipldResolver,options){const source=pullPushable();return{source:source,sink:pullWrite(createStrategy(source),null,options.highWaterMark,err=>source.end(err))}}},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(5),pushable=__webpack_require__(36),pullPair=__webpack_require__(115),batch=__webpack_require__(155);module.exports=function(reduce,options){const pair=pullPair(),source=pair.source,result=pushable();return pull(source,batch(1/0),pull.asyncMap(reduce),pull.collect((err,roots)=>{if(err)return void result.end(err);1===roots.length?(result.push(roots[0]),result.end()):roots.length>1?result.end(new Error("expected a maximum of 1 roots and got "+roots.length)):result.end()})),{sink:pair.sink,source:result}}},function(module,exports,__webpack_require__){"use strict";const assert=__webpack_require__(7),createBuildStream=__webpack_require__(476),Builder=__webpack_require__(475),reducers={flat:__webpack_require__(477),balanced:__webpack_require__(474),trickle:__webpack_require__(480)},defaultOptions={strategy:"balanced",highWaterMark:100,reduceSingleLeafToSelf:!1};module.exports=function(Chunker,ipldResolver,_options){assert(Chunker,"Missing chunker creator function"),assert(ipldResolver,"Missing IPLD Resolver");const options=Object.assign({},defaultOptions,_options),strategyName=options.strategy,reducer=reducers[strategyName];return assert(reducer,"Unknown importer build strategy name: "+strategyName),createBuildStream(Builder(Chunker,ipldResolver,reducer,options),ipldResolver,options)}},function(module,exports,__webpack_require__){"use strict";const waterfall=__webpack_require__(9),dagPB=__webpack_require__(62),UnixFS=__webpack_require__(42),CID=__webpack_require__(12),DAGLink=dagPB.DAGLink,DAGNode=dagPB.DAGNode;module.exports=function(file,ipldResolver,options){return function(leaves,callback){if(1===leaves.length&&(leaves[0].single||options.reduceSingleLeafToSelf)){const leave=leaves[0];return void callback(null,{path:file.path,multihash:leave.multihash,size:leave.size,leafSize:leave.leafSize,name:leave.name})}const f=new UnixFS("file"),links=leaves.map(leaf=>{return f.addBlockSize(leaf.leafSize),new DAGLink(leaf.name,leaf.size,leaf.multihash)});waterfall([cb=>DAGNode.create(f.marshal(),links,cb),(node,cb)=>{ipldResolver.put(node,{cid:new CID(node.multihash)},err=>cb(err,node))}],(err,node)=>{if(err)return void callback(err);callback(null,{name:"",path:file.path,multihash:node.multihash,size:node.size,leafSize:f.fileSize()})})}}},function(module,exports,__webpack_require__){"use strict";const trickleReducer=__webpack_require__(481),defaultOptions={maxChildrenPerNode:174,layerRepeat:4};module.exports=function(reduce,_options){return trickleReducer(reduce,Object.assign({},defaultOptions,_options))}},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(5),pushable=__webpack_require__(36),batch=__webpack_require__(155),pullPair=__webpack_require__(115),through=__webpack_require__(116),pullWrite=__webpack_require__(117),pause=__webpack_require__(297);module.exports=function(reduce,options){function trickle(indent,maxDepth){function write(nodes,callback){let ended=!1;const node=nodes[0];depth&&!deeper&&(deeper=pushable(),pull(deeper,trickle(indent+1,depth-1),through(function(d){this.queue(d)},function(err){if(err)return void this.emit("error",err);ended||(ended=!0,pendingResumes++,pausable.pause()),this.queue(null)}),batch(1/0),pull.asyncMap(reduce),pull.collect((err,nodes)=>{if(pendingResumes--,err)return void result.end(err);nodes.forEach(node=>{result.push(node)}),iterate()}))),deeper?deeper.push(node):(result.push(node),iterate()),callback()}function iterate(){deeper=null,iteration++,(0===depth&&iteration===options.maxChildrenPerNode||depth>0&&iteration===options.layerRepeat)&&(iteration=0,depth++),(!aborting&&maxDepth>=0&&depth>maxDepth||aborting&&!pendingResumes)&&(aborting=!0,result.end()),pendingResumes||pausable.resume()}function end(err){if(err)return void result.end(err);deeper?aborting||(aborting=!0,deeper.end()):result.end()}let deeper,iteration=0,depth=0,aborting=!1;const result=pushable();return{source:result,sink:pullWrite(write,null,1,end)}}const pair=pullPair(),result=pushable(),pausable=pause(()=>{});let pendingResumes=0;return pull(pair.source,pausable,trickle(0,-1),batch(1/0),pull.asyncMap(reduce),pull.collect((err,roots)=>{err?result.end(err):1===roots.length?(result.push(roots[0]),result.end()):roots.length>1?result.end(new Error("expected a maximum of 1 roots and got "+roots.length)):result.end()})),{sink:pair.sink,source:result}}},function(module,exports,__webpack_require__){"use strict";const pullBlock=__webpack_require__(722);module.exports=(options=>{return pullBlock("number"==typeof options?options:options.maxChunkSize,{zeroPadding:!1,emitEmpty:!0})})},function(module,exports,__webpack_require__){"use strict";function dirExporter(node,name,ipldResolver,resolve,parent){const dir={path:name,hash:node.multihash};return cat([pull.values([dir]),pull(pull.values(node.links),pull.map(link=>({path:path.join(name,link.name),hash:link.multihash})),paramap((item,cb)=>ipldResolver.get(new CID(item.hash),(err,n)=>{if(err)return cb(err);cb(null,resolve(n.value,item.path,ipldResolver,name,parent))})),pull.flatten())])}const path=__webpack_require__(45),pull=__webpack_require__(5),paramap=__webpack_require__(157),CID=__webpack_require__(12),cat=__webpack_require__(156);module.exports=dirExporter},function(module,exports,__webpack_require__){"use strict";function shardedDirExporter(node,name,ipldResolver,resolve,parent){let dir;return parent&&parent.path===name||(dir=[{path:name,hash:cleanHash(node.multihash)}]),cat([pull.values(dir),pull(pull.values(node.links),pull.map(link=>{let p=link.name.substring(2);return p=p?path.join(name,p):name,{name:link.name,path:p,hash:link.multihash}}),paramap((item,cb)=>ipldResolver.get(new CID(item.hash),(err,n)=>{if(err)return cb(err);cb(null,resolve(n.value,item.path,ipldResolver,dir&&dir[0]||parent))})),pull.flatten())])}const path=__webpack_require__(45),pull=__webpack_require__(5),paramap=__webpack_require__(157),CID=__webpack_require__(12),cat=__webpack_require__(156),cleanHash=__webpack_require__(223);module.exports=shardedDirExporter},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const traverse=__webpack_require__(304),UnixFS=__webpack_require__(42),CID=__webpack_require__(12),pull=__webpack_require__(5),paramap=__webpack_require__(157);module.exports=((node,name,ipldResolver)=>{function getData(node){try{const file=UnixFS.unmarshal(node.data);return file.data||new Buffer(0)}catch(err){throw new Error("Failed to unmarshal node")}}function visitor(node){return pull(pull.values(node.links),paramap((link,cb)=>ipldResolver.get(new CID(link.multihash),cb)),pull.map(result=>result.value))}let content=pull(traverse.depthFirst(node,visitor),pull.map(getData));const file=UnixFS.unmarshal(node.data);return pull.values([{content:content,path:name,size:file.fileSize()}])})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(5),CID=__webpack_require__(12),isIPFS=__webpack_require__(541),resolve=__webpack_require__(487).resolve,cleanMultihash=__webpack_require__(223);module.exports=((hash,ipldResolver)=>{return isIPFS.multihash(hash)?(hash=cleanMultihash(hash),pull(ipldResolver.getStream(new CID(hash)),pull.map(result=>result.value),pull.map(node=>resolve(node,hash,ipldResolver)),pull.flatten())):pull.error(new Error("not valid multihash"))})},function(module,exports,__webpack_require__){"use strict";function resolve(node,name,ipldResolver,parentNode){const type=typeOf(node),resolver=resolvers[type];return resolver?resolver(node,name,ipldResolver,resolve,parentNode):pull.error(new Error("Unkown node type "+type))}function typeOf(node){return UnixFS.unmarshal(node.data).type}const UnixFS=__webpack_require__(42),pull=__webpack_require__(5),resolvers={directory:__webpack_require__(483),"hamt-sharded-directory":__webpack_require__(484),file:__webpack_require__(485)};module.exports=Object.assign({resolve:resolve,typeOf:typeOf},resolvers)},function(module,exports,__webpack_require__){"use strict";(function(process){function exists(o){return Boolean(o)}function mapNode(node,index){return node.key}function reduceNodes(nodes){return nodes}function asyncTransformBucket(bucket,asyncMap,asyncReduce,callback){map(bucket._children.compactArray(),(child,callback)=>{child instanceof Bucket?asyncTransformBucket(child,asyncMap,asyncReduce,callback):asyncMap(child,(err,mappedChildren)=>{err?callback(err):callback(null,{bitField:bucket._children.bitField(),children:mappedChildren})})},(err,mappedChildren)=>{err?callback(err):asyncReduce(mappedChildren,callback)})}const SparseArray=__webpack_require__(785),map=__webpack_require__(89),eachSeries=__webpack_require__(87),wrapHash=__webpack_require__(490),defaultOptions={bits:8};class Bucket{constructor(options,parent,posAtParent){if(this._options=Object.assign({},defaultOptions,options),this._popCount=0,this._parent=parent,this._posAtParent=posAtParent,!this._options.hashFn)throw new Error("please define an options.hashFn");this._options.hash||(this._options.hash=wrapHash(this._options.hashFn)),this._children=new SparseArray}static isBucket(o){return o instanceof Bucket}put(key,value,callback){this._findNewBucketAndPos(key,(err,place)=>{if(err)return void callback(err);place.bucket._putAt(place,key,value),callback()})}get(key,callback){this._findChild(key,(err,child)=>{err?callback(err):callback(null,child&&child.value)})}del(key,callback){this._findPlace(key,(err,place)=>{if(err)return void callback(err);const child=place.bucket._at(place.pos);child&&child.key===key&&place.bucket._delAt(place.pos),callback(null)})}leafCount(){this._children.reduce((acc,child)=>{return child instanceof Bucket?acc+child.leafCount():acc+1},0)}childrenCount(){return this._children.length}onlyChild(callback){process.nextTick(()=>callback(null,this._children.get(0)))}eachLeafSeries(iterator,callback){eachSeries(this._children.compactArray(),(child,cb)=>{child instanceof Bucket?child.eachLeafSeries(iterator,cb):iterator(child.key,child.value,cb)},callback)}serialize(map,reduce){return reduce(this._children.reduce((acc,child,index)=>{return child&&(child instanceof Bucket?acc.push(child.serialize(map,reduce)):acc.push(map(child,index))),acc},[]))}asyncTransform(asyncMap,asyncReduce,callback){asyncTransformBucket(this,asyncMap,asyncReduce,callback)}toJSON(){return this.serialize(mapNode,reduceNodes)}prettyPrint(){return JSON.stringify(this.toJSON(),null," ")}tableSize(){return Math.pow(2,this._options.bits)}_findChild(key,callback){this._findPlace(key,(err,result)=>{if(err)return void callback(err);const child=result.bucket._at(result.pos);child&&child.key===key?callback(null,child):callback(null,void 0)})}_findPlace(key,callback){const hashValue=this._options.hash(key);hashValue.take(this._options.bits,(err,index)=>{if(err)return void callback(err);const child=this._children.get(index);if(child instanceof Bucket)child._findPlace(hashValue,callback);else{const place={bucket:this,pos:index,hash:hashValue};callback(null,place)}})}_findNewBucketAndPos(key,callback){this._findPlace(key,(err,place)=>{if(err)return void callback(err);const child=place.bucket._at(place.pos);if(child&&child.key!==key){const bucket=new Bucket(this._options,place.bucket,place.pos);place.bucket._putObjectAt(place.pos,bucket),bucket._findPlace(child.hash,(err,newPlace)=>{if(err)return void callback(err);newPlace.bucket._putAt(newPlace,child.key,child.value),bucket._findNewBucketAndPos(place.hash,callback)})}else callback(null,place)})}_putAt(place,key,value){this._putObjectAt(place.pos,{key:key,value:value,hash:place.hash})}_putObjectAt(pos,object){this._children.get(pos)||this._popCount++,this._children.set(pos,object)}_delAt(pos){this._children.get(pos)&&this._popCount--,this._children.unset(pos),this._level()}_level(){if(this._parent&&this._popCount<=1)if(1===this._popCount){const onlyChild=this._children.find(exists);if(!(onlyChild instanceof Bucket)){const hash=onlyChild.hash;hash.untake(this._options.bits);const place={pos:this._posAtParent,hash:hash};this._parent._putAt(place,onlyChild.key,onlyChild.value)}}else this._parent._delAt(this._posAtParent)}_at(index){return this._children.get(index)}}module.exports=Bucket}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";function byteBitsToInt(byte,start,length){return(byte&maskFor(start,length))>>>start}function maskFor(start,length){return START_MASKS[start]&STOP_MASKS[Math.min(length+start-1,7)]}const START_MASKS=[255,254,252,248,240,224,192,128],STOP_MASKS=[1,3,7,15,31,63,127,255];module.exports=class ConsumableBuffer{constructor(value){this._value=value,this._currentBytePos=value.length-1,this._currentBitPos=7}availableBits(){return this._currentBitPos+1+8*this._currentBytePos}totalBits(){return 8*this._value.length}take(bits){let pendingBits=bits,result=0;for(;pendingBits&&this._haveBits();){const byte=this._value[this._currentBytePos],availableBits=this._currentBitPos+1,taking=Math.min(availableBits,pendingBits),value=byteBitsToInt(byte,availableBits-taking,taking);result=(result<7;)this._currentBitPos-=8,this._currentBytePos+=1}_haveBits(){return this._currentBytePos>=0}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer,process){const whilst=__webpack_require__(90),ConsumableBuffer=__webpack_require__(489);module.exports=function(hashFn){return function(value){return value instanceof InfiniteHash?value:new InfiniteHash(value,hashFn)}};class InfiniteHash{constructor(value,hashFn){if("string"!=typeof value&&!Buffer.isBuffer(value))throw new Error("can only hash strings or buffers");this._value=value,this._hashFn=hashFn,this._depth=-1,this._availableBits=0,this._currentBufferIndex=0,this._buffers=[]}take(bits,callback){let pendingBits=bits;whilst(()=>this._availableBits{this._produceMoreBits(callback)},err=>{if(err)return void callback(err);let result=0;whilst(()=>pendingBits>0,callback=>{const hash=this._buffers[this._currentBufferIndex],available=Math.min(hash.availableBits(),pendingBits);result=(result<{if(err)return void callback(err);process.nextTick(()=>callback(null,result))})})}untake(bits){let pendingBits=bits;for(;pendingBits>0;){const hash=this._buffers[this._currentBufferIndex],availableForUntake=Math.min(hash.totalBits()-hash.availableBits(),pendingBits);hash.untake(availableForUntake),pendingBits-=availableForUntake,this._availableBits+=availableForUntake,this._currentBufferIndex>0&&hash.totalBits()===hash.availableBits()&&(this._depth--,this._currentBufferIndex--)}}_produceMoreBits(callback){this._depth++;const value=this._depth?this._value+this._depth:this._value;this._hashFn(value,(err,hashValue)=>{if(err)return void callback(err);const buffer=new ConsumableBuffer(hashValue);this._buffers.push(buffer),this._availableBits+=buffer.availableBits(),callback()})}}}).call(exports,__webpack_require__(0).Buffer,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";const Bucket=__webpack_require__(488);module.exports=function(options){return new Bucket(options)},module.exports.isBucket=Bucket.isBucket},function(module,exports,__webpack_require__){"use strict";(function(process){function createDirFlat(props){return new DirFlat(props)}const asyncEachSeries=__webpack_require__(87),waterfall=__webpack_require__(9),CID=__webpack_require__(12),dagPB=__webpack_require__(62),UnixFS=__webpack_require__(42),DAGLink=dagPB.DAGLink,DAGNode=dagPB.DAGNode,Dir=__webpack_require__(134);class DirFlat extends Dir{constructor(props){super(),this._children={},Object.assign(this,props)}put(name,value,callback){this.multihash=void 0,this.size=void 0,this._children[name]=value,process.nextTick(callback)}get(name,callback){process.nextTick(()=>callback(null,this._children[name]))}childCount(){return Object.keys(this._children).length}directChildrenCount(){return this.childCount()}onlyChild(callback){process.nextTick(()=>callback(null,this._children[Object.keys(this._children)[0]]))}eachChildSeries(iterator,callback){asyncEachSeries(Object.keys(this._children),(key,callback)=>{iterator(key,this._children[key],callback)},callback)}flush(path,ipldResolver,source,callback){const links=Object.keys(this._children).map(key=>{const child=this._children[key];return new DAGLink(key,child.size,child.multihash)}),dir=new UnixFS("directory");waterfall([callback=>DAGNode.create(dir.marshal(),links,callback),(node,callback)=>{ipldResolver.put(node,{cid:new CID(node.multihash)},err=>callback(err,node))},(node,callback)=>{this.multihash=node.multihash,this.size=node.size;const pushable={path:path,multihash:node.multihash,size:node.size};source.push(pushable),callback(null,node)}],callback)}}module.exports=createDirFlat}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function createDirSharded(props){return new DirSharded(props)}function flush(options,bucket,path,ipldResolver,source,callback){function collectChild(child,index,callback){const labelPrefix=leftPad(index.toString(16).toUpperCase(),2,"0");if(Bucket.isBucket(child))flush(options,child,path,ipldResolver,null,(err,node)=>{if(err)return void callback(err);links.push(new DAGLink(labelPrefix,node.size,node.multihash)),callback()});else{const value=child.value,label=labelPrefix+child.key;links.push(new DAGLink(label,value.size,value.multihash)),callback()}}function haveLinks(links){const data=new Buffer(children.bitField().reverse()),dir=new UnixFS("hamt-sharded-directory",data);dir.fanout=bucket.tableSize(),dir.hashType=options.hashFn.code,waterfall([callback=>DAGNode.create(dir.marshal(),links,callback),(node,callback)=>{ipldResolver.put(node,{cid:new CID(node.multihash)},err=>callback(err,node))},(node,callback)=>{const pushable={path:path,multihash:node.multihash,size:node.size};source&&source.push(pushable),callback(null,node)}],callback)}const children=bucket._children;let index=0;const links=[];whilst(()=>index{const child=children.get(index);child?collectChild(child,index,err=>{index++,callback(err)}):(index++,callback())},err=>{if(err)return void callback(err);haveLinks(links)})}const leftPad=__webpack_require__(242),whilst=__webpack_require__(90),waterfall=__webpack_require__(9),CID=__webpack_require__(12),dagPB=__webpack_require__(62),UnixFS=__webpack_require__(42),DAGLink=dagPB.DAGLink,DAGNode=dagPB.DAGNode,multihashing=__webpack_require__(30),Dir=__webpack_require__(134),Bucket=__webpack_require__(491),hashFn=function(value,callback){multihashing(value,"murmur3-128",(err,hash)=>{if(err)callback(err);else{const justHash=hash.slice(2,10),length=justHash.length,result=new Buffer(length);for(let i=0;i{err?callback(err):(this.multihash=node.multihash,this.size=node.size),callback(null,node)})}}module.exports=createDirSharded}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function flatToShard(child,dir,threshold,callback){maybeFlatToShardOne(dir,threshold,(err,newDir)=>{if(err)return void callback(err);const parent=newDir.parent;parent?waterfall([callback=>{ +newDir!==dir?(child&&(child.parent=newDir),parent.put(newDir.parentKey,newDir,callback)):callback()},callback=>{parent?flatToShard(newDir,parent,threshold,callback):callback(null,newDir)}],callback):callback(null,newDir)})}function maybeFlatToShardOne(dir,threshold,callback){dir.flat&&dir.directChildrenCount()>=threshold?definitelyShardOne(dir,callback):callback(null,dir)}function definitelyShardOne(oldDir,callback){const newDir=DirSharded({root:oldDir.root,dir:!0,parent:oldDir.parent,parentKey:oldDir.parentKey,path:oldDir.path,dirty:oldDir.dirty,flat:!1});oldDir.eachChildSeries((key,value,callback)=>{newDir.put(key,value,callback)},err=>{err?callback(err):callback(err,newDir)})}const waterfall=__webpack_require__(9),DirSharded=__webpack_require__(493);module.exports=flatToShard},function(module,exports,__webpack_require__){"use strict";(function(process){const pause=__webpack_require__(297),pull=__webpack_require__(5),writable=__webpack_require__(117),pushable=__webpack_require__(36),assert=__webpack_require__(7),setImmediate=__webpack_require__(11),DAGBuilder=__webpack_require__(478),createTreeBuilder=__webpack_require__(496),chunkers={fixed:__webpack_require__(482)},defaultOptions={chunker:"fixed"};module.exports=function(ipldResolver,_options){function flush(callback){function proceed(){treeBuilder.flush((err,hash)=>{if(err)return treeBuilderStream.source.end(err),void callback(err);pausable.resume(),callback(null,hash)})}pausable.pause(),pending?waitingPending.push(proceed):proceed()}const options=Object.assign({},defaultOptions,_options),Chunker=chunkers[options.chunker];assert(Chunker,"Unknkown chunker named "+options.chunker);let pending=0;const waitingPending=[],entry={sink:writable((nodes,callback)=>{pending+=nodes.length,nodes.forEach(node=>entry.source.push(node)),setImmediate(callback)},null,1,err=>entry.source.end(err)),source:pushable()},dagStream=DAGBuilder(Chunker,ipldResolver,options),treeBuilder=createTreeBuilder(ipldResolver,options),treeBuilderStream=treeBuilder.stream(),pausable=pause(()=>{});return pull(entry,pausable,dagStream,pull.map(node=>{return pending--,pending||process.nextTick(()=>{for(;waitingPending.length;)waitingPending.shift()()}),node}),treeBuilderStream),{sink:entry.sink,source:treeBuilderStream.source,flush:flush}}}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";(function(process){function createTreeBuilder(ipldResolver,_options){function consumeQueue(action,callback){const args=action.args.concat(function(){action.cb.apply(null,arguments),callback()});action.fn.apply(null,args)}function getStream(){return stream}function addToTree(elem,callback){const pathElems=elem.path.split("/").filter(notEmpty);let parent=tree;const lastIndex=pathElems.length-1;let currentPath="";eachOfSeries(pathElems,(pathElem,index,callback)=>{currentPath&&(currentPath+="/"),currentPath+=pathElem;const last=index===lastIndex;parent.dirty=!0,parent.multihash=null,parent.size=null,last?waterfall([callback=>parent.put(pathElem,elem,callback),callback=>flatToShard(null,parent,options.shardSplitThreshold,callback),(newRoot,callback)=>{tree=newRoot,callback()}],callback):parent.get(pathElem,(err,treeNode)=>{if(err)return void callback(err);let dir=treeNode;dir&&dir instanceof Dir||(dir=DirFlat({dir:!0,parent:parent,parentKey:pathElem,path:currentPath,dirty:!0,flat:!0}));const parentDir=parent;parent=dir,parentDir.put(pathElem,dir,callback)})},callback)}function flushRoot(callback){queue.push({fn:flush,args:["",tree],cb:(err,node)=>{err?callback(err):callback(null,node&&node.multihash)}})}function flush(path,tree,callback){if(tree.dir){if(tree.root&&tree.childCount()>1&&!options.wrap)return void callback(new Error("detected more than one root"));tree.eachChildSeries((key,child,callback)=>{flush(path?path+"/"+key:key,child,callback)},err=>{if(err)return void callback(err);flushDir(path,tree,callback)})}else process.nextTick(callback)}function flushDir(path,tree,callback){return tree.root&&!options.wrap?void tree.onlyChild((err,onlyChild)=>{if(err)return void callback(err);callback(null,onlyChild)}):tree.dirty?(tree.dirty=!1,void tree.flush(path,ipldResolver,stream.source,(err,node)=>{err?callback(err):callback(null,node)})):void callback(null,tree.multihash)}const options=Object.assign({},defaultOptions,_options),queue=createQueue(consumeQueue,1);let stream=function(){function write(elems,callback){eachSeries(elems,(elem,callback)=>{queue.push({fn:addToTree,args:[elem],cb:err=>{err?callback(err):(source.push(elem),callback())}})},callback)}function ended(err){flushRoot(flushErr=>{source.end(flushErr||err)})}const sink=writable(write,null,1,ended),source=pushable();return{sink:sink,source:source}}(),tree=DirFlat({path:"",root:!0,dir:!0,dirty:!1,flat:!0});return{flush:flushRoot,stream:getStream}}function notEmpty(str){return Boolean(str)}const eachSeries=__webpack_require__(87),eachOfSeries=__webpack_require__(175),waterfall=__webpack_require__(9),createQueue=__webpack_require__(181),writable=__webpack_require__(117),pushable=__webpack_require__(36),DirFlat=__webpack_require__(492),flatToShard=__webpack_require__(494),Dir=__webpack_require__(134);module.exports=createTreeBuilder;const defaultOptions={wrap:!1,shardSplitThreshold:1e3}}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";exports.importer=exports.Importer=__webpack_require__(495),exports.exporter=exports.Exporter=__webpack_require__(486)},function(module,exports,__webpack_require__){"use strict";module.exports=`message Data { + enum DataType { + Raw = 0; + Directory = 1; + File = 2; + Metadata = 3; + Symlink = 4; + HAMTShard = 5; + } + + required DataType Type = 1; + optional bytes Data = 2; + optional uint64 filesize = 3; + repeated uint64 blocksizes = 4; + + optional uint64 hashType = 5; + optional uint64 fanout = 6; +} + +message Metadata { + required string MimeType = 1; +}`},function(module,exports,__webpack_require__){"use strict";exports.util=__webpack_require__(225),exports.resolver=__webpack_require__(224)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(17),multibase=__webpack_require__(43),multicodec=__webpack_require__(44),codecs=__webpack_require__(35),codecVarints=__webpack_require__(38),multihash=__webpack_require__(17);class CID{constructor(version,codec,multihash){if("string"==typeof version)if(multibase.isEncoded(version)){const cid=multibase.decode(version);this.version=parseInt(cid.slice(0,1).toString("hex"),16),this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=mh.fromB58String(version),this.version=0;else if(Buffer.isBuffer(version)){const firstByte=version.slice(0,1),v=parseInt(firstByte.toString("hex"),16);if(0===v||1===v){const cid=version;this.version=v,this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=version,this.version=0}else if("number"==typeof version){if("string"!=typeof codec)throw new Error("codec must be string");if(0!==version&&1!==version)throw new Error("version must be a number equal to 0 or 1");mh.validate(multihash),this.codec=codec,this.version=version,this.multihash=multihash}}get buffer(){switch(this.version){case 0:return this.multihash;case 1:return Buffer.concat([Buffer("01","hex"),Buffer(codecVarints[this.codec]),this.multihash]);default:throw new Error("unsupported version")}}get prefix(){return Buffer.concat([new Buffer(`0${this.version}`,"hex"),codecVarints[this.codec],multihash.prefix(this.multihash)])}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");return new CID(0,this.codec,this.multihash)}toV1(){return new CID(1,this.codec,this.multihash)}toBaseEncodedString(base){switch(base=base||"base58btc",this.version){case 0:if("base58btc"!==base)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");return mh.toB58String(this.multihash);case 1:return multibase.encode(base,this.buffer).toString();default:throw new Error("Unsupported version")}}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(other){return this.codec===other.codec&&this.version===other.version&&this.multihash.equals(other.multihash)}}CID.codecs=codecs,CID.isCID=(other=>{return"CID"===other.constructor.name}),module.exports=CID}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function create(name,size,multihash,callback){callback(null,new DAGLink(name,size,multihash))}const DAGLink=__webpack_require__(61);module.exports=create},function(module,exports,__webpack_require__){"use strict";function addLink(node,link,callback){const links=cloneLinks(node),data=cloneData(node);if(link.constructor&&"DAGLink"===link.constructor.name);else if(link.constructor&&"DAGNode"===link.constructor.name)link=toDAGLink(link);else{link.multihash=link.multihash||link.hash;try{link=new DAGLink(link.name,link.size,link.multihash)}catch(err){return callback(err)}}links.push(link),create(data,links,callback)}const dagNodeUtil=__webpack_require__(102),cloneLinks=dagNodeUtil.cloneLinks,cloneData=dagNodeUtil.cloneData,toDAGLink=dagNodeUtil.toDAGLink,DAGLink=__webpack_require__(61),create=__webpack_require__(101);module.exports=addLink},function(module,exports,__webpack_require__){"use strict";function clone(dagNode,callback){create(cloneData(dagNode),cloneLinks(dagNode),callback)}const dagNodeUtil=__webpack_require__(102),cloneLinks=dagNodeUtil.cloneLinks,cloneData=dagNodeUtil.cloneData,create=__webpack_require__(101);module.exports=clone},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function rmLink(dagNode,nameOrMultihash,callback){const data=cloneData(dagNode);let links=cloneLinks(dagNode);if("string"==typeof nameOrMultihash)links=links.filter(link=>link.name!==nameOrMultihash);else{if(!Buffer.isBuffer(nameOrMultihash))return callback(new Error("second arg needs to be a name or multihash"),null);links=links.filter(link=>!link.multihash.equals(nameOrMultihash))}create(data,links,callback)}const dagNodeUtil=__webpack_require__(102),cloneLinks=dagNodeUtil.cloneLinks,cloneData=dagNodeUtil.cloneData,create=__webpack_require__(101);module.exports=rmLink}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";module.exports=`// An IPFS MerkleDAG Link +message PBLink { + + // multihash of the target object + optional bytes Hash = 1; + + // utf string name. should be unique per object + optional string Name = 2; + + // cumulative size of target object + optional uint64 Tsize = 3; +} + +// An IPFS MerkleDAG Node +message PBNode { + + // refs to other objects + repeated PBLink Links = 2; + + // opaque user data + optional bytes Data = 1; +}`},function(module,exports,__webpack_require__){"use strict";const waterfall=__webpack_require__(9),util=__webpack_require__(136);exports=module.exports,exports.multicodec="dag-pb",exports.resolve=((block,path,callback)=>{waterfall([cb=>util.deserialize(block.data,cb),(node,cb)=>{const split=path.split("/");if("Links"===split[0]){let remainderPath="";if(!split[1])return cb(null,{value:node.links.map(l=>l.toJSON()),remainderPath:""});const values={};node.links.forEach((l,i)=>{const link=l.toJSON();values[i]={hash:link.multihash,name:link.name,size:link.size},values[link.name]=link.multihash});let value=values[split[1]];"Hash"===split[2]?value={"/":value.hash}:"Tsize"===split[2]?value={"/":value.size}:"Name"===split[2]&&(value={"/":value.name}),remainderPath=split.slice(3).join("/"),cb(null,{value:value,remainderPath:remainderPath})}else"Data"===split[0]?cb(null,{value:node.data,remainderPath:""}):cb(new Error("path not available"))}],callback)}),exports.tree=((block,options,callback)=>{"function"==typeof options&&(callback=options,options={}),options=options||{},util.deserialize(block.data,(err,node)=>{if(err)return callback(err);const paths=[];paths.push("Links"),node.links.forEach((link,i)=>{paths.push(`Links/${i}/Name`),paths.push(`Links/${i}/Tsize`),paths.push(`Links/${i}/Hash`)}),paths.push("Data"),callback(null,paths)})}),exports.isLink=((block,path,callback)=>{exports.resolve(block,path,(err,result)=>{return err?callback(err):result.remainderPath.length>0?callback(new Error("path out of scope")):void("object"==typeof result.value&&result.value["/"]?callback(null,result.value):callback(null,!1))})})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(137),multibase=__webpack_require__(43),multicodec=__webpack_require__(44),codecs=__webpack_require__(35),codecVarints=__webpack_require__(38),multihash=__webpack_require__(137);class CID{constructor(version,codec,multihash){if("string"==typeof version)if(multibase.isEncoded(version)){const cid=multibase.decode(version);this.version=parseInt(cid.slice(0,1).toString("hex"),16),this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=mh.fromB58String(version),this.version=0;else if(Buffer.isBuffer(version)){const firstByte=version.slice(0,1),v=parseInt(firstByte.toString("hex"),16);if(0===v||1===v){const cid=version;this.version=v,this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=version,this.version=0}else if("number"==typeof version){if("string"!=typeof codec)throw new Error("codec must be string");if(0!==version&&1!==version)throw new Error("version must be a number equal to 0 or 1");mh.validate(multihash),this.codec=codec,this.version=version,this.multihash=multihash}}get buffer(){switch(this.version){case 0:return this.multihash;case 1:return Buffer.concat([Buffer("01","hex"),Buffer(codecVarints[this.codec]),this.multihash]);default:throw new Error("unsupported version")}}get prefix(){return Buffer.concat([new Buffer(`0${this.version}`,"hex"),codecVarints[this.codec],multihash.prefix(this.multihash)])}toV0(){return this.multihash}toV1(){return this.buffer}toBaseEncodedString(base){switch(base=base||"base58btc",this.version){case 0:return mh.toB58String(this.multihash);case 1:return multibase.encode(base,this.buffer).toString();default:throw new Error("Unsupported version")}}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(other){return this.codec===other.codec&&this.version===other.version&&this.multihash.equals(other.multihash)}}CID.codecs=codecs,CID.isCID=(other=>{return"CID"===other.constructor.name}),module.exports=CID}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.names={sha1:17,"sha2-256":18,"sha2-512":19,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,murmur3:34,blake2b:64,blake2s:65},exports.codes={17:"sha1",18:"sha2-256",19:"sha2-512",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384",29:"keccak-512",34:"murmur3",64:"blake2b",65:"blake2s"},exports.defaultLengths={17:20,18:32,19:64,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,64:64,65:32}},function(module,exports,__webpack_require__){"use strict";function cidForHash(codec,rawhash){return new CID(1,codec,multihashes.encode(rawhash,"keccak-256"))}const CID=__webpack_require__(507),multihashes=__webpack_require__(137);module.exports={cidForHash:cidForHash}},function(module,exports,__webpack_require__){"use strict";exports.util=__webpack_require__(226),exports.resolver=__webpack_require__(511)},function(module,exports,__webpack_require__){"use strict";const util=__webpack_require__(226);exports=module.exports,exports.multicodec="eth-account-snapshot",exports.resolve=((block,path,callback)=>{let result;util.deserialize(block.data,(err,node)=>{if(err)return callback(err);if(!path||"/"===path)return result={value:node,remainderPath:""},callback(null,result);let pathParts=path.split("/"),firstPart=pathParts.shift(),remainderPath=pathParts.join("/");exports.tree(block,(err,paths)=>{if(err)return callback(err);let treeResult=paths.find(child=>child.path===firstPart);if(!treeResult){let err=new Error('Path not found ("'+firstPart+'").');return callback(err)}return result={value:treeResult.value,remainderPath:remainderPath},callback(null,result)})})}),exports.tree=((block,options,callback)=>{"function"==typeof options&&(callback=options,options=void 0),options||(options={}),util.deserialize(block.data,(err,account)=>{if(err)return callback(err);const paths=[];paths.push({path:"stateRoot",value:account.stateRoot}),paths.push({path:"codeHash",value:account.codeHash}),paths.push({path:"nonce",value:account.nonce}),paths.push({path:"balance",value:account.balance}),paths.push({path:"isEmpty",value:account.isEmpty()}),paths.push({path:"isContract",value:account.isContract()}),callback(null,paths)})})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(103),multibase=__webpack_require__(43),multicodec=__webpack_require__(44),codecs=__webpack_require__(35),codecVarints=__webpack_require__(38),multihash=__webpack_require__(103);class CID{constructor(version,codec,multihash){if("string"==typeof version)if(multibase.isEncoded(version)){const cid=multibase.decode(version);this.version=parseInt(cid.slice(0,1).toString("hex"),16),this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=mh.fromB58String(version),this.version=0;else if(Buffer.isBuffer(version)){const firstByte=version.slice(0,1),v=parseInt(firstByte.toString("hex"),16);if(0===v||1===v){const cid=version;this.version=v,this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=version,this.version=0}else if("number"==typeof version){if("string"!=typeof codec)throw new Error("codec must be string");if(0!==version&&1!==version)throw new Error("version must be a number equal to 0 or 1");mh.validate(multihash),this.codec=codec,this.version=version,this.multihash=multihash}}get buffer(){switch(this.version){case 0:return this.multihash;case 1:return Buffer.concat([Buffer("01","hex"),Buffer(codecVarints[this.codec]),this.multihash]);default:throw new Error("unsupported version")}}get prefix(){return Buffer.concat([new Buffer(`0${this.version}`,"hex"),codecVarints[this.codec],multihash.prefix(this.multihash)])}toV0(){return this.multihash}toV1(){return this.buffer}toBaseEncodedString(base){switch(base=base||"base58btc",this.version){case 0:return mh.toB58String(this.multihash);case 1:return multibase.encode(base,this.buffer).toString();default:throw new Error("Unsupported version")}}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(other){return this.codec===other.codec&&this.version===other.version&&this.multihash.equals(other.multihash)}}CID.codecs=codecs,CID.isCID=(other=>{return"CID"===other.constructor.name}),module.exports=CID}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.names={sha1:17,"sha2-256":18,"sha2-512":19,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,murmur3:34,blake2b:64,blake2s:65},exports.codes={17:"sha1",18:"sha2-256",19:"sha2-512",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384",29:"keccak-512",34:"murmur3",64:"blake2b",65:"blake2s"},exports.defaultLengths={17:20,18:32,19:64,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,64:64,65:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function webCryptoHash(type){if(!webCrypto)throw new Error("Please use a browser with webcrypto support");return(data,callback)=>{const res=webCrypto.digest({name:type},data);if("function"!=typeof res.then)return res.onerror=(()=>{callback(`Error hashing data using ${type}`)}),void(res.oncomplete=(e=>{callback(null,e.target.result)}));nodeify(res.then(raw=>new Buffer(new Uint8Array(raw))),callback)}}function sha1(buf,callback){webCryptoHash("SHA-1")(buf,callback)}function sha2256(buf,callback){webCryptoHash("SHA-256")(buf,callback)}function sha2512(buf,callback){webCryptoHash("SHA-512")(buf,callback)}const nodeify=__webpack_require__(81),webCrypto=function(){if("undefined"!=typeof window){if(window.crypto)return window.crypto.subtle||window.crypto.webkitSubtle;if(window.msCrypto)return window.msCrypto.subtle}}();module.exports={sha1:sha1,sha2256:sha2256,sha2512:sha2512}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const sha3=__webpack_require__(237),toCallback=__webpack_require__(517),sha=__webpack_require__(514),toBuf=(doWork,other)=>input=>{return new Buffer(doWork(input,other),"hex")};module.exports={sha1:sha.sha1,sha2256:sha.sha2256,sha2512:sha.sha2512,sha3512:toCallback(toBuf(sha3.sha3_512)),sha3384:toCallback(toBuf(sha3.sha3_384)),sha3256:toCallback(toBuf(sha3.sha3_256)),sha3224:toCallback(toBuf(sha3.sha3_224)),shake128:toCallback(toBuf(sha3.shake_128,256)),shake256:toCallback(toBuf(sha3.shake_256,512)),keccak224:toCallback(toBuf(sha3.keccak_224)),keccak256:toCallback(toBuf(sha3.keccak_256)),keccak384:toCallback(toBuf(sha3.keccak_384)),keccak512:toCallback(toBuf(sha3.keccak_512))}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function Multihashing(buf,func,length,callback){if("function"==typeof length&&(callback=length,length=void 0),!callback)throw new Error("Missing callback");Multihashing.digest(buf,func,length,(err,digest)=>{if(err)return callback(err);callback(null,multihash.encode(digest,func,length))})}const multihash=__webpack_require__(103),crypto=__webpack_require__(515);module.exports=Multihashing,Multihashing.Buffer=Buffer,Multihashing.multihash=multihash,Multihashing.digest=function(buf,func,length,callback){if("function"==typeof length&&(callback=length,length=void 0),!callback)throw new Error("Missing callback");let cb=callback;length&&(cb=((err,digest)=>{if(err)return callback(err);callback(null,digest.slice(0,length))}));let hash;try{hash=Multihashing.createHash(func)}catch(err){return cb(err)}hash(buf,cb)},Multihashing.createHash=function(func){if(func=multihash.coerceCode(func),!Multihashing.functions[func])throw new Error("multihash function "+func+" not yet supported");return Multihashing.functions[func]},Multihashing.functions={17:crypto.sha1,18:crypto.sha2256,19:crypto.sha2512,20:crypto.sha3512,21:crypto.sha3384,22:crypto.sha3256,23:crypto.sha3224,24:crypto.shake128,25:crypto.shake256,26:crypto.keccak224,27:crypto.keccak256,28:crypto.keccak384,29:crypto.keccak512}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const setImmediate=__webpack_require__(11);module.exports=function(doWork){return function(input,callback){const done=(err,res)=>setImmediate(()=>{callback(err,res)});let res;try{res=doWork(input)}catch(err){return void done(err)}done(null,res)}}},function(module,exports,__webpack_require__){"use strict";exports.util=__webpack_require__(228),exports.resolver=__webpack_require__(519)},function(module,exports,__webpack_require__){"use strict";const async=__webpack_require__(86),EthBlockHead=__webpack_require__(209),IpldEthBlock=__webpack_require__(231),util=__webpack_require__(228);__webpack_require__(227).cidForHash;exports=module.exports,exports.multicodec="eth-block-list",exports.resolve=((block,path,callback)=>{util.deserialize(block.data,(err,ethBlockList)=>{if(err)return callback(err);exports.resolveFromObject(ethBlockList,path,callback)})}),exports.resolveFromObject=((ethBlockList,path,callback)=>{let result;if(!path||"/"===path)return result={value:ethBlockList,remainderPath:""},callback(null,result);exports.treeFromObject(ethBlockList,{},(err,paths)=>{if(err)return callback(err);let matches=paths.filter(child=>child.path===path.slice(0,child.path.length)),sortedMatches=matches.sort((a,b)=>a.path.length{"function"==typeof options&&(callback=options,options=void 0),options||(options={}),util.deserialize(block.data,(err,ethBlockList)=>{if(err)return callback(err);exports.treeFromObject(ethBlockList,options,callback)})}),exports.treeFromObject=((ethBlockList,options,callback)=>{let paths=[];paths.push({path:"count",value:ethBlockList.length}),async.each(ethBlockList,(rawBlock,next)=>{let index=ethBlockList.indexOf(rawBlock),blockPath=index.toString(),ethBlock=new EthBlockHead(rawBlock);paths.push({path:blockPath,value:ethBlock}),IpldEthBlock.resolver.treeFromObject(ethBlock,{},(err,subpaths)=>{if(err)return next(err);subpaths.forEach(path=>path.path=blockPath+"/"+path.path),paths=paths.concat(subpaths),next()})},err=>{if(err)return callback(err);callback(null,paths)})})},function(module,exports,__webpack_require__){"use strict";exports.names={sha1:17,"sha2-256":18,"sha2-512":19,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,"murmur3-128":34,"murmur3-32":35,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664},exports.codes={17:"sha1",18:"sha2-256",19:"sha2-512",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384",29:"keccak-512",34:"murmur3-128",35:"murmur3-32",45569:"blake2b-8",45570:"blake2b-16",45571:"blake2b-24",45572:"blake2b-32",45573:"blake2b-40",45574:"blake2b-48",45575:"blake2b-56",45576:"blake2b-64",45577:"blake2b-72",45578:"blake2b-80",45579:"blake2b-88",45580:"blake2b-96",45581:"blake2b-104",45582:"blake2b-112",45583:"blake2b-120",45584:"blake2b-128",45585:"blake2b-136",45586:"blake2b-144",45587:"blake2b-152",45588:"blake2b-160",45589:"blake2b-168",45590:"blake2b-176",45591:"blake2b-184",45592:"blake2b-192",45593:"blake2b-200",45594:"blake2b-208",45595:"blake2b-216",45596:"blake2b-224",45597:"blake2b-232",45598:"blake2b-240",45599:"blake2b-248",45600:"blake2b-256",45601:"blake2b-264",45602:"blake2b-272",45603:"blake2b-280",45604:"blake2b-288",45605:"blake2b-296",45606:"blake2b-304",45607:"blake2b-312",45608:"blake2b-320",45609:"blake2b-328",45610:"blake2b-336",45611:"blake2b-344",45612:"blake2b-352",45613:"blake2b-360",45614:"blake2b-368",45615:"blake2b-376",45616:"blake2b-384",45617:"blake2b-392",45618:"blake2b-400",45619:"blake2b-408",45620:"blake2b-416",45621:"blake2b-424",45622:"blake2b-432",45623:"blake2b-440",45624:"blake2b-448",45625:"blake2b-456",45626:"blake2b-464",45627:"blake2b-472",45628:"blake2b-480",45629:"blake2b-488",45630:"blake2b-496",45631:"blake2b-504",45632:"blake2b-512",45633:"blake2s-8",45634:"blake2s-16",45635:"blake2s-24",45636:"blake2s-32",45637:"blake2s-40",45638:"blake2s-48",45639:"blake2s-56",45640:"blake2s-64",45641:"blake2s-72",45642:"blake2s-80",45643:"blake2s-88",45644:"blake2s-96",45645:"blake2s-104",45646:"blake2s-112",45647:"blake2s-120",45648:"blake2s-128",45649:"blake2s-136",45650:"blake2s-144",45651:"blake2s-152",45652:"blake2s-160",45653:"blake2s-168",45654:"blake2s-176",45655:"blake2s-184",45656:"blake2s-192",45657:"blake2s-200",45658:"blake2s-208",45659:"blake2s-216",45660:"blake2s-224",45661:"blake2s-232",45662:"blake2s-240",45663:"blake2s-248",45664:"blake2s-256"},exports.defaultLengths={17:20,18:32,19:64,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,45569:1,45570:2,45571:3,45572:4,45573:5,45574:6,45575:7,45576:8,45577:9,45578:10,45579:11,45580:12,45581:13,45582:14,45583:15,45584:16,45585:17,45586:18,45587:19,45588:20,45589:21,45590:22,45591:23,45592:24,45593:25,45594:26,45595:27,45596:28,45597:29,45598:30,45599:31,45600:32,45601:33,45602:34,45603:35,45604:36,45605:37,45606:38,45607:39,45608:40,45609:41,45610:42,45611:43,45612:44,45613:45,45614:46,45615:47,45616:48,45617:49,45618:50,45619:51,45620:52,45621:53,45622:54,45623:55,45624:56,45625:57,45626:58,45627:59,45628:60,45629:61,45630:62,45631:63,45632:64,45633:1,45634:2,45635:3,45636:4,45637:5,45638:6,45639:7,45640:8,45641:9,45642:10,45643:11,45644:12,45645:13,45646:14,45647:15,45648:16,45649:17,45650:18,45651:19,45652:20,45653:21,45654:22,45655:23,45656:24,45657:25,45658:26,45659:27,45660:28,45661:29,45662:30,45663:31,45664:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(229),multibase=__webpack_require__(43),multicodec=__webpack_require__(44),codecs=__webpack_require__(35),codecVarints=__webpack_require__(38),multihash=__webpack_require__(229);class CID{constructor(version,codec,multihash){if("string"==typeof version)if(multibase.isEncoded(version)){const cid=multibase.decode(version);this.version=parseInt(cid.slice(0,1).toString("hex"),16),this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=mh.fromB58String(version),this.version=0;else if(Buffer.isBuffer(version)){const firstByte=version.slice(0,1),v=parseInt(firstByte.toString("hex"),16);if(0===v||1===v){const cid=version;this.version=v,this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=version,this.version=0}else if("number"==typeof version){if("string"!=typeof codec)throw new Error("codec must be string");if(0!==version&&1!==version)throw new Error("version must be a number equal to 0 or 1");mh.validate(multihash),this.codec=codec,this.version=version,this.multihash=multihash}}get buffer(){switch(this.version){case 0:return this.multihash;case 1:return Buffer.concat([Buffer("01","hex"),Buffer(codecVarints[this.codec]),this.multihash]);default:throw new Error("unsupported version")}}get prefix(){return Buffer.concat([new Buffer(`0${this.version}`,"hex"),codecVarints[this.codec],multihash.prefix(this.multihash)])}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");return new CID(0,this.codec,this.multihash)}toV1(){return new CID(1,this.codec,this.multihash)}toBaseEncodedString(base){switch(base=base||"base58btc",this.version){case 0:if("base58btc"!==base)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");return mh.toB58String(this.multihash);case 1:return multibase.encode(base,this.buffer).toString();default:throw new Error("Unsupported version")}}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(other){return this.codec===other.codec&&this.version===other.version&&this.multihash.equals(other.multihash)}}CID.codecs=codecs,CID.isCID=(other=>{return"CID"===other.constructor.name}),module.exports=CID}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.names={sha1:17,"sha2-256":18,"sha2-512":19,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,murmur3:34,blake2b:64,blake2s:65},exports.codes={17:"sha1",18:"sha2-256",19:"sha2-512",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384",29:"keccak-512",34:"murmur3",64:"blake2b",65:"blake2s"},exports.defaultLengths={17:20,18:32,19:64,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,64:64,65:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function validate(multihash){if(!Buffer.isBuffer(multihash))throw new Error("multihash must be a Buffer");if(multihash.length<3)throw new Error("multihash too short. must be > 3 bytes.");if(multihash.length>129)throw new Error("multihash too long. must be < 129 bytes.");let code=multihash[0];if(!exports.isValidCode(code))throw new Error(`multihash unknown function code: 0x${code.toString(16)}`);if(multihash.slice(2).length!==multihash[1])throw new Error(`multihash length inconsistent: 0x${multihash.toString("hex")}`)}const bs58=__webpack_require__(24),cs=__webpack_require__(522);exports.toHexString=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return hash.toString("hex")},exports.fromHexString=function(hash){return new Buffer(hash,"hex")},exports.toB58String=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return bs58.encode(hash)},exports.fromB58String=function(hash){let encoded=hash;return Buffer.isBuffer(hash)&&(encoded=hash.toString()),new Buffer(bs58.decode(encoded))},exports.decode=function(buf){exports.validate(buf);const code=buf[0];return{code:code,name:cs.codes[code],length:buf[1],digest:buf.slice(2)}},exports.encode=function(digest,code,length){if(!digest||!code)throw new Error("multihash encode requires at least two args: digest, code");const hashfn=exports.coerceCode(code);if(!Buffer.isBuffer(digest))throw new Error("digest should be a Buffer");if(null==length&&(length=digest.length),length&&digest.length!==length)throw new Error("digest length should be equal to specified length.");if(length>127)throw new Error("multihash does not yet support digest lengths greater than 127 bytes.");return Buffer.concat([new Buffer([hashfn,length]),digest])},exports.coerceCode=function(name){let code=name;if("string"==typeof name){if(!cs.names[name])throw new Error(`Unrecognized hash function named: ${name}`);code=cs.names[name]}if("number"!=typeof code)throw new Error(`Hash function code should be a number. Got: ${code}`);if(!cs.codes[code]&&!exports.isAppCode(code))throw new Error(`Unrecognized function code: ${code}`);return code},exports.isAppCode=function(code){return code>0&&code<16},exports.isValidCode=function(code){return!!exports.isAppCode(code)||!!cs.codes[code]},exports.validate=validate,exports.prefix=function(multihash){return validate(multihash),multihash.slice(0,2)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const util=__webpack_require__(232),cidForHash=__webpack_require__(230).cidForHash;exports=module.exports,exports.multicodec="eth-block",exports.resolve=((block,path,callback)=>{util.deserialize(block.data,(err,ethBlock)=>{if(err)return callback(err);exports.resolveFromObject(ethBlock,path,callback)})}),exports.resolveFromObject=((ethBlock,path,callback)=>{let result;if(!path||"/"===path)return result={value:ethBlock,remainderPath:""},callback(null,result);let pathParts=path.split("/"),firstPart=pathParts.shift(),remainderPath=pathParts.join("/");exports.treeFromObject(ethBlock,{},(err,paths)=>{if(err)return callback(err);let treeResult=paths.find(child=>child.path===firstPart);if(!treeResult){let err=new Error('Path not found ("'+firstPart+'").');return callback(err)}return result={value:treeResult.value,remainderPath:remainderPath},callback(null,result)})}),exports.tree=((block,options,callback)=>{"function"==typeof options&&(callback=options,options=void 0),options||(options={}),util.deserialize(block.data,(err,ethBlock)=>{if(err)return callback(err);exports.treeFromObject(ethBlock,options,callback)})}),exports.treeFromObject=((ethBlock,options,callback)=>{const paths=[];paths.push({path:"parent",value:{"/":cidForHash("eth-block",ethBlock.parentHash).toBaseEncodedString()}}),paths.push({path:"ommers",value:{"/":cidForHash("eth-block-list",ethBlock.uncleHash).toBaseEncodedString()}}),paths.push({path:"transactions",value:{"/":cidForHash("eth-tx-trie",ethBlock.transactionsTrie).toBaseEncodedString()}}),paths.push({path:"transactionReceipts",value:{"/":cidForHash("eth-tx-receipt-trie",ethBlock.receiptTrie).toBaseEncodedString()}}),paths.push({path:"state",value:{"/":cidForHash("eth-state-trie",ethBlock.stateRoot).toBaseEncodedString()}}),paths.push({path:"parentHash",value:ethBlock.parentHash}),paths.push({path:"ommerHash",value:ethBlock.uncleHash}),paths.push({path:"transactionTrieRoot",value:ethBlock.transactionsTrie}),paths.push({path:"transactionReceiptTrieRoot",value:ethBlock.receiptTrie}),paths.push({path:"stateRoot",value:ethBlock.stateRoot}),paths.push({path:"authorAddress",value:ethBlock.coinbase}),paths.push({path:"bloom",value:ethBlock.bloom}),paths.push({path:"difficulty",value:ethBlock.difficulty}),paths.push({path:"number",value:ethBlock.number}),paths.push({path:"gasLimit",value:ethBlock.gasLimit}),paths.push({path:"gasUsed",value:ethBlock.gasUsed}),paths.push({path:"timestamp",value:ethBlock.timestamp}),paths.push({path:"extraData",value:ethBlock.extraData}),paths.push({path:"mixHash",value:ethBlock.mixHash}),paths.push({path:"nonce",value:ethBlock.nonce}),callback(null,paths)})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function resolve(block,path,callback){waterfall([cb=>resolver.resolve(trieIpldFormat,block,path,cb),(result,cb)=>{if(isExternalLink(result.value)||0===result.remainderPath.length)return cb(null,result);toIpfsBlock(result.value,(err,block)=>{if(err)return cb(err);IpldEthAccountSnapshotResolver.resolve(block,result.remainderPath,cb)})}],callback)}function tree(block,options,callback){exports.util.deserialize(block.data,(err,trieNode)=>{return err?callback(err):"leaf"===trieNode.type?waterfall([cb=>toIpfsBlock(trieNode.getValue(),cb),(block,cb)=>IpldEthAccountSnapshotResolver.tree(block,options,cb)],callback):void waterfall([cb=>resolver.treeFromObject(trieIpldFormat,trieNode,options,cb),(result,cb)=>{let paths=[];each(result,(child,next)=>{if(!Buffer.isBuffer(child.value))return paths.push(child),next();let key=child.key;waterfall([cb=>toIpfsBlock(child.value,cb),(block,cb)=>IpldEthAccountSnapshotResolver.tree(block,options,cb),(subpaths,cb)=>{paths=paths.concat(subpaths.map(p=>{p.path=key+"/"+p.path})),cb()}],next)},err=>{if(err)return cb(err);cb(null,paths)})}],callback)})}function toIpfsBlock(value,callback){multihashing(value,"keccak-256",(err,hash)=>{if(err)return callback(err);callback(null,new IpfsBlock(value,new CID(1,IpldEthAccountSnapshotResolver.multicodec,hash)))})}const each=__webpack_require__(32),waterfall=__webpack_require__(9),util=__webpack_require__(104),resolver=__webpack_require__(139),isExternalLink=__webpack_require__(77).isExternalLink,IpldEthAccountSnapshotResolver=__webpack_require__(510).resolver,IpfsBlock=__webpack_require__(60),CID=__webpack_require__(12),multihashing=__webpack_require__(30),trieIpldFormat="eth-state-trie";exports.util={deserialize:util.deserialize,serialize:util.serialize,cid:util.cid.bind(null,trieIpldFormat)},exports.resolver={multicodec:trieIpldFormat,tree:tree,resolve:resolve}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function resolve(block,path,callback){resolver.resolve(trieIpldFormat,block,path,(err,result)=>{return err?callback(err):callback(null,result)})}function tree(block,options,callback){"function"==typeof options&&(callback=options,options={}),exports.util.deserialize(block.data,(err,trieNode)=>{if(err)return callback(err);resolver.treeFromObject(trieIpldFormat,trieNode,options,(err,result)=>{if(err)return callback(err);callback(null,result)})})}const util=__webpack_require__(104),resolver=__webpack_require__(139),trieIpldFormat="eth-storage-trie";exports.util={deserialize:util.deserialize,serialize:util.serialize,cid:util.cid.bind(null,trieIpldFormat)},exports.resolver={multicodec:trieIpldFormat,tree:tree,resolve:resolve}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(138),multibase=__webpack_require__(43),multicodec=__webpack_require__(44),codecs=__webpack_require__(35),codecVarints=__webpack_require__(38),multihash=__webpack_require__(138);class CID{constructor(version,codec,multihash){if("string"==typeof version)if(multibase.isEncoded(version)){const cid=multibase.decode(version);this.version=parseInt(cid.slice(0,1).toString("hex"),16),this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=mh.fromB58String(version),this.version=0;else if(Buffer.isBuffer(version)){const firstByte=version.slice(0,1),v=parseInt(firstByte.toString("hex"),16);if(0===v||1===v){const cid=version;this.version=v,this.codec=multicodec.getCodec(cid.slice(1)), +this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=version,this.version=0}else if("number"==typeof version){if("string"!=typeof codec)throw new Error("codec must be string");if(0!==version&&1!==version)throw new Error("version must be a number equal to 0 or 1");mh.validate(multihash),this.codec=codec,this.version=version,this.multihash=multihash}}get buffer(){switch(this.version){case 0:return this.multihash;case 1:return Buffer.concat([Buffer("01","hex"),Buffer(codecVarints[this.codec]),this.multihash]);default:throw new Error("unsupported version")}}get prefix(){return Buffer.concat([new Buffer(`0${this.version}`,"hex"),codecVarints[this.codec],multihash.prefix(this.multihash)])}toV0(){return this.multihash}toV1(){return this.buffer}toBaseEncodedString(base){switch(base=base||"base58btc",this.version){case 0:return mh.toB58String(this.multihash);case 1:return multibase.encode(base,this.buffer).toString();default:throw new Error("Unsupported version")}}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(other){return this.codec===other.codec&&this.version===other.version&&this.multihash.equals(other.multihash)}}CID.codecs=codecs,CID.isCID=(other=>{return"CID"===other.constructor.name}),module.exports=CID}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.names={sha1:17,"sha2-256":18,"sha2-512":19,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,murmur3:34,blake2b:64,blake2s:65},exports.codes={17:"sha1",18:"sha2-256",19:"sha2-512",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384",29:"keccak-512",34:"murmur3",64:"blake2b",65:"blake2s"},exports.defaultLengths={17:20,18:32,19:64,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,64:64,65:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function resolve(block,path,callback){resolver.resolve(trieIpldFormat,block,path,(err,result)=>{if(err)return callback(err);if(isExternalLink(result.value)||0===result.remainderPath.length)return callback(null,result);let block=new IpfsBlock(result.value);IpldEthTxResolver.resolve(block,result.remainderPath,callback)})}function tree(block,options,callback){exports.util.deserialize(block.data,(err,trieNode)=>{if(err)return callback(err);if("leaf"===trieNode.type){let block=new IpfsBlock(trieNode.getValue());return void IpldEthTxResolver.tree(block,options,(err,paths)=>{if(err)return callback(err);callback(null,paths)})}resolver.treeFromObject(trieIpldFormat,trieNode,options,(err,result)=>{if(err)return callback(err);let paths=[];async.each(result,(child,next)=>{if(Buffer.isBuffer(child.value)){let key=child.key,block=new IpfsBlock(child.value);IpldEthTxResolver.tree(block,options,(err,subpaths)=>{if(err)return next(err);subpaths.forEach(path=>{path.path=key+"/"+path.path}),paths=paths.concat(subpaths)})}else paths.push(child),next()},err=>{if(err)return callback(err);callback(null,paths)})})})}const async=__webpack_require__(86),util=__webpack_require__(104),resolver=__webpack_require__(139),isExternalLink=__webpack_require__(77).isExternalLink,IpldEthTxResolver=__webpack_require__(535).resolver,IpfsBlock=__webpack_require__(60),trieIpldFormat="eth-tx-trie";exports.util={deserialize:util.deserialize,serialize:util.serialize,cid:util.cid.bind(null,trieIpldFormat)},exports.resolver={multicodec:trieIpldFormat,tree:tree,resolve:resolve}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.names={sha1:17,"sha2-256":18,"sha2-512":19,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,"murmur3-128":34,"murmur3-32":35,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664},exports.codes={17:"sha1",18:"sha2-256",19:"sha2-512",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384",29:"keccak-512",34:"murmur3-128",35:"murmur3-32",45569:"blake2b-8",45570:"blake2b-16",45571:"blake2b-24",45572:"blake2b-32",45573:"blake2b-40",45574:"blake2b-48",45575:"blake2b-56",45576:"blake2b-64",45577:"blake2b-72",45578:"blake2b-80",45579:"blake2b-88",45580:"blake2b-96",45581:"blake2b-104",45582:"blake2b-112",45583:"blake2b-120",45584:"blake2b-128",45585:"blake2b-136",45586:"blake2b-144",45587:"blake2b-152",45588:"blake2b-160",45589:"blake2b-168",45590:"blake2b-176",45591:"blake2b-184",45592:"blake2b-192",45593:"blake2b-200",45594:"blake2b-208",45595:"blake2b-216",45596:"blake2b-224",45597:"blake2b-232",45598:"blake2b-240",45599:"blake2b-248",45600:"blake2b-256",45601:"blake2b-264",45602:"blake2b-272",45603:"blake2b-280",45604:"blake2b-288",45605:"blake2b-296",45606:"blake2b-304",45607:"blake2b-312",45608:"blake2b-320",45609:"blake2b-328",45610:"blake2b-336",45611:"blake2b-344",45612:"blake2b-352",45613:"blake2b-360",45614:"blake2b-368",45615:"blake2b-376",45616:"blake2b-384",45617:"blake2b-392",45618:"blake2b-400",45619:"blake2b-408",45620:"blake2b-416",45621:"blake2b-424",45622:"blake2b-432",45623:"blake2b-440",45624:"blake2b-448",45625:"blake2b-456",45626:"blake2b-464",45627:"blake2b-472",45628:"blake2b-480",45629:"blake2b-488",45630:"blake2b-496",45631:"blake2b-504",45632:"blake2b-512",45633:"blake2s-8",45634:"blake2s-16",45635:"blake2s-24",45636:"blake2s-32",45637:"blake2s-40",45638:"blake2s-48",45639:"blake2s-56",45640:"blake2s-64",45641:"blake2s-72",45642:"blake2s-80",45643:"blake2s-88",45644:"blake2s-96",45645:"blake2s-104",45646:"blake2s-112",45647:"blake2s-120",45648:"blake2s-128",45649:"blake2s-136",45650:"blake2s-144",45651:"blake2s-152",45652:"blake2s-160",45653:"blake2s-168",45654:"blake2s-176",45655:"blake2s-184",45656:"blake2s-192",45657:"blake2s-200",45658:"blake2s-208",45659:"blake2s-216",45660:"blake2s-224",45661:"blake2s-232",45662:"blake2s-240",45663:"blake2s-248",45664:"blake2s-256"},exports.defaultLengths={17:20,18:32,19:64,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,45569:1,45570:2,45571:3,45572:4,45573:5,45574:6,45575:7,45576:8,45577:9,45578:10,45579:11,45580:12,45581:13,45582:14,45583:15,45584:16,45585:17,45586:18,45587:19,45588:20,45589:21,45590:22,45591:23,45592:24,45593:25,45594:26,45595:27,45596:28,45597:29,45598:30,45599:31,45600:32,45601:33,45602:34,45603:35,45604:36,45605:37,45606:38,45607:39,45608:40,45609:41,45610:42,45611:43,45612:44,45613:45,45614:46,45615:47,45616:48,45617:49,45618:50,45619:51,45620:52,45621:53,45622:54,45623:55,45624:56,45625:57,45626:58,45627:59,45628:60,45629:61,45630:62,45631:63,45632:64,45633:1,45634:2,45635:3,45636:4,45637:5,45638:6,45639:7,45640:8,45641:9,45642:10,45643:11,45644:12,45645:13,45646:14,45647:15,45648:16,45649:17,45650:18,45651:19,45652:20,45653:21,45654:22,45655:23,45656:24,45657:25,45658:26,45659:27,45660:28,45661:29,45662:30,45663:31,45664:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(233),multibase=__webpack_require__(43),multicodec=__webpack_require__(44),codecs=__webpack_require__(35),codecVarints=__webpack_require__(38),multihash=__webpack_require__(233);class CID{constructor(version,codec,multihash){if("string"==typeof version)if(multibase.isEncoded(version)){const cid=multibase.decode(version);this.version=parseInt(cid.slice(0,1).toString("hex"),16),this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=mh.fromB58String(version),this.version=0;else if(Buffer.isBuffer(version)){const firstByte=version.slice(0,1),v=parseInt(firstByte.toString("hex"),16);if(0===v||1===v){const cid=version;this.version=v,this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=version,this.version=0}else if("number"==typeof version){if("string"!=typeof codec)throw new Error("codec must be string");if(0!==version&&1!==version)throw new Error("version must be a number equal to 0 or 1");mh.validate(multihash),this.codec=codec,this.version=version,this.multihash=multihash}}get buffer(){switch(this.version){case 0:return this.multihash;case 1:return Buffer.concat([Buffer("01","hex"),Buffer(codecVarints[this.codec]),this.multihash]);default:throw new Error("unsupported version")}}get prefix(){return Buffer.concat([new Buffer(`0${this.version}`,"hex"),codecVarints[this.codec],multihash.prefix(this.multihash)])}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");return new CID(0,this.codec,this.multihash)}toV1(){return new CID(1,this.codec,this.multihash)}toBaseEncodedString(base){switch(base=base||"base58btc",this.version){case 0:if("base58btc"!==base)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");return mh.toB58String(this.multihash);case 1:return multibase.encode(base,this.buffer).toString();default:throw new Error("Unsupported version")}}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(other){return this.codec===other.codec&&this.version===other.version&&this.multihash.equals(other.multihash)}}CID.codecs=codecs,CID.isCID=(other=>{return"CID"===other.constructor.name}),module.exports=CID}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.names={sha1:17,"sha2-256":18,"sha2-512":19,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,murmur3:34,blake2b:64,blake2s:65},exports.codes={17:"sha1",18:"sha2-256",19:"sha2-512",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384",29:"keccak-512",34:"murmur3",64:"blake2b",65:"blake2s"},exports.defaultLengths={17:20,18:32,19:64,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,64:64,65:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function validate(multihash){if(!Buffer.isBuffer(multihash))throw new Error("multihash must be a Buffer");if(multihash.length<3)throw new Error("multihash too short. must be > 3 bytes.");if(multihash.length>129)throw new Error("multihash too long. must be < 129 bytes.");let code=multihash[0];if(!exports.isValidCode(code))throw new Error(`multihash unknown function code: 0x${code.toString(16)}`);if(multihash.slice(2).length!==multihash[1])throw new Error(`multihash length inconsistent: 0x${multihash.toString("hex")}`)}const bs58=__webpack_require__(24),cs=__webpack_require__(532);exports.toHexString=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return hash.toString("hex")},exports.fromHexString=function(hash){return new Buffer(hash,"hex")},exports.toB58String=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return bs58.encode(hash)},exports.fromB58String=function(hash){let encoded=hash;return Buffer.isBuffer(hash)&&(encoded=hash.toString()),new Buffer(bs58.decode(encoded))},exports.decode=function(buf){exports.validate(buf);const code=buf[0];return{code:code,name:cs.codes[code],length:buf[1],digest:buf.slice(2)}},exports.encode=function(digest,code,length){if(!digest||!code)throw new Error("multihash encode requires at least two args: digest, code");const hashfn=exports.coerceCode(code);if(!Buffer.isBuffer(digest))throw new Error("digest should be a Buffer");if(null==length&&(length=digest.length),length&&digest.length!==length)throw new Error("digest length should be equal to specified length.");if(length>127)throw new Error("multihash does not yet support digest lengths greater than 127 bytes.");return Buffer.concat([new Buffer([hashfn,length]),digest])},exports.coerceCode=function(name){let code=name;if("string"==typeof name){if(!cs.names[name])throw new Error(`Unrecognized hash function named: ${name}`);code=cs.names[name]}if("number"!=typeof code)throw new Error(`Hash function code should be a number. Got: ${code}`);if(!cs.codes[code]&&!exports.isAppCode(code))throw new Error(`Unrecognized function code: ${code}`);return code},exports.isAppCode=function(code){return code>0&&code<16},exports.isValidCode=function(code){return!!exports.isAppCode(code)||!!cs.codes[code]},exports.validate=validate,exports.prefix=function(multihash){return validate(multihash),multihash.slice(0,2)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function cidForHash(codec,rawhash){return new CID(1,codec,multihashes.encode(rawhash,"keccak-256"))}const CID=__webpack_require__(531),multihashes=__webpack_require__(533);module.exports={cidForHash:cidForHash}},function(module,exports,__webpack_require__){"use strict";exports.util=__webpack_require__(234),exports.resolver=__webpack_require__(536)},function(module,exports,__webpack_require__){"use strict";const util=__webpack_require__(234);exports=module.exports,exports.multicodec="eth-tx",exports.resolve=((block,path,callback)=>{let result;util.deserialize(block.data,(err,node)=>{if(err)return callback(err);if(!path||"/"===path)return result={value:node,remainderPath:""},callback(null,result);let pathParts=path.split("/"),firstPart=pathParts.shift(),remainderPath=pathParts.join("/");exports.tree(block,(err,paths)=>{if(err)return callback(err);let treeResult=paths.find(child=>child.path===firstPart);if(!treeResult){let err=new Error('Path not found ("'+firstPart+'").');return callback(err)}return result={value:treeResult.value,remainderPath:remainderPath},callback(null,result)})})}),exports.tree=((block,options,callback)=>{"function"==typeof options&&(callback=options,options=void 0),options||(options={}),util.deserialize(block.data,(err,tx)=>{if(err)return callback(err);const paths=[];paths.push({path:"nonce",value:tx.nonce}),paths.push({path:"gasPrice",value:tx.gasPrice}),paths.push({path:"gasLimit",value:tx.gasLimit}),paths.push({path:"toAddress",value:tx.to}),paths.push({path:"value",value:tx.value}),paths.push({path:"data",value:tx.data}),paths.push({path:"v",value:tx.v}),paths.push({path:"r",value:tx.r}),paths.push({path:"s",value:tx.s}),paths.push({path:"fromAddress",value:tx.from}),paths.push({path:"signature",value:[tx.v,tx.r,tx.s]}),paths.push({path:"isContractPublish",value:tx.toCreationAddress()}),callback(null,paths)})})},function(module,exports,__webpack_require__){"use strict";(function(setImmediate){function noop(){}const Block=__webpack_require__(60),pull=__webpack_require__(5),CID=__webpack_require__(12),doUntil=__webpack_require__(344),IPFSRepo=__webpack_require__(221),BlockService=__webpack_require__(220),joinPath=__webpack_require__(45).join,pullDeferSource=__webpack_require__(295).source,pullTraverse=__webpack_require__(304),map=__webpack_require__(89),series=__webpack_require__(40),waterfall=__webpack_require__(9),MemoryStore=__webpack_require__(41).MemoryDatastore,dagPB=__webpack_require__(62),dagCBOR=__webpack_require__(499),ipldEthBlock=__webpack_require__(231),ipldEthBlockList=__webpack_require__(518),ipldEthTxTrie=__webpack_require__(529),ipldEthStateTrie=__webpack_require__(525),ipldEthStorageTrie=__webpack_require__(526);class IPLDResolver{constructor(blockService){if(!blockService)throw new Error("Missing blockservice");this.bs=blockService,this.resolvers={},this.support={},this.support.add=((multicodec,resolver,util)=>{if(this.resolvers[multicodec])throw new Error(multicodec+"already supported");this.resolvers[multicodec]={resolver:resolver,util:util}}),this.support.rm=(multicodec=>{this.resolvers[multicodec]&&delete this.resolvers[multicodec]}),this.support.add(dagPB.resolver.multicodec,dagPB.resolver,dagPB.util),this.support.add(dagCBOR.resolver.multicodec,dagCBOR.resolver,dagCBOR.util),this.support.add(ipldEthBlock.resolver.multicodec,ipldEthBlock.resolver,ipldEthBlock.util),this.support.add(ipldEthBlockList.resolver.multicodec,ipldEthBlockList.resolver,ipldEthBlockList.util),this.support.add(ipldEthTxTrie.resolver.multicodec,ipldEthTxTrie.resolver,ipldEthTxTrie.util),this.support.add(ipldEthStateTrie.resolver.multicodec,ipldEthStateTrie.resolver,ipldEthStateTrie.util),this.support.add(ipldEthStorageTrie.resolver.multicodec,ipldEthStorageTrie.resolver,ipldEthStorageTrie.util)}get(cid,path,options,callback){if("function"==typeof path&&(callback=path,path=void 0),"function"==typeof options&&(callback=options,options={}),"string"==typeof path&&(path=joinPath("/",path).substr(1)),""===path||!path)return this._get(cid,(err,node)=>{if(err)return callback(err);callback(null,{value:node,remainderPath:""})});let value;doUntil(cb=>{this.bs.get(cid,(err,block)=>{if(err)return cb(err);this.resolvers[cid.codec].resolver.resolve(block,path,(err,result)=>{if(err)return cb(err);value=result.value,path=result.remainderPath,cb()})})},()=>{const endReached=!path||""===path||"/"===path,isTerminal=value&&!value["/"];return!!(endReached&&isTerminal||options.localResolve)||(value&&(cid=new CID(value["/"])),!1)},(err,results)=>{return err?callback(err):callback(null,{value:value,remainderPath:path})})}getStream(cid,path,options){const deferred=pullDeferSource();return this.get(cid,path,options,(err,result)=>{if(err)return deferred.resolve(pull.error(err));deferred.resolve(pull.values([result]))}),deferred}put(node,options,callback){return"function"==typeof options?setImmediate(()=>callback(new Error("no options were passed"))):(callback=callback||noop,options.cid&&CID.isCID(options.cid)?this._put(options.cid,node,callback):(options.hashAlg=options.hashAlg||"sha2-256",void this.resolvers[options.format].util.cid(node,(err,cid)=>{if(err)return callback(err);this._put(cid,node,callback)})))}treeStream(cid,path,options){"object"==typeof path&&(options=path,path=void 0),options=options||{};let p;if(!options.recursive){p=pullDeferSource();const r=this.resolvers[cid.codec];waterfall([cb=>this.bs.get(cid,cb),(block,cb)=>r.resolver.tree(block,cb)],(err,paths)=>{if(err)return p.abort(err);p.resolve(pull.values(paths))})}return options.recursive&&(p=pull(pullTraverse.widthFirst({basePath:null,cid:cid},el=>{if("string"==typeof el)return pull.empty();const deferred=pullDeferSource(),r=this.resolvers[el.cid.codec];return waterfall([cb=>this.bs.get(el.cid,cb),(block,cb)=>r.resolver.tree(block,(err,paths)=>{if(err)return cb(err);map(paths,(p,cb)=>{r.resolver.isLink(block,p,(err,link)=>{if(err)return cb(err);cb(null,{path:p,link:link})})},cb)})],(err,paths)=>{if(err)return deferred.abort(err);deferred.resolve(pull.values(paths.map(p=>{const base=el.basePath?el.basePath+"/"+p.path:p.path;return p.link?{basePath:base,cid:new CID(p.link["/"])}:base})))}),deferred}),pull.map(e=>{return"string"==typeof e?e:e.basePath}),pull.filter(Boolean))),path?pull(p,pull.map(el=>{if(0===el.indexOf(path))return el=el.slice(path.length+1)}),pull.filter(Boolean)):p}remove(cids,callback){this.bs.delete(cids,callback)}_get(cid,callback){const r=this.resolvers[cid.codec];waterfall([cb=>this.bs.get(cid,cb),(block,cb)=>{r?r.util.deserialize(block.data,(err,deserialized)=>{if(err)return cb(err);cb(null,deserialized)}):cb(null,block.data)}],callback)}_put(cid,node,callback){callback=callback||noop;const r=this.resolvers[cid.codec];waterfall([cb=>r.util.serialize(node,cb),(buf,cb)=>this.bs.put(new Block(buf,cid),cb)],err=>{if(err)return callback(err);callback(null,cid)})}}IPLDResolver.inMemory=function(callback){const repo=new IPFSRepo("in-memory",{fs:MemoryStore,level:__webpack_require__(674),lock:"memory"}),blockService=new BlockService(repo);series([cb=>repo.init({},cb),cb=>repo.open(cb)],err=>{if(err)return callback(err);callback(null,new IPLDResolver(blockService))})},module.exports=IPLDResolver}).call(exports,__webpack_require__(22).setImmediate)},function(module,exports){function isCircular(obj){return new CircularChecker(obj).isCircular()}function CircularChecker(obj){this.obj=obj}module.exports=isCircular,CircularChecker.prototype.isCircular=function(obj,seen){if(obj=obj||this.obj,seen=seen||[],!(obj instanceof Object))throw new TypeError('"obj" must be an object (or inherit from it)');var self=this;seen.push(obj);for(var key in obj){var val=obj[key];if(val instanceof Object&&(~seen.indexOf(val)||self.isCircular(val,seen.slice())))return!0}return!1}},function(module,exports,__webpack_require__){"use strict";exports.names={sha1:17,"sha2-256":18,"sha2-512":19,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,murmur3:34,blake2b:64,blake2s:65},exports.codes={17:"sha1",18:"sha2-256",19:"sha2-512",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384",29:"keccak-512",34:"murmur3",64:"blake2b",65:"blake2s"},exports.defaultLengths={17:20,18:32,19:64,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,64:64,65:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function validate(multihash){if(!Buffer.isBuffer(multihash))throw new Error("multihash must be a Buffer");if(multihash.length<3)throw new Error("multihash too short. must be > 3 bytes.");if(multihash.length>129)throw new Error("multihash too long. must be < 129 bytes.");let code=multihash[0];if(!exports.isValidCode(code))throw new Error(`multihash unknown function code: 0x${code.toString(16)}`);if(multihash.slice(2).length!==multihash[1])throw new Error(`multihash length inconsistent: 0x${multihash.toString("hex")}`)}const bs58=__webpack_require__(24),cs=__webpack_require__(539);exports.toHexString=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return hash.toString("hex")},exports.fromHexString=function(hash){return new Buffer(hash,"hex")},exports.toB58String=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return bs58.encode(hash)},exports.fromB58String=function(hash){let encoded=hash;return Buffer.isBuffer(hash)&&(encoded=hash.toString()),new Buffer(bs58.decode(encoded))},exports.decode=function(buf){exports.validate(buf);const code=buf[0];return{code:code,name:cs.codes[code],length:buf[1],digest:buf.slice(2)}},exports.encode=function(digest,code,length){if(!digest||!code)throw new Error("multihash encode requires at least two args: digest, code");const hashfn=exports.coerceCode(code);if(!Buffer.isBuffer(digest))throw new Error("digest should be a Buffer");if(null==length&&(length=digest.length),length&&digest.length!==length)throw new Error("digest length should be equal to specified length.");if(length>127)throw new Error("multihash does not yet support digest lengths greater than 127 bytes.");return Buffer.concat([new Buffer([hashfn,length]),digest])},exports.coerceCode=function(name){let code=name;if("string"==typeof name){if(!cs.names[name])throw new Error(`Unrecognized hash function named: ${name}`);code=cs.names[name]}if("number"!=typeof code)throw new Error(`Hash function code should be a number. Got: ${code}`);if(!cs.codes[code]&&!exports.isAppCode(code))throw new Error(`Unrecognized function code: ${code}`);return code},exports.isAppCode=function(code){return code>0&&code<16},exports.isValidCode=function(code){return!!exports.isAppCode(code)||!!cs.codes[code]},exports.validate=validate,exports.prefix=function(multihash){return validate(multihash),multihash.slice(0,2)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function isMultihash(hash){const formatted=convertToString(hash);try{const buffer=new Buffer(base58.decode(formatted));return multihash.decode(buffer),!0}catch(e){return!1}}function isIpfs(input,pattern){const formatted=convertToString(input);if(!formatted)return!1;const match=formatted.match(pattern);return!!match&&("ipfs"===match[1]&&isMultihash(match[4]))}function isIpns(input,pattern){const formatted=convertToString(input);if(!formatted)return!1;const match=formatted.match(pattern);return!!match&&"ipns"===match[1]}function convertToString(input){return Buffer.isBuffer(input)?base58.encode(input):"string"==typeof input&&input}const base58=__webpack_require__(24),multihash=__webpack_require__(540),urlPattern=/^https?:\/\/[^\/]+\/(ip(f|n)s)\/((\w+).*)/,pathPattern=/^\/(ip(f|n)s)\/((\w+).*)/;module.exports={multihash:isMultihash,ipfsUrl:url=>isIpfs(url,urlPattern),ipnsUrl:url=>isIpns(url,urlPattern),url:url=>isIpfs(url,urlPattern)||isIpns(url,urlPattern),urlPattern:urlPattern,ipfsPath:path=>isIpfs(path,pathPattern),ipnsPath:path=>isIpns(path,pathPattern),path:path=>isIpfs(path,pathPattern)||isIpns(path,pathPattern),pathPattern:pathPattern,urlOrPath:x=>isIpfs(x,urlPattern)||isIpns(x,urlPattern)||isIpfs(x,pathPattern)||isIpns(x,pathPattern)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function isProperty(str){ +return/^[$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(str)}module.exports=isProperty},function(module,exports,__webpack_require__){function isStream(obj){return obj instanceof stream.Stream}function isReadable(obj){return isStream(obj)&&"function"==typeof obj._read&&"object"==typeof obj._readableState}function isWritable(obj){return isStream(obj)&&"function"==typeof obj._write&&"object"==typeof obj._writableState}function isDuplex(obj){return isReadable(obj)&&isWritable(obj)}var stream=__webpack_require__(26);module.exports=isStream,module.exports.isReadable=isReadable,module.exports.isWritable=isWritable,module.exports.isDuplex=isDuplex},function(module,exports){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}}},function(module,exports){module.exports={_from:"elliptic@^6.2.3",_id:"elliptic@6.4.0",_inBundle:!1,_integrity:"sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=",_location:"/elliptic",_phantomChildren:{},_requested:{type:"range",registry:!0,raw:"elliptic@^6.2.3",name:"elliptic",escapedName:"elliptic",rawSpec:"^6.2.3",saveSpec:null,fetchSpec:"^6.2.3"},_requiredBy:["/browserify-sign","/create-ecdh","/secp256k1"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz",_shasum:"cac9af8762c85836187003c8dfe193e5e2eae5df",_spec:"elliptic@^6.2.3",_where:"/Users/koruza/code/js-ipfs/node_modules/secp256k1",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},bundleDependencies:!1,dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},deprecated:!1,description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},files:["lib"],homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.0"}},function(module,exports){module.exports={name:"ipfs",version:"0.24.0",description:"JavaScript implementation of the IPFS specification",bin:{jsipfs:"src/cli/bin.js"},main:"src/core/index.js",browser:{"libp2p-ipfs-nodejs":"libp2p-ipfs-browser","./src/core/default-repo.js":"./src/core/default-repo-browser.js","./src/core/components/init-assets.js":!1,"./test/utils/create-repo-node.js":"./test/utils/create-repo-browser.js",stream:"readable-stream"},engines:{node:">=4.0.0",npm:">=3.0.0"},scripts:{lint:"aegir-lint",coverage:"gulp coverage",test:"gulp test --dom","test:node":"npm run test:unit:node","test:browser":"npm run test:unit:browser","test:unit:node":"gulp test:node","test:unit:node:core":"TEST=core npm run test:unit:node","test:unit:node:http":"TEST=http npm run test:unit:node","test:unit:node:cli":"TEST=cli npm run test:unit:node","test:unit:browser":"gulp test:browser","test:interop":"npm run test:interop:node","test:interop:node":"mocha -t 60000 test/interop/node.js","test:interop:browser":"mocha -t 60000 test/interop/browser.js","test:benchmark":'echo "Error: no benchmarks yet" && exit 1',"test:benchmark:node":'echo "Error: no benchmarks yet" && exit 1',"test:benchmark:node:core":'echo "Error: no benchmarks yet" && exit 1',"test:benchmark:node:http":'echo "Error: no benchmarks yet" && exit 1',"test:benchmark:browser":'echo "Error: no benchmarks yet" && exit 1',build:"gulp build",release:"gulp release","release-minor":"gulp release --type minor","release-major":"gulp release --type major","coverage-publish":"aegir-coverage publish"},"pre-commit":["lint","test"],repository:{type:"git",url:"git+https://github.com/ipfs/js-ipfs.git"},keywords:["IPFS"],author:"David Dias ",license:"MIT",bugs:{url:"https://github.com/ipfs/js-ipfs/issues"},homepage:"https://github.com/ipfs/js-ipfs#readme",devDependencies:{aegir:"^11.0.2","buffer-loader":"0.0.1",chai:"^4.0.0",delay:"^2.0.0","detect-node":"^2.0.3","dir-compare":"^1.4.0","dirty-chai":"^1.2.2","eslint-plugin-react":"^7.0.1",execa:"^0.6.3","expose-loader":"^0.7.3","form-data":"^2.1.4",gulp:"^3.9.1","interface-ipfs-core":"~0.28.0","ipfsd-ctl":"~0.21.0","left-pad":"^1.1.3",lodash:"^4.17.4",mocha:"^3.4.2",ncp:"^2.0.0",nexpect:"^0.5.0","pre-commit":"^1.2.2","pretty-bytes":"^4.0.2",qs:"^6.4.0","random-fs":"^1.0.3",rimraf:"^2.6.1","stream-to-promise":"^2.2.0","transform-loader":"^0.2.4"},dependencies:{async:"^2.4.1",bl:"^1.2.1",boom:"^5.1.0",cids:"^0.5.0",debug:"^2.6.8","fsm-event":"^2.1.0",glob:"^7.1.2",hapi:"^16.1.1","hapi-set-header":"^1.0.2",hoek:"^4.1.1","ipfs-api":"^14.0.2","ipfs-bitswap":"~0.13.1","ipfs-block":"~0.6.0","ipfs-block-service":"~0.9.1","ipfs-multipart":"~0.1.0","ipfs-repo":"~0.13.1","ipfs-unixfs":"~0.1.11","ipfs-unixfs-engine":"~0.19.2","ipld-resolver":"~0.11.1",isstream:"^0.1.2",joi:"^10.5.1","libp2p-floodsub":"~0.9.4","libp2p-ipfs-browser":"~0.24.1","libp2p-ipfs-nodejs":"~0.25.2","lodash.flatmap":"^4.5.0","lodash.get":"^4.4.2","lodash.has":"^4.5.2","lodash.set":"^4.3.2","lodash.sortby":"^4.7.0","lodash.values":"^4.3.0",mafmt:"^2.1.8",mkdirp:"^0.5.1",multiaddr:"^2.3.0",multihashes:"~0.4.5",once:"^1.4.0","path-exists":"^3.0.0","peer-book":"~0.4.0","peer-id":"~0.8.7","peer-info":"~0.9.2","promisify-es6":"^1.0.2","pull-file":"^1.0.0","pull-paramap":"^1.2.2","pull-pushable":"^2.1.1","pull-sort":"^1.0.0","pull-stream":"^3.6.0","pull-stream-to-stream":"^1.3.4","pull-zip":"^2.0.1","read-pkg-up":"^2.0.0","safe-buffer":"^5.0.1","stream-to-pull-stream":"^1.7.2","tar-stream":"^1.5.4",temp:"^0.8.3",through2:"^2.0.3","update-notifier":"^2.1.0",yargs:"8.0.1","readable-stream":"1.1.14"},contributors:["Andrew de Andrade ","CHEVALAY JOSSELIN ","Caio Gondim ","Christian Couder ","Daniel J. O'Quinn ","Daniela Borges Matos de Carvalho ","David Dias ","Enrico Marino ","Felix Yan ","Francisco Baio Dias ","Francisco Baio Dias ","Friedel Ziegelmayer ","Georgios Rassias ","Greenkeeper ","Haad ","Harsh Vakharia ","João Antunes ","Lars Gierth ","Marius Darila ","Michelle Lee ","Mikeal Rogers ","Mithgol ","Nuno Nogueira ","Oskar Nyberg ","Pau Ramon Revilla ","Pedro Teixeira ","Richard Littauer ","Rod Keys ","Sid Harder ","SidHarder ","Stephen Whitmore ","Stephen Whitmore ","Terence Pae ","Xiao Liang ","haad ","jbenet ","kumavis ","nginnever ","npmcdn-to-unpkg-bot ","tcme ","ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ "]}},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(548)(__webpack_require__(552))},function(module,exports,__webpack_require__){"use strict";var createKeccak=__webpack_require__(549),createShake=__webpack_require__(550);module.exports=function(KeccakState){var Keccak=createKeccak(KeccakState),Shake=createShake(KeccakState);return function(algorithm,options){switch("string"==typeof algorithm?algorithm.toLowerCase():algorithm){case"keccak224":return new Keccak(1152,448,null,224,options);case"keccak256":return new Keccak(1088,512,null,256,options);case"keccak384":return new Keccak(832,768,null,384,options);case"keccak512":return new Keccak(576,1024,null,512,options);case"sha3-224":return new Keccak(1152,448,6,224,options);case"sha3-256":return new Keccak(1088,512,6,256,options);case"sha3-384":return new Keccak(832,768,6,384,options);case"sha3-512":return new Keccak(576,1024,6,512,options);case"shake128":return new Shake(1344,256,31,options);case"shake256":return new Shake(1088,512,31,options);default:throw new Error("Invald algorithm: "+algorithm)}}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){var Transform=__webpack_require__(26).Transform,inherits=__webpack_require__(1);module.exports=function(KeccakState){function Keccak(rate,capacity,delimitedSuffix,hashBitLength,options){Transform.call(this,options),this._rate=rate,this._capacity=capacity,this._delimitedSuffix=delimitedSuffix,this._hashBitLength=hashBitLength,this._options=options,this._state=new KeccakState,this._state.initialize(rate,capacity),this._finalized=!1}return inherits(Keccak,Transform),Keccak.prototype._transform=function(chunk,encoding,callback){var error=null;try{this.update(chunk,encoding)}catch(err){error=err}callback(error)},Keccak.prototype._flush=function(callback){var error=null;try{this.push(this.digest())}catch(err){error=err}callback(error)},Keccak.prototype.update=function(data,encoding){if(!Buffer.isBuffer(data)&&"string"!=typeof data)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(data)||(data=new Buffer(data,encoding)),this._state.absorb(data),this},Keccak.prototype.digest=function(encoding){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var digest=this._state.squeeze(this._hashBitLength/8);return void 0!==encoding&&(digest=digest.toString(encoding)),this._resetState(),digest},Keccak.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},Keccak.prototype._clone=function(){var clone=new Keccak(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(clone._state),clone._finalized=this._finalized,clone},Keccak}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){var Transform=__webpack_require__(26).Transform,inherits=__webpack_require__(1);module.exports=function(KeccakState){function Shake(rate,capacity,delimitedSuffix,options){Transform.call(this,options),this._rate=rate,this._capacity=capacity,this._delimitedSuffix=delimitedSuffix,this._options=options,this._state=new KeccakState,this._state.initialize(rate,capacity),this._finalized=!1}return inherits(Shake,Transform),Shake.prototype._transform=function(chunk,encoding,callback){var error=null;try{this.update(chunk,encoding)}catch(err){error=err}callback(error)},Shake.prototype._flush=function(){},Shake.prototype._read=function(size){this.push(this.squeeze(size))},Shake.prototype.update=function(data,encoding){if(!Buffer.isBuffer(data)&&"string"!=typeof data)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(data)||(data=new Buffer(data,encoding)),this._state.absorb(data),this},Shake.prototype.squeeze=function(dataByteLength,encoding){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var data=this._state.squeeze(dataByteLength);return void 0!==encoding&&(data=data.toString(encoding)),data},Shake.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},Shake.prototype._clone=function(){var clone=new Shake(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(clone._state),clone._finalized=this._finalized,clone},Shake}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";var P1600_ROUND_CONSTANTS=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];exports.p1600=function(s){for(var round=0;round<24;++round){var lo0=s[0]^s[10]^s[20]^s[30]^s[40],hi0=s[1]^s[11]^s[21]^s[31]^s[41],lo1=s[2]^s[12]^s[22]^s[32]^s[42],hi1=s[3]^s[13]^s[23]^s[33]^s[43],lo2=s[4]^s[14]^s[24]^s[34]^s[44],hi2=s[5]^s[15]^s[25]^s[35]^s[45],lo3=s[6]^s[16]^s[26]^s[36]^s[46],hi3=s[7]^s[17]^s[27]^s[37]^s[47],lo4=s[8]^s[18]^s[28]^s[38]^s[48],hi4=s[9]^s[19]^s[29]^s[39]^s[49],lo=lo4^(lo1<<1|hi1>>>31),hi=hi4^(hi1<<1|lo1>>>31),t1slo0=s[0]^lo,t1shi0=s[1]^hi,t1slo5=s[10]^lo,t1shi5=s[11]^hi,t1slo10=s[20]^lo,t1shi10=s[21]^hi,t1slo15=s[30]^lo,t1shi15=s[31]^hi,t1slo20=s[40]^lo,t1shi20=s[41]^hi;lo=lo0^(lo2<<1|hi2>>>31),hi=hi0^(hi2<<1|lo2>>>31);var t1slo1=s[2]^lo,t1shi1=s[3]^hi,t1slo6=s[12]^lo,t1shi6=s[13]^hi,t1slo11=s[22]^lo,t1shi11=s[23]^hi,t1slo16=s[32]^lo,t1shi16=s[33]^hi,t1slo21=s[42]^lo,t1shi21=s[43]^hi;lo=lo1^(lo3<<1|hi3>>>31),hi=hi1^(hi3<<1|lo3>>>31);var t1slo2=s[4]^lo,t1shi2=s[5]^hi,t1slo7=s[14]^lo,t1shi7=s[15]^hi,t1slo12=s[24]^lo,t1shi12=s[25]^hi,t1slo17=s[34]^lo,t1shi17=s[35]^hi,t1slo22=s[44]^lo,t1shi22=s[45]^hi;lo=lo2^(lo4<<1|hi4>>>31),hi=hi2^(hi4<<1|lo4>>>31);var t1slo3=s[6]^lo,t1shi3=s[7]^hi,t1slo8=s[16]^lo,t1shi8=s[17]^hi,t1slo13=s[26]^lo,t1shi13=s[27]^hi,t1slo18=s[36]^lo,t1shi18=s[37]^hi,t1slo23=s[46]^lo,t1shi23=s[47]^hi;lo=lo3^(lo0<<1|hi0>>>31),hi=hi3^(hi0<<1|lo0>>>31);var t1slo4=s[8]^lo,t1shi4=s[9]^hi,t1slo9=s[18]^lo,t1shi9=s[19]^hi,t1slo14=s[28]^lo,t1shi14=s[29]^hi,t1slo19=s[38]^lo,t1shi19=s[39]^hi,t1slo24=s[48]^lo,t1shi24=s[49]^hi,t2slo0=t1slo0,t2shi0=t1shi0,t2slo16=t1shi5<<4|t1slo5>>>28,t2shi16=t1slo5<<4|t1shi5>>>28,t2slo7=t1slo10<<3|t1shi10>>>29,t2shi7=t1shi10<<3|t1slo10>>>29,t2slo23=t1shi15<<9|t1slo15>>>23,t2shi23=t1slo15<<9|t1shi15>>>23,t2slo14=t1slo20<<18|t1shi20>>>14,t2shi14=t1shi20<<18|t1slo20>>>14,t2slo10=t1slo1<<1|t1shi1>>>31,t2shi10=t1shi1<<1|t1slo1>>>31,t2slo1=t1shi6<<12|t1slo6>>>20,t2shi1=t1slo6<<12|t1shi6>>>20,t2slo17=t1slo11<<10|t1shi11>>>22,t2shi17=t1shi11<<10|t1slo11>>>22,t2slo8=t1shi16<<13|t1slo16>>>19,t2shi8=t1slo16<<13|t1shi16>>>19,t2slo24=t1slo21<<2|t1shi21>>>30,t2shi24=t1shi21<<2|t1slo21>>>30,t2slo20=t1shi2<<30|t1slo2>>>2,t2shi20=t1slo2<<30|t1shi2>>>2,t2slo11=t1slo7<<6|t1shi7>>>26,t2shi11=t1shi7<<6|t1slo7>>>26,t2slo2=t1shi12<<11|t1slo12>>>21,t2shi2=t1slo12<<11|t1shi12>>>21,t2slo18=t1slo17<<15|t1shi17>>>17,t2shi18=t1shi17<<15|t1slo17>>>17,t2slo9=t1shi22<<29|t1slo22>>>3,t2shi9=t1slo22<<29|t1shi22>>>3,t2slo5=t1slo3<<28|t1shi3>>>4,t2shi5=t1shi3<<28|t1slo3>>>4,t2slo21=t1shi8<<23|t1slo8>>>9,t2shi21=t1slo8<<23|t1shi8>>>9,t2slo12=t1slo13<<25|t1shi13>>>7,t2shi12=t1shi13<<25|t1slo13>>>7,t2slo3=t1slo18<<21|t1shi18>>>11,t2shi3=t1shi18<<21|t1slo18>>>11,t2slo19=t1shi23<<24|t1slo23>>>8,t2shi19=t1slo23<<24|t1shi23>>>8,t2slo15=t1slo4<<27|t1shi4>>>5,t2shi15=t1shi4<<27|t1slo4>>>5,t2slo6=t1slo9<<20|t1shi9>>>12,t2shi6=t1shi9<<20|t1slo9>>>12,t2slo22=t1shi14<<7|t1slo14>>>25,t2shi22=t1slo14<<7|t1shi14>>>25,t2slo13=t1slo19<<8|t1shi19>>>24,t2shi13=t1shi19<<8|t1slo19>>>24,t2slo4=t1slo24<<14|t1shi24>>>18,t2shi4=t1shi24<<14|t1slo24>>>18;s[0]=t2slo0^~t2slo1&t2slo2,s[1]=t2shi0^~t2shi1&t2shi2,s[10]=t2slo5^~t2slo6&t2slo7,s[11]=t2shi5^~t2shi6&t2shi7,s[20]=t2slo10^~t2slo11&t2slo12,s[21]=t2shi10^~t2shi11&t2shi12,s[30]=t2slo15^~t2slo16&t2slo17,s[31]=t2shi15^~t2shi16&t2shi17,s[40]=t2slo20^~t2slo21&t2slo22,s[41]=t2shi20^~t2shi21&t2shi22,s[2]=t2slo1^~t2slo2&t2slo3,s[3]=t2shi1^~t2shi2&t2shi3,s[12]=t2slo6^~t2slo7&t2slo8,s[13]=t2shi6^~t2shi7&t2shi8,s[22]=t2slo11^~t2slo12&t2slo13,s[23]=t2shi11^~t2shi12&t2shi13,s[32]=t2slo16^~t2slo17&t2slo18,s[33]=t2shi16^~t2shi17&t2shi18,s[42]=t2slo21^~t2slo22&t2slo23,s[43]=t2shi21^~t2shi22&t2shi23,s[4]=t2slo2^~t2slo3&t2slo4,s[5]=t2shi2^~t2shi3&t2shi4,s[14]=t2slo7^~t2slo8&t2slo9,s[15]=t2shi7^~t2shi8&t2shi9,s[24]=t2slo12^~t2slo13&t2slo14,s[25]=t2shi12^~t2shi13&t2shi14,s[34]=t2slo17^~t2slo18&t2slo19,s[35]=t2shi17^~t2shi18&t2shi19,s[44]=t2slo22^~t2slo23&t2slo24,s[45]=t2shi22^~t2shi23&t2shi24,s[6]=t2slo3^~t2slo4&t2slo0,s[7]=t2shi3^~t2shi4&t2shi0,s[16]=t2slo8^~t2slo9&t2slo5,s[17]=t2shi8^~t2shi9&t2shi5,s[26]=t2slo13^~t2slo14&t2slo10,s[27]=t2shi13^~t2shi14&t2shi10,s[36]=t2slo18^~t2slo19&t2slo15,s[37]=t2shi18^~t2shi19&t2shi15,s[46]=t2slo23^~t2slo24&t2slo20,s[47]=t2shi23^~t2shi24&t2shi20,s[8]=t2slo4^~t2slo0&t2slo1,s[9]=t2shi4^~t2shi0&t2shi1,s[18]=t2slo9^~t2slo5&t2slo6,s[19]=t2shi9^~t2shi5&t2shi6,s[28]=t2slo14^~t2slo10&t2slo11,s[29]=t2shi14^~t2shi10&t2shi11,s[38]=t2slo19^~t2slo15&t2slo16,s[39]=t2shi19^~t2shi15&t2shi16,s[48]=t2slo24^~t2slo20&t2slo21,s[49]=t2shi24^~t2shi20&t2shi21,s[0]^=P1600_ROUND_CONSTANTS[2*round],s[1]^=P1600_ROUND_CONSTANTS[2*round+1]}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function Keccak(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}var keccakState=__webpack_require__(551);Keccak.prototype.initialize=function(rate,capacity){for(var i=0;i<50;++i)this.state[i]=0;this.blockSize=rate/8,this.count=0,this.squeezing=!1},Keccak.prototype.absorb=function(data){for(var i=0;i>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(keccakState.p1600(this.state),this.count=0);return output},Keccak.prototype.copy=function(dest){for(var i=0;i<50;++i)dest.state[i]=this.state[i];dest.blockSize=this.blockSize,dest.count=this.count,dest.squeezing=this.squeezing},module.exports=Keccak}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function Codec(opts){this.opts=opts||{},this.encodings=encodings}var encodings=__webpack_require__(554);module.exports=Codec,Codec.prototype._encoding=function(encoding){return"string"==typeof encoding&&(encoding=encodings[encoding]),encoding||(encoding=encodings.id),encoding},Codec.prototype._keyEncoding=function(opts,batchOpts){return this._encoding(batchOpts&&batchOpts.keyEncoding||opts&&opts.keyEncoding||this.opts.keyEncoding)},Codec.prototype._valueEncoding=function(opts,batchOpts){return this._encoding(batchOpts&&(batchOpts.valueEncoding||batchOpts.encoding)||opts&&(opts.valueEncoding||opts.encoding)||this.opts.valueEncoding||this.opts.encoding)},Codec.prototype.encodeKey=function(key,opts,batchOpts){return this._keyEncoding(opts,batchOpts).encode(key)},Codec.prototype.encodeValue=function(value,opts,batchOpts){return this._valueEncoding(opts,batchOpts).encode(value)},Codec.prototype.decodeKey=function(key,opts){return this._keyEncoding(opts).decode(key)},Codec.prototype.decodeValue=function(value,opts){return this._valueEncoding(opts).decode(value)},Codec.prototype.encodeBatch=function(ops,opts){var self=this;return ops.map(function(_op){var op={type:_op.type,key:self.encodeKey(_op.key,opts,_op)};return self.keyAsBuffer(opts,_op)&&(op.keyEncoding="binary"),_op.prefix&&(op.prefix=_op.prefix),"value"in _op&&(op.value=self.encodeValue(_op.value,opts,_op),self.valueAsBuffer(opts,_op)&&(op.valueEncoding="binary")),op})};var ltgtKeys=["lt","gt","lte","gte","start","end"];Codec.prototype.encodeLtgt=function(ltgt){var self=this,ret={};return Object.keys(ltgt).forEach(function(key){ret[key]=ltgtKeys.indexOf(key)>-1?self.encodeKey(ltgt[key],ltgt):ltgt[key]}),ret},Codec.prototype.createStreamDecoder=function(opts){var self=this;return opts.keys&&opts.values?function(key,value){return{ +key:self.decodeKey(key,opts),value:self.decodeValue(value,opts)}}:opts.keys?function(key){return self.decodeKey(key,opts)}:opts.values?function(_,value){return self.decodeValue(value,opts)}:function(){}},Codec.prototype.keyAsBuffer=function(opts){return this._keyEncoding(opts).buffer},Codec.prototype.valueAsBuffer=function(opts){return this._valueEncoding(opts).buffer}},function(module,exports,__webpack_require__){(function(Buffer){function identity(value){return value}function isBinary(data){return void 0===data||null===data||Buffer.isBuffer(data)}exports.utf8=exports["utf-8"]={encode:function(data){return isBinary(data)?data:String(data)},decode:identity,buffer:!1,type:"utf8"},exports.json={encode:JSON.stringify,decode:JSON.parse,buffer:!1,type:"json"},exports.binary={encode:function(data){return isBinary(data)?data:new Buffer(data)},decode:identity,buffer:!0,type:"binary"},exports.id={encode:function(data){return data},decode:function(data){return data},buffer:!1,type:"id"},["hex","ascii","base64","ucs2","ucs-2","utf16le","utf-16le"].forEach(function(type){exports[type]={encode:function(data){return isBinary(data)?data:new Buffer(data,type)},decode:function(buffer){return buffer.toString(type)},buffer:!0,type:type}})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function ReadStream(iterator,options){if(!(this instanceof ReadStream))return new ReadStream(iterator,options);Readable.call(this,extend(options,{objectMode:!0})),this._iterator=iterator,this._destroyed=!1,this._decoder=null,options&&options.decoder&&(this._decoder=options.decoder),this.on("end",this._cleanup.bind(this))}var inherits=__webpack_require__(1),Readable=__webpack_require__(308).Readable,extend=__webpack_require__(37),EncodingError=__webpack_require__(105).EncodingError;module.exports=ReadStream,inherits(ReadStream,Readable),ReadStream.prototype._read=function(){var self=this;this._destroyed||this._iterator.next(function(err,key,value){if(!self._destroyed){if(err)return self.emit("error",err);if(void 0===key&&void 0===value)self.push(null);else{if(!self._decoder)return self.push({key:key,value:value});try{var value=self._decoder(key,value)}catch(err){return self.emit("error",new EncodingError(err)),void self.push(null)}self.push(value)}}})},ReadStream.prototype.destroy=ReadStream.prototype._cleanup=function(){var self=this;this._destroyed||(this._destroyed=!0,this._iterator.end(function(err){if(err)return self.emit("error",err);self.emit("close")}))}},function(module,exports,__webpack_require__){(function(Buffer,process){function Iterator(db,options){if(this._db=db._db,this._idbOpts=db._idbOpts,AbstractIterator.call(this,db),this._options=xtend({snapshot:!0},this._idbOpts,options),this._limit=this._options.limit,null!=this._limit&&this._limit!==-1||(this._limit=1/0),"number"!=typeof this._limit)throw new TypeError("options.limit must be a number");0!==this._limit&&(this._count=0,this._startCursor(this._options))}var util=__webpack_require__(10),AbstractIterator=__webpack_require__(247).AbstractIterator,ltgt=__webpack_require__(672),idbReadableStream=__webpack_require__(448),stream=__webpack_require__(26),xtend=__webpack_require__(37),Writable=stream.Writable;module.exports=Iterator,util.inherits(Iterator,AbstractIterator),Iterator.prototype._startCursor=function(options){options=xtend(this._options,options);var self=this,keyRange=null,lower=ltgt.lowerBound(options),upper=ltgt.upperBound(options),lowerOpen=ltgt.lowerBoundExclusive(options),upperOpen=ltgt.upperBoundExclusive(options),direction=options.reverse?"prev":"next";if(lower&&("binary"!==options.keyEncoding||Array.isArray(lower)||(lower=Array.prototype.slice.call(lower))),upper&&("binary"!==options.keyEncoding||Array.isArray(upper)||(upper=Array.prototype.slice.call(upper))),lower&&upper)try{keyRange=IDBKeyRange.bound(lower,upper,lowerOpen,upperOpen)}catch(err){return void(this._keyRangeError=!0)}else lower?keyRange=IDBKeyRange.lowerBound(lower,lowerOpen):upper&&(keyRange=IDBKeyRange.upperBound(upper,upperOpen));this._reader=idbReadableStream(this._db,this._idbOpts.storeName,xtend(options,{range:keyRange,direction:direction})),this._reader.on("error",function(err){var cb=self._callback;self._callback=!1,cb?cb(err):self._readNext=function(cb){cb(err)}}),this._reader.pipe(new Writable({objectMode:!0,write:function(item,enc,cb){if(self._count++>=self._limit)return self._reader.pause(),self._reader.unpipe(this),cb(),void this.end();var cb2=self._callback;self._callback=!1,cb2?self._processItem(item,function(err,key,value){cb(err),cb2(err,key,value)}):self._readNext=function(cb2){self._processItem(item,function(err,key,value){cb(err),cb2(err,key,value)})}}})).on("finish",function(){var cb=self._callback;self._callback=!1,cb?cb():self._readNext=function(cb){cb()}})},Iterator.prototype._processItem=function(item,cb){if("function"!=typeof cb)throw new TypeError("cb must be a function");var key=item.key,value=item.value;if(value instanceof Uint8Array&&(value=new Buffer(value)),"binary"===this._options.keyEncoding&&Array.isArray(key)&&(key=new Buffer(key)),"binary"!==this._options.valueEncoding||Buffer.isBuffer(value)||(value=new Buffer(value)),this._options.keyAsBuffer&&!Buffer.isBuffer(key))if(null==key)key=new Buffer(0);else if("string"==typeof key)key=new Buffer(key);else if("boolean"==typeof key)key=new Buffer(String(key));else if("number"==typeof key)key=new Buffer(String(key));else if(Array.isArray(key))key=new Buffer(String(key));else{if(!(key instanceof Uint8Array))throw new TypeError("can't coerce `"+key.constructor.name+"` into a Buffer");key=new Buffer(key)}if(this._options.valueAsBuffer&&!Buffer.isBuffer(value))if(null==value)value=new Buffer(0);else if("string"==typeof value)value=new Buffer(value);else if("boolean"==typeof value)value=new Buffer(String(value));else if("number"==typeof value)value=new Buffer(String(value));else if(Array.isArray(value))value=new Buffer(String(value));else{if(!(value instanceof Uint8Array))throw new TypeError("can't coerce `"+value.constructor.name+"` into a Buffer");value=new Buffer(value)}cb(null,key,value)},Iterator.prototype._next=function(callback){if(this._callback)throw new Error("callback already exists");if(this._keyRangeError||0===this._limit)return void callback();var readNext=this._readNext;this._readNext=!1,readNext?process.nextTick(function(){readNext(callback)}):this._callback=callback}}).call(exports,__webpack_require__(0).Buffer,__webpack_require__(2))},function(module,exports,__webpack_require__){function isLevelDOWN(db){return!(!db||"object"!=typeof db)&&Object.keys(AbstractLevelDOWN.prototype).filter(function(name){return"_"!=name[0]&&"approximateSize"!=name}).every(function(name){return"function"==typeof db[name]})}var AbstractLevelDOWN=__webpack_require__(246);module.exports=isLevelDOWN},function(module,exports,__webpack_require__){function Batch(levelup,codec){this._levelup=levelup,this._codec=codec,this.batch=levelup.db.batch(),this.ops=[],this.length=0}var util=__webpack_require__(248),WriteError=__webpack_require__(105).WriteError,getOptions=util.getOptions,dispatchError=util.dispatchError;Batch.prototype.put=function(key_,value_,options){options=getOptions(options);var key=this._codec.encodeKey(key_,options),value=this._codec.encodeValue(value_,options);try{this.batch.put(key,value)}catch(e){throw new WriteError(e)}return this.ops.push({type:"put",key:key,value:value}),this.length++,this},Batch.prototype.del=function(key_,options){options=getOptions(options);var key=this._codec.encodeKey(key_,options);try{this.batch.del(key)}catch(err){throw new WriteError(err)}return this.ops.push({type:"del",key:key}),this.length++,this},Batch.prototype.clear=function(){try{this.batch.clear()}catch(err){throw new WriteError(err)}return this.ops=[],this.length=0,this},Batch.prototype.write=function(callback){var levelup=this._levelup,ops=this.ops;try{this.batch.write(function(err){if(err)return dispatchError(levelup,new WriteError(err),callback);levelup.emit("batch",ops),callback&&callback()})}catch(err){throw new WriteError(err)}},module.exports=Batch},function(module,exports,__webpack_require__){(function(process){function getCallback(options,callback){return"function"==typeof options?options:callback}function LevelUP(location,options,callback){if(!(this instanceof LevelUP))return new LevelUP(location,options,callback);var error;if(EventEmitter.call(this),this.setMaxListeners(1/0),"function"==typeof location?(options="object"==typeof options?options:{},options.db=location,location=null):"object"==typeof location&&"function"==typeof location.db&&(options=location,location=null),"function"==typeof options&&(callback=options,options={}),(!options||"function"!=typeof options.db)&&"string"!=typeof location){if(error=new InitializationError("Must provide a location for the database"),callback)return process.nextTick(function(){callback(error)});throw error}options=getOptions(options),this.options=extend(defaultOptions,options),this._codec=new Codec(this.options),this._status="new",prr(this,"location",location,"e"),this.open(callback)}function maybeError(db,options,callback){if(!db._isOpening()&&!db.isOpen())return dispatchError(db,new ReadError("Database is not open"),callback),!0}function writeError(db,message,callback){dispatchError(db,new WriteError(message),callback)}function readError(db,message,callback){dispatchError(db,new ReadError(message),callback)}function utilStatic(name){return function(location,callback){getLevelDOWN()[name](location,callback||function(){})}}var EventEmitter=__webpack_require__(8).EventEmitter,inherits=__webpack_require__(10).inherits,deprecate=__webpack_require__(10).deprecate,extend=__webpack_require__(37),prr=__webpack_require__(721),DeferredLevelDOWN=__webpack_require__(393),IteratorStream=__webpack_require__(555),errors=__webpack_require__(105),WriteError=errors.WriteError,ReadError=errors.ReadError,NotFoundError=errors.NotFoundError,OpenError=errors.OpenError,EncodingError=errors.EncodingError,InitializationError=errors.InitializationError,util=__webpack_require__(248),Batch=__webpack_require__(558),Codec=__webpack_require__(553),getOptions=util.getOptions,defaultOptions=util.defaultOptions,getLevelDOWN=__webpack_require__(858),dispatchError=util.dispatchError;util.isDefined;"function"!=typeof getLevelDOWN&&(getLevelDOWN=function(){}),inherits(LevelUP,EventEmitter),LevelUP.prototype.open=function(callback){var dbFactory,db,self=this;return this.isOpen()?(callback&&process.nextTick(function(){callback(null,self)}),this):this._isOpening()?callback&&this.once("open",function(){callback(null,self)}):(this.emit("opening"),this._status="opening",this.db=new DeferredLevelDOWN(this.location),dbFactory=this.options.db||getLevelDOWN(),db=dbFactory(this.location),void db.open(this.options,function(err){if(err)return dispatchError(self,new OpenError(err),callback);self.db.setDb(db),self.db=db,self._status="open",callback&&callback(null,self),self.emit("open"),self.emit("ready")}))},LevelUP.prototype.close=function(callback){var self=this;if(this.isOpen())this._status="closing",this.db.close(function(){self._status="closed",self.emit("closed"),callback&&callback.apply(null,arguments)}),this.emit("closing"),this.db=new DeferredLevelDOWN(this.location);else{if("closed"==this._status&&callback)return process.nextTick(callback);"closing"==this._status&&callback?this.once("closed",callback):this._isOpening()&&this.once("open",function(){self.close(callback)})}},LevelUP.prototype.isOpen=function(){return"open"==this._status},LevelUP.prototype._isOpening=function(){return"opening"==this._status},LevelUP.prototype.isClosed=function(){return/^clos/.test(this._status)},LevelUP.prototype.get=function(key_,options,callback){var key,self=this;if(callback=getCallback(options,callback),!maybeError(this,options,callback)){if(null===key_||void 0===key_||"function"!=typeof callback)return readError(this,"get() requires key and callback arguments",callback);options=util.getOptions(options),key=this._codec.encodeKey(key_,options),options.asBuffer=this._codec.valueAsBuffer(options),this.db.get(key,options,function(err,value){if(err)return err=/notfound/i.test(err)||err.notFound?new NotFoundError("Key not found in database ["+key_+"]",err):new ReadError(err),dispatchError(self,err,callback);if(callback){try{value=self._codec.decodeValue(value,options)}catch(e){return callback(new EncodingError(e))}callback(null,value)}})}},LevelUP.prototype.put=function(key_,value_,options,callback){var key,value,self=this;if(callback=getCallback(options,callback),null===key_||void 0===key_)return writeError(this,"put() requires a key argument",callback);maybeError(this,options,callback)||(options=getOptions(options),key=this._codec.encodeKey(key_,options),value=this._codec.encodeValue(value_,options),this.db.put(key,value,options,function(err){if(err)return dispatchError(self,new WriteError(err),callback);self.emit("put",key_,value_),callback&&callback()}))},LevelUP.prototype.del=function(key_,options,callback){var key,self=this;if(callback=getCallback(options,callback),null===key_||void 0===key_)return writeError(this,"del() requires a key argument",callback);maybeError(this,options,callback)||(options=getOptions(options),key=this._codec.encodeKey(key_,options),this.db.del(key,options,function(err){if(err)return dispatchError(self,new WriteError(err),callback);self.emit("del",key_),callback&&callback()}))},LevelUP.prototype.batch=function(arr_,options,callback){var arr,self=this;return arguments.length?(callback=getCallback(options,callback),Array.isArray(arr_)?void(maybeError(this,options,callback)||(options=getOptions(options),arr=self._codec.encodeBatch(arr_,options),arr=arr.map(function(op){return op.type||void 0===op.key||void 0===op.value||(op.type="put"),op}),this.db.batch(arr,options,function(err){if(err)return dispatchError(self,new WriteError(err),callback);self.emit("batch",arr_),callback&&callback()}))):writeError(this,"batch() requires an array argument",callback)):new Batch(this,this._codec)},LevelUP.prototype.approximateSize=deprecate(function(start_,end_,options,callback){var start,end,self=this;if(callback=getCallback(options,callback),options=getOptions(options),null===start_||void 0===start_||null===end_||void 0===end_||"function"!=typeof callback)return readError(this,"approximateSize() requires start, end and callback arguments",callback);start=this._codec.encodeKey(start_,options),end=this._codec.encodeKey(end_,options),this.db.approximateSize(start,end,function(err,size){if(err)return dispatchError(self,new OpenError(err),callback);callback&&callback(null,size)})},"db.approximateSize() is deprecated. Use db.db.approximateSize() instead"),LevelUP.prototype.readStream=LevelUP.prototype.createReadStream=function(options){return options=extend({keys:!0,values:!0},this.options,options),options.keyEncoding=options.keyEncoding,options.valueEncoding=options.valueEncoding,options=this._codec.encodeLtgt(options),options.keyAsBuffer=this._codec.keyAsBuffer(options),options.valueAsBuffer=this._codec.valueAsBuffer(options),"number"!=typeof options.limit&&(options.limit=-1),new IteratorStream(this.db.iterator(options),extend(options,{decoder:this._codec.createStreamDecoder(options)}))},LevelUP.prototype.keyStream=LevelUP.prototype.createKeyStream=function(options){return this.createReadStream(extend(options,{keys:!0,values:!1}))},LevelUP.prototype.valueStream=LevelUP.prototype.createValueStream=function(options){return this.createReadStream(extend(options,{keys:!1,values:!0}))},LevelUP.prototype.toString=function(){return"LevelUP"},module.exports=LevelUP,module.exports.errors=__webpack_require__(105),module.exports.destroy=deprecate(utilStatic("destroy"),"levelup.destroy() is deprecated. Use leveldown.destroy() instead"),module.exports.repair=deprecate(utilStatic("repair"),"levelup.repair() is deprecated. Use leveldown.repair() instead")}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";const secp256k1=__webpack_require__(768),multihashing=__webpack_require__(30),setImmediate=__webpack_require__(11),randomBytes=__webpack_require__(50).randomBytes;exports.privateKeyLength=32,exports.generateKey=function(callback){const done=(err,res)=>setImmediate(()=>{callback(err,res)});let privateKey;do{privateKey=randomBytes(32)}while(!secp256k1.privateKeyVerify(privateKey));done(null,privateKey)},exports.hashAndSign=function(key,msg,callback){const done=(err,res)=>setImmediate(()=>{callback(err,res)});multihashing.digest(msg,"sha2-256",(err,digest)=>{if(err)return done(err);try{const sig=secp256k1.sign(digest,key),sigDER=secp256k1.signatureExport(sig.signature);return done(null,sigDER)}catch(err){done(err)}})},exports.hashAndVerify=function(key,sig,msg,callback){const done=(err,res)=>setImmediate(()=>{callback(err,res)});multihashing.digest(msg,"sha2-256",(err,digest)=>{if(err)return done(err);try{sig=secp256k1.signatureImport(sig);const valid=secp256k1.verify(digest,sig,key);return done(null,valid)}catch(err){done(err)}})},exports.compressPublicKey=function(key){if(!secp256k1.publicKeyVerify(key))throw new Error("Invalid public key");return secp256k1.publicKeyConvert(key,!0)},exports.decompressPublicKey=function(key){return secp256k1.publicKeyConvert(key,!1)},exports.validatePrivateKey=function(key){if(!secp256k1.privateKeyVerify(key))throw new Error("Invalid private key")},exports.validatePublicKey=function(key){if(!secp256k1.publicKeyVerify(key))throw new Error("Invalid public key")},exports.computePublicKey=function(privateKey){return exports.validatePrivateKey(privateKey),secp256k1.publicKeyCreate(privateKey)}},function(module,exports,__webpack_require__){"use strict";function unmarshalSecp256k1PrivateKey(bytes,callback){callback(null,new Secp256k1PrivateKey(bytes),null)}function unmarshalSecp256k1PublicKey(bytes){return new Secp256k1PublicKey(bytes)}function generateKeyPair(_bits,cb){void 0===cb&&"function"==typeof _bits&&(cb=_bits),ensure(cb),crypto.generateKey((err,privateKeyBytes)=>{if(err)return cb(err);let privkey;try{privkey=new Secp256k1PrivateKey(privateKeyBytes)}catch(err){return void cb(err)}cb(null,privkey)})}function ensure(cb){if("function"!=typeof cb)throw new Error("callback is required")}const multihashing=__webpack_require__(30),crypto=__webpack_require__(560),pbm=__webpack_require__(50).protobuf;class Secp256k1PublicKey{constructor(key){crypto.validatePublicKey(key),this._key=key}verify(data,sig,callback){ensure(callback),crypto.hashAndVerify(this._key,sig,data,callback)}marshal(){return crypto.compressPublicKey(this._key)}get bytes(){return pbm.PublicKey.encode({Type:pbm.KeyType.Secp256k1,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}class Secp256k1PrivateKey{constructor(key,publicKey){this._key=key,this._publicKey=publicKey||crypto.computePublicKey(key),crypto.validatePrivateKey(this._key),crypto.validatePublicKey(this._publicKey)}sign(message,callback){ensure(callback),crypto.hashAndSign(this._key,message,callback)}get public(){return new Secp256k1PublicKey(this._publicKey)}marshal(){return this._key}get bytes(){return pbm.PrivateKey.encode({Type:pbm.KeyType.Secp256k1,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}module.exports={Secp256k1PublicKey:Secp256k1PublicKey,Secp256k1PrivateKey:Secp256k1PrivateKey,unmarshalSecp256k1PrivateKey:unmarshalSecp256k1PrivateKey,unmarshalSecp256k1PublicKey:unmarshalSecp256k1PublicKey,generateKeyPair:generateKeyPair}},function(module,exports,__webpack_require__){"use strict";const ciphers=__webpack_require__(563),CIPHER_MODES={16:"aes-128-ctr",32:"aes-256-ctr"};exports.create=function(key,iv,callback){const mode=CIPHER_MODES[key.length];if(!mode)return callback(new Error("Invalid key length"));const cipher=ciphers.createCipheriv(mode,key,iv),decipher=ciphers.createDecipheriv(mode,key,iv);callback(null,{encrypt(data,cb){cb(null,cipher.update(data))},decrypt(data,cb){cb(null,decipher.update(data))}})}},function(module,exports,__webpack_require__){"use strict";const crypto=__webpack_require__(373);module.exports={createCipheriv:crypto.createCipheriv,createDecipheriv:crypto.createDecipheriv}},function(module,exports,__webpack_require__){"use strict";function marshalPublicKey(jwk){const byteLen=curveLengths[jwk.crv];return Buffer.concat([Buffer.from([4]),toBn(jwk.x).toArrayLike(Buffer,"be",byteLen),toBn(jwk.y).toArrayLike(Buffer,"be",byteLen)],1+2*byteLen)}function unmarshalPublicKey(curve,key){const byteLen=curveLengths[curve];if(!key.slice(0,1).equals(Buffer.from([4])))throw new Error("Invalid key format");const x=new BN(key.slice(1,byteLen+1)),y=new BN(key.slice(1+byteLen));return{kty:"EC",crv:curve,x:toBase64(x,byteLen),y:toBase64(y,byteLen),ext:!0}}function unmarshalPrivateKey(curve,key){const result=unmarshalPublicKey(curve,key.public);return result.d=toBase64(new BN(key.private)),result}const crypto=__webpack_require__(106)(),nodeify=__webpack_require__(81),BN=__webpack_require__(54).bignum,Buffer=__webpack_require__(13).Buffer,util=__webpack_require__(249),toBase64=util.toBase64,toBn=util.toBn,bits={"P-256":256,"P-384":384,"P-521":521};exports.generateEphmeralKeyPair=function(curve,callback){nodeify(crypto.subtle.generateKey({name:"ECDH",namedCurve:curve},!0,["deriveBits"]).then(pair=>{const genSharedKey=(theirPub,forcePrivate,cb)=>{"function"==typeof forcePrivate&&(cb=forcePrivate,forcePrivate=void 0);let privateKey;privateKey=forcePrivate?crypto.subtle.importKey("jwk",unmarshalPrivateKey(curve,forcePrivate),{name:"ECDH",namedCurve:curve},!1,["deriveBits"]):Promise.resolve(pair.privateKey),nodeify(Promise.all([crypto.subtle.importKey("jwk",unmarshalPublicKey(curve,theirPub),{name:"ECDH",namedCurve:curve},!1,[]),privateKey]).then(keys=>crypto.subtle.deriveBits({name:"ECDH",namedCurve:curve,public:keys[0]},keys[1],bits[curve])).then(bits=>Buffer.from(bits)),cb)};return crypto.subtle.exportKey("jwk",pair.publicKey).then(publicKey=>{return{key:marshalPublicKey(publicKey),genSharedKey:genSharedKey}})}),callback)};const curveLengths={"P-256":32,"P-384":48,"P-521":66}},function(module,exports,__webpack_require__){"use strict";const nacl=__webpack_require__(818),setImmediate=__webpack_require__(11),Buffer=__webpack_require__(13).Buffer;exports.publicKeyLength=nacl.sign.publicKeyLength,exports.privateKeyLength=nacl.sign.secretKeyLength,exports.generateKey=function(callback){const done=(err,res)=>setImmediate(()=>{callback(err,res)});let keys;try{keys=nacl.sign.keyPair()}catch(err){return void done(err)}done(null,keys)},exports.generateKeyFromSeed=function(seed,callback){const done=(err,res)=>setImmediate(()=>{callback(err,res)});let keys;try{keys=nacl.sign.keyPair.fromSeed(seed)}catch(err){return void done(err)}done(null,keys)},exports.hashAndSign=function(key,msg,callback){setImmediate(()=>{callback(null,Buffer.from(nacl.sign.detached(msg,key)))})},exports.hashAndVerify=function(key,sig,msg,callback){setImmediate(()=>{callback(null,nacl.sign.detached.verify(msg,sig,key))})}},function(module,exports,__webpack_require__){"use strict";const nodeify=__webpack_require__(81),Buffer=__webpack_require__(13).Buffer,crypto=__webpack_require__(106)(),lengths=__webpack_require__(567),hashTypes={SHA1:"SHA-1",SHA256:"SHA-256",SHA512:"SHA-512"};exports.create=function(hashType,secret,callback){const hash=hashTypes[hashType];nodeify(crypto.subtle.importKey("raw",secret,{name:"HMAC",hash:{name:hash}},!1,["sign"]).then(key=>{return{digest(data,cb){nodeify(crypto.subtle.sign({name:"HMAC"},key,data).then(raw=>Buffer.from(raw)),cb)},length:lengths[hashType]}}),callback)}},function(module,exports,__webpack_require__){"use strict";module.exports={SHA1:20,SHA256:32,SHA512:64}},function(module,exports,__webpack_require__){"use strict";function exportKey(pair){return Promise.all([crypto.subtle.exportKey("jwk",pair.privateKey),crypto.subtle.exportKey("jwk",pair.publicKey)])}function derivePublicFromPrivate(jwKey){return crypto.subtle.importKey("jwk",{kty:jwKey.kty,n:jwKey.n,e:jwKey.e,alg:jwKey.alg,kid:jwKey.kid},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"])}const nodeify=__webpack_require__(81),Buffer=__webpack_require__(13).Buffer,crypto=__webpack_require__(106)();exports.utils=__webpack_require__(569),exports.generateKey=function(bits,callback){nodeify(crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:bits,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(exportKey).then(keys=>({privateKey:keys[0],publicKey:keys[1]})),callback)},exports.unmarshalPrivateKey=function(key,callback){const privateKey=crypto.subtle.importKey("jwk",key,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]);nodeify(Promise.all([privateKey,derivePublicFromPrivate(key)]).then(keys=>exportKey({privateKey:keys[0],publicKey:keys[1]})).then(keys=>({privateKey:keys[0],publicKey:keys[1]})),callback)},exports.getRandomValues=function(arr){return Buffer.from(crypto.getRandomValues(arr))},exports.hashAndSign=function(key,msg,callback){nodeify(crypto.subtle.importKey("jwk",key,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]).then(privateKey=>{return crypto.subtle.sign({name:"RSASSA-PKCS1-v1_5"},privateKey,Uint8Array.from(msg))}).then(sig=>Buffer.from(sig)),callback)},exports.hashAndVerify=function(key,sig,msg,callback){nodeify(crypto.subtle.importKey("jwk",key,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]).then(publicKey=>{return crypto.subtle.verify({name:"RSASSA-PKCS1-v1_5"},publicKey,sig,msg)}),callback)}},function(module,exports,__webpack_require__){"use strict";const asn1=__webpack_require__(54),util=__webpack_require__(249),toBase64=util.toBase64,toBn=util.toBn,RSAPrivateKey=asn1.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}),AlgorithmIdentifier=asn1.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid({"1.2.840.113549.1.1.1":"rsa"}),this.key("none").optional().null_(),this.key("curve").optional().objid(),this.key("params").optional().seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()))}),PublicKey=asn1.define("RSAPublicKey",function(){this.seq().obj(this.key("algorithm").use(AlgorithmIdentifier),this.key("subjectPublicKey").bitstr())}),RSAPublicKey=asn1.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});exports.pkcs1ToJwk=function(bytes){const asn1=RSAPrivateKey.decode(bytes,"der");return{kty:"RSA",n:toBase64(asn1.modulus),e:toBase64(asn1.publicExponent),d:toBase64(asn1.privateExponent),p:toBase64(asn1.prime1),q:toBase64(asn1.prime2),dp:toBase64(asn1.exponent1),dq:toBase64(asn1.exponent2),qi:toBase64(asn1.coefficient),alg:"RS256",kid:"2011-04-29"}},exports.jwkToPkcs1=function(jwk){return RSAPrivateKey.encode({version:0,modulus:toBn(jwk.n),publicExponent:toBn(jwk.e),privateExponent:toBn(jwk.d),prime1:toBn(jwk.p),prime2:toBn(jwk.q),exponent1:toBn(jwk.dp),exponent2:toBn(jwk.dq),coefficient:toBn(jwk.qi)},"der")},exports.pkixToJwk=function(bytes){const ndata=PublicKey.decode(bytes,"der"),asn1=RSAPublicKey.decode(ndata.subjectPublicKey.data,"der");return{kty:"RSA",n:toBase64(asn1.modulus),e:toBase64(asn1.publicExponent),alg:"RS256",kid:"2011-04-29"}},exports.jwkToPkix=function(jwk){return PublicKey.encode({algorithm:{algorithm:"rsa",none:null},subjectPublicKey:{data:RSAPublicKey.encode({modulus:toBn(jwk.n),publicExponent:toBn(jwk.e)},"der")}},"der")}},function(module,exports,__webpack_require__){"use strict";const crypto=__webpack_require__(78);module.exports=((curve,callback)=>{crypto.ecdh.generateEphmeralKeyPair(curve,callback)})},function(module,exports,__webpack_require__){"use strict";const crypto=__webpack_require__(78),whilst=__webpack_require__(90),Buffer=__webpack_require__(13).Buffer,cipherMap={"AES-128":{ivSize:16,keySize:16},"AES-256":{ivSize:16,keySize:32},Blowfish:{ivSize:8,cipherKeySize:32}};module.exports=((cipherType,hash,secret,callback)=>{const cipher=cipherMap[cipherType];if(!cipher)return callback(new Error("unkown cipherType passed"));if(!hash)return callback(new Error("unkown hashType passed"));const cipherKeySize=cipher.keySize,ivSize=cipher.ivSize,seed=Buffer.from("key expansion"),resultLength=2*(ivSize+cipherKeySize+20);crypto.hmac.create(hash,secret,(err,m)=>{if(err)return callback(err);m.digest(seed,(err,a)=>{function stretch(cb){m.digest(Buffer.concat([a,seed]),(err,b)=>{if(err)return cb(err);let todo=b.length;j+todo>resultLength&&(todo=resultLength-j),result.push(b),j+=todo,m.digest(a,(err,_a)=>{if(err)return cb(err);a=_a,cb()})})}function finish(err){if(err)return callback(err);const half=resultLength/2,resultBuffer=Buffer.concat(result),r1=resultBuffer.slice(0,half),r2=resultBuffer.slice(half,resultLength),createKey=res=>({iv:res.slice(0,ivSize),cipherKey:res.slice(ivSize,ivSize+cipherKeySize),macKey:res.slice(ivSize+cipherKeySize)});callback(null,{k1:createKey(r1),k2:createKey(r2)})}if(err)return callback(err);let result=[],j=0;whilst(()=>j{if(err)return cb(err);let privkey;try{privkey=new Ed25519PrivateKey(keys.secretKey,keys.publicKey)}catch(err){return void cb(err)}cb(null,privkey)})}function generateKeyPairFromSeed(seed,_bits,cb){void 0===cb&&"function"==typeof _bits&&(cb=_bits),crypto.generateKeyFromSeed(seed,(err,keys)=>{if(err)return cb(err);let privkey;try{privkey=new Ed25519PrivateKey(keys.secretKey,keys.publicKey)}catch(err){return void cb(err)}cb(null,privkey)})}function ensure(cb){if("function"!=typeof cb)throw new Error("callback is required")}function ensureKey(key,length){if(Buffer.isBuffer(key)&&(key=new Uint8Array(key)),!(key instanceof Uint8Array)||key.length!==length)throw new Error("Key must be a Uint8Array or Buffer of length "+length);return key}const multihashing=__webpack_require__(30),protobuf=__webpack_require__(39),Buffer=__webpack_require__(13).Buffer,crypto=__webpack_require__(78).ed25519,pbm=protobuf(__webpack_require__(141));class Ed25519PublicKey{constructor(key){this._key=ensureKey(key,crypto.publicKeyLength)}verify(data,sig,callback){ensure(callback),crypto.hashAndVerify(this._key,sig,data,callback)}marshal(){return Buffer.from(this._key)}get bytes(){return pbm.PublicKey.encode({Type:pbm.KeyType.Ed25519,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}class Ed25519PrivateKey{constructor(key,publicKey){this._key=ensureKey(key,crypto.privateKeyLength),this._publicKey=ensureKey(publicKey,crypto.publicKeyLength)}sign(message,callback){ensure(callback),crypto.hashAndSign(this._key,message,callback)}get public(){if(!this._publicKey)throw new Error("public key not provided");return new Ed25519PublicKey(this._publicKey)}marshal(){return Buffer.concat([Buffer.from(this._key),Buffer.from(this._publicKey)])}get bytes(){return pbm.PrivateKey.encode({Type:pbm.KeyType.Ed25519,Data:this.marshal()})}equals(key){ +return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}module.exports={Ed25519PublicKey:Ed25519PublicKey,Ed25519PrivateKey:Ed25519PrivateKey,unmarshalEd25519PrivateKey:unmarshalEd25519PrivateKey,unmarshalEd25519PublicKey:unmarshalEd25519PublicKey,generateKeyPair:generateKeyPair,generateKeyPairFromSeed:generateKeyPairFromSeed}},function(module,exports,__webpack_require__){"use strict";module.exports={rsa:__webpack_require__(574),ed25519:__webpack_require__(572),secp256k1:__webpack_require__(561)}},function(module,exports,__webpack_require__){"use strict";function unmarshalRsaPrivateKey(bytes,callback){const jwk=crypto.utils.pkcs1ToJwk(bytes);crypto.unmarshalPrivateKey(jwk,(err,keys)=>{if(err)return callback(err);callback(null,new RsaPrivateKey(keys.privateKey,keys.publicKey))})}function unmarshalRsaPublicKey(bytes){return new RsaPublicKey(crypto.utils.pkixToJwk(bytes))}function generateKeyPair(bits,cb){crypto.generateKey(bits,(err,keys)=>{if(err)return cb(err);cb(null,new RsaPrivateKey(keys.privateKey,keys.publicKey))})}function ensure(cb){if("function"!=typeof cb)throw new Error("callback is required")}const multihashing=__webpack_require__(30),protobuf=__webpack_require__(39),crypto=__webpack_require__(78).rsa,pbm=protobuf(__webpack_require__(141));class RsaPublicKey{constructor(key){this._key=key}verify(data,sig,callback){ensure(callback),crypto.hashAndVerify(this._key,sig,data,callback)}marshal(){return crypto.utils.jwkToPkix(this._key)}get bytes(){return pbm.PublicKey.encode({Type:pbm.KeyType.RSA,Data:this.marshal()})}encrypt(bytes){return this._key.encrypt(bytes,"RSAES-PKCS1-V1_5")}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}class RsaPrivateKey{constructor(key,publicKey){this._key=key,this._publicKey=publicKey}genSecret(){return crypto.getRandomValues(new Uint8Array(16))}sign(message,callback){ensure(callback),crypto.hashAndSign(this._key,message,callback)}get public(){if(!this._publicKey)throw new Error("public key not provided");return new RsaPublicKey(this._publicKey)}decrypt(msg,callback){crypto.decrypt(this._key,msg,callback)}marshal(){return crypto.utils.jwkToPkcs1(this._key)}get bytes(){return pbm.PrivateKey.encode({Type:pbm.KeyType.RSA,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}module.exports={RsaPublicKey:RsaPublicKey,RsaPrivateKey:RsaPrivateKey,unmarshalRsaPublicKey:unmarshalRsaPublicKey,unmarshalRsaPrivateKey:unmarshalRsaPrivateKey,generateKeyPair:generateKeyPair}},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),log=debug("libp2p:floodsub");log.err=debug("libp2p:floodsub:error"),module.exports={log:log,multicodec:"/floodsub/1.0.0"}},function(module,exports,__webpack_require__){"use strict";const EventEmitter=__webpack_require__(8),TimeCache=__webpack_require__(815),values=__webpack_require__(149),pull=__webpack_require__(5),lp=__webpack_require__(28),assert=__webpack_require__(7),asyncEach=__webpack_require__(32),Peer=__webpack_require__(579),utils=__webpack_require__(580),pb=__webpack_require__(250),config=__webpack_require__(575),Buffer=__webpack_require__(13).Buffer,log=config.log,multicodec=config.multicodec,ensureArray=utils.ensureArray,setImmediate=__webpack_require__(11);class FloodSub extends EventEmitter{constructor(libp2p){super(),this.libp2p=libp2p,this.started=!1,this.cache=new TimeCache,this.peers=new Map,this.subscriptions=new Set,this._onConnection=this._onConnection.bind(this),this._dialPeer=this._dialPeer.bind(this)}_dialPeer(peerInfo,callback){callback=callback||function(){};const idB58Str=peerInfo.id.toB58String();log("dialing %s",idB58Str);const peer=this.peers.get(idB58Str);peer&&peer.isConnected||this.libp2p.dial(peerInfo,multicodec,(err,conn)=>{if(err)return log.err(err);this._onDial(peerInfo,conn,callback)})}_onDial(peerInfo,conn,callback){const idB58Str=peerInfo.id.toB58String();this.peers.has(idB58Str)||this.peers.set(idB58Str,new Peer(peerInfo));const peer=this.peers.get(idB58Str);peer.attachConnection(conn),peer.sendSubscriptions(this.subscriptions),setImmediate(()=>callback())}_onConnection(protocol,conn){conn.getPeerInfo((err,peerInfo)=>{if(err)return log.err("Failed to identify incomming conn",err),pull(pull.empty(),conn);const idB58Str=peerInfo.id.toB58String();this.peers.has(idB58Str)||(log("new peer",idB58Str),this.peers.set(idB58Str,new Peer(peerInfo))),this._processConnection(idB58Str,conn)})}_processConnection(idB58Str,conn){pull(conn,lp.decode(),pull.map(data=>pb.rpc.RPC.decode(data)),pull.drain(rpc=>this._onRpc(idB58Str,rpc),err=>this._onConnectionEnd(idB58Str,err)))}_onRpc(idB58Str,rpc){if(rpc){const subs=rpc.subscriptions,msgs=rpc.msgs;if(msgs&&msgs.length&&this._processRpcMessages(rpc.msgs),subs&&subs.length){const peer=this.peers.get(idB58Str);peer&&peer.updateSubscriptions(subs)}}}_processRpcMessages(msgs){msgs.forEach(msg=>{const seqno=utils.msgId(msg.from,msg.seqno.toString());this.cache.has(seqno)||(this.cache.put(seqno),this._emitMessages(msg.topicCIDs,[msg]),this._forwardMessages(msg.topicCIDs,[msg]))})}_onConnectionEnd(idB58Str,err){err&&"socket hang up"!==err.message&&log.err(err),this.peers.delete(idB58Str)}_emitMessages(topics,messages){topics.forEach(topic=>{this.subscriptions.has(topic)&&messages.forEach(message=>{this.emit(topic,message)})})}_forwardMessages(topics,messages){this.peers.forEach(peer=>{peer.isWritable&&utils.anyMatch(peer.topics,topics)&&(peer.sendMessages(messages),log("publish msgs on topics",topics,peer.info.id.toB58String()))})}start(callback){if(this.started)return setImmediate(()=>callback(new Error("already started")));this.libp2p.handle(multicodec,this._onConnection),this.libp2p.swarm.on("peer-mux-established",this._dialPeer),asyncEach(values(this.libp2p.peerBook.getAll()),(peerInfo,cb)=>{this._dialPeer(peerInfo,cb)},err=>{setImmediate(()=>{this.started=!0,callback(err)})})}stop(callback){if(!this.started)return setImmediate(()=>callback(new Error("not started yet")));this.libp2p.unhandle(multicodec),this.libp2p.swarm.removeListener("peer-mux-established",this._dialPeer),asyncEach(this.peers.values(),(peer,cb)=>peer.close(cb),err=>{if(err)return callback(err);this.peers=new Map,this.started=!1,callback()})}publish(topics,messages){assert(this.started,"FloodSub is not started"),log("publish",topics,messages),topics=ensureArray(topics),messages=ensureArray(messages);const from=this.libp2p.peerInfo.id.toB58String(),buildMessage=msg=>{const seqno=utils.randomSeqno();return this.cache.put(utils.msgId(from,seqno)),{from:from,data:msg,seqno:new Buffer(seqno),topicCIDs:topics}},msgObjects=messages.map(buildMessage);this._emitMessages(topics,msgObjects),this._forwardMessages(topics,messages.map(buildMessage))}subscribe(topics){function checkIfReady(peer){peer&&peer.isWritable?peer.sendSubscriptions(topics):setImmediate(checkIfReady.bind(peer))}assert(this.started,"FloodSub is not started"),topics=ensureArray(topics),topics.forEach(topic=>{this.subscriptions.add(topic)}),this.peers.forEach(peer=>checkIfReady(peer))}unsubscribe(topics){function checkIfReady(peer){peer&&peer.isWritable?peer.sendUnsubscriptions(topics):setImmediate(checkIfReady.bind(peer))}assert(this.started,"FloodSub is not started"),topics=ensureArray(topics),topics.forEach(topic=>{this.subscriptions.delete(topic)}),this.peers.forEach(peer=>checkIfReady(peer))}}module.exports=FloodSub},function(module,exports,__webpack_require__){"use strict";module.exports=` +message RPC { + repeated SubOpts subscriptions = 1; + repeated Message msgs = 2; + + message SubOpts { + optional bool subscribe = 1; // subscribe or unsubcribe + optional string topicCID = 2; + } + + message Message { + optional string from = 1; + optional bytes data = 2; + optional bytes seqno = 3; + repeated string topicCIDs = 4; // CID of topic descriptor object + } +}`},function(module,exports,__webpack_require__){"use strict";module.exports=` +// topicCID = cid(merkledag_protobuf(topicDescriptor)); (not the topic.name) +message TopicDescriptor { + optional string name = 1; + optional AuthOpts auth = 2; + optional EncOpts enc = 2; + + message AuthOpts { + optional AuthMode mode = 1; + repeated bytes keys = 2; // root keys to trust + + enum AuthMode { + NONE = 0; // no authentication, anyone can publish + KEY = 1; // only messages signed by keys in the topic descriptor are accepted + WOT = 2; // web of trust, certificates can allow publisher set to grow + } + } + + message EncOpts { + optional EncMode mode = 1; + repeated bytes keyHashes = 2; // the hashes of the shared keys used (salted) + + enum EncMode { + NONE = 0; // no encryption, anyone can read + SHAREDKEY = 1; // messages are encrypted with shared key + WOT = 2; // web of trust, certificates can allow publisher set to grow + } + } +}`},function(module,exports,__webpack_require__){"use strict";const lp=__webpack_require__(28),Pushable=__webpack_require__(36),pull=__webpack_require__(5),setImmediate=__webpack_require__(11),rpc=__webpack_require__(250).rpc.RPC;class Peer{constructor(info){this.info=info,this.conn=null,this.topics=new Set,this.stream=null}get isConnected(){return Boolean(this.conn)}get isWritable(){return Boolean(this.stream)}write(msg){if(!this.isWritable){const id=this.info.id.toB58String();throw new Error("No writable connection to "+id)}this.stream.push(msg)}attachConnection(conn){this.conn=conn,this.stream=new Pushable,pull(this.stream,lp.encode(),conn)}_sendRawSubscriptions(topics,subscribe){if(0!==topics.size){const subs=[];topics.forEach(topic=>{subs.push({subscribe:subscribe,topicCID:topic})}),this.write(rpc.encode({subscriptions:subs}))}}sendSubscriptions(topics){this._sendRawSubscriptions(topics,!0)}sendUnsubscriptions(topics){this._sendRawSubscriptions(topics,!1)}sendMessages(msgs){this.write(rpc.encode({msgs:msgs}))}updateSubscriptions(changes){changes.forEach(subopt=>{subopt.subscribe?this.topics.add(subopt.topicCID):this.topics.delete(subopt.topicCID)})}close(callback){!this.conn||this.stream,this.stream&&this.stream.end(),setImmediate(()=>{this.conn=null,this.stream=null,callback()})}}module.exports=Peer},function(module,exports,__webpack_require__){"use strict";const crypto=__webpack_require__(50);exports=module.exports,exports.randomSeqno=(()=>{return crypto.randomBytes(20).toString("hex")}),exports.msgId=((from,seqno)=>{return from+seqno}),exports.anyMatch=((a,b)=>{let bHas;bHas=Array.isArray(b)?val=>b.indexOf(val)>-1:val=>b.has(val);for(let val of a)if(bHas(val))return!0;return!1}),exports.ensureArray=(maybeArray=>{return Array.isArray(maybeArray)?maybeArray:[maybeArray]})},function(module,exports,__webpack_require__){"use strict";function getObservedAddrs(input){if(!hasObservedAddr(input))return[];let addrs=input.observedAddr;return Array.isArray(input.observedAddr)||(addrs=[addrs]),addrs.map(oa=>multiaddr(oa))}function hasObservedAddr(input){return input.observedAddr&&input.observedAddr.length>0}const PeerInfo=__webpack_require__(51),PeerId=__webpack_require__(31),multiaddr=__webpack_require__(34),pull=__webpack_require__(5),lp=__webpack_require__(28),msg=__webpack_require__(251);module.exports=((conn,callback)=>{pull(conn,lp.decode(),pull.take(1),pull.collect((err,data)=>{if(err)return callback(err);if(0===data.length)return callback(new Error("conn was closed, did not receive data"));const input=msg.decode(data[0]);PeerId.createFromPubKey(input.publicKey,(err,id)=>{if(err)return callback(err);const peerInfo=new PeerInfo(id);input.listenAddrs.map(multiaddr).forEach(ma=>peerInfo.multiaddrs.add(ma)),callback(null,peerInfo,getObservedAddrs(input))})}))})},function(module,exports,__webpack_require__){"use strict";exports=module.exports,exports.multicodec="/ipfs/id/1.0.0",exports.listener=__webpack_require__(583),exports.dialer=__webpack_require__(581)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const pull=__webpack_require__(5),lp=__webpack_require__(28),msg=__webpack_require__(251);module.exports=((conn,pInfoSelf)=>{conn.getObservedAddrs((err,observedAddrs)=>{if(!err){observedAddrs=observedAddrs[0];let publicKey=new Buffer(0);pInfoSelf.id.pubKey&&(publicKey=pInfoSelf.id.pubKey.bytes);const msgSend=msg.encode({protocolVersion:"ipfs/0.1.0",agentVersion:"na",publicKey:publicKey,listenAddrs:pInfoSelf.multiaddrs.toArray().map(ma=>ma.buffer),observedAddr:observedAddrs?observedAddrs.buffer:new Buffer("")});pull(pull.values([msgSend]),lp.encode(),conn)}})})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function mapMuxers(list){return list.map(pref=>{if("string"!=typeof pref)return pref;switch(pref.trim().toLowerCase()){case"spdy":return spdy;case"multiplex":return multiplex;default:throw new Error(pref+" muxer not available")}})}function getMuxers(options){return options?mapMuxers(options):[multiplex,spdy]}const WS=__webpack_require__(623),WebRTCStar=__webpack_require__(622),spdy=__webpack_require__(600),multiplex=__webpack_require__(585),secio=__webpack_require__(598),Railing=__webpack_require__(591),libp2p=__webpack_require__(626);class Node extends libp2p{constructor(peerInfo,peerBook,options){options=options||{};const webRTCStar=new WebRTCStar,modules={transport:[new WS,webRTCStar],connection:{muxer:getMuxers(options.muxer),crypto:[secio]},discovery:[]};if(options.webRTCStar&&modules.discovery.push(webRTCStar.discovery),options.bootstrap){const r=new Railing(options.bootstrap);modules.discovery.push(r)}super(modules,peerInfo,peerBook,options)}}module.exports=Node},function(module,exports,__webpack_require__){"use strict";function create(rawConn,isListener){const stream=toStream(rawConn);stream.on("end",()=>stream.destroy());const mpx=new Multiplex({halfOpen:!0,initiator:!isListener});return pump(stream,mpx,stream),new Muxer(rawConn,mpx)}const Multiplex=__webpack_require__(695),toStream=__webpack_require__(158),MULTIPLEX_CODEC=__webpack_require__(252),Muxer=__webpack_require__(586),pump=__webpack_require__(759);exports=module.exports=create,exports.multicodec=MULTIPLEX_CODEC,exports.dialer=(conn=>create(conn,!1)),exports.listener=(conn=>create(conn,!0))},function(module,exports,__webpack_require__){"use strict";function noop(){}function catchError(stream){return{source:pull(stream.source,pullCatch(err=>{if("Channel destroyed"!==err.message)return!1})),sink:stream.sink}}const EventEmitter=__webpack_require__(8).EventEmitter,Connection=__webpack_require__(29).Connection,toPull=__webpack_require__(120),pull=__webpack_require__(5),pullCatch=__webpack_require__(723),setImmediate=__webpack_require__(11),MULTIPLEX_CODEC=__webpack_require__(252);module.exports=class MultiplexMuxer extends EventEmitter{constructor(conn,multiplex){super(),this.multiplex=multiplex,this.conn=conn,this.multicodec=MULTIPLEX_CODEC,multiplex.on("close",()=>this.emit("close")),multiplex.on("error",err=>this.emit("error",err)),multiplex.on("stream",(stream,id)=>{const muxedConn=new Connection(catchError(toPull.duplex(stream)),this.conn);this.emit("stream",muxedConn)})}newStream(callback){callback=callback||noop;let stream=this.multiplex.createStream();const conn=new Connection(catchError(toPull.duplex(stream)),this.conn);return setImmediate(()=>callback(null,conn)),conn}end(callback){callback=callback||noop,this.multiplex.once("close",callback),this.multiplex.destroy()}}},function(module,exports,__webpack_require__){"use strict";function mount(swarm){swarm.handle(PROTOCOL,(protocol,conn)=>{function next(){shake.read(PING_LENGTH,(err,buf)=>{if(err!==!0)return err?log.error(err):(shake.write(buf),next())})}const stream=handshake({timeout:0}),shake=stream.handshake;pull(conn,stream,conn),next()})}function unmount(swarm){swarm.unhandle(PROTOCOL)}const pull=__webpack_require__(5),handshake=__webpack_require__(67),constants=__webpack_require__(142),PROTOCOL=constants.PROTOCOL,PING_LENGTH=constants.PING_LENGTH,debug=__webpack_require__(3),log=debug("libp2p-ping");log.error=debug("libp2p-ping:error"),exports=module.exports,exports.mount=mount,exports.unmount=unmount},function(module,exports,__webpack_require__){"use strict";const handler=__webpack_require__(587);exports=module.exports=__webpack_require__(589),exports.mount=handler.mount,exports.unmount=handler.unmount},function(module,exports,__webpack_require__){"use strict";const EventEmitter=__webpack_require__(8).EventEmitter,pull=__webpack_require__(5),handshake=__webpack_require__(67),constants=__webpack_require__(142),util=__webpack_require__(590),rnd=util.rnd,debug=__webpack_require__(3),log=debug("libp2p-ping");log.error=debug("libp2p-ping:error");const PROTOCOL=constants.PROTOCOL,PING_LENGTH=constants.PING_LENGTH;class Ping extends EventEmitter{constructor(swarm,peer){super();let shake,stop=!1,self=this;log("dialing %s to %s",PROTOCOL,peer.id.toB58String()),swarm.dial(peer,PROTOCOL,(err,conn)=>{function next(){let start=new Date,buf=rnd(PING_LENGTH);shake.write(buf),shake.read(PING_LENGTH,(err,bufBack)=>{let end=new Date;if(err||!buf.equals(bufBack)){const err=new Error("Received wrong ping ack");return self.emit("error",err)}self.emit("ping",end-start),stop||next()})}if(err)return this.emit("error",err);const stream=handshake({timeout:0});shake=stream.handshake,pull(stream,conn,stream),next()}),this.stop=(()=>{!stop&&shake&&(stop=!0,pull(pull.empty(),shake.rest()))})}}module.exports=Ping},function(module,exports,__webpack_require__){"use strict";const crypto=__webpack_require__(50),constants=__webpack_require__(142);exports=module.exports,exports.rnd=(length=>{return length||(length=constants.PING_LENGTH),crypto.randomBytes(length)})},function(module,exports,__webpack_require__){"use strict";const PeerId=__webpack_require__(31),PeerInfo=__webpack_require__(51),multiaddr=__webpack_require__(34),EventEmitter=__webpack_require__(8).EventEmitter,debug=__webpack_require__(3),includes=__webpack_require__(660),setImmediate=__webpack_require__(11),log=debug("libp2p:railing");log.error=debug("libp2p:railing:error");class Railing extends EventEmitter{constructor(bootstrapers){super(),this.bootstrapers=bootstrapers}start(callback){setImmediate(callback),setImmediate(()=>{this.bootstrapers.forEach(candidate=>{candidate=multiaddr(candidate);let ma;includes(candidate.protoNames(),"ipfs")&&(ma=candidate.decapsulate("ipfs"));let peerIdB58Str;try{peerIdB58Str=candidate.stringTuples().filter(tuple=>{if(tuple[0]===candidate.protos().filter(proto=>{return"ipfs"===proto.name})[0].code)return!0})[0][1]}catch(e){throw new Error("Error extracting IPFS id from multiaddr",e)}const peerId=PeerId.createFromB58String(peerIdB58Str);PeerInfo.create(peerId,(err,peerInfo)=>{if(err)return log.error("Error creating PeerInfo from bootstrap peer",err);peerInfo.multiaddrs.add(ma),this.emit("peer",peerInfo)})})})}stop(callback){setImmediate(callback)}}module.exports=Railing},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function ensureBuffer(){return pull.map(c=>{return"string"==typeof c?new Buffer(c,"utf-8"):c})}const pull=__webpack_require__(5),lp=__webpack_require__(28),lpOpts={fixed:!0,bytes:4};exports.createBoxStream=((cipher,mac)=>{return pull(ensureBuffer(),pull.asyncMap((chunk,cb)=>{cipher.encrypt(chunk,(err,data)=>{if(err)return cb(err);mac.digest(data,(err,digest)=>{if(err)return cb(err);cb(null,Buffer.concat([data,digest]))})})}),lp.encode(lpOpts))}),exports.createUnboxStream=((decipher,mac)=>{return pull(ensureBuffer(),lp.decode(lpOpts),pull.asyncMap((chunk,cb)=>{const l=chunk.length,macSize=mac.length;if(l{return err?cb(err):macd.equals(expected)?void decipher.decrypt(data,(err,decrypted)=>{if(err)return cb(err);cb(null,decrypted)}):cb(new Error(`MAC Invalid: ${macd.toString("hex")} != ${expected.toString("hex")}`))})}))})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),waterfall=__webpack_require__(9),support=__webpack_require__(144),crypto=__webpack_require__(143),log=debug("libp2p:secio");log.error=debug("libp2p:secio:error"),module.exports=function(state,cb){log("2. exchange - start"),log("2. exchange - writing exchange"),waterfall([cb=>crypto.createExchange(state,cb),(ex,cb)=>{support.write(state,ex),support.read(state.shake,cb)},(msg,cb)=>{log("2. exchange - reading exchange"),crypto.verify(state,msg,cb)},cb=>crypto.generateKeys(state,cb)],err=>{if(err)return cb(err);log("2. exchange - finish"),cb()})}},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(5),handshake=__webpack_require__(67),debug=__webpack_require__(3),log=debug("libp2p:secio");log.error=debug("libp2p:secio:error");const etm=__webpack_require__(592),crypto=__webpack_require__(143);module.exports=function(state,cb){log("3. finish - start");const proto=state.protocols,stream=state.shake.rest(),shake=handshake({timeout:state.timeout},err=>{if(err)throw err});pull(stream,etm.createUnboxStream(proto.remote.cipher,proto.remote.mac),shake,etm.createBoxStream(proto.local.cipher,proto.local.mac),stream),shake.handshake.write(state.proposal.in.rand),shake.handshake.read(state.proposal.in.rand.length,(err,nonceBack)=>{const fail=err=>{log.error(err),state.secure.resolve({source:pull.error(err),sink(read){}}),cb(err)};if(err)return fail(err);try{crypto.verifyNonce(state,nonceBack)}catch(err){return fail(err)}log("3. finish - finish"),state.secure.resolve(shake.handshake.rest()),cb()})}},function(module,exports,__webpack_require__){"use strict";const series=__webpack_require__(40),propose=__webpack_require__(596),exchange=__webpack_require__(593),finish=__webpack_require__(594);module.exports=function(state){return series([cb=>propose(state,cb),cb=>exchange(state,cb),cb=>finish(state,cb)],err=>{state.cleanSecrets(),err&&(err===!0&&(err=new Error("Stream ended prematurely")),state.shake.abort(err))}),state.stream}},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),waterfall=__webpack_require__(9),support=__webpack_require__(144),crypto=__webpack_require__(143),log=debug("libp2p:secio");log.error=debug("libp2p:secio:error"),module.exports=function(state,cb){log("1. propose - start"),log("1. propose - writing proposal"),support.write(state,crypto.createProposal(state)),waterfall([cb=>support.read(state.shake,cb),(msg,cb)=>{log("1. propose - reading proposal",msg),crypto.identify(state,msg,cb)},cb=>crypto.selectProtocols(state,cb)],err=>{if(err)return cb(err);log("1. propose - finish"),cb()})}},function(module,exports,__webpack_require__){"use strict";module.exports=`message Propose { + optional bytes rand = 1; + optional bytes pubkey = 2; + optional string exchanges = 3; + optional string ciphers = 4; + optional string hashes = 5; +} + +message Exchange { + optional bytes epubkey = 1; + optional bytes signature = 2; +}`},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(5),Connection=__webpack_require__(29).Connection,handshake=__webpack_require__(595),State=__webpack_require__(599);module.exports={tag:"/secio/1.0.0",encrypt(local,key,insecure,callback){if(!local)throw new Error("no local id provided");if(!key)throw new Error("no local private key provided");if(!insecure)throw new Error("no insecure stream provided");callback||(callback=(err=>{err&&console.error(err)}));const state=new State(local,key,3e5,callback);return pull(insecure,handshake(state),insecure),new Connection(state.secure,insecure)}}},function(module,exports,__webpack_require__){"use strict";const handshake=__webpack_require__(67),deferred=__webpack_require__(295);class State{constructor(id,key,timeout,cb){"function"==typeof timeout&&(cb=timeout,timeout=void 0),this.setup(),this.id.local=id,this.key.local=key,this.timeout=timeout||6e4,cb=cb||(()=>{}),this.secure=deferred.duplex(),this.stream=handshake({timeout:this.timeout},cb),this.shake=this.stream.handshake,delete this.stream.handshake}setup(){this.id={local:null,remote:null},this.key={local:null,remote:null},this.shake=null,this.cleanSecrets()}cleanSecrets(){this.shared={},this.ephemeralKey={local:null,remote:null},this.proposal={in:null,out:null},this.proposalEncoded={in:null,out:null},this.protocols={local:null,remote:null},this.exchange={in:null,out:null}}}module.exports=State},function(module,exports,__webpack_require__){"use strict";function create(rawConn,isListener){const conn=toStream(rawConn);return conn.resume(),conn.on("end",()=>{conn.destroy()}),new Muxer(rawConn,spdy.connection.create(conn,{protocol:"spdy",isServer:isListener}))}const spdy=__webpack_require__(21),toStream=__webpack_require__(158),Muxer=__webpack_require__(601),SPDY_CODEC=__webpack_require__(253);exports=module.exports=create,exports.multicodec=SPDY_CODEC,exports.dialer=(conn=>create(conn,!1)),exports.listener=(conn=>create(conn,!0))},function(module,exports,__webpack_require__){"use strict";const EventEmitter=__webpack_require__(8).EventEmitter,noop=__webpack_require__(634),Connection=__webpack_require__(29).Connection,toPull=__webpack_require__(120),SPDY_CODEC=__webpack_require__(253);module.exports=class Muxer extends EventEmitter{constructor(conn,spdy){super(),this.spdy=spdy,this.conn=conn,this.multicodec=SPDY_CODEC,spdy.start(3.1),spdy.on("close",()=>{this.emit("close")}),spdy.on("error",err=>{this.emit("error",err)}),spdy.on("stream",stream=>{stream.respond(200,{});const muxedConn=new Connection(toPull.duplex(stream),this.conn);this.emit("stream",muxedConn)})}newStream(callback){callback||(callback=noop);const conn=new Connection(null,this.conn);return this.spdy.request({method:"POST",path:"/",headers:{}},(err,stream)=>{if(err)return callback(err);conn.setInnerConn(toPull.duplex(stream),this.conn),callback(null,conn)}),conn}end(cb){this.spdy.destroyStreams(),this.spdy.end(cb)}}},function(module,exports,__webpack_require__){"use strict";const identify=__webpack_require__(582),multistream=__webpack_require__(152),waterfall=__webpack_require__(9),debug=__webpack_require__(3),log=debug("libp2p:swarm:connection"),setImmediate=__webpack_require__(11),protocolMuxer=__webpack_require__(107),plaintext=__webpack_require__(254);module.exports=function(swarm){return{addUpgrade(){},addStreamMuxer(muxer){swarm.muxers[muxer.multicodec]=muxer,swarm.handle(muxer.multicodec,(protocol,conn)=>{const muxedConn=muxer.listener(conn);return muxedConn.on("stream",conn=>{protocolMuxer(swarm.protocols,conn)}),swarm.identify&&(conn.getPeerInfo=(cb=>{const conn=muxedConn.newStream(),ms=new multistream.Dialer;waterfall([cb=>ms.handle(conn,cb),cb=>ms.select(identify.multicodec,cb),(conn,cb)=>identify.dialer(conn,cb),(peerInfo,observedAddrs,cb)=>{observedAddrs.forEach(oa=>{swarm._peerInfo.multiaddrs.addSafe(oa)}),cb(null,peerInfo)}],cb)}),conn.getPeerInfo((err,peerInfo)=>{if(err)return log("Identify not successful");const b58Str=peerInfo.id.toB58String();swarm.muxedConns[b58Str]={muxer:muxedConn},peerInfo.multiaddrs.size>0?peerInfo.connect(peerInfo.multiaddrs.toArray()[0]):peerInfo.connect(`/ipfs/${b58Str}`),peerInfo=swarm._peerBook.put(peerInfo),muxedConn.on("close",()=>{delete swarm.muxedConns[b58Str],peerInfo.disconnect(),peerInfo=swarm._peerBook.put(peerInfo),setImmediate(()=>swarm.emit("peer-mux-closed",peerInfo))}),setImmediate(()=>swarm.emit("peer-mux-established",peerInfo))})),conn})},reuse(){swarm.identify=!0,swarm.handle(identify.multicodec,(protocol,conn)=>{identify.listener(conn,swarm._peerInfo)})},crypto(tag,encrypt){tag||encrypt||(tag=plaintext.tag,encrypt=plaintext.encrypt),swarm.unhandle(swarm.crypto.tag),swarm.handle(tag,(protocol,conn)=>{const id=swarm._peerInfo.id,secure=encrypt(id,id.privKey,conn);protocolMuxer(swarm.protocols,secure)}),swarm.crypto={tag:tag,encrypt:encrypt}}}}},function(module,exports,__webpack_require__){"use strict";const multistream=__webpack_require__(152),Connection=__webpack_require__(29).Connection,debug=__webpack_require__(3),log=debug("libp2p:swarm:dial"),setImmediate=__webpack_require__(11),protocolMuxer=__webpack_require__(107);module.exports=function(swarm){return(pi,protocol,callback)=>{function gotWarmedUpConn(conn){conn.setPeerInfo(pi),attemptMuxerUpgrade(conn,(err,muxer)=>{if(!protocol)return err&&(swarm.conns[b58Id]=conn),callback();err?protocolHandshake(conn,protocol,callback):gotMuxer(muxer)})}function gotMuxer(muxer){swarm.identify,openConnInMuxedConn(muxer,conn=>{protocolHandshake(conn,protocol,callback)})}function attemptMuxerUpgrade(conn,cb){function nextMuxer(key){log("selecting %s",key),ms.select(key,(err,conn)=>{if(err)return void(0===muxers.length?cb(new Error("could not upgrade to stream muxing")):nextMuxer(muxers.shift()));const muxedConn=swarm.muxers[key].dialer(conn);swarm.muxedConns[b58Id]={},swarm.muxedConns[b58Id].muxer=muxedConn,muxedConn.once("close",()=>{const b58Str=pi.id.toB58String();delete swarm.muxedConns[b58Str],pi.disconnect(),swarm._peerBook.get(b58Str).disconnect(),setImmediate(()=>swarm.emit("peer-mux-closed",pi))}),muxedConn.on("stream",conn=>{protocolMuxer(swarm.protocols,conn)}),setImmediate(()=>swarm.emit("peer-mux-established",pi)),cb(null,muxedConn)})}const muxers=Object.keys(swarm.muxers);if(0===muxers.length)return cb(new Error("no muxers available"));const ms=new multistream.Dialer;ms.handle(conn,err=>{if(err)return callback(new Error("multistream not supported"));nextMuxer(muxers.shift())})}function openConnInMuxedConn(muxer,cb){cb(muxer.newStream())}function protocolHandshake(conn,protocol,cb){const ms=new multistream.Dialer;ms.handle(conn,err=>{if(err)return callback(err);ms.select(protocol,(err,conn)=>{if(err)return callback(err);proxyConn.setInnerConn(conn),callback(null,proxyConn)})})}"function"==typeof protocol&&(callback=protocol,protocol=null),callback=callback||function(){};const proxyConn=new Connection,b58Id=pi.id.toB58String();if(log("dialing %s",b58Id),swarm.muxedConns[b58Id]){if(!protocol)return callback();gotMuxer(swarm.muxedConns[b58Id].muxer)}else if(swarm.conns[b58Id]){const conn=swarm.conns[b58Id];swarm.conns[b58Id]=void 0,gotWarmedUpConn(conn)}else!function(pi,cb){function nextTransport(key){swarm.transport.dial(key,pi,(err,conn)=>{if(err)return 0===tKeys.length?cb(new Error("Could not dial in any of the transports")):nextTransport(tKeys.shift());!function(){const ms=new multistream.Dialer;ms.handle(conn,err=>{if(err)return cb(err);const id=swarm._peerInfo.id;log("selecting crypto: %s",swarm.crypto.tag),ms.select(swarm.crypto.tag,(err,conn)=>{if(err)return cb(err);cb(null,swarm.crypto.encrypt(id,id.privKey,conn))})})}()})}const tKeys=swarm.availableTransports(pi);if(0===tKeys.length)return cb(new Error("No available transport to dial to"));nextTransport(tKeys.shift())}(pi,(err,conn)=>{if(err)return callback(err);gotWarmedUpConn(conn)});return proxyConn}}},function(module,exports,__webpack_require__){"use strict";function Swarm(peerInfo,peerBook){if(!(this instanceof Swarm))return new Swarm(peerInfo);assert(peerInfo,"You must provide a `peerInfo`"),assert(peerBook,"You must provide a `peerBook`"),this._peerInfo=peerInfo,this._peerBook=peerBook,this.transports={},this.conns={},this.muxedConns={},this.protocols={},this.muxers={},this.identify=!1,this.crypto=plaintext,this.transport=transport(this),this.connection=connection(this),this.availableTransports=(pi=>{const myAddrs=pi.multiaddrs.toArray();return Object.keys(this.transports).filter(ts=>this.transports[ts].filter(myAddrs).length>0)}),this.dial=dial(this),this.listen=(callback=>{each(this.availableTransports(peerInfo),(ts,cb)=>{this.transport.listen(ts,{},null,cb)},callback)}),this.handle=((protocol,handlerFunc,matchFunc)=>{this.protocols[protocol]={handlerFunc:handlerFunc,matchFunc:matchFunc}}),this.handle(this.crypto.tag,(protocol,conn)=>{const peerId=this._peerInfo.id,wrapped=this.crypto.encrypt(peerId,peerId.privKey,conn);return protocolMuxer(this.protocols,wrapped)}),this.unhandle=(protocol=>{this.protocols[protocol]&&delete this.protocols[protocol]}),this.hangUp=((peerInfo,callback)=>{const key=peerInfo.id.toB58String();if(this.muxedConns[key]){const muxer=this.muxedConns[key].muxer;muxer.once("close",()=>{delete this.muxedConns[key],callback()}),muxer.end()}else callback()}),this.close=(callback=>{series([cb=>each(this.muxedConns,(conn,cb)=>{conn.muxer.end(err=>{if(err&&"Fatal error: OK"!==err.message)return cb(err);cb()})},cb),cb=>{each(this.transports,(transport,cb)=>{each(transport.listeners,(listener,cb)=>{listener.close(cb)},cb)},cb)}],callback)})}const util=__webpack_require__(10),EE=__webpack_require__(8).EventEmitter,each=__webpack_require__(32),series=__webpack_require__(40),transport=__webpack_require__(607),connection=__webpack_require__(602),dial=__webpack_require__(603),protocolMuxer=__webpack_require__(107),plaintext=__webpack_require__(254),assert=__webpack_require__(7);module.exports=Swarm,util.inherits(Swarm,EE)},function(module,exports,__webpack_require__){"use strict";const map=__webpack_require__(89),debug=__webpack_require__(3),log=debug("libp2p:swarm:dialer"),DialQueue=__webpack_require__(606);class LimitDialer{constructor(perPeerLimit,dialTimeout){log("create: %s peer limit, %s dial timeout",perPeerLimit,dialTimeout),this.perPeerLimit=perPeerLimit,this.dialTimeout=dialTimeout,this.queues=new Map}dialMany(peer,transport,addrs,callback){log("dialMany:start");const token={cancel:!1};map(addrs,(m,cb)=>{this.dialSingle(peer,transport,m,token,cb)},(err,results)=>{if(err)return callback(err);const success=results.filter(res=>res.conn);if(success.length>0)return log("dialMany:success"),callback(null,success[0]);log("dialMany:error");const error=new Error("Failed to dial any provided address");return error.errors=results.filter(res=>res.error).map(res=>res.error),callback(error)})}dialSingle(peer,transport,addr,token,callback){const ps=peer.toB58String();log("dialSingle: %s:%s",ps,addr.toString());let q;this.queues.has(ps)?q=this.queues.get(ps):(q=new DialQueue(this.perPeerLimit,this.dialTimeout),this.queues.set(ps,q)),q.push(transport,addr,token,callback)}}module.exports=LimitDialer},function(module,exports,__webpack_require__){"use strict";const Connection=__webpack_require__(29).Connection,pull=__webpack_require__(5),timeout=__webpack_require__(357),queue=__webpack_require__(181),debug=__webpack_require__(3),log=debug("libp2p:swarm:dialer:queue");class DialQueue{constructor(limit,dialTimeout){this.dialTimeout=dialTimeout,this.queue=queue((task,cb)=>{this._doWork(task.transport,task.addr,task.token,cb)},limit)}_doWork(transport,addr,token,callback){log("work"),this._dialWithTimeout(transport,addr,(err,conn)=>{return err?(log("work:error"),callback(null,{error:err})):token.cancel?(log("work:cancel"),pull(pull.empty(),conn),callback(null,{cancel:!0})):(token.cancel=!0,log("work:success"),(new Connection).setInnerConn(conn),void callback(null,{multiaddr:addr,conn:conn}))})}_dialWithTimeout(transport,addr,callback){timeout(cb=>{const conn=transport.dial(addr,err=>{if(err)return cb(err);cb(null,conn)})},this.dialTimeout)(callback)}push(transport,addr,token,callback){this.queue.push({transport:transport,addr:addr,token:token},callback)}}module.exports=DialQueue},function(module,exports,__webpack_require__){"use strict";function dialables(tp,multiaddrs){return tp.filter(multiaddrs)}function noop(){}const parallel=__webpack_require__(46),once=__webpack_require__(82),debug=__webpack_require__(3),log=debug("libp2p:swarm:transport"),protocolMuxer=__webpack_require__(107),LimitDialer=__webpack_require__(605);module.exports=function(swarm){const dialer=new LimitDialer(8,1e4);return{add(key,transport,options,callback){if("function"==typeof options&&(callback=options,options={}),callback=callback||noop,log("adding %s",key),swarm.transports[key])throw new Error("There is already a transport with this key");swarm.transports[key]=transport,swarm.transports[key].listeners||(swarm.transports[key].listeners=[]),callback()},dial(key,pi,callback){const t=swarm.transports[key];let multiaddrs=pi.multiaddrs.toArray();Array.isArray(multiaddrs)||(multiaddrs=[multiaddrs]),log("dialing %s",key,multiaddrs.map(m=>m.toString())),multiaddrs=dialables(t,multiaddrs),dialer.dialMany(pi.id,t,multiaddrs,(err,success)=>{if(err)return callback(err);pi.connect(success.multiaddr),swarm._peerBook.put(pi),callback(null,success.conn)})},listen(key,options,handler,callback){handler||(handler=protocolMuxer.bind(null,swarm.protocols));const multiaddrs=dialables(swarm.transports[key],swarm._peerInfo.multiaddrs.distinct()),transport=swarm.transports[key];transport.listeners||(transport.listeners=[]);let freshMultiaddrs=[];parallel(multiaddrs.map(ma=>{return cb=>{const done=once(cb),listener=transport.createListener(handler);listener.once("error",done),listener.listen(ma,err=>{if(err)return done(err);listener.removeListener("error",done),listener.getAddrs((err,addrs)=>{if(err)return done(err);freshMultiaddrs=freshMultiaddrs.concat(addrs),transport.listeners.push(listener),done()})})}}),err=>{if(err)return callback(err);swarm._peerInfo.multiaddrs.replace(multiaddrs,freshMultiaddrs),callback()})},close(key,callback){const transport=swarm.transports[key];if(!transport)return callback(new Error(`Trying to close non existing transport: ${key}`));parallel(transport.listeners.map(listener=>{return cb=>{listener.close(cb)}}),callback)}}}},function(module,exports,__webpack_require__){module.exports=__webpack_require__(609)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(610),module.exports.parser=__webpack_require__(64)},function(module,exports,__webpack_require__){(function(global){function Socket(uri,opts){if(!(this instanceof Socket))return new Socket(uri,opts);opts=opts||{},uri&&"object"==typeof uri&&(opts=uri,uri=null),uri?(uri=parseuri(uri),opts.hostname=uri.host,opts.secure="https"===uri.protocol||"wss"===uri.protocol,opts.port=uri.port,uri.query&&(opts.query=uri.query)):opts.host&&(opts.hostname=parseuri(opts.host).host),this.secure=null!=opts.secure?opts.secure:global.location&&"https:"===location.protocol,opts.hostname&&!opts.port&&(opts.port=this.secure?"443":"80"),this.agent=opts.agent||!1,this.hostname=opts.hostname||(global.location?location.hostname:"localhost"),this.port=opts.port||(global.location&&location.port?location.port:this.secure?443:80),this.query=opts.query||{},"string"==typeof this.query&&(this.query=parseqs.decode(this.query)),this.upgrade=!1!==opts.upgrade,this.path=(opts.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!opts.forceJSONP,this.jsonp=!1!==opts.jsonp,this.forceBase64=!!opts.forceBase64,this.enablesXDR=!!opts.enablesXDR,this.timestampParam=opts.timestampParam||"t",this.timestampRequests=opts.timestampRequests,this.transports=opts.transports||["polling","websocket"],this.transportOptions=opts.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=opts.policyPort||843,this.rememberUpgrade=opts.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=opts.onlyBinaryUpgrades,this.perMessageDeflate=!1!==opts.perMessageDeflate&&(opts.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=opts.pfx||null,this.key=opts.key||null,this.passphrase=opts.passphrase||null,this.cert=opts.cert||null,this.ca=opts.ca||null,this.ciphers=opts.ciphers||null,this.rejectUnauthorized=void 0===opts.rejectUnauthorized||opts.rejectUnauthorized,this.forceNode=!!opts.forceNode;var freeGlobal="object"==typeof global&&global;freeGlobal.global===freeGlobal&&(opts.extraHeaders&&Object.keys(opts.extraHeaders).length>0&&(this.extraHeaders=opts.extraHeaders),opts.localAddress&&(this.localAddress=opts.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}function clone(obj){var o={};for(var i in obj)obj.hasOwnProperty(i)&&(o[i]=obj[i]);return o}var transports=__webpack_require__(255),Emitter=__webpack_require__(63),debug=__webpack_require__(3)("engine.io-client:socket"),index=__webpack_require__(131),parser=__webpack_require__(64),parseuri=__webpack_require__(291),parsejson=__webpack_require__(712),parseqs=__webpack_require__(154);module.exports=Socket,Socket.priorWebsocketSuccess=!1,Emitter(Socket.prototype),Socket.protocol=parser.protocol,Socket.Socket=Socket,Socket.Transport=__webpack_require__(145),Socket.transports=__webpack_require__(255),Socket.parser=__webpack_require__(64),Socket.prototype.createTransport=function(name){debug('creating transport "%s"',name);var query=clone(this.query);query.EIO=parser.protocol,query.transport=name;var options=this.transportOptions[name]||{};return this.id&&(query.sid=this.id),new transports[name]({query:query,socket:this,agent:options.agent||this.agent,hostname:options.hostname||this.hostname,port:options.port||this.port,secure:options.secure||this.secure,path:options.path||this.path,forceJSONP:options.forceJSONP||this.forceJSONP,jsonp:options.jsonp||this.jsonp,forceBase64:options.forceBase64||this.forceBase64,enablesXDR:options.enablesXDR||this.enablesXDR,timestampRequests:options.timestampRequests||this.timestampRequests,timestampParam:options.timestampParam||this.timestampParam,policyPort:options.policyPort||this.policyPort,pfx:options.pfx||this.pfx,key:options.key||this.key,passphrase:options.passphrase||this.passphrase,cert:options.cert||this.cert,ca:options.ca||this.ca,ciphers:options.ciphers||this.ciphers,rejectUnauthorized:options.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:options.perMessageDeflate||this.perMessageDeflate,extraHeaders:options.extraHeaders||this.extraHeaders,forceNode:options.forceNode||this.forceNode,localAddress:options.localAddress||this.localAddress,requestTimeout:options.requestTimeout||this.requestTimeout,protocols:options.protocols||void 0})},Socket.prototype.open=function(){var transport;if(this.rememberUpgrade&&Socket.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)transport="websocket";else{if(0===this.transports.length){var self=this;return void setTimeout(function(){self.emit("error","No transports available")},0)}transport=this.transports[0]}this.readyState="opening";try{transport=this.createTransport(transport)}catch(e){return this.transports.shift(),void this.open()}transport.open(),this.setTransport(transport)},Socket.prototype.setTransport=function(transport){debug("setting transport %s",transport.name);var self=this;this.transport&&(debug("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=transport,transport.on("drain",function(){self.onDrain()}).on("packet",function(packet){self.onPacket(packet)}).on("error",function(e){self.onError(e)}).on("close",function(){self.onClose("transport close")})},Socket.prototype.probe=function(name){function onTransportOpen(){if(self.onlyBinaryUpgrades){var upgradeLosesBinary=!this.supportsBinary&&self.transport.supportsBinary;failed=failed||upgradeLosesBinary}failed||(debug('probe transport "%s" opened',name),transport.send([{type:"ping",data:"probe"}]),transport.once("packet",function(msg){if(!failed)if("pong"===msg.type&&"probe"===msg.data){if(debug('probe transport "%s" pong',name),self.upgrading=!0,self.emit("upgrading",transport),!transport)return;Socket.priorWebsocketSuccess="websocket"===transport.name,debug('pausing current transport "%s"',self.transport.name),self.transport.pause(function(){failed||"closed"!==self.readyState&&(debug("changing transport and sending upgrade packet"),cleanup(),self.setTransport(transport),transport.send([{type:"upgrade"}]),self.emit("upgrade",transport),transport=null,self.upgrading=!1,self.flush())})}else{debug('probe transport "%s" failed',name);var err=new Error("probe error");err.transport=transport.name,self.emit("upgradeError",err)}}))}function freezeTransport(){failed||(failed=!0,cleanup(),transport.close(),transport=null)}function onerror(err){var error=new Error("probe error: "+err);error.transport=transport.name,freezeTransport(),debug('probe transport "%s" failed because of error: %s',name,err),self.emit("upgradeError",error)}function onTransportClose(){onerror("transport closed")}function onclose(){onerror("socket closed")}function onupgrade(to){transport&&to.name!==transport.name&&(debug('"%s" works - aborting "%s"',to.name,transport.name),freezeTransport())}function cleanup(){transport.removeListener("open",onTransportOpen),transport.removeListener("error",onerror),transport.removeListener("close",onTransportClose),self.removeListener("close",onclose),self.removeListener("upgrading",onupgrade)}debug('probing transport "%s"',name);var transport=this.createTransport(name,{probe:1}),failed=!1,self=this;Socket.priorWebsocketSuccess=!1,transport.once("open",onTransportOpen),transport.once("error",onerror),transport.once("close",onTransportClose),this.once("close",onclose),this.once("upgrading",onupgrade),transport.open()},Socket.prototype.onOpen=function(){if(debug("socket open"),this.readyState="open",Socket.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){debug("starting upgrade probes");for(var i=0,l=this.upgrades.length;i';iframe=document.createElement(html)}catch(e){iframe=document.createElement("iframe"),iframe.name=self.iframeId,iframe.src="javascript:0"}iframe.id=self.iframeId,self.form.appendChild(iframe),self.iframe=iframe}var self=this;if(!this.form){var iframe,form=document.createElement("form"),area=document.createElement("textarea"),id=this.iframeId="eio_iframe_"+this.index;form.className="socketio",form.style.position="absolute",form.style.top="-1000px",form.style.left="-1000px",form.target=id,form.method="POST",form.setAttribute("accept-charset","utf-8"),area.name="d",form.appendChild(area),document.body.appendChild(form),this.form=form,this.area=area}this.form.action=this.uri(),initIframe(),data=data.replace(/\\n/g,"\\\n"),this.area.value=data.replace(/\n/g,"\\n");try{this.form.submit()}catch(e){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===self.iframe.readyState&&complete()}:this.iframe.onload=complete}}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){(function(global){function empty(){}function XHR(opts){if(Polling.call(this,opts),this.requestTimeout=opts.requestTimeout,this.extraHeaders=opts.extraHeaders,global.location){var isSSL="https:"===location.protocol,port=location.port;port||(port=isSSL?443:80),this.xd=opts.hostname!==global.location.hostname||port!==opts.port,this.xs=opts.secure!==isSSL}}function Request(opts){this.method=opts.method||"GET",this.uri=opts.uri,this.xd=!!opts.xd,this.xs=!!opts.xs,this.async=!1!==opts.async,this.data=void 0!==opts.data?opts.data:null,this.agent=opts.agent,this.isBinary=opts.isBinary,this.supportsBinary=opts.supportsBinary,this.enablesXDR=opts.enablesXDR,this.requestTimeout=opts.requestTimeout,this.pfx=opts.pfx,this.key=opts.key,this.passphrase=opts.passphrase,this.cert=opts.cert,this.ca=opts.ca,this.ciphers=opts.ciphers,this.rejectUnauthorized=opts.rejectUnauthorized,this.extraHeaders=opts.extraHeaders,this.create()}function unloadHandler(){for(var i in Request.requests)Request.requests.hasOwnProperty(i)&&Request.requests[i].abort()}var XMLHttpRequest=__webpack_require__(146),Polling=__webpack_require__(256),Emitter=__webpack_require__(63),inherit=__webpack_require__(95),debug=__webpack_require__(3)("engine.io-client:polling-xhr");module.exports=XHR,module.exports.Request=Request,inherit(XHR,Polling),XHR.prototype.supportsBinary=!0,XHR.prototype.request=function(opts){return opts=opts||{},opts.uri=this.uri(),opts.xd=this.xd,opts.xs=this.xs,opts.agent=this.agent||!1,opts.supportsBinary=this.supportsBinary,opts.enablesXDR=this.enablesXDR,opts.pfx=this.pfx,opts.key=this.key,opts.passphrase=this.passphrase,opts.cert=this.cert,opts.ca=this.ca,opts.ciphers=this.ciphers,opts.rejectUnauthorized=this.rejectUnauthorized,opts.requestTimeout=this.requestTimeout,opts.extraHeaders=this.extraHeaders,new Request(opts)},XHR.prototype.doWrite=function(data,fn){var isBinary="string"!=typeof data&&void 0!==data,req=this.request({method:"POST",data:data,isBinary:isBinary}),self=this;req.on("success",fn),req.on("error",function(err){self.onError("xhr post error",err)}),this.sendXhr=req},XHR.prototype.doPoll=function(){debug("xhr poll");var req=this.request(),self=this;req.on("data",function(data){self.onData(data)}),req.on("error",function(err){self.onError("xhr poll error",err)}),this.pollXhr=req},Emitter(Request.prototype),Request.prototype.create=function(){var opts={agent:this.agent, +xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};opts.pfx=this.pfx,opts.key=this.key,opts.passphrase=this.passphrase,opts.cert=this.cert,opts.ca=this.ca,opts.ciphers=this.ciphers,opts.rejectUnauthorized=this.rejectUnauthorized;var xhr=this.xhr=new XMLHttpRequest(opts),self=this;try{debug("xhr open %s: %s",this.method,this.uri),xhr.open(this.method,this.uri,this.async);try{if(this.extraHeaders){xhr.setDisableHeaderCheck&&xhr.setDisableHeaderCheck(!0);for(var i in this.extraHeaders)this.extraHeaders.hasOwnProperty(i)&&xhr.setRequestHeader(i,this.extraHeaders[i])}}catch(e){}if("POST"===this.method)try{this.isBinary?xhr.setRequestHeader("Content-type","application/octet-stream"):xhr.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{xhr.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in xhr&&(xhr.withCredentials=!0),this.requestTimeout&&(xhr.timeout=this.requestTimeout),this.hasXDR()?(xhr.onload=function(){self.onLoad()},xhr.onerror=function(){self.onError(xhr.responseText)}):xhr.onreadystatechange=function(){if(2===xhr.readyState){var contentType;try{contentType=xhr.getResponseHeader("Content-Type")}catch(e){}"application/octet-stream"===contentType&&(xhr.responseType="arraybuffer")}4===xhr.readyState&&(200===xhr.status||1223===xhr.status?self.onLoad():setTimeout(function(){self.onError(xhr.status)},0))},debug("xhr data %s",this.data),xhr.send(this.data)}catch(e){return void setTimeout(function(){self.onError(e)},0)}global.document&&(this.index=Request.requestsCount++,Request.requests[this.index]=this)},Request.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},Request.prototype.onData=function(data){this.emit("data",data),this.onSuccess()},Request.prototype.onError=function(err){this.emit("error",err),this.cleanup(!0)},Request.prototype.cleanup=function(fromError){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=empty:this.xhr.onreadystatechange=empty,fromError)try{this.xhr.abort()}catch(e){}global.document&&delete Request.requests[this.index],this.xhr=null}},Request.prototype.onLoad=function(){var data;try{var contentType;try{contentType=this.xhr.getResponseHeader("Content-Type")}catch(e){}data="application/octet-stream"===contentType?this.xhr.response||this.xhr.responseText:this.xhr.responseText}catch(e){this.onError(e)}null!=data&&this.onData(data)},Request.prototype.hasXDR=function(){return void 0!==global.XDomainRequest&&!this.xs&&this.enablesXDR},Request.prototype.abort=function(){this.cleanup()},Request.requestsCount=0,Request.requests={},global.document&&(global.attachEvent?global.attachEvent("onunload",unloadHandler):global.addEventListener&&global.addEventListener("beforeunload",unloadHandler,!1))}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){(function(global){function WS(opts){opts&&opts.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=opts.perMessageDeflate,this.usingBrowserWebSocket=BrowserWebSocket&&!opts.forceNode,this.protocols=opts.protocols,this.usingBrowserWebSocket||(WebSocket=NodeWebSocket),Transport.call(this,opts)}var NodeWebSocket,Transport=__webpack_require__(145),parser=__webpack_require__(64),parseqs=__webpack_require__(154),inherit=__webpack_require__(95),yeast=__webpack_require__(331),debug=__webpack_require__(3)("engine.io-client:websocket"),BrowserWebSocket=global.WebSocket||global.MozWebSocket;if("undefined"==typeof window)try{NodeWebSocket=__webpack_require__(859)}catch(e){}var WebSocket=BrowserWebSocket;WebSocket||"undefined"!=typeof window||(WebSocket=NodeWebSocket),module.exports=WS,inherit(WS,Transport),WS.prototype.name="websocket",WS.prototype.supportsBinary=!0,WS.prototype.doOpen=function(){if(this.check()){var uri=this.uri(),protocols=this.protocols,opts={agent:this.agent,perMessageDeflate:this.perMessageDeflate};opts.pfx=this.pfx,opts.key=this.key,opts.passphrase=this.passphrase,opts.cert=this.cert,opts.ca=this.ca,opts.ciphers=this.ciphers,opts.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(opts.headers=this.extraHeaders),this.localAddress&&(opts.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket?protocols?new WebSocket(uri,protocols):new WebSocket(uri):new WebSocket(uri,protocols,opts)}catch(err){return this.emit("error",err)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},WS.prototype.addEventListeners=function(){var self=this;this.ws.onopen=function(){self.onOpen()},this.ws.onclose=function(){self.onClose()},this.ws.onmessage=function(ev){self.onData(ev.data)},this.ws.onerror=function(e){self.onError("websocket error",e)}},WS.prototype.write=function(packets){function done(){self.emit("flush"),setTimeout(function(){self.writable=!0,self.emit("drain")},0)}var self=this;this.writable=!1;for(var total=packets.length,i=0,l=total;i=55296&&value<=56319&&counter65535&&(value-=65536,output+=stringFromCharCode(value>>>10&1023|55296),value=56320|1023&value),output+=stringFromCharCode(value);return output}function checkScalarValue(codePoint,strict){if(codePoint>=55296&&codePoint<=57343){if(strict)throw Error("Lone surrogate U+"+codePoint.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function createByte(codePoint,shift){return stringFromCharCode(codePoint>>shift&63|128)}function encodeCodePoint(codePoint,strict){if(0==(4294967168&codePoint))return stringFromCharCode(codePoint);var symbol="";return 0==(4294965248&codePoint)?symbol=stringFromCharCode(codePoint>>6&31|192):0==(4294901760&codePoint)?(checkScalarValue(codePoint,strict)||(codePoint=65533),symbol=stringFromCharCode(codePoint>>12&15|224),symbol+=createByte(codePoint,6)):0==(4292870144&codePoint)&&(symbol=stringFromCharCode(codePoint>>18&7|240),symbol+=createByte(codePoint,12),symbol+=createByte(codePoint,6)),symbol+=stringFromCharCode(63&codePoint|128)}function utf8encode(string,opts){opts=opts||{};for(var codePoint,strict=!1!==opts.strict,codePoints=ucs2decode(string),length=codePoints.length,index=-1,byteString="";++index=byteCount)throw Error("Invalid byte index");var continuationByte=255&byteArray[byteIndex];if(byteIndex++,128==(192&continuationByte))return 63&continuationByte;throw Error("Invalid continuation byte")}function decodeSymbol(strict){var byte1,byte2,byte3,byte4,codePoint;if(byteIndex>byteCount)throw Error("Invalid byte index");if(byteIndex==byteCount)return!1;if(byte1=255&byteArray[byteIndex],byteIndex++,0==(128&byte1))return byte1;if(192==(224&byte1)){if(byte2=readContinuationByte(),(codePoint=(31&byte1)<<6|byte2)>=128)return codePoint;throw Error("Invalid continuation byte")}if(224==(240&byte1)){if(byte2=readContinuationByte(),byte3=readContinuationByte(),(codePoint=(15&byte1)<<12|byte2<<6|byte3)>=2048)return checkScalarValue(codePoint,strict)?codePoint:65533;throw Error("Invalid continuation byte")}if(240==(248&byte1)&&(byte2=readContinuationByte(),byte3=readContinuationByte(),byte4=readContinuationByte(),(codePoint=(7&byte1)<<18|byte2<<12|byte3<<6|byte4)>=65536&&codePoint<=1114111))return codePoint;throw Error("Invalid UTF-8 detected")}function utf8decode(byteString,opts){opts=opts||{};var strict=!1!==opts.strict;byteArray=ucs2decode(byteString),byteCount=byteArray.length,byteIndex=0;for(var tmp,codePoints=[];(tmp=decodeSymbol(strict))!==!1;)codePoints.push(tmp);return ucs2encode(codePoints)}var freeExports="object"==typeof exports&&exports,freeGlobal=("object"==typeof module&&module&&module.exports,"object"==typeof global&&global);freeGlobal.global!==freeGlobal&&freeGlobal.window;var byteArray,byteCount,byteIndex,stringFromCharCode=String.fromCharCode,utf8={version:"2.1.2",encode:utf8encode,decode:utf8decode};void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(){return utf8}.call(exports,__webpack_require__,exports,module))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)}()}).call(exports,__webpack_require__(23)(module),__webpack_require__(4))},function(module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return"[object Array]"==toString.call(arr)}},function(module,exports,__webpack_require__){function lookup(uri,opts){"object"==typeof uri&&(opts=uri,uri=void 0),opts=opts||{};var io,parsed=url(uri),source=parsed.source,id=parsed.id,path=parsed.path,sameNamespace=cache[id]&&path in cache[id].nsps,newConnection=opts.forceNew||opts["force new connection"]||!1===opts.multiplex||sameNamespace;return newConnection?(debug("ignoring socket cache for %s",source),io=Manager(source,opts)):(cache[id]||(debug("new io instance for %s",source),cache[id]=Manager(source,opts)),io=cache[id]),parsed.query&&!opts.query?opts.query=parsed.query:opts&&"object"==typeof opts.query&&(opts.query=encodeQueryString(opts.query)),io.socket(parsed.path,opts)}function encodeQueryString(obj){var str=[];for(var p in obj)obj.hasOwnProperty(p)&&str.push(encodeURIComponent(p)+"="+encodeURIComponent(obj[p]));return str.join("&")}var url=__webpack_require__(618),parser=__webpack_require__(147),Manager=__webpack_require__(257),debug=__webpack_require__(108)("socket.io-client");module.exports=exports=lookup;var cache=exports.managers={};exports.protocol=parser.protocol,exports.connect=lookup,exports.Manager=__webpack_require__(257),exports.Socket=__webpack_require__(259)},function(module,exports,__webpack_require__){(function(global){function url(uri,loc){var obj=uri;loc=loc||global.location,null==uri&&(uri=loc.protocol+"//"+loc.host),"string"==typeof uri&&("/"===uri.charAt(0)&&(uri="/"===uri.charAt(1)?loc.protocol+uri:loc.host+uri),/^(https?|wss?):\/\//.test(uri)||(debug("protocol-less url %s",uri),uri=void 0!==loc?loc.protocol+"//"+uri:"https://"+uri),debug("parse %s",uri),obj=parseuri(uri)),obj.port||(/^(http|ws)$/.test(obj.protocol)?obj.port="80":/^(http|ws)s$/.test(obj.protocol)&&(obj.port="443")),obj.path=obj.path||"/";var ipv6=obj.host.indexOf(":")!==-1,host=ipv6?"["+obj.host+"]":obj.host;return obj.id=obj.protocol+"://"+host+":"+obj.port,obj.href=obj.protocol+"://"+host+(loc&&loc.port===obj.port?"":":"+obj.port),obj}var parseuri=__webpack_require__(291),debug=__webpack_require__(108)("socket.io-client:url");module.exports=url}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){function selectColor(namespace){var i,hash=0;for(i in namespace)hash=(hash<<5)-hash+namespace.charCodeAt(i),hash|=0;return exports.colors[Math.abs(hash)%exports.colors.length]}function createDebug(namespace){function debug(){if(debug.enabled){var self=debug,curr=+new Date,ms=curr-(prevTime||curr);self.diff=ms,self.prev=prevTime,self.curr=curr,prevTime=curr;for(var args=new Array(arguments.length),i=0;i1e4)){var match=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);if(match){var n=parseFloat(match[1]);switch((match[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*y;case"days":case"day":case"d":return n*d;case"hours":case"hour":case"hrs":case"hr":case"h":return n*h;case"minutes":case"minute":case"mins":case"min":case"m":return n*m;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function fmtShort(ms){return ms>=d?Math.round(ms/d)+"d":ms>=h?Math.round(ms/h)+"h":ms>=m?Math.round(ms/m)+"m":ms>=s?Math.round(ms/s)+"s":ms+"ms"}function fmtLong(ms){return plural(ms,d,"day")||plural(ms,h,"hour")||plural(ms,m,"minute")||plural(ms,s,"second")||ms+" ms"}function plural(ms,n,name){if(!(ms0)return parse(val);if("number"===type&&isNaN(val)===!1)return options.long?fmtLong(val):fmtShort(val);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(val))}},function(module,exports,__webpack_require__){(function(global){function _deconstructPacket(data,buffers){if(!data)return data;if(isBuf(data)){var placeholder={_placeholder:!0,num:buffers.length};return buffers.push(data),placeholder}if(isArray(data)){for(var newData=new Array(data.length),i=0;i{}),sioOptions={transports:["websocket"],"force new connection":!0};class WebRTCStar{constructor(){this.maSelf=void 0,this.sioOptions={transports:["websocket"],"force new connection":!0},this.discovery=new EE,this.discovery.start=(callback=>{setImmediate(callback)}),this.discovery.stop=(callback=>{setImmediate(callback)}),this.listenersRefs={},this._peerDiscovered=this._peerDiscovered.bind(this)}dial(ma,options,callback){"function"==typeof options&&(callback=options,options={}),callback=callback?once(callback):noop;const intentId=(~~(1e9*Math.random())).toString(36)+Date.now(),sioClient=this.listenersRefs[Object.keys(this.listenersRefs)[0]].io,spOptions={initiator:!0,trickle:!1};isNode&&(spOptions.wrtc=wrtc);const channel=new SimplePeer(spOptions),conn=new Connection(toPull.duplex(channel));let connected=!1;return channel.on("signal",signal=>{sioClient.emit("ss-handshake",{intentId:intentId,srcMultiaddr:this.maSelf.toString(),dstMultiaddr:ma.toString(),signal:signal})}),channel.once("timeout",()=>callback(new Error("timeout"))),channel.once("error",err=>{connected||callback(err)}),sioClient.on("ws-handshake",offer=>{if(offer.intentId===intentId&&offer.err)return callback(new Error(offer.err));offer.intentId===intentId&&offer.answer&&(channel.once("connect",()=>{connected=!0,conn.destroy=channel.destroy.bind(channel),channel.once("close",()=>conn.destroy()),conn.getObservedAddrs=(callback=>callback(null,[ma])),callback(null,conn)}),channel.signal(offer.signal))}),conn}createListener(options,handler){"function"==typeof options&&(handler=options,options={});const listener=new EE;return listener.listen=((ma,callback)=>{function incommingDial(offer){if(!offer.answer&&!offer.err){const spOptions={trickle:!1};isNode&&(spOptions.wrtc=wrtc);const channel=new SimplePeer(spOptions),conn=new Connection(toPull.duplex(channel));channel.once("connect",()=>{conn.getObservedAddrs=(callback=>{return callback(null,[offer.srcMultiaddr])}),listener.emit("connection",conn),handler(conn)}),channel.once("signal",signal=>{offer.signal=signal,offer.answer=!0,listener.io.emit("ss-handshake",offer)}),channel.signal(offer.signal)}}if(callback=callback?once(callback):noop,!webrtcSupport.support&&!isNode)return setImmediate(()=>{callback(new Error("No WebRTC support in this runtime"))});this.maSelf=ma;const sioUrl=cleanUrlSIO(ma);log("Dialing to Signalling Server on: "+sioUrl),listener.io=io.connect(sioUrl,sioOptions),listener.io.once("connect_error",callback),listener.io.once("error",err=>{listener.emit("error",err),listener.emit("close")}),listener.io.on("ws-handshake",incommingDial),listener.io.on("ws-peer",this._peerDiscovered),listener.io.on("connect",()=>{listener.io.emit("ss-join",ma.toString())}),listener.io.once("connect",()=>{listener.emit("listening"),callback()})}),listener.close=(callback=>{callback=callback?once(callback):noop,listener.io.emit("ss-leave"),setImmediate(()=>{listener.emit("close"),callback()})}),listener.getAddrs=(callback=>{setImmediate(()=>callback(null,[this.maSelf]))}),this.listenersRefs[multiaddr.toString()]=listener,listener}filter(multiaddrs){return Array.isArray(multiaddrs)||(multiaddrs=[multiaddrs]),multiaddrs.filter(ma=>{return mafmt.WebRTCStar.matches(ma)})}_peerDiscovered(maStr){log("Peer Discovered:",maStr);const split=maStr.split("/ipfs/"),peerIdStr=split[split.length-1],peerId=PeerId.createFromB58String(peerIdStr),peerInfo=new PeerInfo(peerId);peerInfo.multiaddrs.add(multiaddr(maStr)),this.discovery.emit("peer",peerInfo)}}module.exports=WebRTCStar},function(module,exports,__webpack_require__){"use strict";const connect=__webpack_require__(752),mafmt=__webpack_require__(110),includes=__webpack_require__(263),Connection=__webpack_require__(29).Connection,maToUrl=__webpack_require__(625),debug=__webpack_require__(3),log=debug("libp2p:websockets:dialer"),createListener=__webpack_require__(624);class WebSockets{dial(ma,options,callback){"function"==typeof options&&(callback=options,options={}),callback=callback||function(){};const url=maToUrl(ma);log("dialing %s",url);const socket=connect(url,{binary:!0,onConnect:err=>callback(err)}),conn=new Connection(socket);return conn.getObservedAddrs=(callback=>callback(null,[ma])),conn.close=(callback=>socket.close(callback)),conn}createListener(options,handler){return"function"==typeof options&&(handler=options,options={}),createListener(options,handler)}filter(multiaddrs){return Array.isArray(multiaddrs)||(multiaddrs=[multiaddrs]),multiaddrs.filter(ma=>{return includes(ma.protoNames(),"ipfs")&&(ma=ma.decapsulate("ipfs")),mafmt.WebSockets.matches(ma)||mafmt.WebSocketsSecure.matches(ma)})}}module.exports=WebSockets},function(module,exports,__webpack_require__){"use strict";function noop(){}const Connection=__webpack_require__(29).Connection,includes=__webpack_require__(263),createServer=__webpack_require__(861)||noop;module.exports=((options,handler)=>{const listener=createServer(socket=>{socket.getObservedAddrs=(callback=>{return callback(null,[])}),handler(new Connection(socket))});let listeningMultiaddr;return listener._listen=listener.listen,listener.listen=((ma,callback)=>{callback=callback||noop,listeningMultiaddr=ma,includes(ma.protoNames(),"ipfs")&&(ma=ma.decapsulate("ipfs")),listener._listen(ma.toOptions(),callback)}),listener.getAddrs=(callback=>{callback(null,[listeningMultiaddr])}),listener})},function(module,exports,__webpack_require__){"use strict";function maToUrl(ma){const maStrSplit=ma.toString().split("/");let proto;try{proto=ma.protoNames().filter(proto=>{return"ws"===proto||"wss"===proto})[0]}catch(e){throw log(e),new Error("Not a valid websocket address",e)}let port;try{port=ma.stringTuples().filter(tuple=>{if(tuple[0]===ma.protos().filter(proto=>{return"tcp"===proto.name})[0].code)return!0})[0][1]}catch(e){log("No port, skipping")}return`${proto}://${maStrSplit[2]}${!port||80===port&&443===port?"":`:${port}`}`}const debug=__webpack_require__(3),log=debug("libp2p:websockets:dialer");module.exports=maToUrl},function(module,exports,__webpack_require__){"use strict";const EventEmitter=__webpack_require__(8).EventEmitter,assert=__webpack_require__(7),setImmediate=__webpack_require__(11),each=__webpack_require__(32),series=__webpack_require__(40),Ping=__webpack_require__(588),Swarm=__webpack_require__(604),PeerId=__webpack_require__(31),PeerInfo=__webpack_require__(51),PeerBook=__webpack_require__(292),mafmt=__webpack_require__(110),multiaddr=__webpack_require__(34);module.exports;class Node extends EventEmitter{constructor(_modules,_peerInfo,_peerBook,_options){if(super(),assert(_modules,"requires modules to equip libp2p with features"),assert(_peerInfo,"requires a PeerInfo instance"),this.modules=_modules,this.peerInfo=_peerInfo,this.peerBook=_peerBook||new PeerBook,this.isOnline=!1,this.swarm=new Swarm(this.peerInfo,this.peerBook),this.modules.connection.muxer){let muxers=this.modules.connection.muxer;muxers=Array.isArray(muxers)?muxers:[muxers],muxers.forEach(muxer=>this.swarm.connection.addStreamMuxer(muxer)),this.swarm.connection.reuse(),this.swarm.on("peer-mux-established",peerInfo=>{this.emit("peer:connect",peerInfo),this.peerBook.put(peerInfo)}),this.swarm.on("peer-mux-closed",peerInfo=>{this.emit("peer:disconnect",peerInfo)})}if(this.modules.connection.crypto){let cryptos=this.modules.connection.crypto;cryptos=Array.isArray(cryptos)?cryptos:[cryptos],cryptos.forEach(crypto=>{this.swarm.connection.crypto(crypto.tag,crypto.encrypt)})}if(this.modules.discovery){let discoveries=this.modules.discovery;discoveries=Array.isArray(discoveries)?discoveries:[discoveries],discoveries.forEach(discovery=>{discovery.on("peer",peerInfo=>this.emit("peer:discovery",peerInfo))})}Ping.mount(this.swarm),_modules.DHT&&(this._dht=new this.modules.DHT(this,20,_options.DHT&&_options.DHT.datastore)),this.peerRouting={findPeer:(id,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.findPeer(id,callback)}},this.contentRouting={findProviders:(key,timeout,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.findProviders(key,timeout,callback)},provide:(key,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.provide(key,callback)}},this.dht={put:(key,value,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.put(key,value,callback)},get:(key,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.get(key,callback)},getMany(key,nVals,callback){if(!this._dht)return callback(new Error("DHT is not available"));this._dht.getMany(key,nVals,callback)}}}start(callback){if(!this.modules.transport)return callback(new Error("no transports were present"));let ws,transports=this.modules.transport;transports=Array.isArray(transports)?transports:[transports];const maOld=[],maNew=[];this.peerInfo.multiaddrs.forEach(ma=>{mafmt.IPFS.matches(ma)||(maOld.push(ma),maNew.push(ma.encapsulate("/ipfs/"+this.peerInfo.id.toB58String())))}),this.peerInfo.multiaddrs.replace(maOld,maNew);const multiaddrs=this.peerInfo.multiaddrs.toArray();transports.forEach(transport=>{transport.filter(multiaddrs).length>0?this.swarm.transport.add(transport.tag||transport.constructor.name,transport):transport.constructor&&"WebSockets"===transport.constructor.name&&(ws=transport)}),series([cb=>this.swarm.listen(cb),cb=>{if(this.isOnline=!0,ws&&this.swarm.transport.add(ws.tag||ws.constructor.name,ws),this.modules.discovery)return each(this.modules.discovery,(d,cb)=>d.start(cb),cb);cb()},cb=>{if(this._dht)return this._dht.start(cb);cb()}],callback)}stop(callback){this.isOnline=!1,this.modules.discovery&&this.modules.discovery.forEach(discovery=>{setImmediate(()=>discovery.stop(()=>{}))}),series([cb=>{if(this._dht)return this._dht.stop(cb);cb()},cb=>this.swarm.close(cb)],callback)}isOn(){return this.isOnline}ping(peer,callback){assert(this.isOn(),"The libp2p node is not started yet"),this._getPeerInfo(peer,(err,peerInfo)=>{if(err)return callback(err);callback(null,new Ping(this.swarm,peerInfo))})}dial(peer,protocol,callback){assert(this.isOn(),"The libp2p node is not started yet"),"function"==typeof protocol&&(callback=protocol,protocol=void 0),this._getPeerInfo(peer,(err,peerInfo)=>{if(err)return callback(err);this.swarm.dial(peerInfo,protocol,(err,conn)=>{if(err)return callback(err);this.peerBook.put(peerInfo),callback(null,conn)})})}hangUp(peer,callback){assert(this.isOn(),"The libp2p node is not started yet"),this._getPeerInfo(peer,(err,peerInfo)=>{if(err)return callback(err);this.swarm.hangUp(peerInfo,callback)})}handle(protocol,handlerFunc,matchFunc){this.swarm.handle(protocol,handlerFunc,matchFunc)}unhandle(protocol){this.swarm.unhandle(protocol)}_getPeerInfo(peer,callback){let p;if(PeerInfo.isPeerInfo(peer))p=peer;else if(multiaddr.isMultiaddr(peer)){const peerIdB58Str=peer.getPeerId();try{p=this.peerBook.get(peerIdB58Str)}catch(err){p=new PeerInfo(PeerId.createFromB58String(peerIdB58Str))}p.multiaddrs.add(peer)}else{if(!PeerId.isPeerId(peer))return setImmediate(()=>callback(new Error("peer type not recognized")));{const peerIdB58Str=peer.toB58String();try{p=this.peerBook.get(peerIdB58Str)}catch(err){return this.peerRouting.findPeer(peer,callback)}}}setImmediate(()=>callback(null,p))}}module.exports=Node},function(module,exports,__webpack_require__){(function(global,module){function arrayFilter(array,predicate){for(var index=-1,length=array?array.length:0,resIndex=0,result=[];++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toFinite(value){if(!value)return 0===value?value:0;if((value=toNumber(value))===INFINITY||value===-INFINITY){return(value<0?-1:1)*MAX_INTEGER}return value===value?value:0}function toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,MAX_INTEGER=1.7976931348623157e308,NAN=NaN,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsOctal=/^0o[0-7]+$/i,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeParseInt=parseInt,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),nativeMax=Math.max,DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&"[object Promise]"!=getTag(Promise.resolve())||Set&&getTag(new Set)!=setTag||WeakMap&&"[object WeakMap]"!=getTag(new WeakMap))&&(getTag=function(value){var result=objectToString.call(value),Ctor=result==objectTag?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):void 0;if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return"[object Promise]";case setCtorString:return setTag;case weakMapCtorString:return"[object WeakMap]"}return result});var stringToPath=memoize(function(string){string=toString(string);var result=[];return reLeadingDot.test(string)&&result.push(""),string.replace(/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,function(match,number,quote,string){result.push(quote?string.replace(/\\(\\)?/g,"$1"):number||match)}),result}),find=function(findIndexFunc){return function(collection,predicate,fromIndex){var iterable=Object(collection);if(!isArrayLike(collection)){var iteratee=baseIteratee(predicate,3);collection=keys(collection),predicate=function(key){return iteratee(iterable[key],key,iterable)}}var index=findIndexFunc(collection,predicate,fromIndex);return index>-1?iterable[iteratee?collection[index]:index]:void 0}}(findIndex);memoize.Cache=MapCache;var isArray=Array.isArray,isTypedArray=nodeIsTypedArray?function(func){return function(value){return func(value)}}(nodeIsTypedArray):baseIsTypedArray;module.exports=find}).call(exports,__webpack_require__(4),__webpack_require__(23)(module))},function(module,exports,__webpack_require__){(function(global,module){function arrayMap(array,iteratee){for(var index=-1,length=array?array.length:0,result=Array(length);++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}function baseGet(object,path){path=isKey(path,object)?[path]:castPath(path);for(var index=0,length=path.length;null!=object&&indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,spreadableSymbol=Symbol?Symbol.isConcatSpreadable:void 0,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))} +}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function has(object,path){return null!=object&&hasPath(object,path,baseHas)} +var FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",symbolTag="[object Symbol]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,Map=getNative(root,"Map"),nativeCreate=getNative(Object,"create"),symbolProto=Symbol?Symbol.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var stringToPath=memoize(function(string){string=toString(string);var result=[];return reLeadingDot.test(string)&&result.push(""),string.replace(/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,function(match,number,quote,string){result.push(quote?string.replace(/\\(\\)?/g,"$1"):number||match)}),result});memoize.Cache=MapCache;var isArray=Array.isArray;module.exports=has}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){(function(global,module){function arraySome(array,predicate){for(var index=-1,length=array?array.length:0;++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}var LARGE_ARRAY_SIZE=200,HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&"[object Promise]"!=getTag(Promise.resolve())||Set&&getTag(new Set)!=setTag||WeakMap&&"[object WeakMap]"!=getTag(new WeakMap))&&(getTag=function(value){var result=objectToString.call(value),Ctor=result==objectTag?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):void 0;if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return"[object Promise]";case setCtorString:return setTag;case weakMapCtorString:return"[object WeakMap]"}return result});var isArray=Array.isArray,isTypedArray=nodeIsTypedArray?function(func){return function(value){return func(value)}}(nodeIsTypedArray):baseIsTypedArray;module.exports=isEqualWith}).call(exports,__webpack_require__(4),__webpack_require__(23)(module))},function(module,exports){function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}var funcTag="[object Function]",genTag="[object GeneratorFunction]",objectProto=Object.prototype,objectToString=objectProto.toString;module.exports=isFunction},function(module,exports){function noop(){}module.exports=noop},function(module,exports){function arrayMap(array,iteratee){for(var index=-1,length=array?array.length:0,result=Array(length);++index-1;)seen!==array&&splice.call(seen,fromIndex,1),splice.call(array,fromIndex,1);return array}function copyArray(source,array){var index=-1,length=source.length;for(array||(array=Array(length));++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index-1&&value%1==0&&value-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key) +;return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}function baseGet(object,path){path=isKey(path,object)?[path]:castPath(path);for(var index=0,length=path.length;null!=object&&indexother||valIsSymbol&&othIsDefined&&othIsReflexive&&!othIsNull&&!othIsSymbol||valIsNull&&othIsDefined&&othIsReflexive||!valIsDefined&&othIsReflexive||!valIsReflexive)return 1;if(!valIsNull&&!valIsSymbol&&!othIsSymbol&&value=ordersLength)return result;return result*("desc"==orders[index]?-1:1)}}return object.index-other.index}function equalArrays(array,other,equalFunc,customizer,bitmask,stack){var isPartial=bitmask&PARTIAL_COMPARE_FLAG,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,spreadableSymbol=Symbol?Symbol.isConcatSpreadable:void 0,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),nativeMax=Math.max,DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index1&&isIterateeCall(collection,iteratees[0],iteratees[1])?iteratees=[]:length>2&&isIterateeCall(iteratees[0],iteratees[1],iteratees[2])&&(iteratees=[iteratees[0]]),baseOrderBy(collection,baseFlatten(iteratees,1),[])});memoize.Cache=MapCache;var isArray=Array.isArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;module.exports=sortBy}).call(exports,__webpack_require__(4),__webpack_require__(23)(module))},function(module,exports,__webpack_require__){(function(global){function debounce(func,wait,options){function invokeFunc(time){var args=lastArgs,thisArg=lastThis;return lastArgs=lastThis=void 0,lastInvokeTime=time,result=func.apply(thisArg,args)}function leadingEdge(time){return lastInvokeTime=time,timerId=setTimeout(timerExpired,wait),leading?invokeFunc(time):result}function remainingWait(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime,result=wait-timeSinceLastCall;return maxing?nativeMin(result,maxWait-timeSinceLastInvoke):result}function shouldInvoke(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime;return void 0===lastCallTime||timeSinceLastCall>=wait||timeSinceLastCall<0||maxing&&timeSinceLastInvoke>=maxWait}function timerExpired(){var time=now();if(shouldInvoke(time))return trailingEdge(time);timerId=setTimeout(timerExpired,remainingWait(time))}function trailingEdge(time){return timerId=void 0,trailing&&lastArgs?invokeFunc(time):(lastArgs=lastThis=void 0,result)}function cancel(){void 0!==timerId&&clearTimeout(timerId),lastInvokeTime=0,lastArgs=lastCallTime=lastThis=timerId=void 0}function flush(){return void 0===timerId?result:trailingEdge(now())}function debounced(){var time=now(),isInvoking=shouldInvoke(time);if(lastArgs=arguments,lastThis=this,lastCallTime=time,isInvoking){if(void 0===timerId)return leadingEdge(lastCallTime);if(maxing)return timerId=setTimeout(timerExpired,wait),invokeFunc(lastCallTime)}return void 0===timerId&&(timerId=setTimeout(timerExpired,wait)),result}var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime=0,leading=!1,maxing=!1,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return wait=toNumber(wait)||0,isObject(options)&&(leading=!!options.leading,maxing="maxWait"in options,maxWait=maxing?nativeMax(toNumber(options.maxWait)||0,wait):maxWait,trailing="trailing"in options?!!options.trailing:trailing),debounced.cancel=cancel,debounced.flush=flush,debounced}function throttle(func,wait,options){var leading=!0,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return isObject(options)&&(leading="leading"in options?!!options.leading:leading,trailing="trailing"in options?!!options.trailing:trailing),debounce(func,wait,{leading:leading,maxWait:wait,trailing:trailing})}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}var FUNC_ERROR_TEXT="Expected a function",NAN=NaN,symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),objectProto=Object.prototype,objectToString=objectProto.toString,nativeMax=Math.max,nativeMin=Math.min,now=function(){return root.Date.now()};module.exports=throttle}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){(function(global,module){function arrayIncludes(array,value){return!!(array?array.length:0)&&baseIndexOf(array,value,0)>-1}function arrayIncludesWith(array,value,comparator){for(var index=-1,length=array?array.length:0;++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function noop(){}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var createSet=Set&&1/setToArray(new Set([,-0]))[1]==INFINITY?function(values){return new Set(values)}:noop,getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&"[object Promise]"!=getTag(Promise.resolve())||Set&&getTag(new Set)!=setTag||WeakMap&&"[object WeakMap]"!=getTag(new WeakMap))&&(getTag=function(value){var result=objectToString.call(value),Ctor=result==objectTag?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):void 0;if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return"[object Promise]";case setCtorString:return setTag;case weakMapCtorString:return"[object WeakMap]"}return result});var stringToPath=memoize(function(string){string=toString(string);var result=[];return reLeadingDot.test(string)&&result.push(""),string.replace(/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,function(match,number,quote,string){result.push(quote?string.replace(/\\(\\)?/g,"$1"):number||match)}),result});memoize.Cache=MapCache;var isArray=Array.isArray,isTypedArray=nodeIsTypedArray?function(func){return function(value){return func(value)}}(nodeIsTypedArray):baseIsTypedArray;module.exports=uniqBy}).call(exports,__webpack_require__(4),__webpack_require__(23)(module))},function(module,exports,__webpack_require__){(function(global){function arrayIncludes(array,value){return!!(array?array.length:0)&&baseIndexOf(array,value,0)>-1}function arrayIncludesWith(array,value,comparator){for(var index=-1,length=array?array.length:0;++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++index-1&&value%1==0&&value-1:!!length&&baseIndexOf(collection,value,fromIndex)>-1}var baseIndexOf=__webpack_require__(266),isArrayLike=__webpack_require__(65),isString=__webpack_require__(664),toInteger=__webpack_require__(669),values=__webpack_require__(671),nativeMax=Math.max;module.exports=includes},function(module,exports,__webpack_require__){var baseIsArguments=__webpack_require__(643),isObjectLike=__webpack_require__(80),objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,propertyIsEnumerable=objectProto.propertyIsEnumerable,isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty.call(value,"callee")&&!propertyIsEnumerable.call(value,"callee")};module.exports=isArguments},function(module,exports,__webpack_require__){(function(module){ +var root=__webpack_require__(268),stubFalse=__webpack_require__(667),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,Buffer=moduleExports?root.Buffer:void 0,nativeIsBuffer=Buffer?Buffer.isBuffer:void 0,isBuffer=nativeIsBuffer||stubFalse;module.exports=isBuffer}).call(exports,__webpack_require__(23)(module))},function(module,exports,__webpack_require__){function isFunction(value){if(!isObject(value))return!1;var tag=baseGetTag(value);return tag==funcTag||tag==genTag||tag==asyncTag||tag==proxyTag}var baseGetTag=__webpack_require__(79),isObject=__webpack_require__(150),asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";module.exports=isFunction},function(module,exports,__webpack_require__){function isString(value){return"string"==typeof value||!isArray(value)&&isObjectLike(value)&&baseGetTag(value)==stringTag}var baseGetTag=__webpack_require__(79),isArray=__webpack_require__(109),isObjectLike=__webpack_require__(80),stringTag="[object String]";module.exports=isString},function(module,exports,__webpack_require__){function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&baseGetTag(value)==symbolTag}var baseGetTag=__webpack_require__(79),isObjectLike=__webpack_require__(80),symbolTag="[object Symbol]";module.exports=isSymbol},function(module,exports,__webpack_require__){var baseIsTypedArray=__webpack_require__(645),baseUnary=__webpack_require__(649),nodeUtil=__webpack_require__(655),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;module.exports=isTypedArray},function(module,exports){function stubFalse(){return!1}module.exports=stubFalse},function(module,exports,__webpack_require__){function toFinite(value){if(!value)return 0===value?value:0;if((value=toNumber(value))===INFINITY||value===-INFINITY){return(value<0?-1:1)*MAX_INTEGER}return value===value?value:0}var toNumber=__webpack_require__(670),INFINITY=1/0,MAX_INTEGER=1.7976931348623157e308;module.exports=toFinite},function(module,exports,__webpack_require__){function toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0}var toFinite=__webpack_require__(668);module.exports=toInteger},function(module,exports,__webpack_require__){function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}var isObject=__webpack_require__(150),isSymbol=__webpack_require__(665),NAN=NaN,reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt;module.exports=toNumber},function(module,exports,__webpack_require__){function values(object){return null==object?[]:baseValues(object,keys(object))}var baseValues=__webpack_require__(650),keys=__webpack_require__(270);module.exports=values},function(module,exports,__webpack_require__){(function(Buffer){function has(obj,key){return Object.hasOwnProperty.call(obj,key)}function isDef(val){return void 0!==val&&""!==val}function has(range,name){return Object.hasOwnProperty.call(range,name)}function hasKey(range,name){return Object.hasOwnProperty.call(range,name)&&name}function id(e){return e}exports.compare=function(a,b){if(Buffer.isBuffer(a)){for(var l=Math.min(a.length,b.length),i=0;ib?1:0};var lowerBoundKey=exports.lowerBoundKey=function(range){return hasKey(range,"gt")||hasKey(range,"gte")||hasKey(range,"min")||(range.reverse?hasKey(range,"end"):hasKey(range,"start"))||void 0},lowerBound=exports.lowerBound=function(range,def){var k=lowerBoundKey(range);return k?range[k]:def},lowerBoundInclusive=exports.lowerBoundInclusive=function(range){return!has(range,"gt")},upperBoundInclusive=exports.upperBoundInclusive=function(range){return!has(range,"lt")},lowerBoundExclusive=exports.lowerBoundExclusive=function(range){return!lowerBoundInclusive(range)},upperBoundExclusive=exports.upperBoundExclusive=function(range){return!upperBoundInclusive(range)},upperBoundKey=exports.upperBoundKey=function(range){return hasKey(range,"lt")||hasKey(range,"lte")||hasKey(range,"max")||(range.reverse?hasKey(range,"start"):hasKey(range,"end"))||void 0},upperBound=exports.upperBound=function(range,def){var k=upperBoundKey(range);return k?range[k]:def};exports.start=function(range,def){return range.reverse?upperBound(range,def):lowerBound(range,def)},exports.end=function(range,def){return range.reverse?lowerBound(range,def):upperBound(range,def)},exports.startInclusive=function(range){return range.reverse?upperBoundInclusive(range):lowerBoundInclusive(range)},exports.endInclusive=function(range){return range.reverse?lowerBoundInclusive(range):upperBoundInclusive(range)},exports.toLtgt=function(range,_range,map,lower,upper){_range=_range||{},map=map||id;var defaults=arguments.length>3,lb=exports.lowerBoundKey(range),ub=exports.upperBoundKey(range);return lb?"gt"===lb?_range.gt=map(range.gt,!1):_range.gte=map(range[lb],!1):defaults&&(_range.gte=map(lower,!1)),ub?"lt"===ub?_range.lt=map(range.lt,!0):_range.lte=map(range[ub],!0):defaults&&(_range.lte=map(upper,!0)),null!=range.reverse&&(_range.reverse=!!range.reverse),has(_range,"max")&&delete _range.max,has(_range,"min")&&delete _range.min,has(_range,"start")&&delete _range.start,has(_range,"end")&&delete _range.end,_range},exports.contains=function(range,key,compare){compare=compare||exports.compare;var lb=lowerBound(range);if(isDef(lb)){var cmp=compare(key,lb);if(cmp<0||0===cmp&&lowerBoundExclusive(range))return!1}var ub=upperBound(range);if(isDef(ub)){var cmp=compare(key,ub);if(cmp>0||0===cmp&&upperBoundExclusive(range))return!1}return!0},exports.filter=function(range,compare){return function(key){return exports.contains(range,key,compare)}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(449)},function(module,exports,__webpack_require__){(function(Buffer){function gt(value){return ltgt.compare(value,this._end)>0}function gte(value){return ltgt.compare(value,this._end)>=0}function lt(value){return ltgt.compare(value,this._end)<0}function lte(value){return ltgt.compare(value,this._end)<=0}function MemIterator(db,options){AbstractIterator.call(this,db),this._limit=options.limit,this._limit===-1&&(this._limit=1/0);var tree=db._store[db._location];this.keyAsBuffer=options.keyAsBuffer!==!1,this.valueAsBuffer=options.valueAsBuffer!==!1,this._reverse=options.reverse,this._options=options,this._done=0,this._reverse?(this._incr="prev",this._start=ltgt.upperBound(options),this._end=ltgt.lowerBound(options),void 0===this._start?this._tree=tree.end:ltgt.upperBoundInclusive(options)?this._tree=tree.le(this._start):this._tree=tree.lt(this._start),this._end&&(ltgt.lowerBoundInclusive(options)?this._test=gte:this._test=gt)):(this._incr="next",this._start=ltgt.lowerBound(options),this._end=ltgt.upperBound(options),void 0===this._start?this._tree=tree.begin:ltgt.lowerBoundInclusive(options)?this._tree=tree.ge(this._start):this._tree=tree.gt(this._start),this._end&&(ltgt.upperBoundInclusive(options)?this._test=lte:this._test=lt))}function MemDOWN(location){if(!(this instanceof MemDOWN))return new MemDOWN(location);AbstractLevelDOWN.call(this,"string"==typeof location?location:""),this._location=this.location?"$"+this.location:"_tree",this._store=this.location?globalStore:this,this._store[this._location]=this._store[this._location]||createRBT(ltgt.compare)}var inherits=__webpack_require__(1),AbstractLevelDOWN=__webpack_require__(275).AbstractLevelDOWN,AbstractIterator=__webpack_require__(275).AbstractIterator,ltgt=__webpack_require__(676),createRBT=__webpack_require__(425),globalStore={},setImmediate=__webpack_require__(673);inherits(MemIterator,AbstractIterator),MemIterator.prototype._next=function(callback){var key,value;return this._done++>=this._limit?setImmediate(callback):this._tree.valid?(key=this._tree.key,value=this._tree.value,this._test(key)?(this.keyAsBuffer&&(key=new Buffer(key)),this.valueAsBuffer&&(value=new Buffer(value)),this._tree[this._incr](),void setImmediate(function(){callback(null,key,value)})):setImmediate(callback)):setImmediate(callback)},MemIterator.prototype._test=function(){return!0},MemDOWN.clearGlobalStore=function(strict){strict?Object.keys(globalStore).forEach(function(key){delete globalStore[key]}):globalStore={}},inherits(MemDOWN,AbstractLevelDOWN),MemDOWN.prototype._open=function(options,callback){var self=this;setImmediate(function(){callback(null,self)})},MemDOWN.prototype._put=function(key,value,options,callback){void 0!==value&&null!==value||(value="");var iter=this._store[this._location].find(key);iter.valid?this._store[this._location]=iter.update(value):this._store[this._location]=this._store[this._location].insert(key,value),setImmediate(callback)},MemDOWN.prototype._get=function(key,options,callback){var value=this._store[this._location].get(key);if(void 0===value)return setImmediate(function(){callback(new Error("NotFound"))});options.asBuffer===!1||this._isBuffer(value)||(value=new Buffer(String(value))),setImmediate(function(){callback(null,value)})},MemDOWN.prototype._del=function(key,options,callback){this._store[this._location]=this._store[this._location].remove(key),setImmediate(callback)},MemDOWN.prototype._batch=function(array,options,callback){for(var key,value,iter,i=-1,len=array.length,tree=this._store[this._location];++ib?1:0};var lowerBoundKey=exports.lowerBoundKey=function(range){return hasKey(range,"gt")||hasKey(range,"gte")||hasKey(range,"min")||(range.reverse?hasKey(range,"end"):hasKey(range,"start"))||void 0},lowerBound=exports.lowerBound=function(range){var k=lowerBoundKey(range);return k&&range[k]},lowerBoundInclusive=exports.lowerBoundInclusive=function(range){return!has(range,"gt")},upperBoundInclusive=exports.upperBoundInclusive=function(range){return!has(range,"lt")},lowerBoundExclusive=exports.lowerBoundExclusive=function(range){return!lowerBoundInclusive(range)},upperBoundExclusive=exports.upperBoundExclusive=function(range){return!upperBoundInclusive(range)},upperBoundKey=exports.upperBoundKey=function(range){return hasKey(range,"lt")||hasKey(range,"lte")||hasKey(range,"max")||(range.reverse?hasKey(range,"start"):hasKey(range,"end"))||void 0},upperBound=exports.upperBound=function(range){var k=upperBoundKey(range);return k&&range[k]};exports.toLtgt=function(range,_range,map,lower,upper){_range=_range||{},map=map||id;var defaults=arguments.length>3,lb=exports.lowerBoundKey(range),ub=exports.upperBoundKey(range);return lb?"gt"===lb?_range.gt=map(range.gt,!1):_range.gte=map(range[lb],!1):defaults&&(_range.gte=map(lower,!1)),ub?"lt"===ub?_range.lt=map(range.lt,!0):_range.lte=map(range[ub],!0):defaults&&(_range.lte=map(upper,!0)),null!=range.reverse&&(_range.reverse=!!range.reverse),has(_range,"max")&&delete _range.max,has(_range,"min")&&delete _range.min,has(_range,"start")&&delete _range.start,has(_range,"end")&&delete _range.end,_range},exports.contains=function(range,key,compare){compare=compare||exports.compare;var lb=lowerBound(range);if(isDef(lb)){var cmp=compare(key,lb);if(cmp<0||0===cmp&&lowerBoundExclusive(range))return!1}var ub=upperBound(range);if(isDef(ub)){var cmp=compare(key,ub);if(cmp>0||0===cmp&&upperBoundExclusive(range))return!1}return!0},exports.filter=function(range,compare){return function(key){return exports.contains(range,key,compare)}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){const SHA3=__webpack_require__(241),secp256k1=__webpack_require__(162),assert=__webpack_require__(7),rlp=__webpack_require__(52),BN=__webpack_require__(20),createHash=__webpack_require__(75);exports.MAX_INTEGER=new BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),exports.TWO_POW256=new BN("10000000000000000000000000000000000000000000000000000000000000000",16),exports.SHA3_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",exports.SHA3_NULL=new Buffer(exports.SHA3_NULL_S,"hex"),exports.SHA3_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",exports.SHA3_RLP_ARRAY=new Buffer(exports.SHA3_RLP_ARRAY_S,"hex"),exports.SHA3_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",exports.SHA3_RLP=new Buffer(exports.SHA3_RLP_S,"hex"),exports.BN=BN,exports.rlp=rlp,exports.secp256k1=secp256k1,exports.zeros=function(bytes){var buf=new Buffer(bytes);return buf.fill(0),buf},exports.setLengthLeft=exports.setLength=function(msg,length,right){var buf=exports.zeros(length);return msg=exports.toBuffer(msg),right?msg.length0&&"0"===first.toString();)a=a.slice(1),first=a[0];return a},exports.toBuffer=function(v){if(!Buffer.isBuffer(v))if(Array.isArray(v))v=new Buffer(v);else if("string"==typeof v)v=exports.isHexPrefixed(v)?new Buffer(exports.padToEven(exports.stripHexPrefix(v)),"hex"):new Buffer(v);else if("number"==typeof v)v=exports.intToBuffer(v);else if(null===v||void 0===v)v=new Buffer([]);else{if(!v.toArray)throw new Error("invalid type");v=new Buffer(v.toArray())}return v},exports.intToHex=function(i){assert(i%1==0,"number is not a integer"),assert(i>=0,"number must be positive");var hex=i.toString(16);return hex.length%2&&(hex="0"+hex),"0x"+hex},exports.intToBuffer=function(i){return new Buffer(exports.intToHex(i).slice(2),"hex")},exports.bufferToInt=function(buf){return parseInt(exports.bufferToHex(buf),16)},exports.bufferToHex=function(buf){return buf=exports.toBuffer(buf),0===buf.length?0:"0x"+buf.toString("hex")},exports.fromSigned=function(num){return new BN(num).fromTwos(256)},exports.toUnsigned=function(num){return new Buffer(num.toTwos(256).toArray())},exports.sha3=function(a,bytes){a=exports.toBuffer(a),bytes||(bytes=256);var h=new SHA3(bytes);return a&&h.update(a),new Buffer(h.digest("hex"),"hex")},exports.sha256=function(a){return a=exports.toBuffer(a),createHash("sha256").update(a).digest()},exports.ripemd160=function(a,padded){a=exports.toBuffer(a);var hash=createHash("rmd160").update(a).digest();return padded===!0?exports.setLength(hash,32):hash},exports.rlphash=function(a){return exports.sha3(rlp.encode(a))},exports.isValidPrivate=function(privateKey){return secp256k1.privateKeyVerify(privateKey)},exports.isValidPublic=function(publicKey,sanitize){return 64===publicKey.length?secp256k1.publicKeyVerify(Buffer.concat([new Buffer([4]),publicKey])):!!sanitize&&secp256k1.publicKeyVerify(publicKey)},exports.pubToAddress=exports.publicToAddress=function(pubKey,sanitize){return pubKey=exports.toBuffer(pubKey),sanitize&&64!==pubKey.length&&(pubKey=secp256k1.publicKeyConvert(pubKey,!1).slice(1)),assert(64===pubKey.length),exports.sha3(pubKey).slice(-20)};var privateToPublic=exports.privateToPublic=function(privateKey){return privateKey=exports.toBuffer(privateKey),secp256k1.publicKeyCreate(privateKey,!1).slice(1)};exports.importPublic=function(publicKey){return publicKey=exports.toBuffer(publicKey),64!==publicKey.length&&(publicKey=secp256k1.publicKeyConvert(publicKey,!1).slice(1)),publicKey},exports.ecsign=function(msgHash,privateKey){var sig=secp256k1.sign(msgHash,privateKey),ret={};return ret.r=sig.signature.slice(0,32),ret.s=sig.signature.slice(32,64),ret.v=sig.recovery+27,ret},exports.ecrecover=function(msgHash,v,r,s){var signature=Buffer.concat([exports.setLength(r,32),exports.setLength(s,32)],64),recovery=exports.bufferToInt(v)-27;if(0!==recovery&&1!==recovery)throw new Error("Invalid signature v value");var senderPubKey=secp256k1.recover(msgHash,signature,recovery);return secp256k1.publicKeyConvert(senderPubKey,!1).slice(1)},exports.toRpcSig=function(v,r,s){return exports.bufferToHex(Buffer.concat([r,s,exports.toBuffer(v-27)]))},exports.fromRpcSig=function(sig){sig=exports.toBuffer(sig);var v=sig[64];return v<27&&(v+=27),{v:v,r:sig.slice(0,32),s:sig.slice(32,64)}},exports.privateToAddress=function(privateKey){return exports.publicToAddress(privateToPublic(privateKey))},exports.isValidAddress=function(address){return/^0x[0-9a-fA-F]{40}$/i.test(address)},exports.toChecksumAddress=function(address){address=exports.stripHexPrefix(address).toLowerCase();for(var hash=exports.sha3(address).toString("hex"),ret="0x",i=0;i=8?address[i].toUpperCase():address[i];return ret},exports.isValidChecksumAddress=function(address){return exports.isValidAddress(address)&&exports.toChecksumAddress(address)===address},exports.generateAddress=function(from,nonce){return from=exports.toBuffer(from),nonce=new BN(nonce),nonce=nonce.isZero()?null:new Buffer(nonce.toArray()),exports.rlphash([from,nonce]).slice(-20)},exports.isPrecompiled=function(address){var a=exports.unpad(address);return 1===a.length&&a[0]>0&&a[0]<5},exports.isHexPrefixed=function(str){return"0x"===str.slice(0,2)},exports.stripHexPrefix=function(str){return"string"!=typeof str?str:exports.isHexPrefixed(str)?str.slice(2):str},exports.addHexPrefix=function(str){return"string"!=typeof str?str:exports.isHexPrefixed(str)?str:"0x"+str},exports.padToEven=function(a){return a.length%2&&(a="0"+a),a},exports.baToJSON=function(ba){if(Buffer.isBuffer(ba))return"0x"+ba.toString("hex");if(ba instanceof Array){for(var array=[],i=0;i=v.length,"The field "+field.name+" must not have more "+field.length+" bytes")):field.allowZero&&0===v.length||!field.length||assert(field.length===v.length,"The field "+field.name+" must have byte length of "+field.length),self.raw[i]=v}self._fields.push(field.name),Object.defineProperty(self,field.name,{enumerable:!0,configurable:!0,get:getter,set:setter}),field.default&&(self[field.name]=field.default),field.alias&&Object.defineProperty(self,field.alias,{enumerable:!1,configurable:!0,set:setter,get:getter})}),data)if("string"==typeof data&&(data=new Buffer(exports.stripHexPrefix(data),"hex")),Buffer.isBuffer(data)&&(data=rlp.decode(data)),Array.isArray(data)){if(data.length>self._fields.length)throw new Error("wrong number of fields in data");data.forEach(function(d,i){self[self._fields[i]]=exports.toBuffer(d)})}else{if("object"!=typeof data)throw new Error("invalid data");for(var prop in data)self._fields.indexOf(prop)!==-1&&(self[prop]=data[prop])}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports){function parse(str){if(str=String(str),!(str.length>100)){var match=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);if(match){var n=parseFloat(match[1]);switch((match[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*y;case"days":case"day":case"d":return n*d;case"hours":case"hour":case"hrs":case"hr":case"h":return n*h;case"minutes":case"minute":case"mins":case"min":case"m":return n*m;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function fmtShort(ms){return ms>=d?Math.round(ms/d)+"d":ms>=h?Math.round(ms/h)+"h":ms>=m?Math.round(ms/m)+"m":ms>=s?Math.round(ms/s)+"s":ms+"ms"}function fmtLong(ms){return plural(ms,d,"day")||plural(ms,h,"hour")||plural(ms,m,"minute")||plural(ms,s,"second")||ms+" ms"}function plural(ms,n,name){if(!(ms0)return parse(val);if("number"===type&&isNaN(val)===!1)return options.long?fmtLong(val):fmtShort(val);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(val))}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function stringToStringTuples(str){const tuples=[],parts=str.split("/").slice(1);if(1===parts.length&&""===parts[0])return[];for(let p=0;p=parts.length)throw ParseError("invalid address: "+str);tuples.push([part,parts[p]])}else tuples.push([part])}return tuples}function stringTuplesToString(tuples){const parts=[];return map(tuples,function(tup){const proto=protoFromTuple(tup);parts.push(proto.name),tup.length>1&&parts.push(tup[1])}),"/"+parts.join("/")}function stringTuplesToTuples(tuples){return map(tuples,function(tup){Array.isArray(tup)||(tup=[tup]);const proto=protoFromTuple(tup);return tup.length>1?[proto.code,convert.toBuffer(proto.code,tup[1])]:[proto.code]})}function tuplesToStringTuples(tuples){return map(tuples,function(tup){const proto=protoFromTuple(tup);return tup.length>1?[proto.code,convert.toString(proto.code,tup[1])]:[proto.code]})}function tuplesToBuffer(tuples){return fromBuffer(Buffer.concat(map(tuples,function(tup){const proto=protoFromTuple(tup);let buf=new Buffer(varint.encode(proto.code));return tup.length>1&&(buf=Buffer.concat([buf,tup[1]])),buf})))}function sizeForAddr(p,addr){if(p.size>0)return p.size/8;if(0===p.size)return 0;{const size=varint.decode(addr);return size+varint.decode.bytes}}function bufferToTuples(buf){const tuples=[];let i=0;for(;ibuf.length)throw ParseError("Invalid address buffer: "+buf.toString("hex"));tuples.push([code,addr])}else tuples.push([code]),i+=n}return tuples}function bufferToString(buf){return stringTuplesToString(tuplesToStringTuples(bufferToTuples(buf)))}function stringToBuffer(str){return str=cleanPath(str),tuplesToBuffer(stringTuplesToTuples(stringToStringTuples(str)))}function fromString(str){return stringToBuffer(str)}function fromBuffer(buf){const err=validateBuffer(buf);if(err)throw err;return new Buffer(buf)}function validateBuffer(buf){try{bufferToTuples(buf)}catch(err){return err}}function isValidBuffer(buf){return void 0===validateBuffer(buf)}function cleanPath(str){return"/"+filter(str.trim().split("/")).join("/")}function ParseError(str){return new Error("Error parsing address: "+str)}function protoFromTuple(tup){return protocols(tup[0])}const map=__webpack_require__(148),filter=__webpack_require__(627),convert=__webpack_require__(680),protocols=__webpack_require__(151),varint=__webpack_require__(16);module.exports={stringToStringTuples:stringToStringTuples,stringTuplesToString:stringTuplesToString,tuplesToStringTuples:tuplesToStringTuples,stringTuplesToTuples:stringTuplesToTuples,bufferToTuples:bufferToTuples,tuplesToBuffer:tuplesToBuffer,bufferToString:bufferToString,stringToBuffer:stringToBuffer,fromString:fromString,fromBuffer:fromBuffer,validateBuffer:validateBuffer,isValidBuffer:isValidBuffer,cleanPath:cleanPath,ParseError:ParseError,protoFromTuple:protoFromTuple,sizeForAddr:sizeForAddr}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function Convert(proto,a){return a instanceof Buffer?Convert.toString(proto,a):Convert.toBuffer(proto,a)}function port2buf(port){const buf=new Buffer(2);return buf.writeUInt16BE(port,0),buf}function buf2port(buf){return buf.readUInt16BE(0)}function str2buf(str){const buf=new Buffer(str),size=new Buffer(varint.encode(buf.length));return Buffer.concat([size,buf])}function buf2str(buf){const size=varint.decode(buf);if(buf=buf.slice(varint.decode.bytes),buf.length!==size)throw new Error("inconsistent lengths");return buf.toString()}function mh2buf(hash){const mh=new Buffer(bs58.decode(hash)),size=new Buffer(varint.encode(mh.length));return Buffer.concat([size,mh])}function buf2mh(buf){const size=varint.decode(buf),address=buf.slice(varint.decode.bytes);if(address.length!==size)throw new Error("inconsistent lengths");return bs58.encode(address)}const ip=__webpack_require__(457),protocols=__webpack_require__(151),bs58=__webpack_require__(24),varint=__webpack_require__(16);module.exports=Convert,Convert.toString=function(proto,buf){switch(proto=protocols(proto),proto.code){case 4:case 41:return ip.toString(buf);case 6:case 17:case 33:case 132:return buf2port(buf);case 53:case 54:case 55:return buf2str(buf);case 421:return buf2mh(buf);default:return buf.toString("hex")}},Convert.toBuffer=function(proto,str){switch(proto=protocols(proto),proto.code){case 4:case 41:return ip.toBuffer(str);case 6:case 17:case 33:case 132:return port2buf(parseInt(str,10));case 53:case 54:case 55:return str2buf(str);case 421:return mh2buf(str);default:return new Buffer(str,"hex")}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";class Base{constructor(name,code,implementation,alphabet){this.name=name,this.code=code,this.alphabet=alphabet,implementation&&alphabet&&(this.engine=implementation(alphabet))}encode(stringOrBuffer){return this.engine.encode(stringOrBuffer)}decode(stringOrBuffer){return this.engine.decode(stringOrBuffer)}isImplemented(){return this.engine}}module.exports=Base},function(module,exports,__webpack_require__){"use strict";(function(Buffer){module.exports=function(alphabet){return{encode(input){return"string"==typeof input?new Buffer(input).toString("hex"):input.toString("hex")},decode(input){for(let char of input)if(alphabet.indexOf(char)<0)throw new Error("invalid base16 character");return new Buffer(input,"hex")}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const Base=__webpack_require__(681),baseX=__webpack_require__(359),base16=__webpack_require__(682),constants=[["base1","1","","1"],["base2","0",baseX,"01"],["base8","7",baseX,"01234567"],["base10","9",baseX,"0123456789"],["base16","f",base16,"0123456789abcdef"],["base32hex","v",baseX,"0123456789abcdefghijklmnopqrstuv"],["base32","b",baseX,"abcdefghijklmnopqrstuvwxyz234567"],["base32z","h",baseX,"ybndrfg8ejkmcpqxot1uwisza345h769"],["base58flickr","Z",baseX,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base58btc","z",baseX,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base64","m",baseX,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64url","u",baseX,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"]],names=constants.reduce((prev,tupple)=>{return prev[tupple[0]]=new Base(tupple[0],tupple[1],tupple[2],tupple[3]),prev},{}),codes=constants.reduce((prev,tupple)=>{return prev[tupple[1]]=names[tupple[0]],prev},{});module.exports={names:names,codes:codes}},function(module,exports,__webpack_require__){"use strict";exports.names={sha1:17,"sha2-256":18,"sha2-512":19,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,"murmur3-128":34,"murmur3-32":35,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664},exports.codes={17:"sha1",18:"sha2-256",19:"sha2-512",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384", +29:"keccak-512",34:"murmur3-128",35:"murmur3-32",45569:"blake2b-8",45570:"blake2b-16",45571:"blake2b-24",45572:"blake2b-32",45573:"blake2b-40",45574:"blake2b-48",45575:"blake2b-56",45576:"blake2b-64",45577:"blake2b-72",45578:"blake2b-80",45579:"blake2b-88",45580:"blake2b-96",45581:"blake2b-104",45582:"blake2b-112",45583:"blake2b-120",45584:"blake2b-128",45585:"blake2b-136",45586:"blake2b-144",45587:"blake2b-152",45588:"blake2b-160",45589:"blake2b-168",45590:"blake2b-176",45591:"blake2b-184",45592:"blake2b-192",45593:"blake2b-200",45594:"blake2b-208",45595:"blake2b-216",45596:"blake2b-224",45597:"blake2b-232",45598:"blake2b-240",45599:"blake2b-248",45600:"blake2b-256",45601:"blake2b-264",45602:"blake2b-272",45603:"blake2b-280",45604:"blake2b-288",45605:"blake2b-296",45606:"blake2b-304",45607:"blake2b-312",45608:"blake2b-320",45609:"blake2b-328",45610:"blake2b-336",45611:"blake2b-344",45612:"blake2b-352",45613:"blake2b-360",45614:"blake2b-368",45615:"blake2b-376",45616:"blake2b-384",45617:"blake2b-392",45618:"blake2b-400",45619:"blake2b-408",45620:"blake2b-416",45621:"blake2b-424",45622:"blake2b-432",45623:"blake2b-440",45624:"blake2b-448",45625:"blake2b-456",45626:"blake2b-464",45627:"blake2b-472",45628:"blake2b-480",45629:"blake2b-488",45630:"blake2b-496",45631:"blake2b-504",45632:"blake2b-512",45633:"blake2s-8",45634:"blake2s-16",45635:"blake2s-24",45636:"blake2s-32",45637:"blake2s-40",45638:"blake2s-48",45639:"blake2s-56",45640:"blake2s-64",45641:"blake2s-72",45642:"blake2s-80",45643:"blake2s-88",45644:"blake2s-96",45645:"blake2s-104",45646:"blake2s-112",45647:"blake2s-120",45648:"blake2s-128",45649:"blake2s-136",45650:"blake2s-144",45651:"blake2s-152",45652:"blake2s-160",45653:"blake2s-168",45654:"blake2s-176",45655:"blake2s-184",45656:"blake2s-192",45657:"blake2s-200",45658:"blake2s-208",45659:"blake2s-216",45660:"blake2s-224",45661:"blake2s-232",45662:"blake2s-240",45663:"blake2s-248",45664:"blake2s-256"},exports.defaultLengths={17:20,18:32,19:64,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,45569:1,45570:2,45571:3,45572:4,45573:5,45574:6,45575:7,45576:8,45577:9,45578:10,45579:11,45580:12,45581:13,45582:14,45583:15,45584:16,45585:17,45586:18,45587:19,45588:20,45589:21,45590:22,45591:23,45592:24,45593:25,45594:26,45595:27,45596:28,45597:29,45598:30,45599:31,45600:32,45601:33,45602:34,45603:35,45604:36,45605:37,45606:38,45607:39,45608:40,45609:41,45610:42,45611:43,45612:44,45613:45,45614:46,45615:47,45616:48,45617:49,45618:50,45619:51,45620:52,45621:53,45622:54,45623:55,45624:56,45625:57,45626:58,45627:59,45628:60,45629:61,45630:62,45631:63,45632:64,45633:1,45634:2,45635:3,45636:4,45637:5,45638:6,45639:7,45640:8,45641:9,45642:10,45643:11,45644:12,45645:13,45646:14,45647:15,45648:16,45649:17,45650:18,45651:19,45652:20,45653:21,45654:22,45655:23,45656:24,45657:25,45658:26,45659:27,45660:28,45661:29,45662:30,45663:31,45664:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const blake=__webpack_require__(366),toCallback=__webpack_require__(280).toCallback,blake2b={init:blake.blake2bInit,update:blake.blake2bUpdate,digest:blake.blake2bFinal},blake2s={init:blake.blake2sInit,update:blake.blake2sUpdate,digest:blake.blake2sFinal},makeB2Hash=(size,hf)=>toCallback(buf=>{const ctx=hf.init(size,null);return hf.update(ctx,buf),new Buffer(hf.digest(ctx))});module.exports=(table=>{for(let i=0;i<64;i++)table[45569+i]=makeB2Hash(i+1,blake2b);for(let i=0;i<32;i++)table[45633+i]=makeB2Hash(i+1,blake2s)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function webCryptoHash(type){if(!webCrypto)throw new Error("Please use a browser with webcrypto support");return(data,callback)=>{const res=webCrypto.digest({name:type},data);if("function"!=typeof res.then)return res.onerror=(()=>{callback(`Error hashing data using ${type}`)}),void(res.oncomplete=(e=>{callback(null,e.target.result)}));nodeify(res.then(raw=>new Buffer(new Uint8Array(raw))),callback)}}function sha1(buf,callback){webCryptoHash("SHA-1")(buf,callback)}function sha2256(buf,callback){webCryptoHash("SHA-256")(buf,callback)}function sha2512(buf,callback){webCryptoHash("SHA-512")(buf,callback)}const nodeify=__webpack_require__(81),webCrypto=function(){return self.crypto?self.crypto.subtle||self.crypto.webkitSubtle:self.msCrypto?self.msCrypto.subtle:void 0}();module.exports={sha1:sha1,sha2256:sha2256,sha2512:sha2512}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const sha3=__webpack_require__(237),murmur3=__webpack_require__(702),utils=__webpack_require__(280),sha=__webpack_require__(686),toCallback=utils.toCallback,toBuf=utils.toBuf,fromString=utils.fromString,fromNumberTo32BitBuf=utils.fromNumberTo32BitBuf;module.exports={sha1:sha.sha1,sha2256:sha.sha2256,sha2512:sha.sha2512,sha3512:toCallback(toBuf(sha3.sha3_512)),sha3384:toCallback(toBuf(sha3.sha3_384)),sha3256:toCallback(toBuf(sha3.sha3_256)),sha3224:toCallback(toBuf(sha3.sha3_224)),shake128:toCallback(toBuf(sha3.shake_128,256)),shake256:toCallback(toBuf(sha3.shake_256,512)),keccak224:toCallback(toBuf(sha3.keccak_224)),keccak256:toCallback(toBuf(sha3.keccak_256)),keccak384:toCallback(toBuf(sha3.keccak_384)),keccak512:toCallback(toBuf(sha3.keccak_512)),murmur3128:toCallback(toBuf(fromString(murmur3.x64.hash128))),murmur332:toCallback(fromNumberTo32BitBuf(fromString(murmur3.x86.hash32))),addBlake:__webpack_require__(685)}},function(module,exports,__webpack_require__){"use strict";function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}module.exports=PassThrough;var Transform=__webpack_require__(282),util=__webpack_require__(6);util.inherits=__webpack_require__(1),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},function(module,exports,__webpack_require__){"use strict";function BufferList(){this.head=null,this.tail=null,this.length=0}var bufferShim=(__webpack_require__(0).Buffer,__webpack_require__(14));module.exports=BufferList,BufferList.prototype.push=function(v){var entry={data:v,next:null};this.length>0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};0===this.length&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(0!==this.length){var ret=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s){if(0===this.length)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s+p.data;return ret},BufferList.prototype.concat=function(n){if(0===this.length)return bufferShim.alloc(0);if(1===this.length)return this.head.data;for(var ret=bufferShim.allocUnsafe(n>>>0),p=this.head,i=0;p;)p.data.copy(ret,i),i+=p.data.length,p=p.next;return ret}},function(module,exports){function read(buf,offset){var b,res=0,offset=offset||0,shift=0,counter=offset,l=buf.length;do{if(counter>=l)return read.bytes=0,void(read.bytesRead=0);b=buf[counter++],res+=shift<28?(b&REST)<=MSB);return read.bytes=counter-offset,res}module.exports=read;var MSB=128,REST=127},function(module,exports){function encode(num,out,offset){out=out||[],offset=offset||0;for(var oldOffset=offset;num>=INT;)out[offset++]=255&num|MSB,num/=128;for(;num&MSBALL;)out[offset++]=255&num|MSB,num>>>=7;return out[offset]=0|num,encode.bytes=offset-oldOffset+1,out}module.exports=encode;var MSB=128,MSBALL=-128,INT=Math.pow(2,31)},function(module,exports,__webpack_require__){module.exports={encode:__webpack_require__(691),decode:__webpack_require__(690),encodingLength:__webpack_require__(693)}},function(module,exports){var N1=Math.pow(2,7),N2=Math.pow(2,14),N3=Math.pow(2,21),N4=Math.pow(2,28),N5=Math.pow(2,35),N6=Math.pow(2,42),N7=Math.pow(2,49),N8=Math.pow(2,56),N9=Math.pow(2,63);module.exports=function(value){return value{this.log("end"),this._read(),this.destroyed||(ended=!0,finished?this._finalize():this.halfOpen||this.end())}),this.once("finish",function onfinish(){if(!this.destroyed){if(!this._opened)return this.once("open",onfinish);this._lazy&&this.initiator&&this._open(),this._multiplex._send(this.channel<<3|(this.initiator?4:3),null),finished=!0,ended&&this._finalize()}})}destroy(err){this._destroy(err,!0)}_destroy(err,local){if(this.log("_destroy:"+(local?"local":"remote")),this.destroyed)return void this.log("already destroyed");this.destroyed=!0;const hasErrorListeners=EventEmitter.listenerCount(this,"error")>0;if(!err||local&&!hasErrorListeners||this.emit("error",err),this.emit("close"),local&&this._opened){this._lazy&&this.initiator&&this._open();const msg=err?new Buffer(err.message):null;try{this._multiplex._send(this.channel<<3|(this.initiator?6:5),msg)}catch(e){}}this._finalize()}_finalize(){this.finalized||(this.finalized=!0,this.emit("finalize"))}_write(data,enc,cb){return this.log("write: ",data.length),this._opened?this.destroyed?void cb():(this._lazy&&this.initiator&&this._open(),this._multiplex._send(this._dataHeader,data)?void cb():void this._multiplex._ondrain.push(cb)):void this.once("open",()=>{this._write(data,enc,cb)})}_read(){if(this._awaitDrain){const drained=this._awaitDrain;this._awaitDrain=0,this._multiplex._onchanneldrain(drained)}}_open(){let buf=null;Buffer.isBuffer(this.name)?buf=this.name:this.name!==this.channel.toString()&&(buf=new Buffer(this.name)),this._lazy=!1,this._multiplex._send(this.channel<<3|0,buf)}open(channel,initiator){this.log("open: "+channel),this.channel=channel,this.initiator=initiator,this._dataHeader=channel<<3|(initiator?2:1),this._opened=!0,!this._lazy&&this.initiator&&this._open(),this.emit("open")}}module.exports=Channel}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const stream=__webpack_require__(285),varint=__webpack_require__(692),duplexify=__webpack_require__(396),debug=__webpack_require__(3),Channel=__webpack_require__(694),SIGNAL_FLUSH=new Buffer([0]),empty=new Buffer(0);let pool=new Buffer(10240),used=0;class Multiplex extends stream.Duplex{constructor(opts,onchannel){super(),"function"==typeof opts&&(onchannel=opts,opts={}),opts||(opts={}),onchannel&&this.on("stream",onchannel),this.destroyed=!1,this.limit=opts.limit||0,null==opts.initiator&&(opts.initiator=!0),this.initiator=opts.initiator,this._corked=0,this._options=opts,this._binaryName=Boolean(opts.binaryName),this._local=[],this._remote=[],this._list=this._local,this._receiving=null,this._chunked=!1,this._state=0,this._type=0,this._channel=0,this._missing=0,this._message=null,this.log=debug("mplex:main:"+Math.floor(1e5*Math.random())),this.log("construction");let bufSize=100;this.limit&&(bufSize=varint.encodingLength(this.limit)),this._buf=new Buffer(bufSize),this._ptr=0,this._awaitChannelDrains=0,this._onwritedrain=null,this._ondrain=[],this._finished=!1,this.once("finish",this._clear),this._nextId=this.initiator?0:1}_nextStreamId(){let id=this._nextId;return this._nextId+=2,id}createStream(name,opts){if(this.destroyed)throw new Error("Multiplexer is destroyed");const id=this._nextStreamId();let channelName=this._name(name||id.toString());const options=Object.assign(this._options,opts);this.log("createStream: %s",id,channelName.toString(),options);const channel=new Channel(channelName,this,options);return this._addChannel(channel,id,this._local)}receiveStream(name,opts){if(this.destroyed)throw new Error("Multiplexer is destroyed");if(void 0===name||null===name)throw new Error("Name is needed when receiving a stream");const channelName=this._name(name);this.log("receiveStream: "+channelName.toString());const channel=new Channel(channelName,this,Object.assign(this._options,opts));if(this._receiving||(this._receiving={}),this._receiving[channel.name])throw new Error("You are already receiving this stream");return this._receiving[channel.name]=channel,channel}createSharedStream(name,opts){return this.log("createSharedStream"),duplexify(this.createStream(name,Object.assign(opts,{lazy:!0})),this.receiveStream(name,opts))}_name(name){return this._binaryName?Buffer.isBuffer(name)?name:new Buffer(name):name.toString()}_send(header,data){const len=data?data.length:0,oldUsed=used;let drained=!0;return this.log("_send",header,len),varint.encode(header,pool,used),used+=varint.encode.bytes,varint.encode(len,pool,used),used+=varint.encode.bytes,drained=this.push(pool.slice(oldUsed,used)),pool.length-used<100&&(pool=new Buffer(10240),used=0),data&&(drained=this.push(data)),drained}_addChannel(channel,id,list){return this.log("_addChannel",id),list[id]=channel,channel.on("finalize",()=>{this.log("_remove channel",id),list[id]=null}),channel.open(id,list===this._local),channel}_writeVarint(data,offset){for(offset;offset>3,this._list=1&this._type?this._local:this._remote;const chunked=this._list.length>this._channel&&this._list[this._channel]&&this._list[this._channel].chunked;this._chunked=!(1!==this._type&&2!==this._type)&&chunked}else if(this._missing=varint.decode(this._buf),this.limit&&this._missing>this.limit)return this._lengthError(data);return this._state++,this._ptr=0,offset+1}}return data.length}_lengthError(data){return this.destroy(new Error("Incoming message is too big")),data.length}_writeMessage(data,offset){const free=data.length-offset,missing=this._missing;if(!this._message){if(missing<=free)return this._missing=0,this._push(data.slice(offset,offset+missing)),offset+missing;if(this._chunked)return this._missing-=free,this._push(data.slice(offset,data.length)),data.length;this._message=new Buffer(missing)}return data.copy(this._message,this._ptr,offset,offset+missing),missing<=free?(this._missing=0,this._push(this._message),offset+missing):(this._missing-=free,this._ptr+=free,data.length)}_push(data){if(this.log("_push",data.length),this._missing||(this._ptr=0,this._state=0,this._message=null),0===this._type){if(this.log("open",this._channel),this.destroyed||this._finished)return;let name;name=this._binaryName?data:data.toString()||this._channel.toString(),this.log("open name",name);let channel;return void(this._receiving&&this._receiving[name]?(channel=this._receiving[name],delete this._receiving[name],this._addChannel(channel,this._channel,this._list)):(channel=new Channel(name,this,this._options),this.emit("stream",this._addChannel(channel,this._channel,this._list),channel.name)))}const stream=this._list[this._channel];if(stream)switch(this._type){case 5:case 6:const error=new Error(data.toString()||"Channel destroyed");return void stream._destroy(error,!1);case 3:case 4:return void stream.push(null);case 1:case 2:return void(stream.push(data)||(this._awaitChannelDrains++,stream._awaitDrain++))}}_onchanneldrain(drained){if(this._awaitChannelDrains-=drained,!this._awaitChannelDrains){const ondrain=this._onwritedrain;this._onwritedrain=null,ondrain&&ondrain()}}_write(data,enc,cb){if(this.log("_write",data.length),this._finished)return void cb();if(this._corked)return void this._onuncork(this._write.bind(this,data,enc,cb));if(data===SIGNAL_FLUSH)return void this._finish(cb);let offset=0;for(;offset{this._writableState.prefinished===!1&&(this._writableState.prefinished=!0),this.emit("prefinish"),this._onuncork(cb)})}cork(){1==++this._corked&&this.emit("cork")}uncork(){this._corked&&0==--this._corked&&this.emit("uncork")}end(data,enc,cb){return this.log("end"),"function"==typeof data&&(cb=data,data=void 0),"function"==typeof enc&&(cb=enc,enc=void 0),data&&this.write(data),this._writableState.ending||this.write(SIGNAL_FLUSH),stream.Writable.prototype.end.call(this,cb)}_onuncork(fn){if(this._corked)return void this.once("uncork",fn);fn()}_read(){for(;this._ondrain.length;)this._ondrain.shift()()}_clear(){if(this.log("_clear"),!this._finished){this._finished=!0;const list=this._local.concat(this._remote);this._local=[],this._remote=[],list.forEach(function(stream){stream&&stream._destroy(null,!1)}),this.push(null)}}finalize(){this._clear()}destroy(err){if(this.log("destroy"),this.destroyed)return void this.log("already destroyed");var list=this._local.concat(this._remote);this.destroyed=!0,err&&this.emit("error",err),this.emit("close"),list.forEach(function(stream){stream&&stream.emit("error",err||new Error("underlying socket has been closed"))}),this._clear()}}module.exports=Multiplex}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(process){function parse(version,loose){if(version instanceof SemVer)return version;if("string"!=typeof version)return null;if(version.length>MAX_LENGTH)return null;if(!(loose?re[LOOSE]:re[FULL]).test(version))return null;try{return new SemVer(version,loose)}catch(er){return null}}function valid(version,loose){var v=parse(version,loose);return v?v.version:null}function clean(version,loose){var s=parse(version.trim().replace(/^[=v]+/,""),loose);return s?s.version:null}function SemVer(version,loose){if(version instanceof SemVer){if(version.loose===loose)return version;version=version.version}else if("string"!=typeof version)throw new TypeError("Invalid Version: "+version);if(version.length>MAX_LENGTH)throw new TypeError("version is longer than "+MAX_LENGTH+" characters");if(!(this instanceof SemVer))return new SemVer(version,loose);debug("SemVer",version,loose),this.loose=loose;var m=version.trim().match(loose?re[LOOSE]:re[FULL]);if(!m)throw new TypeError("Invalid Version: "+version);if(this.raw=version,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>MAX_SAFE_INTEGER||this.major<0)throw new TypeError("Invalid major version");if(this.minor>MAX_SAFE_INTEGER||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>MAX_SAFE_INTEGER||this.patch<0)throw new TypeError("Invalid patch version");m[4]?this.prerelease=m[4].split(".").map(function(id){if(/^[0-9]+$/.test(id)){var num=+id;if(num>=0&&numb?1:0}function rcompareIdentifiers(a,b){return compareIdentifiers(b,a)}function major(a,loose){return new SemVer(a,loose).major}function minor(a,loose){return new SemVer(a,loose).minor}function patch(a,loose){return new SemVer(a,loose).patch}function compare(a,b,loose){return new SemVer(a,loose).compare(b)}function compareLoose(a,b){return compare(a,b,!0)}function rcompare(a,b,loose){return compare(b,a,loose)}function sort(list,loose){return list.sort(function(a,b){return exports.compare(a,b,loose)})}function rsort(list,loose){return list.sort(function(a,b){return exports.rcompare(a,b,loose)})}function gt(a,b,loose){return compare(a,b,loose)>0}function lt(a,b,loose){return compare(a,b,loose)<0}function eq(a,b,loose){return 0===compare(a,b,loose)}function neq(a,b,loose){return 0!==compare(a,b,loose)}function gte(a,b,loose){return compare(a,b,loose)>=0}function lte(a,b,loose){return compare(a,b,loose)<=0}function cmp(a,op,b,loose){var ret;switch(op){case"===":"object"==typeof a&&(a=a.version),"object"==typeof b&&(b=b.version),ret=a===b;break;case"!==":"object"==typeof a&&(a=a.version),"object"==typeof b&&(b=b.version),ret=a!==b;break;case"":case"=":case"==":ret=eq(a,b,loose);break;case"!=":ret=neq(a,b,loose);break;case">":ret=gt(a,b,loose);break;case">=":ret=gte(a,b,loose);break;case"<":ret=lt(a,b,loose);break;case"<=":ret=lte(a,b,loose);break;default:throw new TypeError("Invalid operator: "+op)}return ret}function Comparator(comp,loose){if(comp instanceof Comparator){if(comp.loose===loose)return comp;comp=comp.value}if(!(this instanceof Comparator))return new Comparator(comp,loose);debug("comparator",comp,loose),this.loose=loose,this.parse(comp),this.semver===ANY?this.value="":this.value=this.operator+this.semver.version,debug("comp",this)}function Range(range,loose){if(range instanceof Range&&range.loose===loose)return range;if(!(this instanceof Range))return new Range(range,loose);if(this.loose=loose,this.raw=range,this.set=range.split(/\s*\|\|\s*/).map(function(range){return this.parseRange(range.trim())},this).filter(function(c){return c.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+range);this.format()}function toComparators(range,loose){return new Range(range,loose).set.map(function(comp){return comp.map(function(c){return c.value}).join(" ").trim().split(" ")})}function parseComparator(comp,loose){return debug("comp",comp),comp=replaceCarets(comp,loose),debug("caret",comp),comp=replaceTildes(comp,loose),debug("tildes",comp),comp=replaceXRanges(comp,loose),debug("xrange",comp),comp=replaceStars(comp,loose),debug("stars",comp),comp}function isX(id){return!id||"x"===id.toLowerCase()||"*"===id}function replaceTildes(comp,loose){return comp.trim().split(/\s+/).map(function(comp){return replaceTilde(comp,loose)}).join(" ")}function replaceTilde(comp,loose){var r=loose?re[TILDELOOSE]:re[TILDE];return comp.replace(r,function(_,M,m,p,pr){debug("tilde",comp,_,M,m,p,pr);var ret;return isX(M)?ret="":isX(m)?ret=">="+M+".0.0 <"+(+M+1)+".0.0":isX(p)?ret=">="+M+"."+m+".0 <"+M+"."+(+m+1)+".0":pr?(debug("replaceTilde pr",pr),"-"!==pr.charAt(0)&&(pr="-"+pr),ret=">="+M+"."+m+"."+p+pr+" <"+M+"."+(+m+1)+".0"):ret=">="+M+"."+m+"."+p+" <"+M+"."+(+m+1)+".0",debug("tilde return",ret),ret})}function replaceCarets(comp,loose){return comp.trim().split(/\s+/).map(function(comp){return replaceCaret(comp,loose)}).join(" ")}function replaceCaret(comp,loose){debug("caret",comp,loose);var r=loose?re[CARETLOOSE]:re[CARET];return comp.replace(r,function(_,M,m,p,pr){debug("caret",comp,_,M,m,p,pr);var ret;return isX(M)?ret="":isX(m)?ret=">="+M+".0.0 <"+(+M+1)+".0.0":isX(p)?ret="0"===M?">="+M+"."+m+".0 <"+M+"."+(+m+1)+".0":">="+M+"."+m+".0 <"+(+M+1)+".0.0":pr?(debug("replaceCaret pr",pr),"-"!==pr.charAt(0)&&(pr="-"+pr),ret="0"===M?"0"===m?">="+M+"."+m+"."+p+pr+" <"+M+"."+m+"."+(+p+1):">="+M+"."+m+"."+p+pr+" <"+M+"."+(+m+1)+".0":">="+M+"."+m+"."+p+pr+" <"+(+M+1)+".0.0"):(debug("no pr"),ret="0"===M?"0"===m?">="+M+"."+m+"."+p+" <"+M+"."+m+"."+(+p+1):">="+M+"."+m+"."+p+" <"+M+"."+(+m+1)+".0":">="+M+"."+m+"."+p+" <"+(+M+1)+".0.0"),debug("caret return",ret),ret})}function replaceXRanges(comp,loose){return debug("replaceXRanges",comp,loose),comp.split(/\s+/).map(function(comp){return replaceXRange(comp,loose)}).join(" ")}function replaceXRange(comp,loose){comp=comp.trim();var r=loose?re[XRANGELOOSE]:re[XRANGE];return comp.replace(r,function(ret,gtlt,M,m,p,pr){debug("xRange",comp,ret,gtlt,M,m,p,pr);var xM=isX(M),xm=xM||isX(m),xp=xm||isX(p),anyX=xp;return"="===gtlt&&anyX&&(gtlt=""),xM?ret=">"===gtlt||"<"===gtlt?"<0.0.0":"*":gtlt&&anyX?(xm&&(m=0),xp&&(p=0),">"===gtlt?(gtlt=">=",xm?(M=+M+1,m=0,p=0):xp&&(m=+m+1,p=0)):"<="===gtlt&&(gtlt="<",xm?M=+M+1:m=+m+1),ret=gtlt+M+"."+m+"."+p):xm?ret=">="+M+".0.0 <"+(+M+1)+".0.0":xp&&(ret=">="+M+"."+m+".0 <"+M+"."+(+m+1)+".0"),debug("xRange return",ret),ret})}function replaceStars(comp,loose){return debug("replaceStars",comp,loose),comp.trim().replace(re[STAR],"")}function hyphenReplace($0,from,fM,fm,fp,fpr,fb,to,tM,tm,tp,tpr,tb){return from=isX(fM)?"":isX(fm)?">="+fM+".0.0":isX(fp)?">="+fM+"."+fm+".0":">="+from,to=isX(tM)?"":isX(tm)?"<"+(+tM+1)+".0.0":isX(tp)?"<"+tM+"."+(+tm+1)+".0":tpr?"<="+tM+"."+tm+"."+tp+"-"+tpr:"<="+to,(from+" "+to).trim()}function testSet(set,version){for(var i=0;i0){var allowed=set[i].semver;if(allowed.major===version.major&&allowed.minor===version.minor&&allowed.patch===version.patch)return!0}return!1}return!0}function satisfies(version,range,loose){try{range=new Range(range,loose)}catch(er){return!1}return range.test(version)}function maxSatisfying(versions,range,loose){return versions.filter(function(version){return satisfies(version,range,loose)}).sort(function(a,b){return rcompare(a,b,loose)})[0]||null}function minSatisfying(versions,range,loose){return versions.filter(function(version){return satisfies(version,range,loose)}).sort(function(a,b){return compare(a,b,loose)})[0]||null}function validRange(range,loose){try{return new Range(range,loose).range||"*"}catch(er){return null}}function ltr(version,range,loose){return outside(version,range,"<",loose)}function gtr(version,range,loose){return outside(version,range,">",loose)}function outside(version,range,hilo,loose){version=new SemVer(version,loose),range=new Range(range,loose);var gtfn,ltefn,ltfn,comp,ecomp;switch(hilo){case">":gtfn=gt,ltefn=lte,ltfn=lt,comp=">",ecomp=">=";break;case"<":gtfn=lt,ltefn=gte,ltfn=gt,comp="<",ecomp="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(satisfies(version,range,loose))return!1;for(var i=0;i=0.0.0")),high=high||comparator,low=low||comparator,gtfn(comparator.semver,high.semver,loose)?high=comparator:ltfn(comparator.semver,low.semver,loose)&&(low=comparator)}),high.operator===comp||high.operator===ecomp)return!1;if((!low.operator||low.operator===comp)&<efn(version,low.semver))return!1;if(low.operator===ecomp&<fn(version,low.semver))return!1}return!0}function prerelease(version,loose){var parsed=parse(version,loose);return parsed&&parsed.prerelease.length?parsed.prerelease:null}exports=module.exports=SemVer;var debug;debug="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var args=Array.prototype.slice.call(arguments,0);args.unshift("SEMVER"),console.log.apply(console,args)}:function(){},exports.SEMVER_SPEC_VERSION="2.0.0";var MAX_LENGTH=256,MAX_SAFE_INTEGER=Number.MAX_SAFE_INTEGER||9007199254740991,re=exports.re=[],src=exports.src=[],R=0,NUMERICIDENTIFIER=R++;src[NUMERICIDENTIFIER]="0|[1-9]\\d*";var NUMERICIDENTIFIERLOOSE=R++;src[NUMERICIDENTIFIERLOOSE]="[0-9]+";var NONNUMERICIDENTIFIER=R++;src[NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var MAINVERSION=R++;src[MAINVERSION]="("+src[NUMERICIDENTIFIER]+")\\.("+src[NUMERICIDENTIFIER]+")\\.("+src[NUMERICIDENTIFIER]+")";var MAINVERSIONLOOSE=R++;src[MAINVERSIONLOOSE]="("+src[NUMERICIDENTIFIERLOOSE]+")\\.("+src[NUMERICIDENTIFIERLOOSE]+")\\.("+src[NUMERICIDENTIFIERLOOSE]+")";var PRERELEASEIDENTIFIER=R++;src[PRERELEASEIDENTIFIER]="(?:"+src[NUMERICIDENTIFIER]+"|"+src[NONNUMERICIDENTIFIER]+")";var PRERELEASEIDENTIFIERLOOSE=R++;src[PRERELEASEIDENTIFIERLOOSE]="(?:"+src[NUMERICIDENTIFIERLOOSE]+"|"+src[NONNUMERICIDENTIFIER]+")";var PRERELEASE=R++;src[PRERELEASE]="(?:-("+src[PRERELEASEIDENTIFIER]+"(?:\\."+src[PRERELEASEIDENTIFIER]+")*))";var PRERELEASELOOSE=R++;src[PRERELEASELOOSE]="(?:-?("+src[PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+src[PRERELEASEIDENTIFIERLOOSE]+")*))";var BUILDIDENTIFIER=R++;src[BUILDIDENTIFIER]="[0-9A-Za-z-]+";var BUILD=R++;src[BUILD]="(?:\\+("+src[BUILDIDENTIFIER]+"(?:\\."+src[BUILDIDENTIFIER]+")*))";var FULL=R++,FULLPLAIN="v?"+src[MAINVERSION]+src[PRERELEASE]+"?"+src[BUILD]+"?";src[FULL]="^"+FULLPLAIN+"$";var LOOSEPLAIN="[v=\\s]*"+src[MAINVERSIONLOOSE]+src[PRERELEASELOOSE]+"?"+src[BUILD]+"?",LOOSE=R++;src[LOOSE]="^"+LOOSEPLAIN+"$";var GTLT=R++;src[GTLT]="((?:<|>)?=?)";var XRANGEIDENTIFIERLOOSE=R++;src[XRANGEIDENTIFIERLOOSE]=src[NUMERICIDENTIFIERLOOSE]+"|x|X|\\*";var XRANGEIDENTIFIER=R++;src[XRANGEIDENTIFIER]=src[NUMERICIDENTIFIER]+"|x|X|\\*";var XRANGEPLAIN=R++;src[XRANGEPLAIN]="[v=\\s]*("+src[XRANGEIDENTIFIER]+")(?:\\.("+src[XRANGEIDENTIFIER]+")(?:\\.("+src[XRANGEIDENTIFIER]+")(?:"+src[PRERELEASE]+")?"+src[BUILD]+"?)?)?";var XRANGEPLAINLOOSE=R++;src[XRANGEPLAINLOOSE]="[v=\\s]*("+src[XRANGEIDENTIFIERLOOSE]+")(?:\\.("+src[XRANGEIDENTIFIERLOOSE]+")(?:\\.("+src[XRANGEIDENTIFIERLOOSE]+")(?:"+src[PRERELEASELOOSE]+")?"+src[BUILD]+"?)?)?";var XRANGE=R++;src[XRANGE]="^"+src[GTLT]+"\\s*"+src[XRANGEPLAIN]+"$";var XRANGELOOSE=R++;src[XRANGELOOSE]="^"+src[GTLT]+"\\s*"+src[XRANGEPLAINLOOSE]+"$";var LONETILDE=R++;src[LONETILDE]="(?:~>?)";var TILDETRIM=R++;src[TILDETRIM]="(\\s*)"+src[LONETILDE]+"\\s+",re[TILDETRIM]=new RegExp(src[TILDETRIM],"g");var TILDE=R++;src[TILDE]="^"+src[LONETILDE]+src[XRANGEPLAIN]+"$";var TILDELOOSE=R++;src[TILDELOOSE]="^"+src[LONETILDE]+src[XRANGEPLAINLOOSE]+"$";var LONECARET=R++;src[LONECARET]="(?:\\^)";var CARETTRIM=R++;src[CARETTRIM]="(\\s*)"+src[LONECARET]+"\\s+",re[CARETTRIM]=new RegExp(src[CARETTRIM],"g");var CARET=R++;src[CARET]="^"+src[LONECARET]+src[XRANGEPLAIN]+"$";var CARETLOOSE=R++;src[CARETLOOSE]="^"+src[LONECARET]+src[XRANGEPLAINLOOSE]+"$";var COMPARATORLOOSE=R++;src[COMPARATORLOOSE]="^"+src[GTLT]+"\\s*("+LOOSEPLAIN+")$|^$";var COMPARATOR=R++;src[COMPARATOR]="^"+src[GTLT]+"\\s*("+FULLPLAIN+")$|^$";var COMPARATORTRIM=R++;src[COMPARATORTRIM]="(\\s*)"+src[GTLT]+"\\s*("+LOOSEPLAIN+"|"+src[XRANGEPLAIN]+")",re[COMPARATORTRIM]=new RegExp(src[COMPARATORTRIM],"g");var HYPHENRANGE=R++;src[HYPHENRANGE]="^\\s*("+src[XRANGEPLAIN]+")\\s+-\\s+("+src[XRANGEPLAIN]+")\\s*$";var HYPHENRANGELOOSE=R++;src[HYPHENRANGELOOSE]="^\\s*("+src[XRANGEPLAINLOOSE]+")\\s+-\\s+("+src[XRANGEPLAINLOOSE]+")\\s*$";var STAR=R++;src[STAR]="(<|>)?=?\\s*\\*";for(var i=0;i=0;)"number"==typeof this.prerelease[i]&&(this.prerelease[i]++,i=-2);i===-1&&this.prerelease.push(0)}identifier&&(this.prerelease[0]===identifier?isNaN(this.prerelease[1])&&(this.prerelease=[identifier,0]):this.prerelease=[identifier,0]);break;default:throw new Error("invalid increment argument: "+release)}return this.format(),this.raw=this.version,this},exports.inc=inc,exports.diff=diff,exports.compareIdentifiers=compareIdentifiers;var numeric=/^[0-9]+$/;exports.rcompareIdentifiers=rcompareIdentifiers,exports.major=major,exports.minor=minor,exports.patch=patch,exports.compare=compare,exports.compareLoose=compareLoose,exports.rcompare=rcompare,exports.sort=sort,exports.rsort=rsort,exports.gt=gt,exports.lt=lt,exports.eq=eq,exports.neq=neq,exports.gte=gte,exports.lte=lte,exports.cmp=cmp,exports.Comparator=Comparator;var ANY={};Comparator.prototype.parse=function(comp){var r=this.loose?re[COMPARATORLOOSE]:re[COMPARATOR],m=comp.match(r);if(!m)throw new TypeError("Invalid comparator: "+comp);this.operator=m[1],"="===this.operator&&(this.operator=""),m[2]?this.semver=new SemVer(m[2],this.loose):this.semver=ANY},Comparator.prototype.toString=function(){return this.value},Comparator.prototype.test=function(version){return debug("Comparator.test",version,this.loose),this.semver===ANY||("string"==typeof version&&(version=new SemVer(version,this.loose)),cmp(version,this.operator,this.semver,this.loose))},exports.Range=Range,Range.prototype.format=function(){return this.range=this.set.map(function(comps){return comps.join(" ").trim()}).join("||").trim(),this.range},Range.prototype.toString=function(){return this.range},Range.prototype.parseRange=function(range){var loose=this.loose;range=range.trim(),debug("range",range,loose);var hr=loose?re[HYPHENRANGELOOSE]:re[HYPHENRANGE];range=range.replace(hr,hyphenReplace),debug("hyphen replace",range),range=range.replace(re[COMPARATORTRIM],"$1$2$3"),debug("comparator trim",range,re[COMPARATORTRIM]),range=range.replace(re[TILDETRIM],"$1~"),range=range.replace(re[CARETTRIM],"$1^"),range=range.split(/\s+/).join(" ");var compRe=loose?re[COMPARATORLOOSE]:re[COMPARATOR],set=range.split(" ").map(function(comp){return parseComparator(comp,loose)}).join(" ").split(/\s+/);return this.loose&&(set=set.filter(function(comp){return!!comp.match(compRe)})),set=set.map(function(comp){return new Comparator(comp,loose)})},exports.toComparators=toComparators,Range.prototype.test=function(version){if(!version)return!1;"string"==typeof version&&(version=new SemVer(version,this.loose));for(var i=0;i{return varint.decode(msg),counter=varint.decode(msg,varint.decode.bytes),!0})}const varint=__webpack_require__(16),pull=__webpack_require__(5),pullLP=__webpack_require__(28),Connection=__webpack_require__(29).Connection,util=__webpack_require__(112),select=__webpack_require__(288),once=__webpack_require__(82),PROTOCOL_ID=__webpack_require__(286).PROTOCOL_ID;class Dialer{constructor(){this.conn=null,this.log=util.log.dialer()}handle(rawConn,callback){this.log("dialer handle conn"),callback=once(callback),pull(rawConn,select(PROTOCOL_ID,(err,conn)=>{if(err)return callback(err);this.log("handshake success"),this.conn=new Connection(conn,rawConn),callback()},this.log),rawConn)}select(protocol,callback){if(this.log("dialer select "+protocol),callback=once(callback),!this.conn)return callback(new Error("multistream handshake has not finalized yet"));const s=select(protocol,(err,conn)=>{if(err)return this.conn=new Connection(conn,this.conn),callback(err);callback(null,new Connection(conn,this.conn))},this.log);pull(this.conn,s,this.conn)}ls(callback){callback=once(callback);const lsStream=select("ls",(err,conn)=>{if(err)return callback(err);pull(conn,pullLP.decode(),collectLs(conn),pull.map(stringify),pull.collect((err,list)=>{if(err)return callback(err);callback(null,list.slice(1))}))},this.log);pull(this.conn,lsStream,this.conn)}}module.exports=Dialer},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(5),isFunction=__webpack_require__(633),assert=__webpack_require__(7),select=__webpack_require__(288),selectHandler=__webpack_require__(701),lsHandler=__webpack_require__(699),matchExact=__webpack_require__(287),util=__webpack_require__(112),Connection=__webpack_require__(29).Connection,PROTOCOL_ID=__webpack_require__(286).PROTOCOL_ID;class Listener{constructor(){this.handlers={ls:{handlerFunc:(protocol,conn)=>lsHandler(this,conn),matchFunc:matchExact}},this.log=util.log.listener()}handle(rawConn,callback){this.log("listener handle conn"),pull(rawConn,select(PROTOCOL_ID,(err,conn)=>{if(err)return callback(err);const shConn=new Connection(conn,rawConn);pull(shConn,selectHandler(shConn,this.handlers,this.log),shConn),callback()},this.log),rawConn)}addHandler(protocol,handlerFunc,matchFunc){this.log("adding handler: "+protocol),assert(isFunction(handlerFunc),"handler must be a function"),this.handlers[protocol]&&this.log("overwriting handler for "+protocol),matchFunc||(matchFunc=matchExact),this.handlers[protocol]={handlerFunc:handlerFunc,matchFunc:matchFunc}}}module.exports=Listener},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function lsHandler(self,conn){const protos=Object.keys(self.handlers).filter(key=>"ls"!==key),nProtos=protos.length,size=protos.reduce((size,proto)=>{const p=new Buffer(proto+"\n");return size+varint.encodingLength(p.length)},0),buf=Buffer.concat([new Buffer(varint.encode(nProtos)),new Buffer(varint.encode(size)),new Buffer("\n")]),encodedProtos=protos.map(proto=>{return new Buffer(proto+"\n")}),values=[buf].concat(encodedProtos);pull(pull.values(values),pullLP.encode(),conn)}const pull=__webpack_require__(5),pullLP=__webpack_require__(28),varint=__webpack_require__(16);module.exports=lsHandler}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function matchSemver(myProtocol,senderProtocol,callback){const mps=myProtocol.split("/"),sps=senderProtocol.split("/"),myName=mps[1],myVersion=mps[2],senderName=sps[1],senderVersion=sps[2];if(myName!==senderName)return callback(null,!1);callback(null,semver.satisfies(myVersion,"~"+senderVersion))}const semver=__webpack_require__(696);module.exports=matchSemver},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function selectHandler(rawConn,handlersMap,log){function next(){lp.decodeFromReader(shake,(err,data)=>{if(err)return cb(err);log("received:",data.toString());const protocol=data.toString().slice(0,-1);matcher(protocol,handlersMap,(err,result)=>{if(err)return cb(err);const key=result;if(key){log("send ack back of: "+protocol),writeEncoded(shake,data,cb);const conn=new Connection(shake.rest(),rawConn);handlersMap[key].handlerFunc(protocol,conn)}else log("not supported protocol: "+protocol),writeEncoded(shake,new Buffer("na\n")),next()})})}const cb=err=>{log.error(err)},stream=handshake({timeout:6e4},cb),shake=stream.handshake;return next(),stream}function matcher(protocol,handlers,callback){const supportedProtocols=Object.keys(handlers);let supportedProtocol=!1;some(supportedProtocols,(sp,cb)=>{handlers[sp].matchFunc(sp,protocol,(err,result)=>{if(err)return cb(err);result&&(supportedProtocol=sp),cb()})},err=>{if(err)return callback(err);callback(null,supportedProtocol)})}const handshake=__webpack_require__(67),lp=__webpack_require__(28),Connection=__webpack_require__(29).Connection,writeEncoded=__webpack_require__(112).writeEncoded,some=__webpack_require__(356);module.exports=selectHandler}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(703)},function(module,exports,__webpack_require__){!function(root,undefined){"use strict";function _x86Multiply(m,n){return(65535&m)*n+(((m>>>16)*n&65535)<<16)}function _x86Rotl(m,n){return m<>>32-n}function _x86Fmix(h){return h^=h>>>16,h=_x86Multiply(h,2246822507),h^=h>>>13,h=_x86Multiply(h,3266489909),h^=h>>>16}function _x64Add(m,n){m=[m[0]>>>16,65535&m[0],m[1]>>>16,65535&m[1]],n=[n[0]>>>16,65535&n[0],n[1]>>>16,65535&n[1]];var o=[0,0,0,0];return o[3]+=m[3]+n[3],o[2]+=o[3]>>>16,o[3]&=65535,o[2]+=m[2]+n[2],o[1]+=o[2]>>>16,o[2]&=65535,o[1]+=m[1]+n[1],o[0]+=o[1]>>>16,o[1]&=65535,o[0]+=m[0]+n[0],o[0]&=65535,[o[0]<<16|o[1],o[2]<<16|o[3]]}function _x64Multiply(m,n){m=[m[0]>>>16,65535&m[0],m[1]>>>16,65535&m[1]],n=[n[0]>>>16,65535&n[0],n[1]>>>16,65535&n[1]];var o=[0,0,0,0];return o[3]+=m[3]*n[3],o[2]+=o[3]>>>16,o[3]&=65535,o[2]+=m[2]*n[3],o[1]+=o[2]>>>16,o[2]&=65535,o[2]+=m[3]*n[2],o[1]+=o[2]>>>16,o[2]&=65535,o[1]+=m[1]*n[3],o[0]+=o[1]>>>16,o[1]&=65535,o[1]+=m[2]*n[2],o[0]+=o[1]>>>16,o[1]&=65535,o[1]+=m[3]*n[1],o[0]+=o[1]>>>16,o[1]&=65535,o[0]+=m[0]*n[3]+m[1]*n[2]+m[2]*n[1]+m[3]*n[0],o[0]&=65535,[o[0]<<16|o[1],o[2]<<16|o[3]]}function _x64Rotl(m,n){return n%=64,32===n?[m[1],m[0]]:n<32?[m[0]<>>32-n,m[1]<>>32-n]:(n-=32,[m[1]<>>32-n,m[0]<>>32-n])}function _x64LeftShift(m,n){return n%=64,0===n?m:n<32?[m[0]<>>32-n,m[1]<>>1]),h=_x64Multiply(h,[4283543511,3981806797]),h=_x64Xor(h,[0,h[0]>>>1]),h=_x64Multiply(h,[3301882366,444984403]),h=_x64Xor(h,[0,h[0]>>>1])}var library={version:"3.0.1",x86:{},x64:{}};library.x86.hash32=function(key,seed){key=key||"",seed=seed||0;for(var remainder=key.length%4,bytes=key.length-remainder,h1=seed,k1=0,c1=3432918353,c2=461845907,i=0;i>>0},library.x86.hash128=function(key,seed){key=key||"",seed=seed||0;for(var remainder=key.length%16,bytes=key.length-remainder,h1=seed,h2=seed,h3=seed,h4=seed,k1=0,k2=0,k3=0,k4=0,c1=597399067,c2=2869860233,c3=951274213,c4=2716044179,i=0;i>>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)},library.x64.hash128=function(key,seed){key=key||"",seed=seed||0;for(var remainder=key.length%16,bytes=key.length-remainder,h1=[0,seed],h2=[0,seed],k1=[0,0],k2=[0,0],c1=[2277735313,289559509],c2=[1291169091,658871167],i=0;i>>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)},void 0!==module&&module.exports&&(exports=module.exports=library),exports.murmurHash3=library}()},function(module,exports,__webpack_require__){"use strict";module.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(module,exports,__webpack_require__){"use strict";function err(strm,errorCode){return strm.msg=msg[errorCode],errorCode}function rank(f){return(f<<1)-(f>4?9:0)}function zero(buf){for(var len=buf.length;--len>=0;)buf[len]=0}function flush_pending(strm){var s=strm.state,len=s.pending;len>strm.avail_out&&(len=strm.avail_out),0!==len&&(utils.arraySet(strm.output,s.pending_buf,s.pending_out,len,strm.next_out),strm.next_out+=len,s.pending_out+=len,strm.total_out+=len,strm.avail_out-=len,s.pending-=len,0===s.pending&&(s.pending_out=0))}function flush_block_only(s,last){trees._tr_flush_block(s,s.block_start>=0?s.block_start:-1,s.strstart-s.block_start,last),s.block_start=s.strstart,flush_pending(s.strm)}function put_byte(s,b){s.pending_buf[s.pending++]=b}function putShortMSB(s,b){s.pending_buf[s.pending++]=b>>>8&255,s.pending_buf[s.pending++]=255&b}function read_buf(strm,buf,start,size){var len=strm.avail_in;return len>size&&(len=size),0===len?0:(strm.avail_in-=len,utils.arraySet(buf,strm.input,strm.next_in,len,start),1===strm.state.wrap?strm.adler=adler32(strm.adler,buf,len,start):2===strm.state.wrap&&(strm.adler=crc32(strm.adler,buf,len,start)),strm.next_in+=len,strm.total_in+=len,len)}function longest_match(s,cur_match){var match,len,chain_length=s.max_chain_length,scan=s.strstart,best_len=s.prev_length,nice_match=s.nice_match,limit=s.strstart>s.w_size-MIN_LOOKAHEAD?s.strstart-(s.w_size-MIN_LOOKAHEAD):0,_win=s.window,wmask=s.w_mask,prev=s.prev,strend=s.strstart+MAX_MATCH,scan_end1=_win[scan+best_len-1],scan_end=_win[scan+best_len];s.prev_length>=s.good_match&&(chain_length>>=2),nice_match>s.lookahead&&(nice_match=s.lookahead);do{if(match=cur_match,_win[match+best_len]===scan_end&&_win[match+best_len-1]===scan_end1&&_win[match]===_win[scan]&&_win[++match]===_win[scan+1]){scan+=2,match++;do{}while(_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&scanbest_len){if(s.match_start=cur_match,best_len=len,len>=nice_match)break;scan_end1=_win[scan+best_len-1],scan_end=_win[scan+best_len]}}}while((cur_match=prev[cur_match&wmask])>limit&&0!=--chain_length);return best_len<=s.lookahead?best_len:s.lookahead}function fill_window(s){var p,n,m,more,str,_w_size=s.w_size;do{if(more=s.window_size-s.lookahead-s.strstart,s.strstart>=_w_size+(_w_size-MIN_LOOKAHEAD)){utils.arraySet(s.window,s.window,_w_size,_w_size,0),s.match_start-=_w_size,s.strstart-=_w_size,s.block_start-=_w_size,n=s.hash_size,p=n;do{m=s.head[--p],s.head[p]=m>=_w_size?m-_w_size:0}while(--n);n=_w_size,p=n;do{m=s.prev[--p],s.prev[p]=m>=_w_size?m-_w_size:0}while(--n);more+=_w_size}if(0===s.strm.avail_in)break;if(n=read_buf(s.strm,s.window,s.strstart+s.lookahead,more),s.lookahead+=n,s.lookahead+s.insert>=MIN_MATCH)for(str=s.strstart-s.insert,s.ins_h=s.window[str],s.ins_h=(s.ins_h<s.pending_buf_size-5&&(max_block_size=s.pending_buf_size-5);;){if(s.lookahead<=1){if(fill_window(s),0===s.lookahead&&flush===Z_NO_FLUSH)return BS_NEED_MORE;if(0===s.lookahead)break}s.strstart+=s.lookahead,s.lookahead=0;var max_start=s.block_start+max_block_size;if((0===s.strstart||s.strstart>=max_start)&&(s.lookahead=s.strstart-max_start,s.strstart=max_start,flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE;if(s.strstart-s.block_start>=s.w_size-MIN_LOOKAHEAD&&(flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE}return s.insert=0,flush===Z_FINISH?(flush_block_only(s,!0),0===s.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):(s.strstart>s.block_start&&(flush_block_only(s,!1),s.strm.avail_out),BS_NEED_MORE)}function deflate_fast(s,flush){for(var hash_head,bflush;;){if(s.lookahead=MIN_MATCH&&(s.ins_h=(s.ins_h<=MIN_MATCH)if(bflush=trees._tr_tally(s,s.strstart-s.match_start,s.match_length-MIN_MATCH),s.lookahead-=s.match_length,s.match_length<=s.max_lazy_match&&s.lookahead>=MIN_MATCH){s.match_length--;do{s.strstart++,s.ins_h=(s.ins_h<=MIN_MATCH&&(s.ins_h=(s.ins_h<4096)&&(s.match_length=MIN_MATCH-1)),s.prev_length>=MIN_MATCH&&s.match_length<=s.prev_length){max_insert=s.strstart+s.lookahead-MIN_MATCH,bflush=trees._tr_tally(s,s.strstart-1-s.prev_match,s.prev_length-MIN_MATCH),s.lookahead-=s.prev_length-1,s.prev_length-=2;do{++s.strstart<=max_insert&&(s.ins_h=(s.ins_h<=MIN_MATCH&&s.strstart>0&&(scan=s.strstart-1,(prev=_win[scan])===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan])){strend=s.strstart+MAX_MATCH;do{}while(prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&scans.lookahead&&(s.match_length=s.lookahead)}if(s.match_length>=MIN_MATCH?(bflush=trees._tr_tally(s,1,s.match_length-MIN_MATCH),s.lookahead-=s.match_length,s.strstart+=s.match_length,s.match_length=0):(bflush=trees._tr_tally(s,0,s.window[s.strstart]),s.lookahead--,s.strstart++),bflush&&(flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE}return s.insert=0,flush===Z_FINISH?(flush_block_only(s,!0),0===s.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):s.last_lit&&(flush_block_only(s,!1),0===s.strm.avail_out)?BS_NEED_MORE:BS_BLOCK_DONE}function deflate_huff(s,flush){for(var bflush;;){if(0===s.lookahead&&(fill_window(s),0===s.lookahead)){if(flush===Z_NO_FLUSH)return BS_NEED_MORE;break}if(s.match_length=0,bflush=trees._tr_tally(s,0,s.window[s.strstart]),s.lookahead--,s.strstart++,bflush&&(flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE}return s.insert=0,flush===Z_FINISH?(flush_block_only(s,!0),0===s.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):s.last_lit&&(flush_block_only(s,!1),0===s.strm.avail_out)?BS_NEED_MORE:BS_BLOCK_DONE}function Config(good_length,max_lazy,nice_length,max_chain,func){this.good_length=good_length,this.max_lazy=max_lazy,this.nice_length=nice_length,this.max_chain=max_chain,this.func=func}function lm_init(s){s.window_size=2*s.w_size,zero(s.head),s.max_lazy_match=configuration_table[s.level].max_lazy,s.good_match=configuration_table[s.level].good_length,s.nice_match=configuration_table[s.level].nice_length,s.max_chain_length=configuration_table[s.level].max_chain,s.strstart=0,s.block_start=0,s.lookahead=0,s.insert=0,s.match_length=s.prev_length=MIN_MATCH-1,s.match_available=0,s.ins_h=0}function DeflateState(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Z_DEFLATED,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new utils.Buf16(2*HEAP_SIZE),this.dyn_dtree=new utils.Buf16(2*(2*D_CODES+1)),this.bl_tree=new utils.Buf16(2*(2*BL_CODES+1)),zero(this.dyn_ltree),zero(this.dyn_dtree),zero(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new utils.Buf16(MAX_BITS+1),this.heap=new utils.Buf16(2*L_CODES+1),zero(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new utils.Buf16(2*L_CODES+1),zero(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function deflateResetKeep(strm){var s;return strm&&strm.state?(strm.total_in=strm.total_out=0,strm.data_type=Z_UNKNOWN,s=strm.state,s.pending=0,s.pending_out=0,s.wrap<0&&(s.wrap=-s.wrap),s.status=s.wrap?INIT_STATE:BUSY_STATE,strm.adler=2===s.wrap?0:1,s.last_flush=Z_NO_FLUSH,trees._tr_init(s),Z_OK):err(strm,Z_STREAM_ERROR)}function deflateReset(strm){var ret=deflateResetKeep(strm);return ret===Z_OK&&lm_init(strm.state),ret}function deflateSetHeader(strm,head){return strm&&strm.state?2!==strm.state.wrap?Z_STREAM_ERROR:(strm.state.gzhead=head,Z_OK):Z_STREAM_ERROR}function deflateInit2(strm,level,method,windowBits,memLevel,strategy){if(!strm)return Z_STREAM_ERROR;var wrap=1;if(level===Z_DEFAULT_COMPRESSION&&(level=6),windowBits<0?(wrap=0,windowBits=-windowBits):windowBits>15&&(wrap=2,windowBits-=16),memLevel<1||memLevel>MAX_MEM_LEVEL||method!==Z_DEFLATED||windowBits<8||windowBits>15||level<0||level>9||strategy<0||strategy>Z_FIXED)return err(strm,Z_STREAM_ERROR);8===windowBits&&(windowBits=9);var s=new DeflateState;return strm.state=s,s.strm=strm,s.wrap=wrap,s.gzhead=null,s.w_bits=windowBits,s.w_size=1<Z_BLOCK||flush<0)return strm?err(strm,Z_STREAM_ERROR):Z_STREAM_ERROR;if(s=strm.state,!strm.output||!strm.input&&0!==strm.avail_in||s.status===FINISH_STATE&&flush!==Z_FINISH)return err(strm,0===strm.avail_out?Z_BUF_ERROR:Z_STREAM_ERROR);if(s.strm=strm,old_flush=s.last_flush,s.last_flush=flush,s.status===INIT_STATE)if(2===s.wrap)strm.adler=0,put_byte(s,31),put_byte(s,139),put_byte(s,8),s.gzhead?(put_byte(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(s.gzhead.extra?4:0)+(s.gzhead.name?8:0)+(s.gzhead.comment?16:0)),put_byte(s,255&s.gzhead.time),put_byte(s,s.gzhead.time>>8&255),put_byte(s,s.gzhead.time>>16&255),put_byte(s,s.gzhead.time>>24&255),put_byte(s,9===s.level?2:s.strategy>=Z_HUFFMAN_ONLY||s.level<2?4:0),put_byte(s,255&s.gzhead.os),s.gzhead.extra&&s.gzhead.extra.length&&(put_byte(s,255&s.gzhead.extra.length),put_byte(s,s.gzhead.extra.length>>8&255)),s.gzhead.hcrc&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending,0)),s.gzindex=0,s.status=EXTRA_STATE):(put_byte(s,0),put_byte(s,0),put_byte(s,0),put_byte(s,0),put_byte(s,0),put_byte(s,9===s.level?2:s.strategy>=Z_HUFFMAN_ONLY||s.level<2?4:0),put_byte(s,OS_CODE),s.status=BUSY_STATE);else{var header=Z_DEFLATED+(s.w_bits-8<<4)<<8,level_flags=-1;level_flags=s.strategy>=Z_HUFFMAN_ONLY||s.level<2?0:s.level<6?1:6===s.level?2:3,header|=level_flags<<6, +0!==s.strstart&&(header|=PRESET_DICT),header+=31-header%31,s.status=BUSY_STATE,putShortMSB(s,header),0!==s.strstart&&(putShortMSB(s,strm.adler>>>16),putShortMSB(s,65535&strm.adler)),strm.adler=1}if(s.status===EXTRA_STATE)if(s.gzhead.extra){for(beg=s.pending;s.gzindex<(65535&s.gzhead.extra.length)&&(s.pending!==s.pending_buf_size||(s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),flush_pending(strm),beg=s.pending,s.pending!==s.pending_buf_size));)put_byte(s,255&s.gzhead.extra[s.gzindex]),s.gzindex++;s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),s.gzindex===s.gzhead.extra.length&&(s.gzindex=0,s.status=NAME_STATE)}else s.status=NAME_STATE;if(s.status===NAME_STATE)if(s.gzhead.name){beg=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),flush_pending(strm),beg=s.pending,s.pending===s.pending_buf_size)){val=1;break}val=s.gzindexbeg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),0===val&&(s.gzindex=0,s.status=COMMENT_STATE)}else s.status=COMMENT_STATE;if(s.status===COMMENT_STATE)if(s.gzhead.comment){beg=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),flush_pending(strm),beg=s.pending,s.pending===s.pending_buf_size)){val=1;break}val=s.gzindexbeg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),0===val&&(s.status=HCRC_STATE)}else s.status=HCRC_STATE;if(s.status===HCRC_STATE&&(s.gzhead.hcrc?(s.pending+2>s.pending_buf_size&&flush_pending(strm),s.pending+2<=s.pending_buf_size&&(put_byte(s,255&strm.adler),put_byte(s,strm.adler>>8&255),strm.adler=0,s.status=BUSY_STATE)):s.status=BUSY_STATE),0!==s.pending){if(flush_pending(strm),0===strm.avail_out)return s.last_flush=-1,Z_OK}else if(0===strm.avail_in&&rank(flush)<=rank(old_flush)&&flush!==Z_FINISH)return err(strm,Z_BUF_ERROR);if(s.status===FINISH_STATE&&0!==strm.avail_in)return err(strm,Z_BUF_ERROR);if(0!==strm.avail_in||0!==s.lookahead||flush!==Z_NO_FLUSH&&s.status!==FINISH_STATE){var bstate=s.strategy===Z_HUFFMAN_ONLY?deflate_huff(s,flush):s.strategy===Z_RLE?deflate_rle(s,flush):configuration_table[s.level].func(s,flush);if(bstate!==BS_FINISH_STARTED&&bstate!==BS_FINISH_DONE||(s.status=FINISH_STATE),bstate===BS_NEED_MORE||bstate===BS_FINISH_STARTED)return 0===strm.avail_out&&(s.last_flush=-1),Z_OK;if(bstate===BS_BLOCK_DONE&&(flush===Z_PARTIAL_FLUSH?trees._tr_align(s):flush!==Z_BLOCK&&(trees._tr_stored_block(s,0,0,!1),flush===Z_FULL_FLUSH&&(zero(s.head),0===s.lookahead&&(s.strstart=0,s.block_start=0,s.insert=0))),flush_pending(strm),0===strm.avail_out))return s.last_flush=-1,Z_OK}return flush!==Z_FINISH?Z_OK:s.wrap<=0?Z_STREAM_END:(2===s.wrap?(put_byte(s,255&strm.adler),put_byte(s,strm.adler>>8&255),put_byte(s,strm.adler>>16&255),put_byte(s,strm.adler>>24&255),put_byte(s,255&strm.total_in),put_byte(s,strm.total_in>>8&255),put_byte(s,strm.total_in>>16&255),put_byte(s,strm.total_in>>24&255)):(putShortMSB(s,strm.adler>>>16),putShortMSB(s,65535&strm.adler)),flush_pending(strm),s.wrap>0&&(s.wrap=-s.wrap),0!==s.pending?Z_OK:Z_STREAM_END)}function deflateEnd(strm){var status;return strm&&strm.state?(status=strm.state.status)!==INIT_STATE&&status!==EXTRA_STATE&&status!==NAME_STATE&&status!==COMMENT_STATE&&status!==HCRC_STATE&&status!==BUSY_STATE&&status!==FINISH_STATE?err(strm,Z_STREAM_ERROR):(strm.state=null,status===BUSY_STATE?err(strm,Z_DATA_ERROR):Z_OK):Z_STREAM_ERROR}function deflateSetDictionary(strm,dictionary){var s,str,n,wrap,avail,next,input,tmpDict,dictLength=dictionary.length;if(!strm||!strm.state)return Z_STREAM_ERROR;if(s=strm.state,2===(wrap=s.wrap)||1===wrap&&s.status!==INIT_STATE||s.lookahead)return Z_STREAM_ERROR;for(1===wrap&&(strm.adler=adler32(strm.adler,dictionary,dictLength,0)),s.wrap=0,dictLength>=s.w_size&&(0===wrap&&(zero(s.head),s.strstart=0,s.block_start=0,s.insert=0),tmpDict=new utils.Buf8(s.w_size),utils.arraySet(tmpDict,dictionary,dictLength-s.w_size,s.w_size,0),dictionary=tmpDict,dictLength=s.w_size),avail=strm.avail_in,next=strm.next_in,input=strm.input,strm.avail_in=dictLength,strm.next_in=0,strm.input=dictionary,fill_window(s);s.lookahead>=MIN_MATCH;){str=s.strstart,n=s.lookahead-(MIN_MATCH-1);do{s.ins_h=(s.ins_h<>>24,hold>>>=op,bits-=op,0===(op=here>>>16&255))output[_out++]=65535&here;else{if(!(16&op)){if(0==(64&op)){here=lcode[(65535&here)+(hold&(1<>>=op,bits-=op),bits<15&&(hold+=input[_in++]<>>24,hold>>>=op,bits-=op,!(16&(op=here>>>16&255))){if(0==(64&op)){here=dcode[(65535&here)+(hold&(1<dmax){strm.msg="invalid distance too far back",state.mode=30;break top}if(hold>>>=op,bits-=op,op=_out-beg,dist>op){if((op=dist-op)>whave&&state.sane){strm.msg="invalid distance too far back",state.mode=30;break top}if(from=0,from_source=s_window,0===wnext){if(from+=wsize-op,op2;)output[_out++]=from_source[from++],output[_out++]=from_source[from++],output[_out++]=from_source[from++],len-=3;len&&(output[_out++]=from_source[from++],len>1&&(output[_out++]=from_source[from++]))}else{from=_out-dist;do{output[_out++]=output[from++],output[_out++]=output[from++],output[_out++]=output[from++],len-=3}while(len>2);len&&(output[_out++]=output[from++],len>1&&(output[_out++]=output[from++]))}break}}break}}while(_in>3,_in-=len,bits-=len<<3,hold&=(1<>>24&255)+(q>>>8&65280)+((65280&q)<<8)+((255&q)<<24)}function InflateState(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new utils.Buf16(320),this.work=new utils.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function inflateResetKeep(strm){var state;return strm&&strm.state?(state=strm.state,strm.total_in=strm.total_out=state.total=0,strm.msg="",state.wrap&&(strm.adler=1&state.wrap),state.mode=HEAD,state.last=0,state.havedict=0,state.dmax=32768,state.head=null,state.hold=0,state.bits=0,state.lencode=state.lendyn=new utils.Buf32(ENOUGH_LENS),state.distcode=state.distdyn=new utils.Buf32(ENOUGH_DISTS),state.sane=1,state.back=-1,Z_OK):Z_STREAM_ERROR}function inflateReset(strm){var state;return strm&&strm.state?(state=strm.state,state.wsize=0,state.whave=0,state.wnext=0,inflateResetKeep(strm)):Z_STREAM_ERROR}function inflateReset2(strm,windowBits){var wrap,state;return strm&&strm.state?(state=strm.state,windowBits<0?(wrap=0,windowBits=-windowBits):(wrap=1+(windowBits>>4),windowBits<48&&(windowBits&=15)),windowBits&&(windowBits<8||windowBits>15)?Z_STREAM_ERROR:(null!==state.window&&state.wbits!==windowBits&&(state.window=null),state.wrap=wrap,state.wbits=windowBits,inflateReset(strm))):Z_STREAM_ERROR}function inflateInit2(strm,windowBits){var ret,state;return strm?(state=new InflateState,strm.state=state,state.window=null,ret=inflateReset2(strm,windowBits),ret!==Z_OK&&(strm.state=null),ret):Z_STREAM_ERROR}function inflateInit(strm){return inflateInit2(strm,DEF_WBITS)}function fixedtables(state){if(virgin){var sym;for(lenfix=new utils.Buf32(512),distfix=new utils.Buf32(32),sym=0;sym<144;)state.lens[sym++]=8;for(;sym<256;)state.lens[sym++]=9;for(;sym<280;)state.lens[sym++]=7;for(;sym<288;)state.lens[sym++]=8;for(inflate_table(LENS,state.lens,0,288,lenfix,0,state.work,{bits:9}),sym=0;sym<32;)state.lens[sym++]=5;inflate_table(DISTS,state.lens,0,32,distfix,0,state.work,{bits:5}),virgin=!1}state.lencode=lenfix,state.lenbits=9,state.distcode=distfix,state.distbits=5}function updatewindow(strm,src,end,copy){var dist,state=strm.state;return null===state.window&&(state.wsize=1<=state.wsize?(utils.arraySet(state.window,src,end-state.wsize,state.wsize,0),state.wnext=0,state.whave=state.wsize):(dist=state.wsize-state.wnext,dist>copy&&(dist=copy),utils.arraySet(state.window,src,end-copy,dist,state.wnext),copy-=dist,copy?(utils.arraySet(state.window,src,end-copy,copy,0),state.wnext=copy,state.whave=state.wsize):(state.wnext+=dist,state.wnext===state.wsize&&(state.wnext=0),state.whave>>8&255,state.check=crc32(state.check,hbuf,2,0),hold=0,bits=0,state.mode=FLAGS;break}if(state.flags=0,state.head&&(state.head.done=!1),!(1&state.wrap)||(((255&hold)<<8)+(hold>>8))%31){strm.msg="incorrect header check",state.mode=BAD;break}if((15&hold)!==Z_DEFLATED){strm.msg="unknown compression method",state.mode=BAD;break}if(hold>>>=4,bits-=4,len=8+(15&hold),0===state.wbits)state.wbits=len;else if(len>state.wbits){strm.msg="invalid window size",state.mode=BAD;break}state.dmax=1<>8&1),512&state.flags&&(hbuf[0]=255&hold,hbuf[1]=hold>>>8&255,state.check=crc32(state.check,hbuf,2,0)),hold=0,bits=0,state.mode=TIME;case TIME:for(;bits<32;){if(0===have)break inf_leave;have--,hold+=input[next++]<>>8&255,hbuf[2]=hold>>>16&255,hbuf[3]=hold>>>24&255,state.check=crc32(state.check,hbuf,4,0)),hold=0,bits=0,state.mode=OS;case OS:for(;bits<16;){if(0===have)break inf_leave;have--,hold+=input[next++]<>8),512&state.flags&&(hbuf[0]=255&hold,hbuf[1]=hold>>>8&255,state.check=crc32(state.check,hbuf,2,0)),hold=0,bits=0,state.mode=EXLEN;case EXLEN:if(1024&state.flags){for(;bits<16;){if(0===have)break inf_leave;have--,hold+=input[next++]<>>8&255,state.check=crc32(state.check,hbuf,2,0)),hold=0,bits=0}else state.head&&(state.head.extra=null);state.mode=EXTRA;case EXTRA:if(1024&state.flags&&(copy=state.length,copy>have&&(copy=have),copy&&(state.head&&(len=state.head.extra_len-state.length,state.head.extra||(state.head.extra=new Array(state.head.extra_len)),utils.arraySet(state.head.extra,input,next,copy,len)),512&state.flags&&(state.check=crc32(state.check,input,copy,next)),have-=copy,next+=copy,state.length-=copy),state.length))break inf_leave;state.length=0,state.mode=NAME;case NAME:if(2048&state.flags){if(0===have)break inf_leave;copy=0;do{len=input[next+copy++],state.head&&len&&state.length<65536&&(state.head.name+=String.fromCharCode(len))}while(len&©>9&1,state.head.done=!0),strm.adler=state.check=0,state.mode=TYPE;break;case DICTID:for(;bits<32;){if(0===have)break inf_leave;have--,hold+=input[next++]<>>=7&bits,bits-=7&bits,state.mode=CHECK;break}for(;bits<3;){if(0===have)break inf_leave;have--,hold+=input[next++]<>>=1,bits-=1,3&hold){case 0:state.mode=STORED;break;case 1:if(fixedtables(state),state.mode=LEN_,flush===Z_TREES){hold>>>=2,bits-=2;break inf_leave}break;case 2:state.mode=TABLE;break;case 3:strm.msg="invalid block type",state.mode=BAD}hold>>>=2,bits-=2;break;case STORED:for(hold>>>=7&bits,bits-=7&bits;bits<32;){if(0===have)break inf_leave;have--,hold+=input[next++]<>>16^65535)){strm.msg="invalid stored block lengths",state.mode=BAD;break}if(state.length=65535&hold,hold=0,bits=0,state.mode=COPY_,flush===Z_TREES)break inf_leave;case COPY_:state.mode=COPY;case COPY:if(copy=state.length){if(copy>have&&(copy=have),copy>left&&(copy=left),0===copy)break inf_leave;utils.arraySet(output,input,next,copy,put),have-=copy,next+=copy,left-=copy,put+=copy,state.length-=copy;break}state.mode=TYPE;break;case TABLE:for(;bits<14;){if(0===have)break inf_leave;have--,hold+=input[next++]<>>=5,bits-=5,state.ndist=1+(31&hold),hold>>>=5,bits-=5,state.ncode=4+(15&hold),hold>>>=4,bits-=4,state.nlen>286||state.ndist>30){strm.msg="too many length or distance symbols",state.mode=BAD;break}state.have=0,state.mode=LENLENS;case LENLENS:for(;state.have>>=3,bits-=3}for(;state.have<19;)state.lens[order[state.have++]]=0;if(state.lencode=state.lendyn,state.lenbits=7,opts={bits:state.lenbits},ret=inflate_table(CODES,state.lens,0,19,state.lencode,0,state.work,opts),state.lenbits=opts.bits,ret){strm.msg="invalid code lengths set",state.mode=BAD;break}state.have=0,state.mode=CODELENS;case CODELENS:for(;state.have>>24,here_op=here>>>16&255,here_val=65535&here,!(here_bits<=bits);){if(0===have)break inf_leave;have--,hold+=input[next++]<>>=here_bits,bits-=here_bits,state.lens[state.have++]=here_val;else{if(16===here_val){for(n=here_bits+2;bits>>=here_bits,bits-=here_bits,0===state.have){strm.msg="invalid bit length repeat",state.mode=BAD;break}len=state.lens[state.have-1],copy=3+(3&hold),hold>>>=2,bits-=2}else if(17===here_val){for(n=here_bits+3;bits>>=here_bits,bits-=here_bits,len=0,copy=3+(7&hold),hold>>>=3,bits-=3}else{for(n=here_bits+7;bits>>=here_bits,bits-=here_bits,len=0,copy=11+(127&hold),hold>>>=7,bits-=7}if(state.have+copy>state.nlen+state.ndist){strm.msg="invalid bit length repeat",state.mode=BAD;break}for(;copy--;)state.lens[state.have++]=len}}if(state.mode===BAD)break;if(0===state.lens[256]){strm.msg="invalid code -- missing end-of-block",state.mode=BAD;break}if(state.lenbits=9,opts={bits:state.lenbits},ret=inflate_table(LENS,state.lens,0,state.nlen,state.lencode,0,state.work,opts),state.lenbits=opts.bits,ret){strm.msg="invalid literal/lengths set",state.mode=BAD;break}if(state.distbits=6,state.distcode=state.distdyn,opts={bits:state.distbits},ret=inflate_table(DISTS,state.lens,state.nlen,state.ndist,state.distcode,0,state.work,opts),state.distbits=opts.bits,ret){strm.msg="invalid distances set",state.mode=BAD;break}if(state.mode=LEN_,flush===Z_TREES)break inf_leave;case LEN_:state.mode=LEN;case LEN:if(have>=6&&left>=258){strm.next_out=put,strm.avail_out=left,strm.next_in=next,strm.avail_in=have,state.hold=hold,state.bits=bits,inflate_fast(strm,_out),put=strm.next_out,output=strm.output,left=strm.avail_out,next=strm.next_in,input=strm.input,have=strm.avail_in,hold=state.hold,bits=state.bits,state.mode===TYPE&&(state.back=-1);break}for(state.back=0;here=state.lencode[hold&(1<>>24,here_op=here>>>16&255,here_val=65535&here,!(here_bits<=bits);){if(0===have)break inf_leave;have--,hold+=input[next++]<>last_bits)],here_bits=here>>>24,here_op=here>>>16&255,here_val=65535&here,!(last_bits+here_bits<=bits);){if(0===have)break inf_leave;have--,hold+=input[next++]<>>=last_bits,bits-=last_bits,state.back+=last_bits}if(hold>>>=here_bits,bits-=here_bits,state.back+=here_bits,state.length=here_val,0===here_op){state.mode=LIT;break}if(32&here_op){state.back=-1,state.mode=TYPE;break}if(64&here_op){strm.msg="invalid literal/length code",state.mode=BAD;break}state.extra=15&here_op,state.mode=LENEXT;case LENEXT:if(state.extra){for(n=state.extra;bits>>=state.extra,bits-=state.extra,state.back+=state.extra}state.was=state.length,state.mode=DIST;case DIST:for(;here=state.distcode[hold&(1<>>24,here_op=here>>>16&255,here_val=65535&here,!(here_bits<=bits);){if(0===have)break inf_leave;have--,hold+=input[next++]<>last_bits)],here_bits=here>>>24,here_op=here>>>16&255,here_val=65535&here,!(last_bits+here_bits<=bits);){if(0===have)break inf_leave;have--,hold+=input[next++]<>>=last_bits,bits-=last_bits,state.back+=last_bits}if(hold>>>=here_bits,bits-=here_bits,state.back+=here_bits,64&here_op){strm.msg="invalid distance code",state.mode=BAD;break}state.offset=here_val,state.extra=15&here_op,state.mode=DISTEXT;case DISTEXT:if(state.extra){for(n=state.extra;bits>>=state.extra,bits-=state.extra,state.back+=state.extra}if(state.offset>state.dmax){strm.msg="invalid distance too far back",state.mode=BAD;break}state.mode=MATCH;case MATCH:if(0===left)break inf_leave;if(copy=_out-left,state.offset>copy){if((copy=state.offset-copy)>state.whave&&state.sane){strm.msg="invalid distance too far back",state.mode=BAD;break}copy>state.wnext?(copy-=state.wnext,from=state.wsize-copy):from=state.wnext-copy,copy>state.length&&(copy=state.length),from_source=state.window}else from_source=output,from=put-state.offset,copy=state.length;copy>left&&(copy=left),left-=copy,state.length-=copy;do{output[put++]=from_source[from++]}while(--copy);0===state.length&&(state.mode=LEN);break;case LIT:if(0===left)break inf_leave;output[put++]=state.length,left--,state.mode=LEN;break;case CHECK:if(state.wrap){for(;bits<32;){if(0===have)break inf_leave;have--,hold|=input[next++]<=1&&0===count[max];max--);if(root>max&&(root=max),0===max)return table[table_index++]=20971520,table[table_index++]=20971520,opts.bits=1,0;for(min=1;min0&&(0===type||1!==max))return-1;for(offs[1]=0,len=1;len<15;len++)offs[len+1]=offs[len]+count[len];for(sym=0;sym852||2===type&&used>592)return 1;for(;;){here_bits=len-drop,work[sym]end?(here_op=extra[extra_index+work[sym]],here_val=base[base_index+work[sym]]):(here_op=96,here_val=0),incr=1<>drop)+fill]=here_bits<<24|here_op<<16|here_val|0}while(0!==fill);for(incr=1<>=1;if(0!==incr?(huff&=incr-1,huff+=incr):huff=0,sym++,0==--count[len]){if(len===max)break;len=lens[lens_index+work[sym]]}if(len>root&&(huff&mask)!==low){for(0===drop&&(drop=root),next+=min,curr=len-drop,left=1<852||2===type&&used>592)return 1;low=huff&mask,table[low]=root<<24|curr<<16|next-table_index|0}}return 0!==huff&&(table[next+huff]=len-drop<<24|64<<16|0),opts.bits=root,0}},function(module,exports,__webpack_require__){"use strict";module.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(module,exports,__webpack_require__){"use strict";function zero(buf){for(var len=buf.length;--len>=0;)buf[len]=0}function StaticTreeDesc(static_tree,extra_bits,extra_base,elems,max_length){this.static_tree=static_tree,this.extra_bits=extra_bits,this.extra_base=extra_base,this.elems=elems,this.max_length=max_length,this.has_stree=static_tree&&static_tree.length}function TreeDesc(dyn_tree,stat_desc){this.dyn_tree=dyn_tree,this.max_code=0,this.stat_desc=stat_desc}function d_code(dist){return dist<256?_dist_code[dist]:_dist_code[256+(dist>>>7)]}function put_short(s,w){s.pending_buf[s.pending++]=255&w,s.pending_buf[s.pending++]=w>>>8&255}function send_bits(s,value,length){s.bi_valid>Buf_size-length?(s.bi_buf|=value<>Buf_size-s.bi_valid,s.bi_valid+=length-Buf_size):(s.bi_buf|=value<>>=1,res<<=1}while(--len>0);return res>>>1}function bi_flush(s){16===s.bi_valid?(put_short(s,s.bi_buf),s.bi_buf=0,s.bi_valid=0):s.bi_valid>=8&&(s.pending_buf[s.pending++]=255&s.bi_buf,s.bi_buf>>=8,s.bi_valid-=8)}function gen_bitlen(s,desc){var h,n,m,bits,xbits,f,tree=desc.dyn_tree,max_code=desc.max_code,stree=desc.stat_desc.static_tree,has_stree=desc.stat_desc.has_stree,extra=desc.stat_desc.extra_bits,base=desc.stat_desc.extra_base,max_length=desc.stat_desc.max_length,overflow=0;for(bits=0;bits<=MAX_BITS;bits++)s.bl_count[bits]=0 +;for(tree[2*s.heap[s.heap_max]+1]=0,h=s.heap_max+1;hmax_length&&(bits=max_length,overflow++),tree[2*n+1]=bits,n>max_code||(s.bl_count[bits]++,xbits=0,n>=base&&(xbits=extra[n-base]),f=tree[2*n],s.opt_len+=f*(bits+xbits),has_stree&&(s.static_len+=f*(stree[2*n+1]+xbits)));if(0!==overflow){do{for(bits=max_length-1;0===s.bl_count[bits];)bits--;s.bl_count[bits]--,s.bl_count[bits+1]+=2,s.bl_count[max_length]--,overflow-=2}while(overflow>0);for(bits=max_length;0!==bits;bits--)for(n=s.bl_count[bits];0!==n;)(m=s.heap[--h])>max_code||(tree[2*m+1]!==bits&&(s.opt_len+=(bits-tree[2*m+1])*tree[2*m],tree[2*m+1]=bits),n--)}}function gen_codes(tree,max_code,bl_count){var bits,n,next_code=new Array(MAX_BITS+1),code=0;for(bits=1;bits<=MAX_BITS;bits++)next_code[bits]=code=code+bl_count[bits-1]<<1;for(n=0;n<=max_code;n++){var len=tree[2*n+1];0!==len&&(tree[2*n]=bi_reverse(next_code[len]++,len))}}function tr_static_init(){var n,bits,length,code,dist,bl_count=new Array(MAX_BITS+1);for(length=0,code=0;code>=7;code8?put_short(s,s.bi_buf):s.bi_valid>0&&(s.pending_buf[s.pending++]=s.bi_buf),s.bi_buf=0,s.bi_valid=0}function copy_block(s,buf,len,header){bi_windup(s),header&&(put_short(s,len),put_short(s,~len)),utils.arraySet(s.pending_buf,s.window,buf,len,s.pending),s.pending+=len}function smaller(tree,n,m,depth){var _n2=2*n,_m2=2*m;return tree[_n2]>1;n>=1;n--)pqdownheap(s,tree,n);node=elems;do{n=s.heap[1],s.heap[1]=s.heap[s.heap_len--],pqdownheap(s,tree,1),m=s.heap[1],s.heap[--s.heap_max]=n,s.heap[--s.heap_max]=m,tree[2*node]=tree[2*n]+tree[2*m],s.depth[node]=(s.depth[n]>=s.depth[m]?s.depth[n]:s.depth[m])+1,tree[2*n+1]=tree[2*m+1]=node,s.heap[1]=node++,pqdownheap(s,tree,1)}while(s.heap_len>=2);s.heap[--s.heap_max]=s.heap[1],gen_bitlen(s,desc),gen_codes(tree,max_code,s.bl_count)}function scan_tree(s,tree,max_code){var n,curlen,prevlen=-1,nextlen=tree[1],count=0,max_count=7,min_count=4;for(0===nextlen&&(max_count=138,min_count=3),tree[2*(max_code+1)+1]=65535,n=0;n<=max_code;n++)curlen=nextlen,nextlen=tree[2*(n+1)+1],++count=3&&0===s.bl_tree[2*bl_order[max_blindex]+1];max_blindex--);return s.opt_len+=3*(max_blindex+1)+5+5+4,max_blindex}function send_all_trees(s,lcodes,dcodes,blcodes){var rank;for(send_bits(s,lcodes-257,5),send_bits(s,dcodes-1,5),send_bits(s,blcodes-4,4),rank=0;rank>>=1)if(1&black_mask&&0!==s.dyn_ltree[2*n])return Z_BINARY;if(0!==s.dyn_ltree[18]||0!==s.dyn_ltree[20]||0!==s.dyn_ltree[26])return Z_TEXT;for(n=32;n0?(s.strm.data_type===Z_UNKNOWN&&(s.strm.data_type=detect_data_type(s)),build_tree(s,s.l_desc),build_tree(s,s.d_desc),max_blindex=build_bl_tree(s),opt_lenb=s.opt_len+3+7>>>3,(static_lenb=s.static_len+3+7>>>3)<=opt_lenb&&(opt_lenb=static_lenb)):opt_lenb=static_lenb=stored_len+5,stored_len+4<=opt_lenb&&buf!==-1?_tr_stored_block(s,buf,stored_len,last):s.strategy===Z_FIXED||static_lenb===opt_lenb?(send_bits(s,(STATIC_TREES<<1)+(last?1:0),3),compress_block(s,static_ltree,static_dtree)):(send_bits(s,(DYN_TREES<<1)+(last?1:0),3),send_all_trees(s,s.l_desc.max_code+1,s.d_desc.max_code+1,max_blindex+1),compress_block(s,s.dyn_ltree,s.dyn_dtree)),init_block(s),last&&bi_windup(s)}function _tr_tally(s,dist,lc){return s.pending_buf[s.d_buf+2*s.last_lit]=dist>>>8&255,s.pending_buf[s.d_buf+2*s.last_lit+1]=255&dist,s.pending_buf[s.l_buf+s.last_lit]=255&lc,s.last_lit++,0===dist?s.dyn_ltree[2*lc]++:(s.matches++,dist--,s.dyn_ltree[2*(_length_code[lc]+LITERALS+1)]++,s.dyn_dtree[2*d_code(dist)]++),s.last_lit===s.lit_bufsize-1}var utils=__webpack_require__(114),Z_FIXED=4,Z_BINARY=0,Z_TEXT=1,Z_UNKNOWN=2,STORED_BLOCK=0,STATIC_TREES=1,DYN_TREES=2,LENGTH_CODES=29,LITERALS=256,L_CODES=LITERALS+1+LENGTH_CODES,D_CODES=30,BL_CODES=19,HEAP_SIZE=2*L_CODES+1,MAX_BITS=15,Buf_size=16,MAX_BL_BITS=7,END_BLOCK=256,REP_3_6=16,REPZ_3_10=17,REPZ_11_138=18,extra_lbits=[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],extra_dbits=[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],extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],static_ltree=new Array(2*(L_CODES+2));zero(static_ltree);var static_dtree=new Array(2*D_CODES);zero(static_dtree);var _dist_code=new Array(512);zero(_dist_code);var _length_code=new Array(256);zero(_length_code);var base_length=new Array(LENGTH_CODES);zero(base_length);var base_dist=new Array(D_CODES);zero(base_dist);var static_l_desc,static_d_desc,static_bl_desc,static_init_done=!1;exports._tr_init=_tr_init,exports._tr_stored_block=_tr_stored_block,exports._tr_flush_block=_tr_flush_block,exports._tr_tally=_tr_tally,exports._tr_align=_tr_align},function(module,exports,__webpack_require__){"use strict";function ZStream(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}module.exports=ZStream},function(module,exports,__webpack_require__){(function(global){var rvalidchars=/^[\],:{}\s]*$/;module.exports=function(data){return"string"==typeof data&&data?(data=data.replace(/^\s+/,"").replace(/\s+$/,""),global.JSON&&JSON.parse?JSON.parse(data):rvalidchars.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))?new Function("return "+data)():void 0):null}}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){"use strict";const ensureMultiaddr=__webpack_require__(293).ensureMultiaddr,uniqBy=__webpack_require__(639);class MultiaddrSet{constructor(multiaddrs){this._multiaddrs=multiaddrs||[],this._observedMultiaddrs=[]}add(ma){ma=ensureMultiaddr(ma),this.has(ma)||this._multiaddrs.push(ma)}addSafe(ma){ma=ensureMultiaddr(ma),this._observedMultiaddrs.some((m,i)=>{if(m.equals(ma))return this.add(ma),this._observedMultiaddrs.splice(i,1),!0})||this._observedMultiaddrs.push(ma)}toArray(){return this._multiaddrs.slice()}get size(){return this._multiaddrs.length}forEach(fn){return this._multiaddrs.forEach(fn)}has(ma){return ma=ensureMultiaddr(ma),this._multiaddrs.some(m=>m.equals(ma))}delete(ma){ma=ensureMultiaddr(ma),this._multiaddrs.some((m,i)=>{if(m.equals(ma))return this._multiaddrs.splice(i,1),!0})}replace(existing,fresh){Array.isArray(existing)||(existing=[existing]),Array.isArray(fresh)||(fresh=[fresh]),existing.forEach(m=>this.delete(m)),fresh.forEach(m=>this.add(m))}clear(){this._multiaddrs=[]}distinct(){return uniqBy(this._multiaddrs,ma=>{return[ma.toOptions().port,ma.toOptions().transport].join()})}}module.exports=MultiaddrSet},function(module,exports,__webpack_require__){(function(process){function Promise(fn){function next(skipTimeout){waiting.length?(running=!0,waiting.shift()(skipTimeout||!1)):running=!1}function then(cb,eb){return new Promise(function(resolver){function done(skipTimeout){function timeoutDone(){var val;try{val=callback(value)}catch(ex){return resolver.reject(ex),next()}resolver.fulfill(val),next(!0)}var callback=isFulfilled?cb:eb;"function"==typeof callback?skipTimeout?timeoutDone():nextTick(timeoutDone):isFulfilled?(resolver.fulfill(value),next(skipTimeout)):(resolver.reject(value),next(skipTimeout))}waiting.push(done),isResolved&&!running&&next()})}if(!(this instanceof Promise))return"function"==typeof fn?new Promise(fn):defer();var value,isResolved=!1,isFulfilled=!1,waiting=[],running=!1;this.then=then,function(){function fulfill(val){isResolved||(isPromise(val)?val.then(fulfill,reject):(isResolved=isFulfilled=!0,value=val,next()))}function reject(err){isResolved||(isResolved=!0,isFulfilled=!1,value=err,next())}for(var resolver={fulfill:fulfill,reject:reject},i=0;i"!==tokens[0])throw new Error("Unexpected token in map type: "+tokens[0]);tokens.shift(),field.name=tokens.shift();break;case"repeated":case"required":case"optional":var t=tokens.shift();field.required="required"===t,field.repeated="repeated"===t,field.type=tokens.shift(),field.name=tokens.shift();break;case"[":field.options=onfieldoptions(tokens);break;case";":if(null===field.name)throw new Error("Missing field name");if(null===field.type)throw new Error("Missing type in message field: "+field.name);if(field.tag===-1)throw new Error("Missing tag number in message field: "+field.name);return tokens.shift(),field;default:throw new Error("Unexpected token in message field: "+tokens[0])}throw new Error("No ; found for message field")},onmessagebody=function(tokens){for(var body={enums:[],messages:[],fields:[],extends:[],extensions:null};tokens.length;)switch(tokens[0]){case"map":case"repeated":case"optional":case"required":body.fields.push(onfield(tokens));break;case"enum":body.enums.push(onenum(tokens));break;case"message":body.messages.push(onmessage(tokens));break;case"extensions":body.extensions=onextensions(tokens);break;case"oneof":tokens.shift();var name=tokens.shift();if("{"!==tokens[0])throw new Error("Unexpected token in oneof: "+tokens[0]);for(tokens.shift();"}"!==tokens[0];){tokens.unshift("optional");var field=onfield(tokens);field.oneof=name,body.fields.push(field)}tokens.shift();break;case"extend":body.extends.push(onextend(tokens));break;case";":tokens.shift();break;case"reserved":case"option":for(tokens.shift();";"!==tokens[0];)tokens.shift();break;default:tokens.unshift("optional"),body.fields.push(onfield(tokens))}return body},onextend=function(tokens){return{name:tokens[1],message:onmessage(tokens)}},onextensions=function(tokens){tokens.shift();var from=Number(tokens.shift());if(isNaN(from))throw new Error("Invalid from in extensions definition");if("to"!==tokens.shift())throw new Error("Expected keyword 'to' in extensions definition");var to=tokens.shift();if("max"===to&&(to=536870911),to=Number(to),isNaN(to))throw new Error("Invalid to in extensions definition");if(";"!==tokens.shift())throw new Error("Missing ; in extensions definition");return{from:from,to:to}},onmessage=function(tokens){tokens.shift();var lvl=1,body=[],msg={name:tokens.shift(),enums:[],extends:[],messages:[],fields:[]};if("{"!==tokens[0])throw new Error("Expected { but found "+tokens[0]);for(tokens.shift();tokens.length;){if("{"===tokens[0]?lvl++:"}"===tokens[0]&&lvl--,!lvl)return tokens.shift(),body=onmessagebody(body),msg.enums=body.enums,msg.messages=body.messages,msg.fields=body.fields,msg.extends=body.extends,msg.extensions=body.extensions,msg;body.push(tokens.shift())}if(lvl)throw new Error("No closing tag for message")},onpackagename=function(tokens){tokens.shift();var name=tokens.shift();if(";"!==tokens[0])throw new Error("Expected ; but found "+tokens[0]);return tokens.shift(),name},onsyntaxversion=function(tokens){if(tokens.shift(),"="!==tokens[0])throw new Error("Expected = but found "+tokens[0]);tokens.shift();var version=tokens.shift();switch(version){case'"proto2"':version=2;break;case'"proto3"':version=3;break;default:throw new Error("Expected protobuf syntax version but found "+version)}if(";"!==tokens[0])throw new Error("Expected ; but found "+tokens[0]);return tokens.shift(),version},onenumvalue=function(tokens){if(tokens.length<4)throw new Error("Invalid enum value: "+tokens.slice(0,3).join(" "));if("="!==tokens[1])throw new Error("Expected = but found "+tokens[1]);if(";"!==tokens[3]&&"["!==tokens[3])throw new Error("Expected ; or [ but found "+tokens[1]);var name=tokens.shift();tokens.shift();var val={value:null,options:{}};return val.value=Number(tokens.shift()),"["===tokens[0]&&(val.options=onfieldoptions(tokens)),tokens.shift(),{name:name,val:val}},onenum=function(tokens){tokens.shift();var options={},e={name:tokens.shift(),values:{},options:{}};if("{"!==tokens[0])throw new Error("Expected { but found "+tokens[0]);for(tokens.shift();tokens.length;){if("}"===tokens[0])return tokens.shift(),";"===tokens[0]&&tokens.shift(),e;if("option"!==tokens[0]){var val=onenumvalue(tokens);e.values[val.name]=val.val}else options=onoption(tokens),e.options[options.name]=options.value}throw new Error("No closing tag for enum")},onoption=function(tokens){for(var name=null,value=null;tokens.length;){if(";"===tokens[0])return tokens.shift(),{name:name,value:value};switch(tokens[0]){case"option":tokens.shift();var hasBracket="("===tokens[0];if(hasBracket&&tokens.shift(),name=tokens.shift(),hasBracket){if(")"!==tokens[0])throw new Error("Expected ) but found "+tokens[0]);tokens.shift()}"."===tokens[0][0]&&(name+=tokens.shift());break;case"=":if(tokens.shift(),null===name)throw new Error("Expected key for option with value: "+tokens[0]);if(value=function(value){return"true"===value||"false"!==value&&value.replace(/^"+|"+$/gm,"")}(tokens.shift()),"optimize_for"===name&&!/^(SPEED|CODE_SIZE|LITE_RUNTIME)$/.test(value))throw new Error("Unexpected value for option optimize_for: "+value);"{"===value&&(value=onoptionMap(tokens));break;default:throw new Error("Unexpected token in option: "+tokens[0])}}},onoptionMap=function(tokens){for(var map={};tokens.length;){if("}"===tokens[0])return tokens.shift(),map;var hasBracket="("===tokens[0];hasBracket&&tokens.shift();var key=tokens.shift();if(hasBracket){if(")"!==tokens[0])throw new Error("Expected ) but found "+tokens[0]);tokens.shift()}var value=null;switch(tokens[0]){case":":if(void 0!==map[key])throw new Error("Duplicate option map key "+key);tokens.shift(),value=function(value){return"true"===value||"false"!==value&&value.replace(/^"+|"+$/gm,"")}(tokens.shift()),"{"===value&&(value=onoptionMap(tokens)),map[key]=value;break;case"{":if(tokens.shift(),value=onoptionMap(tokens),void 0===map[key]&&(map[key]=[]),!Array.isArray(map[key]))throw new Error("Duplicate option map key "+key);map[key].push(value);break;default:throw new Error("Unexpected token in option map: "+tokens[0])}}throw new Error("No closing tag for option map")},onimport=function(tokens){tokens.shift();var file=tokens.shift().replace(/^"+|"+$/gm,"");if(";"!==tokens[0])throw new Error("Unexpected token: "+tokens[0]+'. Expected ";"');return tokens.shift(),file},onservice=function(tokens){tokens.shift();var service={name:tokens.shift(),methods:[],options:{}};if("{"!==tokens[0])throw new Error("Expected { but found "+tokens[0]);for(tokens.shift();tokens.length;){if("}"===tokens[0])return tokens.shift(),";"===tokens[0]&&tokens.shift(),service;switch(tokens[0]){case"option":var opt=onoption(tokens);if(void 0!==service.options[opt.name])throw new Error("Duplicate option "+opt.name);service.options[opt.name]=opt.value;break;case"rpc":service.methods.push(onrpc(tokens));break;default:throw new Error("Unexpected token in service: "+tokens[0])}}throw new Error("No closing tag for service")},onrpc=function(tokens){tokens.shift();var rpc={name:tokens.shift(),input_type:null,output_type:null,client_streaming:!1,server_streaming:!1,options:{}};if("("!==tokens[0])throw new Error("Expected ( but found "+tokens[0]);if(tokens.shift(),"stream"===tokens[0]&&(tokens.shift(),rpc.client_streaming=!0),rpc.input_type=tokens.shift(),")"!==tokens[0])throw new Error("Expected ) but found "+tokens[0]);if(tokens.shift(),"returns"!==tokens[0])throw new Error("Expected returns but found "+tokens[0]);if(tokens.shift(),"("!==tokens[0])throw new Error("Expected ( but found "+tokens[0]);if(tokens.shift(),"stream"===tokens[0]&&(tokens.shift(),rpc.server_streaming=!0),rpc.output_type=tokens.shift(),")"!==tokens[0])throw new Error("Expected ) but found "+tokens[0]);if(tokens.shift(),";"===tokens[0])return tokens.shift(),rpc;if("{"!==tokens[0])throw new Error("Expected { but found "+tokens[0]);for(tokens.shift();tokens.length;){if("}"===tokens[0])return tokens.shift(),";"===tokens[0]&&tokens.shift(),rpc;if("option"!==tokens[0])throw new Error("Unexpected token in rpc options: "+tokens[0]);var opt=onoption(tokens);if(void 0!==rpc.options[opt.name])throw new Error("Duplicate option "+opt.name);rpc.options[opt.name]=opt.value}throw new Error("No closing tag for rpc")},parse=function(buf){for(var tokens=tokenize(buf.toString()),i=0;imsg.extensions.to)throw new Error(msg.name+" does not declare "+field.tag+" as an extension number");msg.fields.push(field)})})}),schema.messages.forEach(function(msg){msg.fields.forEach(function(field){function enumNameIsFieldType(en){return en.name===field.type}function enumNameIsNestedEnumName(en){return en.name===nestedEnumName}var fieldSplit,messageName,nestedEnumName,message;if(field.options&&"true"===field.options.packed&&PACKABLE_TYPES.indexOf(field.type)===-1){if(field.type.indexOf(".")===-1){if(msg.enums&&msg.enums.some(enumNameIsFieldType))return}else{if(fieldSplit=field.type.split("."),fieldSplit.length>2)throw new Error("what is this?");if(messageName=fieldSplit[0],nestedEnumName=fieldSplit[1],schema.messages.some(function(msg){if(msg.name===messageName)return message=msg,msg}),message&&message.enums&&message.enums.some(enumNameIsNestedEnumName))return}throw new Error("Fields of type "+field.type+' cannot be declared [packed=true]. Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire types) can be declared "packed". See https://developers.google.com/protocol-buffers/docs/encoding#optional')}})}),schema};module.exports=parse},function(module,exports){var onfield=function(f,result){var prefix=f.repeated?"repeated":f.required?"required":"optional";"map"===f.type&&(prefix="map<"+f.map.from+","+f.map.to+">"),f.oneof&&(prefix="");var opts=Object.keys(f.options||{}).map(function(key){return key+" = "+f.options[key]}).join(",");return opts&&(opts=" ["+opts+"]"),result.push((prefix?prefix+" ":"")+("map"===f.map?"":f.type+" ")+f.name+" = "+f.tag+opts+";"),result},onmessage=function(m,result){result.push("message "+m.name+" {"),m.enums||(m.enums=[]),m.enums.forEach(function(e){result.push(onenum(e,[]))}),m.messages||(m.messages=[]),m.messages.forEach(function(m){result.push(onmessage(m,[]))});var oneofs={};return m.fields||(m.fields=[]),m.fields.forEach(function(f){f.oneof?(oneofs[f.oneof]||(oneofs[f.oneof]=[]),oneofs[f.oneof].push(onfield(f,[]))):result.push(onfield(f,[]))}),Object.keys(oneofs).forEach(function(n){oneofs[n].unshift("oneof "+n+" {"),oneofs[n].push("}"),result.push(oneofs[n])}),result.push("}",""),result},onenum=function(e,result){result.push("enum "+e.name+" {"),e.options||(e.options={});var options=onoption(e.options,[]);return options.length>1&&result.push(options.slice(0,-1)),Object.keys(e.values).map(function(v){var val=onenumvalue(e.values[v]);result.push([v+" = "+val+";"])}),result.push("}",""),result},onenumvalue=function(v,result){var opts=Object.keys(v.options||{}).map(function(key){return key+" = "+v.options[key]}).join(",");return opts&&(opts=" ["+opts+"]"),v.value+opts},onoption=function(o,result){var keys=Object.keys(o);return keys.forEach(function(option){var v=o[option];~option.indexOf(".")&&(option="("+option+")");var type=typeof v;"object"===type?(v=onoptionMap(v,[]),v.length&&result.push("option "+option+" = {",v,"};")):("string"===type&&"optimize_for"!==option&&(v='"'+v+'"'),result.push("option "+option+" = "+v+";"))}),keys.length>0&&result.push(""),result},onoptionMap=function(o,result){return Object.keys(o).forEach(function(k){var v=o[k],type=typeof v;"object"===type?Array.isArray(v)?v.forEach(function(v){v=onoptionMap(v,[]),v.length&&result.push(k+" {",v,"}")}):(v=onoptionMap(v,[]),v.length&&result.push(k+" {",v,"}")):("string"===type&&(v='"'+v+'"'),result.push(k+": "+v))}),result},onservices=function(s,result){return result.push("service "+s.name+" {"),s.options||(s.options={}),onoption(s.options,result),s.methods||(s.methods=[]),s.methods.forEach(function(m){result.push(onrpc(m,[]))}),result.push("}",""),result},onrpc=function(rpc,result){var def="rpc "+rpc.name+"(";rpc.client_streaming&&(def+="stream "),def+=rpc.input_type+") returns (",rpc.server_streaming&&(def+="stream "),def+=rpc.output_type+")",rpc.options||(rpc.options={});var options=onoption(rpc.options,[]);return options.length>1?result.push(def+" {",options.slice(0,-1),"}"):result.push(def+";"),result},indent=function(lvl){return function(line){return Array.isArray(line)?line.map(indent(lvl+" ")).join("\n"):lvl+line}};module.exports=function(schema){var result=[];return result.push('syntax = "proto'+schema.syntax+'";',""),schema.package&&result.push("package "+schema.package+";",""),schema.options||(schema.options={}),onoption(schema.options,result),schema.enums||(schema.enums=[]),schema.enums.forEach(function(e){onenum(e,result)}),schema.messages||(schema.messages=[]),schema.messages.forEach(function(m){onmessage(m,result)}),schema.services&&schema.services.forEach(function(s){onservices(s,result)}),result.map(indent("")).join("\n")}},function(module,exports){module.exports=function(sch){var noComments=function(line){var i=line.indexOf("//");return i>-1?line.slice(0,i):line},trim=function(line){return line.trim()};return sch.replace(/([;,{}\(\)=\:\[\]<>]|\/\*|\*\/)/g," $1 ").split(/\n/).map(trim).filter(Boolean).map(noComments).map(trim).filter(Boolean).join("\n").split(/\s+|\n+/gm).filter(function(){var inside=!1;return function(token){return"/*"===token?(inside=!0,!1):"*/"===token?(inside=!1,!1):!inside}}())}},function(module,exports,__webpack_require__){(function(Buffer){var encodings=__webpack_require__(720),varint=__webpack_require__(16),genobj=__webpack_require__(427),genfun=__webpack_require__(426),flatten=function(values){if(!values)return null;var result={};return Object.keys(values).forEach(function(k){result[k]=values[k].value}),result},skip=function(type,buffer,offset){switch(type){case 0:return varint.decode(buffer,offset),offset+varint.decode.bytes;case 1:return offset+8;case 2:var len=varint.decode(buffer,offset);return offset+varint.decode.bytes+len;case 3:case 4:throw new Error("Groups are not supported");case 5:return offset+4}throw new Error("Unknown wire type: "+type)},defined=function(val){return null!==val&&void 0!==val&&("number"!=typeof val||!isNaN(val))},isString=function(def){try{return!!def&&"string"==typeof JSON.parse(def)}catch(err){return!1}},defaultValue=function(f,def){if(f.map)return"{}";if(f.repeated)return"[]";switch(f.type){case"string":return isString(def)?def:'""';case"bool":return"true"===def?"true":"false";case"float":case"double":case"sfixed32":case"fixed32":case"varint":case"enum":case"uint64":case"uint32":case"int64":case"int32":case"sint64":case"sint32":return""+Number(def||0);default:return"null"}};module.exports=function(schema,extraEncodings){var messages={},enums={},cache={},visit=function(schema,prefix){schema.enums&&schema.enums.forEach(function(e){e.id=prefix+(prefix?".":"")+e.name,enums[e.id]=e,visit(e,e.id)}),schema.messages&&schema.messages.forEach(function(m){m.id=prefix+(prefix?".":"")+m.name,messages[m.id]=m,m.fields.forEach(function(f){if(f.map){var name="Map_"+f.map.from+"_"+f.map.to,map={name:name,enums:[],messages:[],fields:[{name:"key",type:f.map.from,tag:1,repeated:!1,required:!0},{name:"value",type:f.map.to,tag:2,repeated:!1,required:!1}],extensions:null,id:prefix+(prefix?".":"")+name};messages[map.id]||(messages[map.id]=map,schema.messages.push(map)),f.type=name,f.repeated=!0}}),visit(m,m.id)})};visit(schema,"");var compileEnum=function(e){var conditions=Object.keys(e.values).map(function(k){return"val !== "+parseInt(e.values[k].value,10)}).join(" && ");conditions||(conditions="true");var encode=genfun()("function encode (val, buf, offset) {")('if (%s) throw new Error("Invalid enum value: "+val)',conditions)("varint.encode(val, buf, offset)")("encode.bytes = varint.encode.bytes")("return buf")("}").toFunction({varint:varint}),decode=genfun()("function decode (buf, offset) {")("var val = varint.decode(buf, offset)")('if (%s) throw new Error("Invalid enum value: "+val)',conditions)("decode.bytes = varint.decode.bytes")("return val")("}").toFunction({varint:varint});return encodings.make(0,encode,decode,varint.encodingLength) +},compileMessage=function(m,exports){m.messages.forEach(function(nested){exports[nested.name]=resolve(nested.name,m.id)}),m.enums.forEach(function(val){exports[val.name]=flatten(val.values)}),exports.type=2,exports.message=!0,exports.name=m.name;var oneofs={};m.fields.forEach(function(f){f.oneof&&(oneofs[f.oneof]||(oneofs[f.oneof]=[]),oneofs[f.oneof].push(f.name))});var enc=m.fields.map(function(f){return resolve(f.type,m.id)}),forEach=function(fn){for(var i=0;i 1) throw new Error(%s)",oneofs[name].map(function(prop){return"+defined("+genobj("obj",prop)+")"}).join(" + "),msg)}),forEach(function(e,f,val,i){var packed=f.repeated&&f.options&&f.options.packed&&"false"!==f.options.packed,hl=varint.encodingLength(f.tag<<3|e.type);f.required?encodingLength("if (!defined(%s)) throw new Error(%s)",val,JSON.stringify(f.name+" is required")):encodingLength("if (defined(%s)) {",val),f.map&&(encodingLength()("var tmp = Object.keys(%s)",val)("for (var i = 0; i < tmp.length; i++) {")("tmp[i] = {key: tmp[i], value: %s[tmp[i]]}",val)("}"),val="tmp"),packed?(encodingLength()("var packedLen = 0")("for (var i = 0; i < %s.length; i++) {",val)("if (!defined(%s)) continue",val+"[i]")("var len = enc[%d].encodingLength(%s)",i,val+"[i]")("packedLen += len"),e.message&&encodingLength("packedLen += varint.encodingLength(len)"),encodingLength("}")("if (packedLen) {")("length += %d + packedLen + varint.encodingLength(packedLen)",hl)("}")):(f.repeated&&(encodingLength("for (var i = 0; i < %s.length; i++) {",val),val+="[i]",encodingLength("if (!defined(%s)) continue",val)),encodingLength("var len = enc[%d].encodingLength(%s)",i,val),e.message&&encodingLength("length += varint.encodingLength(len)"),encodingLength("length += %d + len",hl),f.repeated&&encodingLength("}")),f.required||encodingLength("}")}),encodingLength()("return length")("}"),encodingLength=encodingLength.toFunction({defined:defined,varint:varint,enc:enc});var encode=genfun()("function encode (obj, buf, offset) {")("if (!offset) offset = 0")("if (!buf) buf = new Buffer(encodingLength(obj))")("var oldOffset = offset");Object.keys(oneofs).forEach(function(name){var msg=JSON.stringify("only one of the properties defined in oneof "+name+" can be set");encode("if ((%s) > 1) throw new Error(%s)",oneofs[name].map(function(prop){return"+defined("+genobj("obj",prop)+")"}).join(" + "),msg)}),forEach(function(e,f,val,i){f.required?encode("if (!defined(%s)) throw new Error(%s)",val,JSON.stringify(f.name+" is required")):encode("if (defined(%s)) {",val);var j,packed=f.repeated&&f.options&&f.options.packed&&"false"!==f.options.packed,p=varint.encode(f.tag<<3|2),h=varint.encode(f.tag<<3|e.type);if(f.map&&(encode()("var tmp = Object.keys(%s)",val)("for (var i = 0; i < tmp.length; i++) {")("tmp[i] = {key: tmp[i], value: %s[tmp[i]]}",val)("}"),val="tmp"),packed){for(encode()("var packedLen = 0")("for (var i = 0; i < %s.length; i++) {",val)("if (!defined(%s)) continue",val+"[i]")("packedLen += enc[%d].encodingLength(%s)",i,val+"[i]")("}"),encode("if (packedLen) {"),j=0;j> 3")("switch (tag) {"),forEach(function(e,f,val,i){var packed=f.repeated&&f.options&&f.options.packed&&"false"!==f.options.packed;decode("case %d:",f.tag),f.oneof&&m.fields.forEach(function(otherField){otherField.oneof===f.oneof&&f.name!==otherField.name&&decode("delete %s",genobj("obj",otherField.name))}),packed&&decode()("var packedEnd = varint.decode(buf, offset)")("offset += varint.decode.bytes")("packedEnd += offset")("while (offset < packedEnd) {"),e.message?(decode("var len = varint.decode(buf, offset)"),decode("offset += varint.decode.bytes"),f.map?(decode("var tmp = enc[%d].decode(buf, offset, offset + len)",i),decode("%s[tmp.key] = tmp.value",val)):f.repeated?decode("%s.push(enc[%d].decode(buf, offset, offset + len))",val,i):decode("%s = enc[%d].decode(buf, offset, offset + len)",val,i)):f.repeated?decode("%s.push(enc[%d].decode(buf, offset))",val,i):decode("%s = enc[%d].decode(buf, offset)",val,i),decode("offset += enc[%d].decode.bytes",i),packed&&decode("}"),f.required&&decode("found%d = true",i),decode("break")}),decode()("default:")("offset = skip(prefix & 7, buf, offset)")("}")("}")("}"),decode=decode.toFunction({varint:varint,skip:skip,enc:enc}),encode.bytes=decode.bytes=0,exports.buffer=!0,exports.encode=encode,exports.decode=decode,exports.encodingLength=encodingLength,exports},resolve=function(name,from,compile){if(extraEncodings&&extraEncodings[name])return extraEncodings[name];if(encodings[name])return encodings[name];var m=(from?from+"."+name:name).split(".").map(function(part,i,list){return list.slice(0,i).concat(name).join(".")}).reverse().reduce(function(result,id){return result||messages[id]||enums[id]},null);if(compile===!1)return m;if(!m)throw new Error("Could not resolve "+name);return m.values?compileEnum(m):cache[m.id]||compileMessage(m,cache[m.id]={})};return(schema.enums||[]).concat((schema.messages||[]).map(function(message){return resolve(message.id)}))}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){var varint=__webpack_require__(16),svarint=__webpack_require__(780),encoder=function(type,encode,decode,encodingLength){return encode.bytes=decode.bytes=0,{type:type,encode:encode,decode:decode,encodingLength:encodingLength}};exports.make=encoder,exports.bytes=function(tag){var bufferLength=function(val){return Buffer.isBuffer(val)?val.length:Buffer.byteLength(val)},encodingLength=function(val){var len=bufferLength(val);return varint.encodingLength(len)+len},encode=function(val,buffer,offset){var oldOffset=offset,len=bufferLength(val);return varint.encode(len,buffer,offset),offset+=varint.encode.bytes,Buffer.isBuffer(val)?val.copy(buffer,offset):buffer.write(val,offset,len),offset+=len,encode.bytes=offset-oldOffset,buffer},decode=function(buffer,offset){var oldOffset=offset,len=varint.decode(buffer,offset);offset+=varint.decode.bytes;var val=buffer.slice(offset,offset+len);return offset+=val.length,decode.bytes=offset-oldOffset,val};return encoder(2,encode,decode,encodingLength)}(),exports.string=function(){var encodingLength=function(val){var len=Buffer.byteLength(val);return varint.encodingLength(len)+len},encode=function(val,buffer,offset){var oldOffset=offset,len=Buffer.byteLength(val);return varint.encode(len,buffer,offset,"utf-8"),offset+=varint.encode.bytes,buffer.write(val,offset,len),offset+=len,encode.bytes=offset-oldOffset,buffer},decode=function(buffer,offset){var oldOffset=offset,len=varint.decode(buffer,offset);offset+=varint.decode.bytes;var val=buffer.toString("utf-8",offset,offset+len);return offset+=len,decode.bytes=offset-oldOffset,val};return encoder(2,encode,decode,encodingLength)}(),exports.bool=function(){var encodingLength=function(val){return 1},encode=function(val,buffer,offset){return buffer[offset]=val?1:0,encode.bytes=1,buffer},decode=function(buffer,offset){var bool=buffer[offset]>0;return decode.bytes=1,bool};return encoder(0,encode,decode,encodingLength)}(),exports.int32=function(){var decode=function(buffer,offset){var val=varint.decode(buffer,offset);return decode.bytes=varint.decode.bytes,val>2147483647?val-4294967296:val},encodingLength=function(val){return varint.encodingLength(val<0?val+4294967296:val)};return encoder(0,varint.encode,decode,encodingLength)}(),exports.int64=function(){var decode=function(buffer,offset){var val=varint.decode(buffer,offset);if(val>=Math.pow(2,63)){for(var limit=9;255===buffer[offset+limit-1];)limit--;limit=limit||9;var subset=new Buffer(limit);buffer.copy(subset,0,offset,offset+limit),subset[limit-1]=127&subset[limit-1],val=-1*varint.decode(subset,0),decode.bytes=10}else decode.bytes=varint.decode.bytes;return val},encode=function(val,buffer,offset){if(val<0){var last=offset+9;for(varint.encode(val*-1,buffer,offset),offset+=varint.encode.bytes-1,buffer[offset]=128|buffer[offset];offset-1};return{enumerable:op("enumerable"),configurable:op("configurable"),writable:op("writable"),value:value}};return function(obj,key,value,options){var k;if(options=makeOptions(value,options),"object"==typeof key){for(k in key)Object.hasOwnProperty.call(key,k)&&(options.value=key[k],setProperty(obj,k,options));return obj}return setProperty(obj,key,options)}})},function(module,exports,__webpack_require__){"use strict";var through=__webpack_require__(116),Buffer=__webpack_require__(13).Buffer;module.exports=function(size,opts){opts||(opts={}),"object"==typeof size&&(opts=size,size=opts.size),size=size||512;var zeroPadding;zeroPadding=!opts.nopad&&(void 0===opts.zeroPadding||opts.zeroPadding);var buffered=[],bufferedBytes=0,emittedChunk=!1;return through(function(data){for("number"==typeof data&&(data=Buffer([data])),bufferedBytes+=data.length,buffered.push(data);bufferedBytes>=size;){var b=Buffer.concat(buffered);bufferedBytes-=size,this.queue(b.slice(0,size)),buffered=[b.slice(size,b.length)],emittedChunk=!0}},function(end){if(opts.emitEmpty&&!emittedChunk||bufferedBytes){if(zeroPadding){var zeroes=Buffer.alloc(size-bufferedBytes);zeroes.fill(0),buffered.push(zeroes)}buffered&&(this.queue(Buffer.concat(buffered)),buffered=null)}this.queue(null)})}},function(module,exports){module.exports=function(onError){onError=onError||function(){};var errd;return function(read){return function(abort,cb){read(abort,function(end,data){if(errd)return cb(!0);if(end&&end!==!0){var _end=onError(end);return _end===!1?cb(end):_end&&_end!==!0?(errd=!0,cb(null,_end)):cb(!0)}cb(end,data)})}}}},function(module,exports){module.exports=function(){function delayed(_read){return stream?stream(_read):(read=_read,function(_abort,_cb){reader?reader(_abort,_cb):(abort=_abort,cb=_cb)})}var read,reader,cb,abort,stream;return delayed.resolve=function(_stream){if(stream)throw new Error("already resolved");if(!(stream=_stream))throw new Error("resolve *must* be passed a transform stream");read&&(reader=stream(read),cb&&reader(abort,cb))},delayed}},function(module,exports,__webpack_require__){"use strict";function decode(opts){let reader=new Reader,p=pushable(err=>{reader.abort(err)});return read=>{function next(){decodeFromReader(reader,opts,(err,msg)=>{if(err)return p.end(err);p.push(msg),next()})}return reader(read),next(),p}}function decodeFromReader(reader,opts,cb){"function"==typeof opts&&(cb=opts,opts={}),opts=Object.assign({fixed:!1,bytes:4},opts||{}),opts.fixed?readFixedMessage(reader,opts.bytes,opts.maxLength,cb):readVarintMessage(reader,opts.maxLength,cb)}function readFixedMessage(reader,byteLength,maxLength,cb){"function"==typeof maxLength&&(cb=maxLength,maxLength=MAX_LENGTH),reader.read(byteLength,(err,bytes)=>{if(err)return cb(err);const msgSize=bytes.readInt32BE(0);if(msgSize>maxLength)return cb("size longer than max permitted length of "+maxLength+"!");readMessage(reader,msgSize,cb)})}function readVarintMessage(reader,maxLength,cb){function readByte(){reader.read(1,(err,byte)=>{if(err)return cb(err);if(rawMsgSize.push(byte),byte&&!isEndByte(byte[0]))return void readByte();const msgSize=varint.decode(Buffer.concat(rawMsgSize));if(msgSize>maxLength)return cb("size longer than max permitted length of "+maxLength+"!");readMessage(reader,msgSize,(err,msg)=>{if(err)return cb(err);rawMsgSize=[],cb(null,msg)})})}"function"==typeof maxLength&&(cb=maxLength,maxLength=MAX_LENGTH);let rawMsgSize=[];0===rawMsgSize.length&&readByte()}function readMessage(reader,size,cb){reader.read(size,(err,msg)=>{if(err)return cb(err);cb(null,msg)})}const varint=__webpack_require__(16),Reader=__webpack_require__(298),Buffer=__webpack_require__(13).Buffer,pushable=__webpack_require__(36);exports.decode=decode,exports.decodeFromReader=decodeFromReader;const isEndByte=byte=>!(128&byte),MAX_LENGTH=4194304},function(module,exports,__webpack_require__){"use strict";function encode(opts){opts=Object.assign({fixed:!1,bytes:4},opts||{});const varint=__webpack_require__(16);let pool=opts.fixed?null:createPool(),used=0,ended=!1;return read=>(end,cb)=>{if(end&&(ended=end),ended)return cb(ended);read(null,(end,data)=>{if(end&&(ended=end),ended)return cb(ended);if(!Buffer.isBuffer(data))return ended=new Error("data must be a buffer"),cb(ended);let encodedLength;opts.fixed?(encodedLength=Buffer.alloc(opts.bytes),encodedLength.writeInt32BE(data.length,0)):(varint.encode(data.length,pool,used),used+=varint.encode.bytes,encodedLength=pool.slice(used-varint.encode.bytes,used),pool.length-used<100&&(pool=createPool(),used=0)),cb(null,Buffer.concat([encodedLength,data]))})}}function createPool(){return Buffer.alloc(poolSize)}const Buffer=__webpack_require__(13).Buffer;module.exports=encode;const poolSize=10240},function(module,exports){module.exports=function(ary){function create(stream){return{ready:!1,reading:!1,ended:!1,read:stream,data:null}}function check(){if(cb){clean();var l=inputs.length,_cb=cb;if(0===l&&(abort||capped))return cb=null,void _cb(abort||!0);for(var j=0;jinputs.length)throw new Error("this should never happen");if(!(current.reading||current.ended||current.ready)){current.reading=!0;var sync=!0;current.read(abort,function next(end,data){current.data=data,current.ready=!0,current.reading=!1,end===!0||abort?current.ended=!0:end&&(abort=current.ended=end),abort&&!end&¤t.read(abort,next),sync||check()}),sync=!1}}(inputs[l]);check()}function read(_abort,_cb){abort=abort||_abort,cb=_cb,next()}var abort,cb,capped=!!ary,inputs=(ary||[]).map(create),i=0;return read.add=function(stream){if(!stream)return capped=!0,next();inputs.push(create(stream)),next()},read.cap=function(err){read.add(null)},read}},function(module,exports){module.exports=function(fn){var active=!1,called=0;return function(){if(called=!0,!active){for(active=!0;called;)called=!1,fn();active=!1}}}},function(module,exports,__webpack_require__){(function(Buffer){module.exports=function(){var buffers=[],length=0;return{length:length,data:this,add:function(data){if(!Buffer.isBuffer(data))throw new Error("data must be a buffer, was: "+JSON.stringify(data));return this.length=length+=data.length,buffers.push(data),this},has:function(n){return null==n?length>0:length>=n},get:function(n){var _length;if(null==n||n===length){length=0;var _buffers=buffers;return buffers=[],1==_buffers.length?_buffers[0]:Buffer.concat(_buffers)}if(buffers.length>1&&n<=(_length=buffers[0].length)){var buf=buffers[0].slice(0,n);return n===_length?buffers.shift():buffers[0]=buffers[0].slice(n,_length),length-=n,buf}if(nmax?cb(!0):void cb(null,i++)}}},function(module,exports,__webpack_require__){"use strict";module.exports=function(){return function(abort,cb){cb(!0)}}},function(module,exports,__webpack_require__){"use strict";module.exports=function(err){return function(abort,cb){cb(err)}}},function(module,exports,__webpack_require__){"use strict";module.exports={keys:__webpack_require__(742),once:__webpack_require__(300),values:__webpack_require__(160),count:__webpack_require__(737),infinite:__webpack_require__(741),empty:__webpack_require__(738),error:__webpack_require__(739)}},function(module,exports,__webpack_require__){"use strict";module.exports=function(generate){return generate=generate||Math.random,function(end,cb){return end?cb&&cb(end):cb(null,generate())}}},function(module,exports,__webpack_require__){"use strict";var values=__webpack_require__(160);module.exports=function(object){return values(Object.keys(object))}},function(module,exports,__webpack_require__){"use strict";function id(e){return e}var prop=__webpack_require__(85);module.exports=function(map){if(!map)return id;map=prop(map);var abortCb,aborted,busy=!1;return function(read){return function next(abort,cb){if(aborted)return cb(aborted);abort?(aborted=abort,busy?read(abort,function(){busy?abortCb=cb:cb(abort)}):read(abort,cb)):read(null,function(end,data){end?cb(end):aborted?cb(aborted):(busy=!0,map(data,function(err,data){busy=!1,aborted?(cb(aborted),abortCb(aborted)):err?next(err,cb):cb(null,data)}))})}}}},function(module,exports,__webpack_require__){"use strict";var tester=__webpack_require__(303),filter=__webpack_require__(161);module.exports=function(test){return test=tester(test),filter(function(data){return!test(data)})}},function(module,exports,__webpack_require__){"use strict";var values=__webpack_require__(160),once=__webpack_require__(300);module.exports=function(){return function(read){var _read;return function(abort,cb){function nextChunk(){_read(null,function(err,data){err===!0?nextStream():err?read(!0,function(abortErr){cb(err)}):cb(null,data)})}function nextStream(){_read=null,read(null,function(end,stream){if(end)return cb(end);Array.isArray(stream)||stream&&"object"==typeof stream?stream=values(stream):"function"!=typeof stream&&(stream=once(stream)),_read=stream,nextChunk()})}abort?_read?_read(abort,function(err){read(err||abort,cb)}):read(abort,cb):_read?nextChunk():nextStream()}}}},function(module,exports,__webpack_require__){"use strict";module.exports={map:__webpack_require__(747),asyncMap:__webpack_require__(743),filter:__webpack_require__(161),filterNot:__webpack_require__(744),through:__webpack_require__(750),take:__webpack_require__(749),unique:__webpack_require__(301),nonUnique:__webpack_require__(748),flatten:__webpack_require__(745)}},function(module,exports,__webpack_require__){"use strict";function id(e){return e}var prop=__webpack_require__(85);module.exports=function(mapper){return mapper?(mapper=prop(mapper),function(read){return function(abort,cb){read(abort,function(end,data){try{data=end?null:mapper(data)}catch(err){return read(err,function(){return cb(err)})}cb(end,data)})}}):id}},function(module,exports,__webpack_require__){"use strict";var unique=__webpack_require__(301);module.exports=function(field){return unique(field,!0)}},function(module,exports,__webpack_require__){"use strict";module.exports=function(test,opts){opts=opts||{};var last=opts.last||!1,ended=!1;if("number"==typeof test){last=!0;var n=test;test=function(){return--n}}return function(read){function terminate(cb){read(!0,function(err){last=!1,cb(err||!0)})}return function(end,cb){ended?last?terminate(cb):cb(ended):(ended=end)?read(ended,cb):read(null,function(end,data){(ended=ended||end)?cb(ended):test(data)?cb(null,data):(ended=!0,last?cb(null,data):terminate(cb))})}}}},function(module,exports,__webpack_require__){"use strict";module.exports=function(op,onEnd){function once(abort){!a&&onEnd&&(a=!0,onEnd(abort===!0?null:abort))}var a=!1;return function(read){return function(end,cb){return end&&once(end),read(end,function(end,data){end?once(end):op&&op(data),cb(end,data)})}}}},function(module,exports){module.exports=function(fn){var active=!1,called=0;return function(){if(called=!0,!active){for(active=!0;called;)called=!1,fn();active=!1}}}},function(module,exports,__webpack_require__){"use strict";function isFunction(f){return"function"==typeof f}var WebSocket=__webpack_require__(757),duplex=__webpack_require__(753),wsurl=__webpack_require__(758);module.exports=function(addr,opts){isFunction(opts)&&(opts={onConnect:opts});var location="undefined"==typeof window?{}:window.location,url=wsurl(addr,location),socket=new WebSocket(url),stream=duplex(socket,opts);return stream.remoteAddress=url,stream.close=function(cb){isFunction(cb)&&socket.addEventListener("close",cb),socket.close()},socket.addEventListener("open",function(e){opts&&isFunction(opts.onConnect)&&opts.onConnect(null,stream)}),stream},module.exports.connect=module.exports},function(module,exports,__webpack_require__){function duplex(ws,opts){var req=ws.upgradeReq||{};return opts&&opts.binaryType?ws.binaryType=opts.binaryType:opts&&opts.binary&&(ws.binaryType="arraybuffer"),{source:source(ws,opts&&opts.onConnect),sink:sink(ws,opts),headers:req.headers,url:req.url,upgrade:req.upgrade,method:req.method}}var source=__webpack_require__(756),sink=__webpack_require__(755);module.exports=duplex},function(module,exports){module.exports=function(socket,callback){function cleanup(){"function"==typeof remove&&(remove.call(socket,"open",handleOpen),remove.call(socket,"error",handleErr))}function handleOpen(evt){cleanup(),callback()}function handleErr(evt){cleanup(),callback(evt)}var remove=socket&&(socket.removeEventListener||socket.removeListener);return socket.readyState>=2?callback(!0):1===socket.readyState?callback():(socket.addEventListener("open",handleOpen),void socket.addEventListener("error",handleErr))}},function(module,exports,__webpack_require__){(function(setImmediate,process){var ready=__webpack_require__(754),nextTick=void 0!==setImmediate?setImmediate:process.nextTick;module.exports=function(socket,opts){return function(read){function next(end,data){if(end)return void(closeOnEnd&&socket.readyState<=1&&(onClose&&socket.addEventListener("close",function(ev){if(ev.wasClean||1006===ev.code)onClose();else{var err=new Error("ws error");err.event=ev,onClose(err)}}),socket.close()));ready(socket,function(end){if(end)return read(end,function(){});socket.send(data),nextTick(function(){read(null,next)})})}opts=opts||{};var closeOnEnd=opts.closeOnEnd!==!1,onClose="function"==typeof opts?opts:opts.onClose;read(null,next)}}}).call(exports,__webpack_require__(22).setImmediate,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(Buffer){module.exports=function(socket,cb){function read(abort,cb){if(receiver=null,ended)return cb(ended);abort?(receiver=cb,socket.close()):buffer.length>0?cb(null,buffer.shift()):receiver=cb}var receiver,ended,buffer=[],started=!1;return socket.addEventListener("message",function(evt){var data=evt.data;if(data instanceof ArrayBuffer&&(data=new Buffer(data)),receiver)return receiver(null,data);buffer.push(data)}),socket.addEventListener("close",function(evt){ended||receiver&&receiver(ended=!0)}),socket.addEventListener("error",function(evt){ended||(ended=evt,started||(started=!0,cb&&cb(evt)),receiver&&receiver(ended))}),socket.addEventListener("open",function(evt){started||ended||(started=!0)}),read}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){module.exports="undefined"==typeof WebSocket?__webpack_require__(863):WebSocket},function(module,exports,__webpack_require__){var rurl=__webpack_require__(767),map={http:"ws",https:"wss"};module.exports=function(url,location){return rurl(url,location,map,"ws")}},function(module,exports,__webpack_require__){var once=__webpack_require__(82),eos=__webpack_require__(415),fs=__webpack_require__(864),noop=function(){},isFn=function(fn){return"function"==typeof fn},isFS=function(stream){return!!fs&&((stream instanceof(fs.ReadStream||noop)||stream instanceof(fs.WriteStream||noop))&&isFn(stream.close))},isRequest=function(stream){return stream.setHeader&&isFn(stream.abort)},destroyer=function(stream,reading,writing,callback){callback=once(callback);var closed=!1;stream.on("close",function(){closed=!0}),eos(stream,{readable:reading,writable:writing},function(err){if(err)return callback(err);closed=!0,callback()});var destroyed=!1;return function(err){if(!closed&&!destroyed)return destroyed=!0,isFS(stream)?stream.close():isRequest(stream)?stream.abort():isFn(stream.destroy)?stream.destroy():void callback(err||new Error("stream was destroyed"))}},call=function(fn){fn()},pipe=function(from,to){return from.pipe(to)},pump=function(){var streams=Array.prototype.slice.call(arguments),callback=isFn(streams[streams.length-1]||noop)&&streams.pop()||noop;if(Array.isArray(streams[0])&&(streams=streams[0]),streams.length<2)throw new Error("pump requires two streams per minimum");var error,destroys=streams.map(function(stream,i){var reading=i0,function(err){error||(error=err),err&&destroys.forEach(call),reading||(destroys.forEach(call),callback(error))})});return streams.reduce(pipe)};module.exports=pump},function(module,exports,__webpack_require__){(function(module,global){var __WEBPACK_AMD_DEFINE_RESULT__;!function(root){function error(type){throw new RangeError(errors[type])}function map(array,fn){for(var length=array.length,result=[];length--;)result[length]=fn(array[length]);return result}function mapDomain(string,fn){var parts=string.split("@"),result="";return parts.length>1&&(result=parts[0]+"@",string=parts[1]),string=string.replace(regexSeparators,"."),result+map(string.split("."),fn).join(".")}function ucs2decode(string){for(var value,extra,output=[],counter=0,length=string.length;counter=55296&&value<=56319&&counter65535&&(value-=65536,output+=stringFromCharCode(value>>>10&1023|55296),value=56320|1023&value),output+=stringFromCharCode(value)}).join("")}function basicToDigit(codePoint){return codePoint-48<10?codePoint-22:codePoint-65<26?codePoint-65:codePoint-97<26?codePoint-97:base}function digitToBasic(digit,flag){return digit+22+75*(digit<26)-((0!=flag)<<5)}function adapt(delta,numPoints,firstTime){var k=0;for(delta=firstTime?floor(delta/damp):delta>>1,delta+=floor(delta/numPoints);delta>baseMinusTMin*tMax>>1;k+=base)delta=floor(delta/baseMinusTMin);return floor(k+(baseMinusTMin+1)*delta/(delta+skew))}function decode(input){var out,basic,j,index,oldi,w,k,digit,t,baseMinusT,output=[],inputLength=input.length,i=0,n=initialN,bias=initialBias;for(basic=input.lastIndexOf(delimiter),basic<0&&(basic=0),j=0;j=128&&error("not-basic"),output.push(input.charCodeAt(j));for(index=basic>0?basic+1:0;index=inputLength&&error("invalid-input"),digit=basicToDigit(input.charCodeAt(index++)),(digit>=base||digit>floor((maxInt-i)/w))&&error("overflow"),i+=digit*w,t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias,!(digitfloor(maxInt/baseMinusT)&&error("overflow"),w*=baseMinusT;out=output.length+1,bias=adapt(i-oldi,out,0==oldi),floor(i/out)>maxInt-n&&error("overflow"),n+=floor(i/out),i%=out,output.splice(i++,0,n)}return ucs2encode(output)}function encode(input){var n,delta,handledCPCount,basicLength,bias,j,m,q,k,t,currentValue,inputLength,handledCPCountPlusOne,baseMinusT,qMinusT,output=[];for(input=ucs2decode(input),inputLength=input.length,n=initialN,delta=0,bias=initialBias,j=0;j=n&¤tValuefloor((maxInt-delta)/handledCPCountPlusOne)&&error("overflow"),delta+=(m-n)*handledCPCountPlusOne,n=m,j=0;jmaxInt&&error("overflow"),currentValue==n){for(q=delta,k=base;t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias,!(q= 0x80 (not a basic code point)","invalid-input":"Invalid input"},baseMinusTMin=base-tMin,floor=Math.floor,stringFromCharCode=String.fromCharCode;punycode={version:"1.4.1",ucs2:{decode:ucs2decode,encode:ucs2encode},decode:decode,encode:encode,toASCII:toASCII,toUnicode:toUnicode},void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(){return punycode}.call(exports,__webpack_require__,exports,module))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)}()}).call(exports,__webpack_require__(23)(module),__webpack_require__(4))},function(module,exports,__webpack_require__){"use strict";function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}module.exports=function(qs,sep,eq,options){sep=sep||"&",eq=eq||"=";var obj={};if("string"!=typeof qs||0===qs.length)return obj;qs=qs.split(sep);var maxKeys=1e3;options&&"number"==typeof options.maxKeys&&(maxKeys=options.maxKeys);var len=qs.length;maxKeys>0&&len>maxKeys&&(len=maxKeys);for(var i=0;i=0?(kstr=x.substr(0,idx),vstr=x.substr(idx+1)):(kstr=x,vstr=""),k=decodeURIComponent(kstr),v=decodeURIComponent(vstr),hasOwnProperty(obj,k)?isArray(obj[k])?obj[k].push(v):obj[k]=[obj[k],v]:obj[k]=v}return obj};var isArray=Array.isArray||function(xs){return"[object Array]"===Object.prototype.toString.call(xs)}},function(module,exports,__webpack_require__){"use strict";function map(xs,f){if(xs.map)return xs.map(f);for(var res=[],i=0;i65536)throw new Error("requested too many random bytes");var rawBytes=new global.Uint8Array(size);size>0&&crypto.getRandomValues(rawBytes);var bytes=new Buffer(rawBytes.buffer);return"function"==typeof cb?process.nextTick(function(){cb(null,bytes)}):bytes}var crypto=global.crypto||global.msCrypto;crypto&&crypto.getRandomValues?module.exports=randomBytes:module.exports=oldBrowser}).call(exports,__webpack_require__(4),__webpack_require__(0).Buffer,__webpack_require__(2))},function(module,exports,__webpack_require__){function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}module.exports=PassThrough;var Transform=__webpack_require__(306),util=__webpack_require__(6);util.inherits=__webpack_require__(1),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},function(module,exports){module.exports=Array.isArray||function(arr){return"[object Array]"==Object.prototype.toString.call(arr)}},function(module,exports,__webpack_require__){var URL=__webpack_require__(167);module.exports=function(url,location,protocolMap,defaultProtocol){protocolMap=protocolMap||{};var proto,url=URL.parse(url,!1,!0);return url.protocol?proto=url.protocol:(proto=location.protocol?location.protocol.replace(/:$/,""):"http",proto=(protocolMap[proto]||defaultProtocol||proto)+":"),url.host&&":"===url.host[0]&&(url.host=null),url.hostname?URL.format({protocol:proto,slashes:!0,hostname:url.hostname,port:url.port,pathname:url.pathname,search:url.search}):(url.host=location.host,url.port?URL.format({protocol:proto,slashes:!0,host:location.hostname+":"+url.port,port:url.port,pathname:url.pathname,search:url.search}):url.pathname?URL.format({protocol:proto,slashes:!0,host:url.host,pathname:url.pathname,search:url.search}):(url.pathname=location.pathname,url.search?URL.format({protocol:proto,slashes:!0,host:url.host,pathname:url.pathname,search:url.search}):(url.search=location.search,url.format(url))))}},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(310)(__webpack_require__(774))},function(module,exports,__webpack_require__){"use strict";(function(Buffer){var toString=Object.prototype.toString;exports.isArray=function(value,message){if(!Array.isArray(value))throw TypeError(message)},exports.isBoolean=function(value,message){if("[object Boolean]"!==toString.call(value))throw TypeError(message)},exports.isBuffer=function(value,message){if(!Buffer.isBuffer(value))throw TypeError(message)},exports.isFunction=function(value,message){if("[object Function]"!==toString.call(value))throw TypeError(message)},exports.isNumber=function(value,message){if("[object Number]"!==toString.call(value))throw TypeError(message)},exports.isObject=function(value,message){if("[object Object]"!==toString.call(value))throw TypeError(message)},exports.isBufferLength=function(buffer,length,message){if(buffer.length!==length)throw RangeError(message)},exports.isBufferLength2=function(buffer,length1,length2,message){if(buffer.length!==length1&&buffer.length!==length2)throw RangeError(message)},exports.isLengthGTZero=function(value,message){if(0===value.length)throw RangeError(message)},exports.isNumberInInterval=function(number,x,y,message){if(number<=x||number>=y)throw RangeError(message)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){var bip66=__webpack_require__(363),EC_PRIVKEY_EXPORT_DER_COMPRESSED=new Buffer([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),EC_PRIVKEY_EXPORT_DER_UNCOMPRESSED=new Buffer([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),ZERO_BUFFER_32=new Buffer([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);exports.privateKeyExport=function(privateKey,publicKey,compressed){var result=new Buffer(compressed?EC_PRIVKEY_EXPORT_DER_COMPRESSED:EC_PRIVKEY_EXPORT_DER_UNCOMPRESSED);return privateKey.copy(result,compressed?8:9),publicKey.copy(result,compressed?181:214),result},exports.privateKeyImport=function(privateKey){var length=privateKey.length,index=0;if(!(length2||length1?privateKey[index+lenb-2]<<8:0);if(index+=lenb,!(length32||length1&&0===r[posR]&&!(128&r[posR+1]);--lenR,++posR);for(var s=Buffer.concat([new Buffer([0]),sigObj.s]),lenS=33,posS=0;lenS>1&&0===s[posS]&&!(128&s[posS+1]);--lenS,++posS);return bip66.encode(r.slice(posR),s.slice(posS))},exports.signatureImport=function(sig){var r=new Buffer(ZERO_BUFFER_32),s=new Buffer(ZERO_BUFFER_32);try{var sigObj=bip66.decode(sig);if(33===sigObj.r.length&&0===sigObj.r[0]&&(sigObj.r=sigObj.r.slice(1)),sigObj.r.length>32)throw new Error("R length is too long");if(33===sigObj.s.length&&0===sigObj.s[0]&&(sigObj.s=sigObj.s.slice(1)),sigObj.s.length>32)throw new Error("S length is too long")}catch(err){return}return sigObj.r.copy(r,32-sigObj.r.length),sigObj.s.copy(s,32-sigObj.s.length),{r:r,s:s}},exports.signatureImportLax=function(sig){var r=new Buffer(ZERO_BUFFER_32),s=new Buffer(ZERO_BUFFER_32),length=sig.length,index=0;if(48===sig[index++]){var lenbyte=sig[index++];if(!(128&lenbyte&&(index+=lenbyte-128)>length)&&2===sig[index++]){var rlen=sig[index++];if(128&rlen){if(lenbyte=rlen-128,index+lenbyte>length)return;for(;lenbyte>0&&0===sig[index];index+=1,lenbyte-=1);for(rlen=0;lenbyte>0;index+=1,lenbyte-=1)rlen=(rlen<<8)+sig[index]}if(!(rlen>length-index)){var rindex=index;if(index+=rlen,2===sig[index++]){var slen=sig[index++];if(128&slen){if(lenbyte=slen-128,index+lenbyte>length)return;for(;lenbyte>0&&0===sig[index];index+=1,lenbyte-=1);for(slen=0;lenbyte>0;index+=1,lenbyte-=1)slen=(slen<<8)+sig[index]}if(!(slen>length-index)){var sindex=index;for(index+=slen;rlen>0&&0===sig[rindex];rlen-=1,rindex+=1);if(!(rlen>32)){var rvalue=sig.slice(rindex,rindex+rlen);for(rvalue.copy(r,32-rvalue.length);slen>0&&0===sig[sindex];slen-=1,sindex+=1);if(!(slen>32)){var svalue=sig.slice(sindex,sindex+slen);return svalue.copy(s,32-svalue.length),{r:r,s:s}}}}}}}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function loadCompressedPublicKey(first,xBuffer){var x=new BN(xBuffer);if(x.cmp(ecparams.p)>=0)return null;x=x.toRed(ecparams.red);var y=x.redSqr().redIMul(x).redIAdd(ecparams.b).redSqrt();return 3===first!==y.isOdd()&&(y=y.redNeg()),ec.keyPair({pub:{x:x,y:y}})}function loadUncompressedPublicKey(first,xBuffer,yBuffer){var x=new BN(xBuffer),y=new BN(yBuffer);if(x.cmp(ecparams.p)>=0||y.cmp(ecparams.p)>=0)return null;if(x=x.toRed(ecparams.red),y=y.toRed(ecparams.red),(6===first||7===first)&&y.isOdd()!==(7===first))return null;var x3=x.redSqr().redIMul(x);return y.redSqr().redISub(x3.redIAdd(ecparams.b)).isZero()?ec.keyPair({pub:{x:x,y:y}}):null}function loadPublicKey(publicKey){var first=publicKey[0];switch(first){case 2:case 3:return 33!==publicKey.length?null:loadCompressedPublicKey(first,publicKey.slice(1,33));case 4:case 6:case 7:return 65!==publicKey.length?null:loadUncompressedPublicKey(first,publicKey.slice(1,33),publicKey.slice(33,65));default:return null}}var createHash=__webpack_require__(75),BN=__webpack_require__(20),EC=__webpack_require__(27).ec,messages=__webpack_require__(140),ec=new EC("secp256k1"),ecparams=ec.curve;exports.privateKeyVerify=function(privateKey){var bn=new BN(privateKey);return bn.cmp(ecparams.n)<0&&!bn.isZero()},exports.privateKeyExport=function(privateKey,compressed){var d=new BN(privateKey);if(d.cmp(ecparams.n)>=0||d.isZero())throw new Error(messages.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return new Buffer(ec.keyFromPrivate(privateKey).getPublic(compressed,!0))},exports.privateKeyTweakAdd=function(privateKey,tweak){var bn=new BN(tweak);if(bn.cmp(ecparams.n)>=0)throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(bn.iadd(new BN(privateKey)),bn.cmp(ecparams.n)>=0&&bn.isub(ecparams.n),bn.isZero())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return bn.toArrayLike(Buffer,"be",32)},exports.privateKeyTweakMul=function(privateKey,tweak){var bn=new BN(tweak);if(bn.cmp(ecparams.n)>=0||bn.isZero())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);return bn.imul(new BN(privateKey)),bn.cmp(ecparams.n)&&(bn=bn.umod(ecparams.n)),bn.toArrayLike(Buffer,"be",32)},exports.publicKeyCreate=function(privateKey,compressed){var d=new BN(privateKey);if(d.cmp(ecparams.n)>=0||d.isZero())throw new Error(messages.EC_PUBLIC_KEY_CREATE_FAIL);return new Buffer(ec.keyFromPrivate(privateKey).getPublic(compressed,!0))},exports.publicKeyConvert=function(publicKey,compressed){var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);return new Buffer(pair.getPublic(compressed,!0))},exports.publicKeyVerify=function(publicKey){return null!==loadPublicKey(publicKey)},exports.publicKeyTweakAdd=function(publicKey,tweak,compressed){var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);if(tweak=new BN(tweak),tweak.cmp(ecparams.n)>=0)throw new Error(messages.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return new Buffer(ecparams.g.mul(tweak).add(pair.pub).encode(!0,compressed))},exports.publicKeyTweakMul=function(publicKey,tweak,compressed){var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);if(tweak=new BN(tweak),tweak.cmp(ecparams.n)>=0||tweak.isZero())throw new Error(messages.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return new Buffer(pair.pub.mul(tweak).encode(!0,compressed))},exports.publicKeyCombine=function(publicKeys,compressed){for(var pairs=new Array(publicKeys.length),i=0;i=0||s.cmp(ecparams.n)>=0)throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);var result=new Buffer(signature);return 1===s.cmp(ec.nh)&&ecparams.n.sub(s).toArrayLike(Buffer,"be",32).copy(result,32),result},exports.signatureExport=function(signature){var r=signature.slice(0,32),s=signature.slice(32,64);if(new BN(r).cmp(ecparams.n)>=0||new BN(s).cmp(ecparams.n)>=0)throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);return{r:r,s:s}},exports.signatureImport=function(sigObj){var r=new BN(sigObj.r);r.cmp(ecparams.n)>=0&&(r=new BN(0));var s=new BN(sigObj.s);return s.cmp(ecparams.n)>=0&&(s=new BN(0)),Buffer.concat([r.toArrayLike(Buffer,"be",32),s.toArrayLike(Buffer,"be",32)])},exports.sign=function(message,privateKey,noncefn,data){if("function"==typeof noncefn){var getNonce=noncefn;noncefn=function(counter){var nonce=getNonce(message,privateKey,null,data,counter);if(!Buffer.isBuffer(nonce)||32!==nonce.length)throw new Error(messages.ECDSA_SIGN_FAIL);return new BN(nonce)}}var d=new BN(privateKey);if(d.cmp(ecparams.n)>=0||d.isZero())throw new Error(messages.ECDSA_SIGN_FAIL);var result=ec.sign(message,privateKey,{canonical:!0,k:noncefn,pers:data});return{signature:Buffer.concat([result.r.toArrayLike(Buffer,"be",32),result.s.toArrayLike(Buffer,"be",32)]),recovery:result.recoveryParam}},exports.verify=function(message,signature,publicKey){var sigObj={r:signature.slice(0,32),s:signature.slice(32,64)},sigr=new BN(sigObj.r),sigs=new BN(sigObj.s);if(sigr.cmp(ecparams.n)>=0||sigs.cmp(ecparams.n)>=0)throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);if(1===sigs.cmp(ec.nh)||sigr.isZero()||sigs.isZero())return!1;var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);return ec.verify(message,sigObj,{x:pair.pub.x,y:pair.pub.y})},exports.recover=function(message,signature,recovery,compressed){var sigObj={r:signature.slice(0,32),s:signature.slice(32,64)},sigr=new BN(sigObj.r),sigs=new BN(sigObj.s);if(sigr.cmp(ecparams.n)>=0||sigs.cmp(ecparams.n)>=0)throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);try{if(sigr.isZero()||sigs.isZero())throw new Error;return new Buffer(ec.recoverPubKey(message,sigObj,recovery).encode(!0,compressed))}catch(err){throw new Error(messages.ECDSA_RECOVER_FAIL)}},exports.ecdh=function(publicKey,privateKey){var shared=exports.ecdhUnsafe(publicKey,privateKey,!0);return createHash("sha256").update(shared).digest()},exports.ecdhUnsafe=function(publicKey,privateKey,compressed){var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);var scalar=new BN(privateKey);if(scalar.cmp(ecparams.n)>=0||scalar.isZero())throw new Error(messages.ECDH_FAIL);return new Buffer(pair.pub.mul(scalar).encode(!0,compressed))}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.umulTo10x10=function(num1,num2,out){var lo,mid,hi,a=num1.words,b=num2.words,o=out.words,c=0,a0=0|a[0],al0=8191&a0,ah0=a0>>>13,a1=0|a[1],al1=8191&a1,ah1=a1>>>13,a2=0|a[2],al2=8191&a2,ah2=a2>>>13,a3=0|a[3],al3=8191&a3,ah3=a3>>>13,a4=0|a[4],al4=8191&a4,ah4=a4>>>13,a5=0|a[5],al5=8191&a5,ah5=a5>>>13,a6=0|a[6],al6=8191&a6,ah6=a6>>>13,a7=0|a[7],al7=8191&a7,ah7=a7>>>13,a8=0|a[8],al8=8191&a8,ah8=a8>>>13,a9=0|a[9],al9=8191&a9,ah9=a9>>>13,b0=0|b[0],bl0=8191&b0,bh0=b0>>>13,b1=0|b[1],bl1=8191&b1,bh1=b1>>>13,b2=0|b[2],bl2=8191&b2,bh2=b2>>>13,b3=0|b[3],bl3=8191&b3,bh3=b3>>>13,b4=0|b[4],bl4=8191&b4,bh4=b4>>>13,b5=0|b[5],bl5=8191&b5,bh5=b5>>>13,b6=0|b[6],bl6=8191&b6,bh6=b6>>>13,b7=0|b[7],bl7=8191&b7,bh7=b7>>>13,b8=0|b[8],bl8=8191&b8,bh8=b8>>>13,b9=0|b[9],bl9=8191&b9,bh9=b9>>>13;out.length=19,lo=Math.imul(al0,bl0),mid=Math.imul(al0,bh0),mid+=Math.imul(ah0,bl0),hi=Math.imul(ah0,bh0);var w0=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w0>>>26),w0&=67108863,lo=Math.imul(al1,bl0),mid=Math.imul(al1,bh0),mid+=Math.imul(ah1,bl0),hi=Math.imul(ah1,bh0),lo+=Math.imul(al0,bl1),mid+=Math.imul(al0,bh1),mid+=Math.imul(ah0,bl1),hi+=Math.imul(ah0,bh1);var w1=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w1>>>26),w1&=67108863,lo=Math.imul(al2,bl0),mid=Math.imul(al2,bh0),mid+=Math.imul(ah2,bl0),hi=Math.imul(ah2,bh0),lo+=Math.imul(al1,bl1),mid+=Math.imul(al1,bh1),mid+=Math.imul(ah1,bl1),hi+=Math.imul(ah1,bh1),lo+=Math.imul(al0,bl2),mid+=Math.imul(al0,bh2),mid+=Math.imul(ah0,bl2),hi+=Math.imul(ah0,bh2);var w2=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w2>>>26),w2&=67108863,lo=Math.imul(al3,bl0),mid=Math.imul(al3,bh0),mid+=Math.imul(ah3,bl0),hi=Math.imul(ah3,bh0),lo+=Math.imul(al2,bl1),mid+=Math.imul(al2,bh1),mid+=Math.imul(ah2,bl1),hi+=Math.imul(ah2,bh1),lo+=Math.imul(al1,bl2),mid+=Math.imul(al1,bh2),mid+=Math.imul(ah1,bl2),hi+=Math.imul(ah1,bh2),lo+=Math.imul(al0,bl3),mid+=Math.imul(al0,bh3),mid+=Math.imul(ah0,bl3),hi+=Math.imul(ah0,bh3);var w3=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w3>>>26),w3&=67108863,lo=Math.imul(al4,bl0),mid=Math.imul(al4,bh0),mid+=Math.imul(ah4,bl0),hi=Math.imul(ah4,bh0),lo+=Math.imul(al3,bl1),mid+=Math.imul(al3,bh1),mid+=Math.imul(ah3,bl1),hi+=Math.imul(ah3,bh1),lo+=Math.imul(al2,bl2),mid+=Math.imul(al2,bh2),mid+=Math.imul(ah2,bl2),hi+=Math.imul(ah2,bh2),lo+=Math.imul(al1,bl3),mid+=Math.imul(al1,bh3),mid+=Math.imul(ah1,bl3),hi+=Math.imul(ah1,bh3),lo+=Math.imul(al0,bl4),mid+=Math.imul(al0,bh4),mid+=Math.imul(ah0,bl4),hi+=Math.imul(ah0,bh4);var w4=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w4>>>26),w4&=67108863,lo=Math.imul(al5,bl0),mid=Math.imul(al5,bh0),mid+=Math.imul(ah5,bl0),hi=Math.imul(ah5,bh0),lo+=Math.imul(al4,bl1),mid+=Math.imul(al4,bh1),mid+=Math.imul(ah4,bl1),hi+=Math.imul(ah4,bh1),lo+=Math.imul(al3,bl2),mid+=Math.imul(al3,bh2),mid+=Math.imul(ah3,bl2),hi+=Math.imul(ah3,bh2),lo+=Math.imul(al2,bl3),mid+=Math.imul(al2,bh3),mid+=Math.imul(ah2,bl3),hi+=Math.imul(ah2,bh3),lo+=Math.imul(al1,bl4),mid+=Math.imul(al1,bh4),mid+=Math.imul(ah1,bl4),hi+=Math.imul(ah1,bh4),lo+=Math.imul(al0,bl5),mid+=Math.imul(al0,bh5),mid+=Math.imul(ah0,bl5),hi+=Math.imul(ah0,bh5);var w5=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w5>>>26),w5&=67108863,lo=Math.imul(al6,bl0),mid=Math.imul(al6,bh0),mid+=Math.imul(ah6,bl0),hi=Math.imul(ah6,bh0),lo+=Math.imul(al5,bl1),mid+=Math.imul(al5,bh1),mid+=Math.imul(ah5,bl1),hi+=Math.imul(ah5,bh1),lo+=Math.imul(al4,bl2),mid+=Math.imul(al4,bh2),mid+=Math.imul(ah4,bl2),hi+=Math.imul(ah4,bh2),lo+=Math.imul(al3,bl3),mid+=Math.imul(al3,bh3),mid+=Math.imul(ah3,bl3),hi+=Math.imul(ah3,bh3),lo+=Math.imul(al2,bl4),mid+=Math.imul(al2,bh4),mid+=Math.imul(ah2,bl4),hi+=Math.imul(ah2,bh4),lo+=Math.imul(al1,bl5),mid+=Math.imul(al1,bh5),mid+=Math.imul(ah1,bl5),hi+=Math.imul(ah1,bh5),lo+=Math.imul(al0,bl6),mid+=Math.imul(al0,bh6),mid+=Math.imul(ah0,bl6),hi+=Math.imul(ah0,bh6);var w6=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w6>>>26),w6&=67108863,lo=Math.imul(al7,bl0),mid=Math.imul(al7,bh0),mid+=Math.imul(ah7,bl0),hi=Math.imul(ah7,bh0),lo+=Math.imul(al6,bl1),mid+=Math.imul(al6,bh1),mid+=Math.imul(ah6,bl1),hi+=Math.imul(ah6,bh1),lo+=Math.imul(al5,bl2),mid+=Math.imul(al5,bh2),mid+=Math.imul(ah5,bl2),hi+=Math.imul(ah5,bh2),lo+=Math.imul(al4,bl3),mid+=Math.imul(al4,bh3),mid+=Math.imul(ah4,bl3),hi+=Math.imul(ah4,bh3),lo+=Math.imul(al3,bl4),mid+=Math.imul(al3,bh4),mid+=Math.imul(ah3,bl4),hi+=Math.imul(ah3,bh4),lo+=Math.imul(al2,bl5),mid+=Math.imul(al2,bh5),mid+=Math.imul(ah2,bl5),hi+=Math.imul(ah2,bh5),lo+=Math.imul(al1,bl6),mid+=Math.imul(al1,bh6),mid+=Math.imul(ah1,bl6),hi+=Math.imul(ah1,bh6),lo+=Math.imul(al0,bl7),mid+=Math.imul(al0,bh7),mid+=Math.imul(ah0,bl7),hi+=Math.imul(ah0,bh7);var w7=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w7>>>26),w7&=67108863,lo=Math.imul(al8,bl0),mid=Math.imul(al8,bh0),mid+=Math.imul(ah8,bl0),hi=Math.imul(ah8,bh0),lo+=Math.imul(al7,bl1),mid+=Math.imul(al7,bh1),mid+=Math.imul(ah7,bl1),hi+=Math.imul(ah7,bh1),lo+=Math.imul(al6,bl2),mid+=Math.imul(al6,bh2),mid+=Math.imul(ah6,bl2),hi+=Math.imul(ah6,bh2),lo+=Math.imul(al5,bl3),mid+=Math.imul(al5,bh3),mid+=Math.imul(ah5,bl3),hi+=Math.imul(ah5,bh3),lo+=Math.imul(al4,bl4),mid+=Math.imul(al4,bh4),mid+=Math.imul(ah4,bl4),hi+=Math.imul(ah4,bh4),lo+=Math.imul(al3,bl5),mid+=Math.imul(al3,bh5),mid+=Math.imul(ah3,bl5),hi+=Math.imul(ah3,bh5),lo+=Math.imul(al2,bl6),mid+=Math.imul(al2,bh6),mid+=Math.imul(ah2,bl6),hi+=Math.imul(ah2,bh6),lo+=Math.imul(al1,bl7),mid+=Math.imul(al1,bh7),mid+=Math.imul(ah1,bl7),hi+=Math.imul(ah1,bh7),lo+=Math.imul(al0,bl8),mid+=Math.imul(al0,bh8),mid+=Math.imul(ah0,bl8),hi+=Math.imul(ah0,bh8);var w8=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w8>>>26),w8&=67108863,lo=Math.imul(al9,bl0),mid=Math.imul(al9,bh0),mid+=Math.imul(ah9,bl0),hi=Math.imul(ah9,bh0),lo+=Math.imul(al8,bl1),mid+=Math.imul(al8,bh1),mid+=Math.imul(ah8,bl1),hi+=Math.imul(ah8,bh1),lo+=Math.imul(al7,bl2),mid+=Math.imul(al7,bh2),mid+=Math.imul(ah7,bl2),hi+=Math.imul(ah7,bh2),lo+=Math.imul(al6,bl3),mid+=Math.imul(al6,bh3),mid+=Math.imul(ah6,bl3),hi+=Math.imul(ah6,bh3),lo+=Math.imul(al5,bl4),mid+=Math.imul(al5,bh4),mid+=Math.imul(ah5,bl4),hi+=Math.imul(ah5,bh4),lo+=Math.imul(al4,bl5),mid+=Math.imul(al4,bh5),mid+=Math.imul(ah4,bl5),hi+=Math.imul(ah4,bh5),lo+=Math.imul(al3,bl6),mid+=Math.imul(al3,bh6),mid+=Math.imul(ah3,bl6),hi+=Math.imul(ah3,bh6),lo+=Math.imul(al2,bl7),mid+=Math.imul(al2,bh7),mid+=Math.imul(ah2,bl7),hi+=Math.imul(ah2,bh7),lo+=Math.imul(al1,bl8),mid+=Math.imul(al1,bh8),mid+=Math.imul(ah1,bl8),hi+=Math.imul(ah1,bh8),lo+=Math.imul(al0,bl9),mid+=Math.imul(al0,bh9),mid+=Math.imul(ah0,bl9),hi+=Math.imul(ah0,bh9);var w9=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w9>>>26),w9&=67108863,lo=Math.imul(al9,bl1),mid=Math.imul(al9,bh1),mid+=Math.imul(ah9,bl1),hi=Math.imul(ah9,bh1),lo+=Math.imul(al8,bl2),mid+=Math.imul(al8,bh2),mid+=Math.imul(ah8,bl2),hi+=Math.imul(ah8,bh2),lo+=Math.imul(al7,bl3),mid+=Math.imul(al7,bh3),mid+=Math.imul(ah7,bl3),hi+=Math.imul(ah7,bh3),lo+=Math.imul(al6,bl4),mid+=Math.imul(al6,bh4),mid+=Math.imul(ah6,bl4),hi+=Math.imul(ah6,bh4),lo+=Math.imul(al5,bl5),mid+=Math.imul(al5,bh5),mid+=Math.imul(ah5,bl5),hi+=Math.imul(ah5,bh5),lo+=Math.imul(al4,bl6),mid+=Math.imul(al4,bh6),mid+=Math.imul(ah4,bl6),hi+=Math.imul(ah4,bh6),lo+=Math.imul(al3,bl7),mid+=Math.imul(al3,bh7),mid+=Math.imul(ah3,bl7),hi+=Math.imul(ah3,bh7),lo+=Math.imul(al2,bl8),mid+=Math.imul(al2,bh8),mid+=Math.imul(ah2,bl8),hi+=Math.imul(ah2,bh8),lo+=Math.imul(al1,bl9),mid+=Math.imul(al1,bh9),mid+=Math.imul(ah1,bl9),hi+=Math.imul(ah1,bh9);var w10=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w10>>>26),w10&=67108863,lo=Math.imul(al9,bl2),mid=Math.imul(al9,bh2),mid+=Math.imul(ah9,bl2),hi=Math.imul(ah9,bh2),lo+=Math.imul(al8,bl3),mid+=Math.imul(al8,bh3),mid+=Math.imul(ah8,bl3),hi+=Math.imul(ah8,bh3),lo+=Math.imul(al7,bl4),mid+=Math.imul(al7,bh4),mid+=Math.imul(ah7,bl4),hi+=Math.imul(ah7,bh4),lo+=Math.imul(al6,bl5),mid+=Math.imul(al6,bh5),mid+=Math.imul(ah6,bl5),hi+=Math.imul(ah6,bh5),lo+=Math.imul(al5,bl6),mid+=Math.imul(al5,bh6),mid+=Math.imul(ah5,bl6),hi+=Math.imul(ah5,bh6),lo+=Math.imul(al4,bl7),mid+=Math.imul(al4,bh7),mid+=Math.imul(ah4,bl7),hi+=Math.imul(ah4,bh7),lo+=Math.imul(al3,bl8),mid+=Math.imul(al3,bh8),mid+=Math.imul(ah3,bl8),hi+=Math.imul(ah3,bh8),lo+=Math.imul(al2,bl9),mid+=Math.imul(al2,bh9),mid+=Math.imul(ah2,bl9),hi+=Math.imul(ah2,bh9);var w11=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w11>>>26),w11&=67108863,lo=Math.imul(al9,bl3),mid=Math.imul(al9,bh3),mid+=Math.imul(ah9,bl3),hi=Math.imul(ah9,bh3),lo+=Math.imul(al8,bl4),mid+=Math.imul(al8,bh4),mid+=Math.imul(ah8,bl4),hi+=Math.imul(ah8,bh4),lo+=Math.imul(al7,bl5),mid+=Math.imul(al7,bh5),mid+=Math.imul(ah7,bl5),hi+=Math.imul(ah7,bh5),lo+=Math.imul(al6,bl6),mid+=Math.imul(al6,bh6),mid+=Math.imul(ah6,bl6),hi+=Math.imul(ah6,bh6),lo+=Math.imul(al5,bl7),mid+=Math.imul(al5,bh7),mid+=Math.imul(ah5,bl7),hi+=Math.imul(ah5,bh7),lo+=Math.imul(al4,bl8),mid+=Math.imul(al4,bh8),mid+=Math.imul(ah4,bl8),hi+=Math.imul(ah4,bh8),lo+=Math.imul(al3,bl9),mid+=Math.imul(al3,bh9),mid+=Math.imul(ah3,bl9),hi+=Math.imul(ah3,bh9);var w12=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w12>>>26),w12&=67108863,lo=Math.imul(al9,bl4),mid=Math.imul(al9,bh4),mid+=Math.imul(ah9,bl4),hi=Math.imul(ah9,bh4),lo+=Math.imul(al8,bl5),mid+=Math.imul(al8,bh5),mid+=Math.imul(ah8,bl5),hi+=Math.imul(ah8,bh5),lo+=Math.imul(al7,bl6),mid+=Math.imul(al7,bh6),mid+=Math.imul(ah7,bl6),hi+=Math.imul(ah7,bh6),lo+=Math.imul(al6,bl7),mid+=Math.imul(al6,bh7),mid+=Math.imul(ah6,bl7),hi+=Math.imul(ah6,bh7),lo+=Math.imul(al5,bl8),mid+=Math.imul(al5,bh8),mid+=Math.imul(ah5,bl8),hi+=Math.imul(ah5,bh8),lo+=Math.imul(al4,bl9),mid+=Math.imul(al4,bh9),mid+=Math.imul(ah4,bl9),hi+=Math.imul(ah4,bh9);var w13=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w13>>>26),w13&=67108863,lo=Math.imul(al9,bl5),mid=Math.imul(al9,bh5),mid+=Math.imul(ah9,bl5),hi=Math.imul(ah9,bh5),lo+=Math.imul(al8,bl6),mid+=Math.imul(al8,bh6),mid+=Math.imul(ah8,bl6),hi+=Math.imul(ah8,bh6),lo+=Math.imul(al7,bl7),mid+=Math.imul(al7,bh7),mid+=Math.imul(ah7,bl7),hi+=Math.imul(ah7,bh7),lo+=Math.imul(al6,bl8),mid+=Math.imul(al6,bh8),mid+=Math.imul(ah6,bl8),hi+=Math.imul(ah6,bh8),lo+=Math.imul(al5,bl9),mid+=Math.imul(al5,bh9),mid+=Math.imul(ah5,bl9),hi+=Math.imul(ah5,bh9);var w14=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w14>>>26),w14&=67108863,lo=Math.imul(al9,bl6),mid=Math.imul(al9,bh6),mid+=Math.imul(ah9,bl6),hi=Math.imul(ah9,bh6),lo+=Math.imul(al8,bl7),mid+=Math.imul(al8,bh7),mid+=Math.imul(ah8,bl7),hi+=Math.imul(ah8,bh7),lo+=Math.imul(al7,bl8),mid+=Math.imul(al7,bh8),mid+=Math.imul(ah7,bl8),hi+=Math.imul(ah7,bh8),lo+=Math.imul(al6,bl9),mid+=Math.imul(al6,bh9),mid+=Math.imul(ah6,bl9),hi+=Math.imul(ah6,bh9);var w15=c+lo+((8191&mid)<<13) +;c=hi+(mid>>>13)+(w15>>>26),w15&=67108863,lo=Math.imul(al9,bl7),mid=Math.imul(al9,bh7),mid+=Math.imul(ah9,bl7),hi=Math.imul(ah9,bh7),lo+=Math.imul(al8,bl8),mid+=Math.imul(al8,bh8),mid+=Math.imul(ah8,bl8),hi+=Math.imul(ah8,bh8),lo+=Math.imul(al7,bl9),mid+=Math.imul(al7,bh9),mid+=Math.imul(ah7,bl9),hi+=Math.imul(ah7,bh9);var w16=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w16>>>26),w16&=67108863,lo=Math.imul(al9,bl8),mid=Math.imul(al9,bh8),mid+=Math.imul(ah9,bl8),hi=Math.imul(ah9,bh8),lo+=Math.imul(al8,bl9),mid+=Math.imul(al8,bh9),mid+=Math.imul(ah8,bl9),hi+=Math.imul(ah8,bh9);var w17=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w17>>>26),w17&=67108863,lo=Math.imul(al9,bl9),mid=Math.imul(al9,bh9),mid+=Math.imul(ah9,bl9),hi=Math.imul(ah9,bh9);var w18=c+lo+((8191&mid)<<13);return c=hi+(mid>>>13)+(w18>>>26),w18&=67108863,o[0]=w0,o[1]=w1,o[2]=w2,o[3]=w3,o[4]=w4,o[5]=w5,o[6]=w6,o[7]=w7,o[8]=w8,o[9]=w9,o[10]=w10,o[11]=w11,o[12]=w12,o[13]=w13,o[14]=w14,o[15]=w15,o[16]=w16,o[17]=w17,o[18]=w18,0!==c&&(o[19]=c,out.length++),out}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function ECPointG(){this.x=BN.fromBuffer(new Buffer("79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","hex")),this.y=BN.fromBuffer(new Buffer("483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8","hex")),this.inf=!1,this._precompute()}var BN=__webpack_require__(118),ECPoint=__webpack_require__(312),ECJPoint=__webpack_require__(311);ECPointG.prototype._precompute=function(){for(var ecpoint=new ECPoint(this.x,this.y),points=new Array(1+Math.ceil(64.25)),acc=points[0]=ecpoint,i=1;i=j;k--)nafW=(nafW<<1)+naf[k];repr.push(nafW)}for(var a=new ECJPoint(null,null,null),b=new ECJPoint(null,null,null),i=I;i>0;i--){for(var jj=0;jj=0;i--){for(var k=0;i>=0&&(tmp[0]=0|naf[0][i],tmp[1]=0|naf[1][i],0===tmp[0]&&0===tmp[1]);++k,--i);if(i>=0&&(k+=1),acc=acc.dblp(k),i<0)break;for(var jj=0;jj<2;jj++){var p,z=tmp[jj];0!==z&&(z>0?p=wnd[jj][z>>1]:z<0&&(p=wnd[jj][-z>>1].neg()),acc=void 0===p.z?acc.mixedAdd(p):acc.add(p))}}return acc},module.exports=new ECPointG}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){var createHash=__webpack_require__(75),HmacDRBG=__webpack_require__(395),messages=__webpack_require__(140),BN=__webpack_require__(118),ECPoint=__webpack_require__(312),g=__webpack_require__(773);exports.privateKeyVerify=function(privateKey){var bn=BN.fromBuffer(privateKey);return!(bn.isOverflow()||bn.isZero())},exports.privateKeyExport=function(privateKey,compressed){var d=BN.fromBuffer(privateKey);if(d.isOverflow()||d.isZero())throw new Error(messages.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return g.mul(d).toPublicKey(compressed)},exports.privateKeyTweakAdd=function(privateKey,tweak){var bn=BN.fromBuffer(tweak);if(bn.isOverflow())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(bn.iadd(BN.fromBuffer(privateKey)),bn.isOverflow()&&bn.isub(BN.n),bn.isZero())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return bn.toBuffer()},exports.privateKeyTweakMul=function(privateKey,tweak){var bn=BN.fromBuffer(tweak);if(bn.isOverflow()||bn.isZero())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);var d=BN.fromBuffer(privateKey);return bn.umul(d).ureduce().toBuffer()},exports.publicKeyCreate=function(privateKey,compressed){var d=BN.fromBuffer(privateKey);if(d.isOverflow()||d.isZero())throw new Error(messages.EC_PUBLIC_KEY_CREATE_FAIL);return g.mul(d).toPublicKey(compressed)},exports.publicKeyConvert=function(publicKey,compressed){var point=ECPoint.fromPublicKey(publicKey);if(null===point)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);return point.toPublicKey(compressed)},exports.publicKeyVerify=function(publicKey){return null!==ECPoint.fromPublicKey(publicKey)},exports.publicKeyTweakAdd=function(publicKey,tweak,compressed){var point=ECPoint.fromPublicKey(publicKey);if(null===point)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);if(tweak=BN.fromBuffer(tweak),tweak.isOverflow())throw new Error(messages.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return g.mul(tweak).add(point).toPublicKey(compressed)},exports.publicKeyTweakMul=function(publicKey,tweak,compressed){var point=ECPoint.fromPublicKey(publicKey);if(null===point)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);if(tweak=BN.fromBuffer(tweak),tweak.isOverflow()||tweak.isZero())throw new Error(messages.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return point.mul(tweak).toPublicKey(compressed)},exports.publicKeyCombine=function(publicKeys,compressed){for(var points=new Array(publicKeys.length),i=0;i=0)&&0===sigr.iadd(BN.psn).redMul(z2).ucmp(point.x)},exports.recover=function(message,signature,recovery,compressed){var sigr=BN.fromBuffer(signature.slice(0,32)),sigs=BN.fromBuffer(signature.slice(32,64));if(sigr.isOverflow()||sigs.isOverflow())throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);do{if(sigr.isZero()||sigs.isZero())break;var kpx=sigr;if(recovery>>1){if(kpx.ucmp(BN.psn)>=0)break;kpx=sigr.add(BN.n)}var kpPublicKey=Buffer.concat([new Buffer([2+(1&recovery)]),kpx.toBuffer()]),kp=ECPoint.fromPublicKey(kpPublicKey);if(null===kp)break;var rInv=sigr.uinvm(),s1=BN.n.sub(BN.fromBuffer(message)).umul(rInv).ureduce(),s2=sigs.umul(rInv).ureduce();return ECPoint.fromECJPoint(g.mulAdd(s1,kp,s2)).toPublicKey(compressed)}while(!1);throw new Error(messages.ECDSA_RECOVER_FAIL)},exports.ecdh=function(publicKey,privateKey){var shared=exports.ecdhUnsafe(publicKey,privateKey,!0);return createHash("sha256").update(shared).digest()},exports.ecdhUnsafe=function(publicKey,privateKey,compressed){var point=ECPoint.fromPublicKey(publicKey);if(null===point)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);var scalar=BN.fromBuffer(privateKey);if(scalar.isOverflow()||scalar.isZero())throw new Error(messages.ECDH_FAIL);return point.mul(scalar).toPublicKey(compressed)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(global,process){!function(global,undefined){"use strict";function setImmediate(callback){"function"!=typeof callback&&(callback=new Function(""+callback));for(var args=new Array(arguments.length-1),i=0;i>>27}function rotl30(num){return num<<30|num>>>2}function ft(s,b,c,d){return 0===s?b&c|~b&d:2===s?b&c|b&d|c&d:b^c^d}var inherits=__webpack_require__(1),Hash=__webpack_require__(69),K=[1518500249,1859775393,-1894007588,-899497514],W=new Array(80);inherits(Sha,Hash),Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha.prototype._update=function(M){for(var W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<80;++i)W[i]=W[i-3]^W[i-8]^W[i-14]^W[i-16];for(var j=0;j<80;++j){var s=~~(j/20),t=rotl5(a)+ft(s,b,c,d)+e+W[j]+K[s]|0;e=d,d=c,c=rotl30(b),b=a,a=t}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0},Sha.prototype._hash=function(){var H=new Buffer(20);return H.writeInt32BE(0|this._a,0),H.writeInt32BE(0|this._b,4),H.writeInt32BE(0|this._c,8),H.writeInt32BE(0|this._d,12),H.writeInt32BE(0|this._e,16),H},module.exports=Sha}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Sha1(){this.init(),this._w=W,Hash.call(this,64,56)}function rotl1(num){return num<<1|num>>>31}function rotl5(num){return num<<5|num>>>27}function rotl30(num){return num<<30|num>>>2}function ft(s,b,c,d){return 0===s?b&c|~b&d:2===s?b&c|b&d|c&d:b^c^d}var inherits=__webpack_require__(1),Hash=__webpack_require__(69),K=[1518500249,1859775393,-1894007588,-899497514],W=new Array(80);inherits(Sha1,Hash),Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha1.prototype._update=function(M){for(var W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<80;++i)W[i]=rotl1(W[i-3]^W[i-8]^W[i-14]^W[i-16]);for(var j=0;j<80;++j){var s=~~(j/20),t=rotl5(a)+ft(s,b,c,d)+e+W[j]+K[s]|0;e=d,d=c,c=rotl30(b),b=a,a=t}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0},Sha1.prototype._hash=function(){var H=new Buffer(20);return H.writeInt32BE(0|this._a,0),H.writeInt32BE(0|this._b,4),H.writeInt32BE(0|this._c,8),H.writeInt32BE(0|this._d,12),H.writeInt32BE(0|this._e,16),H},module.exports=Sha1}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Sha224(){this.init(),this._w=W,Hash.call(this,64,56)}var inherits=__webpack_require__(1),Sha256=__webpack_require__(314),Hash=__webpack_require__(69),W=new Array(64);inherits(Sha224,Sha256),Sha224.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},Sha224.prototype._hash=function(){var H=new Buffer(28);return H.writeInt32BE(this._a,0),H.writeInt32BE(this._b,4),H.writeInt32BE(this._c,8),H.writeInt32BE(this._d,12),H.writeInt32BE(this._e,16),H.writeInt32BE(this._f,20),H.writeInt32BE(this._g,24),H},module.exports=Sha224}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Sha384(){this.init(),this._w=W,Hash.call(this,128,112)}var inherits=__webpack_require__(1),SHA512=__webpack_require__(315),Hash=__webpack_require__(69),W=new Array(160);inherits(Sha384,SHA512),Sha384.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},Sha384.prototype._hash=function(){function writeInt64BE(h,l,offset){H.writeInt32BE(h,offset),H.writeInt32BE(l,offset+4)}var H=new Buffer(48);return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),H},module.exports=Sha384}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){var varint=__webpack_require__(16);exports.encode=function encode(v,b,o){v=v>=0?2*v:v*-2-1;var r=varint.encode(v,b,o);return encode.bytes=varint.encode.bytes,r},exports.decode=function decode(b,o){var v=varint.decode(b,o);return decode.bytes=varint.decode.bytes,1&v?(v+1)/-2:v/2},exports.encodingLength=function(v){return varint.encodingLength(v>=0?2*v:v*-2-1)}},function(module,exports,__webpack_require__){(function(Buffer){function Peer(opts){var self=this;if(!(self instanceof Peer))return new Peer(opts);if(self._id=randombytes(4).toString("hex").slice(0,7),self._debug("new peer %o",opts),opts=Object.assign({allowHalfOpen:!1},opts),stream.Duplex.call(self,opts),self.channelName=opts.initiator?opts.channelName||randombytes(20).toString("hex"):null,self._isChromium="undefined"!=typeof window&&!!window.webkitRTCPeerConnection,self.initiator=opts.initiator||!1,self.channelConfig=opts.channelConfig||Peer.channelConfig,self.config=opts.config||Peer.config,self.constraints=self._transformConstraints(opts.constraints||Peer.constraints),self.offerConstraints=self._transformConstraints(opts.offerConstraints||{}),self.answerConstraints=self._transformConstraints(opts.answerConstraints||{}),self.reconnectTimer=opts.reconnectTimer||!1,self.sdpTransform=opts.sdpTransform||function(sdp){return sdp},self.stream=opts.stream||!1,self.trickle=void 0===opts.trickle||opts.trickle,self.destroyed=!1,self.connected=!1,self.remoteAddress=void 0,self.remoteFamily=void 0,self.remotePort=void 0,self.localAddress=void 0,self.localPort=void 0,self._wrtc=opts.wrtc&&"object"==typeof opts.wrtc?opts.wrtc:getBrowserRTC(),!self._wrtc)throw"undefined"==typeof window?new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"):new Error("No WebRTC support: Not a supported browser");if(self._pcReady=!1,self._channelReady=!1,self._iceComplete=!1,self._channel=null,self._pendingCandidates=[],self._previousStreams=[],self._chunk=null,self._cb=null,self._interval=null,self._reconnectTimeout=null,self._pc=new self._wrtc.RTCPeerConnection(self.config,self.constraints),self._isWrtc=Array.isArray(self._pc.RTCIceConnectionStates),self._isReactNativeWebrtc="number"==typeof self._pc._peerConnectionId,self._pc.oniceconnectionstatechange=function(){self._onIceStateChange()},self._pc.onicegatheringstatechange=function(){self._onIceStateChange()},self._pc.onsignalingstatechange=function(){self._onSignalingStateChange()},self._pc.onicecandidate=function(event){self._onIceCandidate(event)},self.initiator){var createdOffer=!1;self._pc.onnegotiationneeded=function(){createdOffer||self._createOffer(),createdOffer=!0},self._setupData({channel:self._pc.createDataChannel(self.channelName,self.channelConfig)})}else self._pc.ondatachannel=function(event){self._setupData(event)};"addTrack"in self._pc?(self.stream&&self.stream.getTracks().forEach(function(track){self._pc.addTrack(track,self.stream)}),self._pc.ontrack=function(event){self._onTrack(event)}):(self.stream&&self._pc.addStream(self.stream),self._pc.onaddstream=function(event){self._onAddStream(event)}),self.initiator&&self._isWrtc&&self._pc.onnegotiationneeded(),self._onFinishBound=function(){self._onFinish()},self.once("finish",self._onFinishBound)}function noop(){}module.exports=Peer;var debug=__webpack_require__(3)("simple-peer"),getBrowserRTC=__webpack_require__(428),inherits=__webpack_require__(1),randombytes=__webpack_require__(764),stream=__webpack_require__(784);inherits(Peer,stream.Duplex),Peer.WEBRTC_SUPPORT=!!getBrowserRTC(),Peer.config={iceServers:[{urls:"stun:stun.l.google.com:19302"},{urls:"stun:global.stun.twilio.com:3478?transport=udp"}]},Peer.constraints={},Peer.channelConfig={},Object.defineProperty(Peer.prototype,"bufferSize",{get:function(){var self=this;return self._channel&&self._channel.bufferedAmount||0}}),Peer.prototype.address=function(){var self=this;return{port:self.localPort,family:"IPv4",address:self.localAddress}},Peer.prototype.signal=function(data){var self=this;if(self.destroyed)throw new Error("cannot signal after peer is destroyed");if("string"==typeof data)try{data=JSON.parse(data)}catch(err){data={}}self._debug("signal()"),data.candidate&&(self._pc.remoteDescription?self._addIceCandidate(data.candidate):self._pendingCandidates.push(data.candidate)),data.sdp&&self._pc.setRemoteDescription(new self._wrtc.RTCSessionDescription(data),function(){self.destroyed||(self._pendingCandidates.forEach(function(candidate){self._addIceCandidate(candidate)}),self._pendingCandidates=[],"offer"===self._pc.remoteDescription.type&&self._createAnswer())},function(err){self._destroy(err)}),data.sdp||data.candidate||self._destroy(new Error("signal() called with invalid signal data"))},Peer.prototype._addIceCandidate=function(candidate){var self=this;try{self._pc.addIceCandidate(new self._wrtc.RTCIceCandidate(candidate),noop,function(err){self._destroy(err)})}catch(err){self._destroy(new Error("error adding candidate: "+err.message))}},Peer.prototype.send=function(chunk){var self=this;self._isWrtc&&Buffer.isBuffer(chunk)&&(chunk=new Uint8Array(chunk)),self._channel.send(chunk)},Peer.prototype.destroy=function(onclose){this._destroy(null,onclose)},Peer.prototype._destroy=function(err,onclose){var self=this;if(!self.destroyed){if(onclose&&self.once("close",onclose),self._debug("destroy (error: %s)",err&&(err.message||err)),self.readable=self.writable=!1,self._readableState.ended||self.push(null),self._writableState.finished||self.end(),self.destroyed=!0,self.connected=!1,self._pcReady=!1,self._channelReady=!1,self._previousStreams=null,clearInterval(self._interval),clearTimeout(self._reconnectTimeout),self._interval=null,self._reconnectTimeout=null,self._chunk=null,self._cb=null,self._onFinishBound&&self.removeListener("finish",self._onFinishBound),self._onFinishBound=null,self._pc){try{self._pc.close()}catch(err){}self._pc.oniceconnectionstatechange=null,self._pc.onicegatheringstatechange=null,self._pc.onsignalingstatechange=null,self._pc.onicecandidate=null,"addTrack"in self._pc?self._pc.ontrack=null:self._pc.onaddstream=null,self._pc.onnegotiationneeded=null,self._pc.ondatachannel=null}if(self._channel){try{self._channel.close()}catch(err){}self._channel.onmessage=null,self._channel.onopen=null,self._channel.onclose=null,self._channel.onerror=null}self._pc=null,self._channel=null,err&&self.emit("error",err),self.emit("close")}},Peer.prototype._setupData=function(event){var self=this;if(!event.channel)return self._destroy(new Error("Data channel event is missing `channel` property"));self._channel=event.channel,self._channel.binaryType="arraybuffer","number"==typeof self._channel.bufferedAmountLowThreshold&&(self._channel.bufferedAmountLowThreshold=65536),self.channelName=self._channel.label,self._channel.onmessage=function(event){self._onChannelMessage(event)},self._channel.onbufferedamountlow=function(){self._onChannelBufferedAmountLow()},self._channel.onopen=function(){self._onChannelOpen()},self._channel.onclose=function(){self._onChannelClose()},self._channel.onerror=function(err){self._destroy(err)}},Peer.prototype._read=function(){},Peer.prototype._write=function(chunk,encoding,cb){var self=this;if(self.destroyed)return cb(new Error("cannot write after peer is destroyed"));if(self.connected){try{self.send(chunk)}catch(err){return self._destroy(err)}self._channel.bufferedAmount>65536?(self._debug("start backpressure: bufferedAmount %d",self._channel.bufferedAmount),self._cb=cb):cb(null)}else self._debug("write before connect"),self._chunk=chunk,self._cb=cb},Peer.prototype._onFinish=function(){function destroySoon(){setTimeout(function(){self._destroy()},1e3)}var self=this;self.destroyed||(self.connected?destroySoon():self.once("connect",destroySoon))},Peer.prototype._createOffer=function(){var self=this;self.destroyed||self._pc.createOffer(function(offer){function onSuccess(){self.destroyed||(self.trickle||self._iceComplete?sendOffer():self.once("_iceComplete",sendOffer))}function onError(err){self._destroy(err)}function sendOffer(){var signal=self._pc.localDescription||offer;self._debug("signal"),self.emit("signal",{type:signal.type,sdp:signal.sdp})}self.destroyed||(offer.sdp=self.sdpTransform(offer.sdp),self._pc.setLocalDescription(offer,onSuccess,onError))},function(err){self._destroy(err)},self.offerConstraints)},Peer.prototype._createAnswer=function(){var self=this;self.destroyed||self._pc.createAnswer(function(answer){function onSuccess(){self.destroyed||(self.trickle||self._iceComplete?sendAnswer():self.once("_iceComplete",sendAnswer))}function onError(err){self._destroy(err)}function sendAnswer(){var signal=self._pc.localDescription||answer;self._debug("signal"),self.emit("signal",{type:signal.type,sdp:signal.sdp})}self.destroyed||(answer.sdp=self.sdpTransform(answer.sdp),self._pc.setLocalDescription(answer,onSuccess,onError))},function(err){self._destroy(err)},self.answerConstraints)},Peer.prototype._onIceStateChange=function(){var self=this;if(!self.destroyed){var iceConnectionState=self._pc.iceConnectionState,iceGatheringState=self._pc.iceGatheringState;self._debug("iceStateChange (connection: %s) (gathering: %s)",iceConnectionState,iceGatheringState),self.emit("iceStateChange",iceConnectionState,iceGatheringState),"connected"!==iceConnectionState&&"completed"!==iceConnectionState||(clearTimeout(self._reconnectTimeout),self._pcReady=!0,self._maybeReady()),"disconnected"===iceConnectionState&&(self.reconnectTimer?(clearTimeout(self._reconnectTimeout),self._reconnectTimeout=setTimeout(function(){self._destroy()},self.reconnectTimer)):self._destroy()),"failed"===iceConnectionState&&self._destroy(new Error("Ice connection failed.")),"closed"===iceConnectionState&&self._destroy()}},Peer.prototype.getStats=function(cb){var self=this;0===self._pc.getStats.length?self._pc.getStats().then(function(res){var reports=[];res.forEach(function(report){reports.push(report)}),cb(null,reports)},function(err){cb(err)}):self._isReactNativeWebrtc?self._pc.getStats(null,function(res){var reports=[];res.forEach(function(report){reports.push(report)}),cb(null,reports)},function(err){cb(err)}):self._pc.getStats.length>0?self._pc.getStats(function(res){var reports=[];res.result().forEach(function(result){var report={};result.names().forEach(function(name){report[name]=result.stat(name)}),report.id=result.id,report.type=result.type,report.timestamp=result.timestamp,reports.push(report)}),cb(null,reports)},function(err){cb(err)}):cb(null,[])},Peer.prototype._maybeReady=function(){var self=this;self._debug("maybeReady pc %s channel %s",self._pcReady,self._channelReady),!self.connected&&!self._connecting&&self._pcReady&&self._channelReady&&(self._connecting=!0,self.getStats(function(err,items){function setSelectedCandidatePair(selectedCandidatePair){var local=localCandidates[selectedCandidatePair.localCandidateId];local&&local.ip?(self.localAddress=local.ip,self.localPort=Number(local.port)):local&&local.ipAddress?(self.localAddress=local.ipAddress,self.localPort=Number(local.portNumber)):"string"==typeof selectedCandidatePair.googLocalAddress&&(local=selectedCandidatePair.googLocalAddress.split(":"),self.localAddress=local[0],self.localPort=Number(local[1]));var remote=remoteCandidates[selectedCandidatePair.remoteCandidateId];remote&&remote.ip?(self.remoteAddress=remote.ip,self.remotePort=Number(remote.port)):remote&&remote.ipAddress?(self.remoteAddress=remote.ipAddress,self.remotePort=Number(remote.portNumber)):"string"==typeof selectedCandidatePair.googRemoteAddress&&(remote=selectedCandidatePair.googRemoteAddress.split(":"),self.remoteAddress=remote[0],self.remotePort=Number(remote[1])),self.remoteFamily="IPv4",self._debug("connect local: %s:%s remote: %s:%s",self.localAddress,self.localPort,self.remoteAddress,self.remotePort)}if(!self.destroyed){err&&(items=[]),self._connecting=!1,self.connected=!0;var remoteCandidates={},localCandidates={},candidatePairs={};if(items.forEach(function(item){"remotecandidate"!==item.type&&"remote-candidate"!==item.type||(remoteCandidates[item.id]=item),"localcandidate"!==item.type&&"local-candidate"!==item.type||(localCandidates[item.id]=item),"candidatepair"!==item.type&&"candidate-pair"!==item.type||(candidatePairs[item.id]=item)}),items.forEach(function(item){"transport"===item.type&&setSelectedCandidatePair(candidatePairs[item.selectedCandidatePairId]),("googCandidatePair"===item.type&&"true"===item.googActiveConnection||("candidatepair"===item.type||"candidate-pair"===item.type)&&item.selected)&&setSelectedCandidatePair(item)}),self._chunk){try{self.send(self._chunk)}catch(err){return self._destroy(err)}self._chunk=null,self._debug('sent chunk from "write before connect"');var cb=self._cb;self._cb=null,cb(null)}"number"!=typeof self._channel.bufferedAmountLowThreshold&&(self._interval=setInterval(function(){self._onInterval()},150),self._interval.unref&&self._interval.unref()),self._debug("connect"),self.emit("connect")}}))},Peer.prototype._onInterval=function(){!this._cb||!this._channel||this._channel.bufferedAmount>65536||this._onChannelBufferedAmountLow()},Peer.prototype._onSignalingStateChange=function(){var self=this;self.destroyed||(self._debug("signalingStateChange %s",self._pc.signalingState),self.emit("signalingStateChange",self._pc.signalingState))},Peer.prototype._onIceCandidate=function(event){var self=this;self.destroyed||(event.candidate&&self.trickle?self.emit("signal",{candidate:{candidate:event.candidate.candidate,sdpMLineIndex:event.candidate.sdpMLineIndex,sdpMid:event.candidate.sdpMid}}):event.candidate||(self._iceComplete=!0,self.emit("_iceComplete")))},Peer.prototype._onChannelMessage=function(event){var self=this;if(!self.destroyed){var data=event.data;data instanceof ArrayBuffer&&(data=Buffer.from(data)),self.push(data)}},Peer.prototype._onChannelBufferedAmountLow=function(){var self=this;if(!self.destroyed&&self._cb){self._debug("ending backpressure: bufferedAmount %d",self._channel.bufferedAmount);var cb=self._cb;self._cb=null,cb(null)}},Peer.prototype._onChannelOpen=function(){var self=this;self.connected||self.destroyed||(self._debug("on channel open"),self._channelReady=!0,self._maybeReady())},Peer.prototype._onChannelClose=function(){var self=this;self.destroyed||(self._debug("on channel close"),self._destroy())},Peer.prototype._onAddStream=function(event){var self=this;self.destroyed||(self._debug("on add stream"),self.emit("stream",event.stream))},Peer.prototype._onTrack=function(event){var self=this;if(!self.destroyed){self._debug("on track");var id=event.streams[0].id;self._previousStreams.indexOf(id)===-1&&(self._previousStreams.push(id),self.emit("stream",event.streams[0]))}},Peer.prototype._debug=function(){var self=this,args=[].slice.call(arguments);args[0]="["+self._id+"] "+args[0],debug.apply(null,args)},Peer.prototype._transformConstraints=function(constraints){var self=this;if(0===Object.keys(constraints).length)return constraints;if((constraints.mandatory||constraints.optional)&&!self._isChromium){var newConstraints=Object.assign({},constraints.optional,constraints.mandatory);return void 0!==newConstraints.OfferToReceiveVideo&&(newConstraints.offerToReceiveVideo=newConstraints.OfferToReceiveVideo,delete newConstraints.OfferToReceiveVideo), +void 0!==newConstraints.OfferToReceiveAudio&&(newConstraints.offerToReceiveAudio=newConstraints.OfferToReceiveAudio,delete newConstraints.OfferToReceiveAudio),newConstraints}return constraints.mandatory||constraints.optional||!self._isChromium?constraints:(void 0!==constraints.offerToReceiveVideo&&(constraints.OfferToReceiveVideo=constraints.offerToReceiveVideo,delete constraints.offerToReceiveVideo),void 0!==constraints.offerToReceiveAudio&&(constraints.OfferToReceiveAudio=constraints.offerToReceiveAudio,delete constraints.offerToReceiveAudio),{mandatory:constraints})}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}module.exports=PassThrough;var Transform=__webpack_require__(317),util=__webpack_require__(6);util.inherits=__webpack_require__(1),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},function(module,exports,__webpack_require__){"use strict";function BufferList(){this.head=null,this.tail=null,this.length=0}var bufferShim=(__webpack_require__(0).Buffer,__webpack_require__(14));module.exports=BufferList,BufferList.prototype.push=function(v){var entry={data:v,next:null};this.length>0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};0===this.length&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(0!==this.length){var ret=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s){if(0===this.length)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s+p.data;return ret},BufferList.prototype.concat=function(n){if(0===this.length)return bufferShim.alloc(0);if(1===this.length)return this.head.data;for(var ret=bufferShim.allocUnsafe(n>>>0),p=this.head,i=0;p;)p.data.copy(ret,i),i+=p.data.length,p=p.next;return ret}},function(module,exports,__webpack_require__){exports=module.exports=__webpack_require__(316),exports.Stream=exports,exports.Readable=exports,exports.Writable=__webpack_require__(318),exports.Duplex=__webpack_require__(70),exports.Transform=__webpack_require__(317),exports.PassThrough=__webpack_require__(782)},function(module,exports,__webpack_require__){"use strict";function popCountReduce(count,byte){return count+popCount(byte)}function popCount(_v){let v=_v;return v-=v>>1&1431655765,16843009*((v=(858993459&v)+(v>>2&858993459))+(v>>4)&252645135)>>24}function sortInternal(a,b){return a[0]-b[0]}function valueOnly(elem){return elem[1]}module.exports=class SparseArray{constructor(){this._bitArrays=[],this._data=[],this._length=0,this._changedLength=!1,this._changedData=!1}set(index,value){let pos=this._internalPositionFor(index,!1);if(void 0===value)pos!==-1&&(this._unsetInternalPos(pos),this._unsetBit(index),this._changedLength=!0,this._changedData=!0);else{let needsSort=!1;pos===-1?(pos=this._data.length,this._setBit(index),this._changedData=!0):needsSort=!0,this._setInternalPos(pos,index,value,needsSort),this._changedLength=!0}}unset(index){this.set(index,void 0)}get(index){this._sortData();const pos=this._internalPositionFor(index,!0);if(pos!==-1)return this._data[pos][1]}push(value){return this.set(this.length,value),this.length}get length(){if(this._sortData(),this._changedLength){const last=this._data[this._data.length-1];this._length=last?last[0]+1:0,this._changedLength=!1}return this._length}forEach(iterator){let i=0;for(;i=this._bitArrays.length)return-1;const byte=this._bitArrays[bytePos],bitPos=index-7*bytePos;return(byte&1<0?this._bitArrays.slice(0,bytePos).reduce(popCountReduce,0)+popCount(byte&~(4294967295<=index)data.push(elem);else if(data[0][0]<=index)data.unshift(elem);else{const randomIndex=Math.round(data.length/2);this._data=data.slice(0,randomIndex).concat(elem).concat(data.slice(randomIndex))}else this._data.push(elem);this._changedData=!0,this._changedLength=!0}}_unsetInternalPos(pos){this._data.splice(pos,1)}_sortData(){this._changedData&&this._data.sort(sortInternal)}bitField(){const bytes=[];let newByte,pendingBitsForResultingByte=8,pendingBitsForNewByte=0,resultingByte=0;const pending=this._bitArrays.slice();for(;pending.length||pendingBitsForNewByte;){0===pendingBitsForNewByte&&(newByte=pending.shift(),pendingBitsForNewByte=7);const usingBits=Math.min(pendingBitsForNewByte,pendingBitsForResultingByte),mask=~(255<>>=usingBits,pendingBitsForNewByte-=usingBits,pendingBitsForResultingByte-=usingBits,pendingBitsForResultingByte&&(pendingBitsForNewByte||pending.length)||(bytes.push(resultingByte),resultingByte=0,pendingBitsForResultingByte=8)}for(var i=bytes.length-1;i>0;i--){const value=bytes[i];if(0!==value)break;bytes.pop()}return bytes}compactArray(){return this._sortData(),this._data.map(valueOnly)}}},function(module,exports,__webpack_require__){"use strict";(function(process){function Connection(socket,options){EventEmitter.call(this);var state={};this._spdyState=state,this.httpAllowHalfOpen=!0,state.timeout=new transport.utils.Timeout(this),state.protocol=transport.protocol[options.protocol],state.version=null,state.constants=state.protocol.constants,state.pair=null,state.isServer=options.isServer,state.priorityRoot=new transport.Priority({defaultWeight:state.constants.DEFAULT_WEIGHT,maxCount:transport.protocol.base.constants.MAX_PRIORITY_STREAMS}),state.maxStreams=options.maxStreams||state.constants.MAX_CONCURRENT_STREAMS,state.autoSpdy31="h2"!==options.protocol.name&&options.autoSpdy31,state.acceptPush=void 0===options.acceptPush?!state.isServer:options.acceptPush,options.maxChunk===!1?state.maxChunk=1/0:void 0===options.maxChunk?state.maxChunk=transport.protocol.base.constants.DEFAULT_MAX_CHUNK:state.maxChunk=options.maxChunk;var windowSize=options.windowSize||1<<20;state.window=new transport.Window({id:0,isServer:state.isServer,recv:{size:state.constants.DEFAULT_WINDOW,max:state.constants.MAX_INITIAL_WINDOW_SIZE},send:{size:state.constants.DEFAULT_WINDOW,max:state.constants.MAX_INITIAL_WINDOW_SIZE}}),state.window.recv.setMax(windowSize),state.streamWindow=new transport.Window({id:-1,isServer:state.isServer,recv:{size:windowSize,max:state.constants.MAX_INITIAL_WINDOW_SIZE},send:{size:state.constants.DEFAULT_WINDOW,max:state.constants.MAX_INITIAL_WINDOW_SIZE}}),state.pool=state.protocol.compressionPool.create(options.headerCompression),state.counters={push:0,stream:0},state.stream={map:{},count:0,nextId:state.isServer?2:1,lastId:{both:0,received:0}},state.ping={nextId:state.isServer?2:1,map:{}},state.goaway=!1,state.debug=state.isServer?debug.server:debug.client,state.xForward=null,state.parser=state.protocol.parser.create({isServer:state.isServer,window:state.window}),state.framer=state.protocol.framer.create({window:state.window,timeout:state.timeout}),"spdy"===state.protocol.name&&state.framer.enablePush(state.isServer),state.isServer||state.parser.skipPreface(),this.socket=socket,this._init()}var util=__webpack_require__(10),transport=__webpack_require__(21),Buffer=__webpack_require__(13).Buffer,debug={server:__webpack_require__(3)("spdy:connection:server"),client:__webpack_require__(3)("spdy:connection:client")},EventEmitter=__webpack_require__(8).EventEmitter,Stream=transport.Stream;util.inherits(Connection,EventEmitter),exports.Connection=Connection,Connection.create=function(socket,options){return new Connection(socket,options)},Connection.prototype._init=function(){function _onWindowOverflow(){self._onWindowOverflow()}var self=this,state=this._spdyState,pool=state.pool;state.window.recv.on("drain",function(){self._onSessionWindowDrain()}),state.parser.on("data",function(frame){self._handleFrame(frame)}),state.parser.once("version",function(version){self._onVersion(version)}),state.parser.on("error",function(err){self._onParserError(err)}),state.framer.on("error",function(err){self.emit("error",err)}),this.socket.pipe(state.parser),state.framer.pipe(this.socket),this.socket.on("error",function(e){self.emit("error",e)}),this.socket.once("close",function(){var err=new Error("socket hang up");err.code="ECONNRESET",self.destroyStreams(err),self.emit("close",err),state.pair&&pool.put(state.pair),state.framer.resume()}),this.once("close",function(){self.setTimeout(0)}),state.window.recv.on("overflow",_onWindowOverflow),state.window.send.on("overflow",_onWindowOverflow),this.socket.allowHalfOpen=!1},Connection.prototype._onVersion=function(version){var state=this._spdyState,prev=state.version,parser=state.parser,framer=state.framer,pool=state.pool;state.version=version,state.debug("id=0 version=%d",version),prev||(state.pair=pool.get(version),parser.setCompression(state.pair),framer.setCompression(state.pair)),framer.setVersion(version),state.isServer||(framer.prefaceFrame(),null!==state.xForward&&framer.xForwardedFor({host:state.xForward})),framer.settingsFrame({max_header_list_size:state.constants.DEFAULT_MAX_HEADER_LIST_SIZE,max_concurrent_streams:state.maxStreams,enable_push:state.acceptPush?1:0,initial_window_size:state.window.recv.max}),(state.version>=3.1||state.isServer&&state.autoSpdy31)&&this._onSessionWindowDrain(),this.emit("version",version)},Connection.prototype._onParserError=function(err){var state=this._spdyState;state.parser.kill(),err instanceof transport.protocol.base.utils.ProtocolError&&this._goaway({lastId:state.stream.lastId.both,code:err.code,extra:err.message,send:!0}),this.emit("error",err)},Connection.prototype._handleFrame=function(frame){var state=this._spdyState;state.debug("id=0 frame",frame),state.timeout.reset(),this.emit("frame",frame);var stream;if("WINDOW_UPDATE"===frame.type&&0===frame.id)return state.version<3.1&&state.autoSpdy31&&(state.debug("id=0 switch version to 3.1"),state.version=3.1,this.emit("version",3.1)),void state.window.send.update(frame.delta);if(state.isServer&&"PUSH_PROMISE"===frame.type)return state.debug("id=0 server PUSH_PROMISE"),void this._goaway({lastId:state.stream.lastId.both,code:"PROTOCOL_ERROR",send:!0});if(!stream&&void 0!==frame.id&&!(stream=state.stream.map[frame.id])&&"HEADERS"!==frame.type&&"PRIORITY"!==frame.type&&"RST"!==frame.type){if(this._isGoaway(frame.id))return;return state.debug("id=0 stream=%d not found",frame.id),void state.framer.rstFrame({id:frame.id,code:"INVALID_STREAM"})}if(!stream&&"HEADERS"===frame.type)return void this._handleHeaders(frame);stream?stream._handleFrame(frame):"SETTINGS"===frame.type?this._handleSettings(frame.settings):"ACK_SETTINGS"===frame.type||("PING"===frame.type?this._handlePing(frame):"GOAWAY"===frame.type?this._handleGoaway(frame):"X_FORWARDED_FOR"===frame.type?null===state.xForward&&(state.xForward=frame.host):"PRIORITY"===frame.type||state.debug("id=0 unknown frame type: %s",frame.type))},Connection.prototype._onWindowOverflow=function(){var state=this._spdyState;state.debug("id=0 window overflow"),this._goaway({lastId:state.stream.lastId.both,code:"FLOW_CONTROL_ERROR",send:!0})},Connection.prototype._isGoaway=function(id){var state=this._spdyState;return state.goaway!==!1&&state.goawaythis.maxCount&&(debug("hit maximum remove id=%d",this.list[0].id),this.list.shift().remove()),null!==node.parent&&this.list.push(node),node},PriorityTree.prototype.get=function(id){return this.map[id]},PriorityTree.prototype.addDefault=function(id){return debug("creating default node"),this.add({id:id,parent:0,weight:this.defaultWeight})},PriorityTree.prototype._removeNode=function(node){delete this.map[node.id],this.count--}},function(module,exports){exports.DEFAULT_METHOD="GET",exports.DEFAULT_HOST="localhost",exports.MAX_PRIORITY_STREAMS=100,exports.DEFAULT_MAX_CHUNK=8192},function(module,exports,__webpack_require__){"use strict";(function(process){function Framer(options){Scheduler.call(this),this.version=null,this.compress=null,this.window=options.window,this.timeout=options.timeout,this.pushEnabled=null}var util=__webpack_require__(10),transport=__webpack_require__(21),base=__webpack_require__(163),Scheduler=base.Scheduler;util.inherits(Framer,Scheduler),module.exports=Framer,Framer.prototype.setVersion=function(version){this.version=version,this.emit("version")},Framer.prototype.setCompression=function(pair){this.compress=new transport.utils.LockStream(pair.compress)},Framer.prototype.enablePush=function(enable){this.pushEnabled=enable,this.emit("_pushEnabled")},Framer.prototype._checkPush=function(callback){if(null===this.pushEnabled)return void this.once("_pushEnabled",function(){this._checkPush(callback)});var err=null;this.pushEnabled||(err=new Error("PUSH_PROMISE disabled by other side")),process.nextTick(function(){return callback(err)})},Framer.prototype._resetTimeout=function(){this.timeout&&this.timeout.reset()}}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";(function(process){function Parser(options){Transform.call(this,{readableObjectMode:!0}),this.buffer=new OffsetBuffer,this.partial=!1,this.waiting=0,this.window=options.window,this.version=null,this.decompress=null,this.dead=!1}var transport=__webpack_require__(21),util=__webpack_require__(10),utils=__webpack_require__(163).utils,OffsetBuffer=__webpack_require__(113),Transform=__webpack_require__(164).Transform;module.exports=Parser,util.inherits(Parser,Transform),Parser.prototype.error=utils.error,Parser.prototype.kill=function(){this.dead=!0},Parser.prototype._transform=function(data,encoding,cb){this.dead||this.buffer.push(data),this._consume(cb)},Parser.prototype._consume=function(cb){function next(err,frame){if(err)return cb(err);if(Array.isArray(frame))for(var i=0;i=this.list.length||0!==insertCompare(this.list[index],item)?this.list.splice(index,0,item):item=this.list[index],item.push(data),this.count+=chunks.length,this._read()},Scheduler.prototype._read=function(){if(0!==this.count&&!this.pendingTick){this.pendingTick=!0;var self=this;process.nextTick(function(){self.pendingTick=!1,self.tick()})}},Scheduler.prototype.tick=function(){return!!this.tickSync()&&this.tickAsync()},Scheduler.prototype.tickSync=function(){var sync=this.sync,res=!0;this.sync=[];for(var i=0;i0;index++){index%=list.length,startPriority-list[index].priority>this.window&&(index=0),debug("tick async index=%d start=%d",index,startPriority);var current=list[index],item=current.shift();current.isEmpty()&&(list.splice(index,1),0===index&&list.length>0&&(startPriority=list[0].priority),index--),debug("tick async pending=%d",this.count,item.chunks);for(var i=0;ithis.maxFrameSize)return callback(this.error(constants.error.FRAME_SIZE_ERROR,"Frame length OOB"));header.control=header.type!==constants.frameType.DATA,this.state="frame-body",this.pendingHeader=header,this.waiting=header.length,this.partial=!header.control,this.partial&&(this.partial=0==(header.flags&constants.flags.PADDED)),callback(null,null)},Parser.prototype.onFrameBody=function(header,buffer,callback){var frameType=constants.frameType;header.type===frameType.DATA?this.onDataFrame(header,buffer,callback):header.type===frameType.HEADERS?this.onHeadersFrame(header,buffer,callback):header.type===frameType.CONTINUATION?this.onContinuationFrame(header,buffer,callback):header.type===frameType.WINDOW_UPDATE?this.onWindowUpdateFrame(header,buffer,callback):header.type===frameType.RST_STREAM?this.onRSTFrame(header,buffer,callback):header.type===frameType.SETTINGS?this.onSettingsFrame(header,buffer,callback):header.type===frameType.PUSH_PROMISE?this.onPushPromiseFrame(header,buffer,callback):header.type===frameType.PING?this.onPingFrame(header,buffer,callback):header.type===frameType.GOAWAY?this.onGoawayFrame(header,buffer,callback):header.type===frameType.PRIORITY?this.onPriorityFrame(header,buffer,callback):header.type===frameType.X_FORWARDED_FOR?this.onXForwardedFrame(header,buffer,callback):this.onUnknownFrame(header,buffer,callback)},Parser.prototype.onUnknownFrame=function(header,buffer,callback){if(null!==this._lastHeaderBlock)return void callback(this.error(constants.error.PROTOCOL_ERROR,"Received unknown frame in the middle of a header block"));callback(null,{type:"unknown: "+header.type})},Parser.prototype.unpadData=function(header,body,callback){if(0==(header.flags&constants.flags.PADDED))return callback(null,body);if(!body.has(1))return callback(this.error(constants.error.FRAME_SIZE_ERROR,"Not enough space for padding"));var pad=body.readUInt8();if(!body.has(pad))return callback(this.error(constants.error.PROTOCOL_ERROR,"Invalid padding size"));var contents=body.clone(body.size-pad);body.skip(body.size),callback(null,contents)},Parser.prototype.onDataFrame=function(header,body,callback){var isEndStream=0!=(header.flags&constants.flags.END_STREAM);if(0===header.id)return callback(this.error(constants.error.PROTOCOL_ERROR,"Received DATA frame with stream=0"));this.window&&this.window.recv.update(-body.size),this.unpadData(header,body,function(err,data){if(err)return callback(err);callback(null,{type:"DATA",id:header.id,fin:isEndStream,data:data.take(data.size)})})},Parser.prototype.initHeaderBlock=function(header,frame,block,callback){if(this._lastHeaderBlock)return callback(this.error(constants.error.PROTOCOL_ERROR,"Duplicate Stream ID"));this._lastHeaderBlock={id:header.id,frame:frame,queue:[],size:0},this.queueHeaderBlock(header,block,callback)},Parser.prototype.queueHeaderBlock=function(header,block,callback){var self=this,item=this._lastHeaderBlock;if(!this._lastHeaderBlock||item.id!==header.id)return callback(this.error(constants.error.PROTOCOL_ERROR,"No matching stream for continuation"));for(var fin=0!=(header.flags&constants.flags.END_HEADERS),chunks=block.toChunks(),i=0;i=self.maxHeaderListSize?callback(this.error(constants.error.PROTOCOL_ERROR,"Compressed header list is too large")):fin?(this._lastHeaderBlock=null,void this.decompress.write(item.queue,function(err,chunks){if(err)return callback(self.error(constants.error.COMPRESSION_ERROR,err.message));for(var headers={},size=0,i=0;i=self.maxHeaderListSize)return callback(self.error(constants.error.PROTOCOL_ERROR,"Header list is too large"));if(/[A-Z]/.test(header.name))return callback(self.error(constants.error.PROTOCOL_ERROR,"Header name must be lowercase"));utils.addHeaderLine(header.name,header.value,headers)}item.frame.headers=headers,item.frame.path=headers[":path"],callback(null,item.frame)})):callback(null,null)},Parser.prototype.onHeadersFrame=function(header,body,callback){var self=this;if(0===header.id)return callback(this.error(constants.error.PROTOCOL_ERROR,"Invalid stream id for HEADERS"));this.unpadData(header,body,function(err,data){if(err)return callback(err);var isPriority=0!=(header.flags&constants.flags.PRIORITY);if(!data.has(isPriority?5:0))return callback(self.error(constants.error.FRAME_SIZE_ERROR,"Not enough data for HEADERS"));var exclusive=!1,dependency=0,weight=constants.DEFAULT_WEIGHT;if(isPriority&&(dependency=data.readUInt32BE(),exclusive=0!=(2147483648&dependency),dependency&=2147483647,weight=data.readUInt8()+1),dependency===header.id)return callback(self.error(constants.error.PROTOCOL_ERROR,"Stream can't dependend on itself"));var streamInfo={type:"HEADERS",id:header.id,priority:{parent:dependency,exclusive:exclusive,weight:weight},fin:0!=(header.flags&constants.flags.END_STREAM),writable:!0,headers:null,path:null};self.initHeaderBlock(header,streamInfo,data,callback)})},Parser.prototype.onContinuationFrame=function(header,body,callback){this.queueHeaderBlock(header,body,callback)},Parser.prototype.onRSTFrame=function(header,body,callback){return 4!==body.size?callback(this.error(constants.error.FRAME_SIZE_ERROR,"RST_STREAM length not 4")):0===header.id?callback(this.error(constants.error.PROTOCOL_ERROR,"Invalid stream id for RST_STREAM")):void callback(null,{type:"RST",id:header.id,code:constants.errorByCode[body.readUInt32BE()]})},Parser.prototype._validateSettings=function(settings){return void 0!==settings.enable_push&&0!==settings.enable_push&&1!==settings.enable_push?this.error(constants.error.PROTOCOL_ERROR,"SETTINGS_ENABLE_PUSH must be 0 or 1"):void 0!==settings.initial_window_size&&(settings.initial_window_size>constants.MAX_INITIAL_WINDOW_SIZE||settings.initial_window_size<0)?this.error(constants.error.FLOW_CONTROL_ERROR,"SETTINGS_INITIAL_WINDOW_SIZE is OOB"):void 0!==settings.max_frame_size&&(settings.max_frame_size>constants.ABSOLUTE_MAX_FRAME_SIZE||settings.max_frame_size=3)&&("connection"!==lkey&&"keep-alive"!==lkey&&"proxy-connection"!==lkey&&"transfer-encoding"!==lkey)},this).map(function(key){var klen=Buffer.byteLength(key),value=stringify(loweredHeaders[key]),vlen=Buffer.byteLength(value);return len+=2*size+klen+vlen,[klen,key,vlen,value]}),block=new WriteBuffer;block.reserve(len),2===this.version?block.writeUInt16BE(pairs.length):block.writeUInt32BE(pairs.length),pairs.forEach(function(pair){2===this.version?block.writeUInt16BE(pair[0]):block.writeUInt32BE(pair[0]),block.write(pair[1]),2===this.version?block.writeUInt16BE(pair[2]):block.writeUInt32BE(pair[2]),block.write(pair[3])},this),assert(null!==this.compress,"Framer version not initialized"),this.compress.write(block.render(),callback)},Framer.prototype._frame=function(frame,body,callback){if(!this.version)return void this.on("version",function(){this._frame(frame,body,callback)});debug("id=%d type=%s",frame.id,frame.type);var buffer=new WriteBuffer;buffer.writeUInt16BE(32768|this.version),buffer.writeUInt16BE(constants.frameType[frame.type]),buffer.writeUInt8(frame.flags);var len=buffer.skip(3);body(buffer);var frameSize=buffer.size-constants.FRAME_HEADER_SIZE;len.writeUInt24BE(frameSize);var chunks=buffer.render(),toWrite={stream:frame.id,priority:!1,chunks:chunks,callback:callback};return this._resetTimeout(),this.schedule(toWrite),chunks},Framer.prototype._synFrame=function(frame,callback){function preprocess(headers){var method=frame.method||base.constants.DEFAULT_METHOD,version=frame.version||"HTTP/1.1",scheme=frame.scheme||"https",host=frame.host||frame.headers&&frame.headers.host||base.constants.DEFAULT_HOST;2===self.version?(headers.method=method,headers.version=version,headers.url=frame.path,headers.scheme=scheme,headers.host=host,frame.status&&(headers.status=frame.status)):(headers[":method"]=method,headers[":version"]=version,headers[":path"]=frame.path,headers[":scheme"]=scheme,headers[":host"]=host,frame.status&&(headers[":status"]=frame.status))}var self=this;if(!frame.path)throw new Error("`path` is required frame argument");this.headersToDict(frame.headers,preprocess,function(err,chunks){if(err)return callback?callback(err):self.emit("error",err);self._frame({type:"SYN_STREAM",id:frame.id,flags:frame.fin?constants.flags.FLAG_FIN:0},function(buf){buf.reserve(10),buf.writeUInt32BE(2147483647&frame.id),buf.writeUInt32BE(2147483647&frame.associated);var weight=frame.priority&&frame.priority.weight||constants.DEFAULT_WEIGHT,priority=utils.weightToPriority(weight);buf.writeUInt8(priority<<5),buf.writeUInt8(0);for(var i=0;i>5:utils.weightToPriority(constants.DEFAULT_WEIGHT),fin=0!=(flags&constants.flags.FLAG_FIN),unidir=0!=(flags&constants.flags.FLAG_UNIDIRECTIONAL),path=headers[":path"],isPush=stream&&0!==associated,weight=utils.priorityToWeight(priority),priorityInfo={weight:weight,exclusive:!1,parent:0};return isPush?stream&&!headers[":status"]?callback(new Error("Missing `:status` header")):void callback(null,[{type:"PUSH_PROMISE",id:associated,fin:!1,promisedId:id,headers:self._filterHeader(headers,":status"),path:path},{type:"HEADERS",id:id,fin:fin,priority:priorityInfo,writable:!0,path:void 0,headers:{":status":headers[":status"]}}]):void callback(null,{type:"HEADERS",id:id,priority:priorityInfo,fin:fin,writable:!unidir,headers:headers,path:path})})},Parser.prototype.onHeaderFrames=function(body,callback){var offset=2===this.version?6:4;if(!body.has(offset))return callback(new Error("HEADERS OOB"));var streamId=2147483647&body.readUInt32BE();2===this.version&&body.skip(2),this.parseKVs(body,function(err,headers){if(err)return callback(err);callback(null,{type:"HEADERS",priority:{parent:0,exclusive:!1,weight:constants.DEFAULT_WEIGHT},id:streamId,fin:!1,writable:!0,path:void 0,headers:headers})})},Parser.prototype.parseKVs=function(buffer,callback){var self=this;this.decompress.write(buffer.toChunks(),function(err,chunks){function readString(){if(!buffer.has(size))return null;var len=2===self.version?buffer.readUInt16BE():buffer.readUInt32BE();return buffer.has(len)?buffer.take(len).toString():null}if(err)return callback(err);for(var buffer=new OffsetBuffer,i=0;i0;){var key=readString(),value=readString();if(null===key||null===value)return callback(new Error("Headers OOB"));if(self.version<3){var isInternal=/^(method|version|url|host|scheme|status)$/.test(key);"url"===key&&(key="path"),isInternal&&(key=":"+key)}if(":status"===key&&(value=value.split(/ /g,2)[0]),count--,":host"===key&&(key=":authority"),":version"!==key){value=value.split(/\0/g);for(var j=0;j>24&255;if(id&=16777215,!(2&flags)){settings[idMap[id]]=body.readUInt32BE()}}callback(null,{type:"SETTINGS",settings:settings})},Parser.prototype.onPingFrame=function(body,callback){if(!body.has(4))return callback(new Error("PING OOB"));var isServer=this.isServer,opaque=body.clone(body.size).take(body.size),id=body.readUInt32BE();callback(null,{type:"PING",opaque:opaque,ack:isServer?id%2==0:id%2==1})},Parser.prototype.onGoawayFrame=function(body,callback){if(!body.has(8))return callback(new Error("GOAWAY OOB"));callback(null,{type:"GOAWAY",lastId:2147483647&body.readUInt32BE(),code:constants.goawayByCode[body.readUInt32BE()]})},Parser.prototype.onWindowUpdateFrame=function(body,callback){if(!body.has(8))return callback(new Error("WINDOW_UPDATE OOB"));callback(null,{type:"WINDOW_UPDATE",id:2147483647&body.readUInt32BE(),delta:body.readInt32BE()})},Parser.prototype.onXForwardedFrame=function(body,callback){if(!body.has(4))return callback(new Error("X_FORWARDED OOB"));var len=body.readUInt32BE();if(!body.has(len))return callback(new Error("X_FORWARDED host length OOB"));callback(null,{type:"X_FORWARDED_FOR",host:body.take(len).toString()})}},function(module,exports,__webpack_require__){"use strict";function createDeflate(version,compression){var deflate=zlib.createDeflate({dictionary:transport.protocol.spdy.dictionary[version],flush:zlib.Z_SYNC_FLUSH,windowBits:11,level:compression?zlib.Z_DEFAULT_COMPRESSION:zlib.Z_NO_COMPRESSION});return deflate._flush=zlib.Z_SYNC_FLUSH,deflate}function createInflate(version){var inflate=zlib.createInflate({dictionary:transport.protocol.spdy.dictionary[version],flush:zlib.Z_SYNC_FLUSH});return inflate._flush=zlib.Z_SYNC_FLUSH,inflate}function Pool(compression){this.compression=compression,this.pool={2:[],3:[],3.1:[]}}var zlibpool=exports,zlib=__webpack_require__(380),transport=__webpack_require__(21);zlibpool.create=function(compression){return new Pool(compression)},Pool.prototype.get=function(version){if(this.pool[version].length>0)return this.pool[version].pop();var id=version;return{version:version,compress:createDeflate(id,this.compression),decompress:createInflate(id)}},Pool.prototype.put=function(pair){this.pool[pair.version].push(pair)}},function(module,exports,__webpack_require__){"use strict";(function(process){function Stream(connection,options){function _onWindowOverflow(){self._onWindowOverflow()}Duplex.call(this);var connectionState=connection._spdyState,state={};this._spdyState=state,this.id=options.id,this.method=options.method,this.path=options.path,this.host=options.host,this.headers=options.headers||{},this.connection=connection,this.parent=options.parent||null,state.socket=null,state.protocol=connectionState.protocol,state.constants=state.protocol.constants,state.priority=null,state.version=this.connection.getVersion(),state.isServer=this.connection.isServer(),state.debug=state.isServer?debug.server:debug.client,state.framer=connectionState.framer,state.parser=connectionState.parser,state.request=options.request,state.needResponse=options.request,state.window=connectionState.streamWindow.clone(options.id),state.sessionWindow=connectionState.window,state.maxChunk=connectionState.maxChunk,state.sent=!state.request,state.readable=options.readable!==!1,state.writable=options.writable!==!1,state.aborted=!1,state.corked=0,state.corkQueue=[],state.timeout=new transport.utils.Timeout(this),this.on("finish",this._onFinish),this.on("end",this._onEnd);var self=this;state.window.recv.on("overflow",_onWindowOverflow),state.window.send.on("overflow",_onWindowOverflow),this._initPriority(options.priority),state.readable||this.push(null),state.writable||(this._writableState.ended=!0,this._writableState.finished=!0)}function checkAborted(stream,state,callback){return!!state.aborted&&(state.debug("id=%d abort write",stream.id),process.nextTick(function(){callback(new Error("Stream write aborted"))}),!0)}function _send(stream,state,data,callback){checkAborted(stream,state,callback)||(state.debug("id=%d presend=%d",stream.id,data.length),state.timeout.reset(),state.window.send.update(-data.length,function(){checkAborted(stream,state,callback)||(state.debug("id=%d send=%d",stream.id,data.length),state.timeout.reset(),state.framer.dataFrame({id:stream.id,priority:state.priority.getPriority(),fin:!1,data:data},function(err){state.debug("id=%d postsend=%d",stream.id,data.length),callback(err)}))}))}var transport=__webpack_require__(21),assert=__webpack_require__(7),util=__webpack_require__(10),debug={client:__webpack_require__(3)("spdy:stream:client"),server:__webpack_require__(3)("spdy:stream:server")},Buffer=__webpack_require__(13).Buffer,Duplex=__webpack_require__(164).Duplex;util.inherits(Stream,Duplex),exports.Stream=Stream,Stream.prototype._init=function(socket){this.socket=socket},Stream.prototype._initPriority=function(priority){var state=this._spdyState,connectionState=this.connection._spdyState,root=connectionState.priorityRoot;if(!priority)return void(state.priority=root.addDefault(this.id));state.priority=root.add({id:this.id,parent:priority.parent,weight:priority.weight,exclusive:priority.exclusive})},Stream.prototype._handleFrame=function(frame){var state=this._spdyState;if(state.aborted)return void state.debug("id=%d ignoring frame=%s after abort",this.id,frame.type);state.timeout.reset(),"DATA"===frame.type?this._handleData(frame):"HEADERS"===frame.type?this._handleHeaders(frame):"RST"===frame.type?this._handleRST(frame):"WINDOW_UPDATE"===frame.type?this._handleWindowUpdate(frame):"PRIORITY"===frame.type?this._handlePriority(frame):"PUSH_PROMISE"===frame.type&&this._handlePushPromise(frame),frame.fin&&(state.debug("id=%d end",this.id),this.push(null))},Stream.prototype._write=function(data,enc,callback){var state=this._spdyState;if(state.sent||this.send(),0!==state.corked){var self=this;return void state.corkQueue.push(function(){self._write(data,enc,callback)})}this._splitStart(data,_send,callback)},Stream.prototype._splitStart=function(data,onChunk,callback){return this._split(data,0,onChunk,callback)},Stream.prototype._split=function(data,offset,onChunk,callback){if(offset===data.length)return process.nextTick(callback);var state=this._spdyState,local=state.window.send,session=state.sessionWindow.send,availSession=Math.max(0,session.getCurrent());0===availSession&&(availSession=session.getMax());var availLocal=Math.max(0,local.getCurrent());0===availLocal&&(availLocal=local.getMax());var avail=Math.min(availSession,availLocal);avail=Math.min(avail,state.maxChunk);var self=this;if(0===avail)return void state.window.send.update(0,function(){self._split(data,offset,onChunk,callback)});var limit=avail,size=Math.min(data.length-offset,limit);onChunk(this,state,data.slice(offset,offset+size),function(err){if(err)return callback(err);self._split(data,offset+size,onChunk,callback)})},Stream.prototype._read=function(){var state=this._spdyState;if(state.window.recv.isDraining()){var delta=state.window.recv.getDelta();state.debug("id=%d window emptying, update by %d",this.id,delta),state.window.recv.update(delta),state.framer.windowUpdateFrame({id:this.id,delta:delta})}},Stream.prototype._handleData=function(frame){var state=this._spdyState;if(!state.readable||this._readableState.ended)return void state.framer.rstFrame({id:this.id,code:"STREAM_CLOSED"});state.debug("id=%d recv=%d",this.id,frame.data.length),state.window.recv.update(-frame.data.length),this.push(frame.data)},Stream.prototype._handleRST=function(frame){"CANCEL"!==frame.code&&this.emit("error",new Error("Got RST: "+frame.code)),this.abort()},Stream.prototype._handleWindowUpdate=function(frame){this._spdyState.window.send.update(frame.delta)},Stream.prototype._onWindowOverflow=function(){var state=this._spdyState;state.debug("id=%d window overflow",this.id),state.framer.rstFrame({id:this.id,code:"FLOW_CONTROL_ERROR"}),this.aborted=!0,this.emit("error",new Error("HTTP2 window overflow"))},Stream.prototype._handlePriority=function(frame){var state=this._spdyState;state.priority.remove(),state.priority=null,this._initPriority(frame.priority),this.emit("priority",frame.priority)},Stream.prototype._handleHeaders=function(frame){var state=this._spdyState;return!state.readable||this._readableState.ended?void state.framer.rstFrame({id:this.id,code:"STREAM_CLOSED"}):state.needResponse?this._handleResponse(frame):void this.emit("headers",frame.headers)},Stream.prototype._handleResponse=function(frame){var state=this._spdyState;if(void 0===frame.headers[":status"])return void state.framer.rstFrame({id:this.id,code:"PROTOCOL_ERROR"});state.needResponse=!1,this.emit("response",0|frame.headers[":status"],frame.headers)},Stream.prototype._onFinish=function(){var state=this._spdyState;if(state.sent){if(0!==state.corked){var self=this;return void state.corkQueue.push(function(){self._onFinish()})}state.framer.dataFrame({id:this.id,priority:state.priority.getPriority(),fin:!0,data:new Buffer(0)})}else this.send();this._maybeClose()},Stream.prototype._onEnd=function(){this._maybeClose()},Stream.prototype._checkEnded=function(callback){var state=this._spdyState,ended=!1;if(state.aborted&&(ended=!0),state.writable&&!this._writableState.finished||(ended=!0),!ended)return!0;if(!callback)return!1;var err=new Error("Ended stream can't send frames");return process.nextTick(function(){callback(err)}),!1},Stream.prototype._maybeClose=function(){var state=this._spdyState;state.aborted||state.readable&&!this._readableState.ended||!this._writableState.finished||(state.timeout.set(0),this.emit("close"))},Stream.prototype._handlePushPromise=function(frame){var push=this.connection._createStream({id:frame.promisedId,parent:this,push:!0,request:!0,method:frame.headers[":method"],path:frame.headers[":path"],host:frame.headers[":authority"],priority:frame.priority,headers:frame.headers,writable:!1});this.connection._isGoaway(push.id)||this.emit("pushPromise",push)||push.abort()},Stream.prototype._hardCork=function(){var state=this._spdyState;this.cork(),state.corked++},Stream.prototype._hardUncork=function(){var state=this._spdyState;if(this.uncork(),0===--state.corked){var queue=state.corkQueue;state.corkQueue=[];for(var i=0;i>1,cmp=compare(item,list[pos]);if(0===cmp){start=pos,end=pos;break}cmp<0?end=pos:start=pos+1}return start}function binaryInsert(list,item,compare){var index=binaryLookup(list,item,compare);list.splice(index,0,item)}function binarySearch(list,item,compare){var index=binaryLookup(list,item,compare);return index>=list.length?-1:0===compare(item,list[index])?index:-1}function Timeout(object){this.delay=0,this.timer=null,this.object=object}var util=__webpack_require__(10),isNode=__webpack_require__(97);Object.assign=process.versions.modules>=46||!isNode?Object.assign:util._extend,exports.QueueItem=QueueItem,util.inherits(Queue,QueueItem),exports.Queue=Queue,Queue.prototype.insertTail=function(item){item.prev=this.prev,item.next=this,item.prev.next=item,item.next.prev=item},Queue.prototype.remove=function(item){var next=item.next,prev=item.prev;item.next=item,item.prev=item,next.prev=prev,prev.next=next},Queue.prototype.head=function(){return this.next},Queue.prototype.tail=function(){return this.prev},Queue.prototype.isEmpty=function(){return this.next===this},Queue.prototype.isRoot=function(item){return this===item},exports.LockStream=LockStream,LockStream.prototype.write=function(chunks,callback){function done(err,chunks){self.stream.removeListener("error",done),self.locked=!1,self.queue.length>0&&self.queue.shift()(),callback(err,chunks)}function onData(chunk){output.push(chunk)}function next(err){if(self.stream.removeListener("data",onData),err)return done(err);done(null,output)}var self=this;if(this.locked)return void this.queue.push(function(){return self.write(chunks,callback)});this.locked=!0,this.stream.on("error",done);var output=[];this.stream.on("data",onData);for(var i=0;i0?this.stream.write(chunks[i],next):process.nextTick(next),this.stream.execute&&this.stream.execute(function(err){if(err)return done(err)})},exports.binaryLookup=binaryLookup,exports.binaryInsert=binaryInsert,exports.binarySearch=binarySearch,exports.Timeout=Timeout,Timeout.prototype.set=function(delay,callback){this.delay=delay,this.reset(),callback&&(0===this.delay?this.object.removeListener("timeout",callback):this.object.once("timeout",callback))},Timeout.prototype.reset=function(){if(null!==this.timer&&(clearTimeout(this.timer),this.timer=null),0!==this.delay){var self=this;this.timer=setTimeout(function(){self.timer=null,self.object.emit("timeout")},this.delay)}}}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";(function(process){function Side(window,name,options){EventEmitter.call(this),this.name=name,this.window=window,this.current=options.size,this.max=options.size,this.limit=options.max,this.lowWaterMark=void 0===options.lowWaterMark?this.max/2:options.lowWaterMark,this._refilling=!1,this._refillQueue=[]}function Window(options){this.id=options.id,this.isServer=options.isServer,this.debug=this.isServer?debug.server:debug.client,this.recv=new Side(this,"recv",options.recv),this.send=new Side(this,"send",options.send)}var util=__webpack_require__(10),EventEmitter=__webpack_require__(8).EventEmitter,debug={server:__webpack_require__(3)("spdy:window:server"),client:__webpack_require__(3)("spdy:window:client")};util.inherits(Side,EventEmitter),Side.prototype.setMax=function(max){this.window.debug("id=%d side=%s setMax=%d",this.window.id,this.name,max),this.max=max,this.lowWaterMark=this.max/2},Side.prototype.updateMax=function(max){var delta=max-this.max;this.window.debug("id=%d side=%s updateMax=%d delta=%d",this.window.id,this.name,max,delta),this.max=max,this.lowWaterMark=max/2,this.update(delta)},Side.prototype.setLowWaterMark=function(lwm){this.lowWaterMark=lwm},Side.prototype.update=function(size,callback){return size<=0&&callback&&this.isEmpty()?(this.window.debug("id=%d side=%s wait for refill=%d [%d/%d]",this.window.id,this.name,-size,this.current,this.max),void this._refillQueue.push({size:size,callback:callback})):(this.current+=size,this.current>this.limit?void this.emit("overflow"):(this.window.debug("id=%d side=%s update by=%d [%d/%d]",this.window.id,this.name,size,this.current,this.max),size<0&&this.isDraining()&&(this.window.debug("id=%d side=%s drained",this.window.id,this.name),this.emit("drain")),size>0&&this.current>0&&this.current<=size&&(this.window.debug("id=%d side=%s full",this.window.id,this.name),this.emit("full")),this._processRefillQueue(),void(callback&&process.nextTick(callback))))},Side.prototype.getCurrent=function(){return this.current},Side.prototype.getMax=function(){return this.max},Side.prototype.getDelta=function(){return this.max-this.current},Side.prototype.isDraining=function(){return this.current<=this.lowWaterMark},Side.prototype.isEmpty=function(){return this.current<=0},Side.prototype._processRefillQueue=function(){if(!this._refilling){for(this._refilling=!0;this._refillQueue.length>0;){var item=this._refillQueue[0];if(this.isEmpty())break;this.window.debug("id=%d side=%s refilled for size=%d",this.window.id,this.name,-item.size),this._refillQueue.shift(),this.update(item.size,item.callback)}this._refilling=!1}},module.exports=Window,Window.prototype.clone=function(id){return new Window({id:id,isServer:this.isServer,recv:{size:this.recv.max,max:this.recv.limit,lowWaterMark:this.recv.lowWaterMark},send:{size:this.send.max,max:this.send.limit,lowWaterMark:this.send.lowWaterMark}})}}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}module.exports=PassThrough;var Transform=__webpack_require__(323),util=__webpack_require__(6);util.inherits=__webpack_require__(1),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},function(module,exports,__webpack_require__){"use strict";function BufferList(){this.head=null,this.tail=null,this.length=0}var bufferShim=(__webpack_require__(0).Buffer,__webpack_require__(14));module.exports=BufferList,BufferList.prototype.push=function(v){var entry={data:v,next:null};this.length>0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};0===this.length&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(0!==this.length){var ret=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null, +this.length=0},BufferList.prototype.join=function(s){if(0===this.length)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s+p.data;return ret},BufferList.prototype.concat=function(n){if(0===this.length)return bufferShim.alloc(0);if(1===this.length)return this.head.data;for(var ret=bufferShim.allocUnsafe(n>>>0),p=this.head,i=0;p;)p.data.copy(ret,i),i+=p.data.length,p=p.next;return ret}},function(module,exports,__webpack_require__){!function(){function exec(arr,comp){"function"!=typeof comp&&(comp=function(a,b){return String(a).localeCompare(b)});var len=arr.length;if(len<=1)return arr;for(var buffer=new Array(len),chk=1;chklen&&(r=len),e>len&&(e=len),li=l,ri=r;;)if(li0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};0===this.length&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(0!==this.length){var ret=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s){if(0===this.length)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s+p.data;return ret},BufferList.prototype.concat=function(n){if(0===this.length)return bufferShim.alloc(0);if(1===this.length)return this.head.data;for(var ret=bufferShim.allocUnsafe(n>>>0),p=this.head,i=0;p;)p.data.copy(ret,i),i+=p.data.length,p=p.next;return ret}},function(module,exports,__webpack_require__){module.exports=__webpack_require__(166).PassThrough},function(module,exports,__webpack_require__){module.exports=__webpack_require__(166).Transform},function(module,exports,__webpack_require__){module.exports=__webpack_require__(165)},function(module,exports){function shift(stream){var rs=stream._readableState;return rs?rs.objectMode?stream.read():stream.read(getStateLength(rs)):null}function getStateLength(state){return state.buffer.length?state.buffer.head?state.buffer.head.data.length:state.buffer[0].length:state.length}module.exports=shift},function(module,exports,__webpack_require__){var isHexPrefixed=__webpack_require__(235);module.exports=function(str){return"string"!=typeof str?str:isHexPrefixed(str)?str.slice(2):str}},function(module,exports,__webpack_require__){"use strict";function TimeCache(options){if(!(this instanceof TimeCache))return new TimeCache(options);options=options||{};const validity=options.validity||30,entries=new Map,sweep=throttle(()=>{entries.forEach((entry,key)=>{const v=entry.validity||validity;getTimeElapsed(entry.timestamp)>v&&entries.delete(key)})},200);this.put=((key,value,validity)=>{this.has(key)||entries.set(key,{value:value,timestamp:new Date,validity:validity}),sweep()}),this.get=(key=>{if(entries.has(key))return entries.get(key).value;throw new Error("key does not exist")}),this.has=(key=>{return entries.has(key)})}function getTimeElapsed(prevTime){const currentTime=new Date,a=currentTime.getTime()-prevTime.getTime();return Math.floor(a/1e3)}const throttle=__webpack_require__(638);module.exports=TimeCache},function(module,exports){function toArray(list,index){var array=[];index=index||0;for(var i=index||0;i>24&255,x[i+1]=h>>16&255,x[i+2]=h>>8&255,x[i+3]=255&h,x[i+4]=l>>24&255,x[i+5]=l>>16&255,x[i+6]=l>>8&255,x[i+7]=255&l}function vn(x,xi,y,yi,n){var i,d=0;for(i=0;i>>8)-1}function crypto_verify_16(x,xi,y,yi){return vn(x,xi,y,yi,16)}function crypto_verify_32(x,xi,y,yi){return vn(x,xi,y,yi,32)}function core_salsa20(o,p,k,c){for(var u,j0=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,j1=255&k[0]|(255&k[1])<<8|(255&k[2])<<16|(255&k[3])<<24,j2=255&k[4]|(255&k[5])<<8|(255&k[6])<<16|(255&k[7])<<24,j3=255&k[8]|(255&k[9])<<8|(255&k[10])<<16|(255&k[11])<<24,j4=255&k[12]|(255&k[13])<<8|(255&k[14])<<16|(255&k[15])<<24,j5=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,j6=255&p[0]|(255&p[1])<<8|(255&p[2])<<16|(255&p[3])<<24,j7=255&p[4]|(255&p[5])<<8|(255&p[6])<<16|(255&p[7])<<24,j8=255&p[8]|(255&p[9])<<8|(255&p[10])<<16|(255&p[11])<<24,j9=255&p[12]|(255&p[13])<<8|(255&p[14])<<16|(255&p[15])<<24,j10=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,j11=255&k[16]|(255&k[17])<<8|(255&k[18])<<16|(255&k[19])<<24,j12=255&k[20]|(255&k[21])<<8|(255&k[22])<<16|(255&k[23])<<24,j13=255&k[24]|(255&k[25])<<8|(255&k[26])<<16|(255&k[27])<<24,j14=255&k[28]|(255&k[29])<<8|(255&k[30])<<16|(255&k[31])<<24,j15=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,x0=j0,x1=j1,x2=j2,x3=j3,x4=j4,x5=j5,x6=j6,x7=j7,x8=j8,x9=j9,x10=j10,x11=j11,x12=j12,x13=j13,x14=j14,x15=j15,i=0;i<20;i+=2)u=x0+x12|0,x4^=u<<7|u>>>25,u=x4+x0|0,x8^=u<<9|u>>>23,u=x8+x4|0,x12^=u<<13|u>>>19,u=x12+x8|0,x0^=u<<18|u>>>14,u=x5+x1|0,x9^=u<<7|u>>>25,u=x9+x5|0,x13^=u<<9|u>>>23,u=x13+x9|0,x1^=u<<13|u>>>19,u=x1+x13|0,x5^=u<<18|u>>>14,u=x10+x6|0,x14^=u<<7|u>>>25,u=x14+x10|0,x2^=u<<9|u>>>23,u=x2+x14|0,x6^=u<<13|u>>>19,u=x6+x2|0,x10^=u<<18|u>>>14,u=x15+x11|0,x3^=u<<7|u>>>25,u=x3+x15|0,x7^=u<<9|u>>>23,u=x7+x3|0,x11^=u<<13|u>>>19,u=x11+x7|0,x15^=u<<18|u>>>14,u=x0+x3|0,x1^=u<<7|u>>>25,u=x1+x0|0,x2^=u<<9|u>>>23,u=x2+x1|0,x3^=u<<13|u>>>19,u=x3+x2|0,x0^=u<<18|u>>>14,u=x5+x4|0,x6^=u<<7|u>>>25,u=x6+x5|0,x7^=u<<9|u>>>23,u=x7+x6|0,x4^=u<<13|u>>>19,u=x4+x7|0,x5^=u<<18|u>>>14,u=x10+x9|0,x11^=u<<7|u>>>25,u=x11+x10|0,x8^=u<<9|u>>>23,u=x8+x11|0,x9^=u<<13|u>>>19,u=x9+x8|0,x10^=u<<18|u>>>14,u=x15+x14|0,x12^=u<<7|u>>>25,u=x12+x15|0,x13^=u<<9|u>>>23,u=x13+x12|0,x14^=u<<13|u>>>19,u=x14+x13|0,x15^=u<<18|u>>>14;x0=x0+j0|0,x1=x1+j1|0,x2=x2+j2|0,x3=x3+j3|0,x4=x4+j4|0,x5=x5+j5|0,x6=x6+j6|0,x7=x7+j7|0,x8=x8+j8|0,x9=x9+j9|0,x10=x10+j10|0,x11=x11+j11|0,x12=x12+j12|0,x13=x13+j13|0,x14=x14+j14|0,x15=x15+j15|0,o[0]=x0>>>0&255,o[1]=x0>>>8&255,o[2]=x0>>>16&255,o[3]=x0>>>24&255,o[4]=x1>>>0&255,o[5]=x1>>>8&255,o[6]=x1>>>16&255,o[7]=x1>>>24&255,o[8]=x2>>>0&255,o[9]=x2>>>8&255,o[10]=x2>>>16&255,o[11]=x2>>>24&255,o[12]=x3>>>0&255,o[13]=x3>>>8&255,o[14]=x3>>>16&255,o[15]=x3>>>24&255,o[16]=x4>>>0&255,o[17]=x4>>>8&255,o[18]=x4>>>16&255,o[19]=x4>>>24&255,o[20]=x5>>>0&255,o[21]=x5>>>8&255,o[22]=x5>>>16&255,o[23]=x5>>>24&255,o[24]=x6>>>0&255,o[25]=x6>>>8&255,o[26]=x6>>>16&255,o[27]=x6>>>24&255,o[28]=x7>>>0&255,o[29]=x7>>>8&255,o[30]=x7>>>16&255,o[31]=x7>>>24&255,o[32]=x8>>>0&255,o[33]=x8>>>8&255,o[34]=x8>>>16&255,o[35]=x8>>>24&255,o[36]=x9>>>0&255,o[37]=x9>>>8&255,o[38]=x9>>>16&255,o[39]=x9>>>24&255,o[40]=x10>>>0&255,o[41]=x10>>>8&255,o[42]=x10>>>16&255,o[43]=x10>>>24&255,o[44]=x11>>>0&255,o[45]=x11>>>8&255,o[46]=x11>>>16&255,o[47]=x11>>>24&255,o[48]=x12>>>0&255,o[49]=x12>>>8&255,o[50]=x12>>>16&255,o[51]=x12>>>24&255,o[52]=x13>>>0&255,o[53]=x13>>>8&255,o[54]=x13>>>16&255,o[55]=x13>>>24&255,o[56]=x14>>>0&255,o[57]=x14>>>8&255,o[58]=x14>>>16&255,o[59]=x14>>>24&255,o[60]=x15>>>0&255,o[61]=x15>>>8&255,o[62]=x15>>>16&255,o[63]=x15>>>24&255}function core_hsalsa20(o,p,k,c){for(var u,j0=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,j1=255&k[0]|(255&k[1])<<8|(255&k[2])<<16|(255&k[3])<<24,j2=255&k[4]|(255&k[5])<<8|(255&k[6])<<16|(255&k[7])<<24,j3=255&k[8]|(255&k[9])<<8|(255&k[10])<<16|(255&k[11])<<24,j4=255&k[12]|(255&k[13])<<8|(255&k[14])<<16|(255&k[15])<<24,j5=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,j6=255&p[0]|(255&p[1])<<8|(255&p[2])<<16|(255&p[3])<<24,j7=255&p[4]|(255&p[5])<<8|(255&p[6])<<16|(255&p[7])<<24,j8=255&p[8]|(255&p[9])<<8|(255&p[10])<<16|(255&p[11])<<24,j9=255&p[12]|(255&p[13])<<8|(255&p[14])<<16|(255&p[15])<<24,j10=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,j11=255&k[16]|(255&k[17])<<8|(255&k[18])<<16|(255&k[19])<<24,j12=255&k[20]|(255&k[21])<<8|(255&k[22])<<16|(255&k[23])<<24,j13=255&k[24]|(255&k[25])<<8|(255&k[26])<<16|(255&k[27])<<24,j14=255&k[28]|(255&k[29])<<8|(255&k[30])<<16|(255&k[31])<<24,j15=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,x0=j0,x1=j1,x2=j2,x3=j3,x4=j4,x5=j5,x6=j6,x7=j7,x8=j8,x9=j9,x10=j10,x11=j11,x12=j12,x13=j13,x14=j14,x15=j15,i=0;i<20;i+=2)u=x0+x12|0,x4^=u<<7|u>>>25,u=x4+x0|0,x8^=u<<9|u>>>23,u=x8+x4|0,x12^=u<<13|u>>>19,u=x12+x8|0,x0^=u<<18|u>>>14,u=x5+x1|0,x9^=u<<7|u>>>25,u=x9+x5|0,x13^=u<<9|u>>>23,u=x13+x9|0,x1^=u<<13|u>>>19,u=x1+x13|0,x5^=u<<18|u>>>14,u=x10+x6|0,x14^=u<<7|u>>>25,u=x14+x10|0,x2^=u<<9|u>>>23,u=x2+x14|0,x6^=u<<13|u>>>19,u=x6+x2|0,x10^=u<<18|u>>>14,u=x15+x11|0,x3^=u<<7|u>>>25,u=x3+x15|0,x7^=u<<9|u>>>23,u=x7+x3|0,x11^=u<<13|u>>>19,u=x11+x7|0,x15^=u<<18|u>>>14,u=x0+x3|0,x1^=u<<7|u>>>25,u=x1+x0|0,x2^=u<<9|u>>>23,u=x2+x1|0,x3^=u<<13|u>>>19,u=x3+x2|0,x0^=u<<18|u>>>14,u=x5+x4|0,x6^=u<<7|u>>>25,u=x6+x5|0,x7^=u<<9|u>>>23,u=x7+x6|0,x4^=u<<13|u>>>19,u=x4+x7|0,x5^=u<<18|u>>>14,u=x10+x9|0,x11^=u<<7|u>>>25,u=x11+x10|0,x8^=u<<9|u>>>23,u=x8+x11|0,x9^=u<<13|u>>>19,u=x9+x8|0,x10^=u<<18|u>>>14,u=x15+x14|0,x12^=u<<7|u>>>25,u=x12+x15|0,x13^=u<<9|u>>>23,u=x13+x12|0,x14^=u<<13|u>>>19,u=x14+x13|0,x15^=u<<18|u>>>14;o[0]=x0>>>0&255,o[1]=x0>>>8&255,o[2]=x0>>>16&255,o[3]=x0>>>24&255,o[4]=x5>>>0&255,o[5]=x5>>>8&255,o[6]=x5>>>16&255,o[7]=x5>>>24&255,o[8]=x10>>>0&255,o[9]=x10>>>8&255,o[10]=x10>>>16&255,o[11]=x10>>>24&255,o[12]=x15>>>0&255,o[13]=x15>>>8&255,o[14]=x15>>>16&255,o[15]=x15>>>24&255,o[16]=x6>>>0&255,o[17]=x6>>>8&255,o[18]=x6>>>16&255,o[19]=x6>>>24&255,o[20]=x7>>>0&255,o[21]=x7>>>8&255,o[22]=x7>>>16&255,o[23]=x7>>>24&255,o[24]=x8>>>0&255,o[25]=x8>>>8&255,o[26]=x8>>>16&255,o[27]=x8>>>24&255,o[28]=x9>>>0&255,o[29]=x9>>>8&255,o[30]=x9>>>16&255,o[31]=x9>>>24&255}function crypto_core_salsa20(out,inp,k,c){core_salsa20(out,inp,k,c)}function crypto_core_hsalsa20(out,inp,k,c){core_hsalsa20(out,inp,k,c)}function crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k){var u,i,z=new Uint8Array(16),x=new Uint8Array(64);for(i=0;i<16;i++)z[i]=0;for(i=0;i<8;i++)z[i]=n[i];for(;b>=64;){for(crypto_core_salsa20(x,z,k,sigma),i=0;i<64;i++)c[cpos+i]=m[mpos+i]^x[i];for(u=1,i=8;i<16;i++)u=u+(255&z[i])|0,z[i]=255&u,u>>>=8;b-=64,cpos+=64,mpos+=64}if(b>0)for(crypto_core_salsa20(x,z,k,sigma),i=0;i=64;){for(crypto_core_salsa20(x,z,k,sigma),i=0;i<64;i++)c[cpos+i]=x[i];for(u=1,i=8;i<16;i++)u=u+(255&z[i])|0,z[i]=255&u,u>>>=8;b-=64,cpos+=64}if(b>0)for(crypto_core_salsa20(x,z,k,sigma),i=0;i>16&1),m[i-1]&=65535;m[15]=t[15]-32767-(m[14]>>16&1),b=m[15]>>16&1,m[14]&=65535,sel25519(t,m,1-b)}for(i=0;i<16;i++)o[2*i]=255&t[i],o[2*i+1]=t[i]>>8}function neq25519(a,b){var c=new Uint8Array(32),d=new Uint8Array(32);return pack25519(c,a),pack25519(d,b),crypto_verify_32(c,0,d,0)}function par25519(a){var d=new Uint8Array(32);return pack25519(d,a),1&d[0]}function unpack25519(o,n){var i;for(i=0;i<16;i++)o[i]=n[2*i]+(n[2*i+1]<<8);o[15]&=32767}function A(o,a,b){for(var i=0;i<16;i++)o[i]=a[i]+b[i]}function Z(o,a,b){for(var i=0;i<16;i++)o[i]=a[i]-b[i]}function M(o,a,b){var v,c,t0=0,t1=0,t2=0,t3=0,t4=0,t5=0,t6=0,t7=0,t8=0,t9=0,t10=0,t11=0,t12=0,t13=0,t14=0,t15=0,t16=0,t17=0,t18=0,t19=0,t20=0,t21=0,t22=0,t23=0,t24=0,t25=0,t26=0,t27=0,t28=0,t29=0,t30=0,b0=b[0],b1=b[1],b2=b[2],b3=b[3],b4=b[4],b5=b[5],b6=b[6],b7=b[7],b8=b[8],b9=b[9],b10=b[10],b11=b[11],b12=b[12],b13=b[13],b14=b[14],b15=b[15];v=a[0],t0+=v*b0,t1+=v*b1,t2+=v*b2,t3+=v*b3,t4+=v*b4,t5+=v*b5,t6+=v*b6,t7+=v*b7,t8+=v*b8,t9+=v*b9,t10+=v*b10,t11+=v*b11,t12+=v*b12,t13+=v*b13,t14+=v*b14,t15+=v*b15,v=a[1],t1+=v*b0,t2+=v*b1,t3+=v*b2,t4+=v*b3,t5+=v*b4,t6+=v*b5,t7+=v*b6,t8+=v*b7,t9+=v*b8,t10+=v*b9,t11+=v*b10,t12+=v*b11,t13+=v*b12,t14+=v*b13,t15+=v*b14,t16+=v*b15,v=a[2],t2+=v*b0,t3+=v*b1,t4+=v*b2,t5+=v*b3,t6+=v*b4,t7+=v*b5,t8+=v*b6,t9+=v*b7,t10+=v*b8,t11+=v*b9,t12+=v*b10,t13+=v*b11,t14+=v*b12,t15+=v*b13,t16+=v*b14,t17+=v*b15,v=a[3],t3+=v*b0,t4+=v*b1,t5+=v*b2,t6+=v*b3,t7+=v*b4,t8+=v*b5,t9+=v*b6,t10+=v*b7,t11+=v*b8,t12+=v*b9,t13+=v*b10,t14+=v*b11,t15+=v*b12,t16+=v*b13,t17+=v*b14,t18+=v*b15,v=a[4],t4+=v*b0,t5+=v*b1,t6+=v*b2,t7+=v*b3,t8+=v*b4,t9+=v*b5,t10+=v*b6,t11+=v*b7,t12+=v*b8,t13+=v*b9,t14+=v*b10,t15+=v*b11,t16+=v*b12,t17+=v*b13,t18+=v*b14,t19+=v*b15,v=a[5],t5+=v*b0,t6+=v*b1,t7+=v*b2,t8+=v*b3,t9+=v*b4,t10+=v*b5,t11+=v*b6,t12+=v*b7,t13+=v*b8,t14+=v*b9,t15+=v*b10,t16+=v*b11,t17+=v*b12,t18+=v*b13,t19+=v*b14,t20+=v*b15,v=a[6],t6+=v*b0,t7+=v*b1,t8+=v*b2,t9+=v*b3,t10+=v*b4,t11+=v*b5,t12+=v*b6,t13+=v*b7,t14+=v*b8,t15+=v*b9,t16+=v*b10,t17+=v*b11,t18+=v*b12,t19+=v*b13,t20+=v*b14,t21+=v*b15,v=a[7],t7+=v*b0,t8+=v*b1,t9+=v*b2,t10+=v*b3,t11+=v*b4,t12+=v*b5,t13+=v*b6,t14+=v*b7,t15+=v*b8,t16+=v*b9,t17+=v*b10,t18+=v*b11,t19+=v*b12,t20+=v*b13,t21+=v*b14,t22+=v*b15,v=a[8],t8+=v*b0,t9+=v*b1,t10+=v*b2,t11+=v*b3,t12+=v*b4,t13+=v*b5,t14+=v*b6,t15+=v*b7,t16+=v*b8,t17+=v*b9,t18+=v*b10,t19+=v*b11,t20+=v*b12,t21+=v*b13,t22+=v*b14,t23+=v*b15,v=a[9],t9+=v*b0,t10+=v*b1,t11+=v*b2,t12+=v*b3,t13+=v*b4,t14+=v*b5,t15+=v*b6,t16+=v*b7,t17+=v*b8,t18+=v*b9,t19+=v*b10,t20+=v*b11,t21+=v*b12,t22+=v*b13,t23+=v*b14,t24+=v*b15,v=a[10],t10+=v*b0,t11+=v*b1,t12+=v*b2,t13+=v*b3,t14+=v*b4,t15+=v*b5,t16+=v*b6,t17+=v*b7,t18+=v*b8,t19+=v*b9,t20+=v*b10,t21+=v*b11,t22+=v*b12,t23+=v*b13,t24+=v*b14,t25+=v*b15,v=a[11],t11+=v*b0,t12+=v*b1,t13+=v*b2,t14+=v*b3,t15+=v*b4,t16+=v*b5,t17+=v*b6,t18+=v*b7,t19+=v*b8,t20+=v*b9,t21+=v*b10,t22+=v*b11;t23+=v*b12,t24+=v*b13,t25+=v*b14,t26+=v*b15,v=a[12],t12+=v*b0,t13+=v*b1,t14+=v*b2,t15+=v*b3,t16+=v*b4,t17+=v*b5,t18+=v*b6,t19+=v*b7,t20+=v*b8,t21+=v*b9,t22+=v*b10,t23+=v*b11,t24+=v*b12,t25+=v*b13,t26+=v*b14,t27+=v*b15,v=a[13],t13+=v*b0,t14+=v*b1,t15+=v*b2,t16+=v*b3,t17+=v*b4,t18+=v*b5,t19+=v*b6,t20+=v*b7,t21+=v*b8,t22+=v*b9,t23+=v*b10,t24+=v*b11,t25+=v*b12,t26+=v*b13,t27+=v*b14,t28+=v*b15,v=a[14],t14+=v*b0,t15+=v*b1,t16+=v*b2,t17+=v*b3,t18+=v*b4,t19+=v*b5,t20+=v*b6,t21+=v*b7,t22+=v*b8,t23+=v*b9,t24+=v*b10,t25+=v*b11,t26+=v*b12,t27+=v*b13,t28+=v*b14,t29+=v*b15,v=a[15],t15+=v*b0,t16+=v*b1,t17+=v*b2,t18+=v*b3,t19+=v*b4,t20+=v*b5,t21+=v*b6,t22+=v*b7,t23+=v*b8,t24+=v*b9,t25+=v*b10,t26+=v*b11,t27+=v*b12,t28+=v*b13,t29+=v*b14,t30+=v*b15,t0+=38*t16,t1+=38*t17,t2+=38*t18,t3+=38*t19,t4+=38*t20,t5+=38*t21,t6+=38*t22,t7+=38*t23,t8+=38*t24,t9+=38*t25,t10+=38*t26,t11+=38*t27,t12+=38*t28,t13+=38*t29,t14+=38*t30,c=1,v=t0+c+65535,c=Math.floor(v/65536),t0=v-65536*c,v=t1+c+65535,c=Math.floor(v/65536),t1=v-65536*c,v=t2+c+65535,c=Math.floor(v/65536),t2=v-65536*c,v=t3+c+65535,c=Math.floor(v/65536),t3=v-65536*c,v=t4+c+65535,c=Math.floor(v/65536),t4=v-65536*c,v=t5+c+65535,c=Math.floor(v/65536),t5=v-65536*c,v=t6+c+65535,c=Math.floor(v/65536),t6=v-65536*c,v=t7+c+65535,c=Math.floor(v/65536),t7=v-65536*c,v=t8+c+65535,c=Math.floor(v/65536),t8=v-65536*c,v=t9+c+65535,c=Math.floor(v/65536),t9=v-65536*c,v=t10+c+65535,c=Math.floor(v/65536),t10=v-65536*c,v=t11+c+65535,c=Math.floor(v/65536),t11=v-65536*c,v=t12+c+65535,c=Math.floor(v/65536),t12=v-65536*c,v=t13+c+65535,c=Math.floor(v/65536),t13=v-65536*c,v=t14+c+65535,c=Math.floor(v/65536),t14=v-65536*c,v=t15+c+65535,c=Math.floor(v/65536),t15=v-65536*c,t0+=c-1+37*(c-1),c=1,v=t0+c+65535,c=Math.floor(v/65536),t0=v-65536*c,v=t1+c+65535,c=Math.floor(v/65536),t1=v-65536*c,v=t2+c+65535,c=Math.floor(v/65536),t2=v-65536*c,v=t3+c+65535,c=Math.floor(v/65536),t3=v-65536*c,v=t4+c+65535,c=Math.floor(v/65536),t4=v-65536*c,v=t5+c+65535,c=Math.floor(v/65536),t5=v-65536*c,v=t6+c+65535,c=Math.floor(v/65536),t6=v-65536*c,v=t7+c+65535,c=Math.floor(v/65536),t7=v-65536*c,v=t8+c+65535,c=Math.floor(v/65536),t8=v-65536*c,v=t9+c+65535,c=Math.floor(v/65536),t9=v-65536*c,v=t10+c+65535,c=Math.floor(v/65536),t10=v-65536*c,v=t11+c+65535,c=Math.floor(v/65536),t11=v-65536*c,v=t12+c+65535,c=Math.floor(v/65536),t12=v-65536*c,v=t13+c+65535,c=Math.floor(v/65536),t13=v-65536*c,v=t14+c+65535,c=Math.floor(v/65536),t14=v-65536*c,v=t15+c+65535,c=Math.floor(v/65536),t15=v-65536*c,t0+=c-1+37*(c-1),o[0]=t0,o[1]=t1,o[2]=t2,o[3]=t3,o[4]=t4,o[5]=t5,o[6]=t6,o[7]=t7,o[8]=t8,o[9]=t9,o[10]=t10,o[11]=t11,o[12]=t12;o[13]=t13,o[14]=t14,o[15]=t15}function S(o,a){M(o,a,a)}function inv25519(o,i){var a,c=gf();for(a=0;a<16;a++)c[a]=i[a];for(a=253;a>=0;a--)S(c,c),2!==a&&4!==a&&M(c,c,i);for(a=0;a<16;a++)o[a]=c[a]}function pow2523(o,i){var a,c=gf();for(a=0;a<16;a++)c[a]=i[a];for(a=250;a>=0;a--)S(c,c),1!==a&&M(c,c,i);for(a=0;a<16;a++)o[a]=c[a]}function crypto_scalarmult(q,n,p){var r,i,z=new Uint8Array(32),x=new Float64Array(80),a=gf(),b=gf(),c=gf(),d=gf(),e=gf(),f=gf();for(i=0;i<31;i++)z[i]=n[i];for(z[31]=127&n[31]|64,z[0]&=248,unpack25519(x,p),i=0;i<16;i++)b[i]=x[i],d[i]=a[i]=c[i]=0;for(a[0]=d[0]=1,i=254;i>=0;--i)r=z[i>>>3]>>>(7&i)&1,sel25519(a,b,r),sel25519(c,d,r),A(e,a,c),Z(a,a,c),A(c,b,d),Z(b,b,d),S(d,e),S(f,a),M(a,c,a),M(c,b,e),A(e,a,c),Z(a,a,c),S(b,a),Z(c,d,f),M(a,c,_121665),A(a,a,d),M(c,c,a),M(a,d,f),M(d,b,x),S(b,e),sel25519(a,b,r),sel25519(c,d,r);for(i=0;i<16;i++)x[i+16]=a[i],x[i+32]=c[i],x[i+48]=b[i],x[i+64]=d[i];var x32=x.subarray(32),x16=x.subarray(16);return inv25519(x32,x32),M(x16,x16,x32),pack25519(q,x16),0}function crypto_scalarmult_base(q,n){return crypto_scalarmult(q,n,_9)}function crypto_box_keypair(y,x){return randombytes(x,32),crypto_scalarmult_base(y,x)}function crypto_box_beforenm(k,y,x){var s=new Uint8Array(32);return crypto_scalarmult(s,x,y),crypto_core_hsalsa20(k,_0,s,sigma)}function crypto_box(c,m,d,n,y,x){var k=new Uint8Array(32);return crypto_box_beforenm(k,y,x),crypto_box_afternm(c,m,d,n,k)}function crypto_box_open(m,c,d,n,y,x){var k=new Uint8Array(32);return crypto_box_beforenm(k,y,x),crypto_box_open_afternm(m,c,d,n,k)}function crypto_hashblocks_hl(hh,hl,m,n){for(var bh0,bh1,bh2,bh3,bh4,bh5,bh6,bh7,bl0,bl1,bl2,bl3,bl4,bl5,bl6,bl7,th,tl,i,j,h,l,a,b,c,d,wh=new Int32Array(16),wl=new Int32Array(16),ah0=hh[0],ah1=hh[1],ah2=hh[2],ah3=hh[3],ah4=hh[4],ah5=hh[5],ah6=hh[6],ah7=hh[7],al0=hl[0],al1=hl[1],al2=hl[2],al3=hl[3],al4=hl[4],al5=hl[5],al6=hl[6],al7=hl[7],pos=0;n>=128;){for(i=0;i<16;i++)j=8*i+pos,wh[i]=m[j+0]<<24|m[j+1]<<16|m[j+2]<<8|m[j+3],wl[i]=m[j+4]<<24|m[j+5]<<16|m[j+6]<<8|m[j+7];for(i=0;i<80;i++)if(bh0=ah0,bh1=ah1,bh2=ah2,bh3=ah3,bh4=ah4,bh5=ah5,bh6=ah6,bh7=ah7,bl0=al0,bl1=al1,bl2=al2,bl3=al3,bl4=al4,bl5=al5,bl6=al6,bl7=al7,h=ah7,l=al7,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=(ah4>>>14|al4<<18)^(ah4>>>18|al4<<14)^(al4>>>9|ah4<<23),l=(al4>>>14|ah4<<18)^(al4>>>18|ah4<<14)^(ah4>>>9|al4<<23),a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,h=ah4&ah5^~ah4&ah6,l=al4&al5^~al4&al6,a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,h=K[2*i],l=K[2*i+1],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,h=wh[i%16],l=wl[i%16],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,th=65535&c|d<<16,tl=65535&a|b<<16,h=th,l=tl,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=(ah0>>>28|al0<<4)^(al0>>>2|ah0<<30)^(al0>>>7|ah0<<25),l=(al0>>>28|ah0<<4)^(ah0>>>2|al0<<30)^(ah0>>>7|al0<<25),a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,h=ah0&ah1^ah0&ah2^ah1&ah2,l=al0&al1^al0&al2^al1&al2,a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,bh7=65535&c|d<<16,bl7=65535&a|b<<16,h=bh3,l=bl3,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=th,l=tl,a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,bh3=65535&c|d<<16,bl3=65535&a|b<<16,ah1=bh0,ah2=bh1,ah3=bh2,ah4=bh3,ah5=bh4,ah6=bh5,ah7=bh6,ah0=bh7,al1=bl0,al2=bl1,al3=bl2,al4=bl3,al5=bl4,al6=bl5,al7=bl6,al0=bl7,i%16==15)for(j=0;j<16;j++)h=wh[j],l=wl[j],a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=wh[(j+9)%16],l=wl[(j+9)%16],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,th=wh[(j+1)%16],tl=wl[(j+1)%16],h=(th>>>1|tl<<31)^(th>>>8|tl<<24)^th>>>7,l=(tl>>>1|th<<31)^(tl>>>8|th<<24)^(tl>>>7|th<<25),a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,th=wh[(j+14)%16],tl=wl[(j+14)%16],h=(th>>>19|tl<<13)^(tl>>>29|th<<3)^th>>>6,l=(tl>>>19|th<<13)^(th>>>29|tl<<3)^(tl>>>6|th<<26),a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,wh[j]=65535&c|d<<16,wl[j]=65535&a|b<<16;h=ah0,l=al0,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[0],l=hl[0],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[0]=ah0=65535&c|d<<16,hl[0]=al0=65535&a|b<<16,h=ah1,l=al1,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[1],l=hl[1],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[1]=ah1=65535&c|d<<16,hl[1]=al1=65535&a|b<<16,h=ah2,l=al2,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[2],l=hl[2],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[2]=ah2=65535&c|d<<16,hl[2]=al2=65535&a|b<<16,h=ah3,l=al3,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[3],l=hl[3],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[3]=ah3=65535&c|d<<16,hl[3]=al3=65535&a|b<<16,h=ah4,l=al4,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[4],l=hl[4],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[4]=ah4=65535&c|d<<16,hl[4]=al4=65535&a|b<<16,h=ah5,l=al5,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[5],l=hl[5],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[5]=ah5=65535&c|d<<16,hl[5]=al5=65535&a|b<<16,h=ah6,l=al6,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[6],l=hl[6],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[6]=ah6=65535&c|d<<16,hl[6]=al6=65535&a|b<<16,h=ah7,l=al7,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[7],l=hl[7],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[7]=ah7=65535&c|d<<16,hl[7]=al7=65535&a|b<<16,pos+=128,n-=128}return n}function crypto_hash(out,m,n){var i,hh=new Int32Array(8),hl=new Int32Array(8),x=new Uint8Array(256),b=n;for(hh[0]=1779033703,hh[1]=3144134277,hh[2]=1013904242,hh[3]=2773480762,hh[4]=1359893119,hh[5]=2600822924,hh[6]=528734635,hh[7]=1541459225,hl[0]=4089235720,hl[1]=2227873595,hl[2]=4271175723,hl[3]=1595750129,hl[4]=2917565137,hl[5]=725511199,hl[6]=4215389547,hl[7]=327033209,crypto_hashblocks_hl(hh,hl,m,n),n%=128,i=0;i=0;--i)b=s[i/8|0]>>(7&i)&1,cswap(p,q,b),add(q,p),add(p,p),cswap(p,q,b)}function scalarbase(p,s){var q=[gf(),gf(),gf(),gf()];set25519(q[0],X),set25519(q[1],Y),set25519(q[2],gf1),M(q[3],X,Y),scalarmult(p,q,s)}function crypto_sign_keypair(pk,sk,seeded){var i,d=new Uint8Array(64),p=[gf(),gf(),gf(),gf()];for(seeded||randombytes(sk,32),crypto_hash(d,sk,32),d[0]&=248,d[31]&=127,d[31]|=64,scalarbase(p,d),pack(pk,p),i=0;i<32;i++)sk[i+32]=pk[i];return 0}function modL(r,x){var carry,i,j,k;for(i=63;i>=32;--i){for(carry=0,j=i-32,k=i-12;j>8,x[j]-=256*carry;x[j]+=carry,x[i]=0}for(carry=0,j=0;j<32;j++)x[j]+=carry-(x[31]>>4)*L[j],carry=x[j]>>8,x[j]&=255;for(j=0;j<32;j++)x[j]-=carry*L[j];for(i=0;i<32;i++)x[i+1]+=x[i]>>8,r[i]=255&x[i]}function reduce(r){var i,x=new Float64Array(64);for(i=0;i<64;i++)x[i]=r[i];for(i=0;i<64;i++)r[i]=0;modL(r,x)}function crypto_sign(sm,m,n,sk){var i,j,d=new Uint8Array(64),h=new Uint8Array(64),r=new Uint8Array(64),x=new Float64Array(64),p=[gf(),gf(),gf(),gf()];crypto_hash(d,sk,32),d[0]&=248,d[31]&=127,d[31]|=64;var smlen=n+64;for(i=0;i>7&&Z(r[0],gf0,r[0]),M(r[3],r[0],r[1]),0)}function crypto_sign_open(m,sm,n,pk){var i,t=new Uint8Array(32),h=new Uint8Array(64),p=[gf(),gf(),gf(),gf()],q=[gf(),gf(),gf(),gf()];if(-1,n<64)return-1;if(unpackneg(q,pk))return-1;for(i=0;i>>13|t1<<3),t2=255&key[4]|(255&key[5])<<8,this.r[2]=7939&(t1>>>10|t2<<6),t3=255&key[6]|(255&key[7])<<8,this.r[3]=8191&(t2>>>7|t3<<9),t4=255&key[8]|(255&key[9])<<8,this.r[4]=255&(t3>>>4|t4<<12),this.r[5]=t4>>>1&8190,t5=255&key[10]|(255&key[11])<<8,this.r[6]=8191&(t4>>>14|t5<<2),t6=255&key[12]|(255&key[13])<<8,this.r[7]=8065&(t5>>>11|t6<<5),t7=255&key[14]|(255&key[15])<<8,this.r[8]=8191&(t6>>>8|t7<<8),this.r[9]=t7>>>5&127,this.pad[0]=255&key[16]|(255&key[17])<<8,this.pad[1]=255&key[18]|(255&key[19])<<8,this.pad[2]=255&key[20]|(255&key[21])<<8,this.pad[3]=255&key[22]|(255&key[23])<<8,this.pad[4]=255&key[24]|(255&key[25])<<8,this.pad[5]=255&key[26]|(255&key[27])<<8,this.pad[6]=255&key[28]|(255&key[29])<<8,this.pad[7]=255&key[30]|(255&key[31])<<8};poly1305.prototype.blocks=function(m,mpos,bytes){for(var t0,t1,t2,t3,t4,t5,t6,t7,c,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,hibit=this.fin?0:2048,h0=this.h[0],h1=this.h[1],h2=this.h[2],h3=this.h[3],h4=this.h[4],h5=this.h[5],h6=this.h[6],h7=this.h[7],h8=this.h[8],h9=this.h[9],r0=this.r[0],r1=this.r[1],r2=this.r[2],r3=this.r[3],r4=this.r[4],r5=this.r[5],r6=this.r[6],r7=this.r[7],r8=this.r[8],r9=this.r[9];bytes>=16;)t0=255&m[mpos+0]|(255&m[mpos+1])<<8,h0+=8191&t0,t1=255&m[mpos+2]|(255&m[mpos+3])<<8,h1+=8191&(t0>>>13|t1<<3),t2=255&m[mpos+4]|(255&m[mpos+5])<<8,h2+=8191&(t1>>>10|t2<<6),t3=255&m[mpos+6]|(255&m[mpos+7])<<8,h3+=8191&(t2>>>7|t3<<9),t4=255&m[mpos+8]|(255&m[mpos+9])<<8,h4+=8191&(t3>>>4|t4<<12),h5+=t4>>>1&8191,t5=255&m[mpos+10]|(255&m[mpos+11])<<8,h6+=8191&(t4>>>14|t5<<2),t6=255&m[mpos+12]|(255&m[mpos+13])<<8,h7+=8191&(t5>>>11|t6<<5),t7=255&m[mpos+14]|(255&m[mpos+15])<<8,h8+=8191&(t6>>>8|t7<<8),h9+=t7>>>5|hibit,c=0,d0=c,d0+=h0*r0,d0+=h1*(5*r9),d0+=h2*(5*r8),d0+=h3*(5*r7),d0+=h4*(5*r6),c=d0>>>13,d0&=8191,d0+=h5*(5*r5),d0+=h6*(5*r4),d0+=h7*(5*r3),d0+=h8*(5*r2),d0+=h9*(5*r1),c+=d0>>>13,d0&=8191,d1=c,d1+=h0*r1,d1+=h1*r0,d1+=h2*(5*r9),d1+=h3*(5*r8),d1+=h4*(5*r7),c=d1>>>13,d1&=8191,d1+=h5*(5*r6),d1+=h6*(5*r5),d1+=h7*(5*r4),d1+=h8*(5*r3),d1+=h9*(5*r2),c+=d1>>>13,d1&=8191,d2=c,d2+=h0*r2,d2+=h1*r1,d2+=h2*r0,d2+=h3*(5*r9),d2+=h4*(5*r8),c=d2>>>13,d2&=8191,d2+=h5*(5*r7),d2+=h6*(5*r6),d2+=h7*(5*r5),d2+=h8*(5*r4),d2+=h9*(5*r3),c+=d2>>>13,d2&=8191,d3=c,d3+=h0*r3,d3+=h1*r2,d3+=h2*r1,d3+=h3*r0,d3+=h4*(5*r9),c=d3>>>13,d3&=8191,d3+=h5*(5*r8),d3+=h6*(5*r7),d3+=h7*(5*r6),d3+=h8*(5*r5),d3+=h9*(5*r4),c+=d3>>>13,d3&=8191,d4=c,d4+=h0*r4,d4+=h1*r3,d4+=h2*r2,d4+=h3*r1,d4+=h4*r0,c=d4>>>13,d4&=8191,d4+=h5*(5*r9),d4+=h6*(5*r8),d4+=h7*(5*r7),d4+=h8*(5*r6),d4+=h9*(5*r5),c+=d4>>>13,d4&=8191,d5=c,d5+=h0*r5,d5+=h1*r4,d5+=h2*r3,d5+=h3*r2,d5+=h4*r1,c=d5>>>13,d5&=8191,d5+=h5*r0,d5+=h6*(5*r9),d5+=h7*(5*r8),d5+=h8*(5*r7),d5+=h9*(5*r6),c+=d5>>>13,d5&=8191,d6=c,d6+=h0*r6,d6+=h1*r5,d6+=h2*r4,d6+=h3*r3,d6+=h4*r2,c=d6>>>13,d6&=8191,d6+=h5*r1,d6+=h6*r0,d6+=h7*(5*r9),d6+=h8*(5*r8),d6+=h9*(5*r7),c+=d6>>>13,d6&=8191,d7=c,d7+=h0*r7,d7+=h1*r6,d7+=h2*r5,d7+=h3*r4,d7+=h4*r3,c=d7>>>13,d7&=8191,d7+=h5*r2,d7+=h6*r1,d7+=h7*r0,d7+=h8*(5*r9),d7+=h9*(5*r8),c+=d7>>>13,d7&=8191,d8=c,d8+=h0*r8,d8+=h1*r7,d8+=h2*r6,d8+=h3*r5,d8+=h4*r4,c=d8>>>13,d8&=8191,d8+=h5*r3,d8+=h6*r2,d8+=h7*r1,d8+=h8*r0,d8+=h9*(5*r9),c+=d8>>>13,d8&=8191,d9=c,d9+=h0*r9,d9+=h1*r8,d9+=h2*r7,d9+=h3*r6,d9+=h4*r5,c=d9>>>13,d9&=8191,d9+=h5*r4,d9+=h6*r3,d9+=h7*r2,d9+=h8*r1,d9+=h9*r0,c+=d9>>>13,d9&=8191,c=(c<<2)+c|0,c=c+d0|0,d0=8191&c,c>>>=13,d1+=c,h0=d0,h1=d1,h2=d2,h3=d3,h4=d4,h5=d5,h6=d6,h7=d7,h8=d8,h9=d9,mpos+=16,bytes-=16;this.h[0]=h0,this.h[1]=h1,this.h[2]=h2,this.h[3]=h3,this.h[4]=h4,this.h[5]=h5,this.h[6]=h6,this.h[7]=h7,this.h[8]=h8,this.h[9]=h9},poly1305.prototype.finish=function(mac,macpos){var c,mask,f,i,g=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(c=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=c,c=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*c,c=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=c,c=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=c,g[0]=this.h[0]+5,c=g[0]>>>13,g[0]&=8191,i=1;i<10;i++)g[i]=this.h[i]+c,c=g[i]>>>13,g[i]&=8191;for(g[9]-=8192,mask=(1^c)-1,i=0;i<10;i++)g[i]&=mask;for(mask=~mask,i=0;i<10;i++)this.h[i]=this.h[i]&mask|g[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),f=this.h[0]+this.pad[0],this.h[0]=65535&f,i=1;i<8;i++)f=(this.h[i]+this.pad[i]|0)+(f>>>16)|0,this.h[i]=65535&f;mac[macpos+0]=this.h[0]>>>0&255,mac[macpos+1]=this.h[0]>>>8&255,mac[macpos+2]=this.h[1]>>>0&255,mac[macpos+3]=this.h[1]>>>8&255,mac[macpos+4]=this.h[2]>>>0&255,mac[macpos+5]=this.h[2]>>>8&255,mac[macpos+6]=this.h[3]>>>0&255,mac[macpos+7]=this.h[3]>>>8&255,mac[macpos+8]=this.h[4]>>>0&255,mac[macpos+9]=this.h[4]>>>8&255,mac[macpos+10]=this.h[5]>>>0&255,mac[macpos+11]=this.h[5]>>>8&255,mac[macpos+12]=this.h[6]>>>0&255,mac[macpos+13]=this.h[6]>>>8&255,mac[macpos+14]=this.h[7]>>>0&255,mac[macpos+15]=this.h[7]>>>8&255},poly1305.prototype.update=function(m,mpos,bytes){var i,want;if(this.leftover){for(want=16-this.leftover,want>bytes&&(want=bytes),i=0;i=16&&(want=bytes-bytes%16,this.blocks(m,mpos,want),mpos+=want,bytes-=want),bytes){for(i=0;i=0},nacl.sign.keyPair=function(){var pk=new Uint8Array(32),sk=new Uint8Array(64);return crypto_sign_keypair(pk,sk),{publicKey:pk,secretKey:sk}},nacl.sign.keyPair.fromSecretKey=function(secretKey){if(checkArrayTypes(),64!==secretKey.length)throw new Error("bad secret key size");for(var pk=new Uint8Array(32),i=0;i>>((3&i)<<3)&255;return rnds}}module.exports=rng}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const varint=__webpack_require__(16);module.exports=(buf=>{if(!Buffer.isBuffer(buf))throw new Error("arg needs to be a buffer");let result=[];for(;buf.length>0;){const num=varint.decode(buf);result.push(num),buf=buf.slice(varint.decode.bytes)}return result})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports){function read(buf,offset){var b,res=0,offset=offset||0,shift=0,counter=offset,l=buf.length;do{if(counter>=l)throw read.bytes=0,new RangeError("Could not decode varint");b=buf[counter++],res+=shift<28?(b&REST)<=MSB);return read.bytes=counter-offset,res}module.exports=read;var MSB=128,REST=127},function(module,exports){function encode(num,out,offset){out=out||[],offset=offset||0;for(var oldOffset=offset;num>=INT;)out[offset++]=255&num|MSB,num/=128;for(;num&MSBALL;)out[offset++]=255&num|MSB,num>>>=7;return out[offset]=0|num,encode.bytes=offset-oldOffset+1,out}module.exports=encode;var MSB=128,MSBALL=-128,INT=Math.pow(2,31)},function(module,exports){var N1=Math.pow(2,7),N2=Math.pow(2,14),N3=Math.pow(2,21),N4=Math.pow(2,28),N5=Math.pow(2,35),N6=Math.pow(2,42),N7=Math.pow(2,49),N8=Math.pow(2,56),N9=Math.pow(2,63);module.exports=function(value){return value=26||"moz"===prefix&&version>=33),AudioContext=self.AudioContext||self.webkitAudioContext,videoEl=self.document&&document.createElement("video"),supportVp8=videoEl&&videoEl.canPlayType&&"probably"===videoEl.canPlayType('video/webm; codecs="vp8", vorbis'),getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.msGetUserMedia||navigator.mozGetUserMedia;module.exports={prefix:prefix,browserVersion:version,support:!!PC&&!!getUserMedia,supportRTCPeerConnection:!!PC,supportVp8:supportVp8,supportGetUserMedia:!!getUserMedia,supportDataChannel:!!(PC&&PC.prototype&&PC.prototype.createDataChannel),supportWebAudio:!(!AudioContext||!AudioContext.prototype.createMediaStreamSource),supportMediaStream:!(!MediaStream||!MediaStream.prototype.removeTrack),supportScreenSharing:!!screenSharing,AudioContext:AudioContext,PeerConnection:PC,SessionDescription:SessionDescription,IceCandidate:IceCandidate,MediaStream:MediaStream,getUserMedia:getUserMedia}},function(module,exports,__webpack_require__){"use strict";const waterfall=__webpack_require__(9),series=__webpack_require__(40),extend=__webpack_require__(200);module.exports=(self=>{self.log("booting");const options=self._options,doInit=options.init,doStart=options.start,config=options.config,setConfig=config&&"object"==typeof config,repoOpen=!self._repo.closed,customInitOptions="object"==typeof options.init?options.init:{},initOptions=Object.assign({bits:2048},customInitOptions),maybeOpenRepo=cb=>{if(repoOpen)return cb(null,!0);series([cb=>self._repo.open(cb),cb=>self.preStart(cb),cb=>{self.state.initialized(),cb(null,!0)}],(err,res)=>{if(err)return err.message.match(/not found/)||err.message.match(/ENOENT/)||err.message.match(/No value/)?cb(null,!1):cb(err);cb(null,res)})},done=err=>{if(err)return self.emit("error",err);self.emit("ready"),self.log("boot:done",err)},tasks=[];maybeOpenRepo((err,hasRepo)=>{if(err)return done(err);if(doInit&&!hasRepo&&(tasks.push(cb=>self.init(initOptions,cb)),hasRepo=!0),setConfig&&(hasRepo?tasks.push(cb=>{waterfall([cb=>self.config.get(cb),(config,cb)=>{extend(config,options.config),self.config.replace(config,cb)}],cb)}):console.log('WARNING, trying to set config on uninitialized repo, maybe forgot to set "init: true"')),doStart){if(!hasRepo)return console.log('WARNING, trying to start ipfs node on uninitialized repo, maybe forgot to set "init: true"'),done(new Error("Uninitalized repo"));tasks.push(cb=>self.start(cb))}series(tasks,done)})})},function(module,exports,__webpack_require__){"use strict";function formatWantlist(list){return Array.from(list).map(e=>e[1])}const OFFLINE_ERROR=__webpack_require__(169).OFFLINE_ERROR;module.exports=function(self){return{wantlist:()=>{if(!self.isOnline())throw OFFLINE_ERROR;return formatWantlist(self._bitswap.getWantlist())},stat:()=>{if(!self.isOnline())throw OFFLINE_ERROR;const stats=self._bitswap.stat();return stats.wantlist=formatWantlist(stats.wantlist),stats.peers=stats.peers.map(id=>id.toB58String()),stats},unwant:key=>{if(!self.isOnline())throw OFFLINE_ERROR}}}},function(module,exports,__webpack_require__){"use strict";function cleanCid(cid){return CID.isCID(cid)?cid:new CID(cid)}const Block=__webpack_require__(60),multihash=__webpack_require__(17),multihashing=__webpack_require__(30),CID=__webpack_require__(12),waterfall=__webpack_require__(9);module.exports=function(self){return{get:(cid,callback)=>{cid=cleanCid(cid),self._blockService.get(cid,callback)},put:(block,options,callback)=>{if("function"==typeof options&&(callback=options,options={}),Array.isArray(block))return callback(new Error("Array is not supported"));waterfall([cb=>{if(Block.isBlock(block))return cb(null,block);if(options.cid&&CID.isCID(options.cid))return cb(null,new Block(block,options.cid));const mhtype=options.mhtype||"sha2-256",format=options.format||"dag-pb",cidVersion=options.version||0;multihashing(block,mhtype,(err,multihash)=>{if(err)return cb(err);cb(null,new Block(block,new CID(cidVersion,format,multihash)))})},(block,cb)=>self._blockService.put(block,err=>{if(err)return cb(err);cb(null,block)})],callback)},rm:(cid,callback)=>{cid=cleanCid(cid),self._blockService.delete(cid,callback)},stat:(cid,callback)=>{cid=cleanCid(cid),self._blockService.get(cid,(err,block)=>{if(err)return callback(err);callback(null,{key:multihash.toB58String(cid.multihash),size:block.data.length})})}}}},function(module,exports,__webpack_require__){"use strict";const isNode=__webpack_require__(97),defaultNodes=isNode?__webpack_require__(240).Bootstrap:__webpack_require__(239).Bootstrap;module.exports=function(self){return{list:callback=>{self._repo.config.get((err,config)=>{if(err)return callback(err);callback(null,{Peers:config.Bootstrap})})},add:(multiaddr,args,callback)=>{"function"==typeof args&&(callback=args,args={default:!1}),self._repo.config.get((err,config)=>{if(err)return callback(err);args.default?config.Bootstrap=defaultNodes:multiaddr&&config.Bootstrap.push(multiaddr),self._repo.config.set(config,err=>{if(err)return callback(err);callback(null,{Peers:args.default?defaultNodes:[multiaddr]})})})},rm:(multiaddr,args,callback)=>{"function"==typeof args&&(callback=args,args={all:!1}),self._repo.config.get((err,config)=>{if(err)return callback(err);args.all?config.Bootstrap=[]:config.Bootstrap=config.Bootstrap.filter(mh=>mh!==multiaddr),self._repo.config.set(config,err=>{if(err)return callback(err);const res=[];!args.all&&multiaddr&&res.push(multiaddr),callback(null,{Peers:res})})})}}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const promisify=__webpack_require__(25),_get=__webpack_require__(262),_has=__webpack_require__(631),_set=__webpack_require__(636);module.exports=function(self){return{get:promisify((key,callback)=>{return"function"==typeof key&&(callback=key,key=void 0),key?"string"!=typeof key?callback(new Error("Invalid key type")):void self._repo.config.get((err,config)=>{if(err)return callback(err);if(_has(config,key)){const value=_get(config,key,void 0);callback(null,value)}else callback(new Error("Key does not exist in config"))}):self._repo.config.get(callback)}),set:promisify((key,value,callback)=>{return key&&"string"==typeof key?void 0===value||Buffer.isBuffer(value)?callback(new Error("Invalid value type")):void self._repo.config.get((err,config)=>{if(err)return callback(err);_set(config,key,value),self.config.replace(config,callback)}):callback(new Error("Invalid key type"))}),replace:promisify((config,callback)=>{self._repo.config.set(config,callback)})}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(25),CID=__webpack_require__(12),pull=__webpack_require__(5);module.exports=function(self){return{put:promisify((dagNode,options,callback)=>{self._ipldResolver.put(dagNode,options,callback)}),get:promisify((cid,path,options,callback)=>{if("function"==typeof path&&(callback=path,path=void 0),"function"==typeof options&&(callback=options,options={}),options=options||{},"string"==typeof cid){const split=cid.split("/");cid=new CID(split[0]),split.shift(),path=split.length>0?split.join("/"):"/"}self._ipldResolver.get(cid,path,options,callback)}),tree:promisify((cid,path,options,callback)=>{if("object"==typeof path&&(callback=options,options=path,path=void 0),"function"==typeof path&&(callback=path,path=void 0),"function"==typeof options&&(callback=options,options={}),options=options||{},"string"==typeof cid){const split=cid.split("/");cid=new CID(split[0]),split.shift(),path=split.length>0?split.join("/"):void 0}pull(self._ipldResolver.treeStream(cid,path,options),pull.collect(callback))})}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const promisify=__webpack_require__(25),every=__webpack_require__(347),PeerId=__webpack_require__(31),CID=__webpack_require__(12),each=__webpack_require__(32);module.exports=(self=>{return{get:promisify((key,options,callback)=>{if(!Buffer.isBuffer(key))return callback(new Error("Not valid key"));"function"==typeof options&&(callback=options,options={}),self._libp2pNode.dht.get(key,options.timeout,callback)}),put:promisify((key,value,callback)=>{if(!Buffer.isBuffer(key))return callback(new Error("Not valid key"));self._libp2pNode.dht.put(key,value,callback)}), +findprovs:promisify((key,callback)=>{"string"==typeof key&&(key=new CID(key)),self._libp2pNode.contentRouting.findProviders(key,callback)}),findpeer:promisify((peer,callback)=>{"string"==typeof peer&&(peer=PeerId.createFromB58String(peer)),self._libp2pNode.peerRouting.findPeer(peer,(err,info)=>{if(err)return callback(err);callback(null,[{Responses:[{ID:info.id.toB58String(),Addresses:info.multiaddrs.toArray().map(a=>a.toString())}]}])})}),provide:promisify((keys,options,callback)=>{Array.isArray(keys)||(keys=[keys]),"function"==typeof options&&(callback=options,options={}),every(keys,(key,cb)=>{self._repo.blockstore.has(key,cb)},(err,has)=>{if(err)return callback(err);options.recursive||each(keys,(cid,cb)=>{self._libp2pNode.contentRouting.provide(cid,cb)},callback)})}),query:promisify((peerId,callback)=>{"string"==typeof peerId&&(peerId=PeerId.createFromB58String(peerId)),self._libp2pNode._dht.getClosestPeers(peerId.toBytes(),(err,peerIds)=>{if(err)return callback(err);callback(null,peerIds.map(id=>{return{ID:id.toB58String()}}))})})}})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function prepareFile(self,file,callback){const bs58mh=multihashes.toB58String(file.multihash);waterfall([cb=>self.object.get(file.multihash,cb),(node,cb)=>{cb(null,{path:file.path||bs58mh,hash:bs58mh,size:node.size})}],callback)}function normalizeContent(content){return Array.isArray(content)||(content=[content]),content.map(data=>{return Buffer.isBuffer(data)&&(data={path:"",content:pull.values([data])}),isStream.isReadable(data)&&(data={path:"",content:toPull.source(data)}),data&&data.content&&"function"!=typeof data.content&&(Buffer.isBuffer(data.content)&&(data.content=pull.values([data.content])),isStream.isReadable(data.content)&&(data.content=toPull.source(data.content))),data})}function noop(){}const unixfsEngine=__webpack_require__(497),importer=unixfsEngine.importer,exporter=unixfsEngine.exporter,UnixFS=__webpack_require__(42),promisify=__webpack_require__(25),multihashes=__webpack_require__(17),pull=__webpack_require__(5),sort=__webpack_require__(730),pushable=__webpack_require__(36),toStream=__webpack_require__(158),toPull=__webpack_require__(120),CID=__webpack_require__(12),waterfall=__webpack_require__(9),isStream=__webpack_require__(543),Duplex=__webpack_require__(308).Duplex;module.exports=function(self){const createAddPullStream=options=>{const opts=Object.assign({},{shardSplitThreshold:self._options.EXPERIMENTAL.sharding?1e3:1/0},options);return pull(pull.map(normalizeContent),pull.flatten(),importer(self._ipldResolver,opts),pull.asyncMap(prepareFile.bind(null,self)))};return{createAddStream:(options,callback)=>{"function"==typeof options&&(callback=options,options=void 0);const addPullStream=createAddPullStream(options),p=pushable(),s=pull(p,addPullStream),retStream=new AddStreamDuplex(s,p);retStream.once("finish",()=>p.end()),callback(null,retStream)},createAddPullStream:createAddPullStream,add:promisify((data,options,callback)=>{if("function"==typeof options?(callback=options,options=void 0):callback&&"function"==typeof callback||(callback=noop),"object"!=typeof data&&!Buffer.isBuffer(data)&&!isStream(data))return callback(new Error("Invalid arguments, data must be an object, Buffer or readable stream"));pull(pull.values(normalizeContent(data)),importer(self._ipldResolver,options),pull.asyncMap(prepareFile.bind(null,self)),sort((a,b)=>{return a.pathb.path?-1:0}),pull.collect(callback))}),cat:promisify((hash,callback)=>{if("function"==typeof hash)return callback(new Error("You must supply a multihash"));self._ipldResolver.get(new CID(hash),(err,result)=>{if(err)return callback(err);const node=result.value;if("directory"===UnixFS.unmarshal(node.data).type)return callback(new Error("This dag node is a directory"));pull(exporter(hash,self._ipldResolver),pull.collect((err,files)=>{if(err)return callback(err);callback(null,toStream.source(files[0].content))}))})}),get:promisify((hash,callback)=>{callback(null,toStream.source(pull(exporter(hash,self._ipldResolver),pull.map(file=>{return file.content&&(file.content=toStream.source(file.content),file.content.pause()),file}))))}),getPull:promisify((hash,callback)=>{callback(null,exporter(hash,self._ipldResolver))})}};class AddStreamDuplex extends Duplex{constructor(pullStream,push,options){super(Object.assign({objectMode:!0},options)),this._pullStream=pullStream,this._pushable=push,this._waitingPullFlush=[]}_read(){this._pullStream(null,(end,data)=>{for(;this._waitingPullFlush.length;){const cb=this._waitingPullFlush.shift();cb()}end?end instanceof Error&&this.emit("error",end):this.push(data)})}_write(chunk,encoding,callback){this._waitingPullFlush.push(callback),this._pushable.push(chunk)}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(setImmediate){const promisify=__webpack_require__(25);module.exports=function(self){return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),setImmediate(()=>callback(null,{id:self._peerInfo.id.toB58String(),publicKey:self._peerInfo.id.pubKey.bytes.toString("base64"),addresses:self._peerInfo.multiaddrs.toArray().map(ma=>ma.toString()).filter(ma=>ma.indexOf("ipfs")>=0).sort(),agentVersion:"js-ipfs",protocolVersion:"9000"}))})}}).call(exports,__webpack_require__(22).setImmediate)},function(module,exports,__webpack_require__){"use strict";exports.preStart=__webpack_require__(845),exports.start=__webpack_require__(848),exports.stop=__webpack_require__(849),exports.isOnline=__webpack_require__(841),exports.version=__webpack_require__(851),exports.id=__webpack_require__(838),exports.repo=__webpack_require__(847),exports.init=__webpack_require__(840),exports.bootstrap=__webpack_require__(833),exports.config=__webpack_require__(834),exports.block=__webpack_require__(832),exports.object=__webpack_require__(843),exports.dag=__webpack_require__(835),exports.libp2p=__webpack_require__(842),exports.swarm=__webpack_require__(850),exports.ping=__webpack_require__(844),exports.files=__webpack_require__(837),exports.bitswap=__webpack_require__(831),exports.pubsub=__webpack_require__(846),exports.dht=__webpack_require__(836)},function(module,exports,__webpack_require__){"use strict";(function(process){const peerId=__webpack_require__(31),waterfall=__webpack_require__(9),parallel=__webpack_require__(46),isNode=__webpack_require__(97),promisify=__webpack_require__(25),addDefaultAssets=__webpack_require__(870);module.exports=function(self){return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={});const done=(err,res)=>{if(err)return self.emit("error",err),callback(err);self.state.initialized(),self.emit("init"),callback(null,res)};if("uninitalized"!==self.state.state())return done(new Error("Not able to init from state: "+self.state.state()));self.state.init(),self.log("init"),opts.emptyRepo=opts.emptyRepo||!1,opts.bits=Number(opts.bits)||2048,opts.log=opts.log||function(){};const config=__webpack_require__(isNode?240:239);waterfall([cb=>self._repo.exists(cb),(exists,cb)=>{if(self.log("repo exists?",exists),exists===!0)return cb(new Error("repo already exists"));opts.log(`generating ${opts.bits}-bit RSA keypair...`,!1),self.log("generating peer id: %s bits",opts.bits),peerId.create({bits:opts.bits},cb)},(keys,cb)=>{self.log("identity generated"),config.Identity={PeerID:keys.toB58String(),PrivKey:keys.privKey.bytes.toString("base64")},opts.log("done"),opts.log("peer identity: "+config.Identity.PeerID);const isWin=/^win/.test(process.platform),isLinux=/^linux/.test(process.platform);if((!process.env.IPFS_WRTC_LINUX_WINDOWS||self._options.EXPERIMENTAL.wrtcLinuxWindows)&&(isWin||isLinux)){console.log("WARNING: Your platform does not have native WebRTC support, it won' use any WebRTC transport");const newAddrs=config.Addresses.Swarm.filter(addr=>{return addr.indexOf("libp2p-webrtc-star")<0});config.Addresses.Swarm=newAddrs}self._repo.init(config,cb)},(_,cb)=>self._repo.open(cb),cb=>{if(self.log("repo opened"),opts.emptyRepo)return cb(null,!0);const tasks=[cb=>self.object.new("unixfs-dir",cb)];"function"==typeof addDefaultAssets&&tasks.push(cb=>addDefaultAssets(self,opts.log,cb)),parallel(tasks,err=>{err?cb(err):cb(null,!0)})}],done)})}}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";module.exports=function(self){return()=>{return Boolean(self._bitswap&&self._libp2pNode)}}},function(module,exports,__webpack_require__){"use strict";const Node=__webpack_require__(584),promisify=__webpack_require__(25),get=__webpack_require__(262);module.exports=function(self){return{start:promisify(callback=>{function gotConfig(err,config){if(err)return callback(err);const options={mdns:get(config,"Discovery.MDNS.Enabled"),webRTCStar:get(config,"Discovery.webRTCStar.Enabled"),bootstrap:get(config,"Bootstrap"),dht:self._options.EXPERIMENTAL.dht};self._libp2pNode=new Node(self._peerInfo,self._peerInfoBook,options),self._libp2pNode.on("peer:discovery",peerInfo=>{self.isOnline()&&(self._peerInfoBook.put(peerInfo),self._libp2pNode.dial(peerInfo,()=>{}))}),self._libp2pNode.on("peer:connect",peerInfo=>{self._peerInfoBook.put(peerInfo)}),self._libp2pNode.start(err=>{if(err)return callback(err);self._libp2pNode.peerInfo.multiaddrs.forEach(ma=>{console.log("Swarm listening on",ma.toString())}),callback()})}self.config.get(gotConfig)}),stop:promisify(callback=>{self._libp2pNode.stop(callback)})}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function normalizeMultihash(multihash,enc){if("string"==typeof multihash)return"base58"!==enc&&enc?new Buffer(multihash,enc):multihash;if(Buffer.isBuffer(multihash))return multihash;throw new Error("unsupported multihash")}function parseBuffer(buf,encoding,callback){switch(encoding){case"json":return parseJSONBuffer(buf,callback);case"protobuf":return parseProtoBuffer(buf,callback);default:callback(new Error(`unkown encoding: ${encoding}`))}}function parseJSONBuffer(buf,callback){let data,links;try{const parsed=JSON.parse(buf.toString());links=(parsed.Links||[]).map(link=>{return new DAGLink(link.Name||link.name,link.Size||link.size,mh.fromB58String(link.Hash||link.hash||link.multihash))}),data=new Buffer(parsed.Data)}catch(err){return callback(new Error("failed to parse JSON: "+err))}DAGNode.create(data,links,callback)}function parseProtoBuffer(buf,callback){dagPB.util.deserialize(buf,callback)}const waterfall=__webpack_require__(9),promisify=__webpack_require__(25),dagPB=__webpack_require__(62),DAGNode=dagPB.DAGNode,DAGLink=dagPB.DAGLink,CID=__webpack_require__(12),mh=__webpack_require__(17),Unixfs=__webpack_require__(42),assert=__webpack_require__(7);module.exports=function(self){function editAndSave(edit){return(multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={}),waterfall([cb=>{self.object.get(multihash,options,cb)},(node,cb)=>{edit(node,(err,node)=>{if(err)return cb(err);self._ipldResolver.put(node,{cid:new CID(node.multihash)},err=>{cb(err,node)})})}],callback)}}return{new:promisify((template,callback)=>{"function"==typeof template&&(callback=template,template=void 0);let data;template?(assert("unixfs-dir"===template,"unkown template"),data=new Unixfs("directory").marshal()):data=new Buffer(0),DAGNode.create(data,(err,node)=>{if(err)return callback(err);self._ipldResolver.put(node,{cid:new CID(node.multihash)},err=>{if(err)return callback(err);callback(null,node)})})}),put:promisify((obj,options,callback)=>{function next(){self._ipldResolver.put(node,{cid:new CID(node.multihash)},err=>{if(err)return callback(err);self.object.get(node.multihash,callback)})}"function"==typeof options&&(callback=options,options={});const encoding=options.enc;let node;if(Buffer.isBuffer(obj))encoding?parseBuffer(obj,encoding,(err,_node)=>{if(err)return callback(err);node=_node,next()}):DAGNode.create(obj,(err,_node)=>{if(err)return callback(err);node=_node,next()});else if(obj.multihash)node=obj,next();else{if("object"!=typeof obj)return callback(new Error("obj not recognized"));DAGNode.create(obj.Data,obj.Links,(err,_node)=>{if(err)return callback(err);node=_node,next()})}}),get:promisify((multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={});let mh;try{mh=normalizeMultihash(multihash,options.enc)}catch(err){return callback(err)}const cid=new CID(mh);self._ipldResolver.get(cid,(err,result)=>{if(err)return callback(err);callback(null,result.value)})}),data:promisify((multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={}),self.object.get(multihash,options,(err,node)=>{if(err)return callback(err);callback(null,node.data)})}),links:promisify((multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={}),self.object.get(multihash,options,(err,node)=>{if(err)return callback(err);callback(null,node.links)})}),stat:promisify((multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={}),self.object.get(multihash,options,(err,node)=>{if(err)return callback(err);dagPB.util.serialize(node,(err,serialized)=>{if(err)return callback(err);const blockSize=serialized.length,linkLength=node.links.reduce((a,l)=>a+l.size,0);callback(null,{Hash:node.toJSON().multihash,NumLinks:node.links.length,BlockSize:blockSize,LinksSize:blockSize-node.data.length,DataSize:node.data.length,CumulativeSize:blockSize+linkLength})})})}),patch:promisify({addLink(multihash,link,options,callback){editAndSave((node,cb)=>{DAGNode.addLink(node,link,cb)})(multihash,options,callback)},rmLink(multihash,linkRef,options,callback){editAndSave((node,cb)=>{linkRef.constructor&&"DAGLink"===linkRef.constructor.name&&(linkRef=linkRef._name),DAGNode.rmLink(node,linkRef,cb)})(multihash,options,callback)},appendData(multihash,data,options,callback){editAndSave((node,cb)=>{const newData=Buffer.concat([node.data,data]);DAGNode.create(newData,node.links,cb)})(multihash,options,callback)},setData(multihash,data,options,callback){editAndSave((node,cb)=>{DAGNode.create(data,node.links,cb)})(multihash,options,callback)}})}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(25);module.exports=function(self){return promisify(callback=>{callback(new Error("Not implemented"))})}},function(module,exports,__webpack_require__){"use strict";const peerId=__webpack_require__(31),PeerInfo=__webpack_require__(51),multiaddr=__webpack_require__(34),waterfall=__webpack_require__(9),mafmt=__webpack_require__(110);module.exports=function(self){return callback=>{self.log("pre-start"),waterfall([cb=>self._repo.config.get(cb),(config,cb)=>{const privKey=config.Identity.PrivKey;peerId.createFromPrivKey(privKey,(err,id)=>cb(err,config,id))},(config,id,cb)=>{self._peerInfo=new PeerInfo(id),config.Addresses.Swarm.forEach(addr=>{let ma=multiaddr(addr);mafmt.IPFS.matches(ma)||(ma=ma.encapsulate("/ipfs/"+self._peerInfo.id.toB58String())),self._peerInfo.multiaddrs.add(ma)}),cb()}],callback)}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const promisify=__webpack_require__(25),setImmediate=__webpack_require__(11),OFFLINE_ERROR=__webpack_require__(169).OFFLINE_ERROR;module.exports=function(self){function subscribe(topic,options,handler,callback){const ps=self._pubsub;0===ps.listenerCount(topic)&&ps.subscribe(topic),ps.on(topic,handler),setImmediate(()=>callback())}return{subscribe:(topic,options,handler,callback)=>{if(!self.isOnline())throw OFFLINE_ERROR;if("function"==typeof options&&(callback=handler,handler=options,options={}),!callback)return new Promise((resolve,reject)=>{subscribe(topic,options,handler,err=>{if(err)return reject(err);resolve()})});subscribe(topic,options,handler,callback)},unsubscribe:(topic,handler)=>{const ps=self._pubsub;ps.removeListener(topic,handler),0===ps.listenerCount(topic)&&ps.unsubscribe(topic)},publish:promisify((topic,data,callback)=>{return self.isOnline()?Buffer.isBuffer(data)?(self._pubsub.publish(topic,data),void setImmediate(()=>callback())):setImmediate(()=>callback(new Error("data must be a Buffer"))):setImmediate(()=>callback(OFFLINE_ERROR))}),ls:promisify(callback=>{if(!self.isOnline())return setImmediate(()=>callback(OFFLINE_ERROR));const subscriptions=Array.from(self._pubsub.subscriptions);setImmediate(()=>callback(null,subscriptions))}),peers:promisify((topic,callback)=>{if(!self.isOnline())return setImmediate(()=>callback(OFFLINE_ERROR));const peers=Array.from(self._pubsub.peers.values()).filter(peer=>peer.topics.has(topic)).map(peer=>peer.info.id.toB58String());setImmediate(()=>callback(null,peers))}),setMaxListeners(n){return self._pubsub.setMaxListeners(n)}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";module.exports=function(self){return{init:(bits,empty,callback)=>{},version:callback=>{self._repo.version.get(callback)},gc:function(){},path:()=>self._repo.path}}},function(module,exports,__webpack_require__){"use strict";const series=__webpack_require__(40),Bitswap=__webpack_require__(463),FloodSub=__webpack_require__(576),setImmediate=__webpack_require__(11),promisify=__webpack_require__(25);module.exports=(self=>{return promisify(callback=>{callback=callback||function(){};const done=err=>{if(err)return setImmediate(()=>self.emit("error",err)),callback(err);self.state.started(),setImmediate(()=>self.emit("start")),callback()};if("stopped"!==self.state.state())return done(new Error("Not able to start from state: "+self.state.state()));self.log("starting"),self.state.start(),series([cb=>{self._repo.closed?self._repo.open(cb):cb()},cb=>self.preStart(cb),cb=>self.libp2p.start(cb)],err=>{if(err)return done(err);self._bitswap=new Bitswap(self._libp2pNode,self._repo.blockstore,self._peerInfoBook),self._bitswap.start(),self._blockService.goOnline(self._bitswap),self._options.EXPERIMENTAL.pubsub?(self._pubsub=new FloodSub(self._libp2pNode),self._pubsub.start(done)):done()})})})},function(module,exports,__webpack_require__){"use strict";const series=__webpack_require__(40);module.exports=(self=>{return callback=>{callback=callback||function(){},self.log("stop");const done=err=>{if(err)return self.emit("error",err),callback(err);self.state.stopped(),self.emit("stop"),callback()};if("running"!==self.state.state())return done(new Error("Not able to stop from state: "+self.state.state()));self.state.stop(),self._blockService.goOffline(),self._bitswap.stop(),series([cb=>{self._options.EXPERIMENTAL.pubsub?self._pubsub.stop(cb):cb()},cb=>self.libp2p.stop(cb),cb=>self._repo.close(cb)],done)}})},function(module,exports,__webpack_require__){"use strict";const multiaddr=__webpack_require__(34),promisify=__webpack_require__(25),flatMap=__webpack_require__(629),values=__webpack_require__(149),OFFLINE_ERROR=__webpack_require__(169).OFFLINE_ERROR;module.exports=function(self){return{peers:promisify((opts,callback)=>{if("function"==typeof opts&&(callback=opts,opts={}),!self.isOnline())return callback(OFFLINE_ERROR);const verbose=opts.v||opts.verbose,peers=self._peerInfoBook.getAll();callback(null,flatMap(Object.keys(peers),id=>{return peers[id].multiaddrs.toArray().map(addr=>{const res={addr:addr,peer:peers[id]};return verbose&&(res.latency="unknown"),res})}))}),addrs:promisify(callback=>{if(!self.isOnline())return callback(OFFLINE_ERROR);callback(null,values(self._peerInfoBook.getAll()).filter(peer=>peer.isConnected()))}),localAddrs:promisify(callback=>{if(!self.isOnline())return callback(OFFLINE_ERROR);callback(null,self._libp2pNode.peerInfo.multiaddrs.toArray())}),connect:promisify((maddr,callback)=>{if(!self.isOnline())return callback(OFFLINE_ERROR);"string"==typeof maddr&&(maddr=multiaddr(maddr)),self._libp2pNode.dial(maddr,callback)}),disconnect:promisify((maddr,callback)=>{if(!self.isOnline())return callback(OFFLINE_ERROR);"string"==typeof maddr&&(maddr=multiaddr(maddr)),self._libp2pNode.hangUp(maddr,callback)}),filters:promisify(callback=>callback(new Error("Not implemented")))}}},function(module,exports,__webpack_require__){"use strict";const pkg=__webpack_require__(546),promisify=__webpack_require__(25);module.exports=function(self){return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),callback(null,{version:pkg.version,repo:"",commit:""})})}},function(module,exports,__webpack_require__){"use strict";const IPFSRepo=__webpack_require__(221);module.exports=(dir=>{return new IPFSRepo(dir||"ipfs")})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const BlockService=__webpack_require__(220),IPLDResolver=__webpack_require__(537),PeerId=__webpack_require__(31),PeerInfo=__webpack_require__(51),multiaddr=__webpack_require__(34),multihash=__webpack_require__(17),PeerBook=__webpack_require__(292),CID=__webpack_require__(12),debug=__webpack_require__(3),extend=__webpack_require__(200),EventEmitter=__webpack_require__(8),defaultRepo=__webpack_require__(852),boot=__webpack_require__(830),components=__webpack_require__(839);class IPFS extends EventEmitter{constructor(options){super(),this._options={init:!0,start:!0,EXPERIMENTAL:{}},options=options||{},extend(this._options,options),options.init===!1&&(this._options.init=!1),options.start!==!1&&(this._options.start=!0),"string"==typeof options.repo||void 0===options.repo?this._repo=defaultRepo(options.repo):this._repo=options.repo,this.log=debug("jsipfs"),this.log.err=debug("jsipfs:err"),this.on("error",err=>this.log(err)),this.types={Buffer:Buffer,PeerId:PeerId,PeerInfo:PeerInfo,multiaddr:multiaddr,multihash:multihash,CID:CID},this._peerInfoBook=new PeerBook,this._peerInfo=void 0,this._libp2pNode=void 0,this._bitswap=void 0,this._blockService=new BlockService(this._repo),this._ipldResolver=new IPLDResolver(this._blockService),this._pubsub=void 0,this.init=components.init(this),this.preStart=components.preStart(this),this.start=components.start(this),this.stop=components.stop(this),this.isOnline=components.isOnline(this),this.version=components.version(this),this.id=components.id(this),this.repo=components.repo(this),this.bootstrap=components.bootstrap(this),this.config=components.config(this),this.block=components.block(this),this.object=components.object(this),this.dag=components.dag(this),this.libp2p=components.libp2p(this),this.swarm=components.swarm(this),this.files=components.files(this),this.bitswap=components.bitswap(this),this.ping=components.ping(this),this.pubsub=components.pubsub(this),this.dht=components.dht(this),this._options.EXPERIMENTAL.pubsub&&this.log("EXPERIMENTAL pubsub is enabled"),this._options.EXPERIMENTAL.sharding&&this.log("EXPERIMENTAL sharding is enabled"),this._options.EXPERIMENTAL.dht&&this.log("EXPERIMENTAL Kademlia DHT is enabled"),this.state=__webpack_require__(854)(this),boot(this)}}exports=module.exports=IPFS,exports.createNode=(options=>{return new IPFS(options)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),log=debug("jsipfs:state");log.error=debug("jsipfs:state:error");const fsm=__webpack_require__(423);module.exports=(self=>{const s=fsm("uninitalized",{uninitalized:{init:"initializing",initialized:"stopped"},initializing:{initialized:"stopped"},stopped:{start:"starting"},starting:{started:"running"},running:{stop:"stopping"},stopping:{stopped:"stopped"}});return s.on("error",err=>log.error(err)),s.on("done",()=>log("-> "+s._state)),s.init=(()=>{s("init")}),s.initialized=(()=>{s("initialized")}),s.stop=(()=>{s("stop")}),s.stopped=(()=>{s("stopped")}),s.start=(()=>{s("start")}),s.started=(()=>{s("started")}),s.state=(()=>s._state),s})},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports,__webpack_require__){module.exports=__webpack_require__(332)}]); diff --git a/app/extensions/ipfs/js/main.js b/app/extensions/ipfs/js/main.js new file mode 100644 index 00000000000..c10ae8efb67 --- /dev/null +++ b/app/extensions/ipfs/js/main.js @@ -0,0 +1,11 @@ +// const ipc = window.chrome.ipcRenderer + +chrome.protocol.registerStringProtocol('ipfs', (request, callback) => { + /* + const node = new IPFS() + node.on('ready', () => { + callback('hi there!' + test() + IPFS) // eslint-disable-line + }) + */ + callback('hi there!' + test() + IPFS) // eslint-disable-line +}) diff --git a/app/extensions/ipfs/js/some-other.js b/app/extensions/ipfs/js/some-other.js new file mode 100644 index 00000000000..e6b08f63b2f --- /dev/null +++ b/app/extensions/ipfs/js/some-other.js @@ -0,0 +1 @@ +function test () { return 'yeeah' } diff --git a/app/extensions/ipfs/manifest.json b/app/extensions/ipfs/manifest.json new file mode 100644 index 00000000000..30e00c5669a --- /dev/null +++ b/app/extensions/ipfs/manifest.json @@ -0,0 +1,21 @@ +{ + "manifest_version": 2, + "name": "IPFS", + "version": "0.1.0", + "default_locale": "en", + "description": "InterPlanetary FileSystem", + "icons": { + "128": "img/ipfs-128.png", + "48": "img/ipfs-48.png", + "16": "img/ipfs-16.png" + }, + "offline_enabled": true, + "background": { + "scripts": [ + "js/some-other.js", + "js/ipfs.min.js", + "js/main.js" + ], + "persistent": true + } +} diff --git a/docs/state.md b/docs/state.md index 7d18b266a72..aefa3651b76 100644 --- a/docs/state.md +++ b/docs/state.md @@ -209,6 +209,7 @@ AppStore 'advanced.send-usage-statistics': boolean, // true or undefined if usage reports should be sent 'advanced.smooth-scroll-enabled': boolean, // false if smooth scrolling should be explicitly disabled 'advanced.torrent-viewer-enabled': boolean, // whether to render magnet links in the browser + 'advanced.ipfs-enabled': boolean, // whether to use IPFS to render ipfs:// or dweb: links in the browser 'bookmarks.toolbar.show': boolean, // true if the bookmakrs toolbar should be shown 'bookmarks.toolbar.showFavicon': boolean, // true if bookmark favicons should be shown on the bookmarks toolbar 'bookmarks.toolbar.showOnlyFavicon': boolean, // true if only favicons should be shown on the bookmarks toolbar diff --git a/js/about/preferences.js b/js/about/preferences.js index 722689cd440..93e8503ed8b 100644 --- a/js/about/preferences.js +++ b/js/about/preferences.js @@ -819,6 +819,7 @@ class AboutPreferences extends React.Component { settings.LANGUAGE, settings.PDFJS_ENABLED, settings.TORRENT_VIEWER_ENABLED, + settings.IPFS_ENABLED, settings.SMOOTH_SCROLL_ENABLED, settings.SEND_CRASH_REPORTS, settings.UPDATE_TO_PREVIEW_RELEASES diff --git a/js/constants/appConfig.js b/js/constants/appConfig.js index 3b8e6983402..577e0a5823a 100644 --- a/js/constants/appConfig.js +++ b/js/constants/appConfig.js @@ -33,7 +33,8 @@ module.exports = { COOKIEBLOCK: 'cookieblock', // block 3p cookies and referer COOKIEBLOCK_ALL: 'cookieblockAll', // block all cookies and referer SITEHACK: 'siteHacks', - WEBTORRENT: 'webtorrent' + WEBTORRENT: 'webtorrent', + IPFS: 'ipfs' // ... other optional resource files are identified by uuid such as for regional adblock }, cookieblock: { @@ -95,6 +96,9 @@ module.exports = { webtorrent: { enabled: true }, + ipfs: { + enabled: true + }, adInsertion: { enabled: false, url: adHost @@ -207,6 +211,7 @@ module.exports = { 'advanced.default-zoom-level': null, 'advanced.pdfjs-enabled': true, 'advanced.torrent-viewer-enabled': true, + 'advanced.ipfs-enabled': true, 'advanced.smooth-scroll-enabled': false, 'advanced.send-crash-reports': true, 'advanced.send-usage-statistics': false, diff --git a/js/constants/config.js b/js/constants/config.js index 55034eaaf74..d3d525d9b58 100644 --- a/js/constants/config.js +++ b/js/constants/config.js @@ -62,6 +62,7 @@ module.exports = { widevineComponentPublicKey: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCmhe+02cLPPAViaevk/fzODKUnb/ysaAeD8lpE9pwirV6GYOm+naTo7xPOCh8ujcR6Ryi1nPTq2GTG0CyqdDyOsZ1aRLuMZ5QqX3dJ9jXklS0LqGfosoIpGexfwggbiLvQOo9Q+IWTrAO620KAzYU0U6MV272TJLSmZPUEFY6IGQIDAQAB', braveExtensionId: 'mnojpmjdmbbfmejpflffifhffcmidifd', torrentExtensionId: 'fmdpfempfmekjkcfdehndghogpnpjeno', + ipfsExtensionId: 'interplanetaryfilesystemuniverse', syncExtensionId: 'cjnmeadmgmiihncdidmfiabhenbggfjm', // PDFJS // Parent repo: https://github.com/diracdeltas/pdf.js diff --git a/js/constants/settings.js b/js/constants/settings.js index f69f3bedfb5..f91f7630b50 100644 --- a/js/constants/settings.js +++ b/js/constants/settings.js @@ -71,6 +71,7 @@ const settings = { HARDWARE_ACCELERATION_ENABLED: 'advanced.hardware-acceleration-enabled', PDFJS_ENABLED: 'advanced.pdfjs-enabled', TORRENT_VIEWER_ENABLED: 'advanced.torrent-viewer-enabled', + IPFS_ENABLED: 'advanced.ipfs-enabled', DEFAULT_ZOOM_LEVEL: 'advanced.default-zoom-level', SMOOTH_SCROLL_ENABLED: 'advanced.smooth-scroll-enabled', SEND_CRASH_REPORTS: 'advanced.send-crash-reports', diff --git a/js/lib/appUrlUtil.js b/js/lib/appUrlUtil.js index 7a6f334307d..5bb8f90ec4e 100644 --- a/js/lib/appUrlUtil.js +++ b/js/lib/appUrlUtil.js @@ -48,6 +48,18 @@ module.exports.getTorrentExtUrl = function (relativeUrl) { return 'chrome-extension://' + config.torrentExtensionId + '/' + relativeUrl } +/** + * Gets the URL of a page hosted by the ipfsExtension + * Returns 'chrome-extension://<...>' + */ +module.exports.getIpfsExtUrl = function (relativeUrl) { + if (relativeUrl === undefined) { + relativeUrl = '' + } + + return 'chrome-extension://' + config.ipfsExtensionId + '/' + relativeUrl +} + module.exports.getExtensionsPath = function (extensionDir) { return (process.env.NODE_ENV !== 'development' && process.env.NODE_ENV !== 'test') // the path is different for release builds because extensions are not in the asar file @@ -210,6 +222,47 @@ module.exports.isTargetMagnetUrl = function (input) { return !!module.exports.getSourceMagnetUrl(input) } +/** + * Obtains the target URL associated with a IPFS path + * Returns null if the input is not a IPFS path + * Example: getTargetIpfsPath('ipfs:/...') -> 'chrome-extension://<...>.html#/ipfs/...' + */ +module.exports.getTargetIpfsPath = function (input) { + if (!input.startsWith('ipfs://') && + !input.startsWith('dweb:')) { + return null + } + const url = module.exports.getIpfsExtUrl('ipfs.html') + return [url, input].join('#') +} + +/** + * Obtains the source IPFS Path associated with a target URL + * Returns null if the input is not the local URL for a IPFS Path + * Example: getSourceIPFSPath('chrome-extension://<...>.html#/ipfs/...') -> 'ipfs:/:...' + */ +module.exports.getSourceIPFSPath = function (input) { + if (getBaseUrl(input) !== module.exports.getIpfsExtUrl('ipfs.html')) return null + const url = decodeURIComponent(getHash(input)) + return url +} + +/** + * Checks if the input looks like a magnet: URL + * Example: isSourceIpfsPath('ipfs:/..') -> true + */ +module.exports.isSourceIpfsPath = function (input) { + return !!module.exports.getTargetIpfsPath(input) +} + +/* + * Checks if the input looks like the local URL for a IPFS Path + * Example: isSourceIpfsPath('chrome-extension://<...>.html#/ipfs/') -> true + */ +module.exports.isTargetIPFSPath = function (input) { + return !!module.exports.getSourceIPFSPath(input) +} + /** * Determines whether a string is a valid URL. Based on node-urlutil.js. * @param {string} input diff --git a/package.json b/package.json index 535163fdbb2..db36cd2dc08 100644 --- a/package.json +++ b/package.json @@ -148,6 +148,7 @@ "electron-chromedriver": "^1.7.1", "electron-packager": "brave/electron-packager", "electron-prebuilt": "brave/electron-prebuilt", + "electron-rebuild": "^1.5.11", "empty-port": "0.0.2", "enzyme": "^2.9.1", "flow-bin": "^0.22.1", From 3e82c59c9c048a23e2f9b91bf06228c10f34e020 Mon Sep 17 00:00:00 2001 From: David Dias Date: Tue, 22 Aug 2017 08:14:28 +0100 Subject: [PATCH 02/11] feat: update ipfs to latest, add script to fetch it --- app/extensions/ipfs/js/ipfs.min.js | 123 ++++++++++++--------------- app/extensions/ipfs/js/main.js | 17 ++-- app/extensions/ipfs/js/some-other.js | 4 +- app/extensions/ipfs/manifest.json | 1 - package.json | 3 +- 5 files changed, 72 insertions(+), 76 deletions(-) diff --git a/app/extensions/ipfs/js/ipfs.min.js b/app/extensions/ipfs/js/ipfs.min.js index 15af7594646..8ed63d7c9b5 100644 --- a/app/extensions/ipfs/js/ipfs.min.js +++ b/app/extensions/ipfs/js/ipfs.min.js @@ -1,14 +1,12 @@ -function IPFS (modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}var installedModules={};return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.i=function(value){return value},__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module.default}:function(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=871)}([function(module,exports,__webpack_require__){"use strict";(function(global){function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(that,length){if(kMaxLength()=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|length}function SlowBuffer(length){return+length!=length&&(length=0),Buffer.alloc(+length)}function byteLength(string,encoding){if(Buffer.isBuffer(string))return string.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(string)||string instanceof ArrayBuffer))return string.byteLength;"string"!=typeof string&&(string=""+string);var len=string.length;if(0===len)return 0;for(var loweredCase=!1;;)switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":case void 0:return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*len;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase)return utf8ToBytes(string).length;encoding=(""+encoding).toLowerCase(),loweredCase=!0}}function slowToString(encoding,start,end){var loweredCase=!1;if((void 0===start||start<0)&&(start=0),start>this.length)return"";if((void 0===end||end>this.length)&&(end=this.length),end<=0)return"";if(end>>>=0,start>>>=0,end<=start)return"";for(encoding||(encoding="utf8");;)switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase(),loweredCase=!0}}function swap(b,n,m){var i=b[n];b[n]=b[m],b[m]=i}function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){if(0===buffer.length)return-1;if("string"==typeof byteOffset?(encoding=byteOffset,byteOffset=0):byteOffset>2147483647?byteOffset=2147483647:byteOffset<-2147483648&&(byteOffset=-2147483648),byteOffset=+byteOffset,isNaN(byteOffset)&&(byteOffset=dir?0:buffer.length-1),byteOffset<0&&(byteOffset=buffer.length+byteOffset),byteOffset>=buffer.length){if(dir)return-1;byteOffset=buffer.length-1}else if(byteOffset<0){if(!dir)return-1;byteOffset=0}if("string"==typeof val&&(val=Buffer.from(val,encoding)),Buffer.isBuffer(val))return 0===val.length?-1:arrayIndexOf(buffer,val,byteOffset,encoding,dir);if("number"==typeof val)return val&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?dir?Uint8Array.prototype.indexOf.call(buffer,val,byteOffset):Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset):arrayIndexOf(buffer,[val],byteOffset,encoding,dir);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){function read(buf,i){return 1===indexSize?buf[i]:buf.readUInt16BE(i*indexSize)}var indexSize=1,arrLength=arr.length,valLength=val.length;if(void 0!==encoding&&("ucs2"===(encoding=String(encoding).toLowerCase())||"ucs-2"===encoding||"utf16le"===encoding||"utf-16le"===encoding)){if(arr.length<2||val.length<2)return-1;indexSize=2,arrLength/=2,valLength/=2,byteOffset/=2}var i;if(dir){var foundIndex=-1;for(i=byteOffset;iarrLength&&(byteOffset=arrLength-valLength),i=byteOffset;i>=0;i--){for(var found=!0,j=0;jremaining&&(length=remaining):length=remaining;var strLen=string.length;if(strLen%2!=0)throw new TypeError("Invalid hex string");length>strLen/2&&(length=strLen/2);for(var i=0;i239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end){var secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:firstByte<128&&(codePoint=firstByte);break;case 2:secondByte=buf[i+1],128==(192&secondByte)&&(tempCodePoint=(31&firstByte)<<6|63&secondByte)>127&&(codePoint=tempCodePoint);break;case 3:secondByte=buf[i+1],thirdByte=buf[i+2],128==(192&secondByte)&&128==(192&thirdByte)&&(tempCodePoint=(15&firstByte)<<12|(63&secondByte)<<6|63&thirdByte)>2047&&(tempCodePoint<55296||tempCodePoint>57343)&&(codePoint=tempCodePoint);break;case 4:secondByte=buf[i+1],thirdByte=buf[i+2],fourthByte=buf[i+3],128==(192&secondByte)&&128==(192&thirdByte)&&128==(192&fourthByte)&&(tempCodePoint=(15&firstByte)<<18|(63&secondByte)<<12|(63&thirdByte)<<6|63&fourthByte)>65535&&tempCodePoint<1114112&&(codePoint=tempCodePoint)}}null===codePoint?(codePoint=65533,bytesPerSequence=1):codePoint>65535&&(codePoint-=65536,res.push(codePoint>>>10&1023|55296),codePoint=56320|1023&codePoint),res.push(codePoint),i+=bytesPerSequence}return decodeCodePointsArray(res)}function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,codePoints);for(var res="",i=0;ilen)&&(end=len);for(var out="",i=start;ilength)throw new RangeError("Trying to access beyond buffer length")}function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||valuebuf.length)throw new RangeError("Index out of range")}function objectWriteUInt16(buf,value,offset,littleEndian){value<0&&(value=65535+value+1);for(var i=0,j=Math.min(buf.length-offset,2);i>>8*(littleEndian?i:1-i)}function objectWriteUInt32(buf,value,offset,littleEndian){value<0&&(value=4294967295+value+1);for(var i=0,j=Math.min(buf.length-offset,4);i>>8*(littleEndian?i:3-i)&255}function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,value,offset,4,3.4028234663852886e38,-3.4028234663852886e38),ieee754.write(buf,value,offset,littleEndian,23,4),offset+4}function writeDouble(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,value,offset,8,1.7976931348623157e308,-1.7976931348623157e308),ieee754.write(buf,value,offset,littleEndian,52,8),offset+8}function base64clean(str){if(str=stringtrim(str).replace(INVALID_BASE64_RE,""),str.length<2)return"";for(;str.length%4!=0;)str+="=";return str}function stringtrim(str){return str.trim?str.trim():str.replace(/^\s+|\s+$/g,"")}function toHex(n){return n<16?"0"+n.toString(16):n.toString(16)}function utf8ToBytes(string,units){units=units||1/0;for(var codePoint,length=string.length,leadSurrogate=null,bytes=[],i=0;i55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){(units-=3)>-1&&bytes.push(239,191,189);continue}if(i+1===length){(units-=3)>-1&&bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){(units-=3)>-1&&bytes.push(239,191,189),leadSurrogate=codePoint;continue}codePoint=65536+(leadSurrogate-55296<<10|codePoint-56320)}else leadSurrogate&&(units-=3)>-1&&bytes.push(239,191,189);if(leadSurrogate=null,codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,63&codePoint|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,63&codePoint|128)}else{if(!(codePoint<1114112))throw new Error("Invalid code point");if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,63&codePoint|128)}}return bytes}function asciiToBytes(str){for(var byteArray=[],i=0;i>8,lo=c%256,byteArray.push(lo),byteArray.push(hi);return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i=dst.length||i>=src.length);++i)dst[i+offset]=src[i];return i}function isnan(val){return val!==val}var base64=__webpack_require__(362),ieee754=__webpack_require__(218),isArray=__webpack_require__(49);exports.Buffer=Buffer,exports.SlowBuffer=SlowBuffer,exports.INSPECT_MAX_BYTES=50,Buffer.TYPED_ARRAY_SUPPORT=void 0!==global.TYPED_ARRAY_SUPPORT?global.TYPED_ARRAY_SUPPORT:function(){try{var arr=new Uint8Array(1);return arr.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===arr.foo()&&"function"==typeof arr.subarray&&0===arr.subarray(1,1).byteLength}catch(e){return!1}}(),exports.kMaxLength=kMaxLength(),Buffer.poolSize=8192,Buffer._augment=function(arr){return arr.__proto__=Buffer.prototype,arr},Buffer.from=function(value,encodingOrOffset,length){return from(null,value,encodingOrOffset,length)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0})),Buffer.alloc=function(size,fill,encoding){return alloc(null,size,fill,encoding)},Buffer.allocUnsafe=function(size){return allocUnsafe(null,size)},Buffer.allocUnsafeSlow=function(size){return allocUnsafe(null,size)},Buffer.isBuffer=function(b){return!(null==b||!b._isBuffer)},Buffer.compare=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var x=a.length,y=b.length,i=0,len=Math.min(x,y);i0&&(str=this.toString("hex",0,max).match(/.{2}/g).join(" "),this.length>max&&(str+=" ... ")),""},Buffer.prototype.compare=function(target,start,end,thisStart,thisEnd){if(!Buffer.isBuffer(target))throw new TypeError("Argument must be a Buffer");if(void 0===start&&(start=0),void 0===end&&(end=target?target.length:0),void 0===thisStart&&(thisStart=0),void 0===thisEnd&&(thisEnd=this.length),start<0||end>target.length||thisStart<0||thisEnd>this.length)throw new RangeError("out of range index");if(thisStart>=thisEnd&&start>=end)return 0;if(thisStart>=thisEnd)return-1;if(start>=end)return 1;if(start>>>=0,end>>>=0,thisStart>>>=0,thisEnd>>>=0,this===target)return 0;for(var x=thisEnd-thisStart,y=end-start,len=Math.min(x,y),thisCopy=this.slice(thisStart,thisEnd),targetCopy=target.slice(start,end),i=0;iremaining)&&(length=remaining),string.length>0&&(length<0||offset<0)||offset>this.length)throw new RangeError("Attempt to write outside buffer bounds");encoding||(encoding="utf8");for(var loweredCase=!1;;)switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase(),loweredCase=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;Buffer.prototype.slice=function(start,end){var len=this.length;start=~~start,end=void 0===end?len:~~end,start<0?(start+=len)<0&&(start=0):start>len&&(start=len),end<0?(end+=len)<0&&(end=0):end>len&&(end=len),end0&&(mul*=256);)val+=this[offset+--byteLength]*mul;return val},Buffer.prototype.readUInt8=function(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),this[offset]},Buffer.prototype.readUInt16LE=function(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]|this[offset+1]<<8},Buffer.prototype.readUInt16BE=function(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]<<8|this[offset+1]},Buffer.prototype.readUInt32LE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+16777216*this[offset+3]},Buffer.prototype.readUInt32BE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),16777216*this[offset]+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])},Buffer.prototype.readIntLE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset],mul=1,i=0;++i=mul&&(val-=Math.pow(2,8*byteLength)),val},Buffer.prototype.readIntBE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var i=byteLength,mul=1,val=this[offset+--i];i>0&&(mul*=256);)val+=this[offset+--i]*mul;return mul*=128,val>=mul&&(val-=Math.pow(2,8*byteLength)),val},Buffer.prototype.readInt8=function(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),128&this[offset]?(255-this[offset]+1)*-1:this[offset]},Buffer.prototype.readInt16LE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt16BE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt32LE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24},Buffer.prototype.readInt32BE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]},Buffer.prototype.readFloatLE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!0,23,4)},Buffer.prototype.readFloatBE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!1,23,4)},Buffer.prototype.readDoubleLE=function(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!0,52,8)},Buffer.prototype.readDoubleBE=function(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!1,52,8)},Buffer.prototype.writeUIntLE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,byteLength|=0,!noAssert){checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength)-1,0)}var mul=1,i=0;for(this[offset]=255&value;++i=0&&(mul*=256);)this[offset+i]=value/mul&255;return offset+byteLength},Buffer.prototype.writeUInt8=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),this[offset]=255&value,offset+1},Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset+3]=value>>>24,this[offset+2]=value>>>16,this[offset+1]=value>>>8,this[offset]=255&value):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeIntLE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0,mul=1,sub=0;for(this[offset]=255&value;++i>0)-sub&255;return offset+byteLength},Buffer.prototype.writeIntBE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1,mul=1,sub=0;for(this[offset+i]=255&value;--i>=0&&(mul*=256);)value<0&&0===sub&&0!==this[offset+i+1]&&(sub=1),this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength},Buffer.prototype.writeInt8=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),value<0&&(value=255+value+1),this[offset]=255&value,offset+1},Buffer.prototype.writeInt16LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeInt16BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeInt32LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8,this[offset+2]=value>>>16,this[offset+3]=value>>>24):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeInt32BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),value<0&&(value=4294967295+value+1),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeFloatLE=function(value,offset,noAssert){return writeFloat(this,value,offset,!0,noAssert)},Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,!1,noAssert)},Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,!0,noAssert)},Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,!1,noAssert)},Buffer.prototype.copy=function(target,targetStart,start,end){if(start||(start=0),end||0===end||(end=this.length),targetStart>=target.length&&(targetStart=target.length),targetStart||(targetStart=0),end>0&&end=this.length)throw new RangeError("sourceStart out of bounds");if(end<0)throw new RangeError("sourceEnd out of bounds");end>this.length&&(end=this.length),target.length-targetStart=0;--i)target[i+targetStart]=this[i+start];else if(len<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,end=void 0===end?this.length:end>>>0,val||(val=0);var i;if("number"==typeof val)for(i=start;i1)for(var i=1;i=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(args){var useColors=this.useColors;if(args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff),useColors){var c="color: "+this.color;args.splice(1,0,c,"color: inherit");var index=0,lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){"%%"!==match&&(index++,"%c"===match&&(lastC=index))}),args.splice(lastC,0,c)}}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{null==namespaces?exports.storage.removeItem("debug"):exports.storage.debug=namespaces}catch(e){}}function load(){var r;try{r=exports.storage.debug}catch(e){}return!r&&void 0!==process&&"env"in process&&(r=process.env.DEBUG),r}exports=module.exports=__webpack_require__(391),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],exports.formatters.j=function(v){try{return JSON.stringify(v)}catch(err){return"[UnexpectedJSONParseError]: "+err.message}},exports.enable(load())}).call(exports,__webpack_require__(2))},function(module,exports){var g;g=function(){return this}();try{g=g||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(g=window)}module.exports=g},function(module,exports,__webpack_require__){"use strict";var sources=__webpack_require__(740),sinks=__webpack_require__(734),throughs=__webpack_require__(746);exports=module.exports=__webpack_require__(299),exports.pull=exports;for(var k in sources)exports[k]=sources[k];for(var k in throughs)exports[k]=throughs[k];for(var k in sinks)exports[k]=sinks[k]},function(module,exports,__webpack_require__){(function(Buffer){function isArray(arg){return Array.isArray?Array.isArray(arg):"[object Array]"===objectToString(arg)}function isBoolean(arg){return"boolean"==typeof arg}function isNull(arg){return null===arg}function isNullOrUndefined(arg){return null==arg}function isNumber(arg){return"number"==typeof arg}function isString(arg){return"string"==typeof arg}function isSymbol(arg){return"symbol"==typeof arg}function isUndefined(arg){return void 0===arg}function isRegExp(re){return"[object RegExp]"===objectToString(re)}function isObject(arg){return"object"==typeof arg&&null!==arg}function isDate(d){return"[object Date]"===objectToString(d)}function isError(e){return"[object Error]"===objectToString(e)||e instanceof Error}function isFunction(arg){return"function"==typeof arg}function isPrimitive(arg){return null===arg||"boolean"==typeof arg||"number"==typeof arg||"string"==typeof arg||"symbol"==typeof arg||void 0===arg}function objectToString(o){return Object.prototype.toString.call(o)}exports.isArray=isArray,exports.isBoolean=isBoolean,exports.isNull=isNull,exports.isNullOrUndefined=isNullOrUndefined,exports.isNumber=isNumber,exports.isString=isString,exports.isSymbol=isSymbol,exports.isUndefined=isUndefined,exports.isRegExp=isRegExp,exports.isObject=isObject,exports.isDate=isDate,exports.isError=isError,exports.isFunction=isFunction,exports.isPrimitive=isPrimitive,exports.isBuffer=Buffer.isBuffer}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(global){function compare(a,b){if(a===b)return 0;for(var x=a.length,y=b.length,i=0,len=Math.min(x,y);i=0;i--)if(ka[i]!==kb[i])return!1;for(i=ka.length-1;i>=0;i--)if(key=ka[i],!_deepEqual(a[key],b[key],strict,actualVisitedObjects))return!1;return!0}function notDeepStrictEqual(actual,expected,message){_deepEqual(actual,expected,!0)&&fail(actual,expected,message,"notDeepStrictEqual",notDeepStrictEqual)}function expectedException(actual,expected){if(!actual||!expected)return!1;if("[object RegExp]"==Object.prototype.toString.call(expected))return expected.test(actual);try{if(actual instanceof expected)return!0}catch(e){}return!Error.isPrototypeOf(expected)&&expected.call({},actual)===!0}function _tryBlock(block){var error;try{block()}catch(e){error=e}return error}function _throws(shouldThrow,block,expected,message){var actual;if("function"!=typeof block)throw new TypeError('"block" argument must be a function');"string"==typeof expected&&(message=expected,expected=null),actual=_tryBlock(block),message=(expected&&expected.name?" ("+expected.name+").":".")+(message?" "+message:"."),shouldThrow&&!actual&&fail(actual,expected,"Missing expected exception"+message);var userProvidedMessage="string"==typeof message,isUnwantedException=!shouldThrow&&util.isError(actual),isUnexpectedException=!shouldThrow&&actual&&!expected;if((isUnwantedException&&userProvidedMessage&&expectedException(actual,expected)||isUnexpectedException)&&fail(actual,expected,"Got unwanted exception"+message),shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual)throw actual}var util=__webpack_require__(10),hasOwn=Object.prototype.hasOwnProperty,pSlice=Array.prototype.slice,functionsHaveNames=function(){return"foo"===function(){}.name}(),assert=module.exports=ok,regex=/\s*function\s+([^\(\s]*)\s*/;assert.AssertionError=function(options){this.name="AssertionError",this.actual=options.actual,this.expected=options.expected,this.operator=options.operator,options.message?(this.message=options.message,this.generatedMessage=!1):(this.message=getMessage(this),this.generatedMessage=!0);var stackStartFunction=options.stackStartFunction||fail;if(Error.captureStackTrace)Error.captureStackTrace(this,stackStartFunction);else{var err=new Error;if(err.stack){var out=err.stack,fn_name=getName(stackStartFunction),idx=out.indexOf("\n"+fn_name);if(idx>=0){var next_line=out.indexOf("\n",idx+1);out=out.substring(next_line+1)}this.stack=out}}},util.inherits(assert.AssertionError,Error),assert.fail=fail,assert.ok=ok,assert.equal=function(actual,expected,message){actual!=expected&&fail(actual,expected,message,"==",assert.equal)},assert.notEqual=function(actual,expected,message){actual==expected&&fail(actual,expected,message,"!=",assert.notEqual)},assert.deepEqual=function(actual,expected,message){_deepEqual(actual,expected,!1)||fail(actual,expected,message,"deepEqual",assert.deepEqual)},assert.deepStrictEqual=function(actual,expected,message){_deepEqual(actual,expected,!0)||fail(actual,expected,message,"deepStrictEqual",assert.deepStrictEqual)},assert.notDeepEqual=function(actual,expected,message){_deepEqual(actual,expected,!1)&&fail(actual,expected,message,"notDeepEqual",assert.notDeepEqual)},assert.notDeepStrictEqual=notDeepStrictEqual,assert.strictEqual=function(actual,expected,message){actual!==expected&&fail(actual,expected,message,"===",assert.strictEqual)},assert.notStrictEqual=function(actual,expected,message){actual===expected&&fail(actual,expected,message,"!==",assert.notStrictEqual)},assert.throws=function(block,error,message){_throws(!0,block,error,message)},assert.doesNotThrow=function(block,error,message){_throws(!1,block,error,message)},assert.ifError=function(err){if(err)throw err};var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)hasOwn.call(obj,key)&&keys.push(key);return keys}}).call(exports,__webpack_require__(4))},function(module,exports){function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(arg){return"function"==typeof arg}function isNumber(arg){return"number"==typeof arg}function isObject(arg){return"object"==typeof arg&&null!==arg}function isUndefined(arg){return void 0===arg}module.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||n<0||isNaN(n))throw TypeError("n must be a positive number");return this._maxListeners=n,this},EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(this._events||(this._events={}),"error"===type&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length)){if((er=arguments[1])instanceof Error)throw er;var err=new Error('Uncaught, unspecified "error" event. ('+er+")");throw err.context=er,err}if(handler=this._events[type],isUndefined(handler))return!1;if(isFunction(handler))switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:args=Array.prototype.slice.call(arguments,1),handler.apply(this,args)}else if(isObject(handler))for(args=Array.prototype.slice.call(arguments,1),listeners=handler.slice(),len=listeners.length,i=0;i0&&this._events[type].length>m&&(this._events[type].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[type].length),"function"==typeof console.trace&&console.trace()),this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(type,listener){function g(){this.removeListener(type,g),fired||(fired=!0,listener.apply(this,arguments))}if(!isFunction(listener))throw TypeError("listener must be a function");var fired=!1;return g.listener=listener,this.on(type,g),this},EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;if(list=this._events[type],length=list.length,position=-1,list===listener||isFunction(list.listener)&&list.listener===listener)delete this._events[type],this._events.removeListener&&this.emit("removeListener",type,listener);else if(isObject(list)){for(i=length;i-- >0;)if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}if(position<0)return this;1===list.length?(list.length=0,delete this._events[type]):list.splice(position,1),this._events.removeListener&&this.emit("removeListener",type,listener)}return this},EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[type]&&delete this._events[type],this;if(0===arguments.length){for(key in this._events)"removeListener"!==key&&this.removeAllListeners(key);return this.removeAllListeners("removeListener"),this._events={},this}if(listeners=this._events[type],isFunction(listeners))this.removeListener(type,listeners);else if(listeners)for(;listeners.length;)this.removeListener(type,listeners[listeners.length-1]);return delete this._events[type],this},EventEmitter.prototype.listeners=function(type){return this._events&&this._events[type]?isFunction(this._events[type])?[this._events[type]]:this._events[type].slice():[]},EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;if(evlistener)return evlistener.length}return 0},EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)}},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(tasks,callback){function nextTask(args){var task=(0,_wrapAsync2.default)(tasks[taskIndex++]);args.push((0,_onlyOnce2.default)(next)),task.apply(null,args)}function next(err){if(err||taskIndex===tasks.length)return callback.apply(null,arguments);nextTask((0,_slice2.default)(arguments,1))}if(callback=(0,_once2.default)(callback||_noop2.default),!(0,_isArray2.default)(tasks))return callback(new Error("First argument to waterfall must be an array of functions"));if(!tasks.length)return callback();var taskIndex=0;nextTask([])};var _isArray=__webpack_require__(109),_isArray2=_interopRequireDefault(_isArray),_noop=__webpack_require__(33),_noop2=_interopRequireDefault(_noop),_once=__webpack_require__(125),_once2=_interopRequireDefault(_once),_slice=__webpack_require__(56),_slice2=_interopRequireDefault(_slice),_onlyOnce=__webpack_require__(55),_onlyOnce2=_interopRequireDefault(_onlyOnce),_wrapAsync=__webpack_require__(19),_wrapAsync2=_interopRequireDefault(_wrapAsync);module.exports=exports.default},function(module,exports,__webpack_require__){(function(global,process){function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(ctx.depth=arguments[2]),arguments.length>=4&&(ctx.colors=arguments[3]),isBoolean(opts)?ctx.showHidden=opts:opts&&exports._extend(ctx,opts),isUndefined(ctx.showHidden)&&(ctx.showHidden=!1),isUndefined(ctx.depth)&&(ctx.depth=2),isUndefined(ctx.colors)&&(ctx.colors=!1),isUndefined(ctx.customInspect)&&(ctx.customInspect=!0),ctx.colors&&(ctx.stylize=stylizeWithColor),formatValue(ctx,obj,ctx.depth)}function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];return style?"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m":str}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};return array.forEach(function(val,idx){hash[val]=!0}),hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&(!value.constructor||value.constructor.prototype!==value)){var ret=value.inspect(recurseTimes,ctx);return isString(ret)||(ret=formatValue(ctx,ret,recurseTimes)),ret}var primitive=formatPrimitive(ctx,value);if(primitive)return primitive;var keys=Object.keys(value),visibleKeys=arrayToHash(keys);if(ctx.showHidden&&(keys=Object.getOwnPropertyNames(value)),isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0))return formatError(value);if(0===keys.length){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value))return ctx.stylize(RegExp.prototype.toString.call(value),"regexp");if(isDate(value))return ctx.stylize(Date.prototype.toString.call(value),"date");if(isError(value))return formatError(value)}var base="",array=!1,braces=["{","}"];if(isArray(value)&&(array=!0,braces=["[","]"]),isFunction(value)){base=" [Function"+(value.name?": "+value.name:"")+"]"}if(isRegExp(value)&&(base=" "+RegExp.prototype.toString.call(value)),isDate(value)&&(base=" "+Date.prototype.toUTCString.call(value)),isError(value)&&(base=" "+formatError(value)),0===keys.length&&(!array||0==value.length))return braces[0]+base+braces[1];if(recurseTimes<0)return isRegExp(value)?ctx.stylize(RegExp.prototype.toString.call(value),"regexp"):ctx.stylize("[Object]","special");ctx.seen.push(value);var output;return output=array?formatArray(ctx,value,recurseTimes,visibleKeys,keys):keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)}),ctx.seen.pop(),reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}return isNumber(value)?ctx.stylize(""+value,"number"):isBoolean(value)?ctx.stylize(""+value,"boolean"):isNull(value)?ctx.stylize("null","null"):void 0}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){for(var output=[],i=0,l=value.length;i-1&&(str=array?str.split("\n").map(function(line){return" "+line}).join("\n").substr(2):"\n"+str.split("\n").map(function(line){return" "+line}).join("\n"))):str=ctx.stylize("[Circular]","special")),isUndefined(name)){if(array&&key.match(/^\d+$/))return str;name=JSON.stringify(""+key),name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(name=name.substr(1,name.length-2),name=ctx.stylize(name,"name")):(name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),name=ctx.stylize(name,"string"))}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;return output.reduce(function(prev,cur){return numLinesEst++,cur.indexOf("\n")>=0&&numLinesEst++,prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?braces[0]+(""===base?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]:braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}function isBoolean(arg){return"boolean"==typeof arg}function isNull(arg){return null===arg}function isNullOrUndefined(arg){return null==arg}function isNumber(arg){return"number"==typeof arg}function isString(arg){return"string"==typeof arg}function isSymbol(arg){return"symbol"==typeof arg}function isUndefined(arg){return void 0===arg}function isRegExp(re){return isObject(re)&&"[object RegExp]"===objectToString(re)}function isObject(arg){return"object"==typeof arg&&null!==arg}function isDate(d){return isObject(d)&&"[object Date]"===objectToString(d)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(arg){return"function"==typeof arg}function isPrimitive(arg){return null===arg||"boolean"==typeof arg||"number"==typeof arg||"string"==typeof arg||"symbol"==typeof arg||void 0===arg}function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}function timestamp(){var d=new Date,time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}exports.format=function(f){if(!isString(f)){for(var objects=[],i=0;i=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}}),x=args[i];iMAX_LEN)throw new RangeError("size is too large");var enc=encoding,_fill=fill;void 0===_fill&&(enc=void 0,_fill=0);var buf=new Buffer(size) -;if("string"==typeof _fill)for(var fillBuf=new Buffer(_fill,enc),flen=fillBuf.length,i=-1;++iMAX_LEN)throw new RangeError("size is too large");return new Buffer(size)},exports.from=function(value,encodingOrOffset,length){if("function"==typeof Buffer.from&&(!global.Uint8Array||Uint8Array.from!==Buffer.from))return Buffer.from(value,encodingOrOffset,length);if("number"==typeof value)throw new TypeError('"value" argument must not be a number');if("string"==typeof value)return new Buffer(value,encodingOrOffset);if("undefined"!=typeof ArrayBuffer&&value instanceof ArrayBuffer){var offset=encodingOrOffset;if(1===arguments.length)return new Buffer(value);void 0===offset&&(offset=0);var len=length;if(void 0===len&&(len=value.byteLength-offset),offset>=value.byteLength)throw new RangeError("'offset' is out of bounds");if(len>value.byteLength-offset)throw new RangeError("'length' is out of bounds");return new Buffer(value.slice(offset,offset+len))}if(Buffer.isBuffer(value)){var out=new Buffer(value.length);return value.copy(out,0,0,value.length),out}if(value){if(Array.isArray(value)||"undefined"!=typeof ArrayBuffer&&value.buffer instanceof ArrayBuffer||"length"in value)return new Buffer(value);if("Buffer"===value.type&&Array.isArray(value.data))return new Buffer(value.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")},exports.allocUnsafeSlow=function(size){if("function"==typeof Buffer.allocUnsafeSlow)return Buffer.allocUnsafeSlow(size);if("number"!=typeof size)throw new TypeError("size must be a number");if(size>=MAX_LEN)throw new RangeError("size is too large");return new SlowBuffer(size)}}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){"use strict";(function(process){function nextTick(fn,arg1,arg2,arg3){if("function"!=typeof fn)throw new TypeError('"callback" argument must be a function');var args,i,len=arguments.length;switch(len){case 0:case 1:return process.nextTick(fn);case 2:return process.nextTick(function(){fn.call(null,arg1)});case 3:return process.nextTick(function(){fn.call(null,arg1,arg2)});case 4:return process.nextTick(function(){fn.call(null,arg1,arg2,arg3)});default:for(args=new Array(len-1),i=0;i 3 bytes.");let code=varint.decode(buf);if(!exports.isValidCode(code))throw new Error(`multihash unknown function code: 0x${code.toString(16)}`);buf=buf.slice(varint.decode.bytes);let len=varint.decode(buf);if(len<1)throw new Error(`multihash invalid length: 0x${len.toString(16)}`);if(buf=buf.slice(varint.decode.bytes),buf.length!==len)throw new Error(`multihash length inconsistent: 0x${buf.toString("hex")}`);return{code:code,name:cs.codes[code],length:len,digest:buf}},exports.encode=function(digest,code,length){if(!digest||!code)throw new Error("multihash encode requires at least two args: digest, code");const hashfn=exports.coerceCode(code);if(!Buffer.isBuffer(digest))throw new Error("digest should be a Buffer");if(null==length&&(length=digest.length),length&&digest.length!==length)throw new Error("digest length should be equal to specified length.");return Buffer.concat([new Buffer(varint.encode(hashfn)),new Buffer(varint.encode(length)),digest])},exports.coerceCode=function(name){let code=name;if("string"==typeof name){if(!cs.names[name])throw new Error(`Unrecognized hash function named: ${name}`);code=cs.names[name]}if("number"!=typeof code)throw new Error(`Hash function code should be a number. Got: ${code}`);if(!cs.codes[code]&&!exports.isAppCode(code))throw new Error(`Unrecognized function code: ${code}`);return code},exports.isAppCode=function(code){return code>0&&code<16},exports.isValidCode=function(code){return!!exports.isAppCode(code)||!!cs.codes[code]},exports.validate=validate,exports.prefix=function(multihash){return validate(multihash),multihash.slice(0,2)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function assertEncoding(encoding){if(encoding&&!isBufferEncoding(encoding))throw new Error("Unknown encoding: "+encoding)}function passThroughWrite(buffer){return buffer.toString(this.encoding)}function utf16DetectIncompleteChar(buffer){this.charReceived=buffer.length%2,this.charLength=this.charReceived?2:0}function base64DetectIncompleteChar(buffer){this.charReceived=buffer.length%3,this.charLength=this.charReceived?3:0}var Buffer=__webpack_require__(0).Buffer,isBufferEncoding=Buffer.isEncoding||function(encoding){switch(encoding&&encoding.toLowerCase()){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":return!0;default:return!1}},StringDecoder=exports.StringDecoder=function(encoding){switch(this.encoding=(encoding||"utf8").toLowerCase().replace(/[-_]/,""),assertEncoding(encoding),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=utf16DetectIncompleteChar;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=base64DetectIncompleteChar;break;default:return void(this.write=passThroughWrite)}this.charBuffer=new Buffer(6),this.charReceived=0,this.charLength=0};StringDecoder.prototype.write=function(buffer){for(var charStr="";this.charLength;){var available=buffer.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:buffer.length;if(buffer.copy(this.charBuffer,this.charReceived,0,available),this.charReceived+=available,this.charReceived=55296&&charCode<=56319)){if(this.charReceived=this.charLength=0,0===buffer.length)return charStr;break}this.charLength+=this.surrogateSize,charStr=""}this.detectIncompleteChar(buffer);var end=buffer.length;this.charLength&&(buffer.copy(this.charBuffer,0,buffer.length-this.charReceived,end),end-=this.charReceived),charStr+=buffer.toString(this.encoding,0,end);var end=charStr.length-1,charCode=charStr.charCodeAt(end);if(charCode>=55296&&charCode<=56319){var size=this.surrogateSize;return this.charLength+=size,this.charReceived+=size,this.charBuffer.copy(this.charBuffer,size,0,size),buffer.copy(this.charBuffer,0,0,size),charStr.substring(0,end)}return charStr},StringDecoder.prototype.detectIncompleteChar=function(buffer){for(var i=buffer.length>=3?3:buffer.length;i>0;i--){var c=buffer[buffer.length-i];if(1==i&&c>>5==6){this.charLength=2;break}if(i<=2&&c>>4==14){this.charLength=3;break}if(i<=3&&c>>3==30){this.charLength=4;break}}this.charReceived=i},StringDecoder.prototype.end=function(buffer){var res="";if(buffer&&buffer.length&&(res=this.write(buffer)),this.charReceived){var cr=this.charReceived,buf=this.charBuffer,enc=this.encoding;res+=buf.slice(0,cr).toString(enc)}return res}},function(module,exports,__webpack_require__){"use strict";function isAsync(fn){return supportsSymbol&&"AsyncFunction"===fn[Symbol.toStringTag]}function wrapAsync(asyncFn){return isAsync(asyncFn)?(0,_asyncify2.default)(asyncFn):asyncFn}Object.defineProperty(exports,"__esModule",{value:!0}),exports.isAsync=void 0;var _asyncify=__webpack_require__(343),_asyncify2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_asyncify),supportsSymbol="function"==typeof Symbol;exports.default=wrapAsync,exports.isAsync=isAsync},function(module,exports,__webpack_require__){(function(module){!function(module,exports){"use strict";function assert(val,msg){if(!val)throw new Error(msg||"Assertion failed")}function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype,ctor.prototype=new TempCtor,ctor.prototype.constructor=ctor}function BN(number,base,endian){if(BN.isBN(number))return number;this.negative=0,this.words=null,this.length=0,this.red=null,null!==number&&("le"!==base&&"be"!==base||(endian=base,base=10),this._init(number||0,base||10,endian||"be"))}function parseHex(str,start,end){for(var r=0,len=Math.min(str.length,end),i=start;i=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:15&c}return r}function parseBase(str,start,end,mul){for(var r=0,len=Math.min(str.length,end),i=start;i=49?c-49+10:c>=17?c-17+10:c}return r}function toBitArray(num){for(var w=new Array(num.bitLength()),bit=0;bit>>wbit}return w}function smallMulTo(self,num,out){out.negative=num.negative^self.negative;var len=self.length+num.length|0;out.length=len,len=len-1|0;var a=0|self.words[0],b=0|num.words[0],r=a*b,lo=67108863&r,carry=r/67108864|0;out.words[0]=lo;for(var k=1;k>>26,rword=67108863&carry,maxJ=Math.min(k,num.length-1),j=Math.max(0,k-self.length+1);j<=maxJ;j++){var i=k-j|0;a=0|self.words[i],b=0|num.words[j],r=a*b+rword,ncarry+=r/67108864|0,rword=67108863&r}out.words[k]=0|rword,carry=0|ncarry}return 0!==carry?out.words[k]=0|carry:out.length--,out.strip()}function bigMulTo(self,num,out){out.negative=num.negative^self.negative,out.length=self.length+num.length;for(var carry=0,hncarry=0,k=0;k>>26)|0,hncarry+=ncarry>>>26,ncarry&=67108863}out.words[k]=rword,carry=ncarry,ncarry=hncarry}return 0!==carry?out.words[k]=carry:out.length--,out.strip()}function jumboMulTo(self,num,out){return(new FFTM).mulp(self,num,out)}function FFTM(x,y){this.x=x,this.y=y}function MPrime(name,p){this.name=name,this.p=new BN(p,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(m){if("string"==typeof m){var prime=BN._prime(m);this.m=prime.p,this.prime=prime}else assert(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}function Mont(m){Red.call(this,m),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof module?module.exports=BN:exports.BN=BN,BN.BN=BN,BN.wordSize=26;var Buffer;try{Buffer=__webpack_require__(0).Buffer}catch(e){}BN.isBN=function(num){return num instanceof BN||null!==num&&"object"==typeof num&&num.constructor.wordSize===BN.wordSize&&Array.isArray(num.words)},BN.max=function(left,right){return left.cmp(right)>0?left:right},BN.min=function(left,right){return left.cmp(right)<0?left:right},BN.prototype._init=function(number,base,endian){if("number"==typeof number)return this._initNumber(number,base,endian);if("object"==typeof number)return this._initArray(number,base,endian);"hex"===base&&(base=16),assert(base===(0|base)&&base>=2&&base<=36),number=number.toString().replace(/\s+/g,"");var start=0;"-"===number[0]&&start++,16===base?this._parseHex(number,start):this._parseBase(number,base,start),"-"===number[0]&&(this.negative=1),this.strip(),"le"===endian&&this._initArray(this.toArray(),base,endian)},BN.prototype._initNumber=function(number,base,endian){number<0&&(this.negative=1,number=-number),number<67108864?(this.words=[67108863&number],this.length=1):number<4503599627370496?(this.words=[67108863&number,number/67108864&67108863],this.length=2):(assert(number<9007199254740992),this.words=[67108863&number,number/67108864&67108863,1],this.length=3),"le"===endian&&this._initArray(this.toArray(),base,endian)},BN.prototype._initArray=function(number,base,endian){if(assert("number"==typeof number.length),number.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(number.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)w=number[i]|number[i-1]<<8|number[i-2]<<16,this.words[j]|=w<>>26-off&67108863,(off+=24)>=26&&(off-=26,j++);else if("le"===endian)for(i=0,j=0;i>>26-off&67108863,(off+=24)>=26&&(off-=26,j++);return this.strip()},BN.prototype._parseHex=function(number,start){this.length=Math.ceil((number.length-start)/6),this.words=new Array(this.length);for(var i=0;i=start;i-=6)w=parseHex(number,i,i+6),this.words[j]|=w<>>26-off&4194303,(off+=24)>=26&&(off-=26,j++);i+6!==start&&(w=parseHex(number,start,i+6),this.words[j]|=w<>>26-off&4194303),this.strip()},BN.prototype._parseBase=function(number,base,start){this.words=[0],this.length=1;for(var limbLen=0,limbPow=1;limbPow<=67108863;limbPow*=base)limbLen++;limbLen--,limbPow=limbPow/base|0;for(var total=number.length-start,mod=total%limbLen,end=Math.min(total,total-mod)+start,word=0,i=start;i1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.inspect=function(){return(this.red?""};var zeros=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],groupSizes=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],groupBases=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];BN.prototype.toString=function(base,padding){base=base||10,padding=0|padding||1;var out;if(16===base||"hex"===base){out="";for(var off=0,carry=0,i=0;i>>24-off&16777215,out=0!==carry||i!==this.length-1?zeros[6-word.length]+word+out:word+out,off+=2,off>=26&&(off-=26,i--)}for(0!==carry&&(out=carry.toString(16)+out);out.length%padding!=0;)out="0"+out;return 0!==this.negative&&(out="-"+out),out}if(base===(0|base)&&base>=2&&base<=36){var groupSize=groupSizes[base],groupBase=groupBases[base];out="";var c=this.clone();for(c.negative=0;!c.isZero();){var r=c.modn(groupBase).toString(base);c=c.idivn(groupBase),out=c.isZero()?r+out:zeros[groupSize-r.length]+r+out}for(this.isZero()&&(out="0"+out);out.length%padding!=0;)out="0"+out;return 0!==this.negative&&(out="-"+out),out}assert(!1,"Base should be between 2 and 36")},BN.prototype.toNumber=function(){var ret=this.words[0];return 2===this.length?ret+=67108864*this.words[1]:3===this.length&&1===this.words[2]?ret+=4503599627370496+67108864*this.words[1]:this.length>2&&assert(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-ret:ret},BN.prototype.toJSON=function(){return this.toString(16)},BN.prototype.toBuffer=function(endian,length){return assert(void 0!==Buffer),this.toArrayLike(Buffer,endian,length)},BN.prototype.toArray=function(endian,length){return this.toArrayLike(Array,endian,length)},BN.prototype.toArrayLike=function(ArrayType,endian,length){var byteLength=this.byteLength(),reqLength=length||Math.max(1,byteLength);assert(byteLength<=reqLength,"byte array longer than desired length"),assert(reqLength>0,"Requested array length <= 0"),this.strip();var b,i,littleEndian="le"===endian,res=new ArrayType(reqLength),q=this.clone();if(littleEndian){for(i=0;!q.isZero();i++)b=q.andln(255),q.iushrn(8),res[i]=b;for(;i=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},BN.prototype._zeroBits=function(w){if(0===w)return 26;var t=w,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},BN.prototype.bitLength=function(){var w=this.words[this.length-1],hi=this._countBits(w);return 26*(this.length-1)+hi},BN.prototype.zeroBits=function(){if(this.isZero())return 0;for(var r=0,i=0;inum.length?this.clone().ior(num):num.clone().ior(this)},BN.prototype.uor=function(num){return this.length>num.length?this.clone().iuor(num):num.clone().iuor(this)},BN.prototype.iuand=function(num){var b;b=this.length>num.length?num:this;for(var i=0;inum.length?this.clone().iand(num):num.clone().iand(this)},BN.prototype.uand=function(num){return this.length>num.length?this.clone().iuand(num):num.clone().iuand(this)},BN.prototype.iuxor=function(num){var a,b;this.length>num.length?(a=this,b=num):(a=num,b=this);for(var i=0;inum.length?this.clone().ixor(num):num.clone().ixor(this)},BN.prototype.uxor=function(num){return this.length>num.length?this.clone().iuxor(num):num.clone().iuxor(this)},BN.prototype.inotn=function(width){assert("number"==typeof width&&width>=0);var bytesNeeded=0|Math.ceil(width/26),bitsLeft=width%26;this._expand(bytesNeeded),bitsLeft>0&&bytesNeeded--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-bitsLeft),this.strip()},BN.prototype.notn=function(width){return this.clone().inotn(width)},BN.prototype.setn=function(bit,val){assert("number"==typeof bit&&bit>=0);var off=bit/26|0,wbit=bit%26;return this._expand(off+1),this.words[off]=val?this.words[off]|1<num.length?(a=this,b=num):(a=num,b=this);for(var carry=0,i=0;i>>26;for(;0!==carry&&i>>26;if(this.length=a.length,0!==carry)this.words[this.length]=carry,this.length++;else if(a!==this)for(;inum.length?this.clone().iadd(num):num.clone().iadd(this)},BN.prototype.isub=function(num){if(0!==num.negative){num.negative=0;var r=this.iadd(num);return num.negative=1,r._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(num),this.negative=1,this._normSign();var cmp=this.cmp(num);if(0===cmp)return this.negative=0,this.length=1,this.words[0]=0,this;var a,b;cmp>0?(a=this,b=num):(a=num,b=this);for(var carry=0,i=0;i>26,this.words[i]=67108863&r;for(;0!==carry&&i>26,this.words[i]=67108863&r;if(0===carry&&i>>13,a1=0|a[1],al1=8191&a1,ah1=a1>>>13,a2=0|a[2],al2=8191&a2,ah2=a2>>>13,a3=0|a[3],al3=8191&a3,ah3=a3>>>13,a4=0|a[4],al4=8191&a4,ah4=a4>>>13,a5=0|a[5],al5=8191&a5,ah5=a5>>>13,a6=0|a[6],al6=8191&a6,ah6=a6>>>13,a7=0|a[7],al7=8191&a7,ah7=a7>>>13,a8=0|a[8],al8=8191&a8,ah8=a8>>>13,a9=0|a[9],al9=8191&a9,ah9=a9>>>13,b0=0|b[0],bl0=8191&b0,bh0=b0>>>13,b1=0|b[1],bl1=8191&b1,bh1=b1>>>13,b2=0|b[2],bl2=8191&b2,bh2=b2>>>13,b3=0|b[3],bl3=8191&b3,bh3=b3>>>13,b4=0|b[4],bl4=8191&b4,bh4=b4>>>13,b5=0|b[5],bl5=8191&b5,bh5=b5>>>13,b6=0|b[6],bl6=8191&b6,bh6=b6>>>13,b7=0|b[7],bl7=8191&b7,bh7=b7>>>13,b8=0|b[8],bl8=8191&b8,bh8=b8>>>13,b9=0|b[9],bl9=8191&b9,bh9=b9>>>13;out.negative=self.negative^num.negative,out.length=19,lo=Math.imul(al0,bl0),mid=Math.imul(al0,bh0),mid=mid+Math.imul(ah0,bl0)|0,hi=Math.imul(ah0,bh0);var w0=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w0>>>26)|0,w0&=67108863,lo=Math.imul(al1,bl0),mid=Math.imul(al1,bh0),mid=mid+Math.imul(ah1,bl0)|0,hi=Math.imul(ah1,bh0),lo=lo+Math.imul(al0,bl1)|0,mid=mid+Math.imul(al0,bh1)|0,mid=mid+Math.imul(ah0,bl1)|0,hi=hi+Math.imul(ah0,bh1)|0;var w1=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w1>>>26)|0,w1&=67108863,lo=Math.imul(al2,bl0),mid=Math.imul(al2,bh0),mid=mid+Math.imul(ah2,bl0)|0,hi=Math.imul(ah2,bh0),lo=lo+Math.imul(al1,bl1)|0,mid=mid+Math.imul(al1,bh1)|0,mid=mid+Math.imul(ah1,bl1)|0,hi=hi+Math.imul(ah1,bh1)|0,lo=lo+Math.imul(al0,bl2)|0,mid=mid+Math.imul(al0,bh2)|0,mid=mid+Math.imul(ah0,bl2)|0,hi=hi+Math.imul(ah0,bh2)|0;var w2=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w2>>>26)|0,w2&=67108863,lo=Math.imul(al3,bl0),mid=Math.imul(al3,bh0),mid=mid+Math.imul(ah3,bl0)|0,hi=Math.imul(ah3,bh0),lo=lo+Math.imul(al2,bl1)|0,mid=mid+Math.imul(al2,bh1)|0,mid=mid+Math.imul(ah2,bl1)|0,hi=hi+Math.imul(ah2,bh1)|0,lo=lo+Math.imul(al1,bl2)|0,mid=mid+Math.imul(al1,bh2)|0,mid=mid+Math.imul(ah1,bl2)|0,hi=hi+Math.imul(ah1,bh2)|0,lo=lo+Math.imul(al0,bl3)|0,mid=mid+Math.imul(al0,bh3)|0,mid=mid+Math.imul(ah0,bl3)|0,hi=hi+Math.imul(ah0,bh3)|0;var w3=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w3>>>26)|0,w3&=67108863,lo=Math.imul(al4,bl0),mid=Math.imul(al4,bh0),mid=mid+Math.imul(ah4,bl0)|0,hi=Math.imul(ah4,bh0),lo=lo+Math.imul(al3,bl1)|0,mid=mid+Math.imul(al3,bh1)|0,mid=mid+Math.imul(ah3,bl1)|0,hi=hi+Math.imul(ah3,bh1)|0,lo=lo+Math.imul(al2,bl2)|0,mid=mid+Math.imul(al2,bh2)|0,mid=mid+Math.imul(ah2,bl2)|0,hi=hi+Math.imul(ah2,bh2)|0,lo=lo+Math.imul(al1,bl3)|0,mid=mid+Math.imul(al1,bh3)|0,mid=mid+Math.imul(ah1,bl3)|0,hi=hi+Math.imul(ah1,bh3)|0,lo=lo+Math.imul(al0,bl4)|0,mid=mid+Math.imul(al0,bh4)|0,mid=mid+Math.imul(ah0,bl4)|0,hi=hi+Math.imul(ah0,bh4)|0;var w4=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w4>>>26)|0,w4&=67108863,lo=Math.imul(al5,bl0),mid=Math.imul(al5,bh0),mid=mid+Math.imul(ah5,bl0)|0,hi=Math.imul(ah5,bh0),lo=lo+Math.imul(al4,bl1)|0,mid=mid+Math.imul(al4,bh1)|0,mid=mid+Math.imul(ah4,bl1)|0,hi=hi+Math.imul(ah4,bh1)|0,lo=lo+Math.imul(al3,bl2)|0,mid=mid+Math.imul(al3,bh2)|0,mid=mid+Math.imul(ah3,bl2)|0,hi=hi+Math.imul(ah3,bh2)|0,lo=lo+Math.imul(al2,bl3)|0,mid=mid+Math.imul(al2,bh3)|0,mid=mid+Math.imul(ah2,bl3)|0,hi=hi+Math.imul(ah2,bh3)|0,lo=lo+Math.imul(al1,bl4)|0,mid=mid+Math.imul(al1,bh4)|0,mid=mid+Math.imul(ah1,bl4)|0,hi=hi+Math.imul(ah1,bh4)|0,lo=lo+Math.imul(al0,bl5)|0,mid=mid+Math.imul(al0,bh5)|0,mid=mid+Math.imul(ah0,bl5)|0,hi=hi+Math.imul(ah0,bh5)|0;var w5=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w5>>>26)|0,w5&=67108863,lo=Math.imul(al6,bl0),mid=Math.imul(al6,bh0),mid=mid+Math.imul(ah6,bl0)|0,hi=Math.imul(ah6,bh0),lo=lo+Math.imul(al5,bl1)|0,mid=mid+Math.imul(al5,bh1)|0,mid=mid+Math.imul(ah5,bl1)|0,hi=hi+Math.imul(ah5,bh1)|0,lo=lo+Math.imul(al4,bl2)|0,mid=mid+Math.imul(al4,bh2)|0,mid=mid+Math.imul(ah4,bl2)|0,hi=hi+Math.imul(ah4,bh2)|0,lo=lo+Math.imul(al3,bl3)|0,mid=mid+Math.imul(al3,bh3)|0,mid=mid+Math.imul(ah3,bl3)|0,hi=hi+Math.imul(ah3,bh3)|0,lo=lo+Math.imul(al2,bl4)|0,mid=mid+Math.imul(al2,bh4)|0,mid=mid+Math.imul(ah2,bl4)|0,hi=hi+Math.imul(ah2,bh4)|0,lo=lo+Math.imul(al1,bl5)|0,mid=mid+Math.imul(al1,bh5)|0,mid=mid+Math.imul(ah1,bl5)|0,hi=hi+Math.imul(ah1,bh5)|0,lo=lo+Math.imul(al0,bl6)|0,mid=mid+Math.imul(al0,bh6)|0,mid=mid+Math.imul(ah0,bl6)|0,hi=hi+Math.imul(ah0,bh6)|0;var w6=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w6>>>26)|0,w6&=67108863,lo=Math.imul(al7,bl0),mid=Math.imul(al7,bh0),mid=mid+Math.imul(ah7,bl0)|0,hi=Math.imul(ah7,bh0),lo=lo+Math.imul(al6,bl1)|0,mid=mid+Math.imul(al6,bh1)|0,mid=mid+Math.imul(ah6,bl1)|0,hi=hi+Math.imul(ah6,bh1)|0,lo=lo+Math.imul(al5,bl2)|0,mid=mid+Math.imul(al5,bh2)|0,mid=mid+Math.imul(ah5,bl2)|0,hi=hi+Math.imul(ah5,bh2)|0,lo=lo+Math.imul(al4,bl3)|0,mid=mid+Math.imul(al4,bh3)|0,mid=mid+Math.imul(ah4,bl3)|0,hi=hi+Math.imul(ah4,bh3)|0,lo=lo+Math.imul(al3,bl4)|0,mid=mid+Math.imul(al3,bh4)|0,mid=mid+Math.imul(ah3,bl4)|0,hi=hi+Math.imul(ah3,bh4)|0,lo=lo+Math.imul(al2,bl5)|0,mid=mid+Math.imul(al2,bh5)|0,mid=mid+Math.imul(ah2,bl5)|0,hi=hi+Math.imul(ah2,bh5)|0,lo=lo+Math.imul(al1,bl6)|0,mid=mid+Math.imul(al1,bh6)|0,mid=mid+Math.imul(ah1,bl6)|0,hi=hi+Math.imul(ah1,bh6)|0,lo=lo+Math.imul(al0,bl7)|0,mid=mid+Math.imul(al0,bh7)|0,mid=mid+Math.imul(ah0,bl7)|0,hi=hi+Math.imul(ah0,bh7)|0;var w7=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w7>>>26)|0,w7&=67108863,lo=Math.imul(al8,bl0),mid=Math.imul(al8,bh0),mid=mid+Math.imul(ah8,bl0)|0,hi=Math.imul(ah8,bh0),lo=lo+Math.imul(al7,bl1)|0,mid=mid+Math.imul(al7,bh1)|0,mid=mid+Math.imul(ah7,bl1)|0,hi=hi+Math.imul(ah7,bh1)|0,lo=lo+Math.imul(al6,bl2)|0,mid=mid+Math.imul(al6,bh2)|0,mid=mid+Math.imul(ah6,bl2)|0,hi=hi+Math.imul(ah6,bh2)|0,lo=lo+Math.imul(al5,bl3)|0,mid=mid+Math.imul(al5,bh3)|0,mid=mid+Math.imul(ah5,bl3)|0,hi=hi+Math.imul(ah5,bh3)|0,lo=lo+Math.imul(al4,bl4)|0,mid=mid+Math.imul(al4,bh4)|0,mid=mid+Math.imul(ah4,bl4)|0,hi=hi+Math.imul(ah4,bh4)|0,lo=lo+Math.imul(al3,bl5)|0,mid=mid+Math.imul(al3,bh5)|0,mid=mid+Math.imul(ah3,bl5)|0,hi=hi+Math.imul(ah3,bh5)|0,lo=lo+Math.imul(al2,bl6)|0,mid=mid+Math.imul(al2,bh6)|0,mid=mid+Math.imul(ah2,bl6)|0,hi=hi+Math.imul(ah2,bh6)|0,lo=lo+Math.imul(al1,bl7)|0,mid=mid+Math.imul(al1,bh7)|0,mid=mid+Math.imul(ah1,bl7)|0,hi=hi+Math.imul(ah1,bh7)|0,lo=lo+Math.imul(al0,bl8)|0,mid=mid+Math.imul(al0,bh8)|0,mid=mid+Math.imul(ah0,bl8)|0,hi=hi+Math.imul(ah0,bh8)|0;var w8=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w8>>>26)|0,w8&=67108863,lo=Math.imul(al9,bl0),mid=Math.imul(al9,bh0),mid=mid+Math.imul(ah9,bl0)|0,hi=Math.imul(ah9,bh0),lo=lo+Math.imul(al8,bl1)|0,mid=mid+Math.imul(al8,bh1)|0,mid=mid+Math.imul(ah8,bl1)|0,hi=hi+Math.imul(ah8,bh1)|0,lo=lo+Math.imul(al7,bl2)|0,mid=mid+Math.imul(al7,bh2)|0,mid=mid+Math.imul(ah7,bl2)|0,hi=hi+Math.imul(ah7,bh2)|0,lo=lo+Math.imul(al6,bl3)|0,mid=mid+Math.imul(al6,bh3)|0,mid=mid+Math.imul(ah6,bl3)|0,hi=hi+Math.imul(ah6,bh3)|0,lo=lo+Math.imul(al5,bl4)|0,mid=mid+Math.imul(al5,bh4)|0,mid=mid+Math.imul(ah5,bl4)|0,hi=hi+Math.imul(ah5,bh4)|0,lo=lo+Math.imul(al4,bl5)|0,mid=mid+Math.imul(al4,bh5)|0,mid=mid+Math.imul(ah4,bl5)|0,hi=hi+Math.imul(ah4,bh5)|0,lo=lo+Math.imul(al3,bl6)|0,mid=mid+Math.imul(al3,bh6)|0,mid=mid+Math.imul(ah3,bl6)|0,hi=hi+Math.imul(ah3,bh6)|0,lo=lo+Math.imul(al2,bl7)|0,mid=mid+Math.imul(al2,bh7)|0,mid=mid+Math.imul(ah2,bl7)|0,hi=hi+Math.imul(ah2,bh7)|0,lo=lo+Math.imul(al1,bl8)|0,mid=mid+Math.imul(al1,bh8)|0,mid=mid+Math.imul(ah1,bl8)|0,hi=hi+Math.imul(ah1,bh8)|0,lo=lo+Math.imul(al0,bl9)|0,mid=mid+Math.imul(al0,bh9)|0,mid=mid+Math.imul(ah0,bl9)|0,hi=hi+Math.imul(ah0,bh9)|0;var w9=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w9>>>26)|0,w9&=67108863,lo=Math.imul(al9,bl1),mid=Math.imul(al9,bh1),mid=mid+Math.imul(ah9,bl1)|0,hi=Math.imul(ah9,bh1),lo=lo+Math.imul(al8,bl2)|0, -mid=mid+Math.imul(al8,bh2)|0,mid=mid+Math.imul(ah8,bl2)|0,hi=hi+Math.imul(ah8,bh2)|0,lo=lo+Math.imul(al7,bl3)|0,mid=mid+Math.imul(al7,bh3)|0,mid=mid+Math.imul(ah7,bl3)|0,hi=hi+Math.imul(ah7,bh3)|0,lo=lo+Math.imul(al6,bl4)|0,mid=mid+Math.imul(al6,bh4)|0,mid=mid+Math.imul(ah6,bl4)|0,hi=hi+Math.imul(ah6,bh4)|0,lo=lo+Math.imul(al5,bl5)|0,mid=mid+Math.imul(al5,bh5)|0,mid=mid+Math.imul(ah5,bl5)|0,hi=hi+Math.imul(ah5,bh5)|0,lo=lo+Math.imul(al4,bl6)|0,mid=mid+Math.imul(al4,bh6)|0,mid=mid+Math.imul(ah4,bl6)|0,hi=hi+Math.imul(ah4,bh6)|0,lo=lo+Math.imul(al3,bl7)|0,mid=mid+Math.imul(al3,bh7)|0,mid=mid+Math.imul(ah3,bl7)|0,hi=hi+Math.imul(ah3,bh7)|0,lo=lo+Math.imul(al2,bl8)|0,mid=mid+Math.imul(al2,bh8)|0,mid=mid+Math.imul(ah2,bl8)|0,hi=hi+Math.imul(ah2,bh8)|0,lo=lo+Math.imul(al1,bl9)|0,mid=mid+Math.imul(al1,bh9)|0,mid=mid+Math.imul(ah1,bl9)|0,hi=hi+Math.imul(ah1,bh9)|0;var w10=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w10>>>26)|0,w10&=67108863,lo=Math.imul(al9,bl2),mid=Math.imul(al9,bh2),mid=mid+Math.imul(ah9,bl2)|0,hi=Math.imul(ah9,bh2),lo=lo+Math.imul(al8,bl3)|0,mid=mid+Math.imul(al8,bh3)|0,mid=mid+Math.imul(ah8,bl3)|0,hi=hi+Math.imul(ah8,bh3)|0,lo=lo+Math.imul(al7,bl4)|0,mid=mid+Math.imul(al7,bh4)|0,mid=mid+Math.imul(ah7,bl4)|0,hi=hi+Math.imul(ah7,bh4)|0,lo=lo+Math.imul(al6,bl5)|0,mid=mid+Math.imul(al6,bh5)|0,mid=mid+Math.imul(ah6,bl5)|0,hi=hi+Math.imul(ah6,bh5)|0,lo=lo+Math.imul(al5,bl6)|0,mid=mid+Math.imul(al5,bh6)|0,mid=mid+Math.imul(ah5,bl6)|0,hi=hi+Math.imul(ah5,bh6)|0,lo=lo+Math.imul(al4,bl7)|0,mid=mid+Math.imul(al4,bh7)|0,mid=mid+Math.imul(ah4,bl7)|0,hi=hi+Math.imul(ah4,bh7)|0,lo=lo+Math.imul(al3,bl8)|0,mid=mid+Math.imul(al3,bh8)|0,mid=mid+Math.imul(ah3,bl8)|0,hi=hi+Math.imul(ah3,bh8)|0,lo=lo+Math.imul(al2,bl9)|0,mid=mid+Math.imul(al2,bh9)|0,mid=mid+Math.imul(ah2,bl9)|0,hi=hi+Math.imul(ah2,bh9)|0;var w11=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w11>>>26)|0,w11&=67108863,lo=Math.imul(al9,bl3),mid=Math.imul(al9,bh3),mid=mid+Math.imul(ah9,bl3)|0,hi=Math.imul(ah9,bh3),lo=lo+Math.imul(al8,bl4)|0,mid=mid+Math.imul(al8,bh4)|0,mid=mid+Math.imul(ah8,bl4)|0,hi=hi+Math.imul(ah8,bh4)|0,lo=lo+Math.imul(al7,bl5)|0,mid=mid+Math.imul(al7,bh5)|0,mid=mid+Math.imul(ah7,bl5)|0,hi=hi+Math.imul(ah7,bh5)|0,lo=lo+Math.imul(al6,bl6)|0,mid=mid+Math.imul(al6,bh6)|0,mid=mid+Math.imul(ah6,bl6)|0,hi=hi+Math.imul(ah6,bh6)|0,lo=lo+Math.imul(al5,bl7)|0,mid=mid+Math.imul(al5,bh7)|0,mid=mid+Math.imul(ah5,bl7)|0,hi=hi+Math.imul(ah5,bh7)|0,lo=lo+Math.imul(al4,bl8)|0,mid=mid+Math.imul(al4,bh8)|0,mid=mid+Math.imul(ah4,bl8)|0,hi=hi+Math.imul(ah4,bh8)|0,lo=lo+Math.imul(al3,bl9)|0,mid=mid+Math.imul(al3,bh9)|0,mid=mid+Math.imul(ah3,bl9)|0,hi=hi+Math.imul(ah3,bh9)|0;var w12=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w12>>>26)|0,w12&=67108863,lo=Math.imul(al9,bl4),mid=Math.imul(al9,bh4),mid=mid+Math.imul(ah9,bl4)|0,hi=Math.imul(ah9,bh4),lo=lo+Math.imul(al8,bl5)|0,mid=mid+Math.imul(al8,bh5)|0,mid=mid+Math.imul(ah8,bl5)|0,hi=hi+Math.imul(ah8,bh5)|0,lo=lo+Math.imul(al7,bl6)|0,mid=mid+Math.imul(al7,bh6)|0,mid=mid+Math.imul(ah7,bl6)|0,hi=hi+Math.imul(ah7,bh6)|0,lo=lo+Math.imul(al6,bl7)|0,mid=mid+Math.imul(al6,bh7)|0,mid=mid+Math.imul(ah6,bl7)|0,hi=hi+Math.imul(ah6,bh7)|0,lo=lo+Math.imul(al5,bl8)|0,mid=mid+Math.imul(al5,bh8)|0,mid=mid+Math.imul(ah5,bl8)|0,hi=hi+Math.imul(ah5,bh8)|0,lo=lo+Math.imul(al4,bl9)|0,mid=mid+Math.imul(al4,bh9)|0,mid=mid+Math.imul(ah4,bl9)|0,hi=hi+Math.imul(ah4,bh9)|0;var w13=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w13>>>26)|0,w13&=67108863,lo=Math.imul(al9,bl5),mid=Math.imul(al9,bh5),mid=mid+Math.imul(ah9,bl5)|0,hi=Math.imul(ah9,bh5),lo=lo+Math.imul(al8,bl6)|0,mid=mid+Math.imul(al8,bh6)|0,mid=mid+Math.imul(ah8,bl6)|0,hi=hi+Math.imul(ah8,bh6)|0,lo=lo+Math.imul(al7,bl7)|0,mid=mid+Math.imul(al7,bh7)|0,mid=mid+Math.imul(ah7,bl7)|0,hi=hi+Math.imul(ah7,bh7)|0,lo=lo+Math.imul(al6,bl8)|0,mid=mid+Math.imul(al6,bh8)|0,mid=mid+Math.imul(ah6,bl8)|0,hi=hi+Math.imul(ah6,bh8)|0,lo=lo+Math.imul(al5,bl9)|0,mid=mid+Math.imul(al5,bh9)|0,mid=mid+Math.imul(ah5,bl9)|0,hi=hi+Math.imul(ah5,bh9)|0;var w14=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w14>>>26)|0,w14&=67108863,lo=Math.imul(al9,bl6),mid=Math.imul(al9,bh6),mid=mid+Math.imul(ah9,bl6)|0,hi=Math.imul(ah9,bh6),lo=lo+Math.imul(al8,bl7)|0,mid=mid+Math.imul(al8,bh7)|0,mid=mid+Math.imul(ah8,bl7)|0,hi=hi+Math.imul(ah8,bh7)|0,lo=lo+Math.imul(al7,bl8)|0,mid=mid+Math.imul(al7,bh8)|0,mid=mid+Math.imul(ah7,bl8)|0,hi=hi+Math.imul(ah7,bh8)|0,lo=lo+Math.imul(al6,bl9)|0,mid=mid+Math.imul(al6,bh9)|0,mid=mid+Math.imul(ah6,bl9)|0,hi=hi+Math.imul(ah6,bh9)|0;var w15=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w15>>>26)|0,w15&=67108863,lo=Math.imul(al9,bl7),mid=Math.imul(al9,bh7),mid=mid+Math.imul(ah9,bl7)|0,hi=Math.imul(ah9,bh7),lo=lo+Math.imul(al8,bl8)|0,mid=mid+Math.imul(al8,bh8)|0,mid=mid+Math.imul(ah8,bl8)|0,hi=hi+Math.imul(ah8,bh8)|0,lo=lo+Math.imul(al7,bl9)|0,mid=mid+Math.imul(al7,bh9)|0,mid=mid+Math.imul(ah7,bl9)|0,hi=hi+Math.imul(ah7,bh9)|0;var w16=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w16>>>26)|0,w16&=67108863,lo=Math.imul(al9,bl8),mid=Math.imul(al9,bh8),mid=mid+Math.imul(ah9,bl8)|0,hi=Math.imul(ah9,bh8),lo=lo+Math.imul(al8,bl9)|0,mid=mid+Math.imul(al8,bh9)|0,mid=mid+Math.imul(ah8,bl9)|0,hi=hi+Math.imul(ah8,bh9)|0;var w17=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w17>>>26)|0,w17&=67108863,lo=Math.imul(al9,bl9),mid=Math.imul(al9,bh9),mid=mid+Math.imul(ah9,bl9)|0,hi=Math.imul(ah9,bh9);var w18=(c+lo|0)+((8191&mid)<<13)|0;return c=(hi+(mid>>>13)|0)+(w18>>>26)|0,w18&=67108863,o[0]=w0,o[1]=w1,o[2]=w2,o[3]=w3,o[4]=w4,o[5]=w5,o[6]=w6,o[7]=w7,o[8]=w8,o[9]=w9,o[10]=w10,o[11]=w11,o[12]=w12,o[13]=w13,o[14]=w14,o[15]=w15,o[16]=w16,o[17]=w17,o[18]=w18,0!==c&&(o[19]=c,out.length++),out};Math.imul||(comb10MulTo=smallMulTo),BN.prototype.mulTo=function(num,out){var len=this.length+num.length;return 10===this.length&&10===num.length?comb10MulTo(this,num,out):len<63?smallMulTo(this,num,out):len<1024?bigMulTo(this,num,out):jumboMulTo(this,num,out)},FFTM.prototype.makeRBT=function(N){for(var t=new Array(N),l=BN.prototype._countBits(N)-1,i=0;i>=1;return rb},FFTM.prototype.permute=function(rbt,rws,iws,rtws,itws,N){for(var i=0;i>>=1)i++;return 1<>>=13,rws[2*i+1]=8191&carry,carry>>>=13;for(i=2*len;i>=26,carry+=w/67108864|0,carry+=lo>>>26,this.words[i]=67108863&lo}return 0!==carry&&(this.words[i]=carry,this.length++),this},BN.prototype.muln=function(num){return this.clone().imuln(num)},BN.prototype.sqr=function(){return this.mul(this)},BN.prototype.isqr=function(){return this.imul(this.clone())},BN.prototype.pow=function(num){var w=toBitArray(num);if(0===w.length)return new BN(1);for(var res=this,i=0;i=0);var i,r=bits%26,s=(bits-r)/26,carryMask=67108863>>>26-r<<26-r;if(0!==r){var carry=0;for(i=0;i>>26-r}carry&&(this.words[i]=carry,this.length++)}if(0!==s){for(i=this.length-1;i>=0;i--)this.words[i+s]=this.words[i];for(i=0;i=0);var h;h=hint?(hint-hint%26)/26:0;var r=bits%26,s=Math.min((bits-r)/26,this.length),mask=67108863^67108863>>>r<s)for(this.length-=s,i=0;i=0&&(0!==carry||i>=h);i--){var word=0|this.words[i];this.words[i]=carry<<26-r|word>>>r,carry=word&mask}return maskedWords&&0!==carry&&(maskedWords.words[maskedWords.length++]=carry),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},BN.prototype.ishrn=function(bits,hint,extended){return assert(0===this.negative),this.iushrn(bits,hint,extended)},BN.prototype.shln=function(bits){return this.clone().ishln(bits)},BN.prototype.ushln=function(bits){return this.clone().iushln(bits)},BN.prototype.shrn=function(bits){return this.clone().ishrn(bits)},BN.prototype.ushrn=function(bits){return this.clone().iushrn(bits)},BN.prototype.testn=function(bit){assert("number"==typeof bit&&bit>=0);var r=bit%26,s=(bit-r)/26,q=1<=0);var r=bits%26,s=(bits-r)/26;if(assert(0===this.negative,"imaskn works only with positive numbers"),this.length<=s)return this;if(0!==r&&s++,this.length=Math.min(s,this.length),0!==r){var mask=67108863^67108863>>>r<=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},BN.prototype.isubn=function(num){if(assert("number"==typeof num),assert(num<67108864),num<0)return this.iaddn(-num);if(0!==this.negative)return this.negative=0,this.iaddn(num),this.negative=1,this;if(this.words[0]-=num,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var i=0;i>26)-(right/67108864|0),this.words[i+shift]=67108863&w}for(;i>26,this.words[i+shift]=67108863&w;if(0===carry)return this.strip();for(assert(carry===-1),carry=0,i=0;i>26,this.words[i]=67108863&w;return this.negative=1,this.strip()},BN.prototype._wordDiv=function(num,mode){var shift=this.length-num.length,a=this.clone(),b=num,bhi=0|b.words[b.length-1];0!==(shift=26-this._countBits(bhi))&&(b=b.ushln(shift),a.iushln(shift),bhi=0|b.words[b.length-1]);var q,m=a.length-b.length;if("mod"!==mode){q=new BN(null),q.length=m+1,q.words=new Array(q.length);for(var i=0;i=0;j--){var qj=67108864*(0|a.words[b.length+j])+(0|a.words[b.length+j-1]);for(qj=Math.min(qj/bhi|0,67108863),a._ishlnsubmul(b,qj,j);0!==a.negative;)qj--,a.negative=0,a._ishlnsubmul(b,1,j),a.isZero()||(a.negative^=1);q&&(q.words[j]=qj)}return q&&q.strip(),a.strip(),"div"!==mode&&0!==shift&&a.iushrn(shift),{div:q||null,mod:a}},BN.prototype.divmod=function(num,mode,positive){if(assert(!num.isZero()),this.isZero())return{div:new BN(0),mod:new BN(0)};var div,mod,res;return 0!==this.negative&&0===num.negative?(res=this.neg().divmod(num,mode),"mod"!==mode&&(div=res.div.neg()),"div"!==mode&&(mod=res.mod.neg(),positive&&0!==mod.negative&&mod.iadd(num)),{div:div,mod:mod}):0===this.negative&&0!==num.negative?(res=this.divmod(num.neg(),mode),"mod"!==mode&&(div=res.div.neg()),{div:div,mod:res.mod}):0!=(this.negative&num.negative)?(res=this.neg().divmod(num.neg(),mode),"div"!==mode&&(mod=res.mod.neg(),positive&&0!==mod.negative&&mod.isub(num)),{div:res.div,mod:mod}):num.length>this.length||this.cmp(num)<0?{div:new BN(0),mod:this}:1===num.length?"div"===mode?{div:this.divn(num.words[0]),mod:null}:"mod"===mode?{div:null,mod:new BN(this.modn(num.words[0]))}:{div:this.divn(num.words[0]),mod:new BN(this.modn(num.words[0]))}:this._wordDiv(num,mode)},BN.prototype.div=function(num){return this.divmod(num,"div",!1).div},BN.prototype.mod=function(num){return this.divmod(num,"mod",!1).mod},BN.prototype.umod=function(num){return this.divmod(num,"mod",!0).mod},BN.prototype.divRound=function(num){var dm=this.divmod(num);if(dm.mod.isZero())return dm.div;var mod=0!==dm.div.negative?dm.mod.isub(num):dm.mod,half=num.ushrn(1),r2=num.andln(1),cmp=mod.cmp(half);return cmp<0||1===r2&&0===cmp?dm.div:0!==dm.div.negative?dm.div.isubn(1):dm.div.iaddn(1)},BN.prototype.modn=function(num){assert(num<=67108863);for(var p=(1<<26)%num,acc=0,i=this.length-1;i>=0;i--)acc=(p*acc+(0|this.words[i]))%num;return acc},BN.prototype.idivn=function(num){assert(num<=67108863);for(var carry=0,i=this.length-1;i>=0;i--){var w=(0|this.words[i])+67108864*carry;this.words[i]=w/num|0,carry=w%num}return this.strip()},BN.prototype.divn=function(num){return this.clone().idivn(num)},BN.prototype.egcd=function(p){assert(0===p.negative),assert(!p.isZero());var x=this,y=p.clone();x=0!==x.negative?x.umod(p):x.clone();for(var A=new BN(1),B=new BN(0),C=new BN(0),D=new BN(1),g=0;x.isEven()&&y.isEven();)x.iushrn(1),y.iushrn(1),++g;for(var yp=y.clone(),xp=x.clone();!x.isZero();){for(var i=0,im=1;0==(x.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(x.iushrn(i);i-- >0;)(A.isOdd()||B.isOdd())&&(A.iadd(yp),B.isub(xp)),A.iushrn(1),B.iushrn(1);for(var j=0,jm=1;0==(y.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(y.iushrn(j);j-- >0;)(C.isOdd()||D.isOdd())&&(C.iadd(yp),D.isub(xp)),C.iushrn(1),D.iushrn(1);x.cmp(y)>=0?(x.isub(y),A.isub(C),B.isub(D)):(y.isub(x),C.isub(A),D.isub(B))}return{a:C,b:D,gcd:y.iushln(g)}},BN.prototype._invmp=function(p){assert(0===p.negative),assert(!p.isZero());var a=this,b=p.clone();a=0!==a.negative?a.umod(p):a.clone();for(var x1=new BN(1),x2=new BN(0),delta=b.clone();a.cmpn(1)>0&&b.cmpn(1)>0;){for(var i=0,im=1;0==(a.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(a.iushrn(i);i-- >0;)x1.isOdd()&&x1.iadd(delta),x1.iushrn(1);for(var j=0,jm=1;0==(b.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(b.iushrn(j);j-- >0;)x2.isOdd()&&x2.iadd(delta),x2.iushrn(1);a.cmp(b)>=0?(a.isub(b),x1.isub(x2)):(b.isub(a),x2.isub(x1))}var res;return res=0===a.cmpn(1)?x1:x2,res.cmpn(0)<0&&res.iadd(p),res},BN.prototype.gcd=function(num){if(this.isZero())return num.abs();if(num.isZero())return this.abs();var a=this.clone(),b=num.clone();a.negative=0,b.negative=0;for(var shift=0;a.isEven()&&b.isEven();shift++)a.iushrn(1),b.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;b.isEven();)b.iushrn(1);var r=a.cmp(b);if(r<0){var t=a;a=b,b=t}else if(0===r||0===b.cmpn(1))break;a.isub(b)}return b.iushln(shift)},BN.prototype.invm=function(num){return this.egcd(num).a.umod(num)},BN.prototype.isEven=function(){return 0==(1&this.words[0])},BN.prototype.isOdd=function(){return 1==(1&this.words[0])},BN.prototype.andln=function(num){return this.words[0]&num},BN.prototype.bincn=function(bit){assert("number"==typeof bit);var r=bit%26,s=(bit-r)/26,q=1<>>26,w&=67108863,this.words[i]=w}return 0!==carry&&(this.words[i]=carry,this.length++),this},BN.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},BN.prototype.cmpn=function(num){var negative=num<0;if(0!==this.negative&&!negative)return-1;if(0===this.negative&&negative)return 1;this.strip();var res;if(this.length>1)res=1;else{negative&&(num=-num),assert(num<=67108863,"Number is too big");var w=0|this.words[0];res=w===num?0:wnum.length)return 1;if(this.length=0;i--){var a=0|this.words[i],b=0|num.words[i];if(a!==b){ab&&(res=1);break}}return res},BN.prototype.gtn=function(num){return 1===this.cmpn(num)},BN.prototype.gt=function(num){return 1===this.cmp(num)},BN.prototype.gten=function(num){return this.cmpn(num)>=0},BN.prototype.gte=function(num){return this.cmp(num)>=0},BN.prototype.ltn=function(num){return this.cmpn(num)===-1},BN.prototype.lt=function(num){return this.cmp(num)===-1},BN.prototype.lten=function(num){return this.cmpn(num)<=0},BN.prototype.lte=function(num){return this.cmp(num)<=0},BN.prototype.eqn=function(num){return 0===this.cmpn(num)},BN.prototype.eq=function(num){return 0===this.cmp(num)},BN.red=function(num){return new Red(num)},BN.prototype.toRed=function(ctx){return assert(!this.red,"Already a number in reduction context"),assert(0===this.negative,"red works only with positives"),ctx.convertTo(this)._forceRed(ctx)},BN.prototype.fromRed=function(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function(ctx){return this.red=ctx,this},BN.prototype.forceRed=function(ctx){return assert(!this.red,"Already a number in reduction context"),this._forceRed(ctx)},BN.prototype.redAdd=function(num){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,num)},BN.prototype.redIAdd=function(num){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,num)},BN.prototype.redSub=function(num){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,num)},BN.prototype.redISub=function(num){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,num)},BN.prototype.redShl=function(num){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,num)},BN.prototype.redMul=function(num){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,num),this.red.mul(this,num)},BN.prototype.redIMul=function(num){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,num),this.red.imul(this,num)},BN.prototype.redSqr=function(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function(num){return assert(this.red&&!num.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,num)};var primes={k256:null,p224:null,p192:null,p25519:null};MPrime.prototype._tmp=function(){var tmp=new BN(null);return tmp.words=new Array(Math.ceil(this.n/13)),tmp},MPrime.prototype.ireduce=function(num){var rlen,r=num;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),rlen=r.bitLength()}while(rlen>this.n);var cmp=rlen0?r.isub(this.p):r.strip(),r},MPrime.prototype.split=function(input,out){input.iushrn(this.n,0,out)},MPrime.prototype.imulK=function(num){return num.imul(this.k)},inherits(K256,MPrime),K256.prototype.split=function(input,output){for(var outLen=Math.min(input.length,9),i=0;i>>22,prev=next}prev>>>=22,input.words[i-10]=prev,0===prev&&input.length>10?input.length-=10:input.length-=9},K256.prototype.imulK=function(num){num.words[num.length]=0,num.words[num.length+1]=0,num.length+=2;for(var lo=0,i=0;i>>=26,num.words[i]=lo,carry=hi}return 0!==carry&&(num.words[num.length++]=carry),num},BN._prime=function prime(name){if(primes[name])return primes[name];var prime;if("k256"===name)prime=new K256;else if("p224"===name)prime=new P224;else if("p192"===name)prime=new P192;else{if("p25519"!==name)throw new Error("Unknown prime "+name);prime=new P25519}return primes[name]=prime,prime},Red.prototype._verify1=function(a){assert(0===a.negative,"red works only with positives"),assert(a.red,"red works only with red numbers")},Red.prototype._verify2=function(a,b){assert(0==(a.negative|b.negative),"red works only with positives"),assert(a.red&&a.red===b.red,"red works only with red numbers")},Red.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this)},Red.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},Red.prototype.add=function(a,b){this._verify2(a,b);var res=a.add(b);return res.cmp(this.m)>=0&&res.isub(this.m),res._forceRed(this)},Red.prototype.iadd=function(a,b){this._verify2(a,b);var res=a.iadd(b);return res.cmp(this.m)>=0&&res.isub(this.m),res},Red.prototype.sub=function(a,b){this._verify2(a,b);var res=a.sub(b);return res.cmpn(0)<0&&res.iadd(this.m),res._forceRed(this)},Red.prototype.isub=function(a,b){this._verify2(a,b);var res=a.isub(b);return res.cmpn(0)<0&&res.iadd(this.m),res},Red.prototype.shl=function(a,num){return this._verify1(a),this.imod(a.ushln(num))},Red.prototype.imul=function(a,b){return this._verify2(a,b),this.imod(a.imul(b))},Red.prototype.mul=function(a,b){return this._verify2(a,b),this.imod(a.mul(b))},Red.prototype.isqr=function(a){return this.imul(a,a.clone())},Red.prototype.sqr=function(a){return this.mul(a,a)},Red.prototype.sqrt=function(a){if(a.isZero())return a.clone();var mod3=this.m.andln(3);if(assert(mod3%2==1),3===mod3){var pow=this.m.add(new BN(1)).iushrn(2);return this.pow(a,pow)}for(var q=this.m.subn(1),s=0;!q.isZero()&&0===q.andln(1);)s++,q.iushrn(1);assert(!q.isZero());var one=new BN(1).toRed(this),nOne=one.redNeg(),lpow=this.m.subn(1).iushrn(1),z=this.m.bitLength();for(z=new BN(2*z*z).toRed(this);0!==this.pow(z,lpow).cmp(nOne);)z.redIAdd(nOne);for(var c=this.pow(z,q),r=this.pow(a,q.addn(1).iushrn(1)),t=this.pow(a,q),m=s;0!==t.cmp(one);){for(var tmp=t,i=0;0!==tmp.cmp(one);i++)tmp=tmp.redSqr();assert(i=0;i--){for(var word=num.words[i],j=start-1;j>=0;j--){var bit=word>>j&1;res!==wnd[0]&&(res=this.sqr(res)),0!==bit||0!==current?(current<<=1,current|=bit,(4===++currentLen||0===i&&0===j)&&(res=this.mul(res,wnd[current]),currentLen=0,current=0)):currentLen=0}start=26}return res},Red.prototype.convertTo=function(num){var r=num.umod(this.m);return r===num?r.clone():r},Red.prototype.convertFrom=function(num){var res=num.clone();return res.red=null,res},BN.mont=function(num){return new Mont(num)},inherits(Mont,Red),Mont.prototype.convertTo=function(num){return this.imod(num.ushln(this.shift))},Mont.prototype.convertFrom=function(num){var r=this.imod(num.mul(this.rinv));return r.red=null,r},Mont.prototype.imul=function(a,b){if(a.isZero()||b.isZero())return a.words[0]=0,a.length=1,a;var t=a.imul(b),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=t.isub(c).iushrn(this.shift),res=u;return u.cmp(this.m)>=0?res=u.isub(this.m):u.cmpn(0)<0&&(res=u.iadd(this.m)),res._forceRed(this)},Mont.prototype.mul=function(a,b){if(a.isZero()||b.isZero())return new BN(0)._forceRed(this);var t=a.mul(b),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=t.isub(c).iushrn(this.shift),res=u;return u.cmp(this.m)>=0?res=u.isub(this.m):u.cmpn(0)<0&&(res=u.iadd(this.m)),res._forceRed(this)},Mont.prototype.invm=function(a){return this.imod(a._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===module||module,this)}).call(exports,__webpack_require__(23)(module))},function(module,exports,__webpack_require__){"use strict";var transport=exports;transport.utils=__webpack_require__(802),transport.protocol={},transport.protocol.base=__webpack_require__(163),transport.protocol.spdy=__webpack_require__(321),transport.protocol.http2=__webpack_require__(119),transport.Window=__webpack_require__(803),transport.Priority=__webpack_require__(787),transport.Stream=__webpack_require__(801).Stream,transport.Connection=__webpack_require__(786).Connection,transport.connection=transport.Connection},function(module,exports,__webpack_require__){function Timeout(id,clearFn){this._id=id,this._clearFn=clearFn}var apply=Function.prototype.apply;exports.setTimeout=function(){return new Timeout(apply.call(setTimeout,window,arguments),clearTimeout)},exports.setInterval=function(){return new Timeout(apply.call(setInterval,window,arguments),clearInterval)},exports.clearTimeout=exports.clearInterval=function(timeout){timeout&&timeout.close()},Timeout.prototype.unref=Timeout.prototype.ref=function(){},Timeout.prototype.close=function(){this._clearFn.call(window,this._id)},exports.enroll=function(item,msecs){clearTimeout(item._idleTimeoutId),item._idleTimeout=msecs},exports.unenroll=function(item){clearTimeout(item._idleTimeoutId),item._idleTimeout=-1},exports._unrefActive=exports.active=function(item){clearTimeout(item._idleTimeoutId);var msecs=item._idleTimeout;msecs>=0&&(item._idleTimeoutId=setTimeout(function(){item._onTimeout&&item._onTimeout()},msecs))},__webpack_require__(775),exports.setImmediate=setImmediate,exports.clearImmediate=clearImmediate},function(module,exports){module.exports=function(module){return module.webpackPolyfill||(module.deprecate=function(){},module.paths=[],module.children||(module.children=[]),Object.defineProperty(module,"loaded",{enumerable:!0,get:function(){return module.l}}),Object.defineProperty(module,"id",{enumerable:!0,get:function(){return module.i}}),module.webpackPolyfill=1),module}},function(module,exports,__webpack_require__){var basex=__webpack_require__(381);module.exports=basex("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},function(module,exports,__webpack_require__){"use strict";const createCallback=(method,context)=>{return function(){const args=Array.prototype.slice.call(arguments),lastIndex=args.length-1,lastArg=args&&args.length>0?args[lastIndex]:null;return("function"==typeof lastArg?lastArg:null)?method.apply(context,args):new Promise((resolve,reject)=>{args.push((err,val)=>{if(err)return reject(err);resolve(val)}),method.apply(context,args)})}};module.exports=((methods,options)=>{options=options||{};const type=Object.prototype.toString.call(methods);if("[object Object]"===type||"[object Array]"===type){const obj=options.replace?methods:{};for(let key in methods)methods.hasOwnProperty(key)&&(obj[key]=createCallback(methods[key]));return obj}return createCallback(methods,options.context||methods)})},function(module,exports,__webpack_require__){function Stream(){EE.call(this)}module.exports=Stream;var EE=__webpack_require__(8).EventEmitter;__webpack_require__(1)(Stream,EE),Stream.Readable=__webpack_require__(166),Stream.Writable=__webpack_require__(812),Stream.Duplex=__webpack_require__(807),Stream.Transform=__webpack_require__(811),Stream.PassThrough=__webpack_require__(810),Stream.Stream=Stream,Stream.prototype.pipe=function(dest,options){function ondata(chunk){dest.writable&&!1===dest.write(chunk)&&source.pause&&source.pause()}function ondrain(){source.readable&&source.resume&&source.resume()}function onend(){didOnEnd||(didOnEnd=!0,dest.end())}function onclose(){didOnEnd||(didOnEnd=!0,"function"==typeof dest.destroy&&dest.destroy())}function onerror(er){if(cleanup(),0===EE.listenerCount(this,"error"))throw er}function cleanup(){source.removeListener("data",ondata),dest.removeListener("drain",ondrain),source.removeListener("end",onend), -source.removeListener("close",onclose),source.removeListener("error",onerror),dest.removeListener("error",onerror),source.removeListener("end",cleanup),source.removeListener("close",cleanup),dest.removeListener("close",cleanup)}var source=this;source.on("data",ondata),dest.on("drain",ondrain),dest._isStdio||options&&options.end===!1||(source.on("end",onend),source.on("close",onclose));var didOnEnd=!1;return source.on("error",onerror),dest.on("error",onerror),source.on("end",cleanup),source.on("close",cleanup),dest.on("close",cleanup),dest.emit("pipe",source),dest}},function(module,exports,__webpack_require__){"use strict";var elliptic=exports;elliptic.version=__webpack_require__(545).version,elliptic.utils=__webpack_require__(414),elliptic.rand=__webpack_require__(372),elliptic.curve=__webpack_require__(98),elliptic.curves=__webpack_require__(406),elliptic.ec=__webpack_require__(407),elliptic.eddsa=__webpack_require__(410)},function(module,exports,__webpack_require__){"use strict";const encode=__webpack_require__(726),d=__webpack_require__(725);exports.encode=encode,exports.decode=d.decode,exports.decodeFromReader=d.decodeFromReader},function(module,exports,__webpack_require__){"use strict";exports.Connection=__webpack_require__(455)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function Multihashing(buf,func,length,callback){if("function"==typeof length&&(callback=length,length=void 0),!callback)throw new Error("Missing callback");Multihashing.digest(buf,func,length,(err,digest)=>{if(err)return callback(err);callback(null,multihash.encode(digest,func,length))})}const multihash=__webpack_require__(17),crypto=__webpack_require__(687);module.exports=Multihashing,Multihashing.Buffer=Buffer,Multihashing.multihash=multihash,Multihashing.digest=function(buf,func,length,callback){if("function"==typeof length&&(callback=length,length=void 0),!callback)throw new Error("Missing callback");let cb=callback;length&&(cb=((err,digest)=>{if(err)return callback(err);callback(null,digest.slice(0,length))}));let hash;try{hash=Multihashing.createHash(func)}catch(err){return cb(err)}hash(buf,cb)},Multihashing.createHash=function(func){if(func=multihash.coerceCode(func),!Multihashing.functions[func])throw new Error("multihash function "+func+" not yet supported");return Multihashing.functions[func]},Multihashing.functions={17:crypto.sha1,18:crypto.sha2256,19:crypto.sha2512,20:crypto.sha3512,21:crypto.sha3384,22:crypto.sha3256,23:crypto.sha3224,24:crypto.shake128,25:crypto.shake256,26:crypto.keccak224,27:crypto.keccak256,28:crypto.keccak384,29:crypto.keccak512,34:crypto.murmur3128,35:crypto.murmur332},crypto.addBlake(Multihashing.functions)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function toB64Opt(val){if(val)return val.toString("base64")}const mh=__webpack_require__(17),crypto=__webpack_require__(50),assert=__webpack_require__(7),waterfall=__webpack_require__(9);class PeerId{constructor(id,privKey,pubKey){assert(Buffer.isBuffer(id),"invalid id provided"),privKey&&pubKey&&assert(privKey.public.bytes.equals(pubKey.bytes),"inconsistent arguments"),this._id=id,this._idB58String=mh.toB58String(this.id),this._privKey=privKey,this._pubKey=pubKey}get id(){return this._id}set id(val){throw new Error("Id is immutable")}get privKey(){return this._privKey}set privKey(privKey){this._privKey=privKey}get pubKey(){return this._pubKey?this._pubKey:this._privKey?this._privKey.public:void 0}set pubKey(pubKey){this._pubKey=pubKey}marshalPubKey(){if(this.pubKey)return crypto.marshalPublicKey(this.pubKey)}marshalPrivKey(){if(this.privKey)return crypto.marshalPrivateKey(this.privKey)}toPrint(){return this.toJSON()}toJSON(){return{id:this.toB58String(),privKey:toB64Opt(this.marshalPrivKey()),pubKey:toB64Opt(this.marshalPubKey())}}toHexString(){return mh.toHexString(this.id)}toBytes(){return this.id}toB58String(){return this._idB58String}isEqual(id){if(Buffer.isBuffer(id))return this.id.equals(id);if(id.id)return this.id.equals(id.id);throw new Error("not valid Id")}isValid(callback){this.privKey&&this.privKey.public&&this.privKey.public.bytes&&Buffer.isBuffer(this.pubKey.bytes)&&this.privKey.public.bytes.equals(this.pubKey.bytes)?callback():callback(new Error("Keys not match"))}}exports=module.exports=PeerId,exports.create=function(opts,callback){"function"==typeof opts&&(callback=opts,opts={}),opts=opts||{},opts.bits=opts.bits||2048,waterfall([cb=>crypto.generateKeyPair("RSA",opts.bits,cb),(privKey,cb)=>privKey.public.hash((err,digest)=>{cb(err,digest,privKey)})],(err,digest,privKey)=>{if(err)return callback(err);callback(null,new PeerId(digest,privKey))})},exports.createFromHexString=function(str){return new PeerId(mh.fromHexString(str))},exports.createFromBytes=function(buf){return new PeerId(buf)},exports.createFromB58String=function(str){return new PeerId(mh.fromB58String(str))},exports.createFromPubKey=function(key,callback){if("function"!=typeof callback)throw new Error("callback is required");let buf=key;"string"==typeof buf&&(buf=new Buffer(key,"base64"));const pubKey=crypto.unmarshalPublicKey(buf);pubKey.hash((err,digest)=>{if(err)return callback(err);callback(null,new PeerId(digest,null,pubKey))})},exports.createFromPrivKey=function(key,callback){let buf=key;if("string"==typeof buf&&(buf=new Buffer(key,"base64")),"function"!=typeof callback)throw new Error("callback is required");waterfall([cb=>crypto.unmarshalPrivateKey(buf,cb),(privKey,cb)=>privKey.public.hash((err,digest)=>{cb(err,digest,privKey)})],(err,digest,privKey)=>{if(err)return callback(err);callback(null,new PeerId(digest,privKey))})},exports.createFromJSON=function(obj,callback){if("function"!=typeof callback)throw new Error("callback is required");const id=mh.fromB58String(obj.id),rawPrivKey=obj.privKey&&new Buffer(obj.privKey,"base64"),rawPubKey=obj.pubKey&&new Buffer(obj.pubKey,"base64"),pub=rawPubKey&&crypto.unmarshalPublicKey(rawPubKey);rawPrivKey?waterfall([cb=>crypto.unmarshalPrivateKey(rawPrivKey,cb),(priv,cb)=>priv.public.hash((err,digest)=>{cb(err,digest,priv)}),(privDigest,priv,cb)=>{pub?pub.hash((err,pubDigest)=>{cb(err,privDigest,priv,pubDigest)}):cb(null,privDigest,priv)}],(err,privDigest,priv,pubDigest)=>{return err?callback(err):pub&&!privDigest.equals(pubDigest)?callback(new Error("Public and private key do not match")):id&&!privDigest.equals(id)?callback(new Error("Id and private key do not match")):void callback(null,new PeerId(id,priv,pub))}):callback(null,new PeerId(id,null,pub))},exports.isPeerId=function(peerId){return Boolean("object"==typeof peerId&&peerId._id&&peerId._idB58String)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function eachLimit(coll,iteratee,callback){(0,_eachOf2.default)(coll,(0,_withoutIndex2.default)((0,_wrapAsync2.default)(iteratee)),callback)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=eachLimit;var _eachOf=__webpack_require__(122),_eachOf2=_interopRequireDefault(_eachOf),_withoutIndex=__webpack_require__(180),_withoutIndex2=_interopRequireDefault(_withoutIndex),_wrapAsync=__webpack_require__(19),_wrapAsync2=_interopRequireDefault(_wrapAsync);module.exports=exports.default},function(module,exports){function noop(){}module.exports=noop},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function Multiaddr(addr){if(!(this instanceof Multiaddr))return new Multiaddr(addr);if((addr=addr||"")instanceof Buffer)this.buffer=codec.fromBuffer(addr);else if("string"==typeof addr||addr instanceof String)this.buffer=codec.fromString(addr);else{if(!(addr.buffer&&addr.protos&&addr.protoCodes))throw new Error("addr must be a string, Buffer, or another Multiaddr");this.buffer=codec.fromBuffer(addr.buffer)}}const map=__webpack_require__(148),extend=__webpack_require__(37),codec=__webpack_require__(679),protocols=__webpack_require__(151),varint=__webpack_require__(16),bs58=__webpack_require__(24),NotImplemented=new Error("Sorry, Not Implemented Yet.");exports=module.exports=Multiaddr,Multiaddr.prototype.toString=function(){return codec.bufferToString(this.buffer)},Multiaddr.prototype.toOptions=function(){const opts={},parsed=this.toString().split("/");return opts.family="ip4"===parsed[1]?"ipv4":"ipv6",opts.host=parsed[2],opts.transport=parsed[3],opts.port=parsed[4],opts},Multiaddr.prototype.inspect=function(){return""},Multiaddr.prototype.protos=function(){return map(this.protoCodes(),function(code){return extend(protocols(code))})},Multiaddr.prototype.protoCodes=function(){const codes=[],buf=this.buffer;let i=0;for(;i{if(tuple[0]===protocols.names.ipfs.code)return!0})[0][1],bs58.decode(b58str)}catch(e){b58str=null}return b58str},Multiaddr.prototype.equals=function(addr){return this.buffer.equals(addr.buffer)},Multiaddr.prototype.nodeAddress=function(){if(!this.isThinWaistAddress())throw new Error('Multiaddr must be "thin waist" address for nodeAddress.');const codes=this.protoCodes(),parts=this.toString().split("/").slice(1);return{family:41===codes[0]?"IPv6":"IPv4",address:parts[1],port:parts[3]}},Multiaddr.fromNodeAddress=function(addr,transport){if(!addr)throw new Error("requires node address object");if(!transport)throw new Error("requires transport protocol");return Multiaddr("/"+["IPv6"===addr.family?"ip6":"ip4",addr.address,transport,addr.port].join("/"))},Multiaddr.prototype.isThinWaistAddress=function(addr){const protos=(addr||this).protos();return 2===protos.length&&((4===protos[0].code||41===protos[0].code)&&(6===protos[1].code||17===protos[1].code))},Multiaddr.prototype.fromStupidString=function(str){throw NotImplemented},Multiaddr.protocols=protocols,Multiaddr.isMultiaddr=function(addr){return addr.constructor&&addr.constructor.name?"Multiaddr"===addr.constructor.name:Boolean(addr.fromStupidString&&addr.protos)},Multiaddr.isName=function(addr){return!!Multiaddr.isMultiaddr(addr)&&addr.protos().some(proto=>proto.resolvable)},Multiaddr.resolve=function(addr,callback){return callback(Multiaddr.isMultiaddr(addr)&&Multiaddr.isName(addr)?new Error("not implemented yet"):new Error("not a valid name"))}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){exports=module.exports,exports.raw=new Buffer("00","hex"),exports.base1=new Buffer("01","hex"),exports.base2=new Buffer("55","hex"),exports.base8=new Buffer("07","hex"),exports.base10=new Buffer("09","hex"),exports.protobuf=new Buffer("50","hex"),exports.cbor=new Buffer("51","hex"),exports.rlp=new Buffer("60","hex"),exports.bencode=new Buffer("63","hex"),exports.multicodec=new Buffer("30","hex"),exports.multihash=new Buffer("31","hex"),exports.multiaddr=new Buffer("32","hex"),exports.multibase=new Buffer("33","hex"),exports.sha1=new Buffer("11","hex"),exports["sha2-256"]=new Buffer("12","hex"),exports["sha2-512"]=new Buffer("13","hex"),exports["sha3-224"]=new Buffer("17","hex"),exports["sha3-256"]=new Buffer("16","hex"),exports["sha3-384"]=new Buffer("15","hex"),exports["sha3-512"]=new Buffer("14","hex"),exports["shake-128"]=new Buffer("18","hex"),exports["shake-256"]=new Buffer("19","hex"),exports["keccak-224"]=new Buffer("1a","hex"),exports["keccak-256"]=new Buffer("1b","hex"),exports["keccak-384"]=new Buffer("1c","hex"),exports["keccak-512"]=new Buffer("1d","hex"),exports.blake2b=new Buffer("40","hex"),exports.blake2s=new Buffer("41","hex"),exports.ip4=new Buffer("04","hex"),exports.ip6=new Buffer("29","hex"),exports.tcp=new Buffer("06","hex"),exports.udp=new Buffer("0111","hex"),exports.dccp=new Buffer("21","hex"),exports.sctp=new Buffer("84","hex"),exports.udt=new Buffer("012d","hex"),exports.utp=new Buffer("012e","hex"),exports.ipfs=new Buffer("2a","hex"),exports.http=new Buffer("01e0","hex"),exports.https=new Buffer("01bb","hex"),exports.ws=new Buffer("01dd","hex"),exports.onion=new Buffer("01bc","hex"),exports["dag-pb"]=new Buffer("70","hex"),exports["dag-cbor"]=new Buffer("71","hex"),exports["eth-block"]=new Buffer("90","hex"),exports["eth-block-list"]=new Buffer("91","hex"),exports["eth-tx-trie"]=new Buffer("92","hex"),exports["eth-tx"]=new Buffer("93","hex"),exports["eth-tx-receipt-trie"]=new Buffer("94","hex"),exports["eth-tx-receipt"]=new Buffer("95","hex"),exports["eth-state-trie"]=new Buffer("96","hex"),exports["eth-account-snapshot"]=new Buffer("97","hex"),exports["eth-storage-trie"]=new Buffer("98","hex"),exports["bitcoin-block"]=new Buffer("b0","hex"),exports["bitcoin-tx"]=new Buffer("b1","hex"),exports["stellar-block"]=new Buffer("d0","hex"),exports["stellar-tx"]=new Buffer("d1","hex"),exports["torrent-info"]=new Buffer("7b","hex"),exports["torrent-file"]=new Buffer("7c","hex")}).call(exports,__webpack_require__(0).Buffer)},function(module,exports){function pullPushable(separated,onClose){function read(_abort,_cb){_abort&&(abort=_abort,cb&&callback(abort)),cb=_cb,drain()}function end(end){ended=ended||end||!0,drain()}function push(data){if(!ended){if(cb)return void callback(abort,data);buffer.push(data),drain()}}function drain(){cb&&(abort?callback(abort):!buffer.length&&ended?callback(ended):buffer.length&&callback(null,buffer.shift()))}function callback(err,val){var _cb=cb;if(err&&onClose){var c=onClose;onClose=null,c(err===!0?null:err)}cb=null,_cb(err,val)}"function"==typeof separated&&(onClose=separated,separated=!1);var abort,cb,ended,buffer=[];return separated?{push:push,end:end,source:read}:(read.push=push,read.end=end,read)}module.exports=pullPushable},function(module,exports){function extend(){for(var target={},i=0;i{this.blockSizes.push(size)}),this.removeBlockSize=(index=>{this.blockSizes.splice(index,1)}),this.fileSize=(()=>{let sum=0;return this.blockSizes.forEach(size=>{sum+=size}),data&&(sum+=data.length),sum}),this.marshal=(()=>{let type;switch(this.type){case"raw":type=unixfsData.DataType.Raw;break;case"directory":type=unixfsData.DataType.Directory;break;case"file":type=unixfsData.DataType.File;break;case"metadata":type=unixfsData.DataType.Metadata;break;case"symlink":type=unixfsData.DataType.Symlink;break;case"hamt-sharded-directory":type=unixfsData.DataType.HAMTShard;break;default:throw new Error(`Unkown type: "${this.type}"`)}let fileSize=this.fileSize();return 0===fileSize&&(fileSize=void 0),unixfsData.encode({Type:type,Data:this.data,filesize:fileSize,blocksizes:this.blockSizes.length>0?this.blockSizes:void 0,hashType:this.hashType,fanout:this.fanout})})}const protobuf=__webpack_require__(39),pb=protobuf(__webpack_require__(498)),unixfsData=pb.Data,types=["raw","directory","file","metadata","symlink","hamt-sharded-directory"];Data.unmarshal=(marsheled=>{const decoded=unixfsData.decode(marsheled);decoded.Data||(decoded.Data=void 0);const obj=new Data(types[decoded.Type],decoded.Data);return obj.blockSizes=decoded.blocksizes,obj}),module.exports=Data},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function multibase(nameOrCode,buf){if(!buf)throw new Error("requires an encoded buffer");const base=getBase(nameOrCode),codeBuf=new Buffer(base.code);return validEncode(base.name,buf),Buffer.concat([codeBuf,buf])}function encode(nameOrCode,buf){const base=getBase(nameOrCode);return multibase(base.name,new Buffer(base.encode(buf)))}function decode(bufOrString){Buffer.isBuffer(bufOrString)&&(bufOrString=bufOrString.toString());const code=bufOrString.substring(0,1);"string"==typeof(bufOrString=bufOrString.substring(1,bufOrString.length))&&(bufOrString=new Buffer(bufOrString));const base=getBase(code);return{base:base.name,data:new Buffer(base.decode(bufOrString.toString()))}.data}function isEncoded(bufOrString){Buffer.isBuffer(bufOrString)&&(bufOrString=bufOrString.toString());const code=bufOrString.substring(0,1);try{const base=getBase(code);return base.name}catch(err){return!1}}function validEncode(name,buf){getBase(name).decode(buf.toString())}function getBase(nameOrCode){let base;if(constants.names[nameOrCode])base=constants.names[nameOrCode];else{if(!constants.codes[nameOrCode])throw errNotSupported;base=constants.codes[nameOrCode]}if(!base.isImplemented())throw new Error("Base "+nameOrCode+" is not implemented yet");return base}const constants=__webpack_require__(683);exports=module.exports=multibase,exports.encode=encode,exports.decode=decode,exports.isEncoded=isEncoded;const errNotSupported=new Error("Unsupported encoding")}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const varint=__webpack_require__(16),codecNameToCodeVarint=__webpack_require__(38),codeToCodecName=__webpack_require__(278),util=__webpack_require__(279);exports=module.exports,exports.addPrefix=((multicodecStrOrCode,data)=>{let prefix;if(Buffer.isBuffer(multicodecStrOrCode))prefix=util.varintBufferEncode(multicodecStrOrCode);else{if(!codecNameToCodeVarint[multicodecStrOrCode])throw new Error("multicodec not recognized");prefix=codecNameToCodeVarint[multicodecStrOrCode]}return Buffer.concat([prefix,data])}),exports.rmPrefix=(data=>{return varint.decode(data),data.slice(varint.decode.bytes)}),exports.getCodec=(prefixedData=>{return codeToCodecName[util.varintBufferDecode(prefixedData).toString("hex")]})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(process){function normalizeArray(parts,allowAboveRoot){for(var up=0,i=parts.length-1;i>=0;i--){var last=parts[i];"."===last?parts.splice(i,1):".."===last?(parts.splice(i,1),up++):up&&(parts.splice(i,1),up--)}if(allowAboveRoot)for(;up--;up)parts.unshift("..");return parts}function filter(xs,f){if(xs.filter)return xs.filter(f);for(var res=[],i=0;i=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if("string"!=typeof path)throw new TypeError("Arguments to path.resolve must be strings");path&&(resolvedPath=path+"/"+resolvedPath,resolvedAbsolute="/"===path.charAt(0))}return resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/"),(resolvedAbsolute?"/":"")+resolvedPath||"."},exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash="/"===substr(path,-1);return path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/"),path||isAbsolute||(path="."),path&&trailingSlash&&(path+="/"),(isAbsolute?"/":"")+path},exports.isAbsolute=function(path){return"/"===path.charAt(0)},exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if("string"!=typeof p)throw new TypeError("Arguments to path.join must be strings");return p}).join("/"))},exports.relative=function(from,to){function trim(arr){for(var start=0;start=0&&""===arr[end];end--);return start>end?[]:arr.slice(start,end-start+1)}from=exports.resolve(from).substr(1),to=exports.resolve(to).substr(1);for(var fromParts=trim(from.split("/")),toParts=trim(to.split("/")),length=Math.min(fromParts.length,toParts.length),samePartsLength=length,i=0;i{let key=keys[type.toLowerCase()];if(!key)return cb(new Error("invalid or unsupported key type"));key.generateKeyPair(bits,cb)}),exports.generateKeyPairFromSeed=((type,seed,bits,cb)=>{let key=keys[type.toLowerCase()];return key?"ed25519"!==type.toLowerCase()?cb(new Error("Seed key derivation is unimplemented for RSA or secp256k1")):void key.generateKeyPairFromSeed(seed,bits,cb):cb(new Error("invalid or unsupported key type"))}),exports.unmarshalPublicKey=(buf=>{const decoded=pbm.PublicKey.decode(buf);switch(decoded.Type){case pbm.KeyType.RSA:return keys.rsa.unmarshalRsaPublicKey(decoded.Data);case pbm.KeyType.Ed25519:return keys.ed25519.unmarshalEd25519PublicKey(decoded.Data);case pbm.KeyType.Secp256k1:if(keys.secp256k1)return keys.secp256k1.unmarshalSecp256k1PublicKey(decoded.Data);throw new Error("secp256k1 support requires libp2p-crypto-secp256k1 package");default:throw new Error("invalid or unsupported key type")}}),exports.marshalPublicKey=((key,type)=>{if(type=(type||"rsa").toLowerCase(),!isValidKeyType(type))throw new Error("invalid or unsupported key type");return key.bytes}),exports.unmarshalPrivateKey=((buf,callback)=>{const decoded=pbm.PrivateKey.decode(buf);switch(decoded.Type){case pbm.KeyType.RSA:return keys.rsa.unmarshalRsaPrivateKey(decoded.Data,callback);case pbm.KeyType.Ed25519:return keys.ed25519.unmarshalEd25519PrivateKey(decoded.Data,callback);case pbm.KeyType.Secp256k1:return keys.secp256k1?keys.secp256k1.unmarshalSecp256k1PrivateKey(decoded.Data,callback):callback(new Error("secp256k1 support requires libp2p-crypto-secp256k1 package"));default:callback(new Error("invalid or unsupported key type"))}}),exports.marshalPrivateKey=((key,type)=>{if(type=(type||"rsa").toLowerCase(),!isValidKeyType(type))throw new Error("invalid or unsupported key type");return key.bytes}),exports.randomBytes=(number=>{if(!number||"number"!=typeof number)throw new Error("first argument must be a Number bigger than 0");return c.rsa.getRandomValues(new Uint8Array(number))})},function(module,exports,__webpack_require__){"use strict";const Id=__webpack_require__(31),ensureMultiaddr=__webpack_require__(293).ensureMultiaddr,MultiaddrSet=__webpack_require__(713),assert=__webpack_require__(7);class PeerInfo{constructor(peerId){assert(peerId,"Missing peerId. Use Peer.create(cb) to create one"),this.id=peerId,this.multiaddrs=new MultiaddrSet,this.protocols=new Set,this._connectedMultiaddr=void 0}connect(ma){if(ma=ensureMultiaddr(ma),!this.multiaddrs.has(ma)&&ma.toString()!==`/ipfs/${this.id.toB58String()}`)throw new Error("can't be connected to missing multiaddr from set");this._connectedMultiaddr=ma}disconnect(){this._connectedMultiaddr=void 0}isConnected(){return this._connectedMultiaddr}}PeerInfo.create=((id,callback)=>{if("function"==typeof id)return callback=id,id=null,void Id.create((err,id)=>{if(err)return callback(err);callback(null,new PeerInfo(id))});callback(null,new PeerInfo(id))}),PeerInfo.isPeerInfo=(peerInfo=>{return Boolean("object"==typeof peerInfo&&peerInfo.id&&peerInfo.multiaddrs)}),module.exports=PeerInfo},function(module,exports,__webpack_require__){(function(Buffer){function safeParseInt(v,base){if("00"===v.slice(0,2))throw new Error("invalid RLP: extra zeros");return parseInt(v,base)}function encodeLength(len,offset){if(len<56)return new Buffer([len+offset]);var hexLength=intToHex(len);return new Buffer(intToHex(offset+55+hexLength.length/2)+hexLength,"hex")}function _decode(input){var length,llength,data,innerRemainder,d,decoded=[],firstByte=input[0];if(firstByte<=127)return{data:input.slice(0,1),remainder:input.slice(1)};if(firstByte<=183){if(length=firstByte-127,data=128===firstByte?new Buffer([]):input.slice(1,length),2===length&&data[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:data,remainder:input.slice(length)}}if(firstByte<=191){if(llength=firstByte-182,length=safeParseInt(input.slice(1,llength).toString("hex"),16),data=input.slice(llength,length+llength),data.lengthinput.length)throw new Error("invalid rlp: total length is larger than the data");if(innerRemainder=input.slice(llength,totalLength),0===innerRemainder.length)throw new Error("invalid rlp, List has a invalid length");for(;innerRemainder.length;)d=_decode(innerRemainder),decoded.push(d.data),innerRemainder=d.remainder;return{data:decoded, -remainder:input.slice(totalLength)}}function isHexPrefixed(str){return"0x"===str.slice(0,2)}function stripHexPrefix(str){return"string"!=typeof str?str:isHexPrefixed(str)?str.slice(2):str}function intToHex(i){var hex=i.toString(16);return hex.length%2&&(hex="0"+hex),hex}function padToEven(a){return a.length%2&&(a="0"+a),a}function intToBuffer(i){return new Buffer(intToHex(i),"hex")}function toBuffer(v){if(!Buffer.isBuffer(v))if("string"==typeof v)v=isHexPrefixed(v)?new Buffer(padToEven(stripHexPrefix(v)),"hex"):new Buffer(v);else if("number"==typeof v)v=v?intToBuffer(v):new Buffer([]);else if(null===v||void 0===v)v=new Buffer([]);else{if(!v.toArray)throw new Error("invalid type");v=new Buffer(v.toArray())}return v}const assert=__webpack_require__(7);exports.encode=function(input){if(input instanceof Array){for(var output=[],i=0;i`}toJSON(){return{name:this.name,size:this.size,multihash:mh.toB58String(this._multihash)}}get name(){return this._name}set name(name){throw new Error("Can't set property: 'name' is immutable")}get size(){return this._size}set size(size){throw new Error("Can't set property: 'size' is immutable")}get multihash(){return this._multihash}set multihash(multihash){throw new Error("Can't set property: 'multihash' is immutable")}}exports=module.exports=DAGLink,exports.create=__webpack_require__(501)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.DAGNode=__webpack_require__(135),exports.DAGLink=__webpack_require__(61),exports.resolver=__webpack_require__(506),exports.util=__webpack_require__(136)},function(module,exports,__webpack_require__){function Emitter(obj){if(obj)return mixin(obj)}function mixin(obj){for(var key in Emitter.prototype)obj[key]=Emitter.prototype[key];return obj}module.exports=Emitter,Emitter.prototype.on=Emitter.prototype.addEventListener=function(event,fn){return this._callbacks=this._callbacks||{},(this._callbacks["$"+event]=this._callbacks["$"+event]||[]).push(fn),this},Emitter.prototype.once=function(event,fn){function on(){this.off(event,on),fn.apply(this,arguments)}return on.fn=fn,this.on(event,on),this},Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(event,fn){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var callbacks=this._callbacks["$"+event];if(!callbacks)return this;if(1==arguments.length)return delete this._callbacks["$"+event],this;for(var cb,i=0;i1?{type:packetslist[type],data:data.substring(1)}:{type:packetslist[type]}:err}var asArray=new Uint8Array(data),type=asArray[0],rest=sliceBuffer(data,1);return Blob&&"blob"===binaryType&&(rest=new Blob([rest])),{type:packetslist[type],data:rest}},exports.decodeBase64Packet=function(msg,binaryType){var type=packetslist[msg.charAt(0)];if(!base64encoder)return{type:type,data:{base64:!0,data:msg.substr(1)}};var data=base64encoder.decode(msg.substr(1));return"blob"===binaryType&&Blob&&(data=new Blob([data])),{type:type,data:data}},exports.encodePayload=function(packets,supportsBinary,callback){function setLengthHeader(message){return message.length+":"+message}function encodeOne(packet,doneCallback){exports.encodePacket(packet,!!isBinary&&supportsBinary,!1,function(message){doneCallback(null,setLengthHeader(message))})}"function"==typeof supportsBinary&&(callback=supportsBinary,supportsBinary=null);var isBinary=hasBinary(packets);return supportsBinary&&isBinary?Blob&&!dontSendBlobs?exports.encodePayloadAsBlob(packets,callback):exports.encodePayloadAsArrayBuffer(packets,callback):packets.length?void map(packets,encodeOne,function(err,results){return callback(results.join(""))}):callback("0:")},exports.decodePayload=function(data,binaryType,callback){if("string"!=typeof data)return exports.decodePayloadAsBinary(data,binaryType,callback);"function"==typeof binaryType&&(callback=binaryType,binaryType=null);var packet;if(""===data)return callback(err,0,1);for(var n,msg,length="",i=0,l=data.length;i0;){for(var tailArray=new Uint8Array(bufferTail),isString=0===tailArray[0],msgLength="",i=1;255!==tailArray[i];i++){if(msgLength.length>310)return callback(err,0,1);msgLength+=tailArray[i]}bufferTail=sliceBuffer(bufferTail,2+msgLength.length),msgLength=parseInt(msgLength);var msg=sliceBuffer(bufferTail,0,msgLength);if(isString)try{msg=String.fromCharCode.apply(null,new Uint8Array(msg))}catch(e){var typed=new Uint8Array(msg);msg="";for(var i=0;i=8*this._finalSize&&(this._update(this._block),this._block.fill(0)),this._block.writeInt32BE(l,this._blockSize-4);var hash=this._update(this._block)||this._hash();return enc?hash.toString(enc):hash},Hash.prototype._update=function(){throw new Error("_update must be implemented by subclass")},module.exports=Hash}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function Duplex(options){if(!(this instanceof Duplex))return new Duplex(options);Readable.call(this,options),Writable.call(this,options),options&&options.readable===!1&&(this.readable=!1),options&&options.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,options&&options.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",onend)}function onend(){this.allowHalfOpen||this._writableState.ended||processNextTick(onEndNT,this)}function onEndNT(self){self.end()}var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)keys.push(key);return keys};module.exports=Duplex;var processNextTick=__webpack_require__(15),util=__webpack_require__(6);util.inherits=__webpack_require__(1);var Readable=__webpack_require__(316),Writable=__webpack_require__(318);util.inherits(Duplex,Readable);for(var keys=objectKeys(Writable.prototype),v=0;v-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}function noop(){}function once(fn){return function(){if(null!==fn){var callFn=fn;fn=null,callFn.apply(this,arguments)}}}function baseTimes(n,iteratee){for(var index=-1,result=Array(n);++index-1&&value%1==0&&valuelength?0:length+start),end=end>length?length:end,end<0&&(end+=length),length=start>end?0:end-start>>>0,start>>>=0;for(var result=Array(length);++index=length?array:baseSlice(array,start,end)}function charsEndIndex(strSymbols,chrSymbols){for(var index=strSymbols.length;index--&&baseIndexOf(chrSymbols,strSymbols[index],0)>-1;);return index}function charsStartIndex(strSymbols,chrSymbols){for(var index=-1,length=strSymbols.length;++index-1;);return index}function asciiToArray(string){return string.split("")}function hasUnicode(string){return reHasUnicode.test(string)}function unicodeToArray(string){return string.match(reUnicode)||[]}function stringToArray(string){return hasUnicode(string)?unicodeToArray(string):asciiToArray(string)}function toString(value){return null==value?"":baseToString(value)}function trim(string,chars,guard){if((string=toString(string))&&(guard||void 0===chars))return string.replace(reTrim,"");if(!string||!(chars=baseToString(chars)))return string;var strSymbols=stringToArray(string),chrSymbols=stringToArray(chars);return castSlice(strSymbols,charsStartIndex(strSymbols,chrSymbols),charsEndIndex(strSymbols,chrSymbols)+1).join("")}function parseParams(func){return func=func.toString().replace(STRIP_COMMENTS,""),func=func.match(FN_ARGS)[2].replace(" ",""),func=func?func.split(FN_ARG_SPLIT):[],func=func.map(function(arg){return trim(arg.replace(FN_ARG,""))})}function autoInject(tasks,callback){var newTasks={};baseForOwn(tasks,function(taskFn,key){function newTask(results,taskCb){var newArgs=arrayMap(params,function(name){return results[name]});newArgs.push(taskCb),wrapAsync(taskFn).apply(null,newArgs)}var params,fnIsAsync=isAsync(taskFn),hasNoDeps=!fnIsAsync&&1===taskFn.length||fnIsAsync&&0===taskFn.length;if(isArray(taskFn))params=taskFn.slice(0,-1),taskFn=taskFn[taskFn.length-1],newTasks[key]=params.concat(params.length>0?newTask:taskFn);else if(hasNoDeps)newTasks[key]=taskFn;else{if(params=parseParams(taskFn),0===taskFn.length&&!fnIsAsync&&0===params.length)throw new Error("autoInject task functions require explicit parameters.");fnIsAsync||params.pop(),newTasks[key]=params.concat(newTask)}}),auto(newTasks,callback)}function DLL(){this.head=this.tail=null,this.length=0}function setInitial(dll,node){dll.length=1,dll.head=dll.tail=node}function queue(worker,concurrency,payload){function _insert(data,insertAtFront,callback){if(null!=callback&&"function"!=typeof callback)throw new Error("task callback must be a function");if(q.started=!0,isArray(data)||(data=[data]),0===data.length&&q.idle())return setImmediate$1(function(){q.drain()});for(var i=0,l=data.length;i=0&&workersList.splice(index),task.callback.apply(task,arguments),null!=err&&q.error(err,task.data)}numRunning<=q.concurrency-q.buffer&&q.unsaturated(),q.idle()&&q.drain(),q.process()}}if(null==concurrency)concurrency=1;else if(0===concurrency)throw new Error("Concurrency must not be zero");var _worker=wrapAsync(worker),numRunning=0,workersList=[],isProcessing=!1,q={_tasks:new DLL,concurrency:concurrency,payload:payload,saturated:noop,unsaturated:noop,buffer:concurrency/4,empty:noop,drain:noop,error:noop,started:!1,paused:!1,push:function(data,callback){_insert(data,!1,callback)},kill:function(){q.drain=noop,q._tasks.empty()},unshift:function(data,callback){_insert(data,!0,callback)},remove:function(testFn){q._tasks.remove(testFn)},process:function(){if(!isProcessing){for(isProcessing=!0;!q.paused&&numRunning2&&(result=slice(arguments,1)),results[key]=result,callback(err)})},function(err){callback(err,results)})}function parallelLimit(tasks,callback){_parallel(eachOf,tasks,callback)}function parallelLimit$1(tasks,limit,callback){_parallel(_eachOfLimit(limit),tasks,callback)}function race(tasks,callback){if(callback=once(callback||noop),!isArray(tasks))return callback(new TypeError("First argument to race must be an array of functions"));if(!tasks.length)return callback();for(var i=0,l=tasks.length;ib?1:0}var _iteratee=wrapAsync(iteratee);map(coll,function(x,callback){_iteratee(x,function(err,criteria){if(err)return callback(err);callback(null,{value:x,criteria:criteria})})},function(err,results){if(err)return callback(err);callback(null,arrayMap(results.sort(comparator),baseProperty("value")))})}function timeout(asyncFn,milliseconds,info){var fn=wrapAsync(asyncFn);return initialParams(function(args,callback){function timeoutCallback(){var name=asyncFn.name||"anonymous",error=new Error('Callback function "'+name+'" timed out.');error.code="ETIMEDOUT",info&&(error.info=info),timedOut=!0,callback(error)}var timer,timedOut=!1;args.push(function(){timedOut||(callback.apply(null,arguments),clearTimeout(timer))}),timer=setTimeout(timeoutCallback,milliseconds),fn.apply(null,args)})}function baseRange(start,end,step,fromRight){for(var index=-1,length=nativeMax(nativeCeil((end-start)/(step||1)),0),result=Array(length);length--;)result[fromRight?length:++index]=start,start+=step;return result}function timeLimit(count,limit,iteratee,callback){var _iteratee=wrapAsync(iteratee);mapLimit(baseRange(0,count,1),limit,_iteratee,callback)}function transform(coll,accumulator,iteratee,callback){arguments.length<=3&&(callback=iteratee,iteratee=accumulator,accumulator=isArray(coll)?[]:{}),callback=once(callback||noop);var _iteratee=wrapAsync(iteratee);eachOf(coll,function(v,k,cb){_iteratee(accumulator,v,k,cb)},function(err){callback(err,accumulator)})}function tryEach(tasks,callback){var result,error=null;callback=callback||noop,eachSeries(tasks,function(task,callback){wrapAsync(task)(function(err,res){result=arguments.length>2?slice(arguments,1):res,error=err,callback(!err)})},function(){callback(error,result)})}function unmemoize(fn){return function(){return(fn.unmemoized||fn).apply(null,arguments)}}function whilst(test,iteratee,callback){callback=onlyOnce(callback||noop);var _iteratee=wrapAsync(iteratee);if(!test())return callback(null);var next=function(err){if(err)return callback(err);if(test())return _iteratee(next);var args=slice(arguments,1);callback.apply(null,[null].concat(args))};_iteratee(next)}function until(test,iteratee,callback){whilst(function(){return!test.apply(this,arguments)},iteratee,callback)}var _defer,initialParams=function(fn){return function(){var args=slice(arguments),callback=args.pop();fn.call(this,args,callback)}},hasSetImmediate="function"==typeof setImmediate&&setImmediate,hasNextTick="object"==typeof process&&"function"==typeof process.nextTick;_defer=hasSetImmediate?setImmediate:hasNextTick?process.nextTick:fallback;var setImmediate$1=wrap(_defer),supportsSymbol="function"==typeof Symbol,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),Symbol$1=root.Symbol,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,nativeObjectToString=objectProto.toString,symToStringTag$1=Symbol$1?Symbol$1.toStringTag:void 0,objectProto$1=Object.prototype,nativeObjectToString$1=objectProto$1.toString,nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=Symbol$1?Symbol$1.toStringTag:void 0,asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]",MAX_SAFE_INTEGER=9007199254740991,breakLoop={},iteratorSymbol="function"==typeof Symbol&&Symbol.iterator,getIterator=function(coll){return iteratorSymbol&&coll[iteratorSymbol]&&coll[iteratorSymbol]()},argsTag="[object Arguments]",objectProto$3=Object.prototype,hasOwnProperty$2=objectProto$3.hasOwnProperty,propertyIsEnumerable=objectProto$3.propertyIsEnumerable,isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty$2.call(value,"callee")&&!propertyIsEnumerable.call(value,"callee")},isArray=Array.isArray,freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,Buffer=moduleExports?root.Buffer:void 0,nativeIsBuffer=Buffer?Buffer.isBuffer:void 0,isBuffer=nativeIsBuffer||stubFalse,MAX_SAFE_INTEGER$1=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags["[object Arguments]"]=typedArrayTags["[object Array]"]=typedArrayTags["[object ArrayBuffer]"]=typedArrayTags["[object Boolean]"]=typedArrayTags["[object DataView]"]=typedArrayTags["[object Date]"]=typedArrayTags["[object Error]"]=typedArrayTags["[object Function]"]=typedArrayTags["[object Map]"]=typedArrayTags["[object Number]"]=typedArrayTags["[object Object]"]=typedArrayTags["[object RegExp]"]=typedArrayTags["[object Set]"]=typedArrayTags["[object String]"]=typedArrayTags["[object WeakMap]"]=!1;var freeExports$1="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule$1=freeExports$1&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports$1=freeModule$1&&freeModule$1.exports===freeExports$1,freeProcess=moduleExports$1&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?function(func){return function(value){return func(value)}}(nodeIsTypedArray):baseIsTypedArray,objectProto$2=Object.prototype,hasOwnProperty$1=objectProto$2.hasOwnProperty,objectProto$5=Object.prototype,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty,eachOfGeneric=doLimit(eachOfLimit,1/0),eachOf=function(coll,iteratee,callback){(isArrayLike(coll)?eachOfArrayLike:eachOfGeneric)(coll,wrapAsync(iteratee),callback)},map=doParallel(_asyncMap),applyEach=applyEach$1(map),mapLimit=doParallelLimit(_asyncMap),mapSeries=doLimit(mapLimit,1),applyEachSeries=applyEach$1(mapSeries),apply=function(fn){var args=slice(arguments,1);return function(){var callArgs=slice(arguments);return fn.apply(null,args.concat(callArgs))}},baseFor=function(fromRight){return function(object,iteratee,keysFunc){for(var index=-1,iterable=Object(object),props=keysFunc(object),length=props.length;length--;){var key=props[fromRight?length:++index];if(iteratee(iterable[key],key,iterable)===!1)break}return object}}(),auto=function(tasks,concurrency,callback){function enqueueTask(key,task){readyTasks.push(function(){runTask(key,task)})}function processQueue(){if(0===readyTasks.length&&0===runningTasks)return callback(null,results);for(;readyTasks.length&&runningTasks2&&(result=slice(arguments,1)),err){var safeResults={};baseForOwn(results,function(val,rkey){safeResults[rkey]=val}),safeResults[key]=result,hasError=!0,listeners=Object.create(null),callback(err,safeResults)}else results[key]=result,taskComplete(key)});runningTasks++;var taskFn=wrapAsync(task[task.length-1]);task.length>1?taskFn(results,taskCallback):taskFn(taskCallback)}}function getDependents(taskName){var result=[];return baseForOwn(tasks,function(task,key){isArray(task)&&baseIndexOf(task,taskName,0)>=0&&result.push(key)}),result}"function"==typeof concurrency&&(callback=concurrency,concurrency=null),callback=once(callback||noop);var keys$$1=keys(tasks),numTasks=keys$$1.length;if(!numTasks)return callback(null);concurrency||(concurrency=numTasks);var results={},runningTasks=0,hasError=!1,listeners=Object.create(null),readyTasks=[],readyToCheck=[],uncheckedDependencies={};baseForOwn(tasks,function(task,key){if(!isArray(task))return enqueueTask(key,[task]),void readyToCheck.push(key);var dependencies=task.slice(0,task.length-1),remainingDependencies=dependencies.length;if(0===remainingDependencies)return enqueueTask(key,task),void readyToCheck.push(key);uncheckedDependencies[key]=remainingDependencies,arrayEach(dependencies,function(dependencyName){if(!tasks[dependencyName])throw new Error("async.auto task `"+key+"` has a non-existent dependency `"+dependencyName+"` in "+dependencies.join(", "));addListener(dependencyName,function(){0===--remainingDependencies&&enqueueTask(key,task)})})}),function(){for(var currentTask,counter=0;readyToCheck.length;)currentTask=readyToCheck.pop(),counter++,arrayEach(getDependents(currentTask),function(dependent){0==--uncheckedDependencies[dependent]&&readyToCheck.push(dependent)});if(counter!==numTasks)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),processQueue()},symbolTag="[object Symbol]",INFINITY=1/0,symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0,reHasUnicode=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),rsCombo="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",rsFitz="\\ud83c[\\udffb-\\udfff]",rsRegional="(?:\\ud83c[\\udde6-\\uddff]){2}",rsSurrPair="[\\ud800-\\udbff][\\udc00-\\udfff]",reOptMod="(?:"+rsCombo+"|"+rsFitz+")?",rsOptJoin="(?:\\u200d(?:"+["[^\\ud800-\\udfff]",rsRegional,rsSurrPair].join("|")+")[\\ufe0e\\ufe0f]?"+reOptMod+")*",rsSeq="[\\ufe0e\\ufe0f]?"+reOptMod+rsOptJoin,rsSymbol="(?:"+["[^\\ud800-\\udfff]"+rsCombo+"?",rsCombo,rsRegional,rsSurrPair,"[\\ud800-\\udfff]"].join("|")+")",reUnicode=RegExp(rsFitz+"(?="+rsFitz+")|"+rsSymbol+rsSeq,"g"),reTrim=/^\s+|\s+$/g,FN_ARGS=/^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m,FN_ARG_SPLIT=/,/,FN_ARG=/(=.+)?(\s*)$/,STRIP_COMMENTS=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;DLL.prototype.removeLink=function(node){return node.prev?node.prev.next=node.next:this.head=node.next,node.next?node.next.prev=node.prev:this.tail=node.prev,node.prev=node.next=null,this.length-=1,node},DLL.prototype.empty=function(){for(;this.head;)this.shift();return this},DLL.prototype.insertAfter=function(node,newNode){newNode.prev=node,newNode.next=node.next,node.next?node.next.prev=newNode:this.tail=newNode,node.next=newNode,this.length+=1},DLL.prototype.insertBefore=function(node,newNode){newNode.prev=node.prev,newNode.next=node,node.prev?node.prev.next=newNode:this.head=newNode,node.prev=newNode,this.length+=1},DLL.prototype.unshift=function(node){this.head?this.insertBefore(this.head,node):setInitial(this,node)},DLL.prototype.push=function(node){this.tail?this.insertAfter(this.tail,node):setInitial(this,node)},DLL.prototype.shift=function(){return this.head&&this.removeLink(this.head)},DLL.prototype.pop=function(){return this.tail&&this.removeLink(this.tail)},DLL.prototype.toArray=function(){for(var arr=Array(this.length),curr=this.head,idx=0;idx=nextNode.priority;)nextNode=nextNode.next;for(var i=0,l=data.length;i15&&raise(id,tooManyDigits,n),num=!1):x.s=45===str.charCodeAt(0)?(str=str.slice(1),-1):1,str=convertBase(str,10,b,x.s)}else{if(n instanceof BigNumber)return x.s=n.s,x.e=n.e,x.c=(n=n.c)?n.slice():n,void(id=0);if((num="number"==typeof n)&&0*n==0){if(x.s=1/n<0?(n=-n,-1):1,n===~~n){for(e=0,i=n;i>=10;i/=10,e++);return x.e=e,x.c=[n],void(id=0)}str=n+""}else{if(!isNumeric.test(str=n+""))return parseNumeric(x,str,num);x.s=45===str.charCodeAt(0)?(str=str.slice(1),-1):1}}for((e=str.indexOf("."))>-1&&(str=str.replace(".","")),(i=str.search(/e/i))>0?(e<0&&(e=i),e+=+str.slice(i+1),str=str.substring(0,i)):e<0&&(e=str.length),i=0;48===str.charCodeAt(i);i++);for(len=str.length;48===str.charCodeAt(--len););if(str=str.slice(i,len+1))if(len=str.length,num&&ERRORS&&len>15&&(n>MAX_SAFE_INTEGER||n!==mathfloor(n))&&raise(id,tooManyDigits,x.s*n),(e=e-i-1)>MAX_EXP)x.c=x.e=null;else if(e=0&&(k=POW_PRECISION,POW_PRECISION=0,str=str.replace(".",""),y=new BigNumber(baseIn),x=y.pow(str.length-i),POW_PRECISION=k,y.c=toBaseOut(toFixedPoint(coeffToString(x.c),x.e),10,baseOut),y.e=y.c.length),xc=toBaseOut(str,baseIn,baseOut),e=k=xc.length;0==xc[--k];xc.pop());if(!xc[0])return"0";if(i<0?--e:(x.c=xc,x.e=e,x.s=sign,x=div(x,y,dp,rm,baseOut),xc=x.c,r=x.r,e=x.e),d=e+dp+1,i=xc[d],k=baseOut/2,r=r||d<0||null!=xc[d+1],r=rm<4?(null!=i||r)&&(0==rm||rm==(x.s<0?3:2)):i>k||i==k&&(4==rm||r||6==rm&&1&xc[d-1]||rm==(x.s<0?8:7)),d<1||!xc[0])str=r?toFixedPoint("1",-dp):"0";else{if(xc.length=d,r)for(--baseOut;++xc[--d]>baseOut;)xc[d]=0,d||(++e,xc.unshift(1));for(k=xc.length;!xc[--k];);for(i=0,str="";i<=k;str+=ALPHABET.charAt(xc[i++]));str=toFixedPoint(str,e)}return str}function format(n,i,rm,caller){var c0,e,ne,len,str;if(rm=null!=rm&&isValidInt(rm,0,8,caller,roundingMode)?0|rm:ROUNDING_MODE,!n.c)return n.toString();if(c0=n.c[0],ne=n.e,null==i)str=coeffToString(n.c),str=19==caller||24==caller&&ne<=TO_EXP_NEG?toExponential(str,ne):toFixedPoint(str,ne);else if(n=round(new BigNumber(n),i,rm),e=n.e,str=coeffToString(n.c),len=str.length,19==caller||24==caller&&(i<=e||e<=TO_EXP_NEG)){for(;lenlen){if(--i>0)for(str+=".";i--;str+="0");}else if((i+=e-len)>0)for(e+1==len&&(str+=".");i--;str+="0");return n.s<0&&c0?"-"+str:str}function maxOrMin(args,method){var m,n,i=0;for(isArray(args[0])&&(args=args[0]),m=new BigNumber(args[0]);++imax||n!=truncate(n))&&raise(caller,(name||"decimal places")+(nmax?" out of range":" not an integer"),n),!0}function normalise(n,c,e){for(var i=1,j=c.length;!c[--j];c.pop());for(j=c[0];j>=10;j/=10,i++);return(e=i+e*LOG_BASE-1)>MAX_EXP?n.c=n.e=null:e=10;k/=10,d++);if((i=sd-d)<0)i+=LOG_BASE,j=sd,n=xc[ni=0],rd=n/pows10[d-j-1]%10|0;else if((ni=mathceil((i+1)/LOG_BASE))>=xc.length){if(!r)break out;for(;xc.length<=ni;xc.push(0));n=rd=0,d=1,i%=LOG_BASE,j=i-LOG_BASE+1}else{for(n=k=xc[ni],d=1;k>=10;k/=10,d++);i%=LOG_BASE,j=i-LOG_BASE+d,rd=j<0?0:n/pows10[d-j-1]%10|0}if(r=r||sd<0||null!=xc[ni+1]||(j<0?n:n%pows10[d-j-1]),r=rm<4?(rd||r)&&(0==rm||rm==(x.s<0?3:2)):rd>5||5==rd&&(4==rm||r||6==rm&&(i>0?j>0?n/pows10[d-j]:0:xc[ni-1])%10&1||rm==(x.s<0?8:7)),sd<1||!xc[0])return xc.length=0,r?(sd-=x.e+1,xc[0]=pows10[(LOG_BASE-sd%LOG_BASE)%LOG_BASE],x.e=-sd||0):xc[0]=x.e=0,x;if(0==i?(xc.length=ni,k=1,ni--):(xc.length=ni+1,k=pows10[LOG_BASE-i],xc[ni]=j>0?mathfloor(n/pows10[d-j]%pows10[j])*k:0),r)for(;;){if(0==ni){for(i=1,j=xc[0];j>=10;j/=10,i++);for(j=xc[0]+=k,k=1;j>=10;j/=10,k++);i!=k&&(x.e++,xc[0]==BASE&&(xc[0]=1));break}if(xc[ni]+=k,xc[ni]!=BASE)break;xc[ni--]=0,k=1}for(i=xc.length;0===xc[--i];xc.pop());}x.e>MAX_EXP?x.c=x.e=null:x.ei)return null!=(v=a[i++])};return has(p="DECIMAL_PLACES")&&isValidInt(v,0,MAX,2,p)&&(DECIMAL_PLACES=0|v),r[p]=DECIMAL_PLACES,has(p="ROUNDING_MODE")&&isValidInt(v,0,8,2,p)&&(ROUNDING_MODE=0|v),r[p]=ROUNDING_MODE,has(p="EXPONENTIAL_AT")&&(isArray(v)?isValidInt(v[0],-MAX,0,2,p)&&isValidInt(v[1],0,MAX,2,p)&&(TO_EXP_NEG=0|v[0],TO_EXP_POS=0|v[1]):isValidInt(v,-MAX,MAX,2,p)&&(TO_EXP_NEG=-(TO_EXP_POS=0|(v<0?-v:v)))),r[p]=[TO_EXP_NEG,TO_EXP_POS],has(p="RANGE")&&(isArray(v)?isValidInt(v[0],-MAX,-1,2,p)&&isValidInt(v[1],1,MAX,2,p)&&(MIN_EXP=0|v[0],MAX_EXP=0|v[1]):isValidInt(v,-MAX,MAX,2,p)&&(0|v?MIN_EXP=-(MAX_EXP=0|(v<0?-v:v)):ERRORS&&raise(2,p+" cannot be zero",v))),r[p]=[MIN_EXP,MAX_EXP],has(p="ERRORS")&&(v===!!v||1===v||0===v?(id=0,isValidInt=(ERRORS=!!v)?intValidatorWithErrors:intValidatorNoErrors):ERRORS&&raise(2,p+notBool,v)),r[p]=ERRORS,has(p="CRYPTO")&&(v===!0||v===!1||1===v||0===v?v?(v="undefined"==typeof crypto,!v&&crypto&&(crypto.getRandomValues||crypto.randomBytes)?CRYPTO=!0:ERRORS?raise(2,"crypto unavailable",v?void 0:crypto):CRYPTO=!1):CRYPTO=!1:ERRORS&&raise(2,p+notBool,v)),r[p]=CRYPTO,has(p="MODULO_MODE")&&isValidInt(v,0,9,2,p)&&(MODULO_MODE=0|v),r[p]=MODULO_MODE,has(p="POW_PRECISION")&&isValidInt(v,0,MAX,2,p)&&(POW_PRECISION=0|v),r[p]=POW_PRECISION,has(p="FORMAT")&&("object"==typeof v?FORMAT=v:ERRORS&&raise(2,p+" not an object",v)),r[p]=FORMAT,r},BigNumber.max=function(){return maxOrMin(arguments,P.lt)},BigNumber.min=function(){return maxOrMin(arguments,P.gt)},BigNumber.random=function(){var random53bitInt=9007199254740992*Math.random()&2097151?function(){return mathfloor(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(dp){var a,b,e,k,v,i=0,c=[],rand=new BigNumber(ONE);if(dp=null!=dp&&isValidInt(dp,0,MAX,14)?0|dp:DECIMAL_PLACES,k=mathceil(dp/LOG_BASE),CRYPTO)if(crypto.getRandomValues){for(a=crypto.getRandomValues(new Uint32Array(k*=2));i>>11),v>=9e15?(b=crypto.getRandomValues(new Uint32Array(2)),a[i]=b[0],a[i+1]=b[1]):(c.push(v%1e14),i+=2);i=k/2}else if(crypto.randomBytes){for(a=crypto.randomBytes(k*=7);i=9e15?crypto.randomBytes(7).copy(a,i):(c.push(v%1e14),i+=7);i=k/7}else CRYPTO=!1,ERRORS&&raise(14,"crypto unavailable",crypto);if(!CRYPTO)for(;i=10;v/=10,i++);ibL?1:-1;else for(i=cmp=0;ib[i]?1:-1;break}return cmp}function subtract(a,b,aL,base){for(var i=0;aL--;)a[aL]-=i,i=a[aL]1;a.shift());}return function(x,y,dp,rm,base){var cmp,e,i,more,n,prod,prodL,q,qc,rem,remL,rem0,xi,xL,yc0,yL,yz,s=x.s==y.s?1:-1,xc=x.c,yc=y.c;if(!(xc&&xc[0]&&yc&&yc[0]))return new BigNumber(x.s&&y.s&&(xc?!yc||xc[0]!=yc[0]:yc)?xc&&0==xc[0]||!yc?0*s:s/0:NaN);for(q=new BigNumber(s),qc=q.c=[],e=x.e-y.e,s=dp+e+1,base||(base=BASE,e=bitFloor(x.e/LOG_BASE)-bitFloor(y.e/LOG_BASE),s=s/LOG_BASE|0),i=0;yc[i]==(xc[i]||0);i++);if(yc[i]>(xc[i]||0)&&e--,s<0)qc.push(1),more=!0;else{for(xL=xc.length,yL=yc.length,i=0,s+=2,n=mathfloor(base/(yc[0]+1)),n>1&&(yc=multiply(yc,n,base),xc=multiply(xc,n,base),yL=yc.length,xL=xc.length),xi=yL,rem=xc.slice(0,yL),remL=rem.length;remL=base/2&&yc0++;do{if(n=0,(cmp=compare(yc,rem,yL,remL))<0){if(rem0=rem[0],yL!=remL&&(rem0=rem0*base+(rem[1]||0)),(n=mathfloor(rem0/yc0))>1)for(n>=base&&(n=base-1),prod=multiply(yc,n,base),prodL=prod.length,remL=rem.length;1==compare(prod,rem,prodL,remL);)n--,subtract(prod,yL=10;s/=10,i++);round(q,dp+(q.e=i+e*LOG_BASE-1)+1,rm,more)}else q.e=e,q.r=+more;return q}}(),parseNumeric=function(){var isInfinityOrNaN=/^-?(Infinity|NaN)$/;return function(x,str,num,b){var base,s=num?str:str.replace(/^\s*\+(?=[\w.])|^\s+|\s+$/g,"");if(isInfinityOrNaN.test(s))x.s=isNaN(s)?null:s<0?-1:1;else{if(!num&&(s=s.replace(/^(-?)0([xbo])(?=\w[\w.]*$)/i,function(m,p1,p2){return base="x"==(p2=p2.toLowerCase())?16:"b"==p2?2:8,b&&b!=base?m:p1}),b&&(base=b,s=s.replace(/^([^.]+)\.$/,"$1").replace(/^\.([^.]+)$/,"0.$1")),str!=s))return new BigNumber(s,base);ERRORS&&raise(id,"not a"+(b?" base "+b:"")+" number",str),x.s=null}x.c=x.e=null,id=0}}(),P.absoluteValue=P.abs=function(){var x=new BigNumber(this);return x.s<0&&(x.s=1),x},P.ceil=function(){return round(new BigNumber(this),this.e+1,2)},P.comparedTo=P.cmp=function(y,b){return id=1,compare(this,new BigNumber(y,b))},P.decimalPlaces=P.dp=function(){var n,v,c=this.c;if(!c)return null;if(n=((v=c.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,v=c[v])for(;v%10==0;v/=10,n--);return n<0&&(n=0),n},P.dividedBy=P.div=function(y,b){return id=3,div(this,new BigNumber(y,b),DECIMAL_PLACES,ROUNDING_MODE)},P.dividedToIntegerBy=P.divToInt=function(y,b){return id=4,div(this,new BigNumber(y,b),0,1)},P.equals=P.eq=function(y,b){return id=5,0===compare(this,new BigNumber(y,b))},P.floor=function(){return round(new BigNumber(this),this.e+1,3)},P.greaterThan=P.gt=function(y,b){return id=6,compare(this,new BigNumber(y,b))>0},P.greaterThanOrEqualTo=P.gte=function(y,b){return id=7,1===(b=compare(this,new BigNumber(y,b)))||0===b},P.isFinite=function(){return!!this.c},P.isInteger=P.isInt=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},P.isNaN=function(){return!this.s},P.isNegative=P.isNeg=function(){return this.s<0},P.isZero=function(){return!!this.c&&0==this.c[0]},P.lessThan=P.lt=function(y,b){return id=8,compare(this,new BigNumber(y,b))<0},P.lessThanOrEqualTo=P.lte=function(y,b){return id=9,(b=compare(this,new BigNumber(y,b)))===-1||0===b},P.minus=P.sub=function(y,b){var i,j,t,xLTy,x=this,a=x.s;if(id=10,y=new BigNumber(y,b),b=y.s,!a||!b)return new BigNumber(NaN);if(a!=b)return y.s=-b,x.plus(y);var xe=x.e/LOG_BASE,ye=y.e/LOG_BASE,xc=x.c,yc=y.c;if(!xe||!ye){if(!xc||!yc)return xc?(y.s=-b,y):new BigNumber(yc?x:NaN);if(!xc[0]||!yc[0])return yc[0]?(y.s=-b,y):new BigNumber(xc[0]?x:3==ROUNDING_MODE?-0:0)}if(xe=bitFloor(xe),ye=bitFloor(ye),xc=xc.slice(),a=xe-ye){for((xLTy=a<0)?(a=-a,t=xc):(ye=xe,t=yc),t.reverse(),b=a;b--;t.push(0));t.reverse()}else for(j=(xLTy=(a=xc.length)<(b=yc.length))?a:b,a=b=0;b0)for(;b--;xc[i++]=0);for(b=BASE-1;j>a;){if(xc[--j]0?(ye=xe,t=yc):(a=-a,t=xc),t.reverse();a--;t.push(0));t.reverse()}for(a=xc.length,b=yc.length,a-b<0&&(t=yc,yc=xc,xc=t,b=a),a=0;b;)a=(xc[--b]=xc[b]+yc[b]+a)/BASE|0,xc[b]=BASE===xc[b]?0:xc[b]%BASE;return a&&(xc.unshift(a),++ye),normalise(y,xc,ye)},P.precision=P.sd=function(z){var n,v,x=this,c=x.c;if(null!=z&&z!==!!z&&1!==z&&0!==z&&(ERRORS&&raise(13,"argument"+notBool,z),z!=!!z&&(z=null)),!c)return null;if(v=c.length-1,n=v*LOG_BASE+1,v=c[v]){for(;v%10==0;v/=10,n--);for(v=c[0];v>=10;v/=10,n++);}return z&&x.e+1>n&&(n=x.e+1),n},P.round=function(dp,rm){var n=new BigNumber(this);return(null==dp||isValidInt(dp,0,MAX,15))&&round(n,~~dp+this.e+1,null!=rm&&isValidInt(rm,0,8,15,roundingMode)?0|rm:ROUNDING_MODE),n},P.shift=function(k){var n=this;return isValidInt(k,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER,16,"argument")?n.times("1e"+truncate(k)):new BigNumber(n.c&&n.c[0]&&(k<-MAX_SAFE_INTEGER||k>MAX_SAFE_INTEGER)?n.s*(k<0?0:1/0):n)},P.squareRoot=P.sqrt=function(){var m,n,r,rep,t,x=this,c=x.c,s=x.s,e=x.e,dp=DECIMAL_PLACES+4,half=new BigNumber("0.5");if(1!==s||!c||!c[0])return new BigNumber(!s||s<0&&(!c||c[0])?NaN:c?x:1/0);if(s=Math.sqrt(+x),0==s||s==1/0?(n=coeffToString(c),(n.length+e)%2==0&&(n+="0"),s=Math.sqrt(n),e=bitFloor((e+1)/2)-(e<0||e%2),s==1/0?n="1e"+e:(n=s.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),r=new BigNumber(n)):r=new BigNumber(s+""),r.c[0])for(e=r.e,s=e+dp,s<3&&(s=0);;)if(t=r,r=half.times(t.plus(div(x,t,dp,1))),coeffToString(t.c).slice(0,s)===(n=coeffToString(r.c)).slice(0,s)){if(r.e=0;){for(c=0,ylo=yc[i]%sqrtBase,yhi=yc[i]/sqrtBase|0,k=xcL,j=i+k;j>i;)xlo=xc[--k]%sqrtBase,xhi=xc[k]/sqrtBase|0,m=yhi*xlo+xhi*ylo,xlo=ylo*xlo+m%sqrtBase*sqrtBase+zc[j]+c,c=(xlo/base|0)+(m/sqrtBase|0)+yhi*xhi,zc[j--]=xlo%base;zc[j]=c}return c?++e:zc.shift(),normalise(y,zc,e)},P.toDigits=function(sd,rm){var n=new BigNumber(this);return sd=null!=sd&&isValidInt(sd,1,MAX,18,"precision")?0|sd:null,rm=null!=rm&&isValidInt(rm,0,8,18,roundingMode)?0|rm:ROUNDING_MODE,sd?round(n,sd,rm):n},P.toExponential=function(dp,rm){return format(this,null!=dp&&isValidInt(dp,0,MAX,19)?1+~~dp:null,rm,19)},P.toFixed=function(dp,rm){return format(this,null!=dp&&isValidInt(dp,0,MAX,20)?~~dp+this.e+1:null,rm,20)},P.toFormat=function(dp,rm){var str=format(this,null!=dp&&isValidInt(dp,0,MAX,21)?~~dp+this.e+1:null,rm,21);if(this.c){var i,arr=str.split("."),g1=+FORMAT.groupSize,g2=+FORMAT.secondaryGroupSize,groupSeparator=FORMAT.groupSeparator,intPart=arr[0],fractionPart=arr[1],isNeg=this.s<0,intDigits=isNeg?intPart.slice(1):intPart,len=intDigits.length;if(g2&&(i=g1,g1=g2,g2=i,len-=i),g1>0&&len>0){for(i=len%g1||g1,intPart=intDigits.substr(0,i);i0&&(intPart+=groupSeparator+intDigits.slice(i)),isNeg&&(intPart="-"+intPart)}str=fractionPart?intPart+FORMAT.decimalSeparator+((g2=+FORMAT.fractionGroupSize)?fractionPart.replace(new RegExp("\\d{"+g2+"}\\B","g"),"$&"+FORMAT.fractionGroupSeparator):fractionPart):intPart}return str},P.toFraction=function(md){var arr,d0,d2,e,exp,n,n0,q,s,k=ERRORS,x=this,xc=x.c,d=new BigNumber(ONE),n1=d0=new BigNumber(ONE),d1=n0=new BigNumber(ONE);if(null!=md&&(ERRORS=!1,n=new BigNumber(md),ERRORS=k,(k=n.isInt())&&!n.lt(ONE)||(ERRORS&&raise(22,"max denominator "+(k?"out of range":"not an integer"),md),md=!k&&n.c&&round(n,n.e+1,1).gte(ONE)?n:null)),!xc)return x.toString();for(s=coeffToString(xc),e=d.e=s.length-x.e-1,d.c[0]=POWS_TEN[(exp=e%LOG_BASE)<0?LOG_BASE+exp:exp],md=!md||n.cmp(d)>0?e>0?d:n1:n,exp=MAX_EXP,MAX_EXP=1/0,n=new BigNumber(s),n0.c[0]=0;q=div(n,d,0,1),d2=d0.plus(q.times(d1)),1!=d2.cmp(md);)d0=d1,d1=d2,n1=n0.plus(q.times(d2=n1)),n0=d2,d=n.minus(q.times(d2=d)),n=d2;return d2=div(md.minus(d0),d1,0,1),n0=n0.plus(d2.times(n1)),d0=d0.plus(d2.times(d1)),n0.s=n1.s=x.s,e*=2,arr=div(n1,d1,e,ROUNDING_MODE).minus(x).abs().cmp(div(n0,d0,e,ROUNDING_MODE).minus(x).abs())<1?[n1.toString(),d1.toString()]:[n0.toString(),d0.toString()],MAX_EXP=exp,arr},P.toNumber=function(){return+this},P.toPower=P.pow=function(n,m){var k,y,z,i=mathfloor(n<0?-n:+n),x=this;if(null!=m&&(id=23,m=new BigNumber(m)),!isValidInt(n,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER,23,"exponent")&&(!isFinite(n)||i>MAX_SAFE_INTEGER&&(n/=0)||parseFloat(n)!=n&&!(n=NaN))||0==n)return k=Math.pow(+x,n),new BigNumber(m?k%m:k);for(m?n>1&&x.gt(ONE)&&x.isInt()&&m.gt(ONE)&&m.isInt()?x=x.mod(m):(z=m,m=null):POW_PRECISION&&(k=mathceil(POW_PRECISION/LOG_BASE+2)),y=new BigNumber(ONE);;){if(i%2){if(y=y.times(x),!y.c)break;k?y.c.length>k&&(y.c.length=k):m&&(y=y.mod(m))}if(!(i=mathfloor(i/2)))break;x=x.times(x),k?x.c&&x.c.length>k&&(x.c.length=k):m&&(x=x.mod(m))}return m?y:(n<0&&(y=ONE.div(y)),z?y.mod(z):k?round(y,POW_PRECISION,ROUNDING_MODE):y)},P.toPrecision=function(sd,rm){return format(this,null!=sd&&isValidInt(sd,1,MAX,24,"precision")?0|sd:null,rm,24)},P.toString=function(b){var str,n=this,s=n.s,e=n.e;return null===e?s?(str="Infinity",s<0&&(str="-"+str)):str="NaN":(str=coeffToString(n.c),str=null!=b&&isValidInt(b,2,64,25,"base")?convertBase(toFixedPoint(str,e),0|b,10,s):e<=TO_EXP_NEG||e>=TO_EXP_POS?toExponential(str,e):toFixedPoint(str,e),s<0&&n.c[0]&&(str="-"+str)),str},P.truncated=P.trunc=function(){return round(new BigNumber(this),this.e+1,1)},P.valueOf=P.toJSON=function(){var str,n=this,e=n.e;return null===e?n.toString():(str=coeffToString(n.c),str=e<=TO_EXP_NEG||e>=TO_EXP_POS?toExponential(str,e):toFixedPoint(str,e),n.s<0?"-"+str:str)},null!=configObj&&BigNumber.config(configObj),BigNumber}function bitFloor(n){var i=0|n;return n>0||n===i?i:i-1}function coeffToString(a){for(var s,z,i=1,j=a.length,r=a[0]+"";il^a?1:-1;for(j=(k=xc.length)<(l=yc.length)?k:l,i=0;iyc[i]^a?1:-1;return k==l?0:k>l^a?1:-1}function intValidatorNoErrors(n,min,max){return(n=truncate(n))>=min&&n<=max}function isArray(obj){return"[object Array]"==Object.prototype.toString.call(obj)}function toBaseOut(str,baseIn,baseOut){for(var j,arrL,arr=[0],i=0,len=str.length;ibaseOut-1&&(null==arr[j+1]&&(arr[j+1]=0),arr[j+1]+=arr[j]/baseOut|0,arr[j]%=baseOut)}return arr.reverse()}function toExponential(str,e){return(str.length>1?str.charAt(0)+"."+str.slice(1):str)+(e<0?"e":"e+")+e}function toFixedPoint(str,e){var len,z;if(e<0){for(z="0.";++e;z+="0");str=z+str}else if(len=str.length,++e>len){for(z="0",e-=len;--e;z+="0");str+=z}else euint_max||x<0?(x_pos=Math.abs(x)%uint_max,x<0?uint_max-x_pos:x_pos):x}function scrub_vec(v){for(;0>>8^255&sx^99,this.SBOX[x]=sx,this.INV_SBOX[sx]=x,x2=d[x],x4=d[x2],x8=d[x4],t=257*d[sx]^16843008*sx,this.SUB_MIX[0][x]=t<<24|t>>>8,this.SUB_MIX[1][x]=t<<16|t>>>16,this.SUB_MIX[2][x]=t<<8|t>>>24,this.SUB_MIX[3][x]=t,t=16843009*x8^65537*x4^257*x2^16843008*x,this.INV_SUB_MIX[0][sx]=t<<24|t>>>8,this.INV_SUB_MIX[1][sx]=t<<16|t>>>16,this.INV_SUB_MIX[2][sx]=t<<8|t>>>24,this.INV_SUB_MIX[3][sx]=t,0===x?x=xi=1:(x=x2^d[d[d[x8^x2]]],xi^=d[d[xi]]);return!0};var G=new Global;AES.blockSize=16,AES.prototype.blockSize=AES.blockSize,AES.keySize=32,AES.prototype.keySize=AES.keySize,AES.prototype._doReset=function(){var invKsRow,keySize,keyWords,ksRow,ksRows,t;for(keyWords=this._key,keySize=keyWords.length,this._nRounds=keySize+6,ksRows=4*(this._nRounds+1),this._keySchedule=[],ksRow=0;ksRow>>24,t=G.SBOX[t>>>24]<<24|G.SBOX[t>>>16&255]<<16|G.SBOX[t>>>8&255]<<8|G.SBOX[255&t],t^=G.RCON[ksRow/keySize|0]<<24):keySize>6&&ksRow%keySize==4&&(t=G.SBOX[t>>>24]<<24|G.SBOX[t>>>16&255]<<16|G.SBOX[t>>>8&255]<<8|G.SBOX[255&t]),this._keySchedule[ksRow-keySize]^t);for(this._invKeySchedule=[],invKsRow=0;invKsRow>>24]]^G.INV_SUB_MIX[1][G.SBOX[t>>>16&255]]^G.INV_SUB_MIX[2][G.SBOX[t>>>8&255]]^G.INV_SUB_MIX[3][G.SBOX[255&t]];return!0},AES.prototype.encryptBlock=function(M){M=bufferToArray(new Buffer(M));var out=this._doCryptBlock(M,this._keySchedule,G.SUB_MIX,G.SBOX),buf=new Buffer(16);return buf.writeUInt32BE(out[0],0),buf.writeUInt32BE(out[1],4),buf.writeUInt32BE(out[2],8),buf.writeUInt32BE(out[3],12),buf},AES.prototype.decryptBlock=function(M){M=bufferToArray(new Buffer(M));var temp=[M[3],M[1]];M[1]=temp[0],M[3]=temp[1];var out=this._doCryptBlock(M,this._invKeySchedule,G.INV_SUB_MIX,G.INV_SBOX),buf=new Buffer(16);return buf.writeUInt32BE(out[0],0),buf.writeUInt32BE(out[3],4),buf.writeUInt32BE(out[2],8),buf.writeUInt32BE(out[1],12),buf},AES.prototype.scrub=function(){scrub_vec(this._keySchedule),scrub_vec(this._invKeySchedule),scrub_vec(this._key)},AES.prototype._doCryptBlock=function(M,keySchedule,SUB_MIX,SBOX){var ksRow,s0,s1,s2,s3,t0,t1,t2,t3;s0=M[0]^keySchedule[0],s1=M[1]^keySchedule[1],s2=M[2]^keySchedule[2],s3=M[3]^keySchedule[3],ksRow=4;for(var round=1;round>>24]^SUB_MIX[1][s1>>>16&255]^SUB_MIX[2][s2>>>8&255]^SUB_MIX[3][255&s3]^keySchedule[ksRow++],t1=SUB_MIX[0][s1>>>24]^SUB_MIX[1][s2>>>16&255]^SUB_MIX[2][s3>>>8&255]^SUB_MIX[3][255&s0]^keySchedule[ksRow++],t2=SUB_MIX[0][s2>>>24]^SUB_MIX[1][s3>>>16&255]^SUB_MIX[2][s0>>>8&255]^SUB_MIX[3][255&s1]^keySchedule[ksRow++],t3=SUB_MIX[0][s3>>>24]^SUB_MIX[1][s0>>>16&255]^SUB_MIX[2][s1>>>8&255]^SUB_MIX[3][255&s2]^keySchedule[ksRow++],s0=t0,s1=t1,s2=t2,s3=t3;return t0=(SBOX[s0>>>24]<<24|SBOX[s1>>>16&255]<<16|SBOX[s2>>>8&255]<<8|SBOX[255&s3])^keySchedule[ksRow++],t1=(SBOX[s1>>>24]<<24|SBOX[s2>>>16&255]<<16|SBOX[s3>>>8&255]<<8|SBOX[255&s0])^keySchedule[ksRow++],t2=(SBOX[s2>>>24]<<24|SBOX[s3>>>16&255]<<16|SBOX[s0>>>8&255]<<8|SBOX[255&s1])^keySchedule[ksRow++],t3=(SBOX[s3>>>24]<<24|SBOX[s0>>>16&255]<<16|SBOX[s1>>>8&255]<<8|SBOX[255&s2])^keySchedule[ksRow++],[fixup_uint32(t0),fixup_uint32(t1),fixup_uint32(t2),fixup_uint32(t3)]},exports.AES=AES}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function incr32(iv){for(var item,len=iv.length;len--;){if(255!==(item=iv.readUInt8(len))){item++,iv.writeUInt8(item,len);break}iv.writeUInt8(0,len)}}function getBlock(self){var out=self._cipher.encryptBlock(self._prev);return incr32(self._prev),out}var xor=__webpack_require__(74);exports.encrypt=function(self,chunk){for(;self._cache.length{b.put(this.transform.convert(key),value)},delete:key=>{b.delete(this.transform.convert(key))},commit:callback=>{b.commit(callback)}}}query(q){return pull(this.child.query(q),pull.map(e=>{return e.key=this.transform.invert(e.key),e}))}close(callback){this.child.close(callback)}}module.exports=KeyTransformDatastore},function(module,exports,__webpack_require__){(function(global){module.exports=!1;try{module.exports="[object process]"===Object.prototype.toString.call(global.process)}catch(e){}}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){"use strict";var curve=exports;curve.base=__webpack_require__(402),curve.short=__webpack_require__(405),curve.mont=__webpack_require__(404),curve.edwards=__webpack_require__(403)},function(module,exports,__webpack_require__){"use strict";(function(setImmediate){const protobuf=__webpack_require__(39),Block=__webpack_require__(60),isEqualWith=__webpack_require__(632),assert=__webpack_require__(7),each=__webpack_require__(32),CID=__webpack_require__(12),codecName=__webpack_require__(278),vd=__webpack_require__(824),multihashing=__webpack_require__(30),pbm=protobuf(__webpack_require__(465)),Entry=__webpack_require__(464);class BitswapMessage{constructor(full){this.full=full,this.wantlist=new Map,this.blocks=new Map}get empty(){return 0===this.blocks.size&&0===this.wantlist.size}addEntry(cid,priority,cancel){assert(cid&&CID.isCID(cid),"must be a valid cid");const cidStr=cid.buffer.toString(),entry=this.wantlist.get(cidStr);entry?(entry.priority=priority,entry.cancel=Boolean(cancel)):this.wantlist.set(cidStr,new Entry(cid,priority,cancel))}addBlock(block){assert(Block.isBlock(block),"must be a valid cid");const cidStr=block.cid.buffer.toString();this.blocks.set(cidStr,block)}cancel(cid){assert(CID.isCID(cid),"must be a valid cid");const cidStr=cid.buffer.toString();this.wantlist.delete(cidStr),this.addEntry(cid,0,!0)}serializeToBitswap100(){const msg={wantlist:{entries:Array.from(this.wantlist.values()).map(entry=>{return{block:entry.cid.buffer,priority:Number(entry.priority),cancel:Boolean(entry.cancel)}})},blocks:Array.from(this.blocks.values()).map(block=>block.data)};return this.full&&(msg.wantlist.full=!0),pbm.Message.encode(msg)}serializeToBitswap110(){const msg={wantlist:{entries:Array.from(this.wantlist.values()).map(entry=>{return{block:entry.cid.buffer,priority:Number(entry.priority),cancel:Boolean(entry.cancel)}})},payload:[]};return this.full&&(msg.wantlist.full=!0),this.blocks.forEach(block=>{msg.payload.push({prefix:block.cid.prefix,data:block.data})}),pbm.Message.encode(msg)}equals(other){const cmp=(a,b)=>{if(a.equals&&"function"==typeof a.equals)return a.equals(b)};return!(this.full!==other.full||!isEqualWith(this.wantlist,other.wantlist,cmp)||!isEqualWith(this.blocks,other.blocks,cmp))}get[Symbol.toStringTag](){const list=Array.from(this.wantlist.keys()),blocks=Array.from(this.blocks.keys());return`BitswapMessage `}}BitswapMessage.deserialize=((raw,callback)=>{let decoded;try{decoded=pbm.Message.decode(raw)}catch(err){return setImmediate(()=>callback(err))}const isFull=decoded.wantlist&&decoded.wantlist.full||!1,msg=new BitswapMessage(isFull);return decoded.wantlist&&decoded.wantlist.entries.forEach(entry=>{const cid=new CID(entry.block);msg.addEntry(cid,entry.priority,entry.cancel)}),decoded.blocks.length>0?each(decoded.blocks,(b,cb)=>{multihashing(b,"sha2-256",(err,hash)=>{if(err)return cb(err);const cid=new CID(hash);msg.addBlock(new Block(b,cid)),cb()})},err=>{if(err)return callback(err);callback(null,msg)}):decoded.payload.length>0?each(decoded.payload,(p,cb)=>{p.prefix&&p.data||cb();const values=vd(p.prefix),cidVersion=values[0],multicodec=values[1],hashAlg=values[2];multihashing(p.data,hashAlg,(err,hash)=>{if(err)return cb(err);const cid=new CID(cidVersion,codecName[multicodec.toString("16")],hash);msg.addBlock(new Block(p.data,cid)),cb()})},err=>{if(err)return callback(err);callback(null,msg)}):void callback(null,msg)}),BitswapMessage.Entry=Entry,module.exports=BitswapMessage}).call(exports,__webpack_require__(22).setImmediate)},function(module,exports,__webpack_require__){"use strict";const sort=__webpack_require__(637),Entry=__webpack_require__(466);class Wantlist{constructor(){this.set=new Map}get length(){return this.set.size}add(cid,priority){const cidStr=cid.buffer.toString(),entry=this.set.get(cidStr);entry?(entry.inc(),entry.priority=priority):this.set.set(cidStr,new Entry(cid,priority))}remove(cid){const cidStr=cid.buffer.toString(),entry=this.set.get(cidStr);entry&&(entry.dec(),entry.hasRefs()||this.set.delete(cidStr))}removeForce(cidStr){this.set.has(cidStr)&&this.set.delete(cidStr)}entries(){return this.set.entries()}sortedEntries(){return new Map(sort(Array.from(this.set.entries()),o=>{return o[1].key}))}contains(cid){const cidStr=cid.buffer.toString();return this.set.get(cidStr)}}Wantlist.Entry=Entry,module.exports=Wantlist},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function create(data,dagLinks,hashAlg,callback){if("function"==typeof data?(callback=data,data=void 0):"string"==typeof data&&(data=new Buffer(data)),"function"==typeof dagLinks&&(callback=dagLinks,dagLinks=[]),"function"==typeof hashAlg&&(callback=hashAlg,hashAlg=void 0),!Buffer.isBuffer(data))return callback("Passed 'data' is not a buffer or a string!");hashAlg||(hashAlg="sha2-256");const links=dagLinks.map(l=>{return l.constructor&&"DAGLink"===l.constructor.name?l:new DAGLink(l.name?l.name:l.Name,l.size?l.size:l.Size,l.hash||l.Hash||l.multihash)}),sortedLinks=sort(links,linkSort);serialize({data:data,links:sortedLinks},(err,serialized)=>{if(err)return callback(err);multihashing(serialized,hashAlg,(err,multihash)=>{if(err)return callback(err);callback(null,new DAGNode(data,sortedLinks,serialized,multihash))})})}const multihashing=__webpack_require__(30),sort=__webpack_require__(806),dagPBUtil=__webpack_require__(136),serialize=dagPBUtil.serialize,dagNodeUtil=__webpack_require__(102),linkSort=dagNodeUtil.linkSort,DAGNode=__webpack_require__(135),DAGLink=__webpack_require__(61);module.exports=create}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function cloneData(dagNode){let data;return dagNode.data&&dagNode.data.length>0?(data=new Buffer(dagNode.data.length),dagNode.data.copy(data)):data=new Buffer(0),data}function cloneLinks(dagNode){return dagNode.links.slice()}function linkSort(a,b){const aBuf=new Buffer(a.name||"","ascii"),bBuf=new Buffer(b.name||"","ascii");return aBuf.compare(bBuf)}function toDAGLink(node){return new DAGLink("",node.size,node.multihash)}const DAGLink=__webpack_require__(61);exports=module.exports,exports.cloneData=cloneData,exports.cloneLinks=cloneLinks,exports.linkSort=linkSort,exports.toDAGLink=toDAGLink}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function validate(multihash){if(!Buffer.isBuffer(multihash))throw new Error("multihash must be a Buffer");if(multihash.length<3)throw new Error("multihash too short. must be > 3 bytes.");if(multihash.length>129)throw new Error("multihash too long. must be < 129 bytes.");let code=multihash[0];if(!exports.isValidCode(code))throw new Error(`multihash unknown function code: 0x${code.toString(16)}`);if(multihash.slice(2).length!==multihash[1])throw new Error(`multihash length inconsistent: 0x${multihash.toString("hex")}`)}const bs58=__webpack_require__(24),cs=__webpack_require__(513);exports.toHexString=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return hash.toString("hex")},exports.fromHexString=function(hash){return new Buffer(hash,"hex")},exports.toB58String=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return bs58.encode(hash)},exports.fromB58String=function(hash){let encoded=hash;return Buffer.isBuffer(hash)&&(encoded=hash.toString()),new Buffer(bs58.decode(encoded))},exports.decode=function(buf){exports.validate(buf);const code=buf[0];return{code:code,name:cs.codes[code],length:buf[1],digest:buf.slice(2)}},exports.encode=function(digest,code,length){if(!digest||!code)throw new Error("multihash encode requires at least two args: digest, code");const hashfn=exports.coerceCode(code);if(!Buffer.isBuffer(digest))throw new Error("digest should be a Buffer");if(null==length&&(length=digest.length),length&&digest.length!==length)throw new Error("digest length should be equal to specified length.");if(length>127)throw new Error("multihash does not yet support digest lengths greater than 127 bytes.");return Buffer.concat([new Buffer([hashfn,length]),digest])},exports.coerceCode=function(name){let code=name;if("string"==typeof name){if(!cs.names[name])throw new Error(`Unrecognized hash function named: ${name}`);code=cs.names[name]}if("number"!=typeof code)throw new Error(`Hash function code should be a number. Got: ${code}`);if(!cs.codes[code]&&!exports.isAppCode(code))throw new Error(`Unrecognized function code: ${code}`);return code},exports.isAppCode=function(code){return code>0&&code<16},exports.isValidCode=function(code){return!!exports.isAppCode(code)||!!cs.codes[code]},exports.validate=validate,exports.prefix=function(multihash){return validate(multihash),multihash.slice(0,2)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const rlp=__webpack_require__(52),TrieNode=__webpack_require__(276),cidForHash=__webpack_require__(77).cidForHash;exports.deserialize=function(data,callback){let deserialized;try{let rawNode=rlp.decode(data);deserialized=new TrieNode(rawNode)}catch(err){return callback(err)}callback(null,deserialized)},exports.serialize=function(trieNode,callback){let serialized;try{serialized=trieNode.serialize()}catch(err){return callback(err)}callback(null,serialized)},exports.cid=function(trieIpldFormat,tx,callback){let cid;try{cid=cidForHash(trieIpldFormat,tx.hash())}catch(err){return callback(err)}callback(null,cid)}},function(module,exports,__webpack_require__){var createError=__webpack_require__(417).create,LevelUPError=createError("LevelUPError"),NotFoundError=createError("NotFoundError",LevelUPError);NotFoundError.prototype.notFound=!0,NotFoundError.prototype.status=404,module.exports={LevelUPError:LevelUPError,InitializationError:createError("InitializationError",LevelUPError),OpenError:createError("OpenError",LevelUPError),ReadError:createError("ReadError",LevelUPError),WriteError:createError("WriteError",LevelUPError),NotFoundError:NotFoundError,EncodingError:createError("EncodingError",LevelUPError)}},function(module,exports,__webpack_require__){"use strict";module.exports=function(){if("undefined"!=typeof self&&(__webpack_require__(329)(self),self.crypto))return self.crypto;if("undefined"!=typeof self&&(__webpack_require__(329)(self),self.crypto))return self.crypto;throw new Error("Please use an environment with crypto support")}},function(module,exports,__webpack_require__){"use strict";const multistream=__webpack_require__(152);module.exports=function(protocols,conn){const ms=new multistream.Listener;Object.keys(protocols).forEach(protocol=>{protocol&&ms.addHandler(protocol,protocols[protocol].handlerFunc,protocols[protocol].matchFunc)}),ms.handle(conn,err=>{})}},function(module,exports,__webpack_require__){(function(process){function useColors(){return!("undefined"==typeof window||!window||void 0===window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document&&"WebkitAppearance"in document.documentElement.style||"undefined"!=typeof window&&window&&window.console&&(console.firebug||console.exception&&console.table)||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(args){var useColors=this.useColors;if(args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff),useColors){var c="color: "+this.color;args.splice(1,0,c,"color: inherit");var index=0,lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){"%%"!==match&&(index++,"%c"===match&&(lastC=index))}),args.splice(lastC,0,c)}}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{null==namespaces?exports.storage.removeItem("debug"):exports.storage.debug=namespaces}catch(e){}}function load(){var r;try{r=exports.storage.debug}catch(e){}return!r&&void 0!==process&&"env"in process&&(r=process.env.DEBUG),r}exports=module.exports=__webpack_require__(619),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],exports.formatters.j=function(v){try{return JSON.stringify(v)}catch(err){return"[UnexpectedJSONParseError]: "+err.message}},exports.enable(load())}).call(exports,__webpack_require__(2))},function(module,exports){var isArray=Array.isArray;module.exports=isArray},function(module,exports,__webpack_require__){"use strict";function and(){function matches(a){"string"==typeof a&&(a=multiaddr(a));let out=partialMatch(a.protoNames());return null!==out&&0===out.length}function partialMatch(a){return a.lengthor(and(_Circuit,CircuitRecursive),_Circuit),Circuit=CircuitRecursive(),IPFS=or(and(Circuit,_IPFS,Circuit),and(_IPFS,Circuit),and(Circuit,_IPFS),Circuit,_IPFS);exports.DNS=DNS,exports.DNS4=DNS4,exports.DNS6=DNS6,exports.IP=IP,exports.TCP=TCP,exports.UDP=UDP,exports.UTP=UTP,exports.HTTP=HTTP,exports.WebSockets=WebSockets,exports.WebSocketsSecure=WebSocketsSecure,exports.WebRTCStar=WebRTCStar,exports.WebRTCDirect=WebRTCDirect,exports.Reliable=Reliable,exports.Circuit=Circuit,exports.IPFS=IPFS},function(module,exports){function assert(val,msg){if(!val)throw new Error(msg||"Assertion failed")}module.exports=assert,assert.equal=function(l,r,msg){if(l!=r)throw new Error(msg||"Assertion failed: "+l+" != "+r)}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function randomId(){return(~~(1e9*Math.random())).toString(36)}function encode(msg,callback){const values=Buffer.isBuffer(msg)?[msg]:[new Buffer(msg)];pull(pull.values(values),pullLP.encode(),pull.collect((err,encoded)=>{if(err)return callback(err);callback(null,encoded[0])}))}function createLogger(type){function printer(logger){return msg=>{Array.isArray(msg)&&(msg=msg.join(" ")),logger("(%s) %s",rId,msg)}}const rId=randomId(),log=printer(debug("mss:"+type));return log.error=printer(debug("mss:"+type+":error")),log}const pull=__webpack_require__(5),pullLP=__webpack_require__(28),debug=__webpack_require__(3);exports=module.exports,exports.writeEncoded=((writer,msg,callback)=>{encode(msg,(err,msg)=>{if(err)return callback(err);writer.write(msg)})}),exports.log={},exports.log.dialer=(()=>{return createLogger("dialer\t")}),exports.log.listener=(()=>{return createLogger("listener\t")})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function OffsetBuffer(){this.offset=0,this.size=0,this.buffers=[]}function signedInt8(num){return num>=128?-(255^num)-1:num}function signedInt16(num){return num>=32768?-(65535^num)-1:num}function signedInt24(num){return num>=8388608?-(16777215^num)-1:num}function signedInt32(num){return num>=2147483648?-(4294967295^num)-1:num}var Buffer=__webpack_require__(0).Buffer;module.exports=OffsetBuffer,OffsetBuffer.prototype.isEmpty=function(){return 0===this.size},OffsetBuffer.prototype.clone=function(size){var r=new OffsetBuffer;return r.offset=this.offset,r.size=size,r.buffers=this.buffers.slice(),r},OffsetBuffer.prototype.toChunks=function(){if(0===this.size)return[];0!==this.offset&&(this.buffers[0]=this.buffers[0].slice(this.offset),this.offset=0);for(var chunks=[],off=0,i=0;off<=this.size&&ithis.size&&(buf=buf.slice(0,buf.length-(off-this.size)),this.buffers[i]=buf),chunks.push(buf)}return i=n},OffsetBuffer.prototype.skip=function(n){if(0!==this.size){if(this.size-=n,this.offset+n0&&shiftleft){this.offset=left;break}left-=buf.length}this.buffers=this.buffers.slice(shift)}},OffsetBuffer.prototype.copy=function(target,targetOff,off,n){if(0!==this.size){if(0!==off)throw new Error("Unsupported offset in .copy()");var toff=targetOff,first=this.buffers[0],toCopy=Math.min(n,first.length-this.offset);first.copy(target,toff,this.offset,this.offset+toCopy),toff+=toCopy;for(var left=n-toCopy,i=1;left>0&&in){var r=this.buffers[0].slice(this.offset,this.offset+n);return this.offset+=n,r}for(var out=new Buffer(n),toOff=0,startOff=this.offset,i=0;toOff!==n&&i=2?(r=first.readUInt16LE(this.offset,!0),shift=0,this.offset+=2):(r=first[this.offset]|this.buffers[1][0]<<8,shift=1,this.offset=1),this.offset===this.buffers[shift].length&&(this.offset=0,shift++),0!==shift&&(this.buffers=this.buffers.slice(shift)),r},OffsetBuffer.prototype.readUInt24LE=function(){var r,shift,first=this.buffers[0],firstHas=first.length-this.offset;if(firstHas>=3)r=first.readUInt16LE(this.offset,!0)|first[this.offset+2]<<16,shift=0,this.offset+=3;else{if(!(firstHas>=2))return r=first[this.offset],this.offset=0,this.buffers.shift(),this.size-=1,r|=this.readUInt16LE()<<8;r=first.readUInt16LE(this.offset,!0)|this.buffers[1][0]<<16,shift=1,this.offset=1}return this.size-=3,this.offset===this.buffers[shift].length&&(this.offset=0,shift++),0!==shift&&(this.buffers=this.buffers.slice(shift)),r},OffsetBuffer.prototype.readUInt32LE=function(){var r,shift,first=this.buffers[0],firstHas=first.length-this.offset;if(firstHas>=4)r=first.readUInt32LE(this.offset,!0),shift=0,this.offset+=4;else{if(!(firstHas>=3))return firstHas>=2?(r=first.readUInt16LE(this.offset,!0),this.offset=0,this.buffers.shift(),this.size-=2,r+=65536*this.readUInt16LE()):(r=first[this.offset],this.offset=0,this.buffers.shift(),this.size-=1,r+=256*this.readUInt24LE());r=(first.readUInt16LE(this.offset,!0)|first[this.offset+2]<<16)+16777216*this.buffers[1][0],shift=1,this.offset=1}return this.size-=4,this.offset===this.buffers[shift].length&&(this.offset=0,shift++),0!==shift&&(this.buffers=this.buffers.slice(shift)),r},OffsetBuffer.prototype.readUInt16BE=function(){var r=this.readUInt16LE();return(255&r)<<8|r>>8},OffsetBuffer.prototype.readUInt24BE=function(){var r=this.readUInt24LE();return(255&r)<<16|(r>>8&255)<<8|r>>16},OffsetBuffer.prototype.readUInt32BE=function(){var r=this.readUInt32LE();return((255&r)<<24|(r>>>8&255)<<16|(r>>>16&255)<<8|r>>>24)>>>0},OffsetBuffer.prototype.peekInt8=function(){return signedInt8(this.peekUInt8())},OffsetBuffer.prototype.readInt8=function(){return signedInt8(this.readUInt8())},OffsetBuffer.prototype.readInt16BE=function(){return signedInt16(this.readUInt16BE())},OffsetBuffer.prototype.readInt16LE=function(){return signedInt16(this.readUInt16LE())},OffsetBuffer.prototype.readInt24BE=function(){return signedInt24(this.readUInt24BE())},OffsetBuffer.prototype.readInt24LE=function(){return signedInt24(this.readUInt24LE())},OffsetBuffer.prototype.readInt32BE=function(){return signedInt32(this.readUInt32BE())},OffsetBuffer.prototype.readInt32LE=function(){return signedInt32(this.readUInt32LE())}},function(module,exports,__webpack_require__){"use strict";var TYPED_OK="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;exports.assign=function(obj){for(var sources=Array.prototype.slice.call(arguments,1);sources.length;){var source=sources.shift();if(source){if("object"!=typeof source)throw new TypeError(source+"must be non-object");for(var p in source)source.hasOwnProperty(p)&&(obj[p]=source[p])}}return obj},exports.shrinkBuf=function(buf,size){return buf.length===size?buf:buf.subarray?buf.subarray(0,size):(buf.length=size,buf)};var fnTyped={ -arraySet:function(dest,src,src_offs,len,dest_offs){if(src.subarray&&dest.subarray)return void dest.set(src.subarray(src_offs,src_offs+len),dest_offs);for(var i=0;i>>2,bn.words[2]=(63&b32[22])<<20|b32[23]<<12|b32[24]<<4|b32[25]>>>4,bn.words[3]=(255&b32[19])<<18|b32[20]<<10|b32[21]<<2|b32[22]>>>6,bn.words[4]=(3&b32[15])<<24|b32[16]<<16|b32[17]<<8|b32[18],bn.words[5]=(15&b32[12])<<22|b32[13]<<14|b32[14]<<6|b32[15]>>>2,bn.words[6]=(63&b32[9])<<20|b32[10]<<12|b32[11]<<4|b32[12]>>>4,bn.words[7]=(255&b32[6])<<18|b32[7]<<10|b32[8]<<2|b32[9]>>>6,bn.words[8]=(3&b32[2])<<24|b32[3]<<16|b32[4]<<8|b32[5],bn.words[9]=b32[0]<<14|b32[1]<<6|b32[2]>>>2,bn.length=10,bn.strip()},BN.prototype.toBuffer=function(){for(var w=this.words,i=this.length;i<10;++i)w[i]=0;return new Buffer([w[9]>>>14&255,w[9]>>>6&255,(63&w[9])<<2|w[8]>>>24&3,w[8]>>>16&255,w[8]>>>8&255,255&w[8],w[7]>>>18&255,w[7]>>>10&255,w[7]>>>2&255,(3&w[7])<<6|w[6]>>>20&63,w[6]>>>12&255,w[6]>>>4&255,(15&w[6])<<4|w[5]>>>22&15,w[5]>>>14&255,w[5]>>>6&255,(63&w[5])<<2|w[4]>>>24&3,w[4]>>>16&255,w[4]>>>8&255,255&w[4],w[3]>>>18&255,w[3]>>>10&255,w[3]>>>2&255,(3&w[3])<<6|w[2]>>>20&63,w[2]>>>12&255,w[2]>>>4&255,(15&w[2])<<4|w[1]>>>22&15,w[1]>>>14&255,w[1]>>>6&255,(63&w[1])<<2|w[0]>>>24&3,w[0]>>>16&255,w[0]>>>8&255,255&w[0]])},BN.prototype.clone=function(){var r=new BN;r.words=new Array(this.length);for(var i=0;i1&&0==(0|this.words[this.length-1]);)this.length--;return this},BN.prototype.normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.isEven=function(){return 0==(1&this.words[0])},BN.prototype.isOdd=function(){return 1==(1&this.words[0])},BN.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},BN.prototype.ucmp=function(num){if(this.length!==num.length)return this.length>num.length?1:-1;for(var i=this.length-1;i>=0;--i)if(this.words[i]!==num.words[i])return this.words[i]>num.words[i]?1:-1;return 0},BN.prototype.gtOne=function(){return this.length>1||this.words[0]>1},BN.prototype.isOverflow=function(){return this.ucmp(BN.n)>=0},BN.prototype.isHigh=function(){return 1===this.ucmp(BN.nh)},BN.prototype.bitLengthGT256=function(){return this.length>10||10===this.length&&this.words[9]>4194303},BN.prototype.iuaddn=function(num){this.words[0]+=num;for(var i=0;this.words[i]>67108863&&inum.length?(a=this,b=num):(a=num,b=this);for(var i=0,carry=0;i>>26}for(;0!==carry&&i>>26;if(this.length=a.length,0!==carry)this.words[this.length++]=carry;else if(a!==this)for(;i0?(a=this,b=num):(a=num,b=this);for(var i=0,carry=0;i>26,this.words[i]=67108863&word}for(;0!==carry&&i>26,this.words[i]=67108863&word;if(0===carry&&i>>26,rword=67108863&carry,j=Math.max(0,k-num1.length+1),maxJ=Math.min(k,num2.length-1);j<=maxJ;j++){var i=k-j,a=num1.words[i],b=num2.words[j],r=a*b+rword;ncarry+=r/67108864|0,rword=67108863&r}out.words[k]=rword,carry=ncarry}return 0!==carry&&(out.words[out.length++]=carry),out.strip()},BN.umulTo10x10=Math.imul?optimized.umulTo10x10:BN.umulTo,BN.umulnTo=function(num,k,out){if(0===k)return out.words=[0],out.length=1,out;for(var i=0,carry=0;i0?(out.words[i]=carry,out.length=num.length+1):out.length=num.length,out},BN.prototype.umul=function(num){var out=new BN;return out.words=new Array(this.length+num.length),10===this.length&&10===num.length?BN.umulTo10x10(this,num,out):1===this.length?BN.umulnTo(num,this.words[0],out):1===num.length?BN.umulnTo(this,num.words[0],out):BN.umulTo(this,num,out)},BN.prototype.isplit=function(output){output.length=Math.min(this.length,9);for(var i=0;i>>22,prev=word}return prev>>>=22,this.words[i-10]=prev,0===prev&&this.length>10?this.length-=10:this.length-=9,this},BN.prototype.fireduce=function(){return this.isOverflow()&&this.isub(BN.n),this},BN.prototype.ureduce=function(){var num=this.clone().isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp);return num.bitLengthGT256()&&(num=num.isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp),num.bitLengthGT256()&&(num=num.isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp))),num.fireduce()},BN.prototype.ishrn=function(n){for(var mask=(1<=0;--i){var word=this.words[i];this.words[i]=carry<>>n,carry=word&mask}return this.length>1&&0===this.words[this.length-1]&&(this.length-=1),this},BN.prototype.uinvm=function(){for(var x=this.clone(),y=BN.n.clone(),A=BN.fromNumber(1),B=BN.fromNumber(0),C=BN.fromNumber(0),D=BN.fromNumber(1);x.isEven()&&y.isEven();){for(var k=1,m=1;0==(x.words[0]&m)&&0==(y.words[0]&m)&&k<26;++k,m<<=1);x.ishrn(k),y.ishrn(k)}for(var yp=y.clone(),xp=x.clone();!x.isZero();){for(var i=0,im=1;0==(x.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(x.ishrn(i);i-- >0;)(A.isOdd()||B.isOdd())&&(A.iadd(yp),B.isub(xp)),A.ishrn(1),B.ishrn(1);for(var j=0,jm=1;0==(y.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(y.ishrn(j);j-- >0;)(C.isOdd()||D.isOdd())&&(C.iadd(yp),D.isub(xp)),C.ishrn(1),D.ishrn(1);x.ucmp(y)>=0?(x.isub(y),A.isub(C),B.isub(D)):(y.isub(x),C.isub(A),D.isub(B))}if(1===C.negative){C.negative=0;var result=C.ureduce();return result.negative^=1,result.normSign().iadd(BN.n)}return C.ureduce()},BN.prototype.imulK=function(){this.words[this.length]=0,this.words[this.length+1]=0,this.length+=2;for(var i=0,lo=0;i0?this.isub(BN.p):this.strip(),this},BN.prototype.redNeg=function(){return this.isZero()?BN.fromNumber(0):BN.p.sub(this)},BN.prototype.redAdd=function(num){return this.clone().redIAdd(num)},BN.prototype.redIAdd=function(num){return this.iadd(num),this.ucmp(BN.p)>=0&&this.isub(BN.p),this},BN.prototype.redIAdd7=function(){return this.iuaddn(7),this.ucmp(BN.p)>=0&&this.isub(BN.p),this},BN.prototype.redSub=function(num){return this.clone().redISub(num)},BN.prototype.redISub=function(num){return this.isub(num),0!==this.negative&&this.iadd(BN.p),this},BN.prototype.redMul=function(num){return this.umul(num).redIReduce()},BN.prototype.redSqr=function(){return this.umul(this).redIReduce()},BN.prototype.redSqrt=function(){if(this.isZero())return this.clone();for(var wv2=this.redSqr(),wv4=wv2.redSqr(),wv12=wv4.redSqr().redMul(wv4),wv14=wv12.redMul(wv2),wv15=wv14.redMul(this),out=wv15,i=0;i<54;++i)out=out.redSqr().redSqr().redSqr().redSqr().redMul(wv15);for(out=out.redSqr().redSqr().redSqr().redSqr().redMul(wv14),i=0;i<5;++i)out=out.redSqr().redSqr().redSqr().redSqr().redMul(wv15);return out=out.redSqr().redSqr().redSqr().redSqr().redMul(wv12),out=out.redSqr().redSqr().redSqr().redSqr().redSqr().redSqr().redMul(wv12),0===out.redSqr().ucmp(this)?out:null},BN.prototype.redInvm=function(){for(var a=this.clone(),b=BN.p.clone(),x1=BN.fromNumber(1),x2=BN.fromNumber(0);a.gtOne()&&b.gtOne();){for(var i=0,im=1;0==(a.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(a.ishrn(i);i-- >0;)x1.isOdd()&&x1.iadd(BN.p),x1.ishrn(1);for(var j=0,jm=1;0==(b.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(b.ishrn(j);j-- >0;)x2.isOdd()&&x2.iadd(BN.p),x2.ishrn(1);a.ucmp(b)>=0?(a.isub(b),x1.isub(x2)):(b.isub(a),x2.isub(x1))}var res;return res=1===a.length&&1===a.words[0]?x1:x2,0!==res.negative&&res.iadd(BN.p),0!==res.negative?(res.negative=0,res.redIReduce().redNeg()):res.redIReduce()},BN.prototype.getNAF=function(w){for(var naf=[],ws=1<>1,k=this.clone();!k.isZero();){for(var i=0,m=1;0==(k.words[0]&m)&&i<26;++i,m<<=1)naf.push(0);if(0!==i)k.ishrn(i);else{var mod=k.words[0]&wsm1;if(mod>=ws2)naf.push(ws2-mod),k.iuaddn(mod-ws2).ishrn(1);else if(naf.push(mod),k.words[0]-=mod,!k.isZero()){for(i=w-1;i>0;--i)naf.push(0);k.ishrn(w)}}}return naf},BN.prototype.inspect=function(){if(this.isZero())return"0";for(var buffer=this.toBuffer().toString("hex"),i=0;"0"===buffer[i];++i);return buffer.slice(i)},BN.n=BN.fromBuffer(new Buffer("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","hex")),BN.nh=BN.n.clone().ishrn(1),BN.nc=BN.fromBuffer(new Buffer("000000000000000000000000000000014551231950B75FC4402DA1732FC9BEBF","hex")),BN.p=BN.fromBuffer(new Buffer("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","hex")),BN.psn=BN.p.sub(BN.n),BN.tmp=new BN,BN.tmp.words=new Array(10),function(){BN.fromNumber(1).words[3]=0}(),module.exports=BN}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.name="h2",exports.constants=__webpack_require__(793),exports.parser=__webpack_require__(796),exports.framer=__webpack_require__(794),exports.compressionPool=__webpack_require__(795)},function(module,exports,__webpack_require__){(function(process){function destroy(stream,cb){function onClose(){cleanup(),cb()}function onError(err){cleanup(),cb(err)}function cleanup(){stream.removeListener("close",onClose),stream.removeListener("error",onError)}stream.on("close",onClose),stream.on("error",onError)}function destroy(stream){stream.destroy?stream.destroy():console.error("warning, stream-to-pull-stream: \nthe wrapped node-stream does not implement `destroy`, \nthis may cause resource leaks.")}function write(read,stream,cb){function done(){did||(did=!0,cb&&cb(ended===!0?null:ended))}function onClose(){closed||(closed=!0,cleanup(),ended?done():read(ended=!0,done))}function onError(err){cleanup(),ended||read(ended=err,done)}function cleanup(){stream.on("finish",onClose),stream.removeListener("close",onClose),stream.removeListener("error",onError)}var ended,did,closed=!1;stream.on("close",onClose),stream.on("finish",onClose),stream.on("error",onError),process.nextTick(function(){looper(function(next){read(null,function(end,data){if(ended=ended||end,end===!0)return stream._isStdio?done():stream.end();if(ended=ended||end)return destroy(stream),done(ended);if(stream._isStdio)stream.write(data,function(){next()});else{stream.write(data)===!1?stream.once("drain",next):next()}})})})}function read2(stream){function read(){var data=stream.read();if(null!==data&&_cb){var cb=_cb;_cb=null,cb(null,data)}}var _cb,ended=!1,waiting=!1;return stream.on("readable",function(){waiting=!0,_cb&&read()}).on("end",function(){ended=!0,_cb&&_cb(ended)}).on("error",function(err){ended=err,_cb&&_cb(ended)}),function(end,cb){_cb=cb,ended?cb(ended):waiting&&read()}}function read1(stream){function drain(){for(;(buffer.length||ended)&&cbs.length;)cbs.shift()(buffer.length?null:ended,buffer.shift());!buffer.length&&paused&&(paused=!1,stream.resume())}var ended,buffer=[],cbs=[],paused=!1;return stream.on("data",function(data){buffer.push(data),drain(),buffer.length&&stream.pause&&(paused=!0,stream.pause())}),stream.on("end",function(){ended=!0,drain()}),stream.on("close",function(){ended=!0,drain()}),stream.on("error",function(err){ended=err,drain()}),function(abort,cb){function onAbort(){for(;cbs.length;)cbs.shift()(abort);cb(abort)}if(!cb)throw new Error("*must* provide cb");if(abort){if(ended)return onAbort();stream.once("close",onAbort),destroy(stream)}else cbs.push(cb),drain()}}var looper=(__webpack_require__(299),__webpack_require__(271)),read=read1,sink=function(stream,cb){return function(read){return write(read,stream,cb)}},source=function(stream){return read1(stream)};exports=module.exports=function(stream,cb){return stream.writable&&stream.write?stream.readable?function(_read){return write(_read,stream,cb),read1(stream)}:sink(stream,cb):source(stream)},exports.sink=sink,exports.source=source,exports.read=read,exports.read1=read1,exports.read2=read2,exports.duplex=function(stream,cb){return{source:source(stream),sink:sink(stream,cb)}},exports.transform=function(stream){return function(read){var _source=source(stream);return sink(stream)(read),_source}}}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){function v4(options,buf,offset){var i=buf&&offset||0;"string"==typeof options&&(buf="binary"==options?new Array(16):null,options=null),options=options||{};var rnds=options.random||(options.rng||rng)();if(rnds[6]=15&rnds[6]|64,rnds[8]=63&rnds[8]|128,buf)for(var ii=0;ii<16;++ii)buf[i+ii]=rnds[ii];return buf||bytesToUuid(rnds)}var rng=__webpack_require__(823),bytesToUuid=__webpack_require__(822);module.exports=v4},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function eachOfArrayLike(coll,iteratee,callback){function iteratorCallback(err,value){err?callback(err):++completed!==length&&value!==_breakLoop2.default||callback(null)}callback=(0,_once2.default)(callback||_noop2.default);var index=0,completed=0,length=coll.length;for(0===length&&callback(null);index>2,mant=(3&buf[0])<<8|buf[1],exp?31===exp?sign*(mant?NaN:Infinity):sign*Math.pow(2,exp-25)*(1024+mant):5.960464477539063e-8*sign*mant},exports.arrayBufferToBignumber=function(buf){const len=buf.byteLength;let res="";for(let i=0;i{const res=new Map,keys=Object.keys(obj),length=keys.length;for(let i=0;i{return f*SHIFT16+g}),exports.buildInt64=((f1,f2,g1,g2)=>{const f=exports.buildInt32(f1,f2),g=exports.buildInt32(g1,g2);return f>2097151?new Bignumber(f).times(SHIFT32).plus(g):f*SHIFT32+g}),exports.writeHalf=function(buf,half){const u32=new Buffer(4);u32.writeFloatBE(half,0);const u=u32.readUInt32BE(0);if(0!=(8191&u))return!1;var s16=u>>16&32768;const exp=u>>23&255,mant=8388607&u;if(exp>=113&&exp<=142)s16+=(exp-112<<10)+(mant>>13);else{if(!(exp>=103&&exp<113))return!1;if(mant&(1<<126-exp)-1)return!1;s16+=mant+8388608>>126-exp}return buf.writeUInt16BE(s16,0),!0},exports.keySorter=function(a,b){var lenA=a[0].byteLength,lenB=b[0].byteLength;return lenA>lenB?1:lenB>lenA?-1:a[0].compare(b[0])},exports.isNegativeZero=(x=>{return 0===x&&1/x<0}),exports.nextPowerOf2=(n=>{let count=0;if(n&&!(n&n-1))return n;for(;0!==n;)n>>=1,count+=1;return 1<>5]|=128<>>9<<4)]=len;for(var a=1732584193,b=-271733879,c=-1732584194,d=271733878,i=0;i>16)+(y>>16)+(lsw>>16)<<16|65535&lsw}function bit_rol(num,cnt){return num<>>32-cnt}var makeHash=__webpack_require__(382);module.exports=function(buf){return makeHash(buf,core_md5)}},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(5),Source=__webpack_require__(83),path=__webpack_require__(45),os=__webpack_require__(153),uuid=__webpack_require__(121);exports.asyncFilter=function(test){let abortCb,aborted,busy=!1;return function(read){return function next(abort,cb){if(aborted)return cb(aborted);abort?(aborted=abort,busy?read(abort,()=>{busy?abortCb=cb:cb(abort)}):read(abort,cb)):read(null,(end,data)=>{end?cb(end):aborted?cb(aborted):(busy=!0,test(data,(err,valid)=>{busy=!1,aborted?(cb(aborted),abortCb(aborted)):err?next(err,cb):valid?cb(null,data):next(null,cb)}))})}}},exports.asyncSort=function(sorter){const source=Source(),sink=pull.collect((err,ary)=>{if(err)return source.abort(err);sorter(ary,(err,res)=>{if(err)return source.abort(err);source.resolve(pull.values(ary))})});return function(read){return sink(read),source}},exports.replaceStartWith=function(s,r){const matcher=new RegExp("^"+r);return s.replace(matcher,"")},exports.tmpdir=(()=>{return path.join(os.tmpdir(),uuid())})},function(module,exports){var indexOf=[].indexOf;module.exports=function(arr,obj){if(indexOf)return arr.indexOf(obj);for(var i=0;i{busy?abortCb=cb:cb(abort)}):read(abort,cb)):read(null,(end,data)=>{end?cb(end):aborted?cb(aborted):(busy=!0,test(data,(err,valid)=>{busy=!1,aborted?(cb(aborted),abortCb(aborted)):err?next(err,cb):valid?cb(null,data):next(null,cb)}))})}}},exports.asyncSort=function(sorter){const source=Source(),sink=pull.collect((err,ary)=>{if(err)return source.abort(err);sorter(ary,(err,res)=>{if(err)return source.abort(err);source.resolve(pull.values(ary))})});return function(read){return sink(read),source}},exports.replaceStartWith=function(s,r){const matcher=new RegExp("^"+r);return s.replace(matcher,"")},exports.tmpdir=(()=>{return path.join(os.tmpdir(),uuid())})},function(module,exports,__webpack_require__){"use strict";module.exports={maxProvidersPerRequest:3,providerRequestTimeout:1e4,hasBlockTimeout:15e3,provideTimeout:15e3,kMaxPriority:Math.pow(2,31)-1,rebroadcastDelay:1e4,maxListeners:1e3}},function(module,exports,__webpack_require__){"use strict";module.exports=class Dir{}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(17),assert=__webpack_require__(7);class DAGNode{constructor(data,links,serialized,multihash){assert(serialized,"DAGNode needs its serialized format"),assert(multihash,"DAGNode needs its multihash"),"string"==typeof multihash&&(multihash=mh.fromB58String(multihash)),this._data=data||new Buffer(0),this._links=links||[],this._serialized=serialized,this._multihash=multihash,this._size=this.links.reduce((sum,l)=>sum+l.size,this.serialized.length),this._json={data:this.data,links:this.links.map(l=>l.toJSON()),multihash:mh.toB58String(this.multihash),size:this.size}}toJSON(){return this._json}toString(){return`DAGNode <${mh.toB58String(this.multihash)} - data: "${this.data.toString()}", links: ${this.links.length}, size: ${this.size}>`}get data(){return this._data}set data(data){throw new Error("Can't set property: 'data' is immutable")}get links(){return this._links}set links(links){ -throw new Error("Can't set property: 'links' is immutable")}get serialized(){return this._serialized}set serialized(serialized){throw new Error("Can't set property: 'serialized' is immutable")}get size(){return this._size}set size(size){throw new Error("Can't set property: 'size' is immutable")}get multihash(){return this._multihash}set multihash(multihash){throw new Error("Can't set property: 'multihash' is immutable")}}exports=module.exports=DAGNode,exports.create=__webpack_require__(101),exports.clone=__webpack_require__(503),exports.addLink=__webpack_require__(502),exports.rmLink=__webpack_require__(504)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function cid(node,callback){if(node.multihash)return callback(null,new CID(node.multihash));callback(new Error("not valid dagPB node"))}function serialize(node,callback){let serialized;try{const pb=toProtoBuf(node);serialized=proto.PBNode.encode(pb)}catch(err){return callback(err)}callback(null,serialized)}function deserialize(data,callback){const pbn=proto.PBNode.decode(data),links=pbn.Links.map(link=>{return new DAGLink(link.Name,link.Tsize,link.Hash)}),buf=pbn.Data||new Buffer(0);DAGNode.create(buf,links,callback)}function toProtoBuf(node){const pbn={};return node.data&&node.data.length>0?pbn.Data=node.data:pbn.Data=null,node.links&&node.links.length>0?pbn.Links=node.links.map(link=>{return{Hash:link.multihash,Name:link.name,Tsize:link.size}}):pbn.Links=null,pbn}const CID=__webpack_require__(500),protobuf=__webpack_require__(39),proto=protobuf(__webpack_require__(505)),DAGLink=__webpack_require__(61),DAGNode=__webpack_require__(135);exports=module.exports,exports.serialize=serialize,exports.deserialize=deserialize,exports.cid=cid}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function validate(multihash){if(!Buffer.isBuffer(multihash))throw new Error("multihash must be a Buffer");if(multihash.length<3)throw new Error("multihash too short. must be > 3 bytes.");if(multihash.length>129)throw new Error("multihash too long. must be < 129 bytes.");let code=multihash[0];if(!exports.isValidCode(code))throw new Error(`multihash unknown function code: 0x${code.toString(16)}`);if(multihash.slice(2).length!==multihash[1])throw new Error(`multihash length inconsistent: 0x${multihash.toString("hex")}`)}const bs58=__webpack_require__(24),cs=__webpack_require__(508);exports.toHexString=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return hash.toString("hex")},exports.fromHexString=function(hash){return new Buffer(hash,"hex")},exports.toB58String=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return bs58.encode(hash)},exports.fromB58String=function(hash){let encoded=hash;return Buffer.isBuffer(hash)&&(encoded=hash.toString()),new Buffer(bs58.decode(encoded))},exports.decode=function(buf){exports.validate(buf);const code=buf[0];return{code:code,name:cs.codes[code],length:buf[1],digest:buf.slice(2)}},exports.encode=function(digest,code,length){if(!digest||!code)throw new Error("multihash encode requires at least two args: digest, code");const hashfn=exports.coerceCode(code);if(!Buffer.isBuffer(digest))throw new Error("digest should be a Buffer");if(null==length&&(length=digest.length),length&&digest.length!==length)throw new Error("digest length should be equal to specified length.");if(length>127)throw new Error("multihash does not yet support digest lengths greater than 127 bytes.");return Buffer.concat([new Buffer([hashfn,length]),digest])},exports.coerceCode=function(name){let code=name;if("string"==typeof name){if(!cs.names[name])throw new Error(`Unrecognized hash function named: ${name}`);code=cs.names[name]}if("number"!=typeof code)throw new Error(`Hash function code should be a number. Got: ${code}`);if(!cs.codes[code]&&!exports.isAppCode(code))throw new Error(`Unrecognized function code: ${code}`);return code},exports.isAppCode=function(code){return code>0&&code<16},exports.isValidCode=function(code){return!!exports.isAppCode(code)||!!cs.codes[code]},exports.validate=validate,exports.prefix=function(multihash){return validate(multihash),multihash.slice(0,2)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function validate(multihash){if(!Buffer.isBuffer(multihash))throw new Error("multihash must be a Buffer");if(multihash.length<3)throw new Error("multihash too short. must be > 3 bytes.");if(multihash.length>129)throw new Error("multihash too long. must be < 129 bytes.");let code=multihash[0];if(!exports.isValidCode(code))throw new Error(`multihash unknown function code: 0x${code.toString(16)}`);if(multihash.slice(2).length!==multihash[1])throw new Error(`multihash length inconsistent: 0x${multihash.toString("hex")}`)}const bs58=__webpack_require__(24),cs=__webpack_require__(528);exports.toHexString=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return hash.toString("hex")},exports.fromHexString=function(hash){return new Buffer(hash,"hex")},exports.toB58String=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return bs58.encode(hash)},exports.fromB58String=function(hash){let encoded=hash;return Buffer.isBuffer(hash)&&(encoded=hash.toString()),new Buffer(bs58.decode(encoded))},exports.decode=function(buf){exports.validate(buf);const code=buf[0];return{code:code,name:cs.codes[code],length:buf[1],digest:buf.slice(2)}},exports.encode=function(digest,code,length){if(!digest||!code)throw new Error("multihash encode requires at least two args: digest, code");const hashfn=exports.coerceCode(code);if(!Buffer.isBuffer(digest))throw new Error("digest should be a Buffer");if(null==length&&(length=digest.length),length&&digest.length!==length)throw new Error("digest length should be equal to specified length.");if(length>127)throw new Error("multihash does not yet support digest lengths greater than 127 bytes.");return Buffer.concat([new Buffer([hashfn,length]),digest])},exports.coerceCode=function(name){let code=name;if("string"==typeof name){if(!cs.names[name])throw new Error(`Unrecognized hash function named: ${name}`);code=cs.names[name]}if("number"!=typeof code)throw new Error(`Hash function code should be a number. Got: ${code}`);if(!cs.codes[code]&&!exports.isAppCode(code))throw new Error(`Unrecognized function code: ${code}`);return code},exports.isAppCode=function(code){return code>0&&code<16},exports.isValidCode=function(code){return!!exports.isAppCode(code)||!!cs.codes[code]},exports.validate=validate,exports.prefix=function(multihash){return validate(multihash),multihash.slice(0,2)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function nibbleToPath(data){return data.map(num=>num.toString(16)).join("/")}function guessRemainingPath(path){let pathParts=path.split("/"),triePathLength=guessPathEndFromParts(pathParts)+1;return pathParts.slice(triePathLength).join("/")}function guessPathEndFromParts(pathParts){let matchingPart=pathParts.find(part=>part.length>1||Number.isNaN(parseInt(part,16)));return matchingPart?pathParts.indexOf(matchingPart)-1:pathParts.length-1}const async=__webpack_require__(86),TrieNode=__webpack_require__(276),util=__webpack_require__(104),cidForHash=__webpack_require__(77).cidForHash;__webpack_require__(77).isExternalLink;exports.resolve=((trieIpldFormat,block,path,callback)=>{util.deserialize(block.data,(err,ethTrieNode)=>{if(err)return callback(err);exports.resolveFromObject(trieIpldFormat,ethTrieNode,path,callback)})}),exports.resolveFromObject=((trieIpldFormat,ethTrieNode,path,callback)=>{let result;return path&&"/"!==path?"leaf"===ethTrieNode.type?(result={value:ethTrieNode.getValue(),remainderPath:guessRemainingPath(path)},callback(null,result)):void exports.treeFromObject(trieIpldFormat,ethTrieNode,{},(err,paths)=>{if(err)return callback(err);let matches=paths.filter(child=>child.path===path.slice(0,child.path.length)),sortedMatches=matches.sort((a,b)=>a.path.length{"function"==typeof options&&(callback=options,options=void 0),options||(options={}),util.deserialize(block.data,(err,trieNode)=>{if(err)return callback(err);exports.treeFromObject(trieIpldFormat,trieNode,options,callback)})}),exports.treeFromObject=((trieIpldFormat,trieNode,options,callback)=>{let paths=[];async.each(trieNode.getChildren(),(childData,next)=>{let key=nibbleToPath(childData[0]),value=childData[1];if(TrieNode.isRawNode(value)){let childNode=new TrieNode(value);paths.push({path:key,value:childNode}),exports.treeFromObject(trieIpldFormat,childNode,options,(err,subtree)=>{if(err)return next(err);subtree.forEach(path=>path.path=key+"/"+path.path),paths=paths.concat(subtree),next()})}else{let link={"/":cidForHash(trieIpldFormat,value).toBaseEncodedString()};paths.push({path:key,value:link}),next()}},err=>{if(err)return callback(err);callback(null,paths)})})},function(module,exports){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_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"}},function(module,exports,__webpack_require__){"use strict";module.exports=`enum KeyType { +var Ipfs=function(modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}var installedModules={};return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.i=function(value){return value},__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module.default}:function(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=720)}([function(module,exports,__webpack_require__){"use strict";(function(global){function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(that,length){if(kMaxLength()=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|length}function SlowBuffer(length){return+length!=length&&(length=0),Buffer.alloc(+length)}function byteLength(string,encoding){if(Buffer.isBuffer(string))return string.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(string)||string instanceof ArrayBuffer))return string.byteLength;"string"!=typeof string&&(string=""+string);var len=string.length;if(0===len)return 0;for(var loweredCase=!1;;)switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":case void 0:return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*len;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase)return utf8ToBytes(string).length;encoding=(""+encoding).toLowerCase(),loweredCase=!0}}function slowToString(encoding,start,end){var loweredCase=!1;if((void 0===start||start<0)&&(start=0),start>this.length)return"";if((void 0===end||end>this.length)&&(end=this.length),end<=0)return"";if(end>>>=0,start>>>=0,end<=start)return"";for(encoding||(encoding="utf8");;)switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase(),loweredCase=!0}}function swap(b,n,m){var i=b[n];b[n]=b[m],b[m]=i}function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){if(0===buffer.length)return-1;if("string"==typeof byteOffset?(encoding=byteOffset,byteOffset=0):byteOffset>2147483647?byteOffset=2147483647:byteOffset<-2147483648&&(byteOffset=-2147483648),byteOffset=+byteOffset,isNaN(byteOffset)&&(byteOffset=dir?0:buffer.length-1),byteOffset<0&&(byteOffset=buffer.length+byteOffset),byteOffset>=buffer.length){if(dir)return-1;byteOffset=buffer.length-1}else if(byteOffset<0){if(!dir)return-1;byteOffset=0}if("string"==typeof val&&(val=Buffer.from(val,encoding)),Buffer.isBuffer(val))return 0===val.length?-1:arrayIndexOf(buffer,val,byteOffset,encoding,dir);if("number"==typeof val)return val&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?dir?Uint8Array.prototype.indexOf.call(buffer,val,byteOffset):Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset):arrayIndexOf(buffer,[val],byteOffset,encoding,dir);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){function read(buf,i){return 1===indexSize?buf[i]:buf.readUInt16BE(i*indexSize)}var indexSize=1,arrLength=arr.length,valLength=val.length;if(void 0!==encoding&&("ucs2"===(encoding=String(encoding).toLowerCase())||"ucs-2"===encoding||"utf16le"===encoding||"utf-16le"===encoding)){if(arr.length<2||val.length<2)return-1;indexSize=2,arrLength/=2,valLength/=2,byteOffset/=2}var i;if(dir){var foundIndex=-1;for(i=byteOffset;iarrLength&&(byteOffset=arrLength-valLength),i=byteOffset;i>=0;i--){for(var found=!0,j=0;jremaining&&(length=remaining):length=remaining;var strLen=string.length;if(strLen%2!=0)throw new TypeError("Invalid hex string");length>strLen/2&&(length=strLen/2);for(var i=0;i239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end){var secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:firstByte<128&&(codePoint=firstByte);break;case 2:secondByte=buf[i+1],128==(192&secondByte)&&(tempCodePoint=(31&firstByte)<<6|63&secondByte)>127&&(codePoint=tempCodePoint);break;case 3:secondByte=buf[i+1],thirdByte=buf[i+2],128==(192&secondByte)&&128==(192&thirdByte)&&(tempCodePoint=(15&firstByte)<<12|(63&secondByte)<<6|63&thirdByte)>2047&&(tempCodePoint<55296||tempCodePoint>57343)&&(codePoint=tempCodePoint);break;case 4:secondByte=buf[i+1],thirdByte=buf[i+2],fourthByte=buf[i+3],128==(192&secondByte)&&128==(192&thirdByte)&&128==(192&fourthByte)&&(tempCodePoint=(15&firstByte)<<18|(63&secondByte)<<12|(63&thirdByte)<<6|63&fourthByte)>65535&&tempCodePoint<1114112&&(codePoint=tempCodePoint)}}null===codePoint?(codePoint=65533,bytesPerSequence=1):codePoint>65535&&(codePoint-=65536,res.push(codePoint>>>10&1023|55296),codePoint=56320|1023&codePoint),res.push(codePoint),i+=bytesPerSequence}return decodeCodePointsArray(res)}function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,codePoints);for(var res="",i=0;ilen)&&(end=len);for(var out="",i=start;ilength)throw new RangeError("Trying to access beyond buffer length")}function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||valuebuf.length)throw new RangeError("Index out of range")}function objectWriteUInt16(buf,value,offset,littleEndian){value<0&&(value=65535+value+1);for(var i=0,j=Math.min(buf.length-offset,2);i>>8*(littleEndian?i:1-i)}function objectWriteUInt32(buf,value,offset,littleEndian){value<0&&(value=4294967295+value+1);for(var i=0,j=Math.min(buf.length-offset,4);i>>8*(littleEndian?i:3-i)&255}function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,value,offset,4,3.4028234663852886e38,-3.4028234663852886e38),ieee754.write(buf,value,offset,littleEndian,23,4),offset+4}function writeDouble(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,value,offset,8,1.7976931348623157e308,-1.7976931348623157e308),ieee754.write(buf,value,offset,littleEndian,52,8),offset+8}function base64clean(str){if(str=stringtrim(str).replace(INVALID_BASE64_RE,""),str.length<2)return"";for(;str.length%4!=0;)str+="=";return str}function stringtrim(str){return str.trim?str.trim():str.replace(/^\s+|\s+$/g,"")}function toHex(n){return n<16?"0"+n.toString(16):n.toString(16)}function utf8ToBytes(string,units){units=units||1/0;for(var codePoint,length=string.length,leadSurrogate=null,bytes=[],i=0;i55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){(units-=3)>-1&&bytes.push(239,191,189);continue}if(i+1===length){(units-=3)>-1&&bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){(units-=3)>-1&&bytes.push(239,191,189),leadSurrogate=codePoint;continue}codePoint=65536+(leadSurrogate-55296<<10|codePoint-56320)}else leadSurrogate&&(units-=3)>-1&&bytes.push(239,191,189);if(leadSurrogate=null,codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,63&codePoint|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,63&codePoint|128)}else{if(!(codePoint<1114112))throw new Error("Invalid code point");if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,63&codePoint|128)}}return bytes}function asciiToBytes(str){for(var byteArray=[],i=0;i>8,lo=c%256,byteArray.push(lo),byteArray.push(hi);return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i=dst.length||i>=src.length);++i)dst[i+offset]=src[i];return i}function isnan(val){return val!==val}var base64=__webpack_require__(305),ieee754=__webpack_require__(190),isArray=__webpack_require__(205);exports.Buffer=Buffer,exports.SlowBuffer=SlowBuffer,exports.INSPECT_MAX_BYTES=50,Buffer.TYPED_ARRAY_SUPPORT=void 0!==global.TYPED_ARRAY_SUPPORT?global.TYPED_ARRAY_SUPPORT:function(){try{var arr=new Uint8Array(1);return arr.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===arr.foo()&&"function"==typeof arr.subarray&&0===arr.subarray(1,1).byteLength}catch(e){return!1}}(),exports.kMaxLength=kMaxLength(),Buffer.poolSize=8192,Buffer._augment=function(arr){return arr.__proto__=Buffer.prototype,arr},Buffer.from=function(value,encodingOrOffset,length){return from(null,value,encodingOrOffset,length)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0})),Buffer.alloc=function(size,fill,encoding){return alloc(null,size,fill,encoding)},Buffer.allocUnsafe=function(size){return allocUnsafe(null,size)},Buffer.allocUnsafeSlow=function(size){return allocUnsafe(null,size)},Buffer.isBuffer=function(b){return!(null==b||!b._isBuffer)},Buffer.compare=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var x=a.length,y=b.length,i=0,len=Math.min(x,y);i0&&(str=this.toString("hex",0,max).match(/.{2}/g).join(" "),this.length>max&&(str+=" ... ")),""},Buffer.prototype.compare=function(target,start,end,thisStart,thisEnd){if(!Buffer.isBuffer(target))throw new TypeError("Argument must be a Buffer");if(void 0===start&&(start=0),void 0===end&&(end=target?target.length:0),void 0===thisStart&&(thisStart=0),void 0===thisEnd&&(thisEnd=this.length),start<0||end>target.length||thisStart<0||thisEnd>this.length)throw new RangeError("out of range index");if(thisStart>=thisEnd&&start>=end)return 0;if(thisStart>=thisEnd)return-1;if(start>=end)return 1;if(start>>>=0,end>>>=0,thisStart>>>=0,thisEnd>>>=0,this===target)return 0;for(var x=thisEnd-thisStart,y=end-start,len=Math.min(x,y),thisCopy=this.slice(thisStart,thisEnd),targetCopy=target.slice(start,end),i=0;iremaining)&&(length=remaining),string.length>0&&(length<0||offset<0)||offset>this.length)throw new RangeError("Attempt to write outside buffer bounds");encoding||(encoding="utf8");for(var loweredCase=!1;;)switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase(),loweredCase=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;Buffer.prototype.slice=function(start,end){var len=this.length;start=~~start,end=void 0===end?len:~~end,start<0?(start+=len)<0&&(start=0):start>len&&(start=len),end<0?(end+=len)<0&&(end=0):end>len&&(end=len),end0&&(mul*=256);)val+=this[offset+--byteLength]*mul;return val},Buffer.prototype.readUInt8=function(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),this[offset]},Buffer.prototype.readUInt16LE=function(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]|this[offset+1]<<8},Buffer.prototype.readUInt16BE=function(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]<<8|this[offset+1]},Buffer.prototype.readUInt32LE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+16777216*this[offset+3]},Buffer.prototype.readUInt32BE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),16777216*this[offset]+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])},Buffer.prototype.readIntLE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset],mul=1,i=0;++i=mul&&(val-=Math.pow(2,8*byteLength)),val},Buffer.prototype.readIntBE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var i=byteLength,mul=1,val=this[offset+--i];i>0&&(mul*=256);)val+=this[offset+--i]*mul;return mul*=128,val>=mul&&(val-=Math.pow(2,8*byteLength)),val},Buffer.prototype.readInt8=function(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),128&this[offset]?(255-this[offset]+1)*-1:this[offset]},Buffer.prototype.readInt16LE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt16BE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt32LE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24},Buffer.prototype.readInt32BE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]},Buffer.prototype.readFloatLE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!0,23,4)},Buffer.prototype.readFloatBE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!1,23,4)},Buffer.prototype.readDoubleLE=function(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!0,52,8)},Buffer.prototype.readDoubleBE=function(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!1,52,8)},Buffer.prototype.writeUIntLE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,byteLength|=0,!noAssert){checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength)-1,0)}var mul=1,i=0;for(this[offset]=255&value;++i=0&&(mul*=256);)this[offset+i]=value/mul&255;return offset+byteLength},Buffer.prototype.writeUInt8=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),this[offset]=255&value,offset+1},Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset+3]=value>>>24,this[offset+2]=value>>>16,this[offset+1]=value>>>8,this[offset]=255&value):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeIntLE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0,mul=1,sub=0;for(this[offset]=255&value;++i>0)-sub&255;return offset+byteLength},Buffer.prototype.writeIntBE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1,mul=1,sub=0;for(this[offset+i]=255&value;--i>=0&&(mul*=256);)value<0&&0===sub&&0!==this[offset+i+1]&&(sub=1),this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength},Buffer.prototype.writeInt8=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),value<0&&(value=255+value+1),this[offset]=255&value,offset+1},Buffer.prototype.writeInt16LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeInt16BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeInt32LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8,this[offset+2]=value>>>16,this[offset+3]=value>>>24):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeInt32BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),value<0&&(value=4294967295+value+1),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeFloatLE=function(value,offset,noAssert){return writeFloat(this,value,offset,!0,noAssert)},Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,!1,noAssert)},Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,!0,noAssert)},Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,!1,noAssert)},Buffer.prototype.copy=function(target,targetStart,start,end){if(start||(start=0),end||0===end||(end=this.length),targetStart>=target.length&&(targetStart=target.length),targetStart||(targetStart=0),end>0&&end=this.length)throw new RangeError("sourceStart out of bounds");if(end<0)throw new RangeError("sourceEnd out of bounds");end>this.length&&(end=this.length),target.length-targetStart=0;--i)target[i+targetStart]=this[i+start];else if(len<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,end=void 0===end?this.length:end>>>0,val||(val=0);var i;if("number"==typeof val)for(i=start;i=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(args){var useColors=this.useColors;if(args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff),useColors){var c="color: "+this.color;args.splice(1,0,c,"color: inherit");var index=0,lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){"%%"!==match&&(index++,"%c"===match&&(lastC=index))}),args.splice(lastC,0,c)}}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{null==namespaces?exports.storage.removeItem("debug"):exports.storage.debug=namespaces}catch(e){}}function load(){var r;try{r=exports.storage.debug}catch(e){}return!r&&void 0!==process&&"env"in process&&(r=process.env.DEBUG),r}exports=module.exports=__webpack_require__(332),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],exports.formatters.j=function(v){try{return JSON.stringify(v)}catch(err){return"[UnexpectedJSONParseError]: "+err.message}},exports.enable(load())}).call(exports,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";var sources=__webpack_require__(612),sinks=__webpack_require__(606),throughs=__webpack_require__(618);exports=module.exports=__webpack_require__(252),exports.pull=exports;for(var k in sources)exports[k]=sources[k];for(var k in throughs)exports[k]=throughs[k];for(var k in sinks)exports[k]=sinks[k]},function(module,exports){function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(fun){if(cachedSetTimeout===setTimeout)return setTimeout(fun,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(fun,0);try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}function runClearTimeout(marker){if(cachedClearTimeout===clearTimeout)return clearTimeout(marker);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(marker);try{return cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var timeout=runTimeout(cleanUpNextTick);draining=!0;for(var len=queue.length;len;){for(currentQueue=queue,queue=[];++queueIndex1)for(var i=1;i=0;i--)if(ka[i]!==kb[i])return!1;for(i=ka.length-1;i>=0;i--)if(key=ka[i],!_deepEqual(a[key],b[key],strict,actualVisitedObjects))return!1;return!0}function notDeepStrictEqual(actual,expected,message){_deepEqual(actual,expected,!0)&&fail(actual,expected,message,"notDeepStrictEqual",notDeepStrictEqual)}function expectedException(actual,expected){if(!actual||!expected)return!1;if("[object RegExp]"==Object.prototype.toString.call(expected))return expected.test(actual);try{if(actual instanceof expected)return!0}catch(e){}return!Error.isPrototypeOf(expected)&&expected.call({},actual)===!0}function _tryBlock(block){var error;try{block()}catch(e){error=e}return error}function _throws(shouldThrow,block,expected,message){var actual;if("function"!=typeof block)throw new TypeError('"block" argument must be a function');"string"==typeof expected&&(message=expected,expected=null),actual=_tryBlock(block),message=(expected&&expected.name?" ("+expected.name+").":".")+(message?" "+message:"."),shouldThrow&&!actual&&fail(actual,expected,"Missing expected exception"+message);var userProvidedMessage="string"==typeof message,isUnwantedException=!shouldThrow&&util.isError(actual),isUnexpectedException=!shouldThrow&&actual&&!expected;if((isUnwantedException&&userProvidedMessage&&expectedException(actual,expected)||isUnexpectedException)&&fail(actual,expected,"Got unwanted exception"+message),shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual)throw actual}var util=__webpack_require__(32),hasOwn=Object.prototype.hasOwnProperty,pSlice=Array.prototype.slice,functionsHaveNames=function(){return"foo"===function(){}.name}(),assert=module.exports=ok,regex=/\s*function\s+([^\(\s]*)\s*/;assert.AssertionError=function(options){this.name="AssertionError",this.actual=options.actual,this.expected=options.expected,this.operator=options.operator,options.message?(this.message=options.message,this.generatedMessage=!1):(this.message=getMessage(this),this.generatedMessage=!0);var stackStartFunction=options.stackStartFunction||fail;if(Error.captureStackTrace)Error.captureStackTrace(this,stackStartFunction);else{var err=new Error;if(err.stack){var out=err.stack,fn_name=getName(stackStartFunction),idx=out.indexOf("\n"+fn_name);if(idx>=0){var next_line=out.indexOf("\n",idx+1);out=out.substring(next_line+1)}this.stack=out}}},util.inherits(assert.AssertionError,Error),assert.fail=fail,assert.ok=ok,assert.equal=function(actual,expected,message){actual!=expected&&fail(actual,expected,message,"==",assert.equal)},assert.notEqual=function(actual,expected,message){actual==expected&&fail(actual,expected,message,"!=",assert.notEqual)},assert.deepEqual=function(actual,expected,message){_deepEqual(actual,expected,!1)||fail(actual,expected,message,"deepEqual",assert.deepEqual)},assert.deepStrictEqual=function(actual,expected,message){_deepEqual(actual,expected,!0)||fail(actual,expected,message,"deepStrictEqual",assert.deepStrictEqual)},assert.notDeepEqual=function(actual,expected,message){_deepEqual(actual,expected,!1)&&fail(actual,expected,message,"notDeepEqual",assert.notDeepEqual)},assert.notDeepStrictEqual=notDeepStrictEqual,assert.strictEqual=function(actual,expected,message){actual!==expected&&fail(actual,expected,message,"===",assert.strictEqual)},assert.notStrictEqual=function(actual,expected,message){actual===expected&&fail(actual,expected,message,"!==",assert.notStrictEqual)},assert.throws=function(block,error,message){_throws(!0,block,error,message)},assert.doesNotThrow=function(block,error,message){_throws(!1,block,error,message)},assert.ifError=function(err){if(err)throw err};var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)hasOwn.call(obj,key)&&keys.push(key);return keys}}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _setImmediate=__webpack_require__(105),_setImmediate2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_setImmediate);exports.default=_setImmediate2.default,module.exports=exports.default},function(module,exports){function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(arg){return"function"==typeof arg}function isNumber(arg){return"number"==typeof arg}function isObject(arg){return"object"==typeof arg&&null!==arg}function isUndefined(arg){return void 0===arg}module.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||n<0||isNaN(n))throw TypeError("n must be a positive number");return this._maxListeners=n,this},EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(this._events||(this._events={}),"error"===type&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length)){if((er=arguments[1])instanceof Error)throw er;var err=new Error('Uncaught, unspecified "error" event. ('+er+")");throw err.context=er,err}if(handler=this._events[type],isUndefined(handler))return!1;if(isFunction(handler))switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:args=Array.prototype.slice.call(arguments,1),handler.apply(this,args)}else if(isObject(handler))for(args=Array.prototype.slice.call(arguments,1),listeners=handler.slice(),len=listeners.length,i=0;i0&&this._events[type].length>m&&(this._events[type].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[type].length),"function"==typeof console.trace&&console.trace()),this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(type,listener){function g(){this.removeListener(type,g),fired||(fired=!0,listener.apply(this,arguments))}if(!isFunction(listener))throw TypeError("listener must be a function");var fired=!1;return g.listener=listener,this.on(type,g),this},EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;if(list=this._events[type],length=list.length,position=-1,list===listener||isFunction(list.listener)&&list.listener===listener)delete this._events[type],this._events.removeListener&&this.emit("removeListener",type,listener);else if(isObject(list)){for(i=length;i-- >0;)if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}if(position<0)return this;1===list.length?(list.length=0,delete this._events[type]):list.splice(position,1),this._events.removeListener&&this.emit("removeListener",type,listener)}return this},EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[type]&&delete this._events[type],this;if(0===arguments.length){for(key in this._events)"removeListener"!==key&&this.removeAllListeners(key);return this.removeAllListeners("removeListener"),this._events={},this}if(listeners=this._events[type],isFunction(listeners))this.removeListener(type,listeners);else if(listeners)for(;listeners.length;)this.removeListener(type,listeners[listeners.length-1]);return delete this._events[type],this},EventEmitter.prototype.listeners=function(type){return this._events&&this._events[type]?isFunction(this._events[type])?[this._events[type]]:this._events[type].slice():[]},EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;if(evlistener)return evlistener.length}return 0},EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function validate(multihash){exports.decode(multihash)}const bs58=__webpack_require__(79),cs=__webpack_require__(567),varint=__webpack_require__(15);exports.toHexString=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return hash.toString("hex")},exports.fromHexString=function(hash){return new Buffer(hash,"hex")},exports.toB58String=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return bs58.encode(hash)},exports.fromB58String=function(hash){let encoded=hash;return Buffer.isBuffer(hash)&&(encoded=hash.toString()),new Buffer(bs58.decode(encoded))},exports.decode=function(buf){if(!Buffer.isBuffer(buf))throw new Error("multihash must be a Buffer");if(buf.length<3)throw new Error("multihash too short. must be > 3 bytes.");let code=varint.decode(buf);if(!exports.isValidCode(code))throw new Error(`multihash unknown function code: 0x${code.toString(16)}`);buf=buf.slice(varint.decode.bytes);let len=varint.decode(buf);if(len<1)throw new Error(`multihash invalid length: 0x${len.toString(16)}`);if(buf=buf.slice(varint.decode.bytes),buf.length!==len)throw new Error(`multihash length inconsistent: 0x${buf.toString("hex")}`);return{code:code,name:cs.codes[code],length:len,digest:buf}},exports.encode=function(digest,code,length){if(!digest||!code)throw new Error("multihash encode requires at least two args: digest, code");const hashfn=exports.coerceCode(code);if(!Buffer.isBuffer(digest))throw new Error("digest should be a Buffer");if(null==length&&(length=digest.length),length&&digest.length!==length)throw new Error("digest length should be equal to specified length.");return Buffer.concat([new Buffer(varint.encode(hashfn)),new Buffer(varint.encode(length)),digest])},exports.coerceCode=function(name){let code=name;if("string"==typeof name){if(!cs.names[name])throw new Error(`Unrecognized hash function named: ${name}`);code=cs.names[name]}if("number"!=typeof code)throw new Error(`Hash function code should be a number. Got: ${code}`);if(!cs.codes[code]&&!exports.isAppCode(code))throw new Error(`Unrecognized function code: ${code}`);return code},exports.isAppCode=function(code){return code>0&&code<16},exports.isValidCode=function(code){return!!exports.isAppCode(code)||!!cs.codes[code]},exports.validate=validate,exports.prefix=function(multihash){return validate(multihash),multihash.slice(0,2)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function isAsync(fn){return supportsSymbol&&"AsyncFunction"===fn[Symbol.toStringTag]}function wrapAsync(asyncFn){return isAsync(asyncFn)?(0,_asyncify2.default)(asyncFn):asyncFn}Object.defineProperty(exports,"__esModule",{value:!0}),exports.isAsync=void 0;var _asyncify=__webpack_require__(70),_asyncify2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_asyncify),supportsSymbol="function"==typeof Symbol;exports.default=wrapAsync,exports.isAsync=isAsync},function(module,exports,__webpack_require__){(function(module){!function(module,exports){"use strict";function assert(val,msg){if(!val)throw new Error(msg||"Assertion failed")}function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype,ctor.prototype=new TempCtor,ctor.prototype.constructor=ctor}function BN(number,base,endian){if(BN.isBN(number))return number;this.negative=0,this.words=null,this.length=0,this.red=null,null!==number&&("le"!==base&&"be"!==base||(endian=base,base=10),this._init(number||0,base||10,endian||"be"))}function parseHex(str,start,end){for(var r=0,len=Math.min(str.length,end),i=start;i=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:15&c}return r}function parseBase(str,start,end,mul){for(var r=0,len=Math.min(str.length,end),i=start;i=49?c-49+10:c>=17?c-17+10:c}return r}function toBitArray(num){for(var w=new Array(num.bitLength()),bit=0;bit>>wbit}return w}function smallMulTo(self,num,out){out.negative=num.negative^self.negative;var len=self.length+num.length|0;out.length=len,len=len-1|0;var a=0|self.words[0],b=0|num.words[0],r=a*b,lo=67108863&r,carry=r/67108864|0;out.words[0]=lo;for(var k=1;k>>26,rword=67108863&carry,maxJ=Math.min(k,num.length-1),j=Math.max(0,k-self.length+1);j<=maxJ;j++){var i=k-j|0;a=0|self.words[i],b=0|num.words[j],r=a*b+rword,ncarry+=r/67108864|0,rword=67108863&r}out.words[k]=0|rword,carry=0|ncarry}return 0!==carry?out.words[k]=0|carry:out.length--,out.strip()}function bigMulTo(self,num,out){out.negative=num.negative^self.negative,out.length=self.length+num.length;for(var carry=0,hncarry=0,k=0;k>>26)|0,hncarry+=ncarry>>>26,ncarry&=67108863}out.words[k]=rword,carry=ncarry,ncarry=hncarry}return 0!==carry?out.words[k]=carry:out.length--,out.strip()}function jumboMulTo(self,num,out){return(new FFTM).mulp(self,num,out)}function FFTM(x,y){this.x=x,this.y=y}function MPrime(name,p){this.name=name,this.p=new BN(p,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(m){if("string"==typeof m){var prime=BN._prime(m);this.m=prime.p,this.prime=prime}else assert(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}function Mont(m){Red.call(this,m),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof module?module.exports=BN:exports.BN=BN,BN.BN=BN,BN.wordSize=26;var Buffer;try{Buffer=__webpack_require__(0).Buffer}catch(e){}BN.isBN=function(num){return num instanceof BN||null!==num&&"object"==typeof num&&num.constructor.wordSize===BN.wordSize&&Array.isArray(num.words)},BN.max=function(left,right){return left.cmp(right)>0?left:right},BN.min=function(left,right){return left.cmp(right)<0?left:right},BN.prototype._init=function(number,base,endian){if("number"==typeof number)return this._initNumber(number,base,endian);if("object"==typeof number)return this._initArray(number,base,endian);"hex"===base&&(base=16),assert(base===(0|base)&&base>=2&&base<=36),number=number.toString().replace(/\s+/g,"");var start=0;"-"===number[0]&&start++,16===base?this._parseHex(number,start):this._parseBase(number,base,start),"-"===number[0]&&(this.negative=1),this.strip(),"le"===endian&&this._initArray(this.toArray(),base,endian)},BN.prototype._initNumber=function(number,base,endian){number<0&&(this.negative=1,number=-number),number<67108864?(this.words=[67108863&number],this.length=1):number<4503599627370496?(this.words=[67108863&number,number/67108864&67108863],this.length=2):(assert(number<9007199254740992),this.words=[67108863&number,number/67108864&67108863,1],this.length=3),"le"===endian&&this._initArray(this.toArray(),base,endian)},BN.prototype._initArray=function(number,base,endian){if(assert("number"==typeof number.length),number.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(number.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)w=number[i]|number[i-1]<<8|number[i-2]<<16,this.words[j]|=w<>>26-off&67108863,(off+=24)>=26&&(off-=26,j++);else if("le"===endian)for(i=0,j=0;i>>26-off&67108863,(off+=24)>=26&&(off-=26,j++);return this.strip()},BN.prototype._parseHex=function(number,start){this.length=Math.ceil((number.length-start)/6),this.words=new Array(this.length);for(var i=0;i=start;i-=6)w=parseHex(number,i,i+6),this.words[j]|=w<>>26-off&4194303,(off+=24)>=26&&(off-=26,j++);i+6!==start&&(w=parseHex(number,start,i+6),this.words[j]|=w<>>26-off&4194303),this.strip()},BN.prototype._parseBase=function(number,base,start){this.words=[0],this.length=1;for(var limbLen=0,limbPow=1;limbPow<=67108863;limbPow*=base)limbLen++;limbLen--,limbPow=limbPow/base|0;for(var total=number.length-start,mod=total%limbLen,end=Math.min(total,total-mod)+start,word=0,i=start;i1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.inspect=function(){return(this.red?""};var zeros=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],groupSizes=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],groupBases=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];BN.prototype.toString=function(base,padding){base=base||10,padding=0|padding||1;var out;if(16===base||"hex"===base){out="";for(var off=0,carry=0,i=0;i>>24-off&16777215,out=0!==carry||i!==this.length-1?zeros[6-word.length]+word+out:word+out,off+=2,off>=26&&(off-=26,i--)}for(0!==carry&&(out=carry.toString(16)+out);out.length%padding!=0;)out="0"+out;return 0!==this.negative&&(out="-"+out),out}if(base===(0|base)&&base>=2&&base<=36){var groupSize=groupSizes[base],groupBase=groupBases[base];out="";var c=this.clone();for(c.negative=0;!c.isZero();){var r=c.modn(groupBase).toString(base);c=c.idivn(groupBase),out=c.isZero()?r+out:zeros[groupSize-r.length]+r+out}for(this.isZero()&&(out="0"+out);out.length%padding!=0;)out="0"+out;return 0!==this.negative&&(out="-"+out),out}assert(!1,"Base should be between 2 and 36")},BN.prototype.toNumber=function(){var ret=this.words[0];return 2===this.length?ret+=67108864*this.words[1]:3===this.length&&1===this.words[2]?ret+=4503599627370496+67108864*this.words[1]:this.length>2&&assert(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-ret:ret},BN.prototype.toJSON=function(){return this.toString(16)},BN.prototype.toBuffer=function(endian,length){return assert(void 0!==Buffer),this.toArrayLike(Buffer,endian,length)},BN.prototype.toArray=function(endian,length){return this.toArrayLike(Array,endian,length)},BN.prototype.toArrayLike=function(ArrayType,endian,length){var byteLength=this.byteLength(),reqLength=length||Math.max(1,byteLength);assert(byteLength<=reqLength,"byte array longer than desired length"),assert(reqLength>0,"Requested array length <= 0"),this.strip();var b,i,littleEndian="le"===endian,res=new ArrayType(reqLength),q=this.clone();if(littleEndian){for(i=0;!q.isZero();i++)b=q.andln(255),q.iushrn(8),res[i]=b;for(;i=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},BN.prototype._zeroBits=function(w){if(0===w)return 26;var t=w,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},BN.prototype.bitLength=function(){var w=this.words[this.length-1],hi=this._countBits(w);return 26*(this.length-1)+hi},BN.prototype.zeroBits=function(){if(this.isZero())return 0;for(var r=0,i=0;inum.length?this.clone().ior(num):num.clone().ior(this)},BN.prototype.uor=function(num){return this.length>num.length?this.clone().iuor(num):num.clone().iuor(this)},BN.prototype.iuand=function(num){var b;b=this.length>num.length?num:this;for(var i=0;inum.length?this.clone().iand(num):num.clone().iand(this)},BN.prototype.uand=function(num){return this.length>num.length?this.clone().iuand(num):num.clone().iuand(this)},BN.prototype.iuxor=function(num){var a,b;this.length>num.length?(a=this,b=num):(a=num,b=this);for(var i=0;inum.length?this.clone().ixor(num):num.clone().ixor(this)},BN.prototype.uxor=function(num){return this.length>num.length?this.clone().iuxor(num):num.clone().iuxor(this)},BN.prototype.inotn=function(width){assert("number"==typeof width&&width>=0);var bytesNeeded=0|Math.ceil(width/26),bitsLeft=width%26;this._expand(bytesNeeded),bitsLeft>0&&bytesNeeded--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-bitsLeft),this.strip()},BN.prototype.notn=function(width){return this.clone().inotn(width)},BN.prototype.setn=function(bit,val){assert("number"==typeof bit&&bit>=0);var off=bit/26|0,wbit=bit%26;return this._expand(off+1),this.words[off]=val?this.words[off]|1<num.length?(a=this,b=num):(a=num,b=this);for(var carry=0,i=0;i>>26;for(;0!==carry&&i>>26;if(this.length=a.length,0!==carry)this.words[this.length]=carry,this.length++;else if(a!==this)for(;inum.length?this.clone().iadd(num):num.clone().iadd(this)},BN.prototype.isub=function(num){if(0!==num.negative){num.negative=0;var r=this.iadd(num);return num.negative=1,r._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(num),this.negative=1,this._normSign();var cmp=this.cmp(num);if(0===cmp)return this.negative=0,this.length=1,this.words[0]=0,this;var a,b;cmp>0?(a=this,b=num):(a=num,b=this);for(var carry=0,i=0;i>26,this.words[i]=67108863&r;for(;0!==carry&&i>26,this.words[i]=67108863&r;if(0===carry&&i>>13,a1=0|a[1],al1=8191&a1,ah1=a1>>>13,a2=0|a[2],al2=8191&a2,ah2=a2>>>13,a3=0|a[3],al3=8191&a3,ah3=a3>>>13,a4=0|a[4],al4=8191&a4,ah4=a4>>>13,a5=0|a[5],al5=8191&a5,ah5=a5>>>13,a6=0|a[6],al6=8191&a6,ah6=a6>>>13,a7=0|a[7],al7=8191&a7,ah7=a7>>>13,a8=0|a[8],al8=8191&a8,ah8=a8>>>13,a9=0|a[9],al9=8191&a9,ah9=a9>>>13,b0=0|b[0],bl0=8191&b0,bh0=b0>>>13,b1=0|b[1],bl1=8191&b1,bh1=b1>>>13,b2=0|b[2],bl2=8191&b2,bh2=b2>>>13,b3=0|b[3],bl3=8191&b3,bh3=b3>>>13,b4=0|b[4],bl4=8191&b4,bh4=b4>>>13,b5=0|b[5],bl5=8191&b5,bh5=b5>>>13,b6=0|b[6],bl6=8191&b6,bh6=b6>>>13,b7=0|b[7],bl7=8191&b7,bh7=b7>>>13,b8=0|b[8],bl8=8191&b8,bh8=b8>>>13,b9=0|b[9],bl9=8191&b9,bh9=b9>>>13;out.negative=self.negative^num.negative,out.length=19,lo=Math.imul(al0,bl0),mid=Math.imul(al0,bh0),mid=mid+Math.imul(ah0,bl0)|0,hi=Math.imul(ah0,bh0);var w0=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w0>>>26)|0,w0&=67108863,lo=Math.imul(al1,bl0),mid=Math.imul(al1,bh0),mid=mid+Math.imul(ah1,bl0)|0,hi=Math.imul(ah1,bh0),lo=lo+Math.imul(al0,bl1)|0,mid=mid+Math.imul(al0,bh1)|0,mid=mid+Math.imul(ah0,bl1)|0,hi=hi+Math.imul(ah0,bh1)|0;var w1=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w1>>>26)|0,w1&=67108863,lo=Math.imul(al2,bl0),mid=Math.imul(al2,bh0),mid=mid+Math.imul(ah2,bl0)|0,hi=Math.imul(ah2,bh0),lo=lo+Math.imul(al1,bl1)|0,mid=mid+Math.imul(al1,bh1)|0,mid=mid+Math.imul(ah1,bl1)|0,hi=hi+Math.imul(ah1,bh1)|0,lo=lo+Math.imul(al0,bl2)|0,mid=mid+Math.imul(al0,bh2)|0,mid=mid+Math.imul(ah0,bl2)|0,hi=hi+Math.imul(ah0,bh2)|0;var w2=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w2>>>26)|0,w2&=67108863,lo=Math.imul(al3,bl0),mid=Math.imul(al3,bh0),mid=mid+Math.imul(ah3,bl0)|0,hi=Math.imul(ah3,bh0),lo=lo+Math.imul(al2,bl1)|0,mid=mid+Math.imul(al2,bh1)|0,mid=mid+Math.imul(ah2,bl1)|0,hi=hi+Math.imul(ah2,bh1)|0,lo=lo+Math.imul(al1,bl2)|0,mid=mid+Math.imul(al1,bh2)|0,mid=mid+Math.imul(ah1,bl2)|0,hi=hi+Math.imul(ah1,bh2)|0,lo=lo+Math.imul(al0,bl3)|0,mid=mid+Math.imul(al0,bh3)|0,mid=mid+Math.imul(ah0,bl3)|0,hi=hi+Math.imul(ah0,bh3)|0;var w3=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w3>>>26)|0,w3&=67108863,lo=Math.imul(al4,bl0),mid=Math.imul(al4,bh0),mid=mid+Math.imul(ah4,bl0)|0,hi=Math.imul(ah4,bh0),lo=lo+Math.imul(al3,bl1)|0,mid=mid+Math.imul(al3,bh1)|0,mid=mid+Math.imul(ah3,bl1)|0,hi=hi+Math.imul(ah3,bh1)|0,lo=lo+Math.imul(al2,bl2)|0,mid=mid+Math.imul(al2,bh2)|0,mid=mid+Math.imul(ah2,bl2)|0,hi=hi+Math.imul(ah2,bh2)|0,lo=lo+Math.imul(al1,bl3)|0,mid=mid+Math.imul(al1,bh3)|0,mid=mid+Math.imul(ah1,bl3)|0,hi=hi+Math.imul(ah1,bh3)|0,lo=lo+Math.imul(al0,bl4)|0,mid=mid+Math.imul(al0,bh4)|0,mid=mid+Math.imul(ah0,bl4)|0,hi=hi+Math.imul(ah0,bh4)|0;var w4=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w4>>>26)|0,w4&=67108863,lo=Math.imul(al5,bl0),mid=Math.imul(al5,bh0),mid=mid+Math.imul(ah5,bl0)|0,hi=Math.imul(ah5,bh0),lo=lo+Math.imul(al4,bl1)|0,mid=mid+Math.imul(al4,bh1)|0,mid=mid+Math.imul(ah4,bl1)|0,hi=hi+Math.imul(ah4,bh1)|0,lo=lo+Math.imul(al3,bl2)|0,mid=mid+Math.imul(al3,bh2)|0,mid=mid+Math.imul(ah3,bl2)|0,hi=hi+Math.imul(ah3,bh2)|0,lo=lo+Math.imul(al2,bl3)|0,mid=mid+Math.imul(al2,bh3)|0,mid=mid+Math.imul(ah2,bl3)|0,hi=hi+Math.imul(ah2,bh3)|0,lo=lo+Math.imul(al1,bl4)|0,mid=mid+Math.imul(al1,bh4)|0,mid=mid+Math.imul(ah1,bl4)|0,hi=hi+Math.imul(ah1,bh4)|0,lo=lo+Math.imul(al0,bl5)|0,mid=mid+Math.imul(al0,bh5)|0,mid=mid+Math.imul(ah0,bl5)|0,hi=hi+Math.imul(ah0,bh5)|0;var w5=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w5>>>26)|0,w5&=67108863,lo=Math.imul(al6,bl0),mid=Math.imul(al6,bh0),mid=mid+Math.imul(ah6,bl0)|0,hi=Math.imul(ah6,bh0),lo=lo+Math.imul(al5,bl1)|0,mid=mid+Math.imul(al5,bh1)|0,mid=mid+Math.imul(ah5,bl1)|0,hi=hi+Math.imul(ah5,bh1)|0,lo=lo+Math.imul(al4,bl2)|0,mid=mid+Math.imul(al4,bh2)|0,mid=mid+Math.imul(ah4,bl2)|0,hi=hi+Math.imul(ah4,bh2)|0,lo=lo+Math.imul(al3,bl3)|0,mid=mid+Math.imul(al3,bh3)|0,mid=mid+Math.imul(ah3,bl3)|0,hi=hi+Math.imul(ah3,bh3)|0,lo=lo+Math.imul(al2,bl4)|0,mid=mid+Math.imul(al2,bh4)|0,mid=mid+Math.imul(ah2,bl4)|0,hi=hi+Math.imul(ah2,bh4)|0,lo=lo+Math.imul(al1,bl5)|0,mid=mid+Math.imul(al1,bh5)|0,mid=mid+Math.imul(ah1,bl5)|0,hi=hi+Math.imul(ah1,bh5)|0,lo=lo+Math.imul(al0,bl6)|0,mid=mid+Math.imul(al0,bh6)|0,mid=mid+Math.imul(ah0,bl6)|0,hi=hi+Math.imul(ah0,bh6)|0;var w6=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w6>>>26)|0,w6&=67108863,lo=Math.imul(al7,bl0),mid=Math.imul(al7,bh0),mid=mid+Math.imul(ah7,bl0)|0,hi=Math.imul(ah7,bh0),lo=lo+Math.imul(al6,bl1)|0,mid=mid+Math.imul(al6,bh1)|0,mid=mid+Math.imul(ah6,bl1)|0,hi=hi+Math.imul(ah6,bh1)|0,lo=lo+Math.imul(al5,bl2)|0,mid=mid+Math.imul(al5,bh2)|0,mid=mid+Math.imul(ah5,bl2)|0,hi=hi+Math.imul(ah5,bh2)|0,lo=lo+Math.imul(al4,bl3)|0,mid=mid+Math.imul(al4,bh3)|0,mid=mid+Math.imul(ah4,bl3)|0,hi=hi+Math.imul(ah4,bh3)|0,lo=lo+Math.imul(al3,bl4)|0,mid=mid+Math.imul(al3,bh4)|0,mid=mid+Math.imul(ah3,bl4)|0,hi=hi+Math.imul(ah3,bh4)|0,lo=lo+Math.imul(al2,bl5)|0,mid=mid+Math.imul(al2,bh5)|0,mid=mid+Math.imul(ah2,bl5)|0,hi=hi+Math.imul(ah2,bh5)|0,lo=lo+Math.imul(al1,bl6)|0,mid=mid+Math.imul(al1,bh6)|0,mid=mid+Math.imul(ah1,bl6)|0,hi=hi+Math.imul(ah1,bh6)|0,lo=lo+Math.imul(al0,bl7)|0,mid=mid+Math.imul(al0,bh7)|0,mid=mid+Math.imul(ah0,bl7)|0,hi=hi+Math.imul(ah0,bh7)|0;var w7=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w7>>>26)|0,w7&=67108863,lo=Math.imul(al8,bl0),mid=Math.imul(al8,bh0),mid=mid+Math.imul(ah8,bl0)|0,hi=Math.imul(ah8,bh0),lo=lo+Math.imul(al7,bl1)|0,mid=mid+Math.imul(al7,bh1)|0,mid=mid+Math.imul(ah7,bl1)|0,hi=hi+Math.imul(ah7,bh1)|0,lo=lo+Math.imul(al6,bl2)|0,mid=mid+Math.imul(al6,bh2)|0,mid=mid+Math.imul(ah6,bl2)|0,hi=hi+Math.imul(ah6,bh2)|0,lo=lo+Math.imul(al5,bl3)|0,mid=mid+Math.imul(al5,bh3)|0,mid=mid+Math.imul(ah5,bl3)|0,hi=hi+Math.imul(ah5,bh3)|0,lo=lo+Math.imul(al4,bl4)|0,mid=mid+Math.imul(al4,bh4)|0,mid=mid+Math.imul(ah4,bl4)|0,hi=hi+Math.imul(ah4,bh4)|0,lo=lo+Math.imul(al3,bl5)|0,mid=mid+Math.imul(al3,bh5)|0,mid=mid+Math.imul(ah3,bl5)|0,hi=hi+Math.imul(ah3,bh5)|0,lo=lo+Math.imul(al2,bl6)|0,mid=mid+Math.imul(al2,bh6)|0,mid=mid+Math.imul(ah2,bl6)|0,hi=hi+Math.imul(ah2,bh6)|0,lo=lo+Math.imul(al1,bl7)|0,mid=mid+Math.imul(al1,bh7)|0,mid=mid+Math.imul(ah1,bl7)|0,hi=hi+Math.imul(ah1,bh7)|0,lo=lo+Math.imul(al0,bl8)|0,mid=mid+Math.imul(al0,bh8)|0,mid=mid+Math.imul(ah0,bl8)|0,hi=hi+Math.imul(ah0,bh8)|0;var w8=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w8>>>26)|0,w8&=67108863,lo=Math.imul(al9,bl0),mid=Math.imul(al9,bh0),mid=mid+Math.imul(ah9,bl0)|0,hi=Math.imul(ah9,bh0),lo=lo+Math.imul(al8,bl1)|0,mid=mid+Math.imul(al8,bh1)|0,mid=mid+Math.imul(ah8,bl1)|0,hi=hi+Math.imul(ah8,bh1)|0,lo=lo+Math.imul(al7,bl2)|0,mid=mid+Math.imul(al7,bh2)|0,mid=mid+Math.imul(ah7,bl2)|0,hi=hi+Math.imul(ah7,bh2)|0,lo=lo+Math.imul(al6,bl3)|0,mid=mid+Math.imul(al6,bh3)|0,mid=mid+Math.imul(ah6,bl3)|0,hi=hi+Math.imul(ah6,bh3)|0,lo=lo+Math.imul(al5,bl4)|0,mid=mid+Math.imul(al5,bh4)|0,mid=mid+Math.imul(ah5,bl4)|0,hi=hi+Math.imul(ah5,bh4)|0,lo=lo+Math.imul(al4,bl5)|0,mid=mid+Math.imul(al4,bh5)|0,mid=mid+Math.imul(ah4,bl5)|0,hi=hi+Math.imul(ah4,bh5)|0,lo=lo+Math.imul(al3,bl6)|0,mid=mid+Math.imul(al3,bh6)|0,mid=mid+Math.imul(ah3,bl6)|0,hi=hi+Math.imul(ah3,bh6)|0,lo=lo+Math.imul(al2,bl7)|0,mid=mid+Math.imul(al2,bh7)|0,mid=mid+Math.imul(ah2,bl7)|0,hi=hi+Math.imul(ah2,bh7)|0,lo=lo+Math.imul(al1,bl8)|0,mid=mid+Math.imul(al1,bh8)|0,mid=mid+Math.imul(ah1,bl8)|0,hi=hi+Math.imul(ah1,bh8)|0,lo=lo+Math.imul(al0,bl9)|0,mid=mid+Math.imul(al0,bh9)|0,mid=mid+Math.imul(ah0,bl9)|0,hi=hi+Math.imul(ah0,bh9)|0;var w9=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w9>>>26)|0,w9&=67108863,lo=Math.imul(al9,bl1),mid=Math.imul(al9,bh1),mid=mid+Math.imul(ah9,bl1)|0,hi=Math.imul(ah9,bh1),lo=lo+Math.imul(al8,bl2)|0,mid=mid+Math.imul(al8,bh2)|0,mid=mid+Math.imul(ah8,bl2)|0,hi=hi+Math.imul(ah8,bh2)|0,lo=lo+Math.imul(al7,bl3)|0,mid=mid+Math.imul(al7,bh3)|0,mid=mid+Math.imul(ah7,bl3)|0,hi=hi+Math.imul(ah7,bh3)|0,lo=lo+Math.imul(al6,bl4)|0,mid=mid+Math.imul(al6,bh4)|0,mid=mid+Math.imul(ah6,bl4)|0,hi=hi+Math.imul(ah6,bh4)|0,lo=lo+Math.imul(al5,bl5)|0,mid=mid+Math.imul(al5,bh5)|0,mid=mid+Math.imul(ah5,bl5)|0,hi=hi+Math.imul(ah5,bh5)|0,lo=lo+Math.imul(al4,bl6)|0,mid=mid+Math.imul(al4,bh6)|0,mid=mid+Math.imul(ah4,bl6)|0,hi=hi+Math.imul(ah4,bh6)|0,lo=lo+Math.imul(al3,bl7)|0,mid=mid+Math.imul(al3,bh7)|0,mid=mid+Math.imul(ah3,bl7)|0,hi=hi+Math.imul(ah3,bh7)|0,lo=lo+Math.imul(al2,bl8)|0,mid=mid+Math.imul(al2,bh8)|0,mid=mid+Math.imul(ah2,bl8)|0,hi=hi+Math.imul(ah2,bh8)|0,lo=lo+Math.imul(al1,bl9)|0,mid=mid+Math.imul(al1,bh9)|0,mid=mid+Math.imul(ah1,bl9)|0,hi=hi+Math.imul(ah1,bh9)|0;var w10=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w10>>>26)|0,w10&=67108863,lo=Math.imul(al9,bl2),mid=Math.imul(al9,bh2),mid=mid+Math.imul(ah9,bl2)|0,hi=Math.imul(ah9,bh2),lo=lo+Math.imul(al8,bl3)|0,mid=mid+Math.imul(al8,bh3)|0,mid=mid+Math.imul(ah8,bl3)|0,hi=hi+Math.imul(ah8,bh3)|0,lo=lo+Math.imul(al7,bl4)|0,mid=mid+Math.imul(al7,bh4)|0,mid=mid+Math.imul(ah7,bl4)|0,hi=hi+Math.imul(ah7,bh4)|0,lo=lo+Math.imul(al6,bl5)|0,mid=mid+Math.imul(al6,bh5)|0,mid=mid+Math.imul(ah6,bl5)|0,hi=hi+Math.imul(ah6,bh5)|0,lo=lo+Math.imul(al5,bl6)|0,mid=mid+Math.imul(al5,bh6)|0,mid=mid+Math.imul(ah5,bl6)|0,hi=hi+Math.imul(ah5,bh6)|0,lo=lo+Math.imul(al4,bl7)|0,mid=mid+Math.imul(al4,bh7)|0,mid=mid+Math.imul(ah4,bl7)|0,hi=hi+Math.imul(ah4,bh7)|0,lo=lo+Math.imul(al3,bl8)|0,mid=mid+Math.imul(al3,bh8)|0,mid=mid+Math.imul(ah3,bl8)|0,hi=hi+Math.imul(ah3,bh8)|0,lo=lo+Math.imul(al2,bl9)|0,mid=mid+Math.imul(al2,bh9)|0,mid=mid+Math.imul(ah2,bl9)|0,hi=hi+Math.imul(ah2,bh9)|0;var w11=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w11>>>26)|0,w11&=67108863,lo=Math.imul(al9,bl3),mid=Math.imul(al9,bh3),mid=mid+Math.imul(ah9,bl3)|0,hi=Math.imul(ah9,bh3),lo=lo+Math.imul(al8,bl4)|0,mid=mid+Math.imul(al8,bh4)|0,mid=mid+Math.imul(ah8,bl4)|0,hi=hi+Math.imul(ah8,bh4)|0,lo=lo+Math.imul(al7,bl5)|0,mid=mid+Math.imul(al7,bh5)|0,mid=mid+Math.imul(ah7,bl5)|0,hi=hi+Math.imul(ah7,bh5)|0,lo=lo+Math.imul(al6,bl6)|0,mid=mid+Math.imul(al6,bh6)|0,mid=mid+Math.imul(ah6,bl6)|0,hi=hi+Math.imul(ah6,bh6)|0,lo=lo+Math.imul(al5,bl7)|0,mid=mid+Math.imul(al5,bh7)|0,mid=mid+Math.imul(ah5,bl7)|0,hi=hi+Math.imul(ah5,bh7)|0,lo=lo+Math.imul(al4,bl8)|0,mid=mid+Math.imul(al4,bh8)|0,mid=mid+Math.imul(ah4,bl8)|0,hi=hi+Math.imul(ah4,bh8)|0,lo=lo+Math.imul(al3,bl9)|0,mid=mid+Math.imul(al3,bh9)|0,mid=mid+Math.imul(ah3,bl9)|0,hi=hi+Math.imul(ah3,bh9)|0;var w12=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w12>>>26)|0,w12&=67108863,lo=Math.imul(al9,bl4),mid=Math.imul(al9,bh4),mid=mid+Math.imul(ah9,bl4)|0,hi=Math.imul(ah9,bh4),lo=lo+Math.imul(al8,bl5)|0,mid=mid+Math.imul(al8,bh5)|0,mid=mid+Math.imul(ah8,bl5)|0,hi=hi+Math.imul(ah8,bh5)|0,lo=lo+Math.imul(al7,bl6)|0,mid=mid+Math.imul(al7,bh6)|0,mid=mid+Math.imul(ah7,bl6)|0,hi=hi+Math.imul(ah7,bh6)|0,lo=lo+Math.imul(al6,bl7)|0,mid=mid+Math.imul(al6,bh7)|0,mid=mid+Math.imul(ah6,bl7)|0,hi=hi+Math.imul(ah6,bh7)|0,lo=lo+Math.imul(al5,bl8)|0,mid=mid+Math.imul(al5,bh8)|0,mid=mid+Math.imul(ah5,bl8)|0,hi=hi+Math.imul(ah5,bh8)|0,lo=lo+Math.imul(al4,bl9)|0,mid=mid+Math.imul(al4,bh9)|0,mid=mid+Math.imul(ah4,bl9)|0,hi=hi+Math.imul(ah4,bh9)|0;var w13=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w13>>>26)|0,w13&=67108863,lo=Math.imul(al9,bl5),mid=Math.imul(al9,bh5),mid=mid+Math.imul(ah9,bl5)|0,hi=Math.imul(ah9,bh5),lo=lo+Math.imul(al8,bl6)|0,mid=mid+Math.imul(al8,bh6)|0,mid=mid+Math.imul(ah8,bl6)|0,hi=hi+Math.imul(ah8,bh6)|0,lo=lo+Math.imul(al7,bl7)|0,mid=mid+Math.imul(al7,bh7)|0,mid=mid+Math.imul(ah7,bl7)|0,hi=hi+Math.imul(ah7,bh7)|0,lo=lo+Math.imul(al6,bl8)|0,mid=mid+Math.imul(al6,bh8)|0,mid=mid+Math.imul(ah6,bl8)|0,hi=hi+Math.imul(ah6,bh8)|0,lo=lo+Math.imul(al5,bl9)|0,mid=mid+Math.imul(al5,bh9)|0,mid=mid+Math.imul(ah5,bl9)|0,hi=hi+Math.imul(ah5,bh9)|0;var w14=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w14>>>26)|0,w14&=67108863,lo=Math.imul(al9,bl6),mid=Math.imul(al9,bh6),mid=mid+Math.imul(ah9,bl6)|0,hi=Math.imul(ah9,bh6),lo=lo+Math.imul(al8,bl7)|0,mid=mid+Math.imul(al8,bh7)|0,mid=mid+Math.imul(ah8,bl7)|0,hi=hi+Math.imul(ah8,bh7)|0,lo=lo+Math.imul(al7,bl8)|0,mid=mid+Math.imul(al7,bh8)|0,mid=mid+Math.imul(ah7,bl8)|0,hi=hi+Math.imul(ah7,bh8)|0,lo=lo+Math.imul(al6,bl9)|0,mid=mid+Math.imul(al6,bh9)|0,mid=mid+Math.imul(ah6,bl9)|0,hi=hi+Math.imul(ah6,bh9)|0;var w15=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w15>>>26)|0,w15&=67108863,lo=Math.imul(al9,bl7),mid=Math.imul(al9,bh7),mid=mid+Math.imul(ah9,bl7)|0,hi=Math.imul(ah9,bh7),lo=lo+Math.imul(al8,bl8)|0,mid=mid+Math.imul(al8,bh8)|0,mid=mid+Math.imul(ah8,bl8)|0,hi=hi+Math.imul(ah8,bh8)|0,lo=lo+Math.imul(al7,bl9)|0,mid=mid+Math.imul(al7,bh9)|0,mid=mid+Math.imul(ah7,bl9)|0,hi=hi+Math.imul(ah7,bh9)|0;var w16=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w16>>>26)|0,w16&=67108863,lo=Math.imul(al9,bl8),mid=Math.imul(al9,bh8),mid=mid+Math.imul(ah9,bl8)|0,hi=Math.imul(ah9,bh8),lo=lo+Math.imul(al8,bl9)|0,mid=mid+Math.imul(al8,bh9)|0,mid=mid+Math.imul(ah8,bl9)|0,hi=hi+Math.imul(ah8,bh9)|0;var w17=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w17>>>26)|0,w17&=67108863,lo=Math.imul(al9,bl9),mid=Math.imul(al9,bh9),mid=mid+Math.imul(ah9,bl9)|0,hi=Math.imul(ah9,bh9);var w18=(c+lo|0)+((8191&mid)<<13)|0;return c=(hi+(mid>>>13)|0)+(w18>>>26)|0,w18&=67108863,o[0]=w0,o[1]=w1,o[2]=w2,o[3]=w3,o[4]=w4,o[5]=w5,o[6]=w6,o[7]=w7,o[8]=w8,o[9]=w9,o[10]=w10,o[11]=w11,o[12]=w12,o[13]=w13,o[14]=w14,o[15]=w15,o[16]=w16,o[17]=w17,o[18]=w18,0!==c&&(o[19]=c,out.length++),out};Math.imul||(comb10MulTo=smallMulTo),BN.prototype.mulTo=function(num,out){var len=this.length+num.length;return 10===this.length&&10===num.length?comb10MulTo(this,num,out):len<63?smallMulTo(this,num,out):len<1024?bigMulTo(this,num,out):jumboMulTo(this,num,out)},FFTM.prototype.makeRBT=function(N){for(var t=new Array(N),l=BN.prototype._countBits(N)-1,i=0;i>=1;return rb},FFTM.prototype.permute=function(rbt,rws,iws,rtws,itws,N){for(var i=0;i>>=1)i++;return 1<>>=13,rws[2*i+1]=8191&carry,carry>>>=13;for(i=2*len;i>=26,carry+=w/67108864|0,carry+=lo>>>26,this.words[i]=67108863&lo}return 0!==carry&&(this.words[i]=carry,this.length++),this},BN.prototype.muln=function(num){return this.clone().imuln(num)},BN.prototype.sqr=function(){return this.mul(this)},BN.prototype.isqr=function(){return this.imul(this.clone())},BN.prototype.pow=function(num){var w=toBitArray(num);if(0===w.length)return new BN(1);for(var res=this,i=0;i=0);var i,r=bits%26,s=(bits-r)/26,carryMask=67108863>>>26-r<<26-r;if(0!==r){var carry=0;for(i=0;i>>26-r}carry&&(this.words[i]=carry,this.length++)}if(0!==s){for(i=this.length-1;i>=0;i--)this.words[i+s]=this.words[i];for(i=0;i=0);var h;h=hint?(hint-hint%26)/26:0;var r=bits%26,s=Math.min((bits-r)/26,this.length),mask=67108863^67108863>>>r<s)for(this.length-=s,i=0;i=0&&(0!==carry||i>=h);i--){var word=0|this.words[i];this.words[i]=carry<<26-r|word>>>r,carry=word&mask}return maskedWords&&0!==carry&&(maskedWords.words[maskedWords.length++]=carry),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},BN.prototype.ishrn=function(bits,hint,extended){return assert(0===this.negative),this.iushrn(bits,hint,extended)},BN.prototype.shln=function(bits){return this.clone().ishln(bits)},BN.prototype.ushln=function(bits){return this.clone().iushln(bits)},BN.prototype.shrn=function(bits){return this.clone().ishrn(bits)},BN.prototype.ushrn=function(bits){return this.clone().iushrn(bits)},BN.prototype.testn=function(bit){assert("number"==typeof bit&&bit>=0);var r=bit%26,s=(bit-r)/26,q=1<=0);var r=bits%26,s=(bits-r)/26;if(assert(0===this.negative,"imaskn works only with positive numbers"),this.length<=s)return this;if(0!==r&&s++,this.length=Math.min(s,this.length),0!==r){var mask=67108863^67108863>>>r<=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},BN.prototype.isubn=function(num){if(assert("number"==typeof num),assert(num<67108864),num<0)return this.iaddn(-num);if(0!==this.negative)return this.negative=0,this.iaddn(num),this.negative=1,this;if(this.words[0]-=num,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var i=0;i>26)-(right/67108864|0),this.words[i+shift]=67108863&w}for(;i>26,this.words[i+shift]=67108863&w;if(0===carry)return this.strip();for(assert(carry===-1),carry=0,i=0;i>26,this.words[i]=67108863&w;return this.negative=1,this.strip()},BN.prototype._wordDiv=function(num,mode){var shift=this.length-num.length,a=this.clone(),b=num,bhi=0|b.words[b.length-1];0!==(shift=26-this._countBits(bhi))&&(b=b.ushln(shift),a.iushln(shift),bhi=0|b.words[b.length-1]);var q,m=a.length-b.length;if("mod"!==mode){q=new BN(null),q.length=m+1,q.words=new Array(q.length);for(var i=0;i=0;j--){var qj=67108864*(0|a.words[b.length+j])+(0|a.words[b.length+j-1]);for(qj=Math.min(qj/bhi|0,67108863),a._ishlnsubmul(b,qj,j);0!==a.negative;)qj--,a.negative=0,a._ishlnsubmul(b,1,j),a.isZero()||(a.negative^=1);q&&(q.words[j]=qj)}return q&&q.strip(),a.strip(),"div"!==mode&&0!==shift&&a.iushrn(shift),{div:q||null,mod:a}},BN.prototype.divmod=function(num,mode,positive){if(assert(!num.isZero()),this.isZero())return{div:new BN(0),mod:new BN(0)};var div,mod,res;return 0!==this.negative&&0===num.negative?(res=this.neg().divmod(num,mode),"mod"!==mode&&(div=res.div.neg()),"div"!==mode&&(mod=res.mod.neg(),positive&&0!==mod.negative&&mod.iadd(num)),{div:div,mod:mod}):0===this.negative&&0!==num.negative?(res=this.divmod(num.neg(),mode),"mod"!==mode&&(div=res.div.neg()),{div:div,mod:res.mod}):0!=(this.negative&num.negative)?(res=this.neg().divmod(num.neg(),mode),"div"!==mode&&(mod=res.mod.neg(),positive&&0!==mod.negative&&mod.isub(num)),{div:res.div,mod:mod}):num.length>this.length||this.cmp(num)<0?{div:new BN(0),mod:this}:1===num.length?"div"===mode?{div:this.divn(num.words[0]),mod:null}:"mod"===mode?{div:null,mod:new BN(this.modn(num.words[0]))}:{div:this.divn(num.words[0]),mod:new BN(this.modn(num.words[0]))}:this._wordDiv(num,mode)},BN.prototype.div=function(num){return this.divmod(num,"div",!1).div},BN.prototype.mod=function(num){return this.divmod(num,"mod",!1).mod},BN.prototype.umod=function(num){return this.divmod(num,"mod",!0).mod},BN.prototype.divRound=function(num){var dm=this.divmod(num);if(dm.mod.isZero())return dm.div;var mod=0!==dm.div.negative?dm.mod.isub(num):dm.mod,half=num.ushrn(1),r2=num.andln(1),cmp=mod.cmp(half);return cmp<0||1===r2&&0===cmp?dm.div:0!==dm.div.negative?dm.div.isubn(1):dm.div.iaddn(1)}, +BN.prototype.modn=function(num){assert(num<=67108863);for(var p=(1<<26)%num,acc=0,i=this.length-1;i>=0;i--)acc=(p*acc+(0|this.words[i]))%num;return acc},BN.prototype.idivn=function(num){assert(num<=67108863);for(var carry=0,i=this.length-1;i>=0;i--){var w=(0|this.words[i])+67108864*carry;this.words[i]=w/num|0,carry=w%num}return this.strip()},BN.prototype.divn=function(num){return this.clone().idivn(num)},BN.prototype.egcd=function(p){assert(0===p.negative),assert(!p.isZero());var x=this,y=p.clone();x=0!==x.negative?x.umod(p):x.clone();for(var A=new BN(1),B=new BN(0),C=new BN(0),D=new BN(1),g=0;x.isEven()&&y.isEven();)x.iushrn(1),y.iushrn(1),++g;for(var yp=y.clone(),xp=x.clone();!x.isZero();){for(var i=0,im=1;0==(x.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(x.iushrn(i);i-- >0;)(A.isOdd()||B.isOdd())&&(A.iadd(yp),B.isub(xp)),A.iushrn(1),B.iushrn(1);for(var j=0,jm=1;0==(y.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(y.iushrn(j);j-- >0;)(C.isOdd()||D.isOdd())&&(C.iadd(yp),D.isub(xp)),C.iushrn(1),D.iushrn(1);x.cmp(y)>=0?(x.isub(y),A.isub(C),B.isub(D)):(y.isub(x),C.isub(A),D.isub(B))}return{a:C,b:D,gcd:y.iushln(g)}},BN.prototype._invmp=function(p){assert(0===p.negative),assert(!p.isZero());var a=this,b=p.clone();a=0!==a.negative?a.umod(p):a.clone();for(var x1=new BN(1),x2=new BN(0),delta=b.clone();a.cmpn(1)>0&&b.cmpn(1)>0;){for(var i=0,im=1;0==(a.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(a.iushrn(i);i-- >0;)x1.isOdd()&&x1.iadd(delta),x1.iushrn(1);for(var j=0,jm=1;0==(b.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(b.iushrn(j);j-- >0;)x2.isOdd()&&x2.iadd(delta),x2.iushrn(1);a.cmp(b)>=0?(a.isub(b),x1.isub(x2)):(b.isub(a),x2.isub(x1))}var res;return res=0===a.cmpn(1)?x1:x2,res.cmpn(0)<0&&res.iadd(p),res},BN.prototype.gcd=function(num){if(this.isZero())return num.abs();if(num.isZero())return this.abs();var a=this.clone(),b=num.clone();a.negative=0,b.negative=0;for(var shift=0;a.isEven()&&b.isEven();shift++)a.iushrn(1),b.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;b.isEven();)b.iushrn(1);var r=a.cmp(b);if(r<0){var t=a;a=b,b=t}else if(0===r||0===b.cmpn(1))break;a.isub(b)}return b.iushln(shift)},BN.prototype.invm=function(num){return this.egcd(num).a.umod(num)},BN.prototype.isEven=function(){return 0==(1&this.words[0])},BN.prototype.isOdd=function(){return 1==(1&this.words[0])},BN.prototype.andln=function(num){return this.words[0]&num},BN.prototype.bincn=function(bit){assert("number"==typeof bit);var r=bit%26,s=(bit-r)/26,q=1<>>26,w&=67108863,this.words[i]=w}return 0!==carry&&(this.words[i]=carry,this.length++),this},BN.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},BN.prototype.cmpn=function(num){var negative=num<0;if(0!==this.negative&&!negative)return-1;if(0===this.negative&&negative)return 1;this.strip();var res;if(this.length>1)res=1;else{negative&&(num=-num),assert(num<=67108863,"Number is too big");var w=0|this.words[0];res=w===num?0:wnum.length)return 1;if(this.length=0;i--){var a=0|this.words[i],b=0|num.words[i];if(a!==b){ab&&(res=1);break}}return res},BN.prototype.gtn=function(num){return 1===this.cmpn(num)},BN.prototype.gt=function(num){return 1===this.cmp(num)},BN.prototype.gten=function(num){return this.cmpn(num)>=0},BN.prototype.gte=function(num){return this.cmp(num)>=0},BN.prototype.ltn=function(num){return this.cmpn(num)===-1},BN.prototype.lt=function(num){return this.cmp(num)===-1},BN.prototype.lten=function(num){return this.cmpn(num)<=0},BN.prototype.lte=function(num){return this.cmp(num)<=0},BN.prototype.eqn=function(num){return 0===this.cmpn(num)},BN.prototype.eq=function(num){return 0===this.cmp(num)},BN.red=function(num){return new Red(num)},BN.prototype.toRed=function(ctx){return assert(!this.red,"Already a number in reduction context"),assert(0===this.negative,"red works only with positives"),ctx.convertTo(this)._forceRed(ctx)},BN.prototype.fromRed=function(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function(ctx){return this.red=ctx,this},BN.prototype.forceRed=function(ctx){return assert(!this.red,"Already a number in reduction context"),this._forceRed(ctx)},BN.prototype.redAdd=function(num){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,num)},BN.prototype.redIAdd=function(num){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,num)},BN.prototype.redSub=function(num){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,num)},BN.prototype.redISub=function(num){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,num)},BN.prototype.redShl=function(num){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,num)},BN.prototype.redMul=function(num){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,num),this.red.mul(this,num)},BN.prototype.redIMul=function(num){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,num),this.red.imul(this,num)},BN.prototype.redSqr=function(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function(num){return assert(this.red&&!num.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,num)};var primes={k256:null,p224:null,p192:null,p25519:null};MPrime.prototype._tmp=function(){var tmp=new BN(null);return tmp.words=new Array(Math.ceil(this.n/13)),tmp},MPrime.prototype.ireduce=function(num){var rlen,r=num;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),rlen=r.bitLength()}while(rlen>this.n);var cmp=rlen0?r.isub(this.p):r.strip(),r},MPrime.prototype.split=function(input,out){input.iushrn(this.n,0,out)},MPrime.prototype.imulK=function(num){return num.imul(this.k)},inherits(K256,MPrime),K256.prototype.split=function(input,output){for(var outLen=Math.min(input.length,9),i=0;i>>22,prev=next}prev>>>=22,input.words[i-10]=prev,0===prev&&input.length>10?input.length-=10:input.length-=9},K256.prototype.imulK=function(num){num.words[num.length]=0,num.words[num.length+1]=0,num.length+=2;for(var lo=0,i=0;i>>=26,num.words[i]=lo,carry=hi}return 0!==carry&&(num.words[num.length++]=carry),num},BN._prime=function prime(name){if(primes[name])return primes[name];var prime;if("k256"===name)prime=new K256;else if("p224"===name)prime=new P224;else if("p192"===name)prime=new P192;else{if("p25519"!==name)throw new Error("Unknown prime "+name);prime=new P25519}return primes[name]=prime,prime},Red.prototype._verify1=function(a){assert(0===a.negative,"red works only with positives"),assert(a.red,"red works only with red numbers")},Red.prototype._verify2=function(a,b){assert(0==(a.negative|b.negative),"red works only with positives"),assert(a.red&&a.red===b.red,"red works only with red numbers")},Red.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this)},Red.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},Red.prototype.add=function(a,b){this._verify2(a,b);var res=a.add(b);return res.cmp(this.m)>=0&&res.isub(this.m),res._forceRed(this)},Red.prototype.iadd=function(a,b){this._verify2(a,b);var res=a.iadd(b);return res.cmp(this.m)>=0&&res.isub(this.m),res},Red.prototype.sub=function(a,b){this._verify2(a,b);var res=a.sub(b);return res.cmpn(0)<0&&res.iadd(this.m),res._forceRed(this)},Red.prototype.isub=function(a,b){this._verify2(a,b);var res=a.isub(b);return res.cmpn(0)<0&&res.iadd(this.m),res},Red.prototype.shl=function(a,num){return this._verify1(a),this.imod(a.ushln(num))},Red.prototype.imul=function(a,b){return this._verify2(a,b),this.imod(a.imul(b))},Red.prototype.mul=function(a,b){return this._verify2(a,b),this.imod(a.mul(b))},Red.prototype.isqr=function(a){return this.imul(a,a.clone())},Red.prototype.sqr=function(a){return this.mul(a,a)},Red.prototype.sqrt=function(a){if(a.isZero())return a.clone();var mod3=this.m.andln(3);if(assert(mod3%2==1),3===mod3){var pow=this.m.add(new BN(1)).iushrn(2);return this.pow(a,pow)}for(var q=this.m.subn(1),s=0;!q.isZero()&&0===q.andln(1);)s++,q.iushrn(1);assert(!q.isZero());var one=new BN(1).toRed(this),nOne=one.redNeg(),lpow=this.m.subn(1).iushrn(1),z=this.m.bitLength();for(z=new BN(2*z*z).toRed(this);0!==this.pow(z,lpow).cmp(nOne);)z.redIAdd(nOne);for(var c=this.pow(z,q),r=this.pow(a,q.addn(1).iushrn(1)),t=this.pow(a,q),m=s;0!==t.cmp(one);){for(var tmp=t,i=0;0!==tmp.cmp(one);i++)tmp=tmp.redSqr();assert(i=0;i--){for(var word=num.words[i],j=start-1;j>=0;j--){var bit=word>>j&1;res!==wnd[0]&&(res=this.sqr(res)),0!==bit||0!==current?(current<<=1,current|=bit,(4===++currentLen||0===i&&0===j)&&(res=this.mul(res,wnd[current]),currentLen=0,current=0)):currentLen=0}start=26}return res},Red.prototype.convertTo=function(num){var r=num.umod(this.m);return r===num?r.clone():r},Red.prototype.convertFrom=function(num){var res=num.clone();return res.red=null,res},BN.mont=function(num){return new Mont(num)},inherits(Mont,Red),Mont.prototype.convertTo=function(num){return this.imod(num.ushln(this.shift))},Mont.prototype.convertFrom=function(num){var r=this.imod(num.mul(this.rinv));return r.red=null,r},Mont.prototype.imul=function(a,b){if(a.isZero()||b.isZero())return a.words[0]=0,a.length=1,a;var t=a.imul(b),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=t.isub(c).iushrn(this.shift),res=u;return u.cmp(this.m)>=0?res=u.isub(this.m):u.cmpn(0)<0&&(res=u.iadd(this.m)),res._forceRed(this)},Mont.prototype.mul=function(a,b){if(a.isZero()||b.isZero())return new BN(0)._forceRed(this);var t=a.mul(b),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=t.isub(c).iushrn(this.shift),res=u;return u.cmp(this.m)>=0?res=u.isub(this.m):u.cmpn(0)<0&&(res=u.iadd(this.m)),res._forceRed(this)},Mont.prototype.invm=function(a){return this.imod(a._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===module||module,this)}).call(exports,__webpack_require__(18)(module))},function(module,exports,__webpack_require__){module.exports={encode:__webpack_require__(679),decode:__webpack_require__(678),encodingLength:__webpack_require__(680)}},function(module,exports,__webpack_require__){"use strict";const Key=__webpack_require__(191),MemoryDatastore=__webpack_require__(386),utils=__webpack_require__(115);exports.Key=Key,exports.MemoryDatastore=MemoryDatastore,exports.utils=utils},function(module,exports,__webpack_require__){var createCallback=function(method,context){return function(){var args=Array.prototype.slice.call(arguments),lastIndex=args.length-1,lastArg=args&&args.length>0?args[lastIndex]:null;return("function"==typeof lastArg?lastArg:null)?method.apply(context,args):new Promise(function(resolve,reject){args.push(function(err,val){if(err)return reject(err);resolve(val)}),method.apply(context,args)})}};module.exports=function(methods,options){options=options||{};var type=Object.prototype.toString.call(methods);if("[object Object]"===type||"[object Array]"===type){var obj=options.replace?methods:{};for(var key in methods)methods.hasOwnProperty(key)&&(obj[key]=createCallback(methods[key]));return obj}return createCallback(methods,options.context||methods)}},function(module,exports){module.exports=function(module){return module.webpackPolyfill||(module.deprecate=function(){},module.paths=[],module.children||(module.children=[]),Object.defineProperty(module,"loaded",{enumerable:!0,get:function(){return module.l}}),Object.defineProperty(module,"id",{enumerable:!0,get:function(){return module.i}}),module.webpackPolyfill=1),module}},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function eachLimit(coll,iteratee,callback){(0,_eachOf2.default)(coll,(0,_withoutIndex2.default)((0,_wrapAsync2.default)(iteratee)),callback)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=eachLimit;var _eachOf=__webpack_require__(101),_eachOf2=_interopRequireDefault(_eachOf),_withoutIndex=__webpack_require__(159),_withoutIndex2=_interopRequireDefault(_withoutIndex),_wrapAsync=__webpack_require__(13),_wrapAsync2=_interopRequireDefault(_wrapAsync);module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";var elliptic=exports;elliptic.version=__webpack_require__(453).version,elliptic.utils=__webpack_require__(352),elliptic.rand=__webpack_require__(315),elliptic.curve=__webpack_require__(82),elliptic.curves=__webpack_require__(344),elliptic.ec=__webpack_require__(345),elliptic.eddsa=__webpack_require__(348)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function Multihashing(buf,func,length,callback){if("function"==typeof length&&(callback=length,length=void 0),!callback)throw new Error("Missing callback");Multihashing.digest(buf,func,length,(err,digest)=>{if(err)return callback(err);callback(null,multihash.encode(digest,func,length))})}const multihash=__webpack_require__(12),crypto=__webpack_require__(570);module.exports=Multihashing,Multihashing.Buffer=Buffer,Multihashing.multihash=multihash,Multihashing.digest=function(buf,func,length,callback){if("function"==typeof length&&(callback=length,length=void 0),!callback)throw new Error("Missing callback");let cb=callback;length&&(cb=((err,digest)=>{if(err)return callback(err);callback(null,digest.slice(0,length))}));let hash;try{hash=Multihashing.createHash(func)}catch(err){return cb(err)}hash(buf,cb)},Multihashing.createHash=function(func){if(func=multihash.coerceCode(func),!Multihashing.functions[func])throw new Error("multihash function "+func+" not yet supported");return Multihashing.functions[func]},Multihashing.functions={17:crypto.sha1,18:crypto.sha2256,19:crypto.sha2512,20:crypto.sha3512,21:crypto.sha3384,22:crypto.sha3256,23:crypto.sha3224,24:crypto.shake128,25:crypto.shake256,26:crypto.keccak224,27:crypto.keccak256,28:crypto.keccak384,29:crypto.keccak512,34:crypto.murmur3128,35:crypto.murmur332},crypto.addBlake(Multihashing.functions)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function toB64Opt(val){if(val)return val.toString("base64")}const mh=__webpack_require__(12),crypto=__webpack_require__(63),assert=__webpack_require__(9),waterfall=__webpack_require__(7),Buffer=__webpack_require__(6).Buffer;class PeerId{constructor(id,privKey,pubKey){assert(Buffer.isBuffer(id),"invalid id provided"),privKey&&pubKey&&assert(privKey.public.bytes.equals(pubKey.bytes),"inconsistent arguments"),this._id=id,this._idB58String=mh.toB58String(this.id),this._privKey=privKey,this._pubKey=pubKey}get id(){return this._id}set id(val){throw new Error("Id is immutable")}get privKey(){return this._privKey}set privKey(privKey){this._privKey=privKey}get pubKey(){return this._pubKey?this._pubKey:this._privKey?this._privKey.public:void 0}set pubKey(pubKey){this._pubKey=pubKey}marshalPubKey(){if(this.pubKey)return crypto.keys.marshalPublicKey(this.pubKey)}marshalPrivKey(){if(this.privKey)return crypto.keys.marshalPrivateKey(this.privKey)}toPrint(){return this.toJSON()}toJSON(){return{id:this.toB58String(),privKey:toB64Opt(this.marshalPrivKey()),pubKey:toB64Opt(this.marshalPubKey())}}toHexString(){return mh.toHexString(this.id)}toBytes(){return this.id}toB58String(){return this._idB58String}isEqual(id){if(Buffer.isBuffer(id))return this.id.equals(id);if(id.id)return this.id.equals(id.id);throw new Error("not valid Id")}isValid(callback){this.privKey&&this.privKey.public&&this.privKey.public.bytes&&Buffer.isBuffer(this.pubKey.bytes)&&this.privKey.public.bytes.equals(this.pubKey.bytes)?callback():callback(new Error("Keys not match"))}}exports=module.exports=PeerId,exports.create=function(opts,callback){"function"==typeof opts&&(callback=opts,opts={}),opts=opts||{},opts.bits=opts.bits||2048,waterfall([cb=>crypto.keys.generateKeyPair("RSA",opts.bits,cb),(privKey,cb)=>privKey.public.hash((err,digest)=>{cb(err,digest,privKey)})],(err,digest,privKey)=>{if(err)return callback(err);callback(null,new PeerId(digest,privKey))})},exports.createFromHexString=function(str){return new PeerId(mh.fromHexString(str))},exports.createFromBytes=function(buf){return new PeerId(buf)},exports.createFromB58String=function(str){return new PeerId(mh.fromB58String(str))},exports.createFromPubKey=function(key,callback){if("function"!=typeof callback)throw new Error("callback is required");let buf=key;"string"==typeof buf&&(buf=Buffer.from(key,"base64"));const pubKey=crypto.keys.unmarshalPublicKey(buf);pubKey.hash((err,digest)=>{if(err)return callback(err);callback(null,new PeerId(digest,null,pubKey))})},exports.createFromPrivKey=function(key,callback){let buf=key;if("string"==typeof buf&&(buf=Buffer.from(key,"base64")),"function"!=typeof callback)throw new Error("callback is required");waterfall([cb=>crypto.keys.unmarshalPrivateKey(buf,cb),(privKey,cb)=>privKey.public.hash((err,digest)=>{cb(err,digest,privKey)})],(err,digest,privKey)=>{if(err)return callback(err);callback(null,new PeerId(digest,privKey))})},exports.createFromJSON=function(obj,callback){if("function"!=typeof callback)throw new Error("callback is required");const id=mh.fromB58String(obj.id),rawPrivKey=obj.privKey&&Buffer.from(obj.privKey,"base64"),rawPubKey=obj.pubKey&&Buffer.from(obj.pubKey,"base64"),pub=rawPubKey&&crypto.keys.unmarshalPublicKey(rawPubKey);rawPrivKey?waterfall([cb=>crypto.keys.unmarshalPrivateKey(rawPrivKey,cb),(priv,cb)=>priv.public.hash((err,digest)=>{cb(err,digest,priv)}),(privDigest,priv,cb)=>{pub?pub.hash((err,pubDigest)=>{cb(err,privDigest,priv,pubDigest)}):cb(null,privDigest,priv)}],(err,privDigest,priv,pubDigest)=>{return err?callback(err):pub&&!privDigest.equals(pubDigest)?callback(new Error("Public and private key do not match")):id&&!privDigest.equals(id)?callback(new Error("Id and private key do not match")):void callback(null,new PeerId(id,priv,pub))}):callback(null,new PeerId(id,null,pub))},exports.isPeerId=function(peerId){return Boolean("object"==typeof peerId&&peerId._id&&peerId._idB58String)}},function(module,exports,__webpack_require__){"use strict";const encode=__webpack_require__(598),d=__webpack_require__(597);exports.encode=encode,exports.decode=d.decode,exports.decodeFromReader=d.decodeFromReader},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function Multiaddr(addr){if(!(this instanceof Multiaddr))return new Multiaddr(addr);if((addr=addr||"")instanceof Buffer)this.buffer=codec.fromBuffer(addr);else if("string"==typeof addr||addr instanceof String)this.buffer=codec.fromString(addr);else{if(!(addr.buffer&&addr.protos&&addr.protoCodes))throw new Error("addr must be a string, Buffer, or another Multiaddr");this.buffer=codec.fromBuffer(addr.buffer)}}const map=__webpack_require__(128),extend=__webpack_require__(38),codec=__webpack_require__(562),protocols=__webpack_require__(133),varint=__webpack_require__(15),bs58=__webpack_require__(79),NotImplemented=new Error("Sorry, Not Implemented Yet.");exports=module.exports=Multiaddr,Multiaddr.prototype.toString=function(){return codec.bufferToString(this.buffer)},Multiaddr.prototype.toOptions=function(){const opts={},parsed=this.toString().split("/");return opts.family="ip4"===parsed[1]?"ipv4":"ipv6",opts.host=parsed[2],opts.transport=parsed[3],opts.port=parsed[4],opts},Multiaddr.prototype.inspect=function(){return""},Multiaddr.prototype.protos=function(){return map(this.protoCodes(),function(code){return extend(protocols(code))})},Multiaddr.prototype.protoCodes=function(){const codes=[],buf=this.buffer;let i=0;for(;i{if(tuple[0]===protocols.names.ipfs.code)return!0})[0][1],bs58.decode(b58str)}catch(e){b58str=null}return b58str},Multiaddr.prototype.equals=function(addr){return this.buffer.equals(addr.buffer)},Multiaddr.prototype.nodeAddress=function(){if(!this.isThinWaistAddress())throw new Error('Multiaddr must be "thin waist" address for nodeAddress.');const codes=this.protoCodes(),parts=this.toString().split("/").slice(1);return{family:41===codes[0]?"IPv6":"IPv4",address:parts[1],port:parts[3]}},Multiaddr.fromNodeAddress=function(addr,transport){if(!addr)throw new Error("requires node address object");if(!transport)throw new Error("requires transport protocol");return Multiaddr("/"+["IPv6"===addr.family?"ip6":"ip4",addr.address,transport,addr.port].join("/"))},Multiaddr.prototype.isThinWaistAddress=function(addr){const protos=(addr||this).protos();return 2===protos.length&&((4===protos[0].code||41===protos[0].code)&&(6===protos[1].code||17===protos[1].code))},Multiaddr.prototype.fromStupidString=function(str){throw NotImplemented},Multiaddr.protocols=protocols,Multiaddr.isMultiaddr=function(addr){return addr.constructor&&addr.constructor.name?"Multiaddr"===addr.constructor.name:Boolean(addr.fromStupidString&&addr.protos)},Multiaddr.isName=function(addr){return!!Multiaddr.isMultiaddr(addr)&&addr.protos().some(proto=>proto.resolvable)},Multiaddr.resolve=function(addr,callback){return callback(Multiaddr.isMultiaddr(addr)&&Multiaddr.isName(addr)?new Error("not implemented yet"):new Error("not a valid name"))}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function Stream(){EE.call(this)}module.exports=Stream;var EE=__webpack_require__(11).EventEmitter;__webpack_require__(1)(Stream,EE),Stream.Readable=__webpack_require__(36),Stream.Writable=__webpack_require__(642),Stream.Duplex=__webpack_require__(637),Stream.Transform=__webpack_require__(641),Stream.PassThrough=__webpack_require__(640),Stream.Stream=Stream,Stream.prototype.pipe=function(dest,options){function ondata(chunk){dest.writable&&!1===dest.write(chunk)&&source.pause&&source.pause()}function ondrain(){source.readable&&source.resume&&source.resume()}function onend(){didOnEnd||(didOnEnd=!0,dest.end())}function onclose(){didOnEnd||(didOnEnd=!0,"function"==typeof dest.destroy&&dest.destroy())}function onerror(er){if(cleanup(),0===EE.listenerCount(this,"error"))throw er}function cleanup(){source.removeListener("data",ondata),dest.removeListener("drain",ondrain),source.removeListener("end",onend),source.removeListener("close",onclose),source.removeListener("error",onerror),dest.removeListener("error",onerror),source.removeListener("end",cleanup),source.removeListener("close",cleanup),dest.removeListener("close",cleanup)}var source=this;source.on("data",ondata),dest.on("drain",ondrain),dest._isStdio||options&&options.end===!1||(source.on("end",onend),source.on("close",onclose));var didOnEnd=!1;return source.on("error",onerror),dest.on("error",onerror),source.on("end",cleanup),source.on("close",cleanup),dest.on("close",cleanup),dest.emit("pipe",source),dest}},function(module,exports,__webpack_require__){(function(Buffer){function isArray(arg){return Array.isArray?Array.isArray(arg):"[object Array]"===objectToString(arg)}function isBoolean(arg){return"boolean"==typeof arg}function isNull(arg){return null===arg}function isNullOrUndefined(arg){return null==arg}function isNumber(arg){return"number"==typeof arg}function isString(arg){return"string"==typeof arg}function isSymbol(arg){return"symbol"==typeof arg}function isUndefined(arg){return void 0===arg}function isRegExp(re){return"[object RegExp]"===objectToString(re)}function isObject(arg){return"object"==typeof arg&&null!==arg}function isDate(d){return"[object Date]"===objectToString(d)}function isError(e){return"[object Error]"===objectToString(e)||e instanceof Error}function isFunction(arg){return"function"==typeof arg}function isPrimitive(arg){return null===arg||"boolean"==typeof arg||"number"==typeof arg||"string"==typeof arg||"symbol"==typeof arg||void 0===arg}function objectToString(o){return Object.prototype.toString.call(o)}exports.isArray=isArray,exports.isBoolean=isBoolean,exports.isNull=isNull,exports.isNullOrUndefined=isNullOrUndefined,exports.isNumber=isNumber,exports.isString=isString,exports.isSymbol=isSymbol,exports.isUndefined=isUndefined,exports.isRegExp=isRegExp,exports.isObject=isObject,exports.isDate=isDate,exports.isError=isError,exports.isFunction=isFunction,exports.isPrimitive=isPrimitive,exports.isBuffer=Buffer.isBuffer}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function toArray(msg,enc){if(Array.isArray(msg))return msg.slice();if(!msg)return[];var res=[];if("string"==typeof msg)if(enc){if("hex"===enc)for(msg=msg.replace(/[^a-z0-9]+/gi,""),msg.length%2!=0&&(msg="0"+msg),i=0;i>8,lo=255&c;hi?res.push(hi,lo):res.push(lo)}else for(i=0;i>>24|w>>>8&65280|w<<8&16711680|(255&w)<<24)>>>0}function toHex32(msg,endian){for(var res="",i=0;i>>0}return res}function split32(msg,endian){for(var res=new Array(4*msg.length),i=0,k=0;i>>24,res[k+1]=m>>>16&255,res[k+2]=m>>>8&255,res[k+3]=255&m):(res[k+3]=m>>>24,res[k+2]=m>>>16&255,res[k+1]=m>>>8&255,res[k]=255&m)}return res}function rotr32(w,b){return w>>>b|w<<32-b}function rotl32(w,b){return w<>>32-b}function sum32(a,b){return a+b>>>0}function sum32_3(a,b,c){return a+b+c>>>0}function sum32_4(a,b,c,d){return a+b+c+d>>>0}function sum32_5(a,b,c,d,e){return a+b+c+d+e>>>0}function sum64(buf,pos,ah,al){var bh=buf[pos],bl=buf[pos+1],lo=al+bl>>>0,hi=(lo>>0,buf[pos+1]=lo}function sum64_hi(ah,al,bh,bl){return(al+bl>>>0>>0}function sum64_lo(ah,al,bh,bl){return al+bl>>>0}function sum64_4_hi(ah,al,bh,bl,ch,cl,dh,dl){var carry=0,lo=al;return lo=lo+bl>>>0,carry+=lo>>0,carry+=lo>>0,carry+=lo>>0}function sum64_4_lo(ah,al,bh,bl,ch,cl,dh,dl){return al+bl+cl+dl>>>0}function sum64_5_hi(ah,al,bh,bl,ch,cl,dh,dl,eh,el){var carry=0,lo=al;return lo=lo+bl>>>0,carry+=lo>>0,carry+=lo>>0,carry+=lo>>0,carry+=lo>>0}function sum64_5_lo(ah,al,bh,bl,ch,cl,dh,dl,eh,el){return al+bl+cl+dl+el>>>0}function rotr64_hi(ah,al,num){return(al<<32-num|ah>>>num)>>>0}function rotr64_lo(ah,al,num){return(ah<<32-num|al>>>num)>>>0}function shr64_hi(ah,al,num){return ah>>>num}function shr64_lo(ah,al,num){return(ah<<32-num|al>>>num)>>>0}var assert=__webpack_require__(34),inherits=__webpack_require__(1);exports.inherits=inherits,exports.toArray=toArray,exports.toHex=toHex,exports.htonl=htonl,exports.toHex32=toHex32,exports.zero2=zero2,exports.zero8=zero8,exports.join32=join32,exports.split32=split32,exports.rotr32=rotr32,exports.rotl32=rotl32,exports.sum32=sum32,exports.sum32_3=sum32_3,exports.sum32_4=sum32_4,exports.sum32_5=sum32_5,exports.sum64=sum64,exports.sum64_hi=sum64_hi,exports.sum64_lo=sum64_lo,exports.sum64_4_hi=sum64_4_hi,exports.sum64_4_lo=sum64_4_lo,exports.sum64_5_hi=sum64_5_hi,exports.sum64_5_lo=sum64_5_lo,exports.rotr64_hi=rotr64_hi,exports.rotr64_lo=rotr64_lo,exports.shr64_hi=shr64_hi,exports.shr64_lo=shr64_lo},function(module,exports,__webpack_require__){"use strict";exports.Connection=__webpack_require__(385)},function(module,exports){function noop(){}module.exports=noop},function(module,exports){function pullPushable(separated,onClose){function read(_abort,_cb){_abort&&(abort=_abort,cb&&callback(abort)),cb=_cb,drain()}function end(end){ended=ended||end||!0,drain()}function push(data){if(!ended){if(cb)return void callback(abort,data);buffer.push(data),drain()}}function drain(){cb&&(abort?callback(abort):!buffer.length&&ended?callback(ended):buffer.length&&callback(null,buffer.shift()))}function callback(err,val){var _cb=cb;if(err&&onClose){var c=onClose;onClose=null,c(err===!0?null:err)}cb=null,_cb(err,val)}"function"==typeof separated&&(onClose=separated, +separated=!1);var abort,cb,ended,buffer=[];return separated?{push:push,end:end,source:read}:(read.push=push,read.end=end,read)}module.exports=pullPushable},function(module,exports,__webpack_require__){(function(Buffer){var schema=__webpack_require__(587),compile=__webpack_require__(591),flatten=function(values){if(!values)return null;var result={};return Object.keys(values).forEach(function(k){result[k]=values[k].value}),result};module.exports=function(proto,opts){if(opts||(opts={}),!proto)throw new Error("Pass in a .proto string or a protobuf-schema parsed object");var sch="object"!=typeof proto||Buffer.isBuffer(proto)?schema.parse(proto):proto,Messages=function(){var self=this;compile(sch,opts.encodings||{}).forEach(function(m){self[m.name]=flatten(m.values)||m})};return Messages.prototype.toString=function(){return schema.stringify(sch)},Messages.prototype.toJSON=function(){return sch},new Messages}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(global,process){function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(ctx.depth=arguments[2]),arguments.length>=4&&(ctx.colors=arguments[3]),isBoolean(opts)?ctx.showHidden=opts:opts&&exports._extend(ctx,opts),isUndefined(ctx.showHidden)&&(ctx.showHidden=!1),isUndefined(ctx.depth)&&(ctx.depth=2),isUndefined(ctx.colors)&&(ctx.colors=!1),isUndefined(ctx.customInspect)&&(ctx.customInspect=!0),ctx.colors&&(ctx.stylize=stylizeWithColor),formatValue(ctx,obj,ctx.depth)}function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];return style?"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m":str}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};return array.forEach(function(val,idx){hash[val]=!0}),hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&(!value.constructor||value.constructor.prototype!==value)){var ret=value.inspect(recurseTimes,ctx);return isString(ret)||(ret=formatValue(ctx,ret,recurseTimes)),ret}var primitive=formatPrimitive(ctx,value);if(primitive)return primitive;var keys=Object.keys(value),visibleKeys=arrayToHash(keys);if(ctx.showHidden&&(keys=Object.getOwnPropertyNames(value)),isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0))return formatError(value);if(0===keys.length){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value))return ctx.stylize(RegExp.prototype.toString.call(value),"regexp");if(isDate(value))return ctx.stylize(Date.prototype.toString.call(value),"date");if(isError(value))return formatError(value)}var base="",array=!1,braces=["{","}"];if(isArray(value)&&(array=!0,braces=["[","]"]),isFunction(value)){base=" [Function"+(value.name?": "+value.name:"")+"]"}if(isRegExp(value)&&(base=" "+RegExp.prototype.toString.call(value)),isDate(value)&&(base=" "+Date.prototype.toUTCString.call(value)),isError(value)&&(base=" "+formatError(value)),0===keys.length&&(!array||0==value.length))return braces[0]+base+braces[1];if(recurseTimes<0)return isRegExp(value)?ctx.stylize(RegExp.prototype.toString.call(value),"regexp"):ctx.stylize("[Object]","special");ctx.seen.push(value);var output;return output=array?formatArray(ctx,value,recurseTimes,visibleKeys,keys):keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)}),ctx.seen.pop(),reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}return isNumber(value)?ctx.stylize(""+value,"number"):isBoolean(value)?ctx.stylize(""+value,"boolean"):isNull(value)?ctx.stylize("null","null"):void 0}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){for(var output=[],i=0,l=value.length;i-1&&(str=array?str.split("\n").map(function(line){return" "+line}).join("\n").substr(2):"\n"+str.split("\n").map(function(line){return" "+line}).join("\n"))):str=ctx.stylize("[Circular]","special")),isUndefined(name)){if(array&&key.match(/^\d+$/))return str;name=JSON.stringify(""+key),name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(name=name.substr(1,name.length-2),name=ctx.stylize(name,"name")):(name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),name=ctx.stylize(name,"string"))}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;return output.reduce(function(prev,cur){return numLinesEst++,cur.indexOf("\n")>=0&&numLinesEst++,prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?braces[0]+(""===base?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]:braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}function isBoolean(arg){return"boolean"==typeof arg}function isNull(arg){return null===arg}function isNullOrUndefined(arg){return null==arg}function isNumber(arg){return"number"==typeof arg}function isString(arg){return"string"==typeof arg}function isSymbol(arg){return"symbol"==typeof arg}function isUndefined(arg){return void 0===arg}function isRegExp(re){return isObject(re)&&"[object RegExp]"===objectToString(re)}function isObject(arg){return"object"==typeof arg&&null!==arg}function isDate(d){return isObject(d)&&"[object Date]"===objectToString(d)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(arg){return"function"==typeof arg}function isPrimitive(arg){return null===arg||"boolean"==typeof arg||"number"==typeof arg||"string"==typeof arg||"symbol"==typeof arg||void 0===arg}function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}function timestamp(){var d=new Date,time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}exports.format=function(f){if(!isString(f)){for(var objects=[],i=0;i=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}}),x=args[i];i{if("function"==typeof id)return callback=id,id=null,void Id.create((err,id)=>{if(err)return callback(err);callback(null,new PeerInfo(id))});callback(null,new PeerInfo(id))}),PeerInfo.isPeerInfo=(peerInfo=>{return Boolean("object"==typeof peerInfo&&peerInfo.id&&peerInfo.multiaddrs)}),module.exports=PeerInfo},function(module,exports,__webpack_require__){exports=module.exports=__webpack_require__(258),exports.Stream=exports,exports.Readable=exports,exports.Writable=__webpack_require__(143),exports.Duplex=__webpack_require__(44),exports.Transform=__webpack_require__(259),exports.PassThrough=__webpack_require__(638)},function(module,exports,__webpack_require__){function Timeout(id,clearFn){this._id=id,this._clearFn=clearFn}var apply=Function.prototype.apply;exports.setTimeout=function(){return new Timeout(apply.call(setTimeout,window,arguments),clearTimeout)},exports.setInterval=function(){return new Timeout(apply.call(setInterval,window,arguments),clearInterval)},exports.clearTimeout=exports.clearInterval=function(timeout){timeout&&timeout.close()},Timeout.prototype.unref=Timeout.prototype.ref=function(){},Timeout.prototype.close=function(){this._clearFn.call(window,this._id)},exports.enroll=function(item,msecs){clearTimeout(item._idleTimeoutId),item._idleTimeout=msecs},exports.unenroll=function(item){clearTimeout(item._idleTimeoutId),item._idleTimeout=-1},exports._unrefActive=exports.active=function(item){clearTimeout(item._idleTimeoutId);var msecs=item._idleTimeout;msecs>=0&&(item._idleTimeoutId=setTimeout(function(){item._onTimeout&&item._onTimeout()},msecs))},__webpack_require__(652),exports.setImmediate=setImmediate,exports.clearImmediate=clearImmediate},function(module,exports){function extend(){for(var target={},i=0;i{this.blockSizes.push(size)}),this.removeBlockSize=(index=>{this.blockSizes.splice(index,1)}),this.fileSize=(()=>{if(!(dirTypes.indexOf(this.type)>=0)){let sum=0;return this.blockSizes.forEach(size=>{sum+=size}),data&&(sum+=data.length),sum}}),this.marshal=(()=>{let type;switch(this.type){case"raw":type=unixfsData.DataType.Raw;break;case"directory":type=unixfsData.DataType.Directory;break;case"file":type=unixfsData.DataType.File;break;case"metadata":type=unixfsData.DataType.Metadata;break;case"symlink":type=unixfsData.DataType.Symlink;break;case"hamt-sharded-directory":type=unixfsData.DataType.HAMTShard;break;default:throw new Error(`Unkown type: "${this.type}"`)}let fileSize=this.fileSize();return fileSize||(fileSize=void 0),unixfsData.encode({Type:type,Data:this.data,filesize:fileSize,blocksizes:this.blockSizes.length>0?this.blockSizes:void 0,hashType:this.hashType,fanout:this.fanout})})}const protobuf=__webpack_require__(31),pb=protobuf(__webpack_require__(432)),unixfsData=pb.Data,types=["raw","directory","file","metadata","symlink","hamt-sharded-directory"],dirTypes=["directory","hamt-sharded-directory"];Data.unmarshal=(marsheled=>{const decoded=unixfsData.decode(marsheled);decoded.Data||(decoded.Data=void 0);const obj=new Data(types[decoded.Type],decoded.Data);return obj.blockSizes=decoded.blocksizes,obj}),module.exports=Data},function(module,exports,__webpack_require__){"use strict";module.exports={ethAccountSnapshot:__webpack_require__(197),ethBlock:__webpack_require__(198),ethBlockList:__webpack_require__(441),ethStateTrie:__webpack_require__(442),ethStorageTrie:__webpack_require__(443),ethTx:__webpack_require__(199),ethTxTrie:__webpack_require__(444)}},function(module,exports,__webpack_require__){(function(process){function normalizeArray(parts,allowAboveRoot){for(var up=0,i=parts.length-1;i>=0;i--){var last=parts[i];"."===last?parts.splice(i,1):".."===last?(parts.splice(i,1),up++):up&&(parts.splice(i,1),up--)}if(allowAboveRoot)for(;up--;up)parts.unshift("..");return parts}function filter(xs,f){if(xs.filter)return xs.filter(f);for(var res=[],i=0;i=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if("string"!=typeof path)throw new TypeError("Arguments to path.resolve must be strings");path&&(resolvedPath=path+"/"+resolvedPath,resolvedAbsolute="/"===path.charAt(0))}return resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/"),(resolvedAbsolute?"/":"")+resolvedPath||"."},exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash="/"===substr(path,-1);return path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/"),path||isAbsolute||(path="."),path&&trailingSlash&&(path+="/"),(isAbsolute?"/":"")+path},exports.isAbsolute=function(path){return"/"===path.charAt(0)},exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if("string"!=typeof p)throw new TypeError("Arguments to path.join must be strings");return p}).join("/"))},exports.relative=function(from,to){function trim(arr){for(var start=0;start=0&&""===arr[end];end--);return start>end?[]:arr.slice(start,end-start+1)}from=exports.resolve(from).substr(1),to=exports.resolve(to).substr(1);for(var fromParts=trim(from.split("/")),toParts=trim(to.split("/")),length=Math.min(fromParts.length,toParts.length),samePartsLength=length,i=0;iinput.length)throw new Error("invalid rlp: total length is larger than the data");if(innerRemainder=input.slice(llength,totalLength),0===innerRemainder.length)throw new Error("invalid rlp, List has a invalid length");for(;innerRemainder.length;)d=_decode(innerRemainder),decoded.push(d.data),innerRemainder=d.remainder;return{data:decoded,remainder:input.slice(totalLength)}}function isHexPrefixed(str){return"0x"===str.slice(0,2)}function stripHexPrefix(str){return"string"!=typeof str?str:isHexPrefixed(str)?str.slice(2):str}function intToHex(i){var hex=i.toString(16);return hex.length%2&&(hex="0"+hex),hex}function padToEven(a){return a.length%2&&(a="0"+a),a}function intToBuffer(i){return new Buffer(intToHex(i),"hex")}function toBuffer(v){if(!Buffer.isBuffer(v))if("string"==typeof v)v=isHexPrefixed(v)?new Buffer(padToEven(stripHexPrefix(v)),"hex"):new Buffer(v);else if("number"==typeof v)v=v?intToBuffer(v):new Buffer([]);else if(null===v||void 0===v)v=new Buffer([]);else{if(!v.toArray)throw new Error("invalid type");v=new Buffer(v.toArray())}return v}const assert=__webpack_require__(9);exports.encode=function(input){if(input instanceof Array){for(var output=[],i=0;i1?{type:packetslist[type],data:data.substring(1)}:{type:packetslist[type]}:err}var asArray=new Uint8Array(data),type=asArray[0],rest=sliceBuffer(data,1);return Blob&&"blob"===binaryType&&(rest=new Blob([rest])),{type:packetslist[type],data:rest}},exports.decodeBase64Packet=function(msg,binaryType){ +var type=packetslist[msg.charAt(0)];if(!base64encoder)return{type:type,data:{base64:!0,data:msg.substr(1)}};var data=base64encoder.decode(msg.substr(1));return"blob"===binaryType&&Blob&&(data=new Blob([data])),{type:type,data:data}},exports.encodePayload=function(packets,supportsBinary,callback){function setLengthHeader(message){return message.length+":"+message}function encodeOne(packet,doneCallback){exports.encodePacket(packet,!!isBinary&&supportsBinary,!1,function(message){doneCallback(null,setLengthHeader(message))})}"function"==typeof supportsBinary&&(callback=supportsBinary,supportsBinary=null);var isBinary=hasBinary(packets);return supportsBinary&&isBinary?Blob&&!dontSendBlobs?exports.encodePayloadAsBlob(packets,callback):exports.encodePayloadAsArrayBuffer(packets,callback):packets.length?void map(packets,encodeOne,function(err,results){return callback(results.join(""))}):callback("0:")},exports.decodePayload=function(data,binaryType,callback){if("string"!=typeof data)return exports.decodePayloadAsBinary(data,binaryType,callback);"function"==typeof binaryType&&(callback=binaryType,binaryType=null);var packet;if(""===data)return callback(err,0,1);for(var n,msg,length="",i=0,l=data.length;i0;){for(var tailArray=new Uint8Array(bufferTail),isString=0===tailArray[0],msgLength="",i=1;255!==tailArray[i];i++){if(msgLength.length>310)return callback(err,0,1);msgLength+=tailArray[i]}bufferTail=sliceBuffer(bufferTail,2+msgLength.length),msgLength=parseInt(msgLength);var msg=sliceBuffer(bufferTail,0,msgLength);if(isString)try{msg=String.fromCharCode.apply(null,new Uint8Array(msg))}catch(e){var typed=new Uint8Array(msg);msg="";for(var i=0;i`}toJSON(){return{name:this.name,size:this.size,multihash:mh.toB58String(this._multihash)}}get name(){return this._name}set name(name){throw new Error("Can't set property: 'name' is immutable")}get size(){return this._size}set size(size){throw new Error("Can't set property: 'size' is immutable")}get multihash(){return this._multihash}set multihash(multihash){throw new Error("Can't set property: 'multihash' is immutable")}}exports=module.exports=DAGLink,exports.create=__webpack_require__(435)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.DAGNode=__webpack_require__(118),exports.DAGLink=__webpack_require__(51),exports.resolver=__webpack_require__(440),exports.util=__webpack_require__(119)},function(module,exports,__webpack_require__){"use strict";function cidFromHash(codec,hashBuffer){return new CID(1,codec,multihashes.encode(hashBuffer,"keccak-256"))}const CID=__webpack_require__(8),multihashes=__webpack_require__(12);module.exports=cidFromHash},function(module,exports,__webpack_require__){(function(process){function Duplex(options){if(!(this instanceof Duplex))return new Duplex(options);Readable.call(this,options),Writable.call(this,options),options&&options.readable===!1&&(this.readable=!1),options&&options.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,options&&options.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",onend)}function onend(){this.allowHalfOpen||this._writableState.ended||process.nextTick(this.end.bind(this))}module.exports=Duplex;var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)keys.push(key);return keys},util=__webpack_require__(26);util.inherits=__webpack_require__(1);var Readable=__webpack_require__(210),Writable=__webpack_require__(212);util.inherits(Duplex,Readable),function(xs,f){for(var i=0,l=xs.length;i=8*this._finalSize&&(this._update(this._block),this._block.fill(0)),this._block.writeInt32BE(l,this._blockSize-4);var hash=this._update(this._block)||this._hash();return enc?hash.toString(enc):hash},Hash.prototype._update=function(){throw new Error("_update must be implemented by subclass")},module.exports=Hash}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){var base=exports;base.Reporter=__webpack_require__(281).Reporter,base.DecoderBuffer=__webpack_require__(149).DecoderBuffer,base.EncoderBuffer=__webpack_require__(149).EncoderBuffer,base.Node=__webpack_require__(280)},function(module,exports,__webpack_require__){(function(Buffer){module.exports=function(a,b){for(var length=Math.min(a.length,b.length),buffer=new Buffer(length),i=0;i=this._delta8){msg=this.pending;var r=msg.length%this._delta8;this.pending=msg.slice(msg.length-r,msg.length),0===this.pending.length&&(this.pending=null),msg=utils.join32(msg,0,msg.length-r,this.endian);for(var i=0;i>>24&255,res[i++]=len>>>16&255,res[i++]=len>>>8&255,res[i++]=255&len}else for(res[i++]=255&len,res[i++]=len>>>8&255,res[i++]=len>>>16&255,res[i++]=len>>>24&255,res[i++]=0,res[i++]=0,res[i++]=0,res[i++]=0,t=8;tutil.deserialize(ipfsBlock.data,cb),(ethObj,cb)=>treeFromEthObject(ethObj,options,cb)],callback)}function treeFromEthObject(ethObj,options,callback){waterfall([cb=>mapFromEthObject(ethObj,options,cb),(tuples,cb)=>cb(null,tuples.map(tuple=>tuple.path))],callback)}function resolve(ipfsBlock,path,callback){waterfall([cb=>util.deserialize(ipfsBlock.data,cb),(ethObj,cb)=>resolveFromEthObject(ethObj,path,cb)],callback)}function resolveFromEthObject(ethObj,path,callback){if(!path||"/"===path){const result={value:ethObj,remainderPath:""};return callback(null,result)}mapFromEthObject(ethObj,{},(err,paths)=>{if(err)return callback(err);const pathParts=path.split("/");let matches=paths.filter(child=>child.path===path.slice(0,child.path.length));matches=matches.filter(child=>child.path.split("/").every((part,index)=>part===pathParts[index]));const sortedMatches=matches.sort((a,b)=>a.path.length=this.charLength-this.charReceived?this.charLength-this.charReceived:buffer.length;if(buffer.copy(this.charBuffer,this.charReceived,0,available),this.charReceived+=available,this.charReceived=55296&&charCode<=56319)){if(this.charReceived=this.charLength=0,0===buffer.length)return charStr;break}this.charLength+=this.surrogateSize,charStr=""}this.detectIncompleteChar(buffer);var end=buffer.length;this.charLength&&(buffer.copy(this.charBuffer,0,buffer.length-this.charReceived,end),end-=this.charReceived),charStr+=buffer.toString(this.encoding,0,end);var end=charStr.length-1,charCode=charStr.charCodeAt(end);if(charCode>=55296&&charCode<=56319){var size=this.surrogateSize;return this.charLength+=size,this.charReceived+=size,this.charBuffer.copy(this.charBuffer,size,0,size),buffer.copy(this.charBuffer,0,0,size),charStr.substring(0,end)}return charStr},StringDecoder.prototype.detectIncompleteChar=function(buffer){for(var i=buffer.length>=3?3:buffer.length;i>0;i--){var c=buffer[buffer.length-i];if(1==i&&c>>5==6){this.charLength=2;break}if(i<=2&&c>>4==14){this.charLength=3;break}if(i<=3&&c>>3==30){this.charLength=4;break}}this.charReceived=i},StringDecoder.prototype.end=function(buffer){var res="";if(buffer&&buffer.length&&(res=this.write(buffer)),this.charReceived){var cr=this.charReceived,buf=this.charBuffer,enc=this.encoding;res+=buf.slice(0,cr).toString(enc)}return res}},function(module,exports,__webpack_require__){function once(fn){var f=function(){return f.called?f.value:(f.called=!0,f.value=fn.apply(this,arguments))};return f.called=!1,f}function onceStrict(fn){var f=function(){if(f.called)throw new Error(f.onceError);return f.called=!0,f.value=fn.apply(this,arguments)},name=fn.name||"Function wrapped with `once`";return f.onceError=name+" shouldn't be called more than once",f.called=!1,f}var wrappy=__webpack_require__(274);module.exports=wrappy(once),module.exports.strict=wrappy(onceStrict),once.proto=once(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return onceStrict(this)},configurable:!0})})},function(module,exports,__webpack_require__){"use strict";module.exports=function(op,done){function sink(_read){if(read=_read,abort)return sink.abort();!function next(){for(var loop=!0,cbed=!1;loop;)if(cbed=!1,read(null,function(end,data){if(cbed=!0,end=end||abort){if(loop=!1,done)done(end===!0?null:end);else if(end&&end!==!0)throw end}else op&&!1===op(data)||abort?(loop=!1,read(abort||!0,done||function(){})):loop||next()}),!cbed)return void(loop=!1)}()}var read,abort;return sink.abort=function(err,cb){if("function"==typeof err&&(cb=err,err=!0),abort=err||!0,read)return read(abort,cb||function(){})},sink}},function(module,exports){module.exports=function(key){return key&&("string"==typeof key?function(data){return data[key]}:"object"==typeof key&&"function"==typeof key.exec?function(data){var v=key.exec(data);return v&&v[0]}:key)}},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function asyncify(func){return(0,_initialParams2.default)(function(args,callback){var result;try{result=func.apply(this,args)}catch(e){return callback(e)}(0,_isObject2.default)(result)&&"function"==typeof result.then?result.then(function(value){invokeCallback(callback,null,value)},function(err){invokeCallback(callback,err.message?err:new Error(err))}):callback(null,result)})}function invokeCallback(callback,error,value){try{callback(error,value)}catch(e){(0,_setImmediate2.default)(rethrow,e)}}function rethrow(error){throw error}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=asyncify;var _isObject=__webpack_require__(234),_isObject2=_interopRequireDefault(_isObject),_initialParams=__webpack_require__(157),_initialParams2=_interopRequireDefault(_initialParams),_setImmediate=__webpack_require__(105),_setImmediate2=_interopRequireDefault(_setImmediate);module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0});var _eachLimit=__webpack_require__(289),_eachLimit2=_interopRequireDefault(_eachLimit),_doLimit=__webpack_require__(103),_doLimit2=_interopRequireDefault(_doLimit);exports.default=(0,_doLimit2.default)(_eachLimit2.default,1),module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function doParallel(fn){return function(obj,iteratee,callback){return fn(_eachOf2.default,obj,(0,_wrapAsync2.default)(iteratee),callback)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=doParallel;var _eachOf=__webpack_require__(101),_eachOf2=_interopRequireDefault(_eachOf),_wrapAsync=__webpack_require__(13),_wrapAsync2=_interopRequireDefault(_wrapAsync);module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0});var _doParallel=__webpack_require__(72),_doParallel2=_interopRequireDefault(_doParallel),_map=__webpack_require__(295),_map2=_interopRequireDefault(_map);exports.default=(0,_doParallel2.default)(_map2.default),module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function whilst(test,iteratee,callback){callback=(0,_onlyOnce2.default)(callback||_noop2.default);var _iteratee=(0,_wrapAsync2.default)(iteratee);if(!test())return callback(null);var next=function(err){if(err)return callback(err);if(test())return _iteratee(next);var args=(0,_slice2.default)(arguments,1);callback.apply(null,[null].concat(args))};_iteratee(next)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=whilst;var _noop=__webpack_require__(29),_noop2=_interopRequireDefault(_noop),_slice=__webpack_require__(48),_slice2=_interopRequireDefault(_slice),_onlyOnce=__webpack_require__(47),_onlyOnce2=_interopRequireDefault(_onlyOnce),_wrapAsync=__webpack_require__(13),_wrapAsync2=_interopRequireDefault(_wrapAsync);module.exports=exports.default},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_RESULT__;!function(globalObj){"use strict";function constructorFactory(configObj){function BigNumber(n,b){var c,e,i,num,len,str,x=this;if(!(x instanceof BigNumber))return ERRORS&&raise(26,"constructor call without new",n),new BigNumber(n,b);if(null!=b&&isValidInt(b,2,64,id,"base")){if(b|=0,str=n+"",10==b)return x=new BigNumber(n instanceof BigNumber?n:str),round(x,DECIMAL_PLACES+x.e+1,ROUNDING_MODE);if((num="number"==typeof n)&&0*n!=0||!new RegExp("^-?"+(c="["+ALPHABET.slice(0,b)+"]+")+"(?:\\."+c+")?$",b<37?"i":"").test(str))return parseNumeric(x,str,num,b);num?(x.s=1/n<0?(str=str.slice(1),-1):1,ERRORS&&str.replace(/^0\.0*|\./,"").length>15&&raise(id,tooManyDigits,n),num=!1):x.s=45===str.charCodeAt(0)?(str=str.slice(1),-1):1,str=convertBase(str,10,b,x.s)}else{if(n instanceof BigNumber)return x.s=n.s,x.e=n.e,x.c=(n=n.c)?n.slice():n,void(id=0);if((num="number"==typeof n)&&0*n==0){if(x.s=1/n<0?(n=-n,-1):1,n===~~n){for(e=0,i=n;i>=10;i/=10,e++);return x.e=e,x.c=[n],void(id=0)}str=n+""}else{if(!isNumeric.test(str=n+""))return parseNumeric(x,str,num);x.s=45===str.charCodeAt(0)?(str=str.slice(1),-1):1}}for((e=str.indexOf("."))>-1&&(str=str.replace(".","")),(i=str.search(/e/i))>0?(e<0&&(e=i),e+=+str.slice(i+1),str=str.substring(0,i)):e<0&&(e=str.length),i=0;48===str.charCodeAt(i);i++);for(len=str.length;48===str.charCodeAt(--len););if(str=str.slice(i,len+1))if(len=str.length,num&&ERRORS&&len>15&&(n>MAX_SAFE_INTEGER||n!==mathfloor(n))&&raise(id,tooManyDigits,x.s*n),(e=e-i-1)>MAX_EXP)x.c=x.e=null;else if(e=0&&(k=POW_PRECISION,POW_PRECISION=0,str=str.replace(".",""),y=new BigNumber(baseIn),x=y.pow(str.length-i),POW_PRECISION=k,y.c=toBaseOut(toFixedPoint(coeffToString(x.c),x.e),10,baseOut),y.e=y.c.length),xc=toBaseOut(str,baseIn,baseOut),e=k=xc.length;0==xc[--k];xc.pop());if(!xc[0])return"0";if(i<0?--e:(x.c=xc,x.e=e,x.s=sign,x=div(x,y,dp,rm,baseOut),xc=x.c,r=x.r,e=x.e),d=e+dp+1,i=xc[d],k=baseOut/2,r=r||d<0||null!=xc[d+1],r=rm<4?(null!=i||r)&&(0==rm||rm==(x.s<0?3:2)):i>k||i==k&&(4==rm||r||6==rm&&1&xc[d-1]||rm==(x.s<0?8:7)),d<1||!xc[0])str=r?toFixedPoint("1",-dp):"0";else{if(xc.length=d,r)for(--baseOut;++xc[--d]>baseOut;)xc[d]=0,d||(++e,xc.unshift(1));for(k=xc.length;!xc[--k];);for(i=0,str="";i<=k;str+=ALPHABET.charAt(xc[i++]));str=toFixedPoint(str,e)}return str}function format(n,i,rm,caller){var c0,e,ne,len,str;if(rm=null!=rm&&isValidInt(rm,0,8,caller,roundingMode)?0|rm:ROUNDING_MODE,!n.c)return n.toString();if(c0=n.c[0],ne=n.e,null==i)str=coeffToString(n.c),str=19==caller||24==caller&&ne<=TO_EXP_NEG?toExponential(str,ne):toFixedPoint(str,ne);else if(n=round(new BigNumber(n),i,rm),e=n.e,str=coeffToString(n.c),len=str.length,19==caller||24==caller&&(i<=e||e<=TO_EXP_NEG)){for(;lenlen){if(--i>0)for(str+=".";i--;str+="0");}else if((i+=e-len)>0)for(e+1==len&&(str+=".");i--;str+="0");return n.s<0&&c0?"-"+str:str}function maxOrMin(args,method){var m,n,i=0;for(isArray(args[0])&&(args=args[0]),m=new BigNumber(args[0]);++imax||n!=truncate(n))&&raise(caller,(name||"decimal places")+(nmax?" out of range":" not an integer"),n),!0}function normalise(n,c,e){for(var i=1,j=c.length;!c[--j];c.pop());for(j=c[0];j>=10;j/=10,i++);return(e=i+e*LOG_BASE-1)>MAX_EXP?n.c=n.e=null:e=10;k/=10,d++);if((i=sd-d)<0)i+=LOG_BASE,j=sd,n=xc[ni=0],rd=n/pows10[d-j-1]%10|0;else if((ni=mathceil((i+1)/LOG_BASE))>=xc.length){if(!r)break out;for(;xc.length<=ni;xc.push(0));n=rd=0,d=1,i%=LOG_BASE,j=i-LOG_BASE+1}else{for(n=k=xc[ni],d=1;k>=10;k/=10,d++);i%=LOG_BASE,j=i-LOG_BASE+d,rd=j<0?0:n/pows10[d-j-1]%10|0}if(r=r||sd<0||null!=xc[ni+1]||(j<0?n:n%pows10[d-j-1]),r=rm<4?(rd||r)&&(0==rm||rm==(x.s<0?3:2)):rd>5||5==rd&&(4==rm||r||6==rm&&(i>0?j>0?n/pows10[d-j]:0:xc[ni-1])%10&1||rm==(x.s<0?8:7)),sd<1||!xc[0])return xc.length=0,r?(sd-=x.e+1,xc[0]=pows10[(LOG_BASE-sd%LOG_BASE)%LOG_BASE],x.e=-sd||0):xc[0]=x.e=0,x;if(0==i?(xc.length=ni,k=1,ni--):(xc.length=ni+1,k=pows10[LOG_BASE-i],xc[ni]=j>0?mathfloor(n/pows10[d-j]%pows10[j])*k:0),r)for(;;){if(0==ni){for(i=1,j=xc[0];j>=10;j/=10,i++);for(j=xc[0]+=k,k=1;j>=10;j/=10,k++);i!=k&&(x.e++,xc[0]==BASE&&(xc[0]=1));break}if(xc[ni]+=k,xc[ni]!=BASE)break;xc[ni--]=0,k=1}for(i=xc.length;0===xc[--i];xc.pop());}x.e>MAX_EXP?x.c=x.e=null:x.ei)return null!=(v=a[i++])};return has(p="DECIMAL_PLACES")&&isValidInt(v,0,MAX,2,p)&&(DECIMAL_PLACES=0|v), +r[p]=DECIMAL_PLACES,has(p="ROUNDING_MODE")&&isValidInt(v,0,8,2,p)&&(ROUNDING_MODE=0|v),r[p]=ROUNDING_MODE,has(p="EXPONENTIAL_AT")&&(isArray(v)?isValidInt(v[0],-MAX,0,2,p)&&isValidInt(v[1],0,MAX,2,p)&&(TO_EXP_NEG=0|v[0],TO_EXP_POS=0|v[1]):isValidInt(v,-MAX,MAX,2,p)&&(TO_EXP_NEG=-(TO_EXP_POS=0|(v<0?-v:v)))),r[p]=[TO_EXP_NEG,TO_EXP_POS],has(p="RANGE")&&(isArray(v)?isValidInt(v[0],-MAX,-1,2,p)&&isValidInt(v[1],1,MAX,2,p)&&(MIN_EXP=0|v[0],MAX_EXP=0|v[1]):isValidInt(v,-MAX,MAX,2,p)&&(0|v?MIN_EXP=-(MAX_EXP=0|(v<0?-v:v)):ERRORS&&raise(2,p+" cannot be zero",v))),r[p]=[MIN_EXP,MAX_EXP],has(p="ERRORS")&&(v===!!v||1===v||0===v?(id=0,isValidInt=(ERRORS=!!v)?intValidatorWithErrors:intValidatorNoErrors):ERRORS&&raise(2,p+notBool,v)),r[p]=ERRORS,has(p="CRYPTO")&&(v===!0||v===!1||1===v||0===v?v?(v="undefined"==typeof crypto,!v&&crypto&&(crypto.getRandomValues||crypto.randomBytes)?CRYPTO=!0:ERRORS?raise(2,"crypto unavailable",v?void 0:crypto):CRYPTO=!1):CRYPTO=!1:ERRORS&&raise(2,p+notBool,v)),r[p]=CRYPTO,has(p="MODULO_MODE")&&isValidInt(v,0,9,2,p)&&(MODULO_MODE=0|v),r[p]=MODULO_MODE,has(p="POW_PRECISION")&&isValidInt(v,0,MAX,2,p)&&(POW_PRECISION=0|v),r[p]=POW_PRECISION,has(p="FORMAT")&&("object"==typeof v?FORMAT=v:ERRORS&&raise(2,p+" not an object",v)),r[p]=FORMAT,r},BigNumber.max=function(){return maxOrMin(arguments,P.lt)},BigNumber.min=function(){return maxOrMin(arguments,P.gt)},BigNumber.random=function(){var random53bitInt=9007199254740992*Math.random()&2097151?function(){return mathfloor(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(dp){var a,b,e,k,v,i=0,c=[],rand=new BigNumber(ONE);if(dp=null!=dp&&isValidInt(dp,0,MAX,14)?0|dp:DECIMAL_PLACES,k=mathceil(dp/LOG_BASE),CRYPTO)if(crypto.getRandomValues){for(a=crypto.getRandomValues(new Uint32Array(k*=2));i>>11),v>=9e15?(b=crypto.getRandomValues(new Uint32Array(2)),a[i]=b[0],a[i+1]=b[1]):(c.push(v%1e14),i+=2);i=k/2}else if(crypto.randomBytes){for(a=crypto.randomBytes(k*=7);i=9e15?crypto.randomBytes(7).copy(a,i):(c.push(v%1e14),i+=7);i=k/7}else CRYPTO=!1,ERRORS&&raise(14,"crypto unavailable",crypto);if(!CRYPTO)for(;i=10;v/=10,i++);ibL?1:-1;else for(i=cmp=0;ib[i]?1:-1;break}return cmp}function subtract(a,b,aL,base){for(var i=0;aL--;)a[aL]-=i,i=a[aL]1;a.shift());}return function(x,y,dp,rm,base){var cmp,e,i,more,n,prod,prodL,q,qc,rem,remL,rem0,xi,xL,yc0,yL,yz,s=x.s==y.s?1:-1,xc=x.c,yc=y.c;if(!(xc&&xc[0]&&yc&&yc[0]))return new BigNumber(x.s&&y.s&&(xc?!yc||xc[0]!=yc[0]:yc)?xc&&0==xc[0]||!yc?0*s:s/0:NaN);for(q=new BigNumber(s),qc=q.c=[],e=x.e-y.e,s=dp+e+1,base||(base=BASE,e=bitFloor(x.e/LOG_BASE)-bitFloor(y.e/LOG_BASE),s=s/LOG_BASE|0),i=0;yc[i]==(xc[i]||0);i++);if(yc[i]>(xc[i]||0)&&e--,s<0)qc.push(1),more=!0;else{for(xL=xc.length,yL=yc.length,i=0,s+=2,n=mathfloor(base/(yc[0]+1)),n>1&&(yc=multiply(yc,n,base),xc=multiply(xc,n,base),yL=yc.length,xL=xc.length),xi=yL,rem=xc.slice(0,yL),remL=rem.length;remL=base/2&&yc0++;do{if(n=0,(cmp=compare(yc,rem,yL,remL))<0){if(rem0=rem[0],yL!=remL&&(rem0=rem0*base+(rem[1]||0)),(n=mathfloor(rem0/yc0))>1)for(n>=base&&(n=base-1),prod=multiply(yc,n,base),prodL=prod.length,remL=rem.length;1==compare(prod,rem,prodL,remL);)n--,subtract(prod,yL=10;s/=10,i++);round(q,dp+(q.e=i+e*LOG_BASE-1)+1,rm,more)}else q.e=e,q.r=+more;return q}}(),parseNumeric=function(){var isInfinityOrNaN=/^-?(Infinity|NaN)$/;return function(x,str,num,b){var base,s=num?str:str.replace(/^\s*\+(?=[\w.])|^\s+|\s+$/g,"");if(isInfinityOrNaN.test(s))x.s=isNaN(s)?null:s<0?-1:1;else{if(!num&&(s=s.replace(/^(-?)0([xbo])(?=\w[\w.]*$)/i,function(m,p1,p2){return base="x"==(p2=p2.toLowerCase())?16:"b"==p2?2:8,b&&b!=base?m:p1}),b&&(base=b,s=s.replace(/^([^.]+)\.$/,"$1").replace(/^\.([^.]+)$/,"0.$1")),str!=s))return new BigNumber(s,base);ERRORS&&raise(id,"not a"+(b?" base "+b:"")+" number",str),x.s=null}x.c=x.e=null,id=0}}(),P.absoluteValue=P.abs=function(){var x=new BigNumber(this);return x.s<0&&(x.s=1),x},P.ceil=function(){return round(new BigNumber(this),this.e+1,2)},P.comparedTo=P.cmp=function(y,b){return id=1,compare(this,new BigNumber(y,b))},P.decimalPlaces=P.dp=function(){var n,v,c=this.c;if(!c)return null;if(n=((v=c.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,v=c[v])for(;v%10==0;v/=10,n--);return n<0&&(n=0),n},P.dividedBy=P.div=function(y,b){return id=3,div(this,new BigNumber(y,b),DECIMAL_PLACES,ROUNDING_MODE)},P.dividedToIntegerBy=P.divToInt=function(y,b){return id=4,div(this,new BigNumber(y,b),0,1)},P.equals=P.eq=function(y,b){return id=5,0===compare(this,new BigNumber(y,b))},P.floor=function(){return round(new BigNumber(this),this.e+1,3)},P.greaterThan=P.gt=function(y,b){return id=6,compare(this,new BigNumber(y,b))>0},P.greaterThanOrEqualTo=P.gte=function(y,b){return id=7,1===(b=compare(this,new BigNumber(y,b)))||0===b},P.isFinite=function(){return!!this.c},P.isInteger=P.isInt=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},P.isNaN=function(){return!this.s},P.isNegative=P.isNeg=function(){return this.s<0},P.isZero=function(){return!!this.c&&0==this.c[0]},P.lessThan=P.lt=function(y,b){return id=8,compare(this,new BigNumber(y,b))<0},P.lessThanOrEqualTo=P.lte=function(y,b){return id=9,(b=compare(this,new BigNumber(y,b)))===-1||0===b},P.minus=P.sub=function(y,b){var i,j,t,xLTy,x=this,a=x.s;if(id=10,y=new BigNumber(y,b),b=y.s,!a||!b)return new BigNumber(NaN);if(a!=b)return y.s=-b,x.plus(y);var xe=x.e/LOG_BASE,ye=y.e/LOG_BASE,xc=x.c,yc=y.c;if(!xe||!ye){if(!xc||!yc)return xc?(y.s=-b,y):new BigNumber(yc?x:NaN);if(!xc[0]||!yc[0])return yc[0]?(y.s=-b,y):new BigNumber(xc[0]?x:3==ROUNDING_MODE?-0:0)}if(xe=bitFloor(xe),ye=bitFloor(ye),xc=xc.slice(),a=xe-ye){for((xLTy=a<0)?(a=-a,t=xc):(ye=xe,t=yc),t.reverse(),b=a;b--;t.push(0));t.reverse()}else for(j=(xLTy=(a=xc.length)<(b=yc.length))?a:b,a=b=0;b0)for(;b--;xc[i++]=0);for(b=BASE-1;j>a;){if(xc[--j]0?(ye=xe,t=yc):(a=-a,t=xc),t.reverse();a--;t.push(0));t.reverse()}for(a=xc.length,b=yc.length,a-b<0&&(t=yc,yc=xc,xc=t,b=a),a=0;b;)a=(xc[--b]=xc[b]+yc[b]+a)/BASE|0,xc[b]=BASE===xc[b]?0:xc[b]%BASE;return a&&(xc.unshift(a),++ye),normalise(y,xc,ye)},P.precision=P.sd=function(z){var n,v,x=this,c=x.c;if(null!=z&&z!==!!z&&1!==z&&0!==z&&(ERRORS&&raise(13,"argument"+notBool,z),z!=!!z&&(z=null)),!c)return null;if(v=c.length-1,n=v*LOG_BASE+1,v=c[v]){for(;v%10==0;v/=10,n--);for(v=c[0];v>=10;v/=10,n++);}return z&&x.e+1>n&&(n=x.e+1),n},P.round=function(dp,rm){var n=new BigNumber(this);return(null==dp||isValidInt(dp,0,MAX,15))&&round(n,~~dp+this.e+1,null!=rm&&isValidInt(rm,0,8,15,roundingMode)?0|rm:ROUNDING_MODE),n},P.shift=function(k){var n=this;return isValidInt(k,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER,16,"argument")?n.times("1e"+truncate(k)):new BigNumber(n.c&&n.c[0]&&(k<-MAX_SAFE_INTEGER||k>MAX_SAFE_INTEGER)?n.s*(k<0?0:1/0):n)},P.squareRoot=P.sqrt=function(){var m,n,r,rep,t,x=this,c=x.c,s=x.s,e=x.e,dp=DECIMAL_PLACES+4,half=new BigNumber("0.5");if(1!==s||!c||!c[0])return new BigNumber(!s||s<0&&(!c||c[0])?NaN:c?x:1/0);if(s=Math.sqrt(+x),0==s||s==1/0?(n=coeffToString(c),(n.length+e)%2==0&&(n+="0"),s=Math.sqrt(n),e=bitFloor((e+1)/2)-(e<0||e%2),s==1/0?n="1e"+e:(n=s.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),r=new BigNumber(n)):r=new BigNumber(s+""),r.c[0])for(e=r.e,s=e+dp,s<3&&(s=0);;)if(t=r,r=half.times(t.plus(div(x,t,dp,1))),coeffToString(t.c).slice(0,s)===(n=coeffToString(r.c)).slice(0,s)){if(r.e=0;){for(c=0,ylo=yc[i]%sqrtBase,yhi=yc[i]/sqrtBase|0,k=xcL,j=i+k;j>i;)xlo=xc[--k]%sqrtBase,xhi=xc[k]/sqrtBase|0,m=yhi*xlo+xhi*ylo,xlo=ylo*xlo+m%sqrtBase*sqrtBase+zc[j]+c,c=(xlo/base|0)+(m/sqrtBase|0)+yhi*xhi,zc[j--]=xlo%base;zc[j]=c}return c?++e:zc.shift(),normalise(y,zc,e)},P.toDigits=function(sd,rm){var n=new BigNumber(this);return sd=null!=sd&&isValidInt(sd,1,MAX,18,"precision")?0|sd:null,rm=null!=rm&&isValidInt(rm,0,8,18,roundingMode)?0|rm:ROUNDING_MODE,sd?round(n,sd,rm):n},P.toExponential=function(dp,rm){return format(this,null!=dp&&isValidInt(dp,0,MAX,19)?1+~~dp:null,rm,19)},P.toFixed=function(dp,rm){return format(this,null!=dp&&isValidInt(dp,0,MAX,20)?~~dp+this.e+1:null,rm,20)},P.toFormat=function(dp,rm){var str=format(this,null!=dp&&isValidInt(dp,0,MAX,21)?~~dp+this.e+1:null,rm,21);if(this.c){var i,arr=str.split("."),g1=+FORMAT.groupSize,g2=+FORMAT.secondaryGroupSize,groupSeparator=FORMAT.groupSeparator,intPart=arr[0],fractionPart=arr[1],isNeg=this.s<0,intDigits=isNeg?intPart.slice(1):intPart,len=intDigits.length;if(g2&&(i=g1,g1=g2,g2=i,len-=i),g1>0&&len>0){for(i=len%g1||g1,intPart=intDigits.substr(0,i);i0&&(intPart+=groupSeparator+intDigits.slice(i)),isNeg&&(intPart="-"+intPart)}str=fractionPart?intPart+FORMAT.decimalSeparator+((g2=+FORMAT.fractionGroupSize)?fractionPart.replace(new RegExp("\\d{"+g2+"}\\B","g"),"$&"+FORMAT.fractionGroupSeparator):fractionPart):intPart}return str},P.toFraction=function(md){var arr,d0,d2,e,exp,n,n0,q,s,k=ERRORS,x=this,xc=x.c,d=new BigNumber(ONE),n1=d0=new BigNumber(ONE),d1=n0=new BigNumber(ONE);if(null!=md&&(ERRORS=!1,n=new BigNumber(md),ERRORS=k,(k=n.isInt())&&!n.lt(ONE)||(ERRORS&&raise(22,"max denominator "+(k?"out of range":"not an integer"),md),md=!k&&n.c&&round(n,n.e+1,1).gte(ONE)?n:null)),!xc)return x.toString();for(s=coeffToString(xc),e=d.e=s.length-x.e-1,d.c[0]=POWS_TEN[(exp=e%LOG_BASE)<0?LOG_BASE+exp:exp],md=!md||n.cmp(d)>0?e>0?d:n1:n,exp=MAX_EXP,MAX_EXP=1/0,n=new BigNumber(s),n0.c[0]=0;q=div(n,d,0,1),d2=d0.plus(q.times(d1)),1!=d2.cmp(md);)d0=d1,d1=d2,n1=n0.plus(q.times(d2=n1)),n0=d2,d=n.minus(q.times(d2=d)),n=d2;return d2=div(md.minus(d0),d1,0,1),n0=n0.plus(d2.times(n1)),d0=d0.plus(d2.times(d1)),n0.s=n1.s=x.s,e*=2,arr=div(n1,d1,e,ROUNDING_MODE).minus(x).abs().cmp(div(n0,d0,e,ROUNDING_MODE).minus(x).abs())<1?[n1.toString(),d1.toString()]:[n0.toString(),d0.toString()],MAX_EXP=exp,arr},P.toNumber=function(){return+this},P.toPower=P.pow=function(n,m){var k,y,z,i=mathfloor(n<0?-n:+n),x=this;if(null!=m&&(id=23,m=new BigNumber(m)),!isValidInt(n,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER,23,"exponent")&&(!isFinite(n)||i>MAX_SAFE_INTEGER&&(n/=0)||parseFloat(n)!=n&&!(n=NaN))||0==n)return k=Math.pow(+x,n),new BigNumber(m?k%m:k);for(m?n>1&&x.gt(ONE)&&x.isInt()&&m.gt(ONE)&&m.isInt()?x=x.mod(m):(z=m,m=null):POW_PRECISION&&(k=mathceil(POW_PRECISION/LOG_BASE+2)),y=new BigNumber(ONE);;){if(i%2){if(y=y.times(x),!y.c)break;k?y.c.length>k&&(y.c.length=k):m&&(y=y.mod(m))}if(!(i=mathfloor(i/2)))break;x=x.times(x),k?x.c&&x.c.length>k&&(x.c.length=k):m&&(x=x.mod(m))}return m?y:(n<0&&(y=ONE.div(y)),z?y.mod(z):k?round(y,POW_PRECISION,ROUNDING_MODE):y)},P.toPrecision=function(sd,rm){return format(this,null!=sd&&isValidInt(sd,1,MAX,24,"precision")?0|sd:null,rm,24)},P.toString=function(b){var str,n=this,s=n.s,e=n.e;return null===e?s?(str="Infinity",s<0&&(str="-"+str)):str="NaN":(str=coeffToString(n.c),str=null!=b&&isValidInt(b,2,64,25,"base")?convertBase(toFixedPoint(str,e),0|b,10,s):e<=TO_EXP_NEG||e>=TO_EXP_POS?toExponential(str,e):toFixedPoint(str,e),s<0&&n.c[0]&&(str="-"+str)),str},P.truncated=P.trunc=function(){return round(new BigNumber(this),this.e+1,1)},P.valueOf=P.toJSON=function(){var str,n=this,e=n.e;return null===e?n.toString():(str=coeffToString(n.c),str=e<=TO_EXP_NEG||e>=TO_EXP_POS?toExponential(str,e):toFixedPoint(str,e),n.s<0?"-"+str:str)},null!=configObj&&BigNumber.config(configObj),BigNumber}function bitFloor(n){var i=0|n;return n>0||n===i?i:i-1}function coeffToString(a){for(var s,z,i=1,j=a.length,r=a[0]+"";il^a?1:-1;for(j=(k=xc.length)<(l=yc.length)?k:l,i=0;iyc[i]^a?1:-1;return k==l?0:k>l^a?1:-1}function intValidatorNoErrors(n,min,max){return(n=truncate(n))>=min&&n<=max}function isArray(obj){return"[object Array]"==Object.prototype.toString.call(obj)}function toBaseOut(str,baseIn,baseOut){for(var j,arrL,arr=[0],i=0,len=str.length;ibaseOut-1&&(null==arr[j+1]&&(arr[j+1]=0),arr[j+1]+=arr[j]/baseOut|0,arr[j]%=baseOut)}return arr.reverse()}function toExponential(str,e){return(str.length>1?str.charAt(0)+"."+str.slice(1):str)+(e<0?"e":"e+")+e}function toFixedPoint(str,e){var len,z;if(e<0){for(z="0.";++e;z+="0");str=z+str}else if(len=str.length,++e>len){for(z="0",e-=len;--e;z+="0");str+=z}else euint_max||x<0?(x_pos=Math.abs(x)%uint_max,x<0?uint_max-x_pos:x_pos):x}function scrub_vec(v){for(;0>>8^255&sx^99,this.SBOX[x]=sx,this.INV_SBOX[sx]=x,x2=d[x],x4=d[x2],x8=d[x4],t=257*d[sx]^16843008*sx,this.SUB_MIX[0][x]=t<<24|t>>>8,this.SUB_MIX[1][x]=t<<16|t>>>16,this.SUB_MIX[2][x]=t<<8|t>>>24,this.SUB_MIX[3][x]=t,t=16843009*x8^65537*x4^257*x2^16843008*x,this.INV_SUB_MIX[0][sx]=t<<24|t>>>8,this.INV_SUB_MIX[1][sx]=t<<16|t>>>16,this.INV_SUB_MIX[2][sx]=t<<8|t>>>24,this.INV_SUB_MIX[3][sx]=t,0===x?x=xi=1:(x=x2^d[d[d[x8^x2]]],xi^=d[d[xi]]);return!0};var G=new Global;AES.blockSize=16,AES.prototype.blockSize=AES.blockSize,AES.keySize=32,AES.prototype.keySize=AES.keySize,AES.prototype._doReset=function(){var invKsRow,keySize,keyWords,ksRow,ksRows,t;for(keyWords=this._key,keySize=keyWords.length,this._nRounds=keySize+6,ksRows=4*(this._nRounds+1),this._keySchedule=[],ksRow=0;ksRow>>24,t=G.SBOX[t>>>24]<<24|G.SBOX[t>>>16&255]<<16|G.SBOX[t>>>8&255]<<8|G.SBOX[255&t],t^=G.RCON[ksRow/keySize|0]<<24):keySize>6&&ksRow%keySize==4&&(t=G.SBOX[t>>>24]<<24|G.SBOX[t>>>16&255]<<16|G.SBOX[t>>>8&255]<<8|G.SBOX[255&t]),this._keySchedule[ksRow-keySize]^t);for(this._invKeySchedule=[],invKsRow=0;invKsRow>>24]]^G.INV_SUB_MIX[1][G.SBOX[t>>>16&255]]^G.INV_SUB_MIX[2][G.SBOX[t>>>8&255]]^G.INV_SUB_MIX[3][G.SBOX[255&t]];return!0},AES.prototype.encryptBlock=function(M){M=bufferToArray(new Buffer(M));var out=this._doCryptBlock(M,this._keySchedule,G.SUB_MIX,G.SBOX),buf=new Buffer(16);return buf.writeUInt32BE(out[0],0),buf.writeUInt32BE(out[1],4),buf.writeUInt32BE(out[2],8),buf.writeUInt32BE(out[3],12),buf},AES.prototype.decryptBlock=function(M){M=bufferToArray(new Buffer(M));var temp=[M[3],M[1]];M[1]=temp[0],M[3]=temp[1];var out=this._doCryptBlock(M,this._invKeySchedule,G.INV_SUB_MIX,G.INV_SBOX),buf=new Buffer(16);return buf.writeUInt32BE(out[0],0),buf.writeUInt32BE(out[3],4),buf.writeUInt32BE(out[2],8),buf.writeUInt32BE(out[1],12),buf},AES.prototype.scrub=function(){scrub_vec(this._keySchedule),scrub_vec(this._invKeySchedule),scrub_vec(this._key)},AES.prototype._doCryptBlock=function(M,keySchedule,SUB_MIX,SBOX){var ksRow,s0,s1,s2,s3,t0,t1,t2,t3;s0=M[0]^keySchedule[0],s1=M[1]^keySchedule[1],s2=M[2]^keySchedule[2],s3=M[3]^keySchedule[3],ksRow=4;for(var round=1;round>>24]^SUB_MIX[1][s1>>>16&255]^SUB_MIX[2][s2>>>8&255]^SUB_MIX[3][255&s3]^keySchedule[ksRow++],t1=SUB_MIX[0][s1>>>24]^SUB_MIX[1][s2>>>16&255]^SUB_MIX[2][s3>>>8&255]^SUB_MIX[3][255&s0]^keySchedule[ksRow++],t2=SUB_MIX[0][s2>>>24]^SUB_MIX[1][s3>>>16&255]^SUB_MIX[2][s0>>>8&255]^SUB_MIX[3][255&s1]^keySchedule[ksRow++],t3=SUB_MIX[0][s3>>>24]^SUB_MIX[1][s0>>>16&255]^SUB_MIX[2][s1>>>8&255]^SUB_MIX[3][255&s2]^keySchedule[ksRow++],s0=t0,s1=t1,s2=t2,s3=t3;return t0=(SBOX[s0>>>24]<<24|SBOX[s1>>>16&255]<<16|SBOX[s2>>>8&255]<<8|SBOX[255&s3])^keySchedule[ksRow++],t1=(SBOX[s1>>>24]<<24|SBOX[s2>>>16&255]<<16|SBOX[s3>>>8&255]<<8|SBOX[255&s0])^keySchedule[ksRow++],t2=(SBOX[s2>>>24]<<24|SBOX[s3>>>16&255]<<16|SBOX[s0>>>8&255]<<8|SBOX[255&s1])^keySchedule[ksRow++],t3=(SBOX[s3>>>24]<<24|SBOX[s0>>>16&255]<<16|SBOX[s1>>>8&255]<<8|SBOX[255&s2])^keySchedule[ksRow++],[fixup_uint32(t0),fixup_uint32(t1),fixup_uint32(t2),fixup_uint32(t3)]},exports.AES=AES}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function incr32(iv){for(var item,len=iv.length;len--;){if(255!==(item=iv.readUInt8(len))){item++,iv.writeUInt8(item,len);break}iv.writeUInt8(0,len)}}function getBlock(self){var out=self._cipher.encryptBlock(self._prev);return incr32(self._prev),out}var xor=__webpack_require__(58);exports.encrypt=function(self,chunk){for(;self._cache.length{b.put(this.transform.convert(key),value)},delete:key=>{b.delete(this.transform.convert(key))},commit:callback=>{b.commit(callback)}}}query(q){return pull(this.child.query(q),pull.map(e=>{return e.key=this.transform.invert(e.key),e}))}close(callback){this.child.close(callback)}}module.exports=KeyTransformDatastore},function(module,exports,__webpack_require__){"use strict";var curve=exports;curve.base=__webpack_require__(340),curve.short=__webpack_require__(343),curve.mont=__webpack_require__(342),curve.edwards=__webpack_require__(341)},function(module,exports,__webpack_require__){"use strict";(function(setImmediate){const protobuf=__webpack_require__(31),Block=__webpack_require__(61),isEqualWith=__webpack_require__(525),assert=__webpack_require__(9),each=__webpack_require__(19),CID=__webpack_require__(8),codecName=__webpack_require__(237),vd=__webpack_require__(677),multihashing=__webpack_require__(21),pbm=protobuf(__webpack_require__(395)),Entry=__webpack_require__(394);class BitswapMessage{constructor(full){this.full=full,this.wantlist=new Map,this.blocks=new Map}get empty(){return 0===this.blocks.size&&0===this.wantlist.size}addEntry(cid,priority,cancel){assert(cid&&CID.isCID(cid),"must be a valid cid");const cidStr=cid.buffer.toString(),entry=this.wantlist.get(cidStr);entry?(entry.priority=priority,entry.cancel=Boolean(cancel)):this.wantlist.set(cidStr,new Entry(cid,priority,cancel))}addBlock(block){assert(Block.isBlock(block),"must be a valid cid");const cidStr=block.cid.buffer.toString();this.blocks.set(cidStr,block)}cancel(cid){assert(CID.isCID(cid),"must be a valid cid");const cidStr=cid.buffer.toString();this.wantlist.delete(cidStr),this.addEntry(cid,0,!0)}serializeToBitswap100(){const msg={wantlist:{entries:Array.from(this.wantlist.values()).map(entry=>{return{block:entry.cid.buffer,priority:Number(entry.priority),cancel:Boolean(entry.cancel)}})},blocks:Array.from(this.blocks.values()).map(block=>block.data)};return this.full&&(msg.wantlist.full=!0),pbm.Message.encode(msg)}serializeToBitswap110(){const msg={wantlist:{entries:Array.from(this.wantlist.values()).map(entry=>{return{block:entry.cid.buffer,priority:Number(entry.priority),cancel:Boolean(entry.cancel)}})},payload:[]};return this.full&&(msg.wantlist.full=!0),this.blocks.forEach(block=>{msg.payload.push({prefix:block.cid.prefix,data:block.data})}),pbm.Message.encode(msg)}equals(other){const cmp=(a,b)=>{if(a.equals&&"function"==typeof a.equals)return a.equals(b)};return!(this.full!==other.full||!isEqualWith(this.wantlist,other.wantlist,cmp)||!isEqualWith(this.blocks,other.blocks,cmp))}get[Symbol.toStringTag](){const list=Array.from(this.wantlist.keys()),blocks=Array.from(this.blocks.keys());return`BitswapMessage `}}BitswapMessage.deserialize=((raw,callback)=>{let decoded;try{decoded=pbm.Message.decode(raw)}catch(err){return setImmediate(()=>callback(err))}const isFull=decoded.wantlist&&decoded.wantlist.full||!1,msg=new BitswapMessage(isFull);return decoded.wantlist&&decoded.wantlist.entries.forEach(entry=>{const cid=new CID(entry.block);msg.addEntry(cid,entry.priority,entry.cancel)}),decoded.blocks.length>0?each(decoded.blocks,(b,cb)=>{multihashing(b,"sha2-256",(err,hash)=>{if(err)return cb(err);const cid=new CID(hash);msg.addBlock(new Block(b,cid)),cb()})},err=>{if(err)return callback(err);callback(null,msg)}):decoded.payload.length>0?each(decoded.payload,(p,cb)=>{p.prefix&&p.data||cb();const values=vd(p.prefix),cidVersion=values[0],multicodec=values[1],hashAlg=values[2];multihashing(p.data,hashAlg,(err,hash)=>{if(err)return cb(err);const cid=new CID(cidVersion,codecName[multicodec.toString("16")],hash);msg.addBlock(new Block(p.data,cid)),cb()})},err=>{if(err)return callback(err);callback(null,msg)}):void callback(null,msg)}),BitswapMessage.Entry=Entry,module.exports=BitswapMessage}).call(exports,__webpack_require__(37).setImmediate)},function(module,exports,__webpack_require__){"use strict";const sort=__webpack_require__(529),Entry=__webpack_require__(396);class Wantlist{constructor(){this.set=new Map}get length(){return this.set.size}add(cid,priority){const cidStr=cid.buffer.toString(),entry=this.set.get(cidStr);entry?(entry.inc(),entry.priority=priority):this.set.set(cidStr,new Entry(cid,priority))}remove(cid){const cidStr=cid.buffer.toString(),entry=this.set.get(cidStr);entry&&(entry.dec(),entry.hasRefs()||this.set.delete(cidStr))}removeForce(cidStr){this.set.has(cidStr)&&this.set.delete(cidStr)}entries(){return this.set.entries()}sortedEntries(){return new Map(sort(Array.from(this.set.entries()),o=>{return o[1].key}))}contains(cid){const cidStr=cid.buffer.toString();return this.set.get(cidStr)}}Wantlist.Entry=Entry,module.exports=Wantlist},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function create(data,dagLinks,hashAlg,callback){if("function"==typeof data?(callback=data,data=void 0):"string"==typeof data&&(data=new Buffer(data)),"function"==typeof dagLinks&&(callback=dagLinks,dagLinks=[]),"function"==typeof hashAlg&&(callback=hashAlg,hashAlg=void 0),!Buffer.isBuffer(data))return callback("Passed 'data' is not a buffer or a string!");hashAlg||(hashAlg="sha2-256");const links=dagLinks.map(l=>{return l.constructor&&"DAGLink"===l.constructor.name?l:new DAGLink(l.name?l.name:l.Name,l.size?l.size:l.Size,l.hash||l.Hash||l.multihash)}),sortedLinks=sort(links,linkSort);serialize({data:data,links:sortedLinks},(err,serialized)=>{if(err)return callback(err);multihashing(serialized,hashAlg,(err,multihash)=>{if(err)return callback(err);callback(null,new DAGNode(data,sortedLinks,serialized,multihash))})})}const multihashing=__webpack_require__(21),sort=__webpack_require__(664),dagPBUtil=__webpack_require__(119),serialize=dagPBUtil.serialize,dagNodeUtil=__webpack_require__(86),linkSort=dagNodeUtil.linkSort,DAGNode=__webpack_require__(118),DAGLink=__webpack_require__(51);module.exports=create}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function cloneData(dagNode){let data;return dagNode.data&&dagNode.data.length>0?(data=new Buffer(dagNode.data.length),dagNode.data.copy(data)):data=new Buffer(0),data}function cloneLinks(dagNode){return dagNode.links.slice()}function linkSort(a,b){const aBuf=new Buffer(a.name||"","ascii"),bBuf=new Buffer(b.name||"","ascii");return aBuf.compare(bBuf)}function toDAGLink(node){return new DAGLink("",node.size,node.multihash)}const DAGLink=__webpack_require__(51);exports=module.exports,exports.cloneData=cloneData,exports.cloneLinks=cloneLinks,exports.linkSort=linkSort,exports.toDAGLink=toDAGLink}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){var createError=__webpack_require__(363).create,LevelUPError=createError("LevelUPError"),NotFoundError=createError("NotFoundError",LevelUPError);NotFoundError.prototype.notFound=!0,NotFoundError.prototype.status=404,module.exports={LevelUPError:LevelUPError,InitializationError:createError("InitializationError",LevelUPError),OpenError:createError("OpenError",LevelUPError),ReadError:createError("ReadError",LevelUPError),WriteError:createError("WriteError",LevelUPError),NotFoundError:NotFoundError,EncodingError:createError("EncodingError",LevelUPError)}},function(module,exports,__webpack_require__){"use strict";const multistream=__webpack_require__(136);module.exports=function(protocols,conn){const ms=new multistream.Listener;Object.keys(protocols).forEach(protocol=>{protocol&&ms.addHandler(protocol,protocols[protocol].handlerFunc,protocols[protocol].matchFunc)}),ms.handle(conn,err=>{})}},function(module,exports,__webpack_require__){"use strict";function and(){function matches(a){"string"==typeof a&&(a=multiaddr(a));let out=partialMatch(a.protoNames());return null!==out&&0===out.length}function partialMatch(a){return a.lengthor(and(_Circuit,CircuitRecursive),_Circuit),Circuit=CircuitRecursive(),IPFS=or(and(Circuit,_IPFS,Circuit),and(_IPFS,Circuit),and(Circuit,_IPFS),Circuit,_IPFS);exports.DNS=DNS,exports.DNS4=DNS4,exports.DNS6=DNS6,exports.IP=IP,exports.TCP=TCP,exports.UDP=UDP,exports.UTP=UTP,exports.HTTP=HTTP,exports.WebSockets=WebSockets,exports.WebSocketsSecure=WebSocketsSecure,exports.WebRTCStar=WebRTCStar,exports.WebRTCDirect=WebRTCDirect,exports.Reliable=Reliable,exports.Circuit=Circuit,exports.IPFS=IPFS},function(module,exports,__webpack_require__){"use strict";const baseTable=__webpack_require__(65),varintBufferEncode=__webpack_require__(238).varintBufferEncode,varintTable={};module.exports=varintTable;for(let encodingName in baseTable){let code=baseTable[encodingName];varintTable[encodingName]=varintBufferEncode(code)}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function randomId(){return(~~(1e9*Math.random())).toString(36)}function encode(msg,callback){const values=Buffer.isBuffer(msg)?[msg]:[new Buffer(msg)];pull(pull.values(values),pullLP.encode(),pull.collect((err,encoded)=>{if(err)return callback(err);callback(null,encoded[0])}))}function createLogger(type){function printer(logger){return msg=>{Array.isArray(msg)&&(msg=msg.join(" ")),logger("(%s) %s",rId,msg)}}const rId=randomId(),log=printer(debug("mss:"+type));return log.error=printer(debug("mss:"+type+":error")),log}const pull=__webpack_require__(4),pullLP=__webpack_require__(23),debug=__webpack_require__(3);exports=module.exports,exports.writeEncoded=((writer,msg,callback)=>{encode(msg,(err,msg)=>{if(err)return callback(err);writer.write(msg)})}),exports.log={},exports.log.dialer=(()=>{return createLogger("dialer\t")}),exports.log.listener=(()=>{return createLogger("listener\t")})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(setImmediate,process){function nodeify(promise,cb){return"function"!=typeof cb?promise:promise.then(function(res){nextTick(function(){cb(null,res)})},function(err){nextTick(function(){cb(err)})})}function nodeifyThis(cb){return nodeify(this,cb)}function extend(prom){if(prom&&isPromise(prom)){prom.nodeify=nodeifyThis;var then=prom.then;return prom.then=function(){return extend(then.apply(this,arguments))},prom}"function"==typeof prom?prom.prototype.nodeify=nodeifyThis:Promise.prototype.nodeify=nodeifyThis}function NodeifyPromise(fn){if(!(this instanceof NodeifyPromise))return new NodeifyPromise(fn);Promise.call(this,fn),extend(this)}var nextTick,Promise=__webpack_require__(586),isPromise=__webpack_require__(204);nextTick="function"==typeof setImmediate?setImmediate:"object"==typeof process&&process&&process.nextTick?process.nextTick:function(cb){setTimeout(cb,0)},module.exports=nodeify,nodeify.extend=extend,nodeify.Promise=NodeifyPromise,NodeifyPromise.prototype=Object.create(Promise.prototype),NodeifyPromise.prototype.constructor=NodeifyPromise}).call(exports,__webpack_require__(37).setImmediate,__webpack_require__(5))},function(module,exports){exports.encode=function(obj){var str="";for(var i in obj)obj.hasOwnProperty(i)&&(str.length&&(str+="&"),str+=encodeURIComponent(i)+"="+encodeURIComponent(obj[i]));return str},exports.decode=function(qs){for(var qry={},pairs=qs.split("&"),i=0,l=pairs.length;i>>2,bn.words[2]=(63&b32[22])<<20|b32[23]<<12|b32[24]<<4|b32[25]>>>4,bn.words[3]=(255&b32[19])<<18|b32[20]<<10|b32[21]<<2|b32[22]>>>6,bn.words[4]=(3&b32[15])<<24|b32[16]<<16|b32[17]<<8|b32[18],bn.words[5]=(15&b32[12])<<22|b32[13]<<14|b32[14]<<6|b32[15]>>>2,bn.words[6]=(63&b32[9])<<20|b32[10]<<12|b32[11]<<4|b32[12]>>>4,bn.words[7]=(255&b32[6])<<18|b32[7]<<10|b32[8]<<2|b32[9]>>>6,bn.words[8]=(3&b32[2])<<24|b32[3]<<16|b32[4]<<8|b32[5],bn.words[9]=b32[0]<<14|b32[1]<<6|b32[2]>>>2,bn.length=10,bn.strip()},BN.prototype.toBuffer=function(){for(var w=this.words,i=this.length;i<10;++i)w[i]=0;return Buffer.from([w[9]>>>14&255,w[9]>>>6&255,(63&w[9])<<2|w[8]>>>24&3,w[8]>>>16&255,w[8]>>>8&255,255&w[8],w[7]>>>18&255,w[7]>>>10&255,w[7]>>>2&255,(3&w[7])<<6|w[6]>>>20&63,w[6]>>>12&255,w[6]>>>4&255,(15&w[6])<<4|w[5]>>>22&15,w[5]>>>14&255,w[5]>>>6&255,(63&w[5])<<2|w[4]>>>24&3,w[4]>>>16&255,w[4]>>>8&255,255&w[4],w[3]>>>18&255,w[3]>>>10&255,w[3]>>>2&255,(3&w[3])<<6|w[2]>>>20&63,w[2]>>>12&255,w[2]>>>4&255,(15&w[2])<<4|w[1]>>>22&15,w[1]>>>14&255,w[1]>>>6&255,(63&w[1])<<2|w[0]>>>24&3,w[0]>>>16&255,w[0]>>>8&255,255&w[0]])},BN.prototype.clone=function(){var r=new BN;r.words=new Array(this.length);for(var i=0;i1&&0==(0|this.words[this.length-1]);)this.length--;return this},BN.prototype.normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.isEven=function(){return 0==(1&this.words[0])},BN.prototype.isOdd=function(){return 1==(1&this.words[0])},BN.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},BN.prototype.ucmp=function(num){if(this.length!==num.length)return this.length>num.length?1:-1;for(var i=this.length-1;i>=0;--i)if(this.words[i]!==num.words[i])return this.words[i]>num.words[i]?1:-1;return 0},BN.prototype.gtOne=function(){return this.length>1||this.words[0]>1},BN.prototype.isOverflow=function(){return this.ucmp(BN.n)>=0},BN.prototype.isHigh=function(){return 1===this.ucmp(BN.nh)},BN.prototype.bitLengthGT256=function(){return this.length>10||10===this.length&&this.words[9]>4194303},BN.prototype.iuaddn=function(num){this.words[0]+=num;for(var i=0;this.words[i]>67108863&&inum.length?(a=this,b=num):(a=num,b=this);for(var i=0,carry=0;i>>26}for(;0!==carry&&i>>26;if(this.length=a.length,0!==carry)this.words[this.length++]=carry;else if(a!==this)for(;i0?(a=this,b=num):(a=num,b=this);for(var i=0,carry=0;i>26,this.words[i]=67108863&word}for(;0!==carry&&i>26,this.words[i]=67108863&word;if(0===carry&&i>>26,rword=67108863&carry,j=Math.max(0,k-num1.length+1),maxJ=Math.min(k,num2.length-1);j<=maxJ;j++){var i=k-j,a=num1.words[i],b=num2.words[j],r=a*b+rword;ncarry+=r/67108864|0,rword=67108863&r}out.words[k]=rword,carry=ncarry}return 0!==carry&&(out.words[out.length++]=carry),out.strip()},BN.umulTo10x10=Math.imul?optimized.umulTo10x10:BN.umulTo,BN.umulnTo=function(num,k,out){if(0===k)return out.words=[0],out.length=1,out;for(var i=0,carry=0;i0?(out.words[i]=carry,out.length=num.length+1):out.length=num.length,out},BN.prototype.umul=function(num){var out=new BN;return out.words=new Array(this.length+num.length),10===this.length&&10===num.length?BN.umulTo10x10(this,num,out):1===this.length?BN.umulnTo(num,this.words[0],out):1===num.length?BN.umulnTo(this,num.words[0],out):BN.umulTo(this,num,out)},BN.prototype.isplit=function(output){output.length=Math.min(this.length,9);for(var i=0;i>>22,prev=word}return prev>>>=22,this.words[i-10]=prev,0===prev&&this.length>10?this.length-=10:this.length-=9,this},BN.prototype.fireduce=function(){return this.isOverflow()&&this.isub(BN.n),this},BN.prototype.ureduce=function(){var num=this.clone().isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp);return num.bitLengthGT256()&&(num=num.isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp),num.bitLengthGT256()&&(num=num.isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp))),num.fireduce()},BN.prototype.ishrn=function(n){for(var mask=(1<=0;--i){var word=this.words[i];this.words[i]=carry<>>n,carry=word&mask}return this.length>1&&0===this.words[this.length-1]&&(this.length-=1),this},BN.prototype.uinvm=function(){for(var x=this.clone(),y=BN.n.clone(),A=BN.fromNumber(1),B=BN.fromNumber(0),C=BN.fromNumber(0),D=BN.fromNumber(1);x.isEven()&&y.isEven();){for(var k=1,m=1;0==(x.words[0]&m)&&0==(y.words[0]&m)&&k<26;++k,m<<=1);x.ishrn(k),y.ishrn(k)}for(var yp=y.clone(),xp=x.clone();!x.isZero();){for(var i=0,im=1;0==(x.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(x.ishrn(i);i-- >0;)(A.isOdd()||B.isOdd())&&(A.iadd(yp),B.isub(xp)),A.ishrn(1),B.ishrn(1);for(var j=0,jm=1;0==(y.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(y.ishrn(j);j-- >0;)(C.isOdd()||D.isOdd())&&(C.iadd(yp),D.isub(xp)),C.ishrn(1),D.ishrn(1);x.ucmp(y)>=0?(x.isub(y),A.isub(C),B.isub(D)):(y.isub(x),C.isub(A),D.isub(B))}if(1===C.negative){C.negative=0;var result=C.ureduce();return result.negative^=1,result.normSign().iadd(BN.n)}return C.ureduce()},BN.prototype.imulK=function(){this.words[this.length]=0,this.words[this.length+1]=0,this.length+=2;for(var i=0,lo=0;i0?this.isub(BN.p):this.strip(),this},BN.prototype.redNeg=function(){return this.isZero()?BN.fromNumber(0):BN.p.sub(this)},BN.prototype.redAdd=function(num){return this.clone().redIAdd(num)},BN.prototype.redIAdd=function(num){return this.iadd(num),this.ucmp(BN.p)>=0&&this.isub(BN.p),this},BN.prototype.redIAdd7=function(){return this.iuaddn(7),this.ucmp(BN.p)>=0&&this.isub(BN.p),this},BN.prototype.redSub=function(num){return this.clone().redISub(num)},BN.prototype.redISub=function(num){return this.isub(num),0!==this.negative&&this.iadd(BN.p),this},BN.prototype.redMul=function(num){return this.umul(num).redIReduce()},BN.prototype.redSqr=function(){return this.umul(this).redIReduce()},BN.prototype.redSqrt=function(){if(this.isZero())return this.clone();for(var wv2=this.redSqr(),wv4=wv2.redSqr(),wv12=wv4.redSqr().redMul(wv4),wv14=wv12.redMul(wv2),wv15=wv14.redMul(this),out=wv15,i=0;i<54;++i)out=out.redSqr().redSqr().redSqr().redSqr().redMul(wv15);for(out=out.redSqr().redSqr().redSqr().redSqr().redMul(wv14),i=0;i<5;++i)out=out.redSqr().redSqr().redSqr().redSqr().redMul(wv15);return out=out.redSqr().redSqr().redSqr().redSqr().redMul(wv12),out=out.redSqr().redSqr().redSqr().redSqr().redSqr().redSqr().redMul(wv12),0===out.redSqr().ucmp(this)?out:null},BN.prototype.redInvm=function(){for(var a=this.clone(),b=BN.p.clone(),x1=BN.fromNumber(1),x2=BN.fromNumber(0);a.gtOne()&&b.gtOne();){for(var i=0,im=1;0==(a.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(a.ishrn(i);i-- >0;)x1.isOdd()&&x1.iadd(BN.p),x1.ishrn(1);for(var j=0,jm=1;0==(b.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(b.ishrn(j);j-- >0;)x2.isOdd()&&x2.iadd(BN.p),x2.ishrn(1);a.ucmp(b)>=0?(a.isub(b),x1.isub(x2)):(b.isub(a),x2.isub(x1))}var res;return res=1===a.length&&1===a.words[0]?x1:x2,0!==res.negative&&res.iadd(BN.p),0!==res.negative?(res.negative=0,res.redIReduce().redNeg()):res.redIReduce()},BN.prototype.getNAF=function(w){for(var naf=[],ws=1<>1,k=this.clone();!k.isZero();){for(var i=0,m=1;0==(k.words[0]&m)&&i<26;++i,m<<=1)naf.push(0);if(0!==i)k.ishrn(i);else{var mod=k.words[0]&wsm1;if(mod>=ws2)naf.push(ws2-mod),k.iuaddn(mod-ws2).ishrn(1);else if(naf.push(mod),k.words[0]-=mod,!k.isZero()){for(i=w-1;i>0;--i)naf.push(0);k.ishrn(w)}}}return naf},BN.prototype.inspect=function(){if(this.isZero())return"0";for(var buffer=this.toBuffer().toString("hex"),i=0;"0"===buffer[i];++i);return buffer.slice(i)},BN.n=BN.fromBuffer(Buffer.from("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","hex")),BN.nh=BN.n.clone().ishrn(1),BN.nc=BN.fromBuffer(Buffer.from("000000000000000000000000000000014551231950B75FC4402DA1732FC9BEBF","hex")),BN.p=BN.fromBuffer(Buffer.from("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","hex")),BN.psn=BN.p.sub(BN.n),BN.tmp=new BN,BN.tmp.words=new Array(10),function(){BN.fromNumber(1).words[3]=0}(),module.exports=BN},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function eachOfArrayLike(coll,iteratee,callback){function iteratorCallback(err,value){err?callback(err):++completed!==length&&value!==_breakLoop2.default||callback(null)}callback=(0,_once2.default)(callback||_noop2.default);var index=0,completed=0,length=coll.length;for(0===length&&callback(null);index>2,mant=(3&buf[0])<<8|buf[1],exp?31===exp?sign*(mant?NaN:Infinity):sign*Math.pow(2,exp-25)*(1024+mant):5.960464477539063e-8*sign*mant},exports.arrayBufferToBignumber=function(buf){const len=buf.byteLength;let res="";for(let i=0;i{const res=new Map,keys=Object.keys(obj),length=keys.length;for(let i=0;i{return f*SHIFT16+g}),exports.buildInt64=((f1,f2,g1,g2)=>{const f=exports.buildInt32(f1,f2),g=exports.buildInt32(g1,g2);return f>2097151?new Bignumber(f).times(SHIFT32).plus(g):f*SHIFT32+g}),exports.writeHalf=function(buf,half){const u32=new Buffer(4);u32.writeFloatBE(half,0);const u=u32.readUInt32BE(0);if(0!=(8191&u))return!1;var s16=u>>16&32768;const exp=u>>23&255,mant=8388607&u;if(exp>=113&&exp<=142)s16+=(exp-112<<10)+(mant>>13);else{if(!(exp>=103&&exp<113))return!1;if(mant&(1<<126-exp)-1)return!1;s16+=mant+8388608>>126-exp}return buf.writeUInt16BE(s16,0),!0},exports.keySorter=function(a,b){var lenA=a[0].byteLength,lenB=b[0].byteLength;return lenA>lenB?1:lenB>lenA?-1:a[0].compare(b[0])},exports.isNegativeZero=(x=>{return 0===x&&1/x<0}),exports.nextPowerOf2=(n=>{let count=0;if(n&&!(n&n-1))return n;for(;0!==n;)n>>=1,count+=1;return 1<>5]|=128<>>9<<4)]=len;for(var a=1732584193,b=-271733879,c=-1732584194,d=271733878,i=0;i>16)+(y>>16)+(lsw>>16)<<16|65535&lsw}function bit_rol(num,cnt){return num<>>32-cnt}var makeHash=__webpack_require__(323);module.exports=function(buf){return makeHash(buf,core_md5)}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const pull=__webpack_require__(4),levelup=__webpack_require__(470),asyncFilter=__webpack_require__(16).utils.asyncFilter,asyncSort=__webpack_require__(16).utils.asyncSort,Key=__webpack_require__(16).Key;class LevelDatastore{constructor(path,opts){this.db=levelup(path,Object.assign(opts||{},{compression:!1,valueEncoding:"binary"}))}open(callback){this.db.open(callback)}put(key,value,callback){this.db.put(key.toString(),value,callback)}get(key,callback){this.db.get(key.toString(),callback)}has(key,callback){this.db.get(key.toString(),(err,res)=>{if(err)return err.notFound?void callback(null,!1):void callback(err);callback(null,!0)})}delete(key,callback){this.db.del(key.toString(),callback)}close(callback){this.db.close(callback)}batch(){const ops=[];return{put:(key,value)=>{ops.push({type:"put",key:key.toString(),value:value})},delete:key=>{ops.push({type:"del",key:key.toString()})},commit:callback=>{this.db.batch(ops,callback)}}}query(q){let values=!0;null!=q.keysOnly&&(values=!q.keysOnly);const iter=this.db.db.iterator({keys:!0,values:values,keyAsBuffer:!0}),rawStream=(end,cb)=>{if(end)return iter.end(err=>{cb(err||end)});iter.next((err,key,value)=>{if(err)return cb(err);if(null==err&&null==key&&null==value)return iter.end(err=>{cb(err||!0)});const res={key:new Key(key,!1)};values&&(res.value=new Buffer(value)),cb(null,res)})} +;let tasks=[rawStream],filters=[];if(null!=q.prefix){const prefix=q.prefix;filters.push((e,cb)=>cb(null,e.key.toString().startsWith(prefix)))}if(null!=q.filters&&(filters=filters.concat(q.filters)),tasks=tasks.concat(filters.map(f=>asyncFilter(f))),null!=q.orders&&(tasks=tasks.concat(q.orders.map(o=>asyncSort(o)))),null!=q.offset){let i=0;tasks.push(pull.filter(()=>i++>=q.offset))}return null!=q.limit&&tasks.push(pull.take(q.limit)),pull.apply(null,tasks)}}module.exports=LevelDatastore}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function Transport(opts){this.path=opts.path,this.hostname=opts.hostname,this.port=opts.port,this.secure=opts.secure,this.query=opts.query,this.timestampParam=opts.timestampParam,this.timestampRequests=opts.timestampRequests,this.readyState="",this.agent=opts.agent||!1,this.socket=opts.socket,this.enablesXDR=opts.enablesXDR,this.pfx=opts.pfx,this.key=opts.key,this.passphrase=opts.passphrase,this.cert=opts.cert,this.ca=opts.ca,this.ciphers=opts.ciphers,this.rejectUnauthorized=opts.rejectUnauthorized,this.forceNode=opts.forceNode,this.extraHeaders=opts.extraHeaders,this.localAddress=opts.localAddress}var parser=__webpack_require__(50),Emitter=__webpack_require__(49);module.exports=Transport,Emitter(Transport.prototype),Transport.prototype.onError=function(msg,desc){var err=new Error(msg);return err.type="TransportError",err.description=desc,this.emit("error",err),this},Transport.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},Transport.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},Transport.prototype.send=function(packets){if("open"!==this.readyState)throw new Error("Transport not open");this.write(packets)},Transport.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},Transport.prototype.onData=function(data){var packet=parser.decodePacket(data,this.socket.binaryType);this.onPacket(packet)},Transport.prototype.onPacket=function(packet){this.emit("packet",packet)},Transport.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(module,exports,__webpack_require__){(function(global){var hasCORS=__webpack_require__(375);module.exports=function(opts){var xdomain=opts.xdomain,xscheme=opts.xscheme,enablesXDR=opts.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!xdomain||hasCORS))return new XMLHttpRequest}catch(e){}try{if("undefined"!=typeof XDomainRequest&&!xscheme&&enablesXDR)return new XDomainRequest}catch(e){}if(!xdomain)try{return new(global[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){var hash=exports;hash.utils=__webpack_require__(27),hash.common=__webpack_require__(60),hash.sha=__webpack_require__(379),hash.ripemd=__webpack_require__(378),hash.hmac=__webpack_require__(377),hash.sha1=hash.sha.sha1,hash.sha256=hash.sha.sha256,hash.sha224=hash.sha.sha224,hash.sha384=hash.sha.sha384,hash.sha512=hash.sha.sha512,hash.ripemd160=hash.ripemd.ripemd160},function(module,exports){var indexOf=[].indexOf;module.exports=function(arr,obj){if(indexOf)return arr.indexOf(obj);for(var i=0;i{busy?abortCb=cb:cb(abort)}):read(abort,cb)):read(null,(end,data)=>{end?cb(end):aborted?cb(aborted):(busy=!0,test(data,(err,valid)=>{busy=!1,aborted?(cb(aborted),abortCb(aborted)):err?next(err,cb):valid?cb(null,data):next(null,cb)}))})}}},exports.asyncSort=function(sorter){const source=Source(),sink=pull.collect((err,ary)=>{if(err)return source.abort(err);sorter(ary,(err,res)=>{if(err)return source.abort(err);source.resolve(pull.values(ary))})});return function(read){return sink(read),source}},exports.replaceStartWith=function(s,r){const matcher=new RegExp("^"+r);return s.replace(matcher,"")},exports.tmpdir=(()=>{return path.join(os.tmpdir(),uuid())})},function(module,exports,__webpack_require__){"use strict";module.exports={maxProvidersPerRequest:3,providerRequestTimeout:1e4,hasBlockTimeout:15e3,provideTimeout:15e3,kMaxPriority:Math.pow(2,31)-1,rebroadcastDelay:1e4,maxListeners:1e3}},function(module,exports,__webpack_require__){"use strict";module.exports=class Dir{}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(12),assert=__webpack_require__(9);class DAGNode{constructor(data,links,serialized,multihash){assert(serialized,"DAGNode needs its serialized format"),assert(multihash,"DAGNode needs its multihash"),"string"==typeof multihash&&(multihash=mh.fromB58String(multihash)),this._data=data||new Buffer(0),this._links=links||[],this._serialized=serialized,this._multihash=multihash,this._size=this.links.reduce((sum,l)=>sum+l.size,this.serialized.length),this._json={data:this.data,links:this.links.map(l=>l.toJSON()),multihash:mh.toB58String(this.multihash),size:this.size}}toJSON(){return this._json}toString(){return`DAGNode <${mh.toB58String(this.multihash)} - data: "${this.data.toString()}", links: ${this.links.length}, size: ${this.size}>`}get data(){return this._data}set data(data){throw new Error("Can't set property: 'data' is immutable")}get links(){return this._links}set links(links){throw new Error("Can't set property: 'links' is immutable")}get serialized(){return this._serialized}set serialized(serialized){throw new Error("Can't set property: 'serialized' is immutable")}get size(){return this._size}set size(size){throw new Error("Can't set property: 'size' is immutable")}get multihash(){return this._multihash}set multihash(multihash){throw new Error("Can't set property: 'multihash' is immutable")}}exports=module.exports=DAGNode,exports.create=__webpack_require__(85),exports.clone=__webpack_require__(437),exports.addLink=__webpack_require__(436),exports.rmLink=__webpack_require__(438)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function cid(node,callback){if(node.multihash)return callback(null,new CID(node.multihash));callback(new Error("not valid dagPB node"))}function serialize(node,callback){let serialized;try{const pb=toProtoBuf(node);serialized=proto.PBNode.encode(pb)}catch(err){return callback(err)}callback(null,serialized)}function deserialize(data,callback){const pbn=proto.PBNode.decode(data),links=pbn.Links.map(link=>{return new DAGLink(link.Name,link.Tsize,link.Hash)}),buf=pbn.Data||new Buffer(0);DAGNode.create(buf,links,callback)}function toProtoBuf(node){const pbn={};return node.data&&node.data.length>0?pbn.Data=node.data:pbn.Data=null,node.links&&node.links.length>0?pbn.Links=node.links.map(link=>{return{Hash:link.multihash,Name:link.name,Tsize:link.size}}):pbn.Links=null,pbn}const CID=__webpack_require__(434),protobuf=__webpack_require__(31),proto=protobuf(__webpack_require__(439)),DAGLink=__webpack_require__(51),DAGNode=__webpack_require__(118);exports=module.exports,exports.serialize=serialize,exports.deserialize=deserialize,exports.cid=cid}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function createTrieResolver(multicodec,leafResolver){function mapFromEthObj(trieNode,options,callback){mapFromBaseTrie(trieNode,options,(err,basePaths)=>{if(err)return callback(err);if(!leafResolver)return callback(null,basePaths);let paths=basePaths.slice();each(basePaths.filter(child=>Buffer.isBuffer(child.value)),(child,cb)=>{return waterfall([cb=>leafResolver.util.deserialize(child.value,cb),(ethObj,cb)=>leafResolver.resolver._mapFromEthObject(ethObj,options,cb)],(err,grandChildren)=>{if(err)return cb(err);grandChildren.forEach(grandChild=>{paths.push({path:child.path+"/"+grandChild.path,value:grandChild.value})}),cb()})},err=>{if(err)return callback(err);callback(null,paths)})})}function mapFromBaseTrie(trieNode,options,callback){let paths=[];"leaf"===trieNode.type&&paths.push({path:nibbleToPath(trieNode.getKey()),value:trieNode.getValue()}),each(trieNode.getChildren(),(childData,next)=>{const key=nibbleToPath(childData[0]),value=childData[1];if(EthTrieNode.isRawNode(value)){const childNode=new EthTrieNode(value);paths.push({path:key,value:childNode}),mapFromBaseTrie(childNode,options,(err,subtree)=>{if(err)return next(err);subtree.forEach(path=>{path.path=key+"/"+path.path}),paths=paths.concat(subtree),next()})}else{let link={"/":cidFromHash(multicodec,value).toBaseEncodedString()};paths.push({path:key,value:link}),next()}},err=>{if(err)return callback(err);callback(null,paths)})}const baseTrie=createResolver(multicodec,EthTrieNode,mapFromEthObj);return baseTrie.util.deserialize=asyncify(serialized=>{return new EthTrieNode(rlp.decode(serialized))}),baseTrie}function nibbleToPath(data){return data.map(num=>num.toString(16)).join("/")}const each=__webpack_require__(19),waterfall=__webpack_require__(7),asyncify=__webpack_require__(70),rlp=__webpack_require__(45),EthTrieNode=__webpack_require__(560),createResolver=__webpack_require__(62),cidFromHash=(__webpack_require__(445),__webpack_require__(446),__webpack_require__(202),__webpack_require__(201),__webpack_require__(200),__webpack_require__(53));module.exports=createTrieResolver}).call(exports,__webpack_require__(0).Buffer)},function(module,exports){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_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"}},function(module,exports,__webpack_require__){(function(Buffer,process){function Level(location){if(!(this instanceof Level))return new Level(location);AbstractLevelDOWN.call(this,location)}module.exports=Level;var AbstractLevelDOWN=__webpack_require__(216).AbstractLevelDOWN,util=__webpack_require__(32),Iterator=__webpack_require__(467),xtend=__webpack_require__(38);util.inherits(Level,AbstractLevelDOWN),Level.prototype._open=function(options,callback){function onerror(ev){callback(ev.target.error)}function onsuccess(db){self._db=db;var exists=self._db.objectStoreNames.contains(self._idbOpts.storeName);if(options.errorIfExists&&exists)return self._db.close(),void callback(new Error("store already exists"));if(!options.createIfMissing&&!exists)return self._db.close(),void callback(new Error("store does not exist"));if(options.createIfMissing&&!exists){self._db.close();var req2=indexedDB.open(self.location,self._db.version+1);return req2.onerror=function(ev){callback(ev.target.error)},req2.onupgradeneeded=function(){req2.result.createObjectStore(self._idbOpts.storeName,self._idbOpts)},void(req2.onsuccess=function(){self._db=req2.result,callback(null,self)})}callback(null,self)}var self=this;if(this._idbOpts=xtend({storeName:this.location,keyEncoding:"none",valueEncoding:"none"},options),this._idbOpts.idb)onsuccess(this._idbOpts.idb);else{var req=indexedDB.open(this.location);req.onerror=onerror,req.onsuccess=function(){onsuccess(req.result)}}},Level.prototype._get=function(key,options,callback){options=xtend(this._idbOpts,options);var origKey=key;"binary"!==options.keyEncoding||Array.isArray(key)||(key=Array.prototype.slice.call(key));var tx=this._db.transaction(this._idbOpts.storeName),req=tx.objectStore(this._idbOpts.storeName).openCursor(IDBKeyRange.only(key));tx.onabort=function(){callback(tx.error)},req.onsuccess=function(){var cursor=req.result;if(cursor){var value=cursor.value;if(value instanceof Uint8Array&&(value=new Buffer(value)),"binary"!==options.valueEncoding||Buffer.isBuffer(value)||(value=new Buffer(value)),options.asBuffer&&!Buffer.isBuffer(value))if(null==value)value=new Buffer(0);else if("string"==typeof value)value=new Buffer(value);else if("boolean"==typeof value)value=new Buffer(String(value));else if("number"==typeof value)value=new Buffer(String(value));else if(Array.isArray(value))value=new Buffer(String(value));else{if(!(value instanceof Uint8Array))return void callback(new TypeError("can't coerce `"+value.constructor.name+"` into a Buffer"));value=new Buffer(value)}return void callback(null,value,origKey)}return void callback(new Error("NotFound"))}},Level.prototype._del=function(key,options,callback){options=xtend(this._idbOpts,options),"binary"!==options.keyEncoding||Array.isArray(key)||(key=Array.prototype.slice.call(key));var mode="readwrite";options.sync===!0&&(mode="readwriteflush");var tx=this._db.transaction(this._idbOpts.storeName,mode);tx.objectStore(this._idbOpts.storeName).delete(key);tx.onabort=function(){callback(tx.error)},tx.oncomplete=function(){callback()}},Level.prototype._put=function(key,value,options,callback){options=xtend(this._idbOpts,options),"binary"!==options.keyEncoding||Array.isArray(key)||(key=Array.prototype.slice.call(key));var mode="readwrite";options.sync===!0&&(mode="readwriteflush");var tx=this._db.transaction(this._idbOpts.storeName,mode);tx.objectStore(this._idbOpts.storeName).put(value,key);tx.onabort=function(){callback(tx.error)},tx.oncomplete=function(){callback()}},Level.prototype._iterator=function(options){return new Iterator(this,options)},Level.prototype._batch=function(array,options,callback){if(0===array.length)return process.nextTick(callback);var mode="readwrite";options.sync===!0&&(mode="readwriteflush");var tx=this._db.transaction(this._idbOpts.storeName,mode),store=tx.objectStore(this._idbOpts.storeName);tx.onabort=function(){callback(tx.error)},tx.oncomplete=function(){callback()},array.forEach(function(currentOp){"binary"!==xtend(options,currentOp).keyEncoding||Array.isArray(currentOp.key)||(currentOp.key=Array.prototype.slice.call(currentOp.key)),"del"===currentOp.type?store.delete(currentOp.key):store.put(currentOp.value,currentOp.key)})},Level.prototype._close=function(callback){this._db.close(),process.nextTick(callback)},Level.prototype._approximateSize=function(start,end,callback){var err=new Error("Not implemented");if(callback)return void process.nextTick(function(){callback(err)});throw err},Level.destroy=function(db,callback){var idbOpts;if(null!=db&&"object"==typeof db)idbOpts=xtend({location:db.location,storeName:db.location},db._idbOpts);else{if("string"!=typeof db)throw new TypeError("location must be a string or an object");idbOpts={location:db,storeName:db}}if("string"!=typeof idbOpts.location)throw new TypeError("location must be a string");if("string"!=typeof idbOpts.storeName)throw new TypeError("db.storeName must be a string");var req=indexedDB.open(idbOpts.location);req.onerror=function(ev){callback(ev.target.error)},req.onsuccess=function(){function deleteDatabase(name){var req2=indexedDB.deleteDatabase(name);req2.onerror=function(ev){callback(ev.target.error)},req2.onsuccess=function(){callback()}}var db=req.result;if(db.close(),0===db.objectStoreNames.length)return void deleteDatabase(idbOpts.location);if(!db.objectStoreNames.contains(idbOpts.storeName))return void callback();var req2=indexedDB.open(idbOpts.location,db.version+1);req2.onerror=function(ev){callback(ev.target.error)},req2.onupgradeneeded=function(){db=req2.result,db.deleteObjectStore(idbOpts.storeName)},req2.onsuccess=function(){db=req2.result,db.close(),0===db.objectStoreNames.length?deleteDatabase(idbOpts.location):callback()}}}}).call(exports,__webpack_require__(0).Buffer,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";module.exports=`enum KeyType { RSA = 0; Ed25519 = 1; Secp256k1 = 2; @@ -22,14 +20,13 @@ message PublicKey { message PrivateKey { required KeyType Type = 1; required bytes Data = 2; -}`},function(module,exports,__webpack_require__){"use strict";module.exports={PROTOCOL:"/ipfs/ping/1.0.0",PING_LENGTH:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const protobuf=__webpack_require__(39),PeerId=__webpack_require__(31),crypto=__webpack_require__(50),parallel=__webpack_require__(46),waterfall=__webpack_require__(9),debug=__webpack_require__(3),log=debug("libp2p:secio");log.error=debug("libp2p:secio:error");const pbm=protobuf(__webpack_require__(597)),support=__webpack_require__(144);exports.createProposal=(state=>{return state.proposal.out={rand:crypto.randomBytes(16),pubkey:state.key.local.public.bytes,exchanges:support.exchanges.join(","),ciphers:support.ciphers.join(","),hashes:support.hashes.join(",")},state.proposalEncoded.out=pbm.Propose.encode(state.proposal.out),state.proposalEncoded.out}),exports.createExchange=((state,callback)=>{crypto.generateEphemeralKeyPair(state.protocols.local.curveT,(err,res)=>{if(err)return callback(err);state.ephemeralKey.local=res.key,state.shared.generate=res.genSharedKey;const selectionOut=Buffer.concat([state.proposalEncoded.out,state.proposalEncoded.in,state.ephemeralKey.local]);state.key.local.sign(selectionOut,(err,sig)=>{if(err)return callback(err);state.exchange.out={epubkey:state.ephemeralKey.local,signature:sig},callback(null,pbm.Exchange.encode(state.exchange.out))})})}),exports.identify=((state,msg,callback)=>{log("1.1 identify"),state.proposalEncoded.in=msg,state.proposal.in=pbm.Propose.decode(msg);const pubkey=state.proposal.in.pubkey;state.key.remote=crypto.unmarshalPublicKey(pubkey),PeerId.createFromPubKey(pubkey.toString("base64"),(err,remoteId)=>{if(err)return callback(err);state.id.remote=remoteId,log("1.1 identify - %s - identified remote peer as %s",state.id.local.toB58String(),state.id.remote.toB58String()),callback()})}),exports.selectProtocols=((state,callback)=>{log("1.2 selection");const local={pubKeyBytes:state.key.local.public.bytes,exchanges:support.exchanges,hashes:support.hashes,ciphers:support.ciphers,nonce:state.proposal.out.rand},remote={pubKeyBytes:state.proposal.in.pubkey,exchanges:state.proposal.in.exchanges.split(","),hashes:state.proposal.in.hashes.split(","),ciphers:state.proposal.in.ciphers.split(","),nonce:state.proposal.in.rand};support.selectBest(local,remote,(err,selected)=>{if(err)return callback(err);state.protocols.remote={order:selected.order,curveT:selected.curveT,cipherT:selected.cipherT,hashT:selected.hashT},state.protocols.local={order:selected.order,curveT:selected.curveT,cipherT:selected.cipherT,hashT:selected.hashT},callback()})}),exports.verify=((state,msg,callback)=>{log("2.1. verify"),state.exchange.in=pbm.Exchange.decode(msg),state.ephemeralKey.remote=state.exchange.in.epubkey;const selectionIn=Buffer.concat([state.proposalEncoded.in,state.proposalEncoded.out,state.ephemeralKey.remote]);state.key.remote.verify(selectionIn,state.exchange.in.signature,(err,sigOk)=>{return err?callback(err):sigOk?(log("2.1. verify - signature verified"),void callback()):callback(new Error("Bad signature"))})}),exports.generateKeys=((state,callback)=>{log("2.2. keys"),waterfall([cb=>state.shared.generate(state.exchange.in.epubkey,cb),(secret,cb)=>{state.shared.secret=secret,crypto.keyStretcher(state.protocols.local.cipherT,state.protocols.local.hashT,state.shared.secret,cb)},(keys,cb)=>{if(state.protocols.local.order>0)state.protocols.local.keys=keys.k1,state.protocols.remote.keys=keys.k2;else{if(!(state.protocols.local.order<0))return cb(new Error("you are trying to talk to yourself"));state.protocols.local.keys=keys.k2,state.protocols.remote.keys=keys.k1}log("2.3. mac + cipher"),parallel([cb=>support.makeMacAndCipher(state.protocols.local,cb),cb=>support.makeMacAndCipher(state.protocols.remote,cb)],cb)}],callback)}),exports.verifyNonce=((state,n2)=>{const n1=state.proposal.out.rand;if(!n1.equals(n2))throw new Error(`Failed to read our encrypted nonce: ${n1.toString("hex")} != ${n2.toString("hex")}`)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function makeMac(hash,key,callback){crypto.hmac.create(hash,key,callback)}function makeCipher(cipherType,iv,key,callback){if("AES-128"===cipherType||"AES-256"===cipherType)return crypto.aes.create(key,iv,callback);callback(new Error(`unrecognized cipher type: ${cipherType}`))}const mh=__webpack_require__(30),lp=__webpack_require__(28),pull=__webpack_require__(5),crypto=__webpack_require__(50),parallel=__webpack_require__(46);exports.exchanges=["P-256","P-384","P-521"],exports.ciphers=["AES-256","AES-128"],exports.hashes=["SHA256","SHA512"],exports.theBest=((order,p1,p2)=>{let first,second;if(order<0)first=p2,second=p1;else{if(!(order>0))return p1[0];first=p1,second=p2}for(let firstCandidate of first)for(let secondCandidate of second)if(firstCandidate===secondCandidate)return firstCandidate;throw new Error("No algorithms in common!")}),exports.makeMacAndCipher=((target,callback)=>{parallel([cb=>makeMac(target.hashT,target.keys.macKey,cb),cb=>makeCipher(target.cipherT,target.keys.iv,target.keys.cipherKey,cb)],(err,macAndCipher)=>{if(err)return callback(err);target.mac=macAndCipher[0],target.cipher=macAndCipher[1],callback()})}),exports.selectBest=((local,remote,cb)=>{exports.digest(Buffer.concat([remote.pubKeyBytes,local.nonce]),(err,oh1)=>{if(err)return cb(err);exports.digest(Buffer.concat([local.pubKeyBytes,remote.nonce]),(err,oh2)=>{if(err)return cb(err);const order=Buffer.compare(oh1,oh2);if(0===order)return cb(new Error("you are trying to talk to yourself"));cb(null,{curveT:exports.theBest(order,local.exchanges,remote.exchanges),cipherT:exports.theBest(order,local.ciphers,remote.ciphers),hashT:exports.theBest(order,local.hashes,remote.hashes),order:order})})})}),exports.digest=((buf,cb)=>{mh.digest(buf,"sha2-256",buf.length,cb)}),exports.write=function(state,msg,cb){cb=cb||(()=>{}),pull(pull.values([msg]),lp.encode({fixed:!0,bytes:4}),pull.collect((err,res)=>{if(err)return cb(err);state.shake.write(res[0]),cb()}))},exports.read=function(reader,cb){lp.decodeFromReader(reader,{fixed:!0,bytes:4},cb)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function Transport(opts){this.path=opts.path,this.hostname=opts.hostname,this.port=opts.port,this.secure=opts.secure,this.query=opts.query,this.timestampParam=opts.timestampParam,this.timestampRequests=opts.timestampRequests,this.readyState="",this.agent=opts.agent||!1,this.socket=opts.socket,this.enablesXDR=opts.enablesXDR,this.pfx=opts.pfx,this.key=opts.key,this.passphrase=opts.passphrase,this.cert=opts.cert,this.ca=opts.ca,this.ciphers=opts.ciphers,this.rejectUnauthorized=opts.rejectUnauthorized,this.forceNode=opts.forceNode,this.extraHeaders=opts.extraHeaders,this.localAddress=opts.localAddress}var parser=__webpack_require__(64),Emitter=__webpack_require__(63);module.exports=Transport,Emitter(Transport.prototype),Transport.prototype.onError=function(msg,desc){var err=new Error(msg);return err.type="TransportError",err.description=desc,this.emit("error",err),this},Transport.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},Transport.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},Transport.prototype.send=function(packets){if("open"!==this.readyState)throw new Error("Transport not open");this.write(packets)},Transport.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},Transport.prototype.onData=function(data){var packet=parser.decodePacket(data,this.socket.binaryType);this.onPacket(packet)},Transport.prototype.onPacket=function(packet){this.emit("packet",packet)},Transport.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(module,exports,__webpack_require__){(function(global){var hasCORS=__webpack_require__(430);module.exports=function(opts){var xdomain=opts.xdomain,xscheme=opts.xscheme,enablesXDR=opts.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!xdomain||hasCORS))return new XMLHttpRequest}catch(e){}try{if("undefined"!=typeof XDomainRequest&&!xscheme&&enablesXDR)return new XDomainRequest}catch(e){}if(!xdomain)try{return new(global[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){function Encoder(){}function encodeAsString(obj){var str=""+obj.type;return exports.BINARY_EVENT!==obj.type&&exports.BINARY_ACK!==obj.type||(str+=obj.attachments+"-"),obj.nsp&&"/"!==obj.nsp&&(str+=obj.nsp+","),null!=obj.id&&(str+=obj.id),null!=obj.data&&(str+=JSON.stringify(obj.data)),debug("encoded %j as %s",obj,str),str}function encodeAsBinary(obj,callback){function writeEncoding(bloblessData){var deconstruction=binary.deconstructPacket(bloblessData),pack=encodeAsString(deconstruction.packet),buffers=deconstruction.buffers;buffers.unshift(pack),callback(buffers)}binary.removeBlobs(obj,writeEncoding)}function Decoder(){this.reconstructor=null}function decodeString(str){var i=0,p={type:Number(str.charAt(0))};if(null==exports.types[p.type])return error();if(exports.BINARY_EVENT===p.type||exports.BINARY_ACK===p.type){for(var buf="";"-"!==str.charAt(++i)&&(buf+=str.charAt(i),i!=str.length););if(buf!=Number(buf)||"-"!==str.charAt(i))throw new Error("Illegal attachments");p.attachments=Number(buf)}if("/"===str.charAt(i+1))for(p.nsp="";++i;){var c=str.charAt(i);if(","===c)break;if(p.nsp+=c,i===str.length)break}else p.nsp="/";var next=str.charAt(i+1);if(""!==next&&Number(next)==next){for(p.id="";++i;){var c=str.charAt(i);if(null==c||Number(c)!=c){--i;break}if(p.id+=str.charAt(i),i===str.length)break}p.id=Number(p.id)}return str.charAt(++i)&&(p=tryParse(p,str.substr(i))),debug("decoded %s as %j",str,p),p}function tryParse(p,str){try{p.data=JSON.parse(str)}catch(e){return error()}return p}function BinaryReconstructor(packet){this.reconPack=packet,this.buffers=[]}function error(){return{type:exports.ERROR,data:"parser error"}}var debug=__webpack_require__(3)("socket.io-parser"),Emitter=__webpack_require__(63),hasBin=__webpack_require__(212),binary=__webpack_require__(621),isBuf=__webpack_require__(260);exports.protocol=4,exports.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],exports.CONNECT=0,exports.DISCONNECT=1,exports.EVENT=2,exports.ACK=3,exports.ERROR=4,exports.BINARY_EVENT=5,exports.BINARY_ACK=6,exports.Encoder=Encoder,exports.Decoder=Decoder,Encoder.prototype.encode=function(obj,callback){if(obj.type!==exports.EVENT&&obj.type!==exports.ACK||!hasBin(obj.data)||(obj.type=obj.type===exports.EVENT?exports.BINARY_EVENT:exports.BINARY_ACK),debug("encoding packet %j",obj),exports.BINARY_EVENT===obj.type||exports.BINARY_ACK===obj.type)encodeAsBinary(obj,callback);else{callback([encodeAsString(obj)])}},Emitter(Decoder.prototype),Decoder.prototype.add=function(obj){var packet;if("string"==typeof obj)packet=decodeString(obj),exports.BINARY_EVENT===packet.type||exports.BINARY_ACK===packet.type?(this.reconstructor=new BinaryReconstructor(packet),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",packet)):this.emit("decoded",packet);else{if(!isBuf(obj)&&!obj.base64)throw new Error("Unknown type: "+obj);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(packet=this.reconstructor.takeBinaryData(obj))&&(this.reconstructor=null,this.emit("decoded",packet))}},Decoder.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},BinaryReconstructor.prototype.takeBinaryData=function(binData){if(this.buffers.push(binData),this.buffers.length===this.reconPack.attachments){var packet=binary.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),packet}return null},BinaryReconstructor.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(module,exports,__webpack_require__){(function(global,module){function arrayMap(array,iteratee){for(var index=-1,length=array?array.length:0,result=Array(length);++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet, -MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function values(object){return object?baseValues(object,keys(object)):[]}var MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",reIsUint=/^(?:0|[1-9]\d*)$/,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,propertyIsEnumerable=objectProto.propertyIsEnumerable,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),isArray=Array.isArray;module.exports=values},function(module,exports){function isObject(value){var type=typeof value;return null!=value&&("object"==type||"function"==type)}module.exports=isObject},function(module,exports,__webpack_require__){"use strict";function Protocols(proto){if("number"==typeof proto){if(Protocols.codes[proto])return Protocols.codes[proto];throw new Error("no protocol with code: "+proto)}if("string"==typeof proto||proto instanceof String){if(Protocols.names[proto])return Protocols.names[proto];throw new Error("no protocol with name: "+proto)}throw new Error("invalid protocol id type: "+proto)}function p(code,size,name,resolvable){return{code:code,size:size,name:name,resolvable:Boolean(resolvable)}}const map=__webpack_require__(148);Protocols.lengthPrefixedVarSize=-1,Protocols.V=-1,Protocols.table=[[4,32,"ip4"],[6,16,"tcp"],[17,16,"udp"],[33,16,"dccp"],[41,128,"ip6"],[53,-1,"dns","resolvable"],[54,-1,"dns4","resolvable"],[55,-1,"dns6","resolvable"],[132,16,"sctp"],[302,0,"utp"],[421,Protocols.lengthPrefixedVarSize,"ipfs"],[480,0,"http"],[443,0,"https"],[477,0,"ws"],[478,0,"wss"],[275,0,"libp2p-webrtc-star"],[276,0,"libp2p-webrtc-direct"],[290,0,"p2p-circuit"]],Protocols.names={},Protocols.codes={},map(Protocols.table,function(row){const proto=p.apply(null,row);Protocols.codes[proto.code]=proto,Protocols.names[proto.name]=proto}),Protocols.object=p,module.exports=Protocols},function(module,exports,__webpack_require__){"use strict";exports.Listener=exports.listener=__webpack_require__(698),exports.Dialer=exports.dialer=__webpack_require__(697),exports.matchSemver=__webpack_require__(700),exports.matchExact=__webpack_require__(287)},function(module,exports){exports.endianness=function(){return"LE"},exports.hostname=function(){return"undefined"!=typeof location?location.hostname:""},exports.loadavg=function(){return[]},exports.uptime=function(){return 0},exports.freemem=function(){return Number.MAX_VALUE},exports.totalmem=function(){return Number.MAX_VALUE},exports.cpus=function(){return[]},exports.type=function(){return"Browser"},exports.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},exports.networkInterfaces=exports.getNetworkInterfaces=function(){return{}},exports.arch=function(){return"javascript"},exports.platform=function(){return"browser"},exports.tmpdir=exports.tmpDir=function(){return"/tmp"},exports.EOL="\n"},function(module,exports){exports.encode=function(obj){var str="";for(var i in obj)obj.hasOwnProperty(i)&&(str.length&&(str+="&"),str+=encodeURIComponent(i)+"="+encodeURIComponent(obj[i]));return str},exports.decode=function(qs){for(var qry={},pairs=qs.split("&"),i=0,l=pairs.length;i=maxLength;){const end=maxLength,slice=buffered.slice(0,end);buffered=buffered.slice(end),this.queue(slice)}},function(end){buffered.length&&(this.queue(buffered),buffered=[]),this.queue(null)})}},function(module,exports){function abortAll(ary,abort,cb){function next(){--n||cb(abort)}var n=ary.length;if(!n)return cb(abort);ary.forEach(function(f){f?f(abort,next):next()}),n||next()}module.exports=function(streams){return function(abort,cb){!function next(){abort?abortAll(streams,abort,cb):streams.length?streams[0]?streams[0](null,function(err,data){err?(streams.shift(),err===!0?next():abortAll(streams,err,cb)):cb(null,data)}):(streams.shift(),next()):cb(!0)}()}}},function(module,exports,__webpack_require__){var looper=__webpack_require__(728);module.exports=function(map,width,inOrder){inOrder=void 0===inOrder||inOrder;var abort,reading=!1;return function(read){function drain(){if(_cb){var cb=_cb;if(error)return _cb=null,cb(error);if(Object.hasOwnProperty.call(seen,j)){_cb=null;var data=seen[j];delete seen[j],j++,cb(null,data),width&&start()}else j>=last&&ended&&(_cb=null,cb(ended))}}var _cb,error,i=0,j=0,last=0,seen=[],started=!1,ended=!1,start=looper(function(){if(started=!0,ended)return drain();reading||width&&i-width>=j||(reading=!0,read(abort,function(end,data){if(reading=!1,end)last=i,ended=end,drain();else{var k=i++;map(data,function(err,data){inOrder?seen[k]=data:seen.push(data),err&&(error=err),drain()}),ended||start()}}))});return function(_abort,cb){_abort?read(ended=abort=_abort,function(err){if(cb)return cb(err)}):(_cb=cb,started||start(),drain())}}}},function(module,exports,__webpack_require__){(function(setImmediate,process){function duplex(reader,read){function drain(){if(waiting=!1,read&&!busy){for(;output.length&&!s.paused;)s.emit("data",output.shift());if(!s.paused){if(_ended)return s.emit("end");busy=!0,read(null,function next(end,data){busy=!1,s.paused?(end===!0?_ended=end:end?s.emit("error",end):output.push(data),waiting=!0):end&&(ended=end)!==!0?s.emit("error",end):(ended=ended||end)?s.emit("end"):(s.emit("data",data),busy=!0,read(null,next))})}}}reader&&"object"==typeof reader&&(read=reader.source,reader=reader.sink);var ended,needDrain,cbs=[],input=[],s=new Stream;s.writable=s.readable=!0,s.write=function(data){return cbs.length?cbs.shift()(null,data):input.push(data),cbs.length||(needDrain=!0),!!cbs.length},s.end=function(){read?input.length?drain():read(ended=!0,cbs.length?cbs.shift():function(){}):cbs.length&&cbs.shift()(!0)},s.source=function(end,cb){input.length?(cb(null,input.shift()),input.length||s.emit("drain")):((ended=ended||end)?cb(ended):cbs.push(cb),needDrain&&(needDrain=!1,s.emit("drain")))};var n;reader&&(n=reader(s.source)),n&&!read&&(read=n);var output=[],_ended=!1,waiting=!1,busy=!1;if(s.sink=function(_read){read=_read,next(drain)},read){s.sink(read);var pipe=s.pipe.bind(s);s.pipe=function(dest,opts){var res=pipe(dest,opts);return s.paused&&s.resume(),res}}return s.pause=function(){return s.paused=!0,s},s.resume=function(){return s.paused=!1,drain(),s},s.destroy=function(){!ended&&read&&read(ended=!0,function(){}),ended=!0,cbs.length&&cbs.shift()(!0),s.emit("close")},s}var Stream=__webpack_require__(26);module.exports=duplex,module.exports.source=function(source){return duplex(null,source)},module.exports.sink=function(sink){return duplex(sink,null)};var next=void 0===setImmediate?process.nextTick:setImmediate}).call(exports,__webpack_require__(22).setImmediate,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";var drain=__webpack_require__(84);module.exports=function(reducer,acc,cb){cb||(cb=acc,acc=null);var sink=drain(function(data){acc=reducer(acc,data)},function(err){cb(err,acc)});return 2===arguments.length?function(source){source(null,function(end,data){if(end)return cb(end===!0?null:end);acc=data,sink(source)})}:sink}},function(module,exports,__webpack_require__){"use strict";var abortCb=__webpack_require__(302);module.exports=function(array,onAbort){if(!array)return function(abort,cb){return abort?abortCb(cb,abort,onAbort):cb(!0)};Array.isArray(array)||(array=Object.keys(array).map(function(k){return array[k]}));var i=0;return function(abort,cb){if(abort)return abortCb(cb,abort,onAbort);i>=array.length?cb(!0):cb(null,array[i++])}}},function(module,exports,__webpack_require__){"use strict";var tester=__webpack_require__(303);module.exports=function(test){return test=tester(test),function(read){return function next(end,cb){for(var sync,loop=!0;loop;)loop=!1,sync=!0,read(end,function(end,data){if(!end&&!test(data))return sync?loop=!0:next(end,cb);cb(end,data)}),sync=!1}}}},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(310)(__webpack_require__(771))},function(module,exports,__webpack_require__){"use strict";exports.utils=__webpack_require__(792),exports.constants=__webpack_require__(788),exports.Scheduler=__webpack_require__(791),exports.Parser=__webpack_require__(790),exports.Framer=__webpack_require__(789)},function(module,exports,__webpack_require__){exports=module.exports=__webpack_require__(322),exports.Stream=exports,exports.Readable=exports,exports.Writable=__webpack_require__(324),exports.Duplex=__webpack_require__(71),exports.Transform=__webpack_require__(323),exports.PassThrough=__webpack_require__(804)},function(module,exports,__webpack_require__){"use strict";(function(process,setImmediate){function nop(){}function WriteReq(chunk,encoding,cb){this.chunk=chunk,this.encoding=encoding,this.callback=cb,this.next=null}function WritableState(options,stream){Duplex=Duplex||__webpack_require__(53),options=options||{},this.objectMode=!!options.objectMode,stream instanceof Duplex&&(this.objectMode=this.objectMode||!!options.writableObjectMode);var hwm=options.highWaterMark,defaultHwm=this.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:defaultHwm,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var noDecode=options.decodeStrings===!1;this.decodeStrings=!noDecode,this.defaultEncoding=options.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(er){onwrite(stream,er)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}function Writable(options){if(Duplex=Duplex||__webpack_require__(53),!(realHasInstance.call(Writable,this)||this instanceof Duplex))return new Writable(options);this._writableState=new WritableState(options,this),this.writable=!0,options&&("function"==typeof options.write&&(this._write=options.write),"function"==typeof options.writev&&(this._writev=options.writev)),Stream.call(this)}function writeAfterEnd(stream,cb){var er=new Error("write after end");stream.emit("error",er),processNextTick(cb,er)}function validChunk(stream,state,chunk,cb){var valid=!0,er=!1;return null===chunk?er=new TypeError("May not write null values to stream"):"string"==typeof chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er&&(stream.emit("error",er),processNextTick(cb,er),valid=!1),valid}function decodeChunk(state,chunk,encoding){return state.objectMode||state.decodeStrings===!1||"string"!=typeof chunk||(chunk=bufferShim.from(chunk,encoding)),chunk}function writeOrBuffer(stream,state,isBuf,chunk,encoding,cb){isBuf||(chunk=decodeChunk(state,chunk,encoding),Buffer.isBuffer(chunk)&&(encoding="buffer"));var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length-1?setImmediate:processNextTick;Writable.WritableState=WritableState;var util=__webpack_require__(6);util.inherits=__webpack_require__(1);var internalUtil={deprecate:__webpack_require__(72)},Stream=__webpack_require__(328),Buffer=__webpack_require__(0).Buffer,bufferShim=__webpack_require__(14);util.inherits(Writable,Stream),WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(_){}}();var realHasInstance;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return!!realHasInstance.call(this,object)||object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=Buffer.isBuffer(chunk);return"function"==typeof encoding&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),"function"!=typeof cb&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,state.writing||state.corked||state.finished||state.bufferProcessing||!state.bufferedRequest||clearBuffer(this,state))},Writable.prototype.setDefaultEncoding=function(encoding){if("string"==typeof encoding&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this},Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;"function"==typeof chunk?(cb=chunk,chunk=null,encoding=null):"function"==typeof encoding&&(cb=encoding,encoding=null),null!==chunk&&void 0!==chunk&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||state.finished||endWritable(this,state,cb)}}).call(exports,__webpack_require__(2),__webpack_require__(22).setImmediate)},function(module,exports,__webpack_require__){exports=module.exports=__webpack_require__(326),exports.Stream=exports,exports.Readable=exports,exports.Writable=__webpack_require__(165),exports.Duplex=__webpack_require__(53),exports.Transform=__webpack_require__(327),exports.PassThrough=__webpack_require__(808)},function(module,exports,__webpack_require__){"use strict";function Url(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function urlParse(url,parseQueryString,slashesDenoteHost){if(url&&util.isObject(url)&&url instanceof Url)return url;var u=new Url;return u.parse(url,parseQueryString,slashesDenoteHost),u}function urlFormat(obj){return util.isString(obj)&&(obj=urlParse(obj)),obj instanceof Url?obj.format():Url.prototype.format.call(obj)}function urlResolve(source,relative){return urlParse(source,!1,!0).resolve(relative)}function urlResolveObject(source,relative){return source?urlParse(source,!1,!0).resolveObject(relative):relative}var punycode=__webpack_require__(760),util=__webpack_require__(819);exports.parse=urlParse,exports.resolve=urlResolve,exports.resolveObject=urlResolveObject,exports.format=urlFormat,exports.Url=Url;var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,simplePathPattern=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,delims=["<",">",'"',"`"," ","\r","\n","\t"],unwise=["{","}","|","\\","^","`"].concat(delims),autoEscape=["'"].concat(unwise),nonHostChars=["%","/","?",";","#"].concat(autoEscape),hostEndingChars=["/","?","#"],unsafeProtocol={javascript:!0,"javascript:":!0},hostlessProtocol={javascript:!0,"javascript:":!0},slashedProtocol={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},querystring=__webpack_require__(763);Url.prototype.parse=function(url,parseQueryString,slashesDenoteHost){if(!util.isString(url))throw new TypeError("Parameter 'url' must be a string, not "+typeof url);var queryIndex=url.indexOf("?"),splitter=queryIndex!==-1&&queryIndex127?"x":part[j];if(!newpart.match(/^[+a-z0-9A-Z_-]{0,63}$/)){var validParts=hostparts.slice(0,i),notHost=hostparts.slice(i+1),bit=part.match(/^([+a-z0-9A-Z_-]{0,63})(.*)$/);bit&&(validParts.push(bit[1]),notHost.unshift(bit[2])),notHost.length&&(rest="/"+notHost.join(".")+rest),this.hostname=validParts.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),ipv6Hostname||(this.hostname=punycode.toASCII(this.hostname));var p=this.port?":"+this.port:"",h=this.hostname||"";this.host=h+p,this.href+=this.host,ipv6Hostname&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==rest[0]&&(rest="/"+rest))}if(!unsafeProtocol[lowerProto])for(var i=0,l=autoEscape.length;i0)&&result.host.split("@");authInHost&&(result.auth=authInHost.shift(),result.host=result.hostname=authInHost.shift())}return result.search=relative.search,result.query=relative.query,util.isNull(result.pathname)&&util.isNull(result.search)||(result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")),result.href=result.format(),result}if(!srcPath.length)return result.pathname=null,result.search?result.path="/"+result.search:result.path=null,result.href=result.format(),result -;for(var last=srcPath.slice(-1)[0],hasTrailingSlash=(result.host||relative.host||srcPath.length>1)&&("."===last||".."===last)||""===last,up=0,i=srcPath.length;i>=0;i--)last=srcPath[i],"."===last?srcPath.splice(i,1):".."===last?(srcPath.splice(i,1),up++):up&&(srcPath.splice(i,1),up--);if(!mustEndAbs&&!removeAllDots)for(;up--;up)srcPath.unshift("..");!mustEndAbs||""===srcPath[0]||srcPath[0]&&"/"===srcPath[0].charAt(0)||srcPath.unshift(""),hasTrailingSlash&&"/"!==srcPath.join("/").substr(-1)&&srcPath.push("");var isAbsolute=""===srcPath[0]||srcPath[0]&&"/"===srcPath[0].charAt(0);if(psychotic){result.hostname=result.host=isAbsolute?"":srcPath.length?srcPath.shift():"";var authInHost=!!(result.host&&result.host.indexOf("@")>0)&&result.host.split("@");authInHost&&(result.auth=authInHost.shift(),result.host=result.hostname=authInHost.shift())}return mustEndAbs=mustEndAbs||result.host&&srcPath.length,mustEndAbs&&!isAbsolute&&srcPath.unshift(""),srcPath.length?result.pathname=srcPath.join("/"):(result.pathname=null,result.path=null),util.isNull(result.pathname)&&util.isNull(result.search)||(result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")),result.auth=relative.auth||result.auth,result.slashes=result.slashes||relative.slashes,result.href=result.format(),result},Url.prototype.parseHost=function(){var host=this.host,port=portPattern.exec(host);port&&(port=port[0],":"!==port&&(this.port=port.substr(1)),host=host.substr(0,host.length-port.length)),host&&(this.hostname=host)}},function(module,exports,__webpack_require__){function WBuf(){this.buffers=[],this.toReserve=0,this.size=0,this.maxSize=0,this.avail=0,this.last=null,this.offset=0,this.sliceQueue=null,this.forceReserve=!1,this.reserveRate=64}function toUnsigned16(num){return num<0?65536+num:num}function toUnsigned24(num){return num<0?16777216+num:num}function toUnsigned32(num){return num<0?4294967295+num+1:num}var assert=__webpack_require__(111),Buffer=__webpack_require__(0).Buffer;module.exports=WBuf,WBuf.prototype.reserve=function(n){this.toReserve+=n,this.forceReserve&&(this.toReserve=Math.max(this.toReserve,this.reserveRate))},WBuf.prototype._ensure=function(n){this.avail>=n||(0===this.toReserve&&(this.toReserve=this.reserveRate),this.toReserve=Math.max(n-this.avail,this.toReserve),0===this.avail&&this._next())},WBuf.prototype._next=function(){var buf;null===this.sliceQueue?buf=new Buffer(this.toReserve):(buf=this.sliceQueue.shift(),0===this.sliceQueue.length&&(this.sliceQueue=null)),this.toReserve=0,this.buffers.push(buf),this.avail=buf.length,this.offset=0,this.last=buf},WBuf.prototype._rangeCheck=function(){if(0!==this.maxSize&&this.size>this.maxSize)throw new RangeError("WBuf overflow")},WBuf.prototype._move=function(n){this.size+=n,0===this.avail&&(this.last=null),this._rangeCheck()},WBuf.prototype.slice=function(start,end){assert(0<=start&&start<=this.size),assert(0<=end&&end<=this.size),null===this.last&&this._next();var res=new WBuf;if(start>=this.size-this.offset)return res.buffers.push(this.last),res.last=this.last,res.offset=start-this.size+this.offset,res.maxSize=end-start,res.avail=res.maxSize,res;for(var startIndex=-1,startOffset=0,endIndex=-1,offset=0,i=0;i=offset&&start<=next&&(startIndex=i,startOffset=start-offset,endIndex!==-1))break;if(end>=offset&&end<=next&&(endIndex=i,startIndex!==-1))break;offset=next}return res.last=this.buffers[startIndex],res.offset=startOffset,res.maxSize=end-start,startIndex0;){var toSkip=Math.min(left,this.avail);left-=toSkip,this.size+=toSkip,toSkip===this.avail?0!==left?this._next():(this.avail-=toSkip,this.offset+=toSkip):(this.offset+=toSkip,this.avail-=toSkip)}return this._rangeCheck(),this.slice(this.size-n,this.size)},WBuf.prototype.write=function(str){for(var len=0,i=0;i255?2:1}this.reserve(len);for(var i=0;i>>8,lo=255&c;hi&&this.writeUInt8(hi),this.writeUInt8(lo)}},WBuf.prototype.copyFrom=function(buf,start,end){var off=void 0===start?0:start,len=void 0===end?buf.length:end;if(off!==len){for(this._ensure(len-off);off=2?(this.last.writeUInt16BE(v,this.offset,!0),this.offset+=2,this.avail-=2):(this.last[this.offset]=v>>>8,this._next(),this.last[this.offset++]=255&v,this.avail--),this._move(2)},WBuf.prototype.writeUInt24BE=function(v){this._ensure(3),this.avail>=3?(this.last.writeUInt16BE(v>>>8,this.offset,!0),this.last[this.offset+2]=255&v,this.offset+=3,this.avail-=3,this._move(3)):this.avail>=2?(this.last.writeUInt16BE(v>>>8,this.offset,!0),this._next(),this.last[this.offset++]=255&v,this.avail--,this._move(3)):(this.last[this.offset]=v>>>16,this._move(1),this._next(),this.writeUInt16BE(65535&v))},WBuf.prototype.writeUInt32BE=function(v){this._ensure(4),this.avail>=4?(this.last.writeUInt32BE(v,this.offset,!0),this.offset+=4,this.avail-=4,this._move(4)):this.avail>=3?(this.writeUInt24BE(v>>>8),this._next(),this.last[this.offset++]=255&v,this.avail--,this._move(1)):(this.writeUInt16BE(v>>>16),this.writeUInt16BE(65535&v))},WBuf.prototype.writeUInt16LE=function(num){var r=(255&num)<<8|num>>>8;this.writeUInt16BE(r)},WBuf.prototype.writeUInt24LE=function(num){var r=(255&num)<<16|(num>>>8&255)<<8|num>>>16;this.writeUInt24BE(r)},WBuf.prototype.writeUInt32LE=function(num){var r=(255&num)<<24|(num>>>8&255)<<16|(num>>>16&255)<<8|num>>>24;this.writeUInt32BE(r)},WBuf.prototype.render=function(){for(var left=this.size,out=[],i=0;i=0;i++){var buf=this.buffers[i];left-=buf.length,left>=0?out.push(buf):out.push(buf.slice(0,buf.length+left))}return out},WBuf.prototype.writeInt8=function(num){return num<0?this.writeUInt8(256+num):this.writeUInt8(num)},WBuf.prototype.writeInt16LE=function(num){this.writeUInt16LE(toUnsigned16(num))},WBuf.prototype.writeInt16BE=function(num){this.writeUInt16BE(toUnsigned16(num))},WBuf.prototype.writeInt24LE=function(num){this.writeUInt24LE(toUnsigned24(num))},WBuf.prototype.writeInt24BE=function(num){this.writeUInt24BE(toUnsigned24(num))},WBuf.prototype.writeInt32LE=function(num){this.writeUInt32LE(toUnsigned32(num))},WBuf.prototype.writeInt32BE=function(num){this.writeUInt32BE(toUnsigned32(num))},WBuf.prototype.writeComb=function(size,endian,value){if(1===size)return this.writeUInt8(value);"le"===endian?2===size?this.writeUInt16LE(value):3===size?this.writeUInt24LE(value):4===size&&this.writeUInt32LE(value):2===size?this.writeUInt16BE(value):3===size?this.writeUInt24BE(value):4===size&&this.writeUInt32BE(value)}},function(module,exports,__webpack_require__){"use strict";exports.OFFLINE_ERROR=new Error("This command must be run in online mode. Try running 'ipfs daemon' first.")},function(module,exports,__webpack_require__){function DecoderBuffer(base,options){if(Reporter.call(this,options),!Buffer.isBuffer(base))return void this.error("Input not Buffer");this.base=base,this.offset=0,this.length=base.length}function EncoderBuffer(value,reporter){if(Array.isArray(value))this.length=0,this.value=value.map(function(item){return item instanceof EncoderBuffer||(item=new EncoderBuffer(item,reporter)),this.length+=item.length,item},this);else if("number"==typeof value){if(!(0<=value&&value<=255))return reporter.error("non-byte EncoderBuffer value");this.value=value,this.length=1}else if("string"==typeof value)this.value=value,this.length=Buffer.byteLength(value);else{if(!Buffer.isBuffer(value))return reporter.error("Unsupported type: "+typeof value);this.value=value,this.length=value.length}}var inherits=__webpack_require__(1),Reporter=__webpack_require__(73).Reporter,Buffer=__webpack_require__(0).Buffer;inherits(DecoderBuffer,Reporter),exports.DecoderBuffer=DecoderBuffer,DecoderBuffer.prototype.save=function(){return{offset:this.offset,reporter:Reporter.prototype.save.call(this)}},DecoderBuffer.prototype.restore=function(save){var res=new DecoderBuffer(this.base);return res.offset=save.offset,res.length=this.offset,this.offset=save.offset,Reporter.prototype.restore.call(this,save.reporter),res},DecoderBuffer.prototype.isEmpty=function(){return this.offset===this.length},DecoderBuffer.prototype.readUInt8=function(fail){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(fail||"DecoderBuffer overrun")},DecoderBuffer.prototype.skip=function(bytes,fail){if(!(this.offset+bytes<=this.length))return this.error(fail||"DecoderBuffer overrun");var res=new DecoderBuffer(this.base);return res._reporterState=this._reporterState,res.offset=this.offset,res.length=this.offset+bytes,this.offset+=bytes,res},DecoderBuffer.prototype.raw=function(save){return this.base.slice(save?save.offset:this.offset,this.length)},exports.EncoderBuffer=EncoderBuffer,EncoderBuffer.prototype.join=function(out,offset){return out||(out=new Buffer(this.length)),offset||(offset=0),0===this.length?out:(Array.isArray(this.value)?this.value.forEach(function(item){item.join(out,offset),offset+=item.length}):("number"==typeof this.value?out[offset]=this.value:"string"==typeof this.value?out.write(this.value,offset):Buffer.isBuffer(this.value)&&this.value.copy(out,offset),offset+=this.length),out)}},function(module,exports,__webpack_require__){var constants=exports;constants._reverse=function(map){var res={};return Object.keys(map).forEach(function(key){(0|key)==key&&(key|=0),res[map[key]]=key}),res},constants.der=__webpack_require__(338)},function(module,exports,__webpack_require__){function DERDecoder(entity){this.enc="der",this.name=entity.name,this.entity=entity,this.tree=new DERNode,this.tree._init(entity.body)}function DERNode(parent){base.Node.call(this,"der",parent)}function derDecodeTag(buf,fail){var tag=buf.readUInt8(fail);if(buf.isError(tag))return tag;var cls=der.tagClass[tag>>6],primitive=0==(32&tag);if(31==(31&tag)){var oct=tag;for(tag=0;128==(128&oct);){if(oct=buf.readUInt8(fail),buf.isError(oct))return oct;tag<<=7,tag|=127&oct}}else tag&=31;return{cls:cls,primitive:primitive,tag:tag,tagStr:der.tag[tag]}}function derDecodeLen(buf,primitive,fail){var len=buf.readUInt8(fail);if(buf.isError(len))return len;if(!primitive&&128===len)return null;if(0==(128&len))return len;var num=127&len;if(num>4)return buf.error("length octect is too long");len=0;for(var i=0;i=31?reporter.error("Multi-octet tag encoding unsupported"):(primitive||(res|=32),res|=der.tagClassByName[cls||"universal"]<<6)}var inherits=__webpack_require__(1),Buffer=__webpack_require__(0).Buffer,asn1=__webpack_require__(54),base=asn1.base,der=asn1.constants.der;module.exports=DEREncoder,DEREncoder.prototype.encode=function(data,reporter){return this.tree._encode(data,reporter).join()},inherits(DERNode,base.Node),DERNode.prototype._encodeComposite=function(tag,primitive,cls,content){var encodedTag=encodeTag(tag,primitive,cls,this.reporter);if(content.length<128){var header=new Buffer(2);return header[0]=encodedTag,header[1]=content.length,this._createEncoderBuffer([header,content])}for(var lenOctets=1,i=content.length;i>=256;i>>=8)lenOctets++;var header=new Buffer(2+lenOctets);header[0]=encodedTag,header[1]=128|lenOctets;for(var i=1+lenOctets,j=content.length;j>0;i--,j>>=8)header[i]=255&j;return this._createEncoderBuffer([header,content])},DERNode.prototype._encodeStr=function(str,tag){if("bitstr"===tag)return this._createEncoderBuffer([0|str.unused,str.data]);if("bmpstr"===tag){for(var buf=new Buffer(2*str.length),i=0;i=40)return this.reporter.error("Second objid identifier OOB");id.splice(0,2,40*id[0]+id[1])}for(var size=0,i=0;i=128;ident>>=7)size++}for(var objid=new Buffer(size),offset=objid.length-1,i=id.length-1;i>=0;i--){var ident=id[i];for(objid[offset--]=127&ident;(ident>>=7)>0;)objid[offset--]=128|127&ident}return this._createEncoderBuffer(objid)},DERNode.prototype._encodeTime=function(time,tag){var str,date=new Date(time);return"gentime"===tag?str=[two(date.getFullYear()),two(date.getUTCMonth()+1),two(date.getUTCDate()),two(date.getUTCHours()),two(date.getUTCMinutes()),two(date.getUTCSeconds()),"Z"].join(""):"utctime"===tag?str=[two(date.getFullYear()%100),two(date.getUTCMonth()+1),two(date.getUTCDate()),two(date.getUTCHours()),two(date.getUTCMinutes()),two(date.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+tag+" time is not supported yet"),this._encodeStr(str,"octstr")},DERNode.prototype._encodeNull=function(){return this._createEncoderBuffer("")},DERNode.prototype._encodeInt=function(num,values){if("string"==typeof num){if(!values)return this.reporter.error("String int or enum given, but no values map");if(!values.hasOwnProperty(num))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(num));num=values[num]}if("number"!=typeof num&&!Buffer.isBuffer(num)){var numArray=num.toArray();!num.sign&&128&numArray[0]&&numArray.unshift(0),num=new Buffer(numArray)}if(Buffer.isBuffer(num)){var size=num.length;0===num.length&&size++;var out=new Buffer(size);return num.copy(out),0===num.length&&(out[0]=0),this._createEncoderBuffer(out)}if(num<128)return this._createEncoderBuffer(num);if(num<256)return this._createEncoderBuffer([0,num]);for(var size=1,i=num;i>=256;i>>=8)size++;for(var out=new Array(size),i=out.length-1;i>=0;i--)out[i]=255&num,num>>=8;return 128&out[0]&&out.unshift(0),this._createEncoderBuffer(new Buffer(out))},DERNode.prototype._encodeBool=function(value){return this._createEncoderBuffer(value?255:0)},DERNode.prototype._use=function(entity,obj){return"function"==typeof entity&&(entity=entity(obj)),entity._getEncoder("der").tree},DERNode.prototype._skipDefault=function(dataBuffer,reporter,parent){var i,state=this._baseState;if(null===state.default)return!1;var data=dataBuffer.join();if(void 0===state.defaultBuffer&&(state.defaultBuffer=this._encodeValue(state.default,reporter,parent).join()),data.length!==state.defaultBuffer.length)return!1;for(i=0;i2&&(result=(0,_slice2.default)(arguments,1)),results[key]=result,callback(err)})},function(err){callback(err,results)})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=_parallel;var _noop=__webpack_require__(33),_noop2=_interopRequireDefault(_noop),_isArrayLike=__webpack_require__(65),_isArrayLike2=_interopRequireDefault(_isArrayLike),_slice=__webpack_require__(56),_slice2=_interopRequireDefault(_slice),_wrapAsync=__webpack_require__(19),_wrapAsync2=_interopRequireDefault(_wrapAsync);module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _withoutIndex(iteratee){return function(value,index,callback){return iteratee(value,callback)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=_withoutIndex,module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(worker,concurrency){var _worker=(0,_wrapAsync2.default)(worker);return(0,_queue2.default)(function(items,cb){_worker(items[0],cb)},concurrency,1)};var _queue=__webpack_require__(354),_queue2=_interopRequireDefault(_queue),_wrapAsync=__webpack_require__(19),_wrapAsync2=_interopRequireDefault(_wrapAsync);module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0});var _reject=__webpack_require__(355),_reject2=_interopRequireDefault(_reject),_doParallel=__webpack_require__(88),_doParallel2=_interopRequireDefault(_doParallel);exports.default=(0,_doParallel2.default)(_reject2.default),module.exports=exports.default},function(module,exports,__webpack_require__){(function(Buffer){function normalizeInput(input){var ret;if(input instanceof Uint8Array)ret=input;else if(input instanceof Buffer)ret=new Uint8Array(input);else{if("string"!=typeof input)throw new Error(ERROR_MSG_INPUT);ret=new Uint8Array(Buffer.from(input,"utf8"))}return ret}function toHex(bytes){return Array.prototype.map.call(bytes,function(n){return(n<16?"0":"")+n.toString(16)}).join("")}function uint32ToHex(val){return(4294967296+val).toString(16).substring(1)}function debugPrint(label,arr,size){for(var msg="\n"+label+" = ",i=0;inew Date(val),1:val=>new Date(1e3*val),2:val=>utils.arrayBufferToBignumber(val),3:val=>c.NEG_ONE.minus(utils.arrayBufferToBignumber(val)),4:v=>{return c.TEN.pow(v[0]).times(v[1])},5:v=>{return c.TWO.pow(v[0]).times(v[1])},32:val=>url.parse(val),35:val=>new RegExp(val)},opts.tags),this.parser=parser(global,{log:console.log.bind(console),pushInt:this.pushInt.bind(this),pushInt32:this.pushInt32.bind(this),pushInt32Neg:this.pushInt32Neg.bind(this),pushInt64:this.pushInt64.bind(this),pushInt64Neg:this.pushInt64Neg.bind(this),pushFloat:this.pushFloat.bind(this),pushFloatSingle:this.pushFloatSingle.bind(this),pushFloatDouble:this.pushFloatDouble.bind(this),pushTrue:this.pushTrue.bind(this),pushFalse:this.pushFalse.bind(this),pushUndefined:this.pushUndefined.bind(this),pushNull:this.pushNull.bind(this),pushInfinity:this.pushInfinity.bind(this),pushInfinityNeg:this.pushInfinityNeg.bind(this),pushNaN:this.pushNaN.bind(this),pushNaNNeg:this.pushNaNNeg.bind(this),pushArrayStart:this.pushArrayStart.bind(this),pushArrayStartFixed:this.pushArrayStartFixed.bind(this),pushArrayStartFixed32:this.pushArrayStartFixed32.bind(this),pushArrayStartFixed64:this.pushArrayStartFixed64.bind(this),pushObjectStart:this.pushObjectStart.bind(this),pushObjectStartFixed:this.pushObjectStartFixed.bind(this),pushObjectStartFixed32:this.pushObjectStartFixed32.bind(this),pushObjectStartFixed64:this.pushObjectStartFixed64.bind(this),pushByteString:this.pushByteString.bind(this),pushByteStringStart:this.pushByteStringStart.bind(this),pushUtf8String:this.pushUtf8String.bind(this),pushUtf8StringStart:this.pushUtf8StringStart.bind(this),pushSimpleUnassigned:this.pushSimpleUnassigned.bind(this),pushTagUnassigned:this.pushTagUnassigned.bind(this),pushTagStart:this.pushTagStart.bind(this),pushTagStart4:this.pushTagStart4.bind(this),pushTagStart8:this.pushTagStart8.bind(this),pushBreak:this.pushBreak.bind(this)},this._heap)}get _depth(){return this._parents.length}get _currentParent(){return this._parents[this._depth-1]}get _ref(){return this._currentParent.ref}_closeParent(){var p=this._parents.pop();if(p.length>0)throw new Error(`Missing ${p.length} elements`);switch(p.type){case c.PARENT.TAG:this._push(this.createTag(p.ref[0],p.ref[1]));break;case c.PARENT.BYTE_STRING:this._push(this.createByteString(p.ref,p.length));break;case c.PARENT.UTF8_STRING:this._push(this.createUtf8String(p.ref,p.length));break;case c.PARENT.MAP:if(p.values%2>0)throw new Error("Odd number of elements in the map");this._push(this.createMap(p.ref,p.length));break;case c.PARENT.OBJECT:if(p.values%2>0)throw new Error("Odd number of elements in the map");this._push(this.createObject(p.ref,p.length));break;case c.PARENT.ARRAY:this._push(this.createArray(p.ref,p.length))}this._currentParent&&this._currentParent.type===c.PARENT.TAG&&this._dec()}_dec(){ -const p=this._currentParent;p.length<0||0===--p.length&&this._closeParent()}_push(val,hasChildren){const p=this._currentParent;switch(p.values++,p.type){case c.PARENT.ARRAY:case c.PARENT.BYTE_STRING:case c.PARENT.UTF8_STRING:p.length>-1?this._ref[this._ref.length-p.length]=val:this._ref.push(val),this._dec();break;case c.PARENT.OBJECT:null!=p.tmpKey?(this._ref[p.tmpKey]=val,p.tmpKey=null,this._dec()):(p.tmpKey=val,"string"!=typeof p.tmpKey&&(p.type=c.PARENT.MAP,p.ref=utils.buildMap(p.ref)));break;case c.PARENT.MAP:null!=p.tmpKey?(this._ref.set(p.tmpKey,val),p.tmpKey=null,this._dec()):p.tmpKey=val;break;case c.PARENT.TAG:this._ref.push(val),hasChildren||this._dec();break;default:throw new Error("Unknown parent type")}}_createParent(obj,type,len){this._parents[this._depth]={type:type,length:len,ref:obj,values:0,tmpKey:null}}_reset(){this._res=[],this._parents=[{type:c.PARENT.ARRAY,length:-1,ref:this._res,values:0,tmpKey:null}]}createTag(tagNumber,value){const typ=this._knownTags[tagNumber];return typ?typ(value):new Tagged(tagNumber,value)}createMap(obj,len){return obj}createObject(obj,len){return obj}createArray(arr,len){return arr}createByteString(raw,len){return Buffer.concat(raw)}createByteStringFromHeap(start,end){return new Buffer(start===end?0:this._heap.slice(start,end))}createInt(val){return val}createInt32(f,g){return utils.buildInt32(f,g)}createInt64(f1,f2,g1,g2){return utils.buildInt64(f1,f2,g1,g2)}createFloat(val){return val}createFloatSingle(a,b,c,d){return ieee754.read([a,b,c,d],0,!1,23,4)}createFloatDouble(a,b,c,d,e,f,g,h){return ieee754.read([a,b,c,d,e,f,g,h],0,!1,52,8)}createInt32Neg(f,g){return-1-utils.buildInt32(f,g)}createInt64Neg(f1,f2,g1,g2){const f=utils.buildInt32(f1,f2),g=utils.buildInt32(g1,g2);return f>c.MAX_SAFE_HIGH?c.NEG_ONE.sub(new Bignumber(f).times(c.SHIFT32).plus(g)):-1-(f*c.SHIFT32+g)}createTrue(){return!0}createFalse(){return!1}createNull(){return null}createUndefined(){}createInfinity(){return 1/0}createInfinityNeg(){return-(1/0)}createNaN(){return NaN}createNaNNeg(){return NaN}createUtf8String(raw,len){return raw.join("")}createUtf8StringFromHeap(start,end){return start===end?"":new Buffer(this._heap.slice(start,end)).toString("utf8")}createSimpleUnassigned(val){return new Simple(val)}pushInt(val){this._push(this.createInt(val))}pushInt32(f,g){this._push(this.createInt32(f,g))}pushInt64(f1,f2,g1,g2){this._push(this.createInt64(f1,f2,g1,g2))}pushFloat(val){this._push(this.createFloat(val))}pushFloatSingle(a,b,c,d){this._push(this.createFloatSingle(a,b,c,d))}pushFloatDouble(a,b,c,d,e,f,g,h){this._push(this.createFloatDouble(a,b,c,d,e,f,g,h))}pushInt32Neg(f,g){this._push(this.createInt32Neg(f,g))}pushInt64Neg(f1,f2,g1,g2){this._push(this.createInt64Neg(f1,f2,g1,g2))}pushTrue(){this._push(this.createTrue())}pushFalse(){this._push(this.createFalse())}pushNull(){this._push(this.createNull())}pushUndefined(){this._push(this.createUndefined())}pushInfinity(){this._push(this.createInfinity())}pushInfinityNeg(){this._push(this.createInfinityNeg())}pushNaN(){this._push(this.createNaN())}pushNaNNeg(){this._push(this.createNaNNeg())}pushArrayStart(){this._createParent([],c.PARENT.ARRAY,-1)}pushArrayStartFixed(len){this._createArrayStartFixed(len)}pushArrayStartFixed32(len1,len2){const len=utils.buildInt32(len1,len2);this._createArrayStartFixed(len)}pushArrayStartFixed64(len1,len2,len3,len4){const len=utils.buildInt64(len1,len2,len3,len4);this._createArrayStartFixed(len)}pushObjectStart(){this._createObjectStartFixed(-1)}pushObjectStartFixed(len){this._createObjectStartFixed(len)}pushObjectStartFixed32(len1,len2){const len=utils.buildInt32(len1,len2);this._createObjectStartFixed(len)}pushObjectStartFixed64(len1,len2,len3,len4){const len=utils.buildInt64(len1,len2,len3,len4);this._createObjectStartFixed(len)}pushByteStringStart(){this._parents[this._depth]={type:c.PARENT.BYTE_STRING,length:-1,ref:[],values:0,tmpKey:null}}pushByteString(start,end){this._push(this.createByteStringFromHeap(start,end))}pushUtf8StringStart(){this._parents[this._depth]={type:c.PARENT.UTF8_STRING,length:-1,ref:[],values:0,tmpKey:null}}pushUtf8String(start,end){this._push(this.createUtf8StringFromHeap(start,end))}pushSimpleUnassigned(val){this._push(this.createSimpleUnassigned(val))}pushTagStart(tag){this._parents[this._depth]={type:c.PARENT.TAG,length:1,ref:[tag]}}pushTagStart4(f,g){this.pushTagStart(utils.buildInt32(f,g))}pushTagStart8(f1,f2,g1,g2){this.pushTagStart(utils.buildInt64(f1,f2,g1,g2))}pushTagUnassigned(tagNumber){this._push(this.createTag(tagNumber))}pushBreak(){if(this._currentParent.length>-1)throw new Error("Unexpected break");this._closeParent()}_createObjectStartFixed(len){if(0===len)return void this._push(this.createObject({}));this._createParent({},c.PARENT.OBJECT,len)}_createArrayStartFixed(len){if(0===len)return void this._push(this.createArray([]));this._createParent(new Array(len),c.PARENT.ARRAY,len)}_decode(input){if(0===input.byteLength)throw new Error("Input too short");this._reset(),this._heap8.set(input);const code=this.parser.parse(input.byteLength);if(this._depth>1){for(;0===this._currentParent.length;)this._closeParent();if(this._depth>1)throw new Error("Undeterminated nesting")}if(code>0)throw new Error("Failed to parse");if(0===this._res.length)throw new Error("No valid result")}decodeFirst(input){return this._decode(input),this._res[0]}decodeAll(input){return this._decode(input),this._res}static decode(input,enc){return"string"==typeof input&&(input=new Buffer(input,enc||"hex")),new Decoder({size:input.length}).decodeFirst(input)}static decodeAll(input,enc){return"string"==typeof input&&(input=new Buffer(input,enc||"hex")),new Decoder({size:input.length}).decodeAll(input)}}Decoder.decodeFirst=Decoder.decode,module.exports=Decoder}).call(exports,__webpack_require__(4),__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const constants=__webpack_require__(92),MT=constants.MT,SIMPLE=constants.SIMPLE,SYMS=constants.SYMS;class Simple{constructor(value){if("number"!=typeof value)throw new Error("Invalid Simple type: "+typeof value);if(value<0||value>255||(0|value)!==value)throw new Error("value must be a small positive integer: "+value);this.value=value}toString(){return"simple("+this.value+")"}inspect(){return"simple("+this.value+")"}encodeCBOR(gen){return gen._pushInt(this.value,MT.SIMPLE_FLOAT)}static isSimple(obj){return obj instanceof Simple}static decode(val,hasParent){switch(null==hasParent&&(hasParent=!0),val){case SIMPLE.FALSE:return!1;case SIMPLE.TRUE:return!0;case SIMPLE.NULL:return hasParent?null:SYMS.NULL;case SIMPLE.UNDEFINED:return hasParent?void 0:SYMS.UNDEFINED;case-1:if(!hasParent)throw new Error("Invalid BREAK");return SYMS.BREAK;default:return new Simple(val)}}}module.exports=Simple},function(module,exports,__webpack_require__){"use strict";class Tagged{constructor(tag,value,err){if(this.tag=tag,this.value=value,this.err=err,"number"!=typeof this.tag)throw new Error("Invalid tag type ("+typeof this.tag+")");if(this.tag<0||(0|this.tag)!==this.tag)throw new Error("Tag must be a positive integer: "+this.tag)}toString(){return`${this.tag}(${JSON.stringify(this.value)})`}encodeCBOR(gen){return gen._pushTag(this.tag),gen.pushAny(this.value)}convert(converters){var er,f;if("function"!=typeof(f=null!=converters?converters[this.tag]:void 0)&&"function"!=typeof(f=Tagged["_tag"+this.tag]))return this;try{return f.call(Tagged,this.value)}catch(error){return er=error,this.err=er,this}}}module.exports=Tagged},function(module,exports,__webpack_require__){(function(Buffer){function StreamCipher(mode,key,iv,decrypt){if(!(this instanceof StreamCipher))return new StreamCipher(mode,key,iv);Transform.call(this),this._finID=Buffer.concat([iv,new Buffer([0,0,0,1])]),iv=Buffer.concat([iv,new Buffer([0,0,0,2])]),this._cipher=new aes.AES(key),this._prev=new Buffer(iv.length),this._cache=new Buffer(""),this._secCache=new Buffer(""),this._decrypt=decrypt,this._alen=0,this._len=0,iv.copy(this._prev),this._mode=mode;var h=new Buffer(4);h.fill(0),this._ghash=new GHASH(this._cipher.encryptBlock(h)),this._authTag=null,this._called=!1}function xorTest(a,b){var out=0;a.length!==b.length&&out++;for(var len=Math.min(a.length,b.length),i=-1;++i>i%8,self._prev=shiftIn(self._prev,decrypt?bit:value);return out}function shiftIn(buffer,value){var len=buffer.length,i=-1,out=new Buffer(buffer.length);for(buffer=Buffer.concat([buffer,new Buffer([value])]);++i>7;return out}exports.encrypt=function(self,chunk,decrypt){for(var len=chunk.length,out=new Buffer(len),i=-1;++i1&&(this._buf=new Buffer(this.toString().replace(/\/$/,"")))}less(key){const list1=this.list(),list2=key.list();for(let i=0;ic2)return!1}return list1.length{const key=new Key(path).child(new Key(SHARDING_FN));("function"==typeof store.getRaw?store.getRaw.bind(store):store.get.bind(store))(key,(err,res)=>{if(err)return callback(err);let shard;try{shard=parseShardFun((res||"").toString().trim())}catch(err){return callback(err)}callback(null,shard)})}),exports.readme=readme,exports.parseShardFun=parseShardFun,exports.Prefix=Prefix,exports.Suffix=Suffix,exports.NextToLast=NextToLast},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const pull=__webpack_require__(5),levelup=__webpack_require__(559),asyncFilter=__webpack_require__(41).utils.asyncFilter,asyncSort=__webpack_require__(41).utils.asyncSort,Key=__webpack_require__(41).Key;class LevelDatastore{constructor(path,opts){this.db=levelup(path,Object.assign(opts||{},{compression:!1,valueEncoding:"binary"}))}open(callback){this.db.open(callback)}put(key,value,callback){this.db.put(key.toString(),value,callback)}get(key,callback){this.db.get(key.toString(),callback)}has(key,callback){this.db.get(key.toString(),(err,res)=>{if(err)return err.notFound?void callback(null,!1):void callback(err);callback(null,!0)})}delete(key,callback){this.db.del(key.toString(),callback)}close(callback){this.db.close(callback)}batch(){const ops=[];return{put:(key,value)=>{ops.push({type:"put",key:key.toString(),value:value})},delete:key=>{ops.push({type:"del",key:key.toString()})},commit:callback=>{this.db.batch(ops,callback)}}}query(q){let values=!0;null!=q.keysOnly&&(values=!q.keysOnly);const iter=this.db.db.iterator({keys:!0,values:values,keyAsBuffer:!0}),rawStream=(end,cb)=>{if(end)return iter.end(err=>{cb(err||end)});iter.next((err,key,value)=>{if(err)return cb(err);if(null==err&&null==key&&null==value)return iter.end(err=>{cb(err||!0)});const res={key:new Key(key,!1)};values&&(res.value=new Buffer(value)),cb(null,res)})};let tasks=[rawStream],filters=[];if(null!=q.prefix){const prefix=q.prefix;filters.push((e,cb)=>cb(null,e.key.toString().startsWith(prefix)))}if(null!=q.filters&&(filters=filters.concat(q.filters)),tasks=tasks.concat(filters.map(f=>asyncFilter(f))),null!=q.orders&&(tasks=tasks.concat(q.orders.map(o=>asyncSort(o)))),null!=q.offset){let i=0;tasks.push(pull.filter(()=>i++>=q.offset))}return null!=q.limit&&tasks.push(pull.take(q.limit)),pull.apply(null,tasks)}}module.exports=LevelDatastore}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function isSpecificValue(val){return val instanceof Buffer||val instanceof Date||val instanceof RegExp}function cloneSpecificValue(val){if(val instanceof Buffer){var x=new Buffer(val.length);return val.copy(x),x}if(val instanceof Date)return new Date(val.getTime());if(val instanceof RegExp)return new RegExp(val);throw new Error("Unexpected situation")}function deepCloneArray(arr){var clone=[];return arr.forEach(function(item,index){"object"==typeof item&&null!==item?Array.isArray(item)?clone[index]=deepCloneArray(item):isSpecificValue(item)?clone[index]=cloneSpecificValue(item):clone[index]=deepExtend({},item):clone[index]=item}),clone}var deepExtend=module.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var val,src,target=arguments[0],args=Array.prototype.slice.call(arguments,1);return args.forEach(function(obj){"object"!=typeof obj||null===obj||Array.isArray(obj)||Object.keys(obj).forEach(function(key){return src=target[key],val=obj[key],val===target?void 0:"object"!=typeof val||null===val?void(target[key]=val):Array.isArray(val)?void(target[key]=deepCloneArray(val)):isSpecificValue(val)?void(target[key]=cloneSpecificValue(val)):"object"!=typeof src||null===src||Array.isArray(src)?void(target[key]=deepExtend({},val)):void(target[key]=deepExtend(src,val))})}),target}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(process){function AbstractChainedBatch(db){this._db=db,this._operations=[],this._written=!1}AbstractChainedBatch.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},AbstractChainedBatch.prototype.put=function(key,value){this._checkWritten();var err=this._db._checkKey(key,"key",this._db._isBuffer);if(err)throw err;return this._db._isBuffer(key)||(key=String(key)),this._db._isBuffer(value)||(value=String(value)),"function"==typeof this._put?this._put(key,value):this._operations.push({type:"put",key:key,value:value}),this},AbstractChainedBatch.prototype.del=function(key){this._checkWritten();var err=this._db._checkKey(key,"key",this._db._isBuffer);if(err)throw err;return this._db._isBuffer(key)||(key=String(key)),"function"==typeof this._del?this._del(key):this._operations.push({type:"del",key:key}),this},AbstractChainedBatch.prototype.clear=function(){return this._checkWritten(),this._operations=[],"function"==typeof this._clear&&this._clear(),this},AbstractChainedBatch.prototype.write=function(options,callback){if(this._checkWritten(),"function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("write() requires a callback argument");return"object"!=typeof options&&(options={}),this._written=!0,"function"==typeof this._write?this._write(callback):"function"==typeof this._db._batch?this._db._batch(this._operations,options,callback):void process.nextTick(callback)},module.exports=AbstractChainedBatch}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(process){function AbstractIterator(db){this.db=db,this._ended=!1,this._nexting=!1}AbstractIterator.prototype.next=function(callback){var self=this;if("function"!=typeof callback)throw new Error("next() requires a callback argument");return self._ended?callback(new Error("cannot call next() after end()")):self._nexting?callback(new Error("cannot call next() before previous next() has completed")):(self._nexting=!0,"function"==typeof self._next?self._next(function(){self._nexting=!1,callback.apply(null,arguments)}):void process.nextTick(function(){self._nexting=!1,callback()}))},AbstractIterator.prototype.end=function(callback){if("function"!=typeof callback)throw new Error("end() requires a callback argument");return this._ended?callback(new Error("end() already called on iterator")):(this._ended=!0,"function"==typeof this._end?this._end(callback):void process.nextTick(callback))},module.exports=AbstractIterator}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(process,Buffer){function AbstractLevelDOWN(location){if(!arguments.length||void 0===location)throw new Error("constructor requires at least a location argument");if("string"!=typeof location)throw new Error("constructor requires a location string argument");this.location=location,this.status="new"}var xtend=__webpack_require__(37),AbstractIterator=__webpack_require__(202),AbstractChainedBatch=__webpack_require__(201);AbstractLevelDOWN.prototype.open=function(options,callback){var self=this,oldStatus=this.status;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("open() requires a callback argument");"object"!=typeof options&&(options={}),options.createIfMissing=0!=options.createIfMissing,options.errorIfExists=!!options.errorIfExists,"function"==typeof this._open?(this.status="opening",this._open(options,function(err){if(err)return self.status=oldStatus,callback(err);self.status="open",callback()})):(this.status="open",process.nextTick(callback))},AbstractLevelDOWN.prototype.close=function(callback){var self=this,oldStatus=this.status;if("function"!=typeof callback)throw new Error("close() requires a callback argument");"function"==typeof this._close?(this.status="closing",this._close(function(err){if(err)return self.status=oldStatus,callback(err);self.status="closed",callback()})):(this.status="closed",process.nextTick(callback))},AbstractLevelDOWN.prototype.get=function(key,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("get() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),"object"!=typeof options&&(options={}),options.asBuffer=0!=options.asBuffer,"function"==typeof this._get?this._get(key,options,callback):void process.nextTick(function(){callback(new Error("NotFound"))}))},AbstractLevelDOWN.prototype.put=function(key,value,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("put() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),null==value||this._isBuffer(value)||process.browser||(value=String(value)),"object"!=typeof options&&(options={}),"function"==typeof this._put?this._put(key,value,options,callback):void process.nextTick(callback))},AbstractLevelDOWN.prototype.del=function(key,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("del() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),"object"!=typeof options&&(options={}),"function"==typeof this._del?this._del(key,options,callback):void process.nextTick(callback))},AbstractLevelDOWN.prototype.batch=function(array,options,callback){if(!arguments.length)return this._chainedBatch();if("function"==typeof options&&(callback=options),"function"==typeof array&&(callback=array),"function"!=typeof callback)throw new Error("batch(array) requires a callback argument");if(!Array.isArray(array))return callback(new Error("batch(array) requires an array argument"));options&&"object"==typeof options||(options={});for(var e,err,i=0,l=array.length;i0)if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var _e=new Error("stream.unshift() after end event");stream.emit("error",_e)}else{var skipAdd;!state.decoder||addToFront||encoding||(chunk=state.decoder.write(chunk),skipAdd=!state.objectMode&&0===chunk.length),addToFront||(state.reading=!1),skipAdd||(state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream))),maybeReadMore(stream,state)}else addToFront||(state.reading=!1);return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||0===state.length&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}function chunkInvalid(state,chunk){var er=null;return Buffer.isBuffer(chunk)||"string"==typeof chunk||null===chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function onEofChunk(stream,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?processNextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,processNextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return nstr.length?str.length:n;if(ret+=nb===str.length?str:str.slice(0,n),0===(n-=nb)){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=bufferShim.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),0===(n-=nb)){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,processNextTick(endReadableNT,state,stream))}function endReadableNT(state,stream){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}function indexOf(xs,x){for(var i=0,l=xs.length;i=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n0?fromList(n,state):null,null===ret?(state.needReadable=!0,n=0):state.length-=n,0===state.length&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),null!==ret&&this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable){debug("onunpipe"),readable===src&&cleanup()}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",cleanup),src.removeListener("data",ondata),cleanedUp=!0,!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain()}function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1,!1!==dest.write(chunk)||increasedAwaitDrain||((1===state.pipesCount&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EElistenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:cleanup;state.endEmitted?processNextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1,increasedAwaitDrain=!1;return src.on("data",ondata),prependListener(dest,"error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState;if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i-1?setImmediate:processNextTick;Writable.WritableState=WritableState;var util=__webpack_require__(6);util.inherits=__webpack_require__(1);var internalUtil={deprecate:__webpack_require__(72)},Stream=__webpack_require__(208),Buffer=__webpack_require__(0).Buffer,bufferShim=__webpack_require__(14);util.inherits(Writable,Stream),WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(_){}}();var realHasInstance;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return!!realHasInstance.call(this,object)||object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=Buffer.isBuffer(chunk);return"function"==typeof encoding&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),"function"!=typeof cb&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,state.writing||state.corked||state.finished||state.bufferProcessing||!state.bufferedRequest||clearBuffer(this,state))},Writable.prototype.setDefaultEncoding=function(encoding){if("string"==typeof encoding&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this},Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;"function"==typeof chunk?(cb=chunk,chunk=null,encoding=null):"function"==typeof encoding&&(cb=encoding,encoding=null),null!==chunk&&void 0!==chunk&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||state.finished||endWritable(this,state,cb)}}).call(exports,__webpack_require__(2),__webpack_require__(22).setImmediate)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(8).EventEmitter},function(module,exports,__webpack_require__){(function(Buffer){const utils=__webpack_require__(210),params=__webpack_require__(238),BN=utils.BN;var BlockHeader=module.exports=function(data){var fields=[{name:"parentHash",length:32,default:utils.zeros(32)},{name:"uncleHash",default:utils.SHA3_RLP_ARRAY},{name:"coinbase",length:20,default:utils.zeros(20)},{name:"stateRoot",length:32,default:utils.zeros(32)},{name:"transactionsTrie",length:32,default:utils.SHA3_RLP},{name:"receiptTrie",length:32,default:utils.SHA3_RLP},{name:"bloom",default:utils.zeros(256)},{name:"difficulty",default:new Buffer([])},{name:"number",default:utils.intToBuffer(params.homeSteadForkNumber.v)},{name:"gasLimit",default:new Buffer("ffffffffffffff","hex")},{name:"gasUsed",empty:!0,default:new Buffer([])},{name:"timestamp",default:new Buffer([])},{name:"extraData",allowZero:!0,empty:!0,default:new Buffer([])},{name:"mixHash",default:utils.zeros(32)},{name:"nonce",default:new Buffer([])}];utils.defineProperties(this,fields,data)};BlockHeader.prototype.canonicalDifficulty=function(parentBlock){const blockTs=new BN(this.timestamp),parentTs=new BN(parentBlock.header.timestamp),parentDif=new BN(parentBlock.header.difficulty),minimumDifficulty=new BN(params.minimumDifficulty.v);var dif,offset=parentDif.div(new BN(params.difficultyBoundDivisor.v));if(this.isHomestead()){var a=blockTs.sub(parentTs).idivn(10).ineg().iaddn(1),cutoff=new BN(-99);1===cutoff.cmp(a)&&(a=cutoff),dif=parentDif.add(offset.mul(a))}else dif=1===parentTs.addn(params.durationLimit.v).cmp(blockTs)?offset.add(parentDif):parentDif.sub(offset);var exp=new BN(this.number).idivn(1e5).isubn(2);return exp.isNeg()||dif.iadd(new BN(2).pow(exp)),dif.cmp(minimumDifficulty)===-1&&(dif=minimumDifficulty),dif},BlockHeader.prototype.validateDifficulty=function(parentBlock){return 0===this.canonicalDifficulty(parentBlock).cmp(new BN(this.difficulty))},BlockHeader.prototype.validateGasLimit=function(parentBlock){const pGasLimit=utils.bufferToInt(parentBlock.header.gasLimit),gasLimit=utils.bufferToInt(this.gasLimit),a=Math.floor(pGasLimit/params.gasLimitBoundDivisor.v),maxGasLimit=pGasLimit+a,minGasLimit=pGasLimit-a;return maxGasLimit>gasLimit&&minGasLimitparams.maximumExtraDataSize.v?cb("invalid amount of extra data"):void cb():cb("invalid gas limit"):cb("invalid Difficulty")})},BlockHeader.prototype.hash=function(){return utils.rlphash(this.raw)},BlockHeader.prototype.isGenesis=function(){return""===this.number.toString("hex")},BlockHeader.prototype.isHomestead=function(){return utils.bufferToInt(this.number)>=params.homeSteadForkNumber.v},BlockHeader.prototype.isHomesteadReprice=function(){return utils.bufferToInt(this.number)>=params.homesteadRepriceForkNumber.v}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){const createKeccakHash=__webpack_require__(547),secp256k1=__webpack_require__(162),assert=__webpack_require__(7),rlp=__webpack_require__(52),BN=__webpack_require__(20),createHash=__webpack_require__(75);Object.assign(exports,__webpack_require__(422)),exports.MAX_INTEGER=new BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),exports.TWO_POW256=new BN("10000000000000000000000000000000000000000000000000000000000000000",16),exports.SHA3_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",exports.SHA3_NULL=Buffer.from(exports.SHA3_NULL_S,"hex"),exports.SHA3_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",exports.SHA3_RLP_ARRAY=Buffer.from(exports.SHA3_RLP_ARRAY_S,"hex"),exports.SHA3_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",exports.SHA3_RLP=Buffer.from(exports.SHA3_RLP_S,"hex"),exports.BN=BN,exports.rlp=rlp,exports.secp256k1=secp256k1,exports.zeros=function(bytes){return Buffer.allocUnsafe(bytes).fill(0)},exports.setLengthLeft=exports.setLength=function(msg,length,right){var buf=exports.zeros(length);return msg=exports.toBuffer(msg),right?msg.length0&&"0"===first.toString();)a=a.slice(1),first=a[0];return a},exports.toBuffer=function(v){if(!Buffer.isBuffer(v))if(Array.isArray(v))v=Buffer.from(v);else if("string"==typeof v)v=exports.isHexPrefixed(v)?Buffer.from(exports.padToEven(exports.stripHexPrefix(v)),"hex"):Buffer.from(v);else if("number"==typeof v)v=exports.intToBuffer(v);else if(null===v||void 0===v)v=Buffer.allocUnsafe(0);else{if(!v.toArray)throw new Error("invalid type");v=Buffer.from(v.toArray())}return v},exports.bufferToInt=function(buf){return new BN(exports.toBuffer(buf)).toNumber()},exports.bufferToHex=function(buf){return buf=exports.toBuffer(buf),"0x"+buf.toString("hex")},exports.fromSigned=function(num){return new BN(num).fromTwos(256)},exports.toUnsigned=function(num){return Buffer.from(num.toTwos(256).toArray())},exports.sha3=function(a,bits){return a=exports.toBuffer(a),bits||(bits=256),createKeccakHash("keccak"+bits).update(a).digest()},exports.sha256=function(a){return a=exports.toBuffer(a),createHash("sha256").update(a).digest()},exports.ripemd160=function(a,padded){a=exports.toBuffer(a);var hash=createHash("rmd160").update(a).digest();return padded===!0?exports.setLength(hash,32):hash},exports.rlphash=function(a){return exports.sha3(rlp.encode(a))},exports.isValidPrivate=function(privateKey){return secp256k1.privateKeyVerify(privateKey)},exports.isValidPublic=function(publicKey,sanitize){return 64===publicKey.length?secp256k1.publicKeyVerify(Buffer.concat([Buffer.from([4]),publicKey])):!!sanitize&&secp256k1.publicKeyVerify(publicKey)},exports.pubToAddress=exports.publicToAddress=function(pubKey,sanitize){return pubKey=exports.toBuffer(pubKey),sanitize&&64!==pubKey.length&&(pubKey=secp256k1.publicKeyConvert(pubKey,!1).slice(1)),assert(64===pubKey.length),exports.sha3(pubKey).slice(-20)};var privateToPublic=exports.privateToPublic=function(privateKey){return privateKey=exports.toBuffer(privateKey),secp256k1.publicKeyCreate(privateKey,!1).slice(1)};exports.importPublic=function(publicKey){return publicKey=exports.toBuffer(publicKey),64!==publicKey.length&&(publicKey=secp256k1.publicKeyConvert(publicKey,!1).slice(1)),publicKey},exports.ecsign=function(msgHash,privateKey){var sig=secp256k1.sign(msgHash,privateKey),ret={};return ret.r=sig.signature.slice(0,32),ret.s=sig.signature.slice(32,64),ret.v=sig.recovery+27,ret},exports.hashPersonalMessage=function(message){var prefix=exports.toBuffer("Ethereum Signed Message:\n"+message.length.toString());return exports.sha3(Buffer.concat([prefix,message]))},exports.ecrecover=function(msgHash,v,r,s){var signature=Buffer.concat([exports.setLength(r,32),exports.setLength(s,32)],64),recovery=v-27;if(0!==recovery&&1!==recovery)throw new Error("Invalid signature v value");var senderPubKey=secp256k1.recover(msgHash,signature,recovery);return secp256k1.publicKeyConvert(senderPubKey,!1).slice(1)},exports.toRpcSig=function(v,r,s){if(27!==v&&28!==v)throw new Error("Invalid recovery id") -;return exports.bufferToHex(Buffer.concat([exports.setLengthLeft(r,32),exports.setLengthLeft(s,32),exports.toBuffer(v-27)]))},exports.fromRpcSig=function(sig){if(sig=exports.toBuffer(sig),65!==sig.length)throw new Error("Invalid signature length");var v=sig[64];return v<27&&(v+=27),{v:v,r:sig.slice(0,32),s:sig.slice(32,64)}},exports.privateToAddress=function(privateKey){return exports.publicToAddress(privateToPublic(privateKey))},exports.isValidAddress=function(address){return/^0x[0-9a-fA-F]{40}$/i.test(address)},exports.toChecksumAddress=function(address){address=exports.stripHexPrefix(address).toLowerCase();for(var hash=exports.sha3(address).toString("hex"),ret="0x",i=0;i=8?address[i].toUpperCase():address[i];return ret},exports.isValidChecksumAddress=function(address){return exports.isValidAddress(address)&&exports.toChecksumAddress(address)===address},exports.generateAddress=function(from,nonce){return from=exports.toBuffer(from),nonce=new BN(nonce),nonce=nonce.isZero()?null:Buffer.from(nonce.toArray()),exports.rlphash([from,nonce]).slice(-20)},exports.isPrecompiled=function(address){var a=exports.unpad(address);return 1===a.length&&a[0]>0&&a[0]<5},exports.addHexPrefix=function(str){return"string"!=typeof str?str:exports.isHexPrefixed(str)?str:"0x"+str},exports.isValidSignature=function(v,r,s,homestead){const SECP256K1_N_DIV_2=new BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),SECP256K1_N=new BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===r.length&&32===s.length&&((27===v||28===v)&&(r=new BN(r),s=new BN(s),!(r.isZero()||r.gt(SECP256K1_N)||s.isZero()||s.gt(SECP256K1_N))&&(homestead!==!1||1!==new BN(s).cmp(SECP256K1_N_DIV_2))))},exports.baToJSON=function(ba){if(Buffer.isBuffer(ba))return"0x"+ba.toString("hex");if(ba instanceof Array){for(var array=[],i=0;i=v.length,"The field "+field.name+" must not have more "+field.length+" bytes")):field.allowZero&&0===v.length||!field.length||assert(field.length===v.length,"The field "+field.name+" must have byte length of "+field.length),self.raw[i]=v}self._fields.push(field.name),Object.defineProperty(self,field.name,{enumerable:!0,configurable:!0,get:getter,set:setter}),field.default&&(self[field.name]=field.default),field.alias&&Object.defineProperty(self,field.alias,{enumerable:!1,configurable:!0,set:setter,get:getter})}),data)if("string"==typeof data&&(data=Buffer.from(exports.stripHexPrefix(data),"hex")),Buffer.isBuffer(data)&&(data=rlp.decode(data)),Array.isArray(data)){if(data.length>self._fields.length)throw new Error("wrong number of fields in data");data.forEach(function(d,i){self[self._fields[i]]=exports.toBuffer(d)})}else{if("object"!=typeof data)throw new Error("invalid data");{const keys=Object.keys(data);fields.forEach(function(field){keys.indexOf(field.name)!==-1&&(self[field.name]=data[field.name]),keys.indexOf(field.alias)!==-1&&(self[field.alias]=data[field.alias])})}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function EVP_BytesToKey(password,salt,keyLen,ivLen){Buffer.isBuffer(password)||(password=new Buffer(password,"binary")),salt&&!Buffer.isBuffer(salt)&&(salt=new Buffer(salt,"binary")),keyLen/=8,ivLen=ivLen||0;for(var md_buf,i,ki=0,ii=0,key=new Buffer(keyLen),iv=new Buffer(ivLen),addmd=0,bufs=[];;){if(addmd++>0&&bufs.push(md_buf),bufs.push(password),salt&&bufs.push(salt),md_buf=md5(Buffer.concat(bufs)),bufs=[],i=0,keyLen>0)for(;;){if(0===keyLen)break;if(i===md_buf.length)break;key[ki++]=md_buf[i],keyLen--,i++}if(ivLen>0&&i!==md_buf.length)for(;;){if(0===ivLen)break;if(i===md_buf.length)break;iv[ii++]=md_buf[i],ivLen--,i++}if(0===keyLen&&0===ivLen)break}for(i=0;i0)if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var _e=new Error("stream.unshift() after end event");stream.emit("error",_e)}else{var skipAdd;!state.decoder||addToFront||encoding||(chunk=state.decoder.write(chunk),skipAdd=!state.objectMode&&0===chunk.length),addToFront||(state.reading=!1),skipAdd||(state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream))),maybeReadMore(stream,state)}else addToFront||(state.reading=!1);return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||0===state.length&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}function chunkInvalid(state,chunk){var er=null;return Buffer.isBuffer(chunk)||"string"==typeof chunk||null===chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function onEofChunk(stream,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?processNextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,processNextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return nstr.length?str.length:n;if(ret+=nb===str.length?str:str.slice(0,n),0===(n-=nb)){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=bufferShim.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),0===(n-=nb)){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,processNextTick(endReadableNT,state,stream))}function endReadableNT(state,stream){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}function indexOf(xs,x){for(var i=0,l=xs.length;i=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n0?fromList(n,state):null,null===ret?(state.needReadable=!0,n=0):state.length-=n,0===state.length&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),null!==ret&&this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable){debug("onunpipe"),readable===src&&cleanup()}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",cleanup),src.removeListener("data",ondata),cleanedUp=!0,!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain()}function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1,!1!==dest.write(chunk)||increasedAwaitDrain||((1===state.pipesCount&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EElistenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:cleanup;state.endEmitted?processNextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1,increasedAwaitDrain=!1;return src.on("data",ondata),prependListener(dest,"error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState;if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i-1?setImmediate:processNextTick;Writable.WritableState=WritableState;var util=__webpack_require__(6);util.inherits=__webpack_require__(1);var internalUtil={deprecate:__webpack_require__(72)},Stream=__webpack_require__(216),Buffer=__webpack_require__(0).Buffer,bufferShim=__webpack_require__(14);util.inherits(Writable,Stream),WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(_){}}();var realHasInstance;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return!!realHasInstance.call(this,object)||object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=Buffer.isBuffer(chunk);return"function"==typeof encoding&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),"function"!=typeof cb&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,state.writing||state.corked||state.finished||state.bufferProcessing||!state.bufferedRequest||clearBuffer(this,state))},Writable.prototype.setDefaultEncoding=function(encoding){if("string"==typeof encoding&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this},Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;"function"==typeof chunk?(cb=chunk,chunk=null,encoding=null):"function"==typeof encoding&&(cb=encoding,encoding=null),null!==chunk&&void 0!==chunk&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||state.finished||endWritable(this,state,cb)}}).call(exports,__webpack_require__(2),__webpack_require__(22).setImmediate)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(8).EventEmitter},function(module,exports,__webpack_require__){exports=module.exports=__webpack_require__(213),exports.Stream=exports,exports.Readable=exports,exports.Writable=__webpack_require__(215),exports.Duplex=__webpack_require__(59),exports.Transform=__webpack_require__(214),exports.PassThrough=__webpack_require__(446)},function(module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=8*nBytes-mLen-1,eMax=(1<>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];for(i+=d,e=s&(1<<-nBits)-1,s>>=-nBits,nBits+=eLen;nBits>0;e=256*e+buffer[offset+i],i+=d,nBits-=8);for(m=e&(1<<-nBits)-1,e>>=-nBits,nBits+=mLen;nBits>0;m=256*m+buffer[offset+i],i+=d,nBits-=8);if(0===e)e=1-eBias;else{if(e===eMax)return m?NaN:1/0*(s?-1:1);m+=Math.pow(2,mLen),e-=eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)},exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c,eLen=8*nBytes-mLen-1,eMax=(1<>1,rt=23===mLen?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||0===value&&1/value<0?1:0;for(value=Math.abs(value),isNaN(value)||value===1/0?(m=isNaN(value)?1:0,e=eMax):(e=Math.floor(Math.log(value)/Math.LN2),value*(c=Math.pow(2,-e))<1&&(e--,c*=2),value+=e+eBias>=1?rt/c:rt*Math.pow(2,1-eBias),value*c>=2&&(e++,c/=2),e+eBias>=eMax?(m=0,e=eMax):e+eBias>=1?(m=(value*c-1)*Math.pow(2,mLen), -e+=eBias):(m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen),e=0));mLen>=8;buffer[offset+i]=255&m,i+=d,m/=256,mLen-=8);for(e=e<0;buffer[offset+i]=255&e,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=128*s}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function namespaceType(ns){const parts=ns.split(":");return parts.length<2?"":parts.slice(0,-1).join(":")}function namespaceValue(ns){const parts=ns.split(":");return parts[parts.length-1]}const path=__webpack_require__(45),uuid=__webpack_require__(121);class Key{constructor(s,clean){if("string"==typeof s?this._buf=new Buffer(s):Buffer.isBuffer(s)&&(this._buf=s),null==clean&&(clean=!0),clean&&this.clean(),0===this._buf.length||47!==this._buf[0])throw new Error(`Invalid key: ${this.toString()}`)}toString(encoding){return this._buf.toString(encoding||"utf8")}toBuffer(){return this._buf}get[Symbol.toStringTag](){return`[Key ${this.toString()}]`}static withNamespaces(list){return new Key(list.join("/"))}static random(){return new Key(uuid().replace(/-/g,""))}clean(){this._buf&&0!==this._buf.length||(this._buf=new Buffer("/")),47!==this._buf[0]&&(this._buf=Buffer.concat([new Buffer("/"),this._buf])),this._buf=new Buffer(path.normalize(this.toString())),this.toString().length>1&&(this._buf=new Buffer(this.toString().replace(/\/$/,"")))}less(key){const list1=this.list(),list2=key.list();for(let i=0;ic2)return!1}return list1.lengththis._fsStore.open(err=>{if(err&&"Already open"===err.message)return cb();cb(err)}),cb=>this.config.set(config,cb),cb=>this.version.set(5,cb)],callback)}open(callback){if(!this.closed)return callback(new Error("repo is already open"));log("opening at: %s",this.path),waterfall([cb=>this._fsStore.open(err=>{if(err&&"Already open"===err.message)return cb();cb(err)}),cb=>this._isInitialized(cb),cb=>this._locker.lock(this.path,cb),(lck,cb)=>{log("aquired repo.lock"),this.lockfile=lck,log("creating flatfs");const FsStore=this.options.fs,s=new FsStore(path.join(this.path,"blocks"),this._fsOptions);if(this.options.sharding){const shard=new core.shard.NextToLast(2);ShardingStore.createOrOpen(s,shard,cb)}else cb(null,s)},(flatfs,cb)=>{log("Flatfs store opened"),this.store=new MountStore([{prefix:new Key("blocks"),datastore:flatfs},{prefix:new Key("/"),datastore:new LevelStore(path.join(this.path,"datastore"),{db:this.options.level})}]),this.blockstore=blockstore(this),this.closed=!1,cb()}],err=>{if(err&&this.lockfile)return this.lockfile.close(err2=>{log("error removing lock",err2),callback(err)});callback(err)})}_isInitialized(callback){log("init check"),parallel([cb=>this.config.exists(cb),cb=>this.version.check(5,cb)],(err,res)=>{return log("init",err,res),err?callback(err):res[0]?void callback():callback(new Error("repo is not initialized yet"))})}close(callback){if(this.closed)return callback(new Error("repo is already closed"));log("closing at: %s",this.path),series([cb=>this._fsStore.delete(apiFile,err=>{if(err&&err.message.startsWith("ENOENT"))return cb();cb(err)}),cb=>this.store.close(cb),cb=>this._fsStore.close(cb),cb=>{log("unlocking"),this.closed=!0,this.lockfile.close(cb)},cb=>{this.lockfile=null,cb()}],err=>callback(err))}exists(callback){this.version.exists(callback)}setApiAddress(addr,callback){this._fsStore.put(apiFile,Buffer.from(addr.toString()),callback)}apiAddress(callback){this._fsStore.get(apiFile,(err,rawAddr)=>{if(err)return callback(err);callback(null,new Multiaddr(rawAddr.toString()))})}}module.exports=IpfsRepo},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),setImmediate=__webpack_require__(11),log=debug("repo:lock"),LOCKS={};exports.lock=((dir,callback)=>{const file=dir+"/repo.lock";log("locking %s",file),LOCKS[file]=!0;const closer={close(cb){LOCKS[file]&&delete LOCKS[file],setImmediate(cb)}};setImmediate(()=>{callback(null,closer)})}),exports.locked=((dir,callback)=>{const file=dir+"/repo.lock";log("checking lock: %s");const locked=LOCKS[file];setImmediate(()=>{callback(null,locked)})})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(17);module.exports=(multihash=>{return Buffer.isBuffer(multihash)?mh.toB58String(multihash):multihash})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function flattenObject(obj,delimiter){return delimiter=delimiter||"/",0===Object.keys(obj).length?[]:traverse(obj).reduce(function(acc,x){"object"==typeof x&&x["/"]&&this.update(void 0);const path=this.path.join(delimiter);return""!==path&&acc.push({path:path,value:x}),acc},[])}const util=__webpack_require__(225),traverse=__webpack_require__(817);exports=module.exports,exports.multicodec="dag-cbor",exports.resolve=((block,path,callback)=>{"function"==typeof path&&(callback=path,path=void 0),util.deserialize(block.data,(err,node)=>{if(err)return callback(err);if(!path||"/"===path)return callback(null,{value:node,remainderPath:""});const parts=path.split("/"),val=traverse(node).get(parts);if(val)return callback(null,{value:val,remainderPath:""});let value,len=parts.length;for(let i=0;i{"function"==typeof options&&(callback=options,options=void 0),options=options||{},util.deserialize(block.data,(err,node)=>{if(err)return callback(err);callback(null,flattenObject(node).map(el=>el.path))})}),exports.isLink=((block,path,callback)=>{exports.resolve(block,path,(err,result)=>{return err?callback(err):result.remainderPath.length>0?callback(new Error("path out of scope")):void("object"==typeof result.value&&result.value["/"]?callback(null,result.value):callback(null,!1))})})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function tagCID(cid){return"string"==typeof cid&&(cid=new CID(cid).buffer),new cbor.Tagged(CID_CBOR_TAG,Buffer.concat([new Buffer("00","hex"),cid]))}function replaceCIDbyTAG(dagNode){function transform(obj){if(!obj||Buffer.isBuffer(obj)||"string"==typeof obj)return obj;if(Array.isArray(obj))return obj.map(transform);const keys=Object.keys(obj);if(1===keys.length&&"/"===keys[0])return tagCID(obj["/"]);if(keys.length>0){let out={};return keys.forEach(key=>{"object"==typeof obj[key]?out[key]=transform(obj[key]):out[key]=obj[key]}),out}return obj}let circular;try{circular=isCircular(dagNode)}catch(e){circular=!1}if(circular)throw new Error("The object passed has circular references");return transform(dagNode)}const cbor=__webpack_require__(371),multihashing=__webpack_require__(30),CID=__webpack_require__(12),waterfall=__webpack_require__(9),setImmediate=__webpack_require__(11),isCircular=__webpack_require__(538),resolver=__webpack_require__(224),CID_CBOR_TAG=42,decoder=new cbor.Decoder({tags:{[CID_CBOR_TAG]:val=>{return val=val.slice(1),{"/":val}}}});exports=module.exports,exports.serialize=((dagNode,callback)=>{let serialized;try{const dagNodeTagged=replaceCIDbyTAG(dagNode);serialized=cbor.encode(dagNodeTagged)}catch(err){return setImmediate(()=>callback(err))}setImmediate(()=>callback(null,serialized))}),exports.deserialize=((data,callback)=>{let deserialized;try{deserialized=decoder.decodeFirst(data)}catch(err){return setImmediate(()=>callback(err))}setImmediate(()=>callback(null,deserialized))}),exports.cid=((dagNode,callback)=>{waterfall([cb=>exports.serialize(dagNode,cb),(serialized,cb)=>multihashing(serialized,"sha2-256",cb),(mh,cb)=>cb(null,new CID(1,resolver.multicodec,mh))],callback)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const Account=__webpack_require__(419),cidForHash=__webpack_require__(509).cidForHash;exports.deserialize=function(data,callback){let deserialized;try{deserialized=new Account(data)}catch(err){return callback(err)}callback(null,deserialized)},exports.serialize=function(account,callback){let serialized;try{serialized=account.serialize()}catch(err){return callback(err)}callback(null,serialized)},exports.cid=function(account,callback){let cid;try{cid=cidForHash("eth-account-snapshot",account.hash())}catch(err){return callback(err)}callback(null,cid)}},function(module,exports,__webpack_require__){"use strict";function cidForHash(codec,rawhash){return new CID(1,codec,multihashes.encode(rawhash,"keccak-256"))}const CID=__webpack_require__(512),multihashes=__webpack_require__(103);module.exports={cidForHash:cidForHash}},function(module,exports,__webpack_require__){"use strict";const async=__webpack_require__(86),RLP=__webpack_require__(52),multihash=__webpack_require__(516),cidForHash=__webpack_require__(227).cidForHash;exports.deserialize=function(data,callback){let deserialized;try{deserialized=RLP.decode(data)}catch(err){return callback(err)}callback(null,deserialized)},exports.serialize=function(blockList,callback){let serialized;try{serialized=RLP.encode(blockList)}catch(err){return callback(err)}callback(null,serialized)},exports.cid=function(blockList,callback){async.waterfall([cb=>exports.serialize(blockList,cb),(data,cb)=>multihash.digest(data,"keccak-256",cb),(mhash,cb)=>{let cid;try{cid=cidForHash("eth-block-list",mhash)}catch(err){return cb(err)}cb(null,cid)}],callback)}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function validate(multihash){exports.decode(multihash)}const bs58=__webpack_require__(24),cs=__webpack_require__(520),varint=__webpack_require__(16);exports.toHexString=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return hash.toString("hex")},exports.fromHexString=function(hash){return new Buffer(hash,"hex")},exports.toB58String=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return bs58.encode(hash)},exports.fromB58String=function(hash){let encoded=hash;return Buffer.isBuffer(hash)&&(encoded=hash.toString()),new Buffer(bs58.decode(encoded))},exports.decode=function(buf){if(!Buffer.isBuffer(buf))throw new Error("multihash must be a Buffer");if(buf.length<3)throw new Error("multihash too short. must be > 3 bytes.");let code=varint.decode(buf);if(!exports.isValidCode(code))throw new Error(`multihash unknown function code: 0x${code.toString(16)}`);buf=buf.slice(varint.decode.bytes);let len=varint.decode(buf);if(len<1)throw new Error(`multihash invalid length: 0x${len.toString(16)}`);if(buf=buf.slice(varint.decode.bytes),buf.length!==len)throw new Error(`multihash length inconsistent: 0x${buf.toString("hex")}`);return{code:code,name:cs.codes[code],length:len,digest:buf}},exports.encode=function(digest,code,length){if(!digest||!code)throw new Error("multihash encode requires at least two args: digest, code");const hashfn=exports.coerceCode(code);if(!Buffer.isBuffer(digest))throw new Error("digest should be a Buffer");if(null==length&&(length=digest.length),length&&digest.length!==length)throw new Error("digest length should be equal to specified length.");return Buffer.concat([new Buffer(varint.encode(hashfn)),new Buffer(varint.encode(length)),digest])},exports.coerceCode=function(name){let code=name;if("string"==typeof name){if(!cs.names[name])throw new Error(`Unrecognized hash function named: ${name}`);code=cs.names[name]}if("number"!=typeof code)throw new Error(`Hash function code should be a number. Got: ${code}`);if(!cs.codes[code]&&!exports.isAppCode(code))throw new Error(`Unrecognized function code: ${code}`);return code},exports.isAppCode=function(code){return code>0&&code<16},exports.isValidCode=function(code){return!!exports.isAppCode(code)||!!cs.codes[code]},exports.validate=validate,exports.prefix=function(multihash){return validate(multihash),multihash.slice(0,2)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function cidForHash(codec,rawhash){return new CID(1,codec,multihashes.encode(rawhash,"keccak-256"))}const CID=__webpack_require__(521),multihashes=__webpack_require__(523);module.exports={cidForHash:cidForHash}},function(module,exports,__webpack_require__){"use strict";exports.util=__webpack_require__(232),exports.resolver=__webpack_require__(524)},function(module,exports,__webpack_require__){"use strict";const EthBlockHeader=__webpack_require__(209),cidForHash=__webpack_require__(230).cidForHash;exports.deserialize=function(data,callback){let deserialized;try{deserialized=new EthBlockHeader(data)}catch(err){return callback(err)}callback(null,deserialized)},exports.serialize=function(blockHeader,callback){let serialized;try{serialized=blockHeader.serialize()}catch(err){return callback(err)}callback(null,serialized)},exports.cid=function(blockHeader,callback){let cid;try{cid=cidForHash("eth-block",blockHeader.hash())}catch(err){return callback(err)}callback(null,cid)}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function validate(multihash){exports.decode(multihash)}const bs58=__webpack_require__(24),cs=__webpack_require__(530),varint=__webpack_require__(16);exports.toHexString=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return hash.toString("hex")},exports.fromHexString=function(hash){return new Buffer(hash,"hex")},exports.toB58String=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return bs58.encode(hash)},exports.fromB58String=function(hash){let encoded=hash;return Buffer.isBuffer(hash)&&(encoded=hash.toString()),new Buffer(bs58.decode(encoded))},exports.decode=function(buf){if(!Buffer.isBuffer(buf))throw new Error("multihash must be a Buffer");if(buf.length<3)throw new Error("multihash too short. must be > 3 bytes.");let code=varint.decode(buf);if(!exports.isValidCode(code))throw new Error(`multihash unknown function code: 0x${code.toString(16)}`);buf=buf.slice(varint.decode.bytes);let len=varint.decode(buf);if(len<1)throw new Error(`multihash invalid length: 0x${len.toString(16)}`);if(buf=buf.slice(varint.decode.bytes),buf.length!==len)throw new Error(`multihash length inconsistent: 0x${buf.toString("hex")}`);return{code:code,name:cs.codes[code],length:len,digest:buf}},exports.encode=function(digest,code,length){if(!digest||!code)throw new Error("multihash encode requires at least two args: digest, code");const hashfn=exports.coerceCode(code);if(!Buffer.isBuffer(digest))throw new Error("digest should be a Buffer");if(null==length&&(length=digest.length),length&&digest.length!==length)throw new Error("digest length should be equal to specified length.");return Buffer.concat([new Buffer(varint.encode(hashfn)),new Buffer(varint.encode(length)),digest])},exports.coerceCode=function(name){let code=name;if("string"==typeof name){if(!cs.names[name])throw new Error(`Unrecognized hash function named: ${name}`);code=cs.names[name]}if("number"!=typeof code)throw new Error(`Hash function code should be a number. Got: ${code}`);if(!cs.codes[code]&&!exports.isAppCode(code))throw new Error(`Unrecognized function code: ${code}`);return code},exports.isAppCode=function(code){return code>0&&code<16},exports.isValidCode=function(code){return!!exports.isAppCode(code)||!!cs.codes[code]},exports.validate=validate,exports.prefix=function(multihash){return validate(multihash),multihash.slice(0,2)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const Transaction=__webpack_require__(421),cidForHash=__webpack_require__(534).cidForHash;exports.deserialize=function(data,callback){let deserialized;try{deserialized=new Transaction(data)}catch(err){return callback(err)}callback(null,deserialized)},exports.serialize=function(tx,callback){let serialized;try{serialized=tx.serialize()}catch(err){return callback(err)}callback(null,serialized)},exports.cid=function(tx,callback){let cid;try{cid=cidForHash("eth-tx",tx.hash())}catch(err){return callback(err)}callback(null,cid)}},function(module,exports){module.exports=function(str){if("string"!=typeof str)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof str+", while checking isHexPrefixed.");return"0x"===str.slice(0,2)}},function(module,exports){function isPromise(obj){return obj&&"function"==typeof obj.then}module.exports=isPromise},function(module,exports,__webpack_require__){(function(process,global){!function(){"use strict";function Keccak(bits,padding,outputBits){this.blocks=[],this.s=[],this.padding=padding,this.outputBits=outputBits,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(bits<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=outputBits>>5,this.extraBytes=(31&outputBits)>>3;for(var i=0;i<50;++i)this.s[i]=0}var root="object"==typeof window?window:{};!root.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(root=global);for(var COMMON_JS=!root.JS_SHA3_NO_COMMON_JS&&"object"==typeof module&&module.exports,HEX_CHARS="0123456789abcdef".split(""),SHAKE_PADDING=[31,7936,2031616,520093696],KECCAK_PADDING=[1,256,65536,16777216],PADDING=[6,1536,393216,100663296],SHIFT=[0,8,16,24],RC=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],BITS=[224,256,384,512],SHAKE_BITS=[128,256],OUTPUT_TYPES=["hex","buffer","arrayBuffer","array"],createOutputMethod=function(bits,padding,outputType){return function(message){return new Keccak(bits,padding,bits).update(message)[outputType]()}},createShakeOutputMethod=function(bits,padding,outputType){return function(message,outputBits){return new Keccak(bits,padding,outputBits).update(message)[outputType]()}},createMethod=function(bits,padding){var method=createOutputMethod(bits,padding,"hex");method.create=function(){return new Keccak(bits,padding,bits)},method.update=function(message){return method.create().update(message)};for(var i=0;i>2]|=message[index]<>2]|=code<>2]|=(192|code>>6)<>2]|=(128|63&code)<=57344?(blocks[i>>2]|=(224|code>>12)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<>2]|=(240|code>>18)<>2]|=(128|code>>12&63)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<=byteCount){for(this.start=i-byteCount,this.block=blocks[blockCount],i=0;i>2]|=this.padding[3&i],this.lastByteIndex===this.byteCount)for(blocks[0]=blocks[blockCount],i=1;i>4&15]+HEX_CHARS[15&block]+HEX_CHARS[block>>12&15]+HEX_CHARS[block>>8&15]+HEX_CHARS[block>>20&15]+HEX_CHARS[block>>16&15]+HEX_CHARS[block>>28&15]+HEX_CHARS[block>>24&15];j%blockCount==0&&(f(s),i=0)}return extraBytes&&(block=s[i],extraBytes>0&&(hex+=HEX_CHARS[block>>4&15]+HEX_CHARS[15&block]),extraBytes>1&&(hex+=HEX_CHARS[block>>12&15]+HEX_CHARS[block>>8&15]),extraBytes>2&&(hex+=HEX_CHARS[block>>20&15]+HEX_CHARS[block>>16&15])),hex},Keccak.prototype.arrayBuffer=function(){this.finalize();var buffer,blockCount=this.blockCount,s=this.s,outputBlocks=this.outputBlocks,extraBytes=this.extraBytes,i=0,j=0,bytes=this.outputBits>>3;buffer=extraBytes?new ArrayBuffer(outputBlocks+1<<2):new ArrayBuffer(bytes);for(var array=new Uint32Array(buffer);j>8&255,array[offset+2]=block>>16&255,array[offset+3]=block>>24&255;j%blockCount==0&&f(s)}return extraBytes&&(offset=j<<2,block=s[i],extraBytes>0&&(array[offset]=255&block),extraBytes>1&&(array[offset+1]=block>>8&255),extraBytes>2&&(array[offset+2]=block>>16&255)),array};var f=function(s){var h,l,n,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49;for(n=0;n<48;n+=2)c0=s[0]^s[10]^s[20]^s[30]^s[40],c1=s[1]^s[11]^s[21]^s[31]^s[41],c2=s[2]^s[12]^s[22]^s[32]^s[42],c3=s[3]^s[13]^s[23]^s[33]^s[43],c4=s[4]^s[14]^s[24]^s[34]^s[44],c5=s[5]^s[15]^s[25]^s[35]^s[45],c6=s[6]^s[16]^s[26]^s[36]^s[46],c7=s[7]^s[17]^s[27]^s[37]^s[47],c8=s[8]^s[18]^s[28]^s[38]^s[48],c9=s[9]^s[19]^s[29]^s[39]^s[49],h=c8^(c2<<1|c3>>>31),l=c9^(c3<<1|c2>>>31),s[0]^=h,s[1]^=l,s[10]^=h,s[11]^=l,s[20]^=h,s[21]^=l,s[30]^=h,s[31]^=l,s[40]^=h,s[41]^=l,h=c0^(c4<<1|c5>>>31),l=c1^(c5<<1|c4>>>31),s[2]^=h,s[3]^=l,s[12]^=h,s[13]^=l,s[22]^=h,s[23]^=l,s[32]^=h,s[33]^=l,s[42]^=h,s[43]^=l,h=c2^(c6<<1|c7>>>31),l=c3^(c7<<1|c6>>>31),s[4]^=h,s[5]^=l,s[14]^=h,s[15]^=l,s[24]^=h,s[25]^=l,s[34]^=h,s[35]^=l,s[44]^=h,s[45]^=l,h=c4^(c8<<1|c9>>>31),l=c5^(c9<<1|c8>>>31),s[6]^=h,s[7]^=l,s[16]^=h,s[17]^=l,s[26]^=h,s[27]^=l,s[36]^=h,s[37]^=l,s[46]^=h,s[47]^=l,h=c6^(c0<<1|c1>>>31),l=c7^(c1<<1|c0>>>31),s[8]^=h,s[9]^=l,s[18]^=h,s[19]^=l,s[28]^=h,s[29]^=l,s[38]^=h,s[39]^=l,s[48]^=h,s[49]^=l,b0=s[0],b1=s[1],b32=s[11]<<4|s[10]>>>28,b33=s[10]<<4|s[11]>>>28,b14=s[20]<<3|s[21]>>>29,b15=s[21]<<3|s[20]>>>29,b46=s[31]<<9|s[30]>>>23,b47=s[30]<<9|s[31]>>>23,b28=s[40]<<18|s[41]>>>14,b29=s[41]<<18|s[40]>>>14,b20=s[2]<<1|s[3]>>>31,b21=s[3]<<1|s[2]>>>31,b2=s[13]<<12|s[12]>>>20,b3=s[12]<<12|s[13]>>>20,b34=s[22]<<10|s[23]>>>22,b35=s[23]<<10|s[22]>>>22,b16=s[33]<<13|s[32]>>>19,b17=s[32]<<13|s[33]>>>19,b48=s[42]<<2|s[43]>>>30,b49=s[43]<<2|s[42]>>>30,b40=s[5]<<30|s[4]>>>2,b41=s[4]<<30|s[5]>>>2,b22=s[14]<<6|s[15]>>>26,b23=s[15]<<6|s[14]>>>26,b4=s[25]<<11|s[24]>>>21,b5=s[24]<<11|s[25]>>>21,b36=s[34]<<15|s[35]>>>17,b37=s[35]<<15|s[34]>>>17,b18=s[45]<<29|s[44]>>>3,b19=s[44]<<29|s[45]>>>3,b10=s[6]<<28|s[7]>>>4,b11=s[7]<<28|s[6]>>>4,b42=s[17]<<23|s[16]>>>9,b43=s[16]<<23|s[17]>>>9,b24=s[26]<<25|s[27]>>>7,b25=s[27]<<25|s[26]>>>7,b6=s[36]<<21|s[37]>>>11,b7=s[37]<<21|s[36]>>>11,b38=s[47]<<24|s[46]>>>8,b39=s[46]<<24|s[47]>>>8,b30=s[8]<<27|s[9]>>>5,b31=s[9]<<27|s[8]>>>5,b12=s[18]<<20|s[19]>>>12,b13=s[19]<<20|s[18]>>>12,b44=s[29]<<7|s[28]>>>25,b45=s[28]<<7|s[29]>>>25,b26=s[38]<<8|s[39]>>>24,b27=s[39]<<8|s[38]>>>24,b8=s[48]<<14|s[49]>>>18,b9=s[49]<<14|s[48]>>>18,s[0]=b0^~b2&b4,s[1]=b1^~b3&b5,s[10]=b10^~b12&b14,s[11]=b11^~b13&b15,s[20]=b20^~b22&b24,s[21]=b21^~b23&b25,s[30]=b30^~b32&b34,s[31]=b31^~b33&b35,s[40]=b40^~b42&b44,s[41]=b41^~b43&b45,s[2]=b2^~b4&b6,s[3]=b3^~b5&b7,s[12]=b12^~b14&b16,s[13]=b13^~b15&b17,s[22]=b22^~b24&b26,s[23]=b23^~b25&b27,s[32]=b32^~b34&b36,s[33]=b33^~b35&b37,s[42]=b42^~b44&b46,s[43]=b43^~b45&b47,s[4]=b4^~b6&b8,s[5]=b5^~b7&b9,s[14]=b14^~b16&b18,s[15]=b15^~b17&b19,s[24]=b24^~b26&b28,s[25]=b25^~b27&b29,s[34]=b34^~b36&b38,s[35]=b35^~b37&b39,s[44]=b44^~b46&b48,s[45]=b45^~b47&b49,s[6]=b6^~b8&b0,s[7]=b7^~b9&b1,s[16]=b16^~b18&b10,s[17]=b17^~b19&b11,s[26]=b26^~b28&b20,s[27]=b27^~b29&b21,s[36]=b36^~b38&b30,s[37]=b37^~b39&b31,s[46]=b46^~b48&b40,s[47]=b47^~b49&b41,s[8]=b8^~b0&b2,s[9]=b9^~b1&b3,s[18]=b18^~b10&b12,s[19]=b19^~b11&b13,s[28]=b28^~b20&b22,s[29]=b29^~b21&b23,s[38]=b38^~b30&b32,s[39]=b39^~b31&b33,s[48]=b48^~b40&b42,s[49]=b49^~b41&b43,s[0]^=RC[n],s[1]^=RC[n+1]};if(COMMON_JS)module.exports=methods;else for(var i=0;i>=1))break;ch+=ch}return pad+str}module.exports=leftPad;var cache=[""," "," "," "," "," "," "," "," "," "]},function(module,exports,__webpack_require__){(function(Buffer,process){function Level(location){if(!(this instanceof Level))return new Level(location);AbstractLevelDOWN.call(this,location)}module.exports=Level;var AbstractLevelDOWN=__webpack_require__(247).AbstractLevelDOWN,util=__webpack_require__(10),Iterator=__webpack_require__(556),xtend=__webpack_require__(37);util.inherits(Level,AbstractLevelDOWN),Level.prototype._open=function(options,callback){function onerror(ev){callback(ev.target.error)}function onsuccess(db){self._db=db;var exists=self._db.objectStoreNames.contains(self._idbOpts.storeName);if(options.errorIfExists&&exists)return self._db.close(),void callback(new Error("store already exists"));if(!options.createIfMissing&&!exists)return self._db.close(),void callback(new Error("store does not exist"));if(options.createIfMissing&&!exists){self._db.close();var req2=indexedDB.open(self.location,self._db.version+1);return req2.onerror=function(ev){callback(ev.target.error)},req2.onupgradeneeded=function(){req2.result.createObjectStore(self._idbOpts.storeName,self._idbOpts)},void(req2.onsuccess=function(){self._db=req2.result,callback(null,self)})}callback(null,self)}var self=this;if(this._idbOpts=xtend({storeName:this.location,keyEncoding:"none",valueEncoding:"none"},options),this._idbOpts.idb)onsuccess(this._idbOpts.idb);else{var req=indexedDB.open(this.location);req.onerror=onerror,req.onsuccess=function(){onsuccess(req.result)}}},Level.prototype._get=function(key,options,callback){options=xtend(this._idbOpts,options);var origKey=key;"binary"!==options.keyEncoding||Array.isArray(key)||(key=Array.prototype.slice.call(key));var tx=this._db.transaction(this._idbOpts.storeName),req=tx.objectStore(this._idbOpts.storeName).openCursor(IDBKeyRange.only(key));tx.onabort=function(){callback(tx.error)},req.onsuccess=function(){var cursor=req.result;if(cursor){var value=cursor.value;if(value instanceof Uint8Array&&(value=new Buffer(value)),"binary"!==options.valueEncoding||Buffer.isBuffer(value)||(value=new Buffer(value)),options.asBuffer&&!Buffer.isBuffer(value))if(null==value)value=new Buffer(0);else if("string"==typeof value)value=new Buffer(value);else if("boolean"==typeof value)value=new Buffer(String(value));else if("number"==typeof value)value=new Buffer(String(value));else if(Array.isArray(value))value=new Buffer(String(value));else{if(!(value instanceof Uint8Array))return void callback(new TypeError("can't coerce `"+value.constructor.name+"` into a Buffer"));value=new Buffer(value)}return void callback(null,value,origKey)}return void callback(new Error("NotFound"))}},Level.prototype._del=function(key,options,callback){options=xtend(this._idbOpts,options),"binary"!==options.keyEncoding||Array.isArray(key)||(key=Array.prototype.slice.call(key));var mode="readwrite";options.sync===!0&&(mode="readwriteflush");var tx=this._db.transaction(this._idbOpts.storeName,mode);tx.objectStore(this._idbOpts.storeName).delete(key);tx.onabort=function(){callback(tx.error)},tx.oncomplete=function(){callback()}},Level.prototype._put=function(key,value,options,callback){options=xtend(this._idbOpts,options),"binary"!==options.keyEncoding||Array.isArray(key)||(key=Array.prototype.slice.call(key));var mode="readwrite";options.sync===!0&&(mode="readwriteflush");var tx=this._db.transaction(this._idbOpts.storeName,mode);tx.objectStore(this._idbOpts.storeName).put(value,key);tx.onabort=function(){callback(tx.error)},tx.oncomplete=function(){callback()}},Level.prototype._iterator=function(options){return new Iterator(this,options)},Level.prototype._batch=function(array,options,callback){if(0===array.length)return process.nextTick(callback);var mode="readwrite";options.sync===!0&&(mode="readwriteflush");var tx=this._db.transaction(this._idbOpts.storeName,mode),store=tx.objectStore(this._idbOpts.storeName);tx.onabort=function(){callback(tx.error)},tx.oncomplete=function(){callback()},array.forEach(function(currentOp){"binary"!==xtend(options,currentOp).keyEncoding||Array.isArray(currentOp.key)||(currentOp.key=Array.prototype.slice.call(currentOp.key)),"del"===currentOp.type?store.delete(currentOp.key):store.put(currentOp.value,currentOp.key)})},Level.prototype._close=function(callback){this._db.close(),process.nextTick(callback)},Level.prototype._approximateSize=function(start,end,callback){var err=new Error("Not implemented");if(callback)return void process.nextTick(function(){callback(err)});throw err},Level.destroy=function(db,callback){var idbOpts;if(null!=db&&"object"==typeof db)idbOpts=xtend({location:db.location,storeName:db.location},db._idbOpts);else{if("string"!=typeof db)throw new TypeError("location must be a string or an object");idbOpts={location:db,storeName:db}}if("string"!=typeof idbOpts.location)throw new TypeError("location must be a string");if("string"!=typeof idbOpts.storeName)throw new TypeError("db.storeName must be a string");var req=indexedDB.open(idbOpts.location);req.onerror=function(ev){callback(ev.target.error)},req.onsuccess=function(){function deleteDatabase(name){var req2=indexedDB.deleteDatabase(name);req2.onerror=function(ev){callback(ev.target.error)},req2.onsuccess=function(){callback()}}var db=req.result;if(db.close(),0===db.objectStoreNames.length)return void deleteDatabase(idbOpts.location);if(!db.objectStoreNames.contains(idbOpts.storeName))return void callback();var req2=indexedDB.open(idbOpts.location,db.version+1);req2.onerror=function(ev){callback(ev.target.error)},req2.onupgradeneeded=function(){db=req2.result,db.deleteObjectStore(idbOpts.storeName)},req2.onsuccess=function(){db=req2.result,db.close(),0===db.objectStoreNames.length?deleteDatabase(idbOpts.location):callback()}}}}).call(exports,__webpack_require__(0).Buffer,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(process){function AbstractChainedBatch(db){this._db=db,this._operations=[],this._written=!1}AbstractChainedBatch.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},AbstractChainedBatch.prototype.put=function(key,value){this._checkWritten();var err=this._db._checkKey(key,"key",this._db._isBuffer);if(err)throw err;return this._db._isBuffer(key)||(key=String(key)),this._db._isBuffer(value)||(value=String(value)),"function"==typeof this._put?this._put(key,value):this._operations.push({type:"put",key:key,value:value}),this},AbstractChainedBatch.prototype.del=function(key){this._checkWritten();var err=this._db._checkKey(key,"key",this._db._isBuffer);if(err)throw err;return this._db._isBuffer(key)||(key=String(key)),"function"==typeof this._del?this._del(key):this._operations.push({type:"del",key:key}),this},AbstractChainedBatch.prototype.clear=function(){return this._checkWritten(),this._operations=[],"function"==typeof this._clear&&this._clear(),this},AbstractChainedBatch.prototype.write=function(options,callback){if(this._checkWritten(),"function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("write() requires a callback argument");return"object"!=typeof options&&(options={}),this._written=!0,"function"==typeof this._write?this._write(callback):"function"==typeof this._db._batch?this._db._batch(this._operations,options,callback):void process.nextTick(callback)},module.exports=AbstractChainedBatch}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(process){function AbstractIterator(db){this.db=db,this._ended=!1,this._nexting=!1}AbstractIterator.prototype.next=function(callback){var self=this;if("function"!=typeof callback)throw new Error("next() requires a callback argument");return self._ended?callback(new Error("cannot call next() after end()")):self._nexting?callback(new Error("cannot call next() before previous next() has completed")):(self._nexting=!0,"function"==typeof self._next?self._next(function(){self._nexting=!1,callback.apply(null,arguments)}):void process.nextTick(function(){self._nexting=!1,callback()}))},AbstractIterator.prototype.end=function(callback){if("function"!=typeof callback)throw new Error("end() requires a callback argument");return this._ended?callback(new Error("end() already called on iterator")):(this._ended=!0,"function"==typeof this._end?this._end(callback):void process.nextTick(callback))},module.exports=AbstractIterator}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(process,Buffer){function AbstractLevelDOWN(location){if(!arguments.length||void 0===location)throw new Error("constructor requires at least a location argument");if("string"!=typeof location)throw new Error("constructor requires a location string argument");this.location=location,this.status="new"}var xtend=__webpack_require__(37),AbstractIterator=__webpack_require__(245),AbstractChainedBatch=__webpack_require__(244);AbstractLevelDOWN.prototype.open=function(options,callback){var self=this,oldStatus=this.status;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("open() requires a callback argument");"object"!=typeof options&&(options={}),options.createIfMissing=0!=options.createIfMissing,options.errorIfExists=!!options.errorIfExists,"function"==typeof this._open?(this.status="opening",this._open(options,function(err){if(err)return self.status=oldStatus,callback(err);self.status="open",callback()})):(this.status="open",process.nextTick(callback))},AbstractLevelDOWN.prototype.close=function(callback){var self=this,oldStatus=this.status;if("function"!=typeof callback)throw new Error("close() requires a callback argument");"function"==typeof this._close?(this.status="closing",this._close(function(err){if(err)return self.status=oldStatus,callback(err);self.status="closed",callback()})):(this.status="closed",process.nextTick(callback))},AbstractLevelDOWN.prototype.get=function(key,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("get() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),"object"!=typeof options&&(options={}),options.asBuffer=0!=options.asBuffer,"function"==typeof this._get?this._get(key,options,callback):void process.nextTick(function(){callback(new Error("NotFound"))}))},AbstractLevelDOWN.prototype.put=function(key,value,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("put() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),null==value||this._isBuffer(value)||process.browser||(value=String(value)),"object"!=typeof options&&(options={}),"function"==typeof this._put?this._put(key,value,options,callback):void process.nextTick(callback))},AbstractLevelDOWN.prototype.del=function(key,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("del() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),"object"!=typeof options&&(options={}),"function"==typeof this._del?this._del(key,options,callback):void process.nextTick(callback))},AbstractLevelDOWN.prototype.batch=function(array,options,callback){if(!arguments.length)return this._chainedBatch();if("function"==typeof options&&(callback=options),"function"==typeof array&&(callback=array),"function"!=typeof callback)throw new Error("batch(array) requires a callback argument");if(!Array.isArray(array))return callback(new Error("batch(array) requires an array argument"));options&&"object"==typeof options||(options={});for(var e,err,i=0,l=array.length;i{if("undefined"!=typeof self&&(__webpack_require__(682)(self),self.crypto))return self.crypto;throw new Error("Please use an environment with crypto support")})},function(module,exports,__webpack_require__){"use strict";module.exports={PROTOCOL:"/ipfs/ping/1.0.0",PING_LENGTH:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const protobuf=__webpack_require__(31),PeerId=__webpack_require__(22),crypto=__webpack_require__(63),parallel=__webpack_require__(39),waterfall=__webpack_require__(7),debug=__webpack_require__(3),log=debug("libp2p:secio");log.error=debug("libp2p:secio:error");const pbm=protobuf(__webpack_require__(505)),support=__webpack_require__(127);exports.createProposal=(state=>{return state.proposal.out={rand:crypto.randomBytes(16),pubkey:state.key.local.public.bytes,exchanges:support.exchanges.join(","),ciphers:support.ciphers.join(","),hashes:support.hashes.join(",")},state.proposalEncoded.out=pbm.Propose.encode(state.proposal.out),state.proposalEncoded.out}),exports.createExchange=((state,callback)=>{crypto.keys.generateEphemeralKeyPair(state.protocols.local.curveT,(err,res)=>{if(err)return callback(err);state.ephemeralKey.local=res.key,state.shared.generate=res.genSharedKey;const selectionOut=Buffer.concat([state.proposalEncoded.out,state.proposalEncoded.in,state.ephemeralKey.local]);state.key.local.sign(selectionOut,(err,sig)=>{if(err)return callback(err);state.exchange.out={epubkey:state.ephemeralKey.local,signature:sig},callback(null,pbm.Exchange.encode(state.exchange.out))})})}),exports.identify=((state,msg,callback)=>{log("1.1 identify"),state.proposalEncoded.in=msg,state.proposal.in=pbm.Propose.decode(msg);const pubkey=state.proposal.in.pubkey;state.key.remote=crypto.keys.unmarshalPublicKey(pubkey),PeerId.createFromPubKey(pubkey.toString("base64"),(err,remoteId)=>{if(err)return callback(err);state.id.remote=remoteId,log("1.1 identify - %s - identified remote peer as %s",state.id.local.toB58String(),state.id.remote.toB58String()),callback()})}),exports.selectProtocols=((state,callback)=>{log("1.2 selection");const local={pubKeyBytes:state.key.local.public.bytes,exchanges:support.exchanges,hashes:support.hashes,ciphers:support.ciphers,nonce:state.proposal.out.rand},remote={pubKeyBytes:state.proposal.in.pubkey,exchanges:state.proposal.in.exchanges.split(","),hashes:state.proposal.in.hashes.split(","),ciphers:state.proposal.in.ciphers.split(","),nonce:state.proposal.in.rand};support.selectBest(local,remote,(err,selected)=>{if(err)return callback(err);state.protocols.remote={order:selected.order,curveT:selected.curveT,cipherT:selected.cipherT,hashT:selected.hashT},state.protocols.local={order:selected.order,curveT:selected.curveT,cipherT:selected.cipherT,hashT:selected.hashT},callback()})}),exports.verify=((state,msg,callback)=>{log("2.1. verify"),state.exchange.in=pbm.Exchange.decode(msg),state.ephemeralKey.remote=state.exchange.in.epubkey;const selectionIn=Buffer.concat([state.proposalEncoded.in,state.proposalEncoded.out,state.ephemeralKey.remote]);state.key.remote.verify(selectionIn,state.exchange.in.signature,(err,sigOk)=>{return err?callback(err):sigOk?(log("2.1. verify - signature verified"),void callback()):callback(new Error("Bad signature"))})}),exports.generateKeys=((state,callback)=>{log("2.2. keys"),waterfall([cb=>state.shared.generate(state.exchange.in.epubkey,cb),(secret,cb)=>{state.shared.secret=secret,crypto.keys.keyStretcher(state.protocols.local.cipherT,state.protocols.local.hashT,state.shared.secret,cb)},(keys,cb)=>{if(state.protocols.local.order>0)state.protocols.local.keys=keys.k1,state.protocols.remote.keys=keys.k2;else{if(!(state.protocols.local.order<0))return cb(new Error("you are trying to talk to yourself"));state.protocols.local.keys=keys.k2,state.protocols.remote.keys=keys.k1}log("2.3. mac + cipher"),parallel([cb=>support.makeMacAndCipher(state.protocols.local,cb),cb=>support.makeMacAndCipher(state.protocols.remote,cb)],cb)}],callback)}),exports.verifyNonce=((state,n2)=>{const n1=state.proposal.out.rand;if(!n1.equals(n2))throw new Error(`Failed to read our encrypted nonce: ${n1.toString("hex")} != ${n2.toString("hex")}`)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function makeMac(hash,key,callback){crypto.hmac.create(hash,key,callback)}function makeCipher(cipherType,iv,key,callback){if("AES-128"===cipherType||"AES-256"===cipherType)return crypto.aes.create(key,iv,callback);callback(new Error(`unrecognized cipher type: ${cipherType}`))}const mh=__webpack_require__(21),lp=__webpack_require__(23),pull=__webpack_require__(4),crypto=__webpack_require__(63),parallel=__webpack_require__(39);exports.exchanges=["P-256","P-384","P-521"],exports.ciphers=["AES-256","AES-128"],exports.hashes=["SHA256","SHA512"],exports.theBest=((order,p1,p2)=>{let first,second;if(order<0)first=p2,second=p1;else{if(!(order>0))return p1[0];first=p1,second=p2}for(let firstCandidate of first)for(let secondCandidate of second)if(firstCandidate===secondCandidate)return firstCandidate;throw new Error("No algorithms in common!")}),exports.makeMacAndCipher=((target,callback)=>{parallel([cb=>makeMac(target.hashT,target.keys.macKey,cb),cb=>makeCipher(target.cipherT,target.keys.iv,target.keys.cipherKey,cb)],(err,macAndCipher)=>{if(err)return callback(err);target.mac=macAndCipher[0],target.cipher=macAndCipher[1],callback()})}),exports.selectBest=((local,remote,cb)=>{exports.digest(Buffer.concat([remote.pubKeyBytes,local.nonce]),(err,oh1)=>{if(err)return cb(err);exports.digest(Buffer.concat([local.pubKeyBytes,remote.nonce]),(err,oh2)=>{if(err)return cb(err);const order=Buffer.compare(oh1,oh2);if(0===order)return cb(new Error("you are trying to talk to yourself"));cb(null,{curveT:exports.theBest(order,local.exchanges,remote.exchanges),cipherT:exports.theBest(order,local.ciphers,remote.ciphers),hashT:exports.theBest(order,local.hashes,remote.hashes),order:order})})})}),exports.digest=((buf,cb)=>{mh.digest(buf,"sha2-256",buf.length,cb)}),exports.write=function(state,msg,cb){cb=cb||(()=>{}),pull(pull.values([msg]),lp.encode({fixed:!0,bytes:4}),pull.collect((err,res)=>{if(err)return cb(err);state.shake.write(res[0]),cb()}))},exports.read=function(reader,cb){lp.decodeFromReader(reader,{fixed:!0,bytes:4},cb)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(global,module){function arrayMap(array,iteratee){for(var index=-1,length=array?array.length:0,result=Array(length);++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function values(object){return object?baseValues(object,keys(object)):[]}var MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",reIsUint=/^(?:0|[1-9]\d*)$/,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,propertyIsEnumerable=objectProto.propertyIsEnumerable,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),isArray=Array.isArray;module.exports=values},function(module,exports,__webpack_require__){function baseGetTag(value){return null==value?void 0===value?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(value)?getRawTag(value):objectToString(value)}var Symbol=__webpack_require__(230),getRawTag=__webpack_require__(544),objectToString=__webpack_require__(549),nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=Symbol?Symbol.toStringTag:void 0;module.exports=baseGetTag},function(module,exports){var isArray=Array.isArray;module.exports=isArray},function(module,exports){function isObjectLike(value){return null!=value&&"object"==typeof value}module.exports=isObjectLike +},function(module,exports,__webpack_require__){"use strict";function Protocols(proto){if("number"==typeof proto){if(Protocols.codes[proto])return Protocols.codes[proto];throw new Error("no protocol with code: "+proto)}if("string"==typeof proto||proto instanceof String){if(Protocols.names[proto])return Protocols.names[proto];throw new Error("no protocol with name: "+proto)}throw new Error("invalid protocol id type: "+proto)}function p(code,size,name,resolvable){return{code:code,size:size,name:name,resolvable:Boolean(resolvable)}}const map=__webpack_require__(128);Protocols.lengthPrefixedVarSize=-1,Protocols.V=-1,Protocols.table=[[4,32,"ip4"],[6,16,"tcp"],[17,16,"udp"],[33,16,"dccp"],[41,128,"ip6"],[53,-1,"dns","resolvable"],[54,-1,"dns4","resolvable"],[55,-1,"dns6","resolvable"],[132,16,"sctp"],[302,0,"utp"],[421,Protocols.lengthPrefixedVarSize,"ipfs"],[480,0,"http"],[443,0,"https"],[477,0,"ws"],[478,0,"wss"],[275,0,"libp2p-webrtc-star"],[276,0,"libp2p-webrtc-direct"],[290,0,"p2p-circuit"]],Protocols.names={},Protocols.codes={},map(Protocols.table,function(row){const proto=p.apply(null,row);Protocols.codes[proto.code]=proto,Protocols.names[proto.name]=proto}),Protocols.object=p,module.exports=Protocols},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function multibase(nameOrCode,buf){if(!buf)throw new Error("requires an encoded buffer");const base=getBase(nameOrCode),codeBuf=new Buffer(base.code);return validEncode(base.name,buf),Buffer.concat([codeBuf,buf])}function encode(nameOrCode,buf){const base=getBase(nameOrCode);return multibase(base.name,new Buffer(base.encode(buf)))}function decode(bufOrString){Buffer.isBuffer(bufOrString)&&(bufOrString=bufOrString.toString());const code=bufOrString.substring(0,1);"string"==typeof(bufOrString=bufOrString.substring(1,bufOrString.length))&&(bufOrString=new Buffer(bufOrString));const base=getBase(code);return{base:base.name,data:new Buffer(base.decode(bufOrString.toString()))}.data}function isEncoded(bufOrString){Buffer.isBuffer(bufOrString)&&(bufOrString=bufOrString.toString());const code=bufOrString.substring(0,1);try{const base=getBase(code);return base.name}catch(err){return!1}}function validEncode(name,buf){getBase(name).decode(buf.toString())}function getBase(nameOrCode){let base;if(constants.names[nameOrCode])base=constants.names[nameOrCode];else{if(!constants.codes[nameOrCode])throw errNotSupported;base=constants.codes[nameOrCode]}if(!base.isImplemented())throw new Error("Base "+nameOrCode+" is not implemented yet");return base}const constants=__webpack_require__(566);exports=module.exports=multibase,exports.encode=encode,exports.decode=decode,exports.isEncoded=isEncoded;const errNotSupported=new Error("Unsupported encoding")}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const varint=__webpack_require__(15),codecNameToCodeVarint=__webpack_require__(90),codeToCodecName=__webpack_require__(237),util=__webpack_require__(238);exports=module.exports,exports.addPrefix=((multicodecStrOrCode,data)=>{let prefix;if(Buffer.isBuffer(multicodecStrOrCode))prefix=util.varintBufferEncode(multicodecStrOrCode);else{if(!codecNameToCodeVarint[multicodecStrOrCode])throw new Error("multicodec not recognized");prefix=codecNameToCodeVarint[multicodecStrOrCode]}return Buffer.concat([prefix,data])}),exports.rmPrefix=(data=>{return varint.decode(data),data.slice(varint.decode.bytes)}),exports.getCodec=(prefixedData=>{return codeToCodecName[util.varintBufferDecode(prefixedData).toString("hex")]})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.Listener=exports.listener=__webpack_require__(578),exports.Dialer=exports.dialer=__webpack_require__(577),exports.matchSemver=__webpack_require__(580),exports.matchExact=__webpack_require__(241)},function(module,exports,__webpack_require__){"use strict";const through=__webpack_require__(98);module.exports=function(_maxLength){const maxLength=_maxLength||100;var buffered=[];return through(function(data){for(buffered=buffered.concat(data);buffered.length>=maxLength;){const end=maxLength,slice=buffered.slice(0,end);buffered=buffered.slice(end),this.queue(slice)}},function(end){buffered.length&&(this.queue(buffered),buffered=[]),this.queue(null)})}},function(module,exports){function abortAll(ary,abort,cb){function next(){--n||cb(abort)}var n=ary.length;if(!n)return cb(abort);ary.forEach(function(f){f?f(abort,next):next()}),n||next()}module.exports=function(streams){return function(abort,cb){!function next(){abort?abortAll(streams,abort,cb):streams.length?streams[0]?streams[0](null,function(err,data){err?(streams.shift(),err===!0?next():abortAll(streams,err,cb)):cb(null,data)}):(streams.shift(),next()):cb(!0)}()}}},function(module,exports,__webpack_require__){var looper=__webpack_require__(600);module.exports=function(map,width,inOrder){inOrder=void 0===inOrder||inOrder;var abort,reading=!1;return function(read){function drain(){if(_cb){var cb=_cb;if(error)return _cb=null,cb(error);if(Object.hasOwnProperty.call(seen,j)){_cb=null;var data=seen[j];delete seen[j],j++,cb(null,data),width&&start()}else j>=last&&ended&&(_cb=null,cb(ended))}}var _cb,error,i=0,j=0,last=0,seen=[],started=!1,ended=!1,start=looper(function(){if(started=!0,ended)return drain();reading||width&&i-width>=j||(reading=!0,read(abort,function(end,data){if(reading=!1,end)last=i,ended=end,drain();else{var k=i++;map(data,function(err,data){inOrder?seen[k]=data:seen.push(data),err&&(error=err),drain()}),ended||start()}}))});return function(_abort,cb){_abort?read(ended=abort=_abort,function(err){if(cb)return cb(err)}):(_cb=cb,started||start(),drain())}}}},function(module,exports,__webpack_require__){"use strict";var drain=__webpack_require__(68);module.exports=function(reducer,acc,cb){cb||(cb=acc,acc=null);var sink=drain(function(data){acc=reducer(acc,data)},function(err){cb(err,acc)});return 2===arguments.length?function(source){source(null,function(end,data){if(end)return cb(end===!0?null:end);acc=data,sink(source)})}:sink}},function(module,exports,__webpack_require__){"use strict";var abortCb=__webpack_require__(255);module.exports=function(array,onAbort){if(!array)return function(abort,cb){return abort?abortCb(cb,abort,onAbort):cb(!0)};Array.isArray(array)||(array=Object.keys(array).map(function(k){return array[k]}));var i=0;return function(abort,cb){if(abort)return abortCb(cb,abort,onAbort);i>=array.length?cb(!0):cb(null,array[i++])}}},function(module,exports,__webpack_require__){"use strict";var tester=__webpack_require__(256);module.exports=function(test){return test=tester(test),function(read){return function next(end,cb){for(var sync,loop=!0;loop;)loop=!1,sync=!0,read(end,function(end,data){if(!end&&!test(data))return sync?loop=!0:next(end,cb);cb(end,data)}),sync=!1}}}},function(module,exports,__webpack_require__){"use strict";(function(process,setImmediate,global){function CorkedRequest(state){var _this=this;this.next=null,this.entry=null,this.finish=function(){onCorkedFinish(_this,state)}}function _uint8ArrayToBuffer(chunk){return Buffer.from(chunk)}function _isUint8Array(obj){return Buffer.isBuffer(obj)||obj instanceof OurUint8Array}function nop(){}function WritableState(options,stream){Duplex=Duplex||__webpack_require__(44),options=options||{},this.objectMode=!!options.objectMode,stream instanceof Duplex&&(this.objectMode=this.objectMode||!!options.writableObjectMode);var hwm=options.highWaterMark,defaultHwm=this.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:defaultHwm,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var noDecode=options.decodeStrings===!1;this.decodeStrings=!noDecode,this.defaultEncoding=options.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(er){onwrite(stream,er)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}function Writable(options){if(Duplex=Duplex||__webpack_require__(44),!(realHasInstance.call(Writable,this)||this instanceof Duplex))return new Writable(options);this._writableState=new WritableState(options,this),this.writable=!0,options&&("function"==typeof options.write&&(this._write=options.write),"function"==typeof options.writev&&(this._writev=options.writev),"function"==typeof options.destroy&&(this._destroy=options.destroy),"function"==typeof options.final&&(this._final=options.final)),Stream.call(this)}function writeAfterEnd(stream,cb){var er=new Error("write after end");stream.emit("error",er),processNextTick(cb,er)}function validChunk(stream,state,chunk,cb){var valid=!0,er=!1;return null===chunk?er=new TypeError("May not write null values to stream"):"string"==typeof chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er&&(stream.emit("error",er),processNextTick(cb,er),valid=!1),valid}function decodeChunk(state,chunk,encoding){return state.objectMode||state.decodeStrings===!1||"string"!=typeof chunk||(chunk=Buffer.from(chunk,encoding)),chunk}function writeOrBuffer(stream,state,isBuf,chunk,encoding,cb){if(!isBuf){var newChunk=decodeChunk(state,chunk,encoding);chunk!==newChunk&&(isBuf=!0,encoding="buffer",chunk=newChunk)}var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length-1?setImmediate:processNextTick;Writable.WritableState=WritableState;var util=__webpack_require__(26);util.inherits=__webpack_require__(1);var internalUtil={deprecate:__webpack_require__(672)},Stream=__webpack_require__(261),Buffer=__webpack_require__(6).Buffer,OurUint8Array=global.Uint8Array||function(){},destroyImpl=__webpack_require__(260);util.inherits(Writable,Stream),WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(_){}}();var realHasInstance;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return!!realHasInstance.call(this,object)||object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=_isUint8Array(chunk)&&!state.objectMode;return isBuf&&!Buffer.isBuffer(chunk)&&(chunk=_uint8ArrayToBuffer(chunk)),"function"==typeof encoding&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),"function"!=typeof cb&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,state.writing||state.corked||state.finished||state.bufferProcessing||!state.bufferedRequest||clearBuffer(this,state))},Writable.prototype.setDefaultEncoding=function(encoding){if("string"==typeof encoding&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this},Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;"function"==typeof chunk?(cb=chunk,chunk=null,encoding=null):"function"==typeof encoding&&(cb=encoding,encoding=null),null!==chunk&&void 0!==chunk&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||state.finished||endWritable(this,state,cb)},Object.defineProperty(Writable.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(value){this._writableState&&(this._writableState.destroyed=value)}}),Writable.prototype.destroy=destroyImpl.destroy,Writable.prototype._undestroy=destroyImpl.undestroy,Writable.prototype._destroy=function(err,cb){this.end(),cb(err)}}).call(exports,__webpack_require__(5),__webpack_require__(37).setImmediate,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(263)(__webpack_require__(647))},function(module,exports,__webpack_require__){function Encoder(){}function encodeAsString(obj){var str=""+obj.type;return exports.BINARY_EVENT!==obj.type&&exports.BINARY_ACK!==obj.type||(str+=obj.attachments+"-"),obj.nsp&&"/"!==obj.nsp&&(str+=obj.nsp+","),null!=obj.id&&(str+=obj.id),null!=obj.data&&(str+=JSON.stringify(obj.data)),debug("encoded %j as %s",obj,str),str}function encodeAsBinary(obj,callback){function writeEncoding(bloblessData){var deconstruction=binary.deconstructPacket(bloblessData),pack=encodeAsString(deconstruction.packet),buffers=deconstruction.buffers;buffers.unshift(pack),callback(buffers)}binary.removeBlobs(obj,writeEncoding)}function Decoder(){this.reconstructor=null}function decodeString(str){var i=0,p={type:Number(str.charAt(0))};if(null==exports.types[p.type])return error();if(exports.BINARY_EVENT===p.type||exports.BINARY_ACK===p.type){for(var buf="";"-"!==str.charAt(++i)&&(buf+=str.charAt(i),i!=str.length););if(buf!=Number(buf)||"-"!==str.charAt(i))throw new Error("Illegal attachments");p.attachments=Number(buf)}if("/"===str.charAt(i+1))for(p.nsp="";++i;){var c=str.charAt(i);if(","===c)break;if(p.nsp+=c,i===str.length)break}else p.nsp="/";var next=str.charAt(i+1);if(""!==next&&Number(next)==next){for(p.id="";++i;){var c=str.charAt(i);if(null==c||Number(c)!=c){--i;break}if(p.id+=str.charAt(i),i===str.length)break}p.id=Number(p.id)}return str.charAt(++i)&&(p=tryParse(p,str.substr(i))),debug("decoded %s as %j",str,p),p}function tryParse(p,str){try{p.data=JSON.parse(str)}catch(e){return error()}return p}function BinaryReconstructor(packet){this.reconPack=packet,this.buffers=[]}function error(){return{type:exports.ERROR,data:"parser error"}}var debug=__webpack_require__(3)("socket.io-parser"),Emitter=__webpack_require__(49),hasBin=__webpack_require__(186),binary=__webpack_require__(661),isBuf=__webpack_require__(272);exports.protocol=4,exports.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],exports.CONNECT=0,exports.DISCONNECT=1,exports.EVENT=2,exports.ACK=3,exports.ERROR=4,exports.BINARY_EVENT=5,exports.BINARY_ACK=6,exports.Encoder=Encoder,exports.Decoder=Decoder,Encoder.prototype.encode=function(obj,callback){if(obj.type!==exports.EVENT&&obj.type!==exports.ACK||!hasBin(obj.data)||(obj.type=obj.type===exports.EVENT?exports.BINARY_EVENT:exports.BINARY_ACK),debug("encoding packet %j",obj),exports.BINARY_EVENT===obj.type||exports.BINARY_ACK===obj.type)encodeAsBinary(obj,callback);else{callback([encodeAsString(obj)])}},Emitter(Decoder.prototype),Decoder.prototype.add=function(obj){var packet;if("string"==typeof obj)packet=decodeString(obj),exports.BINARY_EVENT===packet.type||exports.BINARY_ACK===packet.type?(this.reconstructor=new BinaryReconstructor(packet),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",packet)):this.emit("decoded",packet);else{if(!isBuf(obj)&&!obj.base64)throw new Error("Unknown type: "+obj);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(packet=this.reconstructor.takeBinaryData(obj))&&(this.reconstructor=null,this.emit("decoded",packet))}},Decoder.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},BinaryReconstructor.prototype.takeBinaryData=function(binData){if(this.buffers.push(binData),this.buffers.length===this.reconPack.attachments){var packet=binary.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),packet}return null},BinaryReconstructor.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(module,exports,__webpack_require__){(function(process){function destroy(stream,cb){function onClose(){cleanup(),cb()}function onError(err){cleanup(),cb(err)}function cleanup(){stream.removeListener("close",onClose),stream.removeListener("error",onError)}stream.on("close",onClose),stream.on("error",onError)}function destroy(stream){stream.destroy?stream.destroy():console.error("warning, stream-to-pull-stream: \nthe wrapped node-stream does not implement `destroy`, \nthis may cause resource leaks.")}function write(read,stream,cb){function done(){did||(did=!0,cb&&cb(ended===!0?null:ended))}function onClose(){closed||(closed=!0,cleanup(),ended?done():read(ended=!0,done))}function onError(err){cleanup(),ended||read(ended=err,done)}function cleanup(){stream.on("finish",onClose),stream.removeListener("close",onClose),stream.removeListener("error",onError)}var ended,did,closed=!1;stream.on("close",onClose),stream.on("finish",onClose),stream.on("error",onError),process.nextTick(function(){looper(function(next){read(null,function(end,data){if(ended=ended||end,end===!0)return stream._isStdio?done():stream.end();if(ended=ended||end)return destroy(stream),done(ended);if(stream._isStdio)stream.write(data,function(){next()});else{stream.write(data)===!1?stream.once("drain",next):next()}})})})}function read2(stream){function read(){var data=stream.read();if(null!==data&&_cb){var cb=_cb;_cb=null,cb(null,data)}}var _cb,ended=!1,waiting=!1;return stream.on("readable",function(){waiting=!0,_cb&&read()}).on("end",function(){ended=!0,_cb&&_cb(ended)}).on("error",function(err){ended=err,_cb&&_cb(ended)}),function(end,cb){_cb=cb,ended?cb(ended):waiting&&read()}}function read1(stream){function drain(){for(;(buffer.length||ended)&&cbs.length;)cbs.shift()(buffer.length?null:ended,buffer.shift());!buffer.length&&paused&&(paused=!1,stream.resume())}var ended,buffer=[],cbs=[],paused=!1;return stream.on("data",function(data){buffer.push(data),drain(),buffer.length&&stream.pause&&(paused=!0,stream.pause())}),stream.on("end",function(){ended=!0,drain()}),stream.on("close",function(){ended=!0,drain()}),stream.on("error",function(err){ended=err,drain()}),function(abort,cb){function onAbort(){for(;cbs.length;)cbs.shift()(abort);cb(abort)}if(!cb)throw new Error("*must* provide cb");if(abort){if(ended)return onAbort();stream.once("close",onAbort),destroy(stream)}else cbs.push(cb),drain()}}var looper=(__webpack_require__(252),__webpack_require__(235)),read=read1,sink=function(stream,cb){return function(read){return write(read,stream,cb)}},source=function(stream){return read1(stream)};exports=module.exports=function(stream,cb){return stream.writable&&stream.write?stream.readable?function(_read){return write(_read,stream,cb),read1(stream)}:sink(stream,cb):source(stream)},exports.sink=sink,exports.source=source,exports.read=read,exports.read1=read1,exports.read2=read2,exports.duplex=function(stream,cb){return{source:source(stream),sink:sink(stream,cb)}},exports.transform=function(stream){return function(read){var _source=source(stream);return sink(stream)(read),_source}}}).call(exports,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";function Url(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function urlParse(url,parseQueryString,slashesDenoteHost){if(url&&util.isObject(url)&&url instanceof Url)return url;var u=new Url;return u.parse(url,parseQueryString,slashesDenoteHost),u}function urlFormat(obj){return util.isString(obj)&&(obj=urlParse(obj)),obj instanceof Url?obj.format():Url.prototype.format.call(obj)}function urlResolve(source,relative){return urlParse(source,!1,!0).resolve(relative)}function urlResolveObject(source,relative){return source?urlParse(source,!1,!0).resolveObject(relative):relative}var punycode=__webpack_require__(632),util=__webpack_require__(671);exports.parse=urlParse,exports.resolve=urlResolve,exports.resolveObject=urlResolveObject,exports.format=urlFormat,exports.Url=Url;var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,simplePathPattern=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,delims=["<",">",'"',"`"," ","\r","\n","\t"],unwise=["{","}","|","\\","^","`"].concat(delims),autoEscape=["'"].concat(unwise),nonHostChars=["%","/","?",";","#"].concat(autoEscape),hostEndingChars=["/","?","#"],unsafeProtocol={javascript:!0,"javascript:":!0},hostlessProtocol={javascript:!0,"javascript:":!0},slashedProtocol={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},querystring=__webpack_require__(635);Url.prototype.parse=function(url,parseQueryString,slashesDenoteHost){if(!util.isString(url))throw new TypeError("Parameter 'url' must be a string, not "+typeof url);var queryIndex=url.indexOf("?"),splitter=queryIndex!==-1&&queryIndex127?"x":part[j];if(!newpart.match(/^[+a-z0-9A-Z_-]{0,63}$/)){var validParts=hostparts.slice(0,i),notHost=hostparts.slice(i+1),bit=part.match(/^([+a-z0-9A-Z_-]{0,63})(.*)$/);bit&&(validParts.push(bit[1]),notHost.unshift(bit[2])),notHost.length&&(rest="/"+notHost.join(".")+rest),this.hostname=validParts.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),ipv6Hostname||(this.hostname=punycode.toASCII(this.hostname));var p=this.port?":"+this.port:"",h=this.hostname||"";this.host=h+p,this.href+=this.host,ipv6Hostname&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==rest[0]&&(rest="/"+rest))}if(!unsafeProtocol[lowerProto])for(var i=0,l=autoEscape.length;i0)&&result.host.split("@");authInHost&&(result.auth=authInHost.shift(),result.host=result.hostname=authInHost.shift())}return result.search=relative.search,result.query=relative.query,util.isNull(result.pathname)&&util.isNull(result.search)||(result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")),result.href=result.format(),result}if(!srcPath.length)return result.pathname=null,result.search?result.path="/"+result.search:result.path=null,result.href=result.format(),result;for(var last=srcPath.slice(-1)[0],hasTrailingSlash=(result.host||relative.host||srcPath.length>1)&&("."===last||".."===last)||""===last,up=0,i=srcPath.length;i>=0;i--)last=srcPath[i],"."===last?srcPath.splice(i,1):".."===last?(srcPath.splice(i,1),up++):up&&(srcPath.splice(i,1),up--);if(!mustEndAbs&&!removeAllDots)for(;up--;up)srcPath.unshift("..");!mustEndAbs||""===srcPath[0]||srcPath[0]&&"/"===srcPath[0].charAt(0)||srcPath.unshift(""),hasTrailingSlash&&"/"!==srcPath.join("/").substr(-1)&&srcPath.push("");var isAbsolute=""===srcPath[0]||srcPath[0]&&"/"===srcPath[0].charAt(0);if(psychotic){result.hostname=result.host=isAbsolute?"":srcPath.length?srcPath.shift():"";var authInHost=!!(result.host&&result.host.indexOf("@")>0)&&result.host.split("@");authInHost&&(result.auth=authInHost.shift(),result.host=result.hostname=authInHost.shift())}return mustEndAbs=mustEndAbs||result.host&&srcPath.length,mustEndAbs&&!isAbsolute&&srcPath.unshift(""),srcPath.length?result.pathname=srcPath.join("/"):(result.pathname=null,result.path=null),util.isNull(result.pathname)&&util.isNull(result.search)||(result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")),result.auth=relative.auth||result.auth,result.slashes=result.slashes||relative.slashes,result.href=result.format(),result},Url.prototype.parseHost=function(){var host=this.host,port=portPattern.exec(host);port&&(port=port[0],":"!==port&&(this.port=port.substr(1)),host=host.substr(0,host.length-port.length)),host&&(this.hostname=host)}},function(module,exports,__webpack_require__){"use strict";exports.OFFLINE_ERROR=new Error("This command must be run in online mode. Try running 'ipfs daemon' first.")},function(module,exports,__webpack_require__){function DecoderBuffer(base,options){if(Reporter.call(this,options),!Buffer.isBuffer(base))return void this.error("Input not Buffer");this.base=base,this.offset=0,this.length=base.length}function EncoderBuffer(value,reporter){if(Array.isArray(value))this.length=0,this.value=value.map(function(item){return item instanceof EncoderBuffer||(item=new EncoderBuffer(item,reporter)),this.length+=item.length,item},this);else if("number"==typeof value){if(!(0<=value&&value<=255))return reporter.error("non-byte EncoderBuffer value");this.value=value,this.length=1}else if("string"==typeof value)this.value=value,this.length=Buffer.byteLength(value);else{if(!Buffer.isBuffer(value))return reporter.error("Unsupported type: "+typeof value);this.value=value,this.length=value.length}}var inherits=__webpack_require__(1),Reporter=__webpack_require__(57).Reporter,Buffer=__webpack_require__(0).Buffer;inherits(DecoderBuffer,Reporter),exports.DecoderBuffer=DecoderBuffer,DecoderBuffer.prototype.save=function(){return{offset:this.offset,reporter:Reporter.prototype.save.call(this)}},DecoderBuffer.prototype.restore=function(save){var res=new DecoderBuffer(this.base);return res.offset=save.offset,res.length=this.offset,this.offset=save.offset,Reporter.prototype.restore.call(this,save.reporter),res},DecoderBuffer.prototype.isEmpty=function(){return this.offset===this.length},DecoderBuffer.prototype.readUInt8=function(fail){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(fail||"DecoderBuffer overrun")},DecoderBuffer.prototype.skip=function(bytes,fail){if(!(this.offset+bytes<=this.length))return this.error(fail||"DecoderBuffer overrun");var res=new DecoderBuffer(this.base);return res._reporterState=this._reporterState,res.offset=this.offset,res.length=this.offset+bytes,this.offset+=bytes,res},DecoderBuffer.prototype.raw=function(save){return this.base.slice(save?save.offset:this.offset,this.length)},exports.EncoderBuffer=EncoderBuffer,EncoderBuffer.prototype.join=function(out,offset){return out||(out=new Buffer(this.length)),offset||(offset=0),0===this.length?out:(Array.isArray(this.value)?this.value.forEach(function(item){item.join(out,offset),offset+=item.length}):("number"==typeof this.value?out[offset]=this.value:"string"==typeof this.value?out.write(this.value,offset):Buffer.isBuffer(this.value)&&this.value.copy(out,offset),offset+=this.length),out)}},function(module,exports,__webpack_require__){var constants=exports;constants._reverse=function(map){var res={};return Object.keys(map).forEach(function(key){(0|key)==key&&(key|=0),res[map[key]]=key}),res},constants.der=__webpack_require__(282)},function(module,exports,__webpack_require__){function DERDecoder(entity){this.enc="der",this.name=entity.name,this.entity=entity,this.tree=new DERNode,this.tree._init(entity.body)}function DERNode(parent){base.Node.call(this,"der",parent)}function derDecodeTag(buf,fail){var tag=buf.readUInt8(fail);if(buf.isError(tag))return tag;var cls=der.tagClass[tag>>6],primitive=0==(32&tag);if(31==(31&tag)){var oct=tag;for(tag=0;128==(128&oct);){if(oct=buf.readUInt8(fail),buf.isError(oct))return oct;tag<<=7,tag|=127&oct}}else tag&=31;return{cls:cls,primitive:primitive,tag:tag,tagStr:der.tag[tag]}}function derDecodeLen(buf,primitive,fail){var len=buf.readUInt8(fail);if(buf.isError(len))return len;if(!primitive&&128===len)return null;if(0==(128&len))return len;var num=127&len;if(num>4)return buf.error("length octect is too long");len=0;for(var i=0;i=31?reporter.error("Multi-octet tag encoding unsupported"):(primitive||(res|=32),res|=der.tagClassByName[cls||"universal"]<<6)}var inherits=__webpack_require__(1),Buffer=__webpack_require__(0).Buffer,asn1=__webpack_require__(46),base=asn1.base,der=asn1.constants.der;module.exports=DEREncoder,DEREncoder.prototype.encode=function(data,reporter){return this.tree._encode(data,reporter).join()},inherits(DERNode,base.Node),DERNode.prototype._encodeComposite=function(tag,primitive,cls,content){var encodedTag=encodeTag(tag,primitive,cls,this.reporter);if(content.length<128){var header=new Buffer(2);return header[0]=encodedTag,header[1]=content.length,this._createEncoderBuffer([header,content])}for(var lenOctets=1,i=content.length;i>=256;i>>=8)lenOctets++;var header=new Buffer(2+lenOctets);header[0]=encodedTag,header[1]=128|lenOctets;for(var i=1+lenOctets,j=content.length;j>0;i--,j>>=8)header[i]=255&j;return this._createEncoderBuffer([header,content])},DERNode.prototype._encodeStr=function(str,tag){if("bitstr"===tag)return this._createEncoderBuffer([0|str.unused,str.data]);if("bmpstr"===tag){for(var buf=new Buffer(2*str.length),i=0;i=40)return this.reporter.error("Second objid identifier OOB");id.splice(0,2,40*id[0]+id[1])}for(var size=0,i=0;i=128;ident>>=7)size++}for(var objid=new Buffer(size),offset=objid.length-1,i=id.length-1;i>=0;i--){var ident=id[i];for(objid[offset--]=127&ident;(ident>>=7)>0;)objid[offset--]=128|127&ident}return this._createEncoderBuffer(objid)},DERNode.prototype._encodeTime=function(time,tag){var str,date=new Date(time);return"gentime"===tag?str=[two(date.getFullYear()),two(date.getUTCMonth()+1),two(date.getUTCDate()),two(date.getUTCHours()),two(date.getUTCMinutes()),two(date.getUTCSeconds()),"Z"].join(""):"utctime"===tag?str=[two(date.getFullYear()%100),two(date.getUTCMonth()+1),two(date.getUTCDate()),two(date.getUTCHours()),two(date.getUTCMinutes()),two(date.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+tag+" time is not supported yet"),this._encodeStr(str,"octstr")},DERNode.prototype._encodeNull=function(){return this._createEncoderBuffer("")},DERNode.prototype._encodeInt=function(num,values){if("string"==typeof num){if(!values)return this.reporter.error("String int or enum given, but no values map");if(!values.hasOwnProperty(num))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(num));num=values[num]}if("number"!=typeof num&&!Buffer.isBuffer(num)){var numArray=num.toArray();!num.sign&&128&numArray[0]&&numArray.unshift(0),num=new Buffer(numArray)}if(Buffer.isBuffer(num)){var size=num.length;0===num.length&&size++;var out=new Buffer(size);return num.copy(out),0===num.length&&(out[0]=0),this._createEncoderBuffer(out)}if(num<128)return this._createEncoderBuffer(num);if(num<256)return this._createEncoderBuffer([0,num]);for(var size=1,i=num;i>=256;i>>=8)size++;for(var out=new Array(size),i=out.length-1;i>=0;i--)out[i]=255&num,num>>=8;return 128&out[0]&&out.unshift(0),this._createEncoderBuffer(new Buffer(out))},DERNode.prototype._encodeBool=function(value){return this._createEncoderBuffer(value?255:0)},DERNode.prototype._use=function(entity,obj){return"function"==typeof entity&&(entity=entity(obj)),entity._getEncoder("der").tree},DERNode.prototype._skipDefault=function(dataBuffer,reporter,parent){var i,state=this._baseState;if(null===state.default)return!1;var data=dataBuffer.join();if(void 0===state.defaultBuffer&&(state.defaultBuffer=this._encodeValue(state.default,reporter,parent).join()),data.length!==state.defaultBuffer.length)return!1;for(i=0;i2&&(result=(0,_slice2.default)(arguments,1)),results[key]=result,callback(err)})},function(err){callback(err,results)})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=_parallel;var _noop=__webpack_require__(29),_noop2=_interopRequireDefault(_noop),_isArrayLike=__webpack_require__(64),_isArrayLike2=_interopRequireDefault(_isArrayLike),_slice=__webpack_require__(48),_slice2=_interopRequireDefault(_slice),_wrapAsync=__webpack_require__(13),_wrapAsync2=_interopRequireDefault(_wrapAsync);module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _withoutIndex(iteratee){return function(value,index,callback){return iteratee(value,callback)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=_withoutIndex,module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0});var _reject=__webpack_require__(298),_reject2=_interopRequireDefault(_reject),_doParallel=__webpack_require__(72),_doParallel2=_interopRequireDefault(_doParallel);exports.default=(0,_doParallel2.default)(_reject2.default),module.exports=exports.default},function(module,exports,__webpack_require__){(function(Buffer){function normalizeInput(input){var ret;if(input instanceof Uint8Array)ret=input;else if(input instanceof Buffer)ret=new Uint8Array(input);else{if("string"!=typeof input)throw new Error(ERROR_MSG_INPUT);ret=new Uint8Array(Buffer.from(input,"utf8"))}return ret}function toHex(bytes){return Array.prototype.map.call(bytes,function(n){return(n<16?"0":"")+n.toString(16)}).join("")}function uint32ToHex(val){return(4294967296+val).toString(16).substring(1)}function debugPrint(label,arr,size){for(var msg="\n"+label+" = ",i=0;inew Date(val),1:val=>new Date(1e3*val),2:val=>utils.arrayBufferToBignumber(val),3:val=>c.NEG_ONE.minus(utils.arrayBufferToBignumber(val)),4:v=>{return c.TEN.pow(v[0]).times(v[1])},5:v=>{return c.TWO.pow(v[0]).times(v[1])},32:val=>url.parse(val),35:val=>new RegExp(val)},opts.tags),this.parser=parser(global,{log:console.log.bind(console),pushInt:this.pushInt.bind(this),pushInt32:this.pushInt32.bind(this),pushInt32Neg:this.pushInt32Neg.bind(this),pushInt64:this.pushInt64.bind(this),pushInt64Neg:this.pushInt64Neg.bind(this),pushFloat:this.pushFloat.bind(this),pushFloatSingle:this.pushFloatSingle.bind(this),pushFloatDouble:this.pushFloatDouble.bind(this),pushTrue:this.pushTrue.bind(this),pushFalse:this.pushFalse.bind(this),pushUndefined:this.pushUndefined.bind(this),pushNull:this.pushNull.bind(this),pushInfinity:this.pushInfinity.bind(this),pushInfinityNeg:this.pushInfinityNeg.bind(this),pushNaN:this.pushNaN.bind(this),pushNaNNeg:this.pushNaNNeg.bind(this),pushArrayStart:this.pushArrayStart.bind(this),pushArrayStartFixed:this.pushArrayStartFixed.bind(this),pushArrayStartFixed32:this.pushArrayStartFixed32.bind(this),pushArrayStartFixed64:this.pushArrayStartFixed64.bind(this),pushObjectStart:this.pushObjectStart.bind(this),pushObjectStartFixed:this.pushObjectStartFixed.bind(this),pushObjectStartFixed32:this.pushObjectStartFixed32.bind(this),pushObjectStartFixed64:this.pushObjectStartFixed64.bind(this),pushByteString:this.pushByteString.bind(this),pushByteStringStart:this.pushByteStringStart.bind(this),pushUtf8String:this.pushUtf8String.bind(this),pushUtf8StringStart:this.pushUtf8StringStart.bind(this),pushSimpleUnassigned:this.pushSimpleUnassigned.bind(this),pushTagUnassigned:this.pushTagUnassigned.bind(this),pushTagStart:this.pushTagStart.bind(this),pushTagStart4:this.pushTagStart4.bind(this),pushTagStart8:this.pushTagStart8.bind(this),pushBreak:this.pushBreak.bind(this)},this._heap)}get _depth(){return this._parents.length}get _currentParent(){return this._parents[this._depth-1]}get _ref(){return this._currentParent.ref}_closeParent(){var p=this._parents.pop();if(p.length>0)throw new Error(`Missing ${p.length} elements`);switch(p.type){case c.PARENT.TAG:this._push(this.createTag(p.ref[0],p.ref[1]));break;case c.PARENT.BYTE_STRING:this._push(this.createByteString(p.ref,p.length));break;case c.PARENT.UTF8_STRING:this._push(this.createUtf8String(p.ref,p.length));break;case c.PARENT.MAP:if(p.values%2>0)throw new Error("Odd number of elements in the map");this._push(this.createMap(p.ref,p.length));break;case c.PARENT.OBJECT:if(p.values%2>0)throw new Error("Odd number of elements in the map");this._push(this.createObject(p.ref,p.length));break;case c.PARENT.ARRAY:this._push(this.createArray(p.ref,p.length))}this._currentParent&&this._currentParent.type===c.PARENT.TAG&&this._dec()}_dec(){const p=this._currentParent;p.length<0||0===--p.length&&this._closeParent()}_push(val,hasChildren){const p=this._currentParent;switch(p.values++,p.type){case c.PARENT.ARRAY:case c.PARENT.BYTE_STRING:case c.PARENT.UTF8_STRING:p.length>-1?this._ref[this._ref.length-p.length]=val:this._ref.push(val),this._dec();break;case c.PARENT.OBJECT:null!=p.tmpKey?(this._ref[p.tmpKey]=val,p.tmpKey=null,this._dec()):(p.tmpKey=val,"string"!=typeof p.tmpKey&&(p.type=c.PARENT.MAP,p.ref=utils.buildMap(p.ref)));break;case c.PARENT.MAP:null!=p.tmpKey?(this._ref.set(p.tmpKey,val),p.tmpKey=null,this._dec()):p.tmpKey=val;break;case c.PARENT.TAG:this._ref.push(val),hasChildren||this._dec();break;default:throw new Error("Unknown parent type")}}_createParent(obj,type,len){this._parents[this._depth]={type:type,length:len,ref:obj,values:0,tmpKey:null}}_reset(){this._res=[],this._parents=[{type:c.PARENT.ARRAY,length:-1,ref:this._res,values:0,tmpKey:null}]}createTag(tagNumber,value){const typ=this._knownTags[tagNumber];return typ?typ(value):new Tagged(tagNumber,value)}createMap(obj,len){return obj}createObject(obj,len){return obj}createArray(arr,len){return arr}createByteString(raw,len){return Buffer.concat(raw)}createByteStringFromHeap(start,end){return new Buffer(start===end?0:this._heap.slice(start,end))}createInt(val){return val}createInt32(f,g){return utils.buildInt32(f,g)}createInt64(f1,f2,g1,g2){return utils.buildInt64(f1,f2,g1,g2)}createFloat(val){return val}createFloatSingle(a,b,c,d){return ieee754.read([a,b,c,d],0,!1,23,4)}createFloatDouble(a,b,c,d,e,f,g,h){return ieee754.read([a,b,c,d,e,f,g,h],0,!1,52,8)}createInt32Neg(f,g){return-1-utils.buildInt32(f,g)}createInt64Neg(f1,f2,g1,g2){const f=utils.buildInt32(f1,f2),g=utils.buildInt32(g1,g2);return f>c.MAX_SAFE_HIGH?c.NEG_ONE.sub(new Bignumber(f).times(c.SHIFT32).plus(g)):-1-(f*c.SHIFT32+g)}createTrue(){return!0}createFalse(){return!1}createNull(){return null}createUndefined(){}createInfinity(){return 1/0}createInfinityNeg(){return-(1/0)}createNaN(){return NaN}createNaNNeg(){return NaN}createUtf8String(raw,len){return raw.join("")}createUtf8StringFromHeap(start,end){return start===end?"":new Buffer(this._heap.slice(start,end)).toString("utf8")}createSimpleUnassigned(val){return new Simple(val)}pushInt(val){this._push(this.createInt(val))}pushInt32(f,g){this._push(this.createInt32(f,g))}pushInt64(f1,f2,g1,g2){this._push(this.createInt64(f1,f2,g1,g2))}pushFloat(val){this._push(this.createFloat(val))}pushFloatSingle(a,b,c,d){this._push(this.createFloatSingle(a,b,c,d))}pushFloatDouble(a,b,c,d,e,f,g,h){this._push(this.createFloatDouble(a,b,c,d,e,f,g,h))}pushInt32Neg(f,g){this._push(this.createInt32Neg(f,g))}pushInt64Neg(f1,f2,g1,g2){this._push(this.createInt64Neg(f1,f2,g1,g2))}pushTrue(){this._push(this.createTrue())}pushFalse(){this._push(this.createFalse())}pushNull(){this._push(this.createNull())}pushUndefined(){this._push(this.createUndefined())}pushInfinity(){this._push(this.createInfinity())}pushInfinityNeg(){this._push(this.createInfinityNeg())}pushNaN(){this._push(this.createNaN())}pushNaNNeg(){this._push(this.createNaNNeg())}pushArrayStart(){this._createParent([],c.PARENT.ARRAY,-1)}pushArrayStartFixed(len){this._createArrayStartFixed(len)}pushArrayStartFixed32(len1,len2){const len=utils.buildInt32(len1,len2);this._createArrayStartFixed(len)}pushArrayStartFixed64(len1,len2,len3,len4){const len=utils.buildInt64(len1,len2,len3,len4);this._createArrayStartFixed(len)}pushObjectStart(){this._createObjectStartFixed(-1)}pushObjectStartFixed(len){this._createObjectStartFixed(len)}pushObjectStartFixed32(len1,len2){const len=utils.buildInt32(len1,len2);this._createObjectStartFixed(len)}pushObjectStartFixed64(len1,len2,len3,len4){const len=utils.buildInt64(len1,len2,len3,len4);this._createObjectStartFixed(len)}pushByteStringStart(){this._parents[this._depth]={type:c.PARENT.BYTE_STRING,length:-1,ref:[],values:0,tmpKey:null}}pushByteString(start,end){this._push(this.createByteStringFromHeap(start,end))}pushUtf8StringStart(){this._parents[this._depth]={type:c.PARENT.UTF8_STRING,length:-1,ref:[],values:0,tmpKey:null}}pushUtf8String(start,end){this._push(this.createUtf8StringFromHeap(start,end))}pushSimpleUnassigned(val){this._push(this.createSimpleUnassigned(val))}pushTagStart(tag){this._parents[this._depth]={type:c.PARENT.TAG,length:1,ref:[tag]}}pushTagStart4(f,g){this.pushTagStart(utils.buildInt32(f,g))}pushTagStart8(f1,f2,g1,g2){this.pushTagStart(utils.buildInt64(f1,f2,g1,g2))}pushTagUnassigned(tagNumber){ +this._push(this.createTag(tagNumber))}pushBreak(){if(this._currentParent.length>-1)throw new Error("Unexpected break");this._closeParent()}_createObjectStartFixed(len){if(0===len)return void this._push(this.createObject({}));this._createParent({},c.PARENT.OBJECT,len)}_createArrayStartFixed(len){if(0===len)return void this._push(this.createArray([]));this._createParent(new Array(len),c.PARENT.ARRAY,len)}_decode(input){if(0===input.byteLength)throw new Error("Input too short");this._reset(),this._heap8.set(input);const code=this.parser.parse(input.byteLength);if(this._depth>1){for(;0===this._currentParent.length;)this._closeParent();if(this._depth>1)throw new Error("Undeterminated nesting")}if(code>0)throw new Error("Failed to parse");if(0===this._res.length)throw new Error("No valid result")}decodeFirst(input){return this._decode(input),this._res[0]}decodeAll(input){return this._decode(input),this._res}static decode(input,enc){return"string"==typeof input&&(input=new Buffer(input,enc||"hex")),new Decoder({size:input.length}).decodeFirst(input)}static decodeAll(input,enc){return"string"==typeof input&&(input=new Buffer(input,enc||"hex")),new Decoder({size:input.length}).decodeAll(input)}}Decoder.decodeFirst=Decoder.decode,module.exports=Decoder}).call(exports,__webpack_require__(2),__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const constants=__webpack_require__(76),MT=constants.MT,SIMPLE=constants.SIMPLE,SYMS=constants.SYMS;class Simple{constructor(value){if("number"!=typeof value)throw new Error("Invalid Simple type: "+typeof value);if(value<0||value>255||(0|value)!==value)throw new Error("value must be a small positive integer: "+value);this.value=value}toString(){return"simple("+this.value+")"}inspect(){return"simple("+this.value+")"}encodeCBOR(gen){return gen._pushInt(this.value,MT.SIMPLE_FLOAT)}static isSimple(obj){return obj instanceof Simple}static decode(val,hasParent){switch(null==hasParent&&(hasParent=!0),val){case SIMPLE.FALSE:return!1;case SIMPLE.TRUE:return!0;case SIMPLE.NULL:return hasParent?null:SYMS.NULL;case SIMPLE.UNDEFINED:return hasParent?void 0:SYMS.UNDEFINED;case-1:if(!hasParent)throw new Error("Invalid BREAK");return SYMS.BREAK;default:return new Simple(val)}}}module.exports=Simple},function(module,exports,__webpack_require__){"use strict";class Tagged{constructor(tag,value,err){if(this.tag=tag,this.value=value,this.err=err,"number"!=typeof this.tag)throw new Error("Invalid tag type ("+typeof this.tag+")");if(this.tag<0||(0|this.tag)!==this.tag)throw new Error("Tag must be a positive integer: "+this.tag)}toString(){return`${this.tag}(${JSON.stringify(this.value)})`}encodeCBOR(gen){return gen._pushTag(this.tag),gen.pushAny(this.value)}convert(converters){var er,f;if("function"!=typeof(f=null!=converters?converters[this.tag]:void 0)&&"function"!=typeof(f=Tagged["_tag"+this.tag]))return this;try{return f.call(Tagged,this.value)}catch(error){return er=error,this.err=er,this}}}module.exports=Tagged},function(module,exports,__webpack_require__){(function(Buffer){function StreamCipher(mode,key,iv,decrypt){if(!(this instanceof StreamCipher))return new StreamCipher(mode,key,iv);Transform.call(this),this._finID=Buffer.concat([iv,new Buffer([0,0,0,1])]),iv=Buffer.concat([iv,new Buffer([0,0,0,2])]),this._cipher=new aes.AES(key),this._prev=new Buffer(iv.length),this._cache=new Buffer(""),this._secCache=new Buffer(""),this._decrypt=decrypt,this._alen=0,this._len=0,iv.copy(this._prev),this._mode=mode;var h=new Buffer(4);h.fill(0),this._ghash=new GHASH(this._cipher.encryptBlock(h)),this._authTag=null,this._called=!1}function xorTest(a,b){var out=0;a.length!==b.length&&out++;for(var len=Math.min(a.length,b.length),i=-1;++i>i%8,self._prev=shiftIn(self._prev,decrypt?bit:value);return out}function shiftIn(buffer,value){var len=buffer.length,i=-1,out=new Buffer(buffer.length);for(buffer=Buffer.concat([buffer,new Buffer([value])]);++i>7;return out}exports.encrypt=function(self,chunk,decrypt){for(var len=chunk.length,out=new Buffer(len),i=-1;++i{const key=new Key(path).child(new Key(SHARDING_FN));("function"==typeof store.getRaw?store.getRaw.bind(store):store.get.bind(store))(key,(err,res)=>{if(err)return callback(err);let shard;try{shard=parseShardFun((res||"").toString().trim())}catch(err){return callback(err)}callback(null,shard)})}),exports.readme=readme,exports.parseShardFun=parseShardFun,exports.Prefix=Prefix,exports.Suffix=Suffix,exports.NextToLast=NextToLast},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function isSpecificValue(val){return val instanceof Buffer||val instanceof Date||val instanceof RegExp}function cloneSpecificValue(val){if(val instanceof Buffer){var x=new Buffer(val.length);return val.copy(x),x}if(val instanceof Date)return new Date(val.getTime());if(val instanceof RegExp)return new RegExp(val);throw new Error("Unexpected situation")}function deepCloneArray(arr){var clone=[];return arr.forEach(function(item,index){"object"==typeof item&&null!==item?Array.isArray(item)?clone[index]=deepCloneArray(item):isSpecificValue(item)?clone[index]=cloneSpecificValue(item):clone[index]=deepExtend({},item):clone[index]=item}),clone}var deepExtend=module.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var val,src,target=arguments[0],args=Array.prototype.slice.call(arguments,1);return args.forEach(function(obj){"object"!=typeof obj||null===obj||Array.isArray(obj)||Object.keys(obj).forEach(function(key){return src=target[key],val=obj[key],val===target?void 0:"object"!=typeof val||null===val?void(target[key]=val):Array.isArray(val)?void(target[key]=deepCloneArray(val)):isSpecificValue(val)?void(target[key]=cloneSpecificValue(val)):"object"!=typeof src||null===src||Array.isArray(src)?void(target[key]=deepExtend({},val)):void(target[key]=deepExtend(src,val))})}),target}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(process){function AbstractChainedBatch(db){this._db=db,this._operations=[],this._written=!1}AbstractChainedBatch.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},AbstractChainedBatch.prototype.put=function(key,value){this._checkWritten();var err=this._db._checkKey(key,"key",this._db._isBuffer);if(err)throw err;return this._db._isBuffer(key)||(key=String(key)),this._db._isBuffer(value)||(value=String(value)),"function"==typeof this._put?this._put(key,value):this._operations.push({type:"put",key:key,value:value}),this},AbstractChainedBatch.prototype.del=function(key){this._checkWritten();var err=this._db._checkKey(key,"key",this._db._isBuffer);if(err)throw err;return this._db._isBuffer(key)||(key=String(key)),"function"==typeof this._del?this._del(key):this._operations.push({type:"del",key:key}),this},AbstractChainedBatch.prototype.clear=function(){return this._checkWritten(),this._operations=[],"function"==typeof this._clear&&this._clear(),this},AbstractChainedBatch.prototype.write=function(options,callback){if(this._checkWritten(),"function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("write() requires a callback argument");return"object"!=typeof options&&(options={}),this._written=!0,"function"==typeof this._write?this._write(callback):"function"==typeof this._db._batch?this._db._batch(this._operations,options,callback):void process.nextTick(callback)},module.exports=AbstractChainedBatch}).call(exports,__webpack_require__(5))},function(module,exports,__webpack_require__){(function(process){function AbstractIterator(db){this.db=db,this._ended=!1,this._nexting=!1}AbstractIterator.prototype.next=function(callback){var self=this;if("function"!=typeof callback)throw new Error("next() requires a callback argument");return self._ended?callback(new Error("cannot call next() after end()")):self._nexting?callback(new Error("cannot call next() before previous next() has completed")):(self._nexting=!0,"function"==typeof self._next?self._next(function(){self._nexting=!1,callback.apply(null,arguments)}):void process.nextTick(function(){self._nexting=!1,callback()}))},AbstractIterator.prototype.end=function(callback){if("function"!=typeof callback)throw new Error("end() requires a callback argument");return this._ended?callback(new Error("end() already called on iterator")):(this._ended=!0,"function"==typeof this._end?this._end(callback):void process.nextTick(callback))},module.exports=AbstractIterator}).call(exports,__webpack_require__(5))},function(module,exports,__webpack_require__){(function(process,Buffer){function AbstractLevelDOWN(location){if(!arguments.length||void 0===location)throw new Error("constructor requires at least a location argument");if("string"!=typeof location)throw new Error("constructor requires a location string argument");this.location=location,this.status="new"}var xtend=__webpack_require__(38),AbstractIterator=__webpack_require__(177),AbstractChainedBatch=__webpack_require__(176);AbstractLevelDOWN.prototype.open=function(options,callback){var self=this,oldStatus=this.status;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("open() requires a callback argument");"object"!=typeof options&&(options={}),options.createIfMissing=0!=options.createIfMissing,options.errorIfExists=!!options.errorIfExists,"function"==typeof this._open?(this.status="opening",this._open(options,function(err){if(err)return self.status=oldStatus,callback(err);self.status="open",callback()})):(this.status="open",process.nextTick(callback))},AbstractLevelDOWN.prototype.close=function(callback){var self=this,oldStatus=this.status;if("function"!=typeof callback)throw new Error("close() requires a callback argument");"function"==typeof this._close?(this.status="closing",this._close(function(err){if(err)return self.status=oldStatus,callback(err);self.status="closed",callback()})):(this.status="closed",process.nextTick(callback))},AbstractLevelDOWN.prototype.get=function(key,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("get() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),"object"!=typeof options&&(options={}),options.asBuffer=0!=options.asBuffer,"function"==typeof this._get?this._get(key,options,callback):void process.nextTick(function(){callback(new Error("NotFound"))}))},AbstractLevelDOWN.prototype.put=function(key,value,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("put() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),null==value||this._isBuffer(value)||process.browser||(value=String(value)),"object"!=typeof options&&(options={}),"function"==typeof this._put?this._put(key,value,options,callback):void process.nextTick(callback))},AbstractLevelDOWN.prototype.del=function(key,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("del() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),"object"!=typeof options&&(options={}),"function"==typeof this._del?this._del(key,options,callback):void process.nextTick(callback))},AbstractLevelDOWN.prototype.batch=function(array,options,callback){if(!arguments.length)return this._chainedBatch();if("function"==typeof options&&(callback=options),"function"==typeof array&&(callback=array),"function"!=typeof callback)throw new Error("batch(array) requires a callback argument");if(!Array.isArray(array))return callback(new Error("batch(array) requires an array argument"));options&&"object"==typeof options||(options={});for(var e,err,i=0,l=array.length;iparams.maximumExtraDataSize.v?cb("invalid amount of extra data"):void cb():cb("invalid gas limit"):cb("invalid Difficulty")})},BlockHeader.prototype.hash=function(){return utils.rlphash(this.raw)},BlockHeader.prototype.isGenesis=function(){return""===this.number.toString("hex")},BlockHeader.prototype.isHomestead=function(){return utils.bufferToInt(this.number)>=params.homeSteadForkNumber.v},BlockHeader.prototype.isHomesteadReprice=function(){return utils.bufferToInt(this.number)>=params.homesteadRepriceForkNumber.v}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){const SHA3=__webpack_require__(460),secp256k1=__webpack_require__(144),assert=__webpack_require__(9),rlp=__webpack_require__(45),BN=__webpack_require__(14),createHash=__webpack_require__(59);exports.MAX_INTEGER=new BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),exports.TWO_POW256=new BN("10000000000000000000000000000000000000000000000000000000000000000",16),exports.SHA3_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",exports.SHA3_NULL=new Buffer(exports.SHA3_NULL_S,"hex"),exports.SHA3_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",exports.SHA3_RLP_ARRAY=new Buffer(exports.SHA3_RLP_ARRAY_S,"hex"),exports.SHA3_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",exports.SHA3_RLP=new Buffer(exports.SHA3_RLP_S,"hex"),exports.BN=BN,exports.rlp=rlp,exports.secp256k1=secp256k1,exports.zeros=function(bytes){var buf=new Buffer(bytes);return buf.fill(0),buf},exports.setLengthLeft=exports.setLength=function(msg,length,right){var buf=exports.zeros(length);return msg=exports.toBuffer(msg),right?msg.length0&&"0"===first.toString();)a=a.slice(1),first=a[0];return a},exports.toBuffer=function(v){if(!Buffer.isBuffer(v))if(Array.isArray(v))v=new Buffer(v);else if("string"==typeof v)v=exports.isHexPrefixed(v)?new Buffer(exports.padToEven(exports.stripHexPrefix(v)),"hex"):new Buffer(v);else if("number"==typeof v)v=exports.intToBuffer(v);else if(null===v||void 0===v)v=new Buffer([]);else{if(!v.toArray)throw new Error("invalid type");v=new Buffer(v.toArray())}return v},exports.intToHex=function(i){assert(i%1==0,"number is not a integer"),assert(i>=0,"number must be positive");var hex=i.toString(16);return hex.length%2&&(hex="0"+hex),"0x"+hex},exports.intToBuffer=function(i){return new Buffer(exports.intToHex(i).slice(2),"hex")},exports.bufferToInt=function(buf){return parseInt(exports.bufferToHex(buf),16)},exports.bufferToHex=function(buf){return buf=exports.toBuffer(buf),0===buf.length?0:"0x"+buf.toString("hex")},exports.fromSigned=function(num){return new BN(num).fromTwos(256)},exports.toUnsigned=function(num){return new Buffer(num.toTwos(256).toArray())},exports.sha3=function(a,bytes){a=exports.toBuffer(a),bytes||(bytes=256);var h=new SHA3(bytes);return a&&h.update(a),new Buffer(h.digest("hex"),"hex")},exports.sha256=function(a){return a=exports.toBuffer(a),createHash("sha256").update(a).digest()},exports.ripemd160=function(a,padded){a=exports.toBuffer(a);var hash=createHash("rmd160").update(a).digest();return padded===!0?exports.setLength(hash,32):hash},exports.rlphash=function(a){return exports.sha3(rlp.encode(a))},exports.isValidPrivate=function(privateKey){return secp256k1.privateKeyVerify(privateKey)},exports.isValidPublic=function(publicKey,sanitize){return 64===publicKey.length?secp256k1.publicKeyVerify(Buffer.concat([new Buffer([4]),publicKey])):!!sanitize&&secp256k1.publicKeyVerify(publicKey)},exports.pubToAddress=exports.publicToAddress=function(pubKey,sanitize){return pubKey=exports.toBuffer(pubKey),sanitize&&64!==pubKey.length&&(pubKey=secp256k1.publicKeyConvert(pubKey,!1).slice(1)), +assert(64===pubKey.length),exports.sha3(pubKey).slice(-20)};var privateToPublic=exports.privateToPublic=function(privateKey){return privateKey=exports.toBuffer(privateKey),secp256k1.publicKeyCreate(privateKey,!1).slice(1)};exports.importPublic=function(publicKey){return publicKey=exports.toBuffer(publicKey),64!==publicKey.length&&(publicKey=secp256k1.publicKeyConvert(publicKey,!1).slice(1)),publicKey},exports.ecsign=function(msgHash,privateKey){var sig=secp256k1.sign(msgHash,privateKey),ret={};return ret.r=sig.signature.slice(0,32),ret.s=sig.signature.slice(32,64),ret.v=sig.recovery+27,ret},exports.ecrecover=function(msgHash,v,r,s){var signature=Buffer.concat([exports.setLength(r,32),exports.setLength(s,32)],64),recovery=exports.bufferToInt(v)-27;if(0!==recovery&&1!==recovery)throw new Error("Invalid signature v value");var senderPubKey=secp256k1.recover(msgHash,signature,recovery);return secp256k1.publicKeyConvert(senderPubKey,!1).slice(1)},exports.toRpcSig=function(v,r,s){return exports.bufferToHex(Buffer.concat([r,s,exports.toBuffer(v-27)]))},exports.fromRpcSig=function(sig){sig=exports.toBuffer(sig);var v=sig[64];return v<27&&(v+=27),{v:v,r:sig.slice(0,32),s:sig.slice(32,64)}},exports.privateToAddress=function(privateKey){return exports.publicToAddress(privateToPublic(privateKey))},exports.isValidAddress=function(address){return/^0x[0-9a-fA-F]{40}$/i.test(address)},exports.toChecksumAddress=function(address){address=exports.stripHexPrefix(address).toLowerCase();for(var hash=exports.sha3(address).toString("hex"),ret="0x",i=0;i=8?address[i].toUpperCase():address[i];return ret},exports.isValidChecksumAddress=function(address){return exports.isValidAddress(address)&&exports.toChecksumAddress(address)===address},exports.generateAddress=function(from,nonce){return from=exports.toBuffer(from),nonce=new BN(nonce),nonce=nonce.isZero()?null:new Buffer(nonce.toArray()),exports.rlphash([from,nonce]).slice(-20)},exports.isPrecompiled=function(address){var a=exports.unpad(address);return 1===a.length&&a[0]>0&&a[0]<5},exports.isHexPrefixed=function(str){return"0x"===str.slice(0,2)},exports.stripHexPrefix=function(str){return"string"!=typeof str?str:exports.isHexPrefixed(str)?str.slice(2):str},exports.addHexPrefix=function(str){return"string"!=typeof str?str:exports.isHexPrefixed(str)?str:"0x"+str},exports.padToEven=function(a){return a.length%2&&(a="0"+a),a},exports.baToJSON=function(ba){if(Buffer.isBuffer(ba))return"0x"+ba.toString("hex");if(ba instanceof Array){for(var array=[],i=0;i=v.length,"The field "+field.name+" must not have more "+field.length+" bytes")):field.allowZero&&0===v.length||!field.length||assert(field.length===v.length,"The field "+field.name+" must have byte length of "+field.length),self.raw[i]=v}self._fields.push(field.name),Object.defineProperty(self,field.name,{enumerable:!0,configurable:!0,get:getter,set:setter}),field.default&&(self[field.name]=field.default),field.alias&&Object.defineProperty(self,field.alias,{enumerable:!1,configurable:!0,set:setter,get:getter})}),data)if("string"==typeof data&&(data=new Buffer(exports.stripHexPrefix(data),"hex")),Buffer.isBuffer(data)&&(data=rlp.decode(data)),Array.isArray(data)){if(data.length>self._fields.length)throw new Error("wrong number of fields in data");data.forEach(function(d,i){self[self._fields[i]]=exports.toBuffer(d)})}else{if("object"!=typeof data)throw new Error("invalid data");for(var prop in data)self._fields.indexOf(prop)!==-1&&(self[prop]=data[prop])}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function padToEven(value){var a=value;if("string"!=typeof a)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof a+", while padToEven.");return a.length%2&&(a="0"+a),a}function intToHex(i){return"0x"+padToEven(i.toString(16))}function intToBuffer(i){return new Buffer(intToHex(i).slice(2),"hex")}function getBinarySize(str){if("string"!=typeof str)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof str+"'.");return Buffer.byteLength(str,"utf8")}function arrayContainsArray(superset,subset,some){if(Array.isArray(superset)!==!0)throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof superset+"'");if(Array.isArray(subset)!==!0)throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof subset+"'");return subset[Boolean(some)&&"some"||"every"](function(value){return superset.indexOf(value)>=0})}function toUtf8(hex){return new Buffer(padToEven(stripHexPrefix(hex).replace(/^0+|0+$/g,"")),"hex").toString("utf8")}function toAscii(hex){var str="",i=0,l=hex.length;for("0x"===hex.substring(0,2)&&(i=2);i0&&bufs.push(md_buf),bufs.push(password),salt&&bufs.push(salt),md_buf=md5(Buffer.concat(bufs)),bufs=[],i=0,keyLen>0)for(;;){if(0===keyLen)break;if(i===md_buf.length)break;key[ki++]=md_buf[i],keyLen--,i++}if(ivLen>0&&i!==md_buf.length)for(;;){if(0===ivLen)break;if(i===md_buf.length)break;iv[ii++]=md_buf[i],ivLen--,i++}if(0===keyLen&&0===ivLen)break}for(i=0;i>>3}function g1_256(x){return rotr32(x,17)^rotr32(x,19)^x>>>10}var utils=__webpack_require__(27),rotr32=utils.rotr32;exports.ft_1=ft_1,exports.ch32=ch32,exports.maj32=maj32,exports.p32=p32,exports.s0_256=s0_256,exports.s1_256=s1_256,exports.g0_256=g0_256,exports.g1_256=g1_256},function(module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=8*nBytes-mLen-1,eMax=(1<>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];for(i+=d,e=s&(1<<-nBits)-1,s>>=-nBits,nBits+=eLen;nBits>0;e=256*e+buffer[offset+i],i+=d,nBits-=8);for(m=e&(1<<-nBits)-1,e>>=-nBits,nBits+=mLen;nBits>0;m=256*m+buffer[offset+i],i+=d,nBits-=8);if(0===e)e=1-eBias;else{if(e===eMax)return m?NaN:1/0*(s?-1:1);m+=Math.pow(2,mLen),e-=eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)},exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c,eLen=8*nBytes-mLen-1,eMax=(1<>1,rt=23===mLen?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||0===value&&1/value<0?1:0;for(value=Math.abs(value),isNaN(value)||value===1/0?(m=isNaN(value)?1:0,e=eMax):(e=Math.floor(Math.log(value)/Math.LN2),value*(c=Math.pow(2,-e))<1&&(e--,c*=2),value+=e+eBias>=1?rt/c:rt*Math.pow(2,1-eBias),value*c>=2&&(e++,c/=2),e+eBias>=eMax?(m=0,e=eMax):e+eBias>=1?(m=(value*c-1)*Math.pow(2,mLen),e+=eBias):(m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen),e=0));mLen>=8;buffer[offset+i]=255&m,i+=d,m/=256,mLen-=8);for(e=e<0;buffer[offset+i]=255&e,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=128*s}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function namespaceType(ns){const parts=ns.split(":");return parts.length<2?"":parts.slice(0,-1).join(":")}function namespaceValue(ns){const parts=ns.split(":");return parts[parts.length-1]}const path=__webpack_require__(43),uuid=__webpack_require__(273),pathSepS=path.sep,pathSep=new Buffer(pathSepS,"utf8")[0];class Key{constructor(s,clean){if("string"==typeof s?this._buf=new Buffer(s):Buffer.isBuffer(s)&&(this._buf=s),null==clean&&(clean=!0),clean&&this.clean(),0===this._buf.length||this._buf[0]!==pathSep)throw new Error(`Invalid key: ${this.toString()}`)}toString(encoding){return this._buf.toString(encoding||"utf8")}toBuffer(){return this._buf}get[Symbol.toStringTag](){return`[Key ${this.toString()}]`}static withNamespaces(list){return new Key(list.join(pathSepS))}static random(){return new Key(uuid().replace(/-/g,""))}clean(){this._buf&&0!==this._buf.length||(this._buf=new Buffer(pathSepS,"utf8")),this._buf=new Buffer(path.normalize(this.toString())),this._buf[0]!==pathSep&&(this._buf=Buffer.concat([new Buffer(pathSepS,"utf8"),this._buf])),this.toString().length>1&&this._buf[this._buf.length-1]===pathSep&&(this._buf=this._buf.slice(0,-1))}less(key){const list1=this.list(),list2=key.list();for(let i=0;ic2)return!1}return list1.length{cb(err&&!cond(err)?err:null)}}function ignoringAlreadyOpened(cb){return ignoringIf(err=>"Already open"===err.message,cb)}function ignoringNotFound(cb){return ignoringIf(err=>err.message.startsWith("ENOENT"),cb)}function buildOptions(_options){const options=Object.assign({},defaultOptions,_options);return options.storageBackends=Object.assign({},defaultOptions.storageBackends,options.storageBackends),options.storageBackendOptions=Object.assign({},defaultOptions.storageBackendOptions,options.storageBackendOptions),options}const waterfall=__webpack_require__(7),series=__webpack_require__(33),parallel=__webpack_require__(39),each=__webpack_require__(19),assert=__webpack_require__(9),path=__webpack_require__(43),debug=__webpack_require__(3),backends=__webpack_require__(399),version=__webpack_require__(403),config=__webpack_require__(401),apiAddr=__webpack_require__(398),blockstore=__webpack_require__(400),defaultOptions=__webpack_require__(402),log=debug("repo"),lockers={memory:__webpack_require__(194),fs:__webpack_require__(194)};class IpfsRepo{constructor(repoPath,options){assert.equal(typeof repoPath,"string","missing repoPath"),this.options=buildOptions(options),this.closed=!0,this.path=repoPath,this._locker=lockers[this.options.lock],assert(this._locker,"Unknown lock type: "+this.options.lock),this.root=backends.create("root",this.path,this.options),this.version=version(this.root),this.config=config(this.root),this.apiAddr=apiAddr(this.root)}init(config,callback){log("initializing at: %s",this.path),series([cb=>this.root.open(ignoringAlreadyOpened(cb)),cb=>this.config.set(config,cb),cb=>this.version.set(5,cb)],callback)}open(callback){if(!this.closed)return void setImmediate(()=>callback(new Error("repo is already open")));log("opening at: %s",this.path),waterfall([cb=>this.root.open(ignoringAlreadyOpened(cb)),cb=>this._isInitialized(cb),cb=>this._locker.lock(this.path,cb),(lck,cb)=>{log("aquired repo.lock"),this.lockfile=lck,cb()},cb=>{log("creating datastore"),this.datastore=backends.create("datastore",path.join(this.path,"datastore"),this.options),log("creating blocks"),blockstore(backends.create("blocks",path.join(this.path,"blocks"),this.options),this.options.storageBackendOptions.blocks,cb)},(blocks,cb)=>{this.blocks=blocks,cb()},cb=>{this.closed=!1,log("all opened"),cb()}],err=>{err&&this.lockfile?this.lockfile.close(err2=>{err2?log("error removing lock",err2):this.lockfile=null,callback(err)}):callback(err)})}_isInitialized(callback){log("init check"),parallel({config:cb=>this.config.exists(cb),version:cb=>this.version.check(5,cb)},(err,res)=>{return log("init",err,res),err?callback(err):res.config?void callback():callback(new Error("repo is not initialized yet"))})}close(callback){if(this.closed)return callback(new Error("repo is already closed"));log("closing at: %s",this.path),series([cb=>this.apiAddr.delete(ignoringNotFound(cb)),cb=>{each([this.blocks,this.datastore],(store,callback)=>store.close(callback),cb)},cb=>{log("unlocking"),this.closed=!0,this.lockfile.close(cb)},cb=>{this.lockfile=null,cb()}],err=>callback(err))}exists(callback){this.version.exists(callback)}}module.exports=IpfsRepo}).call(exports,__webpack_require__(37).setImmediate)},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),setImmediate=__webpack_require__(10),log=debug("repo:lock"),LOCKS={};exports.lock=((dir,callback)=>{const file=dir+"/repo.lock";log("locking %s",file),LOCKS[file]=!0;const closer={close(cb){LOCKS[file]&&delete LOCKS[file],setImmediate(cb)}};setImmediate(()=>{callback(null,closer)})}),exports.locked=((dir,callback)=>{const file=dir+"/repo.lock";log("checking lock: %s");const locked=LOCKS[file];setImmediate(()=>{callback(null,locked)})})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function flattenObject(obj,delimiter){return delimiter=delimiter||"/",0===Object.keys(obj).length?[]:traverse(obj).reduce(function(acc,x){"object"==typeof x&&x["/"]&&this.update(void 0);const path=this.path.join(delimiter);return""!==path&&acc.push({path:path,value:x}),acc},[])}const util=__webpack_require__(196),traverse=__webpack_require__(669);exports=module.exports,exports.multicodec="dag-cbor",exports.resolve=((block,path,callback)=>{"function"==typeof path&&(callback=path,path=void 0),util.deserialize(block.data,(err,node)=>{if(err)return callback(err);if(!path||"/"===path)return callback(null,{value:node,remainderPath:""});const parts=path.split("/"),val=traverse(node).get(parts);if(val)return callback(null,{value:val,remainderPath:""});let value,len=parts.length;for(let i=0;i{"function"==typeof options&&(callback=options,options=void 0),options=options||{},util.deserialize(block.data,(err,node)=>{if(err)return callback(err);callback(null,flattenObject(node).map(el=>el.path))})}),exports.isLink=((block,path,callback)=>{exports.resolve(block,path,(err,result)=>{return err?callback(err):result.remainderPath.length>0?callback(new Error("path out of scope")):void("object"==typeof result.value&&result.value["/"]?callback(null,result.value):callback(null,!1))})})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function tagCID(cid){return"string"==typeof cid&&(cid=new CID(cid).buffer),new cbor.Tagged(CID_CBOR_TAG,Buffer.concat([new Buffer("00","hex"),cid]))}function replaceCIDbyTAG(dagNode){function transform(obj){if(!obj||Buffer.isBuffer(obj)||"string"==typeof obj)return obj;if(Array.isArray(obj))return obj.map(transform);const keys=Object.keys(obj);if(1===keys.length&&"/"===keys[0])return tagCID(obj["/"]);if(keys.length>0){let out={};return keys.forEach(key=>{"object"==typeof obj[key]?out[key]=transform(obj[key]):out[key]=obj[key]}),out}return obj}let circular;try{circular=isCircular(dagNode)}catch(e){circular=!1}if(circular)throw new Error("The object passed has circular references");return transform(dagNode)}const cbor=__webpack_require__(314),multihashing=__webpack_require__(21),CID=__webpack_require__(8),waterfall=__webpack_require__(7),setImmediate=__webpack_require__(10),isCircular=__webpack_require__(448),resolver=__webpack_require__(195),CID_CBOR_TAG=42,decoder=new cbor.Decoder({tags:{[CID_CBOR_TAG]:val=>{return val=val.slice(1),{"/":val}}}});exports=module.exports,exports.serialize=((dagNode,callback)=>{let serialized;try{const dagNodeTagged=replaceCIDbyTAG(dagNode);serialized=cbor.encode(dagNodeTagged)}catch(err){return setImmediate(()=>callback(err))}setImmediate(()=>callback(null,serialized))}),exports.deserialize=((data,callback)=>{let deserialized;try{deserialized=decoder.decodeFirst(data)}catch(err){return setImmediate(()=>callback(err))}setImmediate(()=>callback(null,deserialized))}),exports.cid=((dagNode,callback)=>{waterfall([cb=>exports.serialize(dagNode,cb),(serialized,cb)=>multihashing(serialized,"sha2-256",cb),(mh,cb)=>cb(null,new CID(1,resolver.multicodec,mh))],callback)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function mapFromEthObj(account,options,callback){const paths=[];paths.push({path:"storage",value:{"/":cidFromHash("eth-storage-trie",account.stateRoot).toBaseEncodedString()}}),paths.push({path:"code",value:{"/":cidFromHash("raw",account.codeHash).toBaseEncodedString()}}),paths.push({path:"stateRoot",value:account.stateRoot}),paths.push({path:"codeHash",value:account.codeHash}),paths.push({path:"nonce",value:account.nonce}),paths.push({path:"balance",value:account.balance}),paths.push({path:"isEmpty",value:account.isEmpty()}),paths.push({path:"isContract",value:account.isContract()}),callback(null,paths)}const EthAccount=__webpack_require__(365),createResolver=__webpack_require__(62),cidFromHash=__webpack_require__(53);module.exports=createResolver("eth-account-snapshot",EthAccount,mapFromEthObj)},function(module,exports,__webpack_require__){"use strict";function mapFromEthObj(ethObj,options,callback){const paths=[];paths.push({path:"parent",value:{"/":cidFromHash("eth-block",ethObj.parentHash).toBaseEncodedString()}}),paths.push({path:"ommers",value:{"/":cidFromHash("eth-block-list",ethObj.uncleHash).toBaseEncodedString()}}),paths.push({path:"transactions",value:{"/":cidFromHash("eth-tx-trie",ethObj.transactionsTrie).toBaseEncodedString()}}),paths.push({path:"transactionReceipts",value:{"/":cidFromHash("eth-tx-receipt-trie",ethObj.receiptTrie).toBaseEncodedString()}}),paths.push({path:"state",value:{"/":cidFromHash("eth-state-trie",ethObj.stateRoot).toBaseEncodedString()}}),paths.push({path:"parentHash",value:ethObj.parentHash}),paths.push({path:"ommerHash",value:ethObj.uncleHash}),paths.push({path:"transactionTrieRoot",value:ethObj.transactionsTrie}),paths.push({path:"transactionReceiptTrieRoot",value:ethObj.receiptTrie}),paths.push({path:"stateRoot",value:ethObj.stateRoot}),paths.push({path:"authorAddress",value:ethObj.coinbase}),paths.push({path:"bloom",value:ethObj.bloom}),paths.push({path:"difficulty",value:ethObj.difficulty}),paths.push({path:"number", +value:ethObj.number}),paths.push({path:"gasLimit",value:ethObj.gasLimit}),paths.push({path:"gasUsed",value:ethObj.gasUsed}),paths.push({path:"timestamp",value:ethObj.timestamp}),paths.push({path:"extraData",value:ethObj.extraData}),paths.push({path:"mixHash",value:ethObj.mixHash}),paths.push({path:"nonce",value:ethObj.nonce}),callback(null,paths)}const EthBlockHeader=__webpack_require__(182),createResolver=__webpack_require__(62),cidFromHash=__webpack_require__(53);module.exports=createResolver("eth-block",EthBlockHeader,mapFromEthObj)},function(module,exports,__webpack_require__){"use strict";function mapFromEthObj(tx,options,callback){const paths=[];paths.push({path:"nonce",value:tx.nonce}),paths.push({path:"gasPrice",value:tx.gasPrice}),paths.push({path:"gasLimit",value:tx.gasLimit}),paths.push({path:"toAddress",value:tx.to}),paths.push({path:"value",value:tx.value}),paths.push({path:"data",value:tx.data}),paths.push({path:"v",value:tx.v}),paths.push({path:"r",value:tx.r}),paths.push({path:"s",value:tx.s}),paths.push({path:"fromAddress",value:tx.from}),paths.push({path:"signature",value:[tx.v,tx.r,tx.s]}),paths.push({path:"isContractPublish",value:tx.toCreationAddress()}),callback(null,paths)}const EthTx=__webpack_require__(367),createResolver=__webpack_require__(62);__webpack_require__(53);module.exports=createResolver("eth-tx",EthTx,mapFromEthObj)},function(module,exports,__webpack_require__){"use strict";function cidFromEthObj(multicodec,ethObj){return cidFromHash(multicodec,ethObj.hash())}const cidFromHash=__webpack_require__(53);module.exports=cidFromEthObj},function(module,exports){function createIsLink(resolve){return function(block,path,callback){resolve(block,path,(err,result)=>{return err?callback(err):result.remainderPath.length>0?callback(new Error("path out of scope")):void("object"==typeof result.value&&result.value["/"]?callback(null,result.value):callback(null,!1))})}}module.exports=createIsLink},function(module,exports,__webpack_require__){function createUtil(multicodec,EthObjClass){return{deserialize:asyncify(serialized=>new EthObjClass(serialized)),serialize:asyncify(ethObj=>ethObj.serialize()),cid:asyncify(ethObj=>cidFromEthObj(multicodec,ethObj))}}const cidFromEthObj=__webpack_require__(200),asyncify=__webpack_require__(70);module.exports=createUtil},function(module,exports){module.exports=function(str){if("string"!=typeof str)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof str+", while checking isHexPrefixed.");return"0x"===str.slice(0,2)}},function(module,exports){function isPromise(obj){return obj&&"function"==typeof obj.then}module.exports=isPromise},function(module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return"[object Array]"==toString.call(arr)}},function(module,exports){module.exports={genesisGasLimit:{v:5e3,d:"Gas limit of the Genesis block."},genesisDifficulty:{v:17179869184,d:"Difficulty of the Genesis block."},genesisNonce:{v:"0x0000000000000042",d:"the geneis nonce"},genesisExtraData:{v:"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa",d:"extra data "},genesisHash:{v:"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3",d:"genesis hash"},genesisStateRoot:{v:"0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544",d:"the genesis state root"},minGasLimit:{v:5e3,d:"Minimum the gas limit may ever be."},gasLimitBoundDivisor:{v:1024,d:"The bound divisor of the gas limit, used in update calculations."},minimumDifficulty:{v:131072,d:"The minimum that the difficulty may ever be."},difficultyBoundDivisor:{v:2048,d:"The bound divisor of the difficulty, used in the update calculations."},durationLimit:{v:13,d:"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not."},maximumExtraDataSize:{v:32,d:"Maximum size extra data may be after Genesis."},epochDuration:{v:3e4,d:"Duration between proof-of-work epochs."},stackLimit:{v:1024,d:"Maximum size of VM stack allowed."},callCreateDepth:{v:1024,d:"Maximum depth of call/create stack."},tierStepGas:{v:[0,2,3,5,8,10,20],d:"Once per operation, for a selection of them."},expGas:{v:10,d:"Once per EXP instuction."},expByteGas:{v:10,d:"Times ceil(log256(exponent)) for the EXP instruction."},sha3Gas:{v:30,d:"Once per SHA3 operation."},sha3WordGas:{v:6,d:"Once per word of the SHA3 operation's data."},sloadGas:{v:50,d:"Once per SLOAD operation."},sstoreSetGas:{v:2e4,d:"Once per SSTORE operation if the zeroness changes from zero."},sstoreResetGas:{v:5e3,d:"Once per SSTORE operation if the zeroness does not change from zero."},sstoreRefundGas:{v:15e3,d:"Once per SSTORE operation if the zeroness changes to zero."},jumpdestGas:{v:1,d:"Refunded gas, once per SSTORE operation if the zeroness changes to zero."},logGas:{v:375,d:"Per LOG* operation."},logDataGas:{v:8,d:"Per byte in a LOG* operation's data."},logTopicGas:{v:375,d:"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas."},createGas:{v:32e3,d:"Once per CREATE operation & contract-creation transaction."},callGas:{v:40,d:"Once per CALL operation & message call transaction."},callStipend:{v:2300,d:"Free gas given at beginning of call."},callValueTransferGas:{v:9e3,d:"Paid for CALL when the value transfor is non-zero."},callNewAccountGas:{v:25e3,d:"Paid for CALL when the destination address didn't exist prior."},suicideRefundGas:{v:24e3,d:"Refunded following a suicide operation."},memoryGas:{v:3,d:"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL."},quadCoeffDiv:{v:512,d:"Divisor for the quadratic particle of the memory cost equation."},createDataGas:{v:200,d:""},txGas:{v:21e3,d:"Per transaction. NOTE: Not payable on data of calls between transactions."},txCreation:{v:32e3,d:"the cost of creating a contract via tx"},txDataZeroGas:{v:4,d:"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions."},txDataNonZeroGas:{v:68,d:"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions."},copyGas:{v:3,d:"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added."},ecrecoverGas:{v:3e3,d:""},sha256Gas:{v:60,d:""},sha256WordGas:{v:12,d:""},ripemd160Gas:{v:600,d:""},ripemd160WordGas:{v:120,d:""},identityGas:{v:15,d:""},identityWordGas:{v:3,d:""},minerReward:{v:"5000000000000000000",d:"the amount a miner get rewarded for mining a block"},ommerReward:{v:"625000000000000000",d:"The amount of wei a miner of an uncle block gets for being inculded in the blockchain"},niblingReward:{v:"156250000000000000",d:"the amount a miner gets for inculding a uncle"},homeSteadForkNumber:{v:115e4,d:"the block that the Homestead fork started at"},homesteadRepriceForkNumber:{v:2463e3,d:"the block that the Homestead Reprice (EIP150) fork started at"},timebombPeriod:{v:1e5,d:"Exponential difficulty timebomb period"},freeBlockPeriod:{v:2}}},function(module,exports){module.exports={Addresses:{Swarm:["/libp2p-webrtc-star/dns4/star-signal.cloud.ipfs.team/wss"],API:"",Gateway:""},Discovery:{MDNS:{Enabled:!1,Interval:10},webRTCStar:{Enabled:!0}},Bootstrap:["/dns4/ams-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd","/dns4/sfo-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx","/dns4/lon-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3","/dns4/sfo-2.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z","/dns4/sfo-3.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM","/dns4/sgp-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu","/dns4/nyc-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm","/dns4/nyc-2.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64"]}},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(455)(__webpack_require__(459))},function(module,exports,__webpack_require__){"use strict";function leftPad(str,len,ch){if(str+="",(len-=str.length)<=0)return str;if(ch||0===ch||(ch=" ")," "===(ch+="")&&len<10)return cache[len]+str;for(var pad="";;){if(1&len&&(pad+=ch),!(len>>=1))break;ch+=ch}return pad+str}module.exports=leftPad;var cache=[""," "," "," "," "," "," "," "," "," "]},function(module,exports,__webpack_require__){(function(process){function ReadableState(options,stream){var Duplex=__webpack_require__(54);options=options||{};var hwm=options.highWaterMark,defaultHwm=options.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:defaultHwm,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!options.objectMode,stream instanceof Duplex&&(this.objectMode=this.objectMode||!!options.readableObjectMode),this.defaultEncoding=options.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(StringDecoder||(StringDecoder=__webpack_require__(66).StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding)}function Readable(options){__webpack_require__(54);if(!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this),this.readable=!0,Stream.call(this)}function readableAddChunk(stream,state,chunk,encoding,addToFront){var er=chunkInvalid(state,chunk);if(er)stream.emit("error",er);else if(util.isNullOrUndefined(chunk))state.reading=!1,state.ended||onEofChunk(stream,state);else if(state.objectMode||chunk&&chunk.length>0)if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var e=new Error("stream.unshift() after end event");stream.emit("error",e)}else!state.decoder||addToFront||encoding||(chunk=state.decoder.write(chunk)),addToFront||(state.reading=!1),state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream)),maybeReadMore(stream,state);else addToFront||(state.reading=!1);return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM)n=MAX_HWM;else{n--;for(var p=1;p<32;p<<=1)n|=n>>p;n++}return n}function howMuchToRead(n,state){return 0===state.length&&state.ended?0:state.objectMode?0===n?0:1:isNaN(n)||util.isNull(n)?state.flowing&&state.buffer.length?state.buffer[0].length:state.length:n<=0?0:(n>state.highWaterMark&&(state.highWaterMark=roundUpToNextPowerOf2(n)),n>state.length?state.ended?state.length:(state.needReadable=!0,0):n)}function chunkInvalid(state,chunk){var er=null;return util.isBuffer(chunk)||util.isString(chunk)||util.isNullOrUndefined(chunk)||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function onEofChunk(stream,state){if(state.decoder&&!state.ended){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?process.nextTick(function(){emitReadable_(stream)}):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,process.nextTick(function(){maybeReadMore_(stream,state)}))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=length)ret=stringMode?list.join(""):Buffer.concat(list,length),list.length=0;else if(n0)throw new Error("endReadable called on non-empty stream");state.endEmitted||(state.ended=!0,process.nextTick(function(){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}))}function forEach(xs,f){for(var i=0,l=xs.length;i0)&&(state.emittedReadable=!1),0===n&&state.needReadable&&(state.length>=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n0?fromList(n,state):null,util.isNull(ret)&&(state.needReadable=!0,n=0),state.length-=n,0!==state.length||state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&0===state.length&&endReadable(this),util.isNull(ret)||this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable){debug("onunpipe"),readable===src&&cleanup()}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",cleanup),src.removeListener("data",ondata),!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain()}function ondata(chunk){debug("ondata"),!1===dest.write(chunk)&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EE.listenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:cleanup;state.endEmitted?process.nextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);return dest.on("drain",ondrain),src.on("data",ondata),dest._events&&dest._events.error?isArray(dest._events.error)?dest._events.error.unshift(onerror):dest._events.error=[onerror,dest._events.error]:dest.on("error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState;if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i1){for(var cbs=[],c=0;c{return{digest(data,cb){nodeify(crypto.subtle.sign({name:"HMAC"},key,data).then(raw=>Buffer.from(raw)),cb)},length:lengths[hashType]}}),callback)}},function(module,exports,__webpack_require__){"use strict";function exportKey(pair){return Promise.all([webcrypto.subtle.exportKey("jwk",pair.privateKey),webcrypto.subtle.exportKey("jwk",pair.publicKey)])}function derivePublicFromPrivate(jwKey){return webcrypto.subtle.importKey("jwk",{kty:jwKey.kty,n:jwKey.n,e:jwKey.e,alg:jwKey.alg,kid:jwKey.kid},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"])}const nodeify=__webpack_require__(92),Buffer=__webpack_require__(6).Buffer,webcrypto=__webpack_require__(124)();exports.utils=__webpack_require__(483),exports.generateKey=function(bits,callback){nodeify(webcrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:bits,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(exportKey).then(keys=>({privateKey:keys[0],publicKey:keys[1]})),callback)},exports.unmarshalPrivateKey=function(key,callback){const privateKey=webcrypto.subtle.importKey("jwk",key,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]);nodeify(Promise.all([privateKey,derivePublicFromPrivate(key)]).then(keys=>exportKey({privateKey:keys[0],publicKey:keys[1]})).then(keys=>({privateKey:keys[0],publicKey:keys[1]})),callback)},exports.getRandomValues=function(arr){return Buffer.from(webcrypto.getRandomValues(arr))},exports.hashAndSign=function(key,msg,callback){nodeify(webcrypto.subtle.importKey("jwk",key,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]).then(privateKey=>{return webcrypto.subtle.sign({name:"RSASSA-PKCS1-v1_5"},privateKey,Uint8Array.from(msg))}).then(sig=>Buffer.from(sig)),callback)},exports.hashAndVerify=function(key,sig,msg,callback){nodeify(webcrypto.subtle.importKey("jwk",key,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]).then(publicKey=>{return webcrypto.subtle.verify({name:"RSASSA-PKCS1-v1_5"},publicKey,sig,msg)}),callback)}},function(module,exports,__webpack_require__){"use strict";function randomBytes(number){if(!number||"number"!=typeof number)throw new Error("first argument must be a Number bigger than 0");return rsa.getRandomValues(new Uint8Array(number))}const rsa=__webpack_require__(219);module.exports=randomBytes},function(module,exports,__webpack_require__){"use strict";const BN=__webpack_require__(46).bignum,Buffer=__webpack_require__(6).Buffer;exports.toBase64=function(bn,len){return bn.toArrayLike(Buffer,"be",len).toString("base64").replace(/(=*)$/,"").replace(/\+/g,"-").replace(/\//g,"_")},exports.toBn=function(str){return new BN(Buffer.from(str,"base64"))}},function(module,exports,__webpack_require__){"use strict";const protobuf=__webpack_require__(31),rpcProto=protobuf(__webpack_require__(486)),topicDescriptorProto=protobuf(__webpack_require__(487));exports=module.exports,exports.rpc=rpcProto,exports.td=topicDescriptorProto},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const protobuf=__webpack_require__(31),schema=new Buffer(` message Identify { // protocolVersion determines compatibility between peers optional string protocolVersion = 5; // e.g. ipfs/1.0.0 @@ -53,17 +50,13 @@ message Identify { repeated string protocols = 3; } -`);module.exports=protobuf(schema).Identify}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";module.exports="/mplex/6.7.0"},function(module,exports,__webpack_require__){"use strict";module.exports="/spdy/3.1.0"},function(module,exports,__webpack_require__){"use strict";module.exports={tag:"/plaintext/1.0.0",encrypt(id,privKey,conn){return conn}}},function(module,exports,__webpack_require__){(function(global){function polling(opts){var xd=!1,xs=!1,jsonp=!1!==opts.jsonp;if(global.location){var isSSL="https:"===location.protocol,port=location.port;port||(port=isSSL?443:80),xd=opts.hostname!==location.hostname||port!==opts.port,xs=opts.secure!==isSSL}if(opts.xdomain=xd,opts.xscheme=xs,"open"in new XMLHttpRequest(opts)&&!opts.forceJSONP)return new XHR(opts);if(!jsonp)throw new Error("JSONP disabled");return new JSONP(opts)}var XMLHttpRequest=__webpack_require__(146),XHR=__webpack_require__(612),JSONP=__webpack_require__(611),websocket=__webpack_require__(613);exports.polling=polling,exports.websocket=websocket}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){function Polling(opts){var forceBase64=opts&&opts.forceBase64;hasXHR2&&!forceBase64||(this.supportsBinary=!1),Transport.call(this,opts)}var Transport=__webpack_require__(145),parseqs=__webpack_require__(154),parser=__webpack_require__(64),inherit=__webpack_require__(95),yeast=__webpack_require__(331),debug=__webpack_require__(3)("engine.io-client:polling");module.exports=Polling;var hasXHR2=function(){return null!=new(__webpack_require__(146))({xdomain:!1}).responseType}();inherit(Polling,Transport),Polling.prototype.name="polling",Polling.prototype.doOpen=function(){this.poll()},Polling.prototype.pause=function(onPause){function pause(){debug("paused"),self.readyState="paused",onPause()}var self=this;if(this.readyState="pausing",this.polling||!this.writable){var total=0;this.polling&&(debug("we are currently polling - waiting to pause"),total++,this.once("pollComplete",function(){debug("pre-pause polling complete"),--total||pause()})),this.writable||(debug("we are currently writing - waiting to pause"),total++,this.once("drain",function(){debug("pre-pause writing complete"),--total||pause()}))}else pause()},Polling.prototype.poll=function(){debug("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},Polling.prototype.onData=function(data){var self=this;debug("polling got data %s",data);var callback=function(packet,index,total){if("opening"===self.readyState&&self.onOpen(),"close"===packet.type)return self.onClose(),!1;self.onPacket(packet)};parser.decodePayload(data,this.socket.binaryType,callback),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():debug('ignoring poll - transport state "%s"',this.readyState))},Polling.prototype.doClose=function(){function close(){debug("writing close packet"),self.write([{type:"close"}])}var self=this;"open"===this.readyState?(debug("transport open - closing"),close()):(debug("transport not open - deferring close"),this.once("open",close))},Polling.prototype.write=function(packets){var self=this;this.writable=!1;var callbackfn=function(){self.writable=!0,self.emit("drain")};parser.encodePayload(packets,this.supportsBinary,function(data){self.doWrite(data,callbackfn)})},Polling.prototype.uri=function(){var query=this.query||{},schema=this.secure?"https":"http",port="";return!1!==this.timestampRequests&&(query[this.timestampParam]=yeast()),this.supportsBinary||query.sid||(query.b64=1),query=parseqs.encode(query),this.port&&("https"===schema&&443!==Number(this.port)||"http"===schema&&80!==Number(this.port))&&(port=":"+this.port),query.length&&(query="?"+query),schema+"://"+(this.hostname.indexOf(":")!==-1?"["+this.hostname+"]":this.hostname)+port+this.path+query}},function(module,exports,__webpack_require__){function Manager(uri,opts){if(!(this instanceof Manager))return new Manager(uri,opts);uri&&"object"==typeof uri&&(opts=uri,uri=void 0),opts=opts||{},opts.path=opts.path||"/socket.io",this.nsps={},this.subs=[],this.opts=opts,this.reconnection(opts.reconnection!==!1),this.reconnectionAttempts(opts.reconnectionAttempts||1/0),this.reconnectionDelay(opts.reconnectionDelay||1e3),this.reconnectionDelayMax(opts.reconnectionDelayMax||5e3),this.randomizationFactor(opts.randomizationFactor||.5),this.backoff=new Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==opts.timeout?2e4:opts.timeout),this.readyState="closed",this.uri=uri,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var _parser=opts.parser||parser;this.encoder=new _parser.Encoder,this.decoder=new _parser.Decoder,this.autoConnect=opts.autoConnect!==!1,this.autoConnect&&this.open()}var eio=__webpack_require__(608),Socket=__webpack_require__(259),Emitter=__webpack_require__(63),parser=__webpack_require__(147),on=__webpack_require__(258),bind=__webpack_require__(195),debug=__webpack_require__(108)("socket.io-client:manager"),indexOf=__webpack_require__(131),Backoff=__webpack_require__(358),has=Object.prototype.hasOwnProperty;module.exports=Manager,Manager.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var nsp in this.nsps)has.call(this.nsps,nsp)&&this.nsps[nsp].emit.apply(this.nsps[nsp],arguments)},Manager.prototype.updateSocketIds=function(){for(var nsp in this.nsps)has.call(this.nsps,nsp)&&(this.nsps[nsp].id=this.generateId(nsp))},Manager.prototype.generateId=function(nsp){return("/"===nsp?"":nsp+"#")+this.engine.id},Emitter(Manager.prototype),Manager.prototype.reconnection=function(v){return arguments.length?(this._reconnection=!!v,this):this._reconnection},Manager.prototype.reconnectionAttempts=function(v){return arguments.length?(this._reconnectionAttempts=v,this):this._reconnectionAttempts},Manager.prototype.reconnectionDelay=function(v){return arguments.length?(this._reconnectionDelay=v,this.backoff&&this.backoff.setMin(v),this):this._reconnectionDelay},Manager.prototype.randomizationFactor=function(v){return arguments.length?(this._randomizationFactor=v,this.backoff&&this.backoff.setJitter(v),this):this._randomizationFactor},Manager.prototype.reconnectionDelayMax=function(v){return arguments.length?(this._reconnectionDelayMax=v,this.backoff&&this.backoff.setMax(v),this):this._reconnectionDelayMax},Manager.prototype.timeout=function(v){return arguments.length?(this._timeout=v,this):this._timeout},Manager.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},Manager.prototype.open=Manager.prototype.connect=function(fn,opts){if(debug("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;debug("opening %s",this.uri),this.engine=eio(this.uri,this.opts);var socket=this.engine,self=this;this.readyState="opening",this.skipReconnect=!1;var openSub=on(socket,"open",function(){self.onopen(),fn&&fn()}),errorSub=on(socket,"error",function(data){if(debug("connect_error"),self.cleanup(),self.readyState="closed",self.emitAll("connect_error",data),fn){var err=new Error("Connection error");err.data=data,fn(err)}else self.maybeReconnectOnOpen()});if(!1!==this._timeout){var timeout=this._timeout;debug("connect attempt will timeout after %d",timeout);var timer=setTimeout(function(){debug("connect attempt timed out after %d",timeout),openSub.destroy(),socket.close(),socket.emit("error","timeout"),self.emitAll("connect_timeout",timeout)},timeout);this.subs.push({destroy:function(){clearTimeout(timer)}})}return this.subs.push(openSub),this.subs.push(errorSub),this},Manager.prototype.onopen=function(){debug("open"),this.cleanup(),this.readyState="open",this.emit("open");var socket=this.engine;this.subs.push(on(socket,"data",bind(this,"ondata"))),this.subs.push(on(socket,"ping",bind(this,"onping"))),this.subs.push(on(socket,"pong",bind(this,"onpong"))),this.subs.push(on(socket,"error",bind(this,"onerror"))),this.subs.push(on(socket,"close",bind(this,"onclose"))),this.subs.push(on(this.decoder,"decoded",bind(this,"ondecoded")))},Manager.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},Manager.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},Manager.prototype.ondata=function(data){this.decoder.add(data)},Manager.prototype.ondecoded=function(packet){this.emit("packet",packet)},Manager.prototype.onerror=function(err){debug("error",err),this.emitAll("error",err)},Manager.prototype.socket=function(nsp,opts){function onConnecting(){~indexOf(self.connecting,socket)||self.connecting.push(socket)}var socket=this.nsps[nsp];if(!socket){socket=new Socket(this,nsp,opts),this.nsps[nsp]=socket;var self=this;socket.on("connecting",onConnecting),socket.on("connect",function(){socket.id=self.generateId(nsp)}),this.autoConnect&&onConnecting()}return socket},Manager.prototype.destroy=function(socket){var index=indexOf(this.connecting,socket);~index&&this.connecting.splice(index,1),this.connecting.length||this.close()},Manager.prototype.packet=function(packet){debug("writing packet %j",packet);var self=this;packet.query&&0===packet.type&&(packet.nsp+="?"+packet.query),self.encoding?self.packetBuffer.push(packet):(self.encoding=!0,this.encoder.encode(packet,function(encodedPackets){for(var i=0;i0&&!this.encoding){var pack=this.packetBuffer.shift();this.packet(pack)}},Manager.prototype.cleanup=function(){debug("cleanup");for(var subsLength=this.subs.length,i=0;i=this._reconnectionAttempts)debug("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var delay=this.backoff.duration();debug("will wait %dms before reconnect attempt",delay),this.reconnecting=!0;var timer=setTimeout(function(){self.skipReconnect||(debug("attempting reconnect"),self.emitAll("reconnect_attempt",self.backoff.attempts),self.emitAll("reconnecting",self.backoff.attempts),self.skipReconnect||self.open(function(err){err?(debug("reconnect attempt error"),self.reconnecting=!1,self.reconnect(),self.emitAll("reconnect_error",err.data)):(debug("reconnect success"),self.onreconnect())}))},delay);this.subs.push({destroy:function(){clearTimeout(timer)}})}},Manager.prototype.onreconnect=function(){var attempt=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",attempt)}},function(module,exports){function on(obj,ev,fn){return obj.on(ev,fn),{destroy:function(){obj.removeListener(ev,fn)}}}module.exports=on},function(module,exports,__webpack_require__){function Socket(io,nsp,opts){this.io=io,this.nsp=nsp,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,opts&&opts.query&&(this.query=opts.query),this.io.autoConnect&&this.open()}var parser=__webpack_require__(147),Emitter=__webpack_require__(63),toArray=__webpack_require__(816),on=__webpack_require__(258),bind=__webpack_require__(195),debug=__webpack_require__(108)("socket.io-client:socket");module.exports=Socket;var events={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},emit=Emitter.prototype.emit;Emitter(Socket.prototype),Socket.prototype.subEvents=function(){if(!this.subs){var io=this.io;this.subs=[on(io,"open",bind(this,"onopen")),on(io,"packet",bind(this,"onpacket")),on(io,"close",bind(this,"onclose"))]}},Socket.prototype.open=Socket.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting"),this)},Socket.prototype.send=function(){var args=toArray(arguments);return args.unshift("message"),this.emit.apply(this,args),this},Socket.prototype.emit=function(ev){if(events.hasOwnProperty(ev))return emit.apply(this,arguments),this;var args=toArray(arguments),packet={type:parser.EVENT,data:args};return packet.options={},packet.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof args[args.length-1]&&(debug("emitting packet with ack id %d",this.ids),this.acks[this.ids]=args.pop(),packet.id=this.ids++),this.connected?this.packet(packet):this.sendBuffer.push(packet),delete this.flags,this},Socket.prototype.packet=function(packet){packet.nsp=this.nsp,this.io.packet(packet)},Socket.prototype.onopen=function(){debug("transport is open - connecting"),"/"!==this.nsp&&(this.query?this.packet({type:parser.CONNECT,query:this.query}):this.packet({type:parser.CONNECT}))},Socket.prototype.onclose=function(reason){debug("close (%s)",reason),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",reason)},Socket.prototype.onpacket=function(packet){if(packet.nsp===this.nsp)switch(packet.type){case parser.CONNECT:this.onconnect();break;case parser.EVENT:this.onevent(packet);break;case parser.BINARY_EVENT:this.onevent(packet);break;case parser.ACK:this.onack(packet);break;case parser.BINARY_ACK:this.onack(packet);break;case parser.DISCONNECT:this.ondisconnect();break;case parser.ERROR:this.emit("error",packet.data)}},Socket.prototype.onevent=function(packet){var args=packet.data||[];debug("emitting event %j",args),null!=packet.id&&(debug("attaching ack callback to event"),args.push(this.ack(packet.id))),this.connected?emit.apply(this,args):this.receiveBuffer.push(args)},Socket.prototype.ack=function(id){var self=this,sent=!1;return function(){if(!sent){sent=!0;var args=toArray(arguments);debug("sending ack %j",args),self.packet({type:parser.ACK,id:id,data:args})}}},Socket.prototype.onack=function(packet){var ack=this.acks[packet.id];"function"==typeof ack?(debug("calling ack %s with %j",packet.id,packet.data),ack.apply(this,packet.data),delete this.acks[packet.id]):debug("bad ack %s",packet.id)},Socket.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},Socket.prototype.emitBuffered=function(){var i;for(i=0;i=wait||timeSinceLastCall<0||maxing&&timeSinceLastInvoke>=maxWait}function timerExpired(){var time=now();if(shouldInvoke(time))return trailingEdge(time);timerId=setTimeout(timerExpired,remainingWait(time))}function trailingEdge(time){return timerId=void 0,trailing&&lastArgs?invokeFunc(time):(lastArgs=lastThis=void 0,result)}function cancel(){void 0!==timerId&&clearTimeout(timerId),lastInvokeTime=0,lastArgs=lastCallTime=lastThis=timerId=void 0}function flush(){return void 0===timerId?result:trailingEdge(now())}function debounced(){var time=now(),isInvoking=shouldInvoke(time);if(lastArgs=arguments,lastThis=this,lastCallTime=time,isInvoking){if(void 0===timerId)return leadingEdge(lastCallTime);if(maxing)return timerId=setTimeout(timerExpired,wait),invokeFunc(lastCallTime)}return void 0===timerId&&(timerId=setTimeout(timerExpired,wait)),result}var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime=0,leading=!1,maxing=!1,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return wait=toNumber(wait)||0,isObject(options)&&(leading=!!options.leading,maxing="maxWait"in options,maxWait=maxing?nativeMax(toNumber(options.maxWait)||0,wait):maxWait,trailing="trailing"in options?!!options.trailing:trailing),debounced.cancel=cancel,debounced.flush=flush,debounced}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}var FUNC_ERROR_TEXT="Expected a function",NAN=NaN,symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),objectProto=Object.prototype,objectToString=objectProto.toString,nativeMax=Math.max,nativeMin=Math.min,now=function(){return root.Date.now()};module.exports=debounce}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){(function(global){function getValue(object,key){return null==object?void 0:object[key]}function isHostObject(value){var result=!1;if(null!=value&&"function"!=typeof value.toString)try{result=!!(value+"")}catch(e){}return result}function Hash(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index-1&&value%1==0&&value-1:!!length&&baseIndexOf(collection,value,fromIndex)>-1}function isArguments(value){return isArrayLikeObject(value)&&hasOwnProperty.call(value,"callee")&&(!propertyIsEnumerable.call(value,"callee")||objectToString.call(value)==argsTag)}function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isString(value){return"string"==typeof value||!isArray(value)&&isObjectLike(value)&&objectToString.call(value)==stringTag}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toFinite(value){if(!value)return 0===value?value:0;if((value=toNumber(value))===INFINITY||value===-INFINITY){return(value<0?-1:1)*MAX_INTEGER}return value===value?value:0}function toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function values(object){return object?baseValues(object,keys(object)):[]}var INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,MAX_INTEGER=1.7976931348623157e308,NAN=NaN,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",stringTag="[object String]",symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,reIsUint=/^(?:0|[1-9]\d*)$/,freeParseInt=parseInt,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,propertyIsEnumerable=objectProto.propertyIsEnumerable,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),nativeMax=Math.max,isArray=Array.isArray;module.exports=includes},function(module,exports,__webpack_require__){var root=__webpack_require__(268),Symbol=root.Symbol;module.exports=Symbol},function(module,exports){function arrayMap(array,iteratee){for(var index=-1,length=null==array?0:array.length,result=Array(length);++index-1&&value%1==0&&value<=MAX_SAFE_INTEGER}var MAX_SAFE_INTEGER=9007199254740991;module.exports=isLength},function(module,exports,__webpack_require__){function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}var arrayLikeKeys=__webpack_require__(641),baseKeys=__webpack_require__(646),isArrayLike=__webpack_require__(65);module.exports=keys},function(module,exports){module.exports=function(fun){!function next(){var loop=!0,sync=!1;do{sync=!0,loop=!1,fun.call(this,function(){sync?loop=!0:next()}),sync=!1}while(loop)}()}},function(module,exports,__webpack_require__){(function(process){function AbstractChainedBatch(db){this._db=db,this._operations=[],this._written=!1}AbstractChainedBatch.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},AbstractChainedBatch.prototype.put=function(key,value){this._checkWritten();var err=this._db._checkKey(key,"key",this._db._isBuffer);if(err)throw err;return this._db._isBuffer(key)||(key=String(key)),this._db._isBuffer(value)||(value=String(value)),"function"==typeof this._put?this._put(key,value):this._operations.push({type:"put",key:key,value:value}),this},AbstractChainedBatch.prototype.del=function(key){this._checkWritten();var err=this._db._checkKey(key,"key",this._db._isBuffer);if(err)throw err;return this._db._isBuffer(key)||(key=String(key)),"function"==typeof this._del?this._del(key):this._operations.push({type:"del",key:key}),this},AbstractChainedBatch.prototype.clear=function(){return this._checkWritten(),this._operations=[],"function"==typeof this._clear&&this._clear(),this},AbstractChainedBatch.prototype.write=function(options,callback){if(this._checkWritten(),"function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("write() requires a callback argument");return"object"!=typeof options&&(options={}),this._written=!0,"function"==typeof this._write?this._write(callback):"function"==typeof this._db._batch?this._db._batch(this._operations,options,callback):void process.nextTick(callback)},module.exports=AbstractChainedBatch}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(process){function AbstractIterator(db){this.db=db,this._ended=!1,this._nexting=!1}AbstractIterator.prototype.next=function(callback){var self=this;if("function"!=typeof callback)throw new Error("next() requires a callback argument");return self._ended?callback(new Error("cannot call next() after end()")):self._nexting?callback(new Error("cannot call next() before previous next() has completed")):(self._nexting=!0,"function"==typeof self._next?self._next(function(){self._nexting=!1,callback.apply(null,arguments)}):void process.nextTick(function(){self._nexting=!1,callback()}))},AbstractIterator.prototype.end=function(callback){if("function"!=typeof callback)throw new Error("end() requires a callback argument");return this._ended?callback(new Error("end() already called on iterator")):(this._ended=!0,"function"==typeof this._end?this._end(callback):void process.nextTick(callback))},module.exports=AbstractIterator}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(process,Buffer){function AbstractLevelDOWN(location){if(!arguments.length||void 0===location)throw new Error("constructor requires at least a location argument");if("string"!=typeof location)throw new Error("constructor requires a location string argument");this.location=location,this.status="new"}var xtend=__webpack_require__(37),AbstractIterator=__webpack_require__(273),AbstractChainedBatch=__webpack_require__(272);AbstractLevelDOWN.prototype.open=function(options,callback){var self=this,oldStatus=this.status;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("open() requires a callback argument");"object"!=typeof options&&(options={}),options.createIfMissing=0!=options.createIfMissing,options.errorIfExists=!!options.errorIfExists,"function"==typeof this._open?(this.status="opening",this._open(options,function(err){if(err)return self.status=oldStatus,callback(err);self.status="open",callback()})):(this.status="open",process.nextTick(callback))},AbstractLevelDOWN.prototype.close=function(callback){var self=this,oldStatus=this.status;if("function"!=typeof callback)throw new Error("close() requires a callback argument");"function"==typeof this._close?(this.status="closing",this._close(function(err){if(err)return self.status=oldStatus,callback(err);self.status="closed",callback()})):(this.status="closed",process.nextTick(callback))},AbstractLevelDOWN.prototype.get=function(key,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("get() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),"object"!=typeof options&&(options={}),options.asBuffer=0!=options.asBuffer,"function"==typeof this._get?this._get(key,options,callback):void process.nextTick(function(){callback(new Error("NotFound"))}))},AbstractLevelDOWN.prototype.put=function(key,value,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("put() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),null==value||this._isBuffer(value)||process.browser||(value=String(value)),"object"!=typeof options&&(options={}),"function"==typeof this._put?this._put(key,value,options,callback):void process.nextTick(callback))},AbstractLevelDOWN.prototype.del=function(key,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("del() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),"object"!=typeof options&&(options={}),"function"==typeof this._del?this._del(key,options,callback):void process.nextTick(callback))},AbstractLevelDOWN.prototype.batch=function(array,options,callback){if(!arguments.length)return this._chainedBatch();if("function"==typeof options&&(callback=options),"function"==typeof array&&(callback=array),"function"!=typeof callback)throw new Error("batch(array) requires a callback argument");if(!Array.isArray(array))return callback(new Error("batch(array) requires an array argument"));options&&"object"==typeof options||(options={});for(var e,err,i=0,l=array.length;i1}function stringToNibbles(key){for(var bkey=new Buffer(key),nibbles=[],i=0;i>4,++q,nibbles[q]=bkey[i]%16}return nibbles}function nibblesToBuffer(arr){for(var buf=new Buffer(arr.length/2),i=0;i>8,lo=255&c;hi?res.push(hi,lo):res.push(lo)}return res}function zero2(word){return 1===word.length?"0"+word:word}function toHex(msg){for(var res="",i=0;i{return function(input,callback){const done=(err,res)=>setImmediate(()=>{callback(err,res)});let res;try{res=doWork(input)}catch(err){return void done(err)}done(null,res)}}),exports.toBuf=((doWork,other)=>input=>{return new Buffer(doWork(input,other),"hex")}),exports.fromString=((doWork,other)=>_input=>{return doWork(Buffer.isBuffer(_input)?_input.toString():_input,other)}),exports.fromNumberTo32BitBuf=((doWork,other)=>input=>{let number=doWork(input,other);const bytes=new Array(4);for(let i=0;i<4;i++)bytes[i]=255&number,number>>=8;return Buffer.from(bytes)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(process){function prependListener(emitter,event,fn){if("function"==typeof emitter.prependListener)return emitter.prependListener(event,fn);emitter._events&&emitter._events[event]?isArray(emitter._events[event])?emitter._events[event].unshift(fn):emitter._events[event]=[fn,emitter._events[event]]:emitter.on(event,fn)}function ReadableState(options,stream){Duplex=Duplex||__webpack_require__(66),options=options||{},this.objectMode=!!options.objectMode,stream instanceof Duplex&&(this.objectMode=this.objectMode||!!options.readableObjectMode);var hwm=options.highWaterMark,defaultHwm=this.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:defaultHwm,this.highWaterMark=~~this.highWaterMark,this.buffer=new BufferList,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=options.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(StringDecoder||(StringDecoder=__webpack_require__(18).StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding)}function Readable(options){if(Duplex=Duplex||__webpack_require__(66),!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this),this.readable=!0,options&&"function"==typeof options.read&&(this._read=options.read),Stream.call(this)}function readableAddChunk(stream,state,chunk,encoding,addToFront){var er=chunkInvalid(state,chunk);if(er)stream.emit("error",er);else if(null===chunk)state.reading=!1,onEofChunk(stream,state);else if(state.objectMode||chunk&&chunk.length>0)if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var _e=new Error("stream.unshift() after end event");stream.emit("error",_e)}else{var skipAdd;!state.decoder||addToFront||encoding||(chunk=state.decoder.write(chunk),skipAdd=!state.objectMode&&0===chunk.length),addToFront||(state.reading=!1),skipAdd||(state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream))),maybeReadMore(stream,state)}else addToFront||(state.reading=!1);return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||0===state.length&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}function chunkInvalid(state,chunk){var er=null;return Buffer.isBuffer(chunk)||"string"==typeof chunk||null===chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function onEofChunk(stream,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?processNextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,processNextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return nstr.length?str.length:n;if(ret+=nb===str.length?str:str.slice(0,n),0===(n-=nb)){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=bufferShim.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),0===(n-=nb)){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,processNextTick(endReadableNT,state,stream))}function endReadableNT(state,stream){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}function indexOf(xs,x){for(var i=0,l=xs.length;i=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n0?fromList(n,state):null,null===ret?(state.needReadable=!0,n=0):state.length-=n,0===state.length&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),null!==ret&&this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable){debug("onunpipe"),readable===src&&cleanup()}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",cleanup),src.removeListener("data",ondata),cleanedUp=!0,!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain()}function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1,!1!==dest.write(chunk)||increasedAwaitDrain||((1===state.pipesCount&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EElistenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:cleanup;state.endEmitted?processNextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1,increasedAwaitDrain=!1;return src.on("data",ondata),prependListener(dest,"error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState;if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i-1?setImmediate:processNextTick;Writable.WritableState=WritableState;var util=__webpack_require__(6);util.inherits=__webpack_require__(1);var internalUtil={deprecate:__webpack_require__(72)},Stream=__webpack_require__(284),Buffer=__webpack_require__(0).Buffer,bufferShim=__webpack_require__(14);util.inherits(Writable,Stream),WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(_){}}();var realHasInstance;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return!!realHasInstance.call(this,object)||object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=Buffer.isBuffer(chunk);return"function"==typeof encoding&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),"function"!=typeof cb&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,state.writing||state.corked||state.finished||state.bufferProcessing||!state.bufferedRequest||clearBuffer(this,state))},Writable.prototype.setDefaultEncoding=function(encoding){if("string"==typeof encoding&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this},Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;"function"==typeof chunk?(cb=chunk,chunk=null,encoding=null):"function"==typeof encoding&&(cb=encoding,encoding=null),null!==chunk&&void 0!==chunk&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||state.finished||endWritable(this,state,cb)}}).call(exports,__webpack_require__(2),__webpack_require__(22).setImmediate)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(8).EventEmitter},function(module,exports,__webpack_require__){exports=module.exports=__webpack_require__(281),exports.Stream=exports,exports.Readable=exports,exports.Writable=__webpack_require__(283),exports.Duplex=__webpack_require__(66),exports.Transform=__webpack_require__(282),exports.PassThrough=__webpack_require__(688)},function(module,exports,__webpack_require__){"use strict";exports=module.exports,exports.PROTOCOL_ID="/multistream/1.0.0"},function(module,exports,__webpack_require__){"use strict";function matchExact(myProtocol,senderProtocol,callback){callback(null,myProtocol===senderProtocol)}module.exports=matchExact},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function select(multicodec,callback,log){const stream=handshake({timeout:6e4},callback),shake=stream.handshake;return log("writing multicodec: "+multicodec),writeEncoded(shake,new Buffer(multicodec+"\n"),callback),pullLP.decodeFromReader(shake,(err,data)=>{if(err)return callback(err);const protocol=data.toString().slice(0,-1);if(protocol!==multicodec)return callback(new Error(`"${multicodec}" not supported`),shake.rest());log("received ack: "+protocol),callback(null,shake.rest())}),stream}const handshake=__webpack_require__(67),pullLP=__webpack_require__(28),util=__webpack_require__(112),writeEncoded=util.writeEncoded;module.exports=select}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function adler32(adler,buf,len,pos){for(var s1=65535&adler|0,s2=adler>>>16&65535|0,n=0;0!==len;){n=len>2e3?2e3:len,len-=n;do{s1=s1+buf[pos++]|0,s2=s2+s1|0}while(--n);s1%=65521,s2%=65521}return s1|s2<<16|0}module.exports=adler32},function(module,exports,__webpack_require__){"use strict";function crc32(crc,buf,len,pos){var t=crcTable,end=pos+len;crc^=-1;for(var i=pos;i>>8^t[255&(crc^buf[i])];return crc^-1}var crcTable=function(){for(var c,table=[],n=0;n<256;n++){c=n;for(var k=0;k<8;k++)c=1&c?3988292384^c>>>1:c>>>1;table[n]=c}return table}();module.exports=crc32},function(module,exports){var re=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,parts=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];module.exports=function(str){var src=str,b=str.indexOf("["),e=str.indexOf("]");b!=-1&&e!=-1&&(str=str.substring(0,b)+str.substring(b,e).replace(/:/g,";")+str.substring(e,str.length));for(var m=re.exec(str||""),uri={},i=14;i--;)uri[parts[i]]=m[i]||"";return b!=-1&&e!=-1&&(uri.source=src,uri.host=uri.host.substring(1,uri.host.length-1).replace(/;/g,":"),uri.authority=uri.authority.replace("[","").replace("]","").replace(/;/g,":"),uri.ipv6uri=!0),uri}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function getB58Str(peer){let b58Str;if("string"==typeof peer)b58Str=peer;else if(Buffer.isBuffer(peer))b58Str=bs58.encode(peer).toString();else if(PeerId.isPeerId(peer))b58Str=peer.toB58String();else{if(!PeerInfo.isPeerInfo(peer))throw new Error("not valid PeerId or PeerInfo, or B58Str");b58Str=peer.id.toB58String()}return b58Str}const bs58=__webpack_require__(24),PeerId=__webpack_require__(31),PeerInfo=__webpack_require__(51);class PeerBook{constructor(){this._peers={}}has(peer){const b58Str=getB58Str(peer);return Boolean(this._peers[b58Str])}put(peerInfo,replace){const localPeerInfo=this._peers[peerInfo.id.toB58String()];if(!localPeerInfo||replace)return this._peers[peerInfo.id.toB58String()]=peerInfo,peerInfo;peerInfo.multiaddrs.forEach(ma=>localPeerInfo.multiaddrs.add(ma));const ma=peerInfo.isConnected();return ma&&localPeerInfo.connect(ma),peerInfo.protocols.forEach(p=>localPeerInfo.protocols.add(p)),!localPeerInfo.id.privKey&&peerInfo.id.privKey&&(localPeerInfo.id.privKey=peerInfo.id.privKey),!localPeerInfo.id.pubKey&&peerInfo.id.pubKey&&(localPeerInfo.id.pubKey=peerInfo.id.pubKey),localPeerInfo}get(peer){const b58Str=getB58Str(peer),peerInfo=this._peers[b58Str];if(peerInfo)return peerInfo;throw new Error("PeerInfo not found")}getAll(){return this._peers}getAllArray(){return Object.keys(this._peers).map(b58Str=>this._peers[b58Str])}getMultiaddrs(peer){return this.get(peer).multiaddrs.toArray()}remove(peer){const b58Str=getB58Str(peer);this._peers[b58Str]&&delete this._peers[b58Str]}}module.exports=PeerBook}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function ensureMultiaddr(ma){return multiaddr.isMultiaddr(ma)?ma:multiaddr(ma)}const multiaddr=__webpack_require__(34);module.exports={ensureMultiaddr:ensureMultiaddr}},function(module,exports,__webpack_require__){var Source=__webpack_require__(83),Sink=__webpack_require__(296);module.exports=function(){var source=Source(),sink=Sink();return{source:source,sink:sink,resolve:function(duplex){source.resolve(duplex.source),sink.resolve(duplex.sink)}}}},function(module,exports,__webpack_require__){exports.source=__webpack_require__(83),exports.through=__webpack_require__(724),exports.sink=__webpack_require__(296),exports.duplex=__webpack_require__(294)},function(module,exports){module.exports=function(stream){function consume(_read){if(!_read)throw new Error("must be passed a readable");read=_read,started&&stream(read)}var read,started=!1;Math.random();return consume.resolve=consume.ready=consume.start=function(_stream){return started=!0,stream=_stream||stream,read&&stream(read),consume},consume}},function(module,exports){module.exports=function(onPause){function reader(_read){return read=_read,function(abort,cb){paused?wait=[abort,cb]:read(abort,cb)}}var wait,read,paused;return reader.pause=function(){paused||onPause&&onPause(paused=!0)},reader.resume=function(){if(paused&&(paused=!1,onPause&&onPause(paused),wait)){var _wait=wait;wait=null,read(_wait[0],_wait[1])}},reader}},function(module,exports,__webpack_require__){"use strict";function isInteger(i){return Number.isFinite(i)}function isFunction(f){return"function"==typeof f}function maxDelay(fn,delay){return delay?function(a,cb){var timer=setTimeout(function(){fn(new Error("pull-reader: read exceeded timeout"),cb)},delay);fn(a,function(err,value){clearTimeout(timer),cb(err,value)})}:fn}var State=__webpack_require__(729);module.exports=function(timeout){function drain(){for(;queue.length;)if(null==queue[0].length&&state.has(1))queue.shift().cb(null,state.get());else if(state.has(queue[0].length)){var next=queue.shift();next.cb(null,state.get(next.length))}else{if(!ended)return!!queue.length;queue.shift().cb(ended)}return queue.length||!state.has(1)||abort}function more(){drain()&&!reading&&(!read||reading||streaming||(reading=!0,readTimed(null,function(err,data){if(reading=!1,err)return ended=err,drain();state.add(data),more()})))}function reader(_read){if(abort){for(;queue.length;)queue.shift().cb(abort);return cb&&cb(abort)}readTimed=maxDelay(_read,timeout),read=_read,more()}var read,readTimed,ended,streaming,abort,queue=[],reading=!1,state=State();return reader.abort=function(err,cb){abort=err||!0,read?(reading=!0,read(abort,function(){for(;queue.length;)queue.shift().cb(abort);cb&&cb(abort)})):cb()},reader.read=function(len,_timeout,cb){if(isFunction(_timeout)&&(cb=_timeout,_timeout=timeout),!isFunction(cb))return streaming=!0,function(abort,cb){if(reading||state.has(1)){if(abort)return read(abort,cb);queue.push({length:null,cb:cb}),more()}else maxDelay(read,_timeout)(abort,function(err,data){cb(err,data)})};queue.push({length:isInteger(len)?len:null,cb:cb}),more()},reader}},function(module,exports,__webpack_require__){"use strict";module.exports=function pull(a){var length=arguments.length;if("function"==typeof a&&1===a.length){for(var args=new Array(length),i=0;i0)if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var e=new Error("stream.unshift() after end event");stream.emit("error",e)}else!state.decoder||addToFront||encoding||(chunk=state.decoder.write(chunk)),addToFront||(state.reading=!1),state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream)),maybeReadMore(stream,state);else addToFront||(state.reading=!1);return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM)n=MAX_HWM;else{n--;for(var p=1;p<32;p<<=1)n|=n>>p;n++}return n}function howMuchToRead(n,state){return 0===state.length&&state.ended?0:state.objectMode?0===n?0:1:isNaN(n)||util.isNull(n)?state.flowing&&state.buffer.length?state.buffer[0].length:state.length:n<=0?0:(n>state.highWaterMark&&(state.highWaterMark=roundUpToNextPowerOf2(n)),n>state.length?state.ended?state.length:(state.needReadable=!0,0):n)}function chunkInvalid(state,chunk){var er=null;return util.isBuffer(chunk)||util.isString(chunk)||util.isNullOrUndefined(chunk)||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function onEofChunk(stream,state){if(state.decoder&&!state.ended){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?process.nextTick(function(){emitReadable_(stream)}):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,process.nextTick(function(){maybeReadMore_(stream,state)}))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=length)ret=stringMode?list.join(""):Buffer.concat(list,length),list.length=0;else if(n0)throw new Error("endReadable called on non-empty stream");state.endEmitted||(state.ended=!0,process.nextTick(function(){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}))}function forEach(xs,f){for(var i=0,l=xs.length;i0)&&(state.emittedReadable=!1),0===n&&state.needReadable&&(state.length>=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n0?fromList(n,state):null,util.isNull(ret)&&(state.needReadable=!0,n=0),state.length-=n,0!==state.length||state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&0===state.length&&endReadable(this),util.isNull(ret)||this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable){debug("onunpipe"),readable===src&&cleanup()}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",cleanup),src.removeListener("data",ondata),!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain()}function ondata(chunk){debug("ondata"),!1===dest.write(chunk)&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EE.listenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:cleanup;state.endEmitted?process.nextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);return dest.on("drain",ondrain),src.on("data",ondata),dest._events&&dest._events.error?isArray(dest._events.error)?dest._events.error.unshift(onerror):dest._events.error=[onerror,dest._events.error]:dest.on("error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState;if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i1){for(var cbs=[],c=0;c>>32-n}function fn1(a,b,c,d,e,m,k,s){return rotl(a+(b^c^d)+m+k|0,s)+e|0}function fn2(a,b,c,d,e,m,k,s){return rotl(a+(b&c|~b&d)+m+k|0,s)+e|0}function fn3(a,b,c,d,e,m,k,s){return rotl(a+((b|~c)^d)+m+k|0,s)+e|0}function fn4(a,b,c,d,e,m,k,s){return rotl(a+(b&d|c&~d)+m+k|0,s)+e|0}function fn5(a,b,c,d,e,m,k,s){return rotl(a+(b^(c|~d))+m+k|0,s)+e|0}var inherits=__webpack_require__(1),HashBase=__webpack_require__(431);inherits(RIPEMD160,HashBase),RIPEMD160.prototype._update=function(){for(var m=new Array(16),i=0;i<16;++i)m[i]=this._block.readInt32LE(4*i);var al=this._a,bl=this._b,cl=this._c,dl=this._d,el=this._e;al=fn1(al,bl,cl,dl,el,m[0],0,11),cl=rotl(cl,10),el=fn1(el,al,bl,cl,dl,m[1],0,14),bl=rotl(bl,10),dl=fn1(dl,el,al,bl,cl,m[2],0,15),al=rotl(al,10),cl=fn1(cl,dl,el,al,bl,m[3],0,12),el=rotl(el,10),bl=fn1(bl,cl,dl,el,al,m[4],0,5),dl=rotl(dl,10),al=fn1(al,bl,cl,dl,el,m[5],0,8),cl=rotl(cl,10),el=fn1(el,al,bl,cl,dl,m[6],0,7),bl=rotl(bl,10),dl=fn1(dl,el,al,bl,cl,m[7],0,9),al=rotl(al,10),cl=fn1(cl,dl,el,al,bl,m[8],0,11),el=rotl(el,10),bl=fn1(bl,cl,dl,el,al,m[9],0,13),dl=rotl(dl,10),al=fn1(al,bl,cl,dl,el,m[10],0,14),cl=rotl(cl,10),el=fn1(el,al,bl,cl,dl,m[11],0,15),bl=rotl(bl,10),dl=fn1(dl,el,al,bl,cl,m[12],0,6),al=rotl(al,10),cl=fn1(cl,dl,el,al,bl,m[13],0,7),el=rotl(el,10),bl=fn1(bl,cl,dl,el,al,m[14],0,9),dl=rotl(dl,10),al=fn1(al,bl,cl,dl,el,m[15],0,8),cl=rotl(cl,10),el=fn2(el,al,bl,cl,dl,m[7],1518500249,7),bl=rotl(bl,10),dl=fn2(dl,el,al,bl,cl,m[4],1518500249,6),al=rotl(al,10),cl=fn2(cl,dl,el,al,bl,m[13],1518500249,8),el=rotl(el,10),bl=fn2(bl,cl,dl,el,al,m[1],1518500249,13),dl=rotl(dl,10),al=fn2(al,bl,cl,dl,el,m[10],1518500249,11),cl=rotl(cl,10),el=fn2(el,al,bl,cl,dl,m[6],1518500249,9),bl=rotl(bl,10),dl=fn2(dl,el,al,bl,cl,m[15],1518500249,7),al=rotl(al,10),cl=fn2(cl,dl,el,al,bl,m[3],1518500249,15),el=rotl(el,10),bl=fn2(bl,cl,dl,el,al,m[12],1518500249,7),dl=rotl(dl,10),al=fn2(al,bl,cl,dl,el,m[0],1518500249,12),cl=rotl(cl,10),el=fn2(el,al,bl,cl,dl,m[9],1518500249,15),bl=rotl(bl,10),dl=fn2(dl,el,al,bl,cl,m[5],1518500249,9),al=rotl(al,10),cl=fn2(cl,dl,el,al,bl,m[2],1518500249,11),el=rotl(el,10),bl=fn2(bl,cl,dl,el,al,m[14],1518500249,7),dl=rotl(dl,10),al=fn2(al,bl,cl,dl,el,m[11],1518500249,13),cl=rotl(cl,10),el=fn2(el,al,bl,cl,dl,m[8],1518500249,12),bl=rotl(bl,10),dl=fn3(dl,el,al,bl,cl,m[3],1859775393,11),al=rotl(al,10),cl=fn3(cl,dl,el,al,bl,m[10],1859775393,13),el=rotl(el,10),bl=fn3(bl,cl,dl,el,al,m[14],1859775393,6),dl=rotl(dl,10),al=fn3(al,bl,cl,dl,el,m[4],1859775393,7),cl=rotl(cl,10),el=fn3(el,al,bl,cl,dl,m[9],1859775393,14),bl=rotl(bl,10),dl=fn3(dl,el,al,bl,cl,m[15],1859775393,9),al=rotl(al,10),cl=fn3(cl,dl,el,al,bl,m[8],1859775393,13),el=rotl(el,10),bl=fn3(bl,cl,dl,el,al,m[1],1859775393,15),dl=rotl(dl,10),al=fn3(al,bl,cl,dl,el,m[2],1859775393,14),cl=rotl(cl,10),el=fn3(el,al,bl,cl,dl,m[7],1859775393,8),bl=rotl(bl,10),dl=fn3(dl,el,al,bl,cl,m[0],1859775393,13),al=rotl(al,10),cl=fn3(cl,dl,el,al,bl,m[6],1859775393,6),el=rotl(el,10),bl=fn3(bl,cl,dl,el,al,m[13],1859775393,5),dl=rotl(dl,10),al=fn3(al,bl,cl,dl,el,m[11],1859775393,12),cl=rotl(cl,10),el=fn3(el,al,bl,cl,dl,m[5],1859775393,7),bl=rotl(bl,10),dl=fn3(dl,el,al,bl,cl,m[12],1859775393,5),al=rotl(al,10),cl=fn4(cl,dl,el,al,bl,m[1],2400959708,11),el=rotl(el,10),bl=fn4(bl,cl,dl,el,al,m[9],2400959708,12),dl=rotl(dl,10),al=fn4(al,bl,cl,dl,el,m[11],2400959708,14),cl=rotl(cl,10),el=fn4(el,al,bl,cl,dl,m[10],2400959708,15),bl=rotl(bl,10),dl=fn4(dl,el,al,bl,cl,m[0],2400959708,14),al=rotl(al,10),cl=fn4(cl,dl,el,al,bl,m[8],2400959708,15),el=rotl(el,10),bl=fn4(bl,cl,dl,el,al,m[12],2400959708,9),dl=rotl(dl,10),al=fn4(al,bl,cl,dl,el,m[4],2400959708,8),cl=rotl(cl,10),el=fn4(el,al,bl,cl,dl,m[13],2400959708,9),bl=rotl(bl,10),dl=fn4(dl,el,al,bl,cl,m[3],2400959708,14),al=rotl(al,10),cl=fn4(cl,dl,el,al,bl,m[7],2400959708,5),el=rotl(el,10),bl=fn4(bl,cl,dl,el,al,m[15],2400959708,6),dl=rotl(dl,10),al=fn4(al,bl,cl,dl,el,m[14],2400959708,8),cl=rotl(cl,10),el=fn4(el,al,bl,cl,dl,m[5],2400959708,6),bl=rotl(bl,10),dl=fn4(dl,el,al,bl,cl,m[6],2400959708,5),al=rotl(al,10),cl=fn4(cl,dl,el,al,bl,m[2],2400959708,12),el=rotl(el,10),bl=fn5(bl,cl,dl,el,al,m[4],2840853838,9),dl=rotl(dl,10),al=fn5(al,bl,cl,dl,el,m[0],2840853838,15),cl=rotl(cl,10),el=fn5(el,al,bl,cl,dl,m[5],2840853838,5),bl=rotl(bl,10),dl=fn5(dl,el,al,bl,cl,m[9],2840853838,11),al=rotl(al,10),cl=fn5(cl,dl,el,al,bl,m[7],2840853838,6),el=rotl(el,10),bl=fn5(bl,cl,dl,el,al,m[12],2840853838,8),dl=rotl(dl,10),al=fn5(al,bl,cl,dl,el,m[2],2840853838,13),cl=rotl(cl,10),el=fn5(el,al,bl,cl,dl,m[10],2840853838,12),bl=rotl(bl,10),dl=fn5(dl,el,al,bl,cl,m[14],2840853838,5),al=rotl(al,10),cl=fn5(cl,dl,el,al,bl,m[1],2840853838,12),el=rotl(el,10),bl=fn5(bl,cl,dl,el,al,m[3],2840853838,13),dl=rotl(dl,10),al=fn5(al,bl,cl,dl,el,m[8],2840853838,14),cl=rotl(cl,10),el=fn5(el,al,bl,cl,dl,m[11],2840853838,11),bl=rotl(bl,10),dl=fn5(dl,el,al,bl,cl,m[6],2840853838,8),al=rotl(al,10),cl=fn5(cl,dl,el,al,bl,m[15],2840853838,5),el=rotl(el,10),bl=fn5(bl,cl,dl,el,al,m[13],2840853838,6),dl=rotl(dl,10);var ar=this._a,br=this._b,cr=this._c,dr=this._d,er=this._e;ar=fn5(ar,br,cr,dr,er,m[5],1352829926,8),cr=rotl(cr,10),er=fn5(er,ar,br,cr,dr,m[14],1352829926,9),br=rotl(br,10),dr=fn5(dr,er,ar,br,cr,m[7],1352829926,9),ar=rotl(ar,10),cr=fn5(cr,dr,er,ar,br,m[0],1352829926,11),er=rotl(er,10),br=fn5(br,cr,dr,er,ar,m[9],1352829926,13),dr=rotl(dr,10),ar=fn5(ar,br,cr,dr,er,m[2],1352829926,15),cr=rotl(cr,10),er=fn5(er,ar,br,cr,dr,m[11],1352829926,15),br=rotl(br,10),dr=fn5(dr,er,ar,br,cr,m[4],1352829926,5),ar=rotl(ar,10),cr=fn5(cr,dr,er,ar,br,m[13],1352829926,7),er=rotl(er,10),br=fn5(br,cr,dr,er,ar,m[6],1352829926,7),dr=rotl(dr,10),ar=fn5(ar,br,cr,dr,er,m[15],1352829926,8),cr=rotl(cr,10),er=fn5(er,ar,br,cr,dr,m[8],1352829926,11),br=rotl(br,10),dr=fn5(dr,er,ar,br,cr,m[1],1352829926,14),ar=rotl(ar,10),cr=fn5(cr,dr,er,ar,br,m[10],1352829926,14),er=rotl(er,10),br=fn5(br,cr,dr,er,ar,m[3],1352829926,12),dr=rotl(dr,10),ar=fn5(ar,br,cr,dr,er,m[12],1352829926,6),cr=rotl(cr,10),er=fn4(er,ar,br,cr,dr,m[6],1548603684,9),br=rotl(br,10),dr=fn4(dr,er,ar,br,cr,m[11],1548603684,13),ar=rotl(ar,10),cr=fn4(cr,dr,er,ar,br,m[3],1548603684,15),er=rotl(er,10),br=fn4(br,cr,dr,er,ar,m[7],1548603684,7),dr=rotl(dr,10),ar=fn4(ar,br,cr,dr,er,m[0],1548603684,12),cr=rotl(cr,10),er=fn4(er,ar,br,cr,dr,m[13],1548603684,8),br=rotl(br,10),dr=fn4(dr,er,ar,br,cr,m[5],1548603684,9),ar=rotl(ar,10),cr=fn4(cr,dr,er,ar,br,m[10],1548603684,11),er=rotl(er,10),br=fn4(br,cr,dr,er,ar,m[14],1548603684,7),dr=rotl(dr,10),ar=fn4(ar,br,cr,dr,er,m[15],1548603684,7),cr=rotl(cr,10),er=fn4(er,ar,br,cr,dr,m[8],1548603684,12),br=rotl(br,10),dr=fn4(dr,er,ar,br,cr,m[12],1548603684,7),ar=rotl(ar,10),cr=fn4(cr,dr,er,ar,br,m[4],1548603684,6),er=rotl(er,10),br=fn4(br,cr,dr,er,ar,m[9],1548603684,15),dr=rotl(dr,10),ar=fn4(ar,br,cr,dr,er,m[1],1548603684,13),cr=rotl(cr,10),er=fn4(er,ar,br,cr,dr,m[2],1548603684,11),br=rotl(br,10),dr=fn3(dr,er,ar,br,cr,m[15],1836072691,9),ar=rotl(ar,10),cr=fn3(cr,dr,er,ar,br,m[5],1836072691,7),er=rotl(er,10),br=fn3(br,cr,dr,er,ar,m[1],1836072691,15),dr=rotl(dr,10),ar=fn3(ar,br,cr,dr,er,m[3],1836072691,11),cr=rotl(cr,10),er=fn3(er,ar,br,cr,dr,m[7],1836072691,8),br=rotl(br,10),dr=fn3(dr,er,ar,br,cr,m[14],1836072691,6),ar=rotl(ar,10),cr=fn3(cr,dr,er,ar,br,m[6],1836072691,6),er=rotl(er,10),br=fn3(br,cr,dr,er,ar,m[9],1836072691,14),dr=rotl(dr,10),ar=fn3(ar,br,cr,dr,er,m[11],1836072691,12),cr=rotl(cr,10),er=fn3(er,ar,br,cr,dr,m[8],1836072691,13),br=rotl(br,10),dr=fn3(dr,er,ar,br,cr,m[12],1836072691,5),ar=rotl(ar,10),cr=fn3(cr,dr,er,ar,br,m[2],1836072691,14),er=rotl(er,10),br=fn3(br,cr,dr,er,ar,m[10],1836072691,13),dr=rotl(dr,10),ar=fn3(ar,br,cr,dr,er,m[0],1836072691,13),cr=rotl(cr,10),er=fn3(er,ar,br,cr,dr,m[4],1836072691,7),br=rotl(br,10),dr=fn3(dr,er,ar,br,cr,m[13],1836072691,5),ar=rotl(ar,10),cr=fn2(cr,dr,er,ar,br,m[8],2053994217,15),er=rotl(er,10),br=fn2(br,cr,dr,er,ar,m[6],2053994217,5),dr=rotl(dr,10),ar=fn2(ar,br,cr,dr,er,m[4],2053994217,8),cr=rotl(cr,10),er=fn2(er,ar,br,cr,dr,m[1],2053994217,11),br=rotl(br,10),dr=fn2(dr,er,ar,br,cr,m[3],2053994217,14),ar=rotl(ar,10),cr=fn2(cr,dr,er,ar,br,m[11],2053994217,14),er=rotl(er,10),br=fn2(br,cr,dr,er,ar,m[15],2053994217,6),dr=rotl(dr,10),ar=fn2(ar,br,cr,dr,er,m[0],2053994217,14),cr=rotl(cr,10),er=fn2(er,ar,br,cr,dr,m[5],2053994217,6),br=rotl(br,10),dr=fn2(dr,er,ar,br,cr,m[12],2053994217,9),ar=rotl(ar,10),cr=fn2(cr,dr,er,ar,br,m[2],2053994217,12),er=rotl(er,10),br=fn2(br,cr,dr,er,ar,m[13],2053994217,9),dr=rotl(dr,10),ar=fn2(ar,br,cr,dr,er,m[9],2053994217,12),cr=rotl(cr,10),er=fn2(er,ar,br,cr,dr,m[7],2053994217,5),br=rotl(br,10),dr=fn2(dr,er,ar,br,cr,m[10],2053994217,15),ar=rotl(ar,10),cr=fn2(cr,dr,er,ar,br,m[14],2053994217,8),er=rotl(er,10),br=fn1(br,cr,dr,er,ar,m[12],0,8),dr=rotl(dr,10),ar=fn1(ar,br,cr,dr,er,m[15],0,5),cr=rotl(cr,10),er=fn1(er,ar,br,cr,dr,m[10],0,12),br=rotl(br,10),dr=fn1(dr,er,ar,br,cr,m[4],0,9),ar=rotl(ar,10),cr=fn1(cr,dr,er,ar,br,m[1],0,12),er=rotl(er,10),br=fn1(br,cr,dr,er,ar,m[5],0,5),dr=rotl(dr,10),ar=fn1(ar,br,cr,dr,er,m[8],0,14),cr=rotl(cr,10),er=fn1(er,ar,br,cr,dr,m[7],0,6),br=rotl(br,10),dr=fn1(dr,er,ar,br,cr,m[6],0,8),ar=rotl(ar,10),cr=fn1(cr,dr,er,ar,br,m[2],0,13),er=rotl(er,10),br=fn1(br,cr,dr,er,ar,m[13],0,6),dr=rotl(dr,10),ar=fn1(ar,br,cr,dr,er,m[14],0,5),cr=rotl(cr,10),er=fn1(er,ar,br,cr,dr,m[0],0,15),br=rotl(br,10),dr=fn1(dr,er,ar,br,cr,m[3],0,13),ar=rotl(ar,10),cr=fn1(cr,dr,er,ar,br,m[9],0,11),er=rotl(er,10),br=fn1(br,cr,dr,er,ar,m[11],0,11),dr=rotl(dr,10);var t=this._b+cl+dr|0;this._b=this._c+dl+er|0,this._c=this._d+el+ar|0,this._d=this._e+al+br|0,this._e=this._a+bl+cr|0,this._a=t},RIPEMD160.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var buffer=new Buffer(20);return buffer.writeInt32LE(this._a,0),buffer.writeInt32LE(this._b,4),buffer.writeInt32LE(this._c,8),buffer.writeInt32LE(this._d,12),buffer.writeInt32LE(this._e,16),buffer},module.exports=RIPEMD160}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function initCompressedValue(value,defaultValue){return void 0===value?defaultValue:(assert.isBoolean(value,messages.COMPRESSED_TYPE_INVALID),value)}var assert=__webpack_require__(769),der=__webpack_require__(770),messages=__webpack_require__(140);module.exports=function(secp256k1){return{privateKeyVerify:function(privateKey){return assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),32===privateKey.length&&secp256k1.privateKeyVerify(privateKey)},privateKeyExport:function(privateKey,compressed){assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),assert.isBufferLength(privateKey,32,messages.EC_PRIVATE_KEY_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0);var publicKey=secp256k1.privateKeyExport(privateKey,compressed);return der.privateKeyExport(privateKey,publicKey,compressed)},privateKeyImport:function(privateKey){if(assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),(privateKey=der.privateKeyImport(privateKey))&&32===privateKey.length&&secp256k1.privateKeyVerify(privateKey))return privateKey;throw new Error(messages.EC_PRIVATE_KEY_IMPORT_DER_FAIL)},privateKeyTweakAdd:function(privateKey,tweak){return assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),assert.isBufferLength(privateKey,32,messages.EC_PRIVATE_KEY_LENGTH_INVALID),assert.isBuffer(tweak,messages.TWEAK_TYPE_INVALID),assert.isBufferLength(tweak,32,messages.TWEAK_LENGTH_INVALID),secp256k1.privateKeyTweakAdd(privateKey,tweak)},privateKeyTweakMul:function(privateKey,tweak){return assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),assert.isBufferLength(privateKey,32,messages.EC_PRIVATE_KEY_LENGTH_INVALID),assert.isBuffer(tweak,messages.TWEAK_TYPE_INVALID),assert.isBufferLength(tweak,32,messages.TWEAK_LENGTH_INVALID),secp256k1.privateKeyTweakMul(privateKey,tweak)},publicKeyCreate:function(privateKey,compressed){return assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),assert.isBufferLength(privateKey,32,messages.EC_PRIVATE_KEY_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0),secp256k1.publicKeyCreate(privateKey,compressed)},publicKeyConvert:function(publicKey,compressed){return assert.isBuffer(publicKey,messages.EC_PUBLIC_KEY_TYPE_INVALID),assert.isBufferLength2(publicKey,33,65,messages.EC_PUBLIC_KEY_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0),secp256k1.publicKeyConvert(publicKey,compressed)},publicKeyVerify:function(publicKey){return assert.isBuffer(publicKey,messages.EC_PUBLIC_KEY_TYPE_INVALID),secp256k1.publicKeyVerify(publicKey)},publicKeyTweakAdd:function(publicKey,tweak,compressed){return assert.isBuffer(publicKey,messages.EC_PUBLIC_KEY_TYPE_INVALID),assert.isBufferLength2(publicKey,33,65,messages.EC_PUBLIC_KEY_LENGTH_INVALID),assert.isBuffer(tweak,messages.TWEAK_TYPE_INVALID),assert.isBufferLength(tweak,32,messages.TWEAK_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0),secp256k1.publicKeyTweakAdd(publicKey,tweak,compressed)},publicKeyTweakMul:function(publicKey,tweak,compressed){return assert.isBuffer(publicKey,messages.EC_PUBLIC_KEY_TYPE_INVALID),assert.isBufferLength2(publicKey,33,65,messages.EC_PUBLIC_KEY_LENGTH_INVALID),assert.isBuffer(tweak,messages.TWEAK_TYPE_INVALID),assert.isBufferLength(tweak,32,messages.TWEAK_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0),secp256k1.publicKeyTweakMul(publicKey,tweak,compressed)},publicKeyCombine:function(publicKeys,compressed){assert.isArray(publicKeys,messages.EC_PUBLIC_KEYS_TYPE_INVALID),assert.isLengthGTZero(publicKeys,messages.EC_PUBLIC_KEYS_LENGTH_INVALID);for(var i=0;i=0||y.ucmp(BN.p)>=0?null:6!==first&&7!==first||y.isOdd()===(7===first)?0!==x.redSqr().redMul(x).redIAdd7().ucmp(y.redSqr())?null:new ECPoint(x,y):null):(x=BN.fromBuffer(publicKey.slice(1,33)),x.ucmp(BN.p)>=0?null:null===(y=x.redSqr().redMul(x).redIAdd7().redSqrt())?null:(3===first!==y.isOdd()&&(y=y.redNeg()),new ECPoint(x,y)))},ECPoint.prototype.toPublicKey=function(compressed){var publicKey,x=this.x,y=this.y;return compressed?(publicKey=new Buffer(33),publicKey[0]=y.isOdd()?3:2,x.toBuffer().copy(publicKey,1)):(publicKey=new Buffer(65),publicKey[0]=4,x.toBuffer().copy(publicKey,1),y.toBuffer().copy(publicKey,33)),publicKey},ECPoint.fromECJPoint=function(p){if(p.inf)return new ECPoint(null,null);var zinv=p.z.redInvm(),zinv2=zinv.redSqr();return new ECPoint(p.x.redMul(zinv2),p.y.redMul(zinv2).redMul(zinv))},ECPoint.prototype.toECJPoint=function(){return this.inf?new ECJPoint(null,null,null):new ECJPoint(this.x,this.y,ECJPoint.one)},ECPoint.prototype.neg=function(){return this.inf?this:new ECPoint(this.x,this.y.redNeg())},ECPoint.prototype.add=function(p){if(this.inf)return p;if(p.inf)return this;if(0===this.x.ucmp(p.x))return 0===this.y.ucmp(p.y)?this.dbl():new ECPoint(null,null);var s=this.y.redSub(p.y);s.isZero()||(s=s.redMul(this.x.redSub(p.x).redInvm()));var nx=s.redSqr().redISub(this.x).redISub(p.x);return new ECPoint(nx,s.redMul(this.x.redSub(nx)).redISub(this.y))},ECPoint.prototype.dbl=function(){if(this.inf)return this;var yy=this.y.redAdd(this.y);if(yy.isZero())return new ECPoint(null,null);var x2=this.x.redSqr(),s=x2.redAdd(x2).redIAdd(x2).redMul(yy.redInvm()),nx=s.redSqr().redISub(this.x.redAdd(this.x));return new ECPoint(nx,s.redMul(this.x.redSub(nx)).redISub(this.y))},ECPoint.prototype.mul=function(num){for(var nafPoints=this._getNAFPoints(4),points=nafPoints.points,naf=num.getNAF(nafPoints.wnd),acc=new ECJPoint(null,null,null),i=naf.length-1;i>=0;i--){for(var k=0;i>=0&&0===naf[i];i--,++k);if(i>=0&&(k+=1),acc=acc.dblp(k),i<0)break;var z=naf[i];acc=z>0?acc.mixedAdd(points[z-1>>1]):acc.mixedAdd(points[-z-1>>1].neg())}return ECPoint.fromECJPoint(acc)},ECPoint.prototype._getNAFPoints1=function(){return{wnd:1,points:[this]}},ECPoint.prototype._getNAFPoints=function(wnd){var points=new Array((1<>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10)}function sigma1(x){return(x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7)}function gamma0(x){return(x>>>7|x<<25)^(x>>>18|x<<14)^x>>>3}function gamma1(x){return(x>>>17|x<<15)^(x>>>19|x<<13)^x>>>10}var inherits=__webpack_require__(1),Hash=__webpack_require__(69),K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],W=new Array(64);inherits(Sha256,Hash),Sha256.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},Sha256.prototype._update=function(M){for(var W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,f=0|this._f,g=0|this._g,h=0|this._h,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<64;++i)W[i]=gamma1(W[i-2])+W[i-7]+gamma0(W[i-15])+W[i-16]|0;for(var j=0;j<64;++j){var T1=h+sigma1(e)+ch(e,f,g)+K[j]+W[j]|0,T2=sigma0(a)+maj(a,b,c)|0;h=g,g=f,f=e,e=d+T1|0,d=c,c=b,b=a,a=T1+T2|0}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0,this._f=f+this._f|0,this._g=g+this._g|0,this._h=h+this._h|0},Sha256.prototype._hash=function(){var H=new Buffer(32);return H.writeInt32BE(this._a,0),H.writeInt32BE(this._b,4),H.writeInt32BE(this._c,8),H.writeInt32BE(this._d,12),H.writeInt32BE(this._e,16),H.writeInt32BE(this._f,20),H.writeInt32BE(this._g,24),H.writeInt32BE(this._h,28),H},module.exports=Sha256}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Sha512(){this.init(),this._w=W,Hash.call(this,128,112)}function Ch(x,y,z){return z^x&(y^z)}function maj(x,y,z){return x&y|z&(x|y)}function sigma0(x,xl){return(x>>>28|xl<<4)^(xl>>>2|x<<30)^(xl>>>7|x<<25)}function sigma1(x,xl){return(x>>>14|xl<<18)^(x>>>18|xl<<14)^(xl>>>9|x<<23)}function Gamma0(x,xl){return(x>>>1|xl<<31)^(x>>>8|xl<<24)^x>>>7}function Gamma0l(x,xl){return(x>>>1|xl<<31)^(x>>>8|xl<<24)^(x>>>7|xl<<25)}function Gamma1(x,xl){return(x>>>19|xl<<13)^(xl>>>29|x<<3)^x>>>6}function Gamma1l(x,xl){return(x>>>19|xl<<13)^(xl>>>29|x<<3)^(x>>>6|xl<<26)}function getCarry(a,b){return a>>>0>>0?1:0}var inherits=__webpack_require__(1),Hash=__webpack_require__(69),K=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],W=new Array(160);inherits(Sha512,Hash),Sha512.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},Sha512.prototype._update=function(M){for(var W=this._w,ah=0|this._ah,bh=0|this._bh,ch=0|this._ch,dh=0|this._dh,eh=0|this._eh,fh=0|this._fh,gh=0|this._gh,hh=0|this._hh,al=0|this._al,bl=0|this._bl,cl=0|this._cl,dl=0|this._dl,el=0|this._el,fl=0|this._fl,gl=0|this._gl,hl=0|this._hl,i=0;i<32;i+=2)W[i]=M.readInt32BE(4*i),W[i+1]=M.readInt32BE(4*i+4);for(;i<160;i+=2){var xh=W[i-30],xl=W[i-30+1],gamma0=Gamma0(xh,xl),gamma0l=Gamma0l(xl,xh);xh=W[i-4],xl=W[i-4+1];var gamma1=Gamma1(xh,xl),gamma1l=Gamma1l(xl,xh),Wi7h=W[i-14],Wi7l=W[i-14+1],Wi16h=W[i-32],Wi16l=W[i-32+1],Wil=gamma0l+Wi7l|0,Wih=gamma0+Wi7h+getCarry(Wil,gamma0l)|0;Wil=Wil+gamma1l|0,Wih=Wih+gamma1+getCarry(Wil,gamma1l)|0,Wil=Wil+Wi16l|0,Wih=Wih+Wi16h+getCarry(Wil,Wi16l)|0,W[i]=Wih,W[i+1]=Wil}for(var j=0;j<160;j+=2){Wih=W[j],Wil=W[j+1];var majh=maj(ah,bh,ch),majl=maj(al,bl,cl),sigma0h=sigma0(ah,al),sigma0l=sigma0(al,ah),sigma1h=sigma1(eh,el),sigma1l=sigma1(el,eh),Kih=K[j],Kil=K[j+1],chh=Ch(eh,fh,gh),chl=Ch(el,fl,gl),t1l=hl+sigma1l|0,t1h=hh+sigma1h+getCarry(t1l,hl)|0;t1l=t1l+chl|0,t1h=t1h+chh+getCarry(t1l,chl)|0,t1l=t1l+Kil|0,t1h=t1h+Kih+getCarry(t1l,Kil)|0,t1l=t1l+Wil|0,t1h=t1h+Wih+getCarry(t1l,Wil)|0;var t2l=sigma0l+majl|0,t2h=sigma0h+majh+getCarry(t2l,sigma0l)|0;hh=gh,hl=gl,gh=fh,gl=fl,fh=eh,fl=el,el=dl+t1l|0,eh=dh+t1h+getCarry(el,dl)|0,dh=ch,dl=cl,ch=bh,cl=bl,bh=ah,bl=al,al=t1l+t2l|0,ah=t1h+t2h+getCarry(al,t1l)|0}this._al=this._al+al|0,this._bl=this._bl+bl|0,this._cl=this._cl+cl|0,this._dl=this._dl+dl|0,this._el=this._el+el|0,this._fl=this._fl+fl|0,this._gl=this._gl+gl|0,this._hl=this._hl+hl|0,this._ah=this._ah+ah+getCarry(this._al,al)|0,this._bh=this._bh+bh+getCarry(this._bl,bl)|0,this._ch=this._ch+ch+getCarry(this._cl,cl)|0,this._dh=this._dh+dh+getCarry(this._dl,dl)|0,this._eh=this._eh+eh+getCarry(this._el,el)|0,this._fh=this._fh+fh+getCarry(this._fl,fl)|0,this._gh=this._gh+gh+getCarry(this._gl,gl)|0,this._hh=this._hh+hh+getCarry(this._hl,hl)|0},Sha512.prototype._hash=function(){function writeInt64BE(h,l,offset){H.writeInt32BE(h,offset),H.writeInt32BE(l,offset+4)}var H=new Buffer(64);return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),writeInt64BE(this._gh,this._gl,48),writeInt64BE(this._hh,this._hl,56),H},module.exports=Sha512}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(process){function prependListener(emitter,event,fn){if("function"==typeof emitter.prependListener)return emitter.prependListener(event,fn);emitter._events&&emitter._events[event]?isArray(emitter._events[event])?emitter._events[event].unshift(fn):emitter._events[event]=[fn,emitter._events[event]]:emitter.on(event,fn)}function ReadableState(options,stream){Duplex=Duplex||__webpack_require__(70),options=options||{},this.objectMode=!!options.objectMode,stream instanceof Duplex&&(this.objectMode=this.objectMode||!!options.readableObjectMode);var hwm=options.highWaterMark,defaultHwm=this.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:defaultHwm,this.highWaterMark=~~this.highWaterMark,this.buffer=new BufferList,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=options.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(StringDecoder||(StringDecoder=__webpack_require__(18).StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding)}function Readable(options){if(Duplex=Duplex||__webpack_require__(70),!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this),this.readable=!0,options&&"function"==typeof options.read&&(this._read=options.read),Stream.call(this)}function readableAddChunk(stream,state,chunk,encoding,addToFront){var er=chunkInvalid(state,chunk);if(er)stream.emit("error",er);else if(null===chunk)state.reading=!1,onEofChunk(stream,state);else if(state.objectMode||chunk&&chunk.length>0)if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var _e=new Error("stream.unshift() after end event");stream.emit("error",_e)}else{var skipAdd;!state.decoder||addToFront||encoding||(chunk=state.decoder.write(chunk),skipAdd=!state.objectMode&&0===chunk.length),addToFront||(state.reading=!1),skipAdd||(state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream))),maybeReadMore(stream,state)}else addToFront||(state.reading=!1);return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||0===state.length&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}function chunkInvalid(state,chunk){var er=null;return Buffer.isBuffer(chunk)||"string"==typeof chunk||null===chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function onEofChunk(stream,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?processNextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,processNextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return nstr.length?str.length:n;if(ret+=nb===str.length?str:str.slice(0,n),0===(n-=nb)){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=bufferShim.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),0===(n-=nb)){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,processNextTick(endReadableNT,state,stream))}function endReadableNT(state,stream){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}function indexOf(xs,x){for(var i=0,l=xs.length;i=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n0?fromList(n,state):null,null===ret?(state.needReadable=!0,n=0):state.length-=n,0===state.length&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),null!==ret&&this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable){debug("onunpipe"),readable===src&&cleanup()}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",cleanup),src.removeListener("data",ondata),cleanedUp=!0,!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain()}function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1,!1!==dest.write(chunk)||increasedAwaitDrain||((1===state.pipesCount&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EElistenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:cleanup;state.endEmitted?processNextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1,increasedAwaitDrain=!1;return src.on("data",ondata),prependListener(dest,"error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState;if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i-1?setImmediate:processNextTick;Writable.WritableState=WritableState;var util=__webpack_require__(6);util.inherits=__webpack_require__(1);var internalUtil={deprecate:__webpack_require__(72)},Stream=__webpack_require__(319),Buffer=__webpack_require__(0).Buffer,bufferShim=__webpack_require__(14);util.inherits(Writable,Stream),WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(_){}}();var realHasInstance;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return!!realHasInstance.call(this,object)||object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=Buffer.isBuffer(chunk);return"function"==typeof encoding&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),"function"!=typeof cb&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){ -var state=this._writableState;state.corked&&(state.corked--,state.writing||state.corked||state.finished||state.bufferProcessing||!state.bufferedRequest||clearBuffer(this,state))},Writable.prototype.setDefaultEncoding=function(encoding){if("string"==typeof encoding&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this},Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;"function"==typeof chunk?(cb=chunk,chunk=null,encoding=null):"function"==typeof encoding&&(cb=encoding,encoding=null),null!==chunk&&void 0!==chunk&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||state.finished||endWritable(this,state,cb)}}).call(exports,__webpack_require__(2),__webpack_require__(22).setImmediate)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(8).EventEmitter},function(module,exports,__webpack_require__){"use strict";var transport=__webpack_require__(21),base=transport.protocol.base;exports.FRAME_HEADER_SIZE=8,exports.PING_OPAQUE_SIZE=4,exports.MAX_CONCURRENT_STREAMS=1/0,exports.DEFAULT_MAX_HEADER_LIST_SIZE=1/0,exports.DEFAULT_WEIGHT=16,exports.frameType={SYN_STREAM:1,SYN_REPLY:2,RST_STREAM:3,SETTINGS:4,PING:6,GOAWAY:7,HEADERS:8,WINDOW_UPDATE:9,X_FORWARDED_FOR:61440},exports.flags={FLAG_FIN:1,FLAG_COMPRESSED:2,FLAG_UNIDIRECTIONAL:2},exports.error={PROTOCOL_ERROR:1,INVALID_STREAM:2,REFUSED_STREAM:3,UNSUPPORTED_VERSION:4,CANCEL:5,INTERNAL_ERROR:6,FLOW_CONTROL_ERROR:7,STREAM_IN_USE:8,STREAM_CLOSED:9,INVALID_CREDENTIALS:10,FRAME_TOO_LARGE:11},exports.errorByCode=base.utils.reverse(exports.error),exports.settings={FLAG_SETTINGS_PERSIST_VALUE:1,FLAG_SETTINGS_PERSISTED:2,SETTINGS_UPLOAD_BANDWIDTH:1,SETTINGS_DOWNLOAD_BANDWIDTH:2,SETTINGS_ROUND_TRIP_TIME:3,SETTINGS_MAX_CONCURRENT_STREAMS:4,SETTINGS_CURRENT_CWND:5,SETTINGS_DOWNLOAD_RETRANS_RATE:6,SETTINGS_INITIAL_WINDOW_SIZE:7,SETTINGS_CLIENT_CERTIFICATE_VECTOR_SIZE:8},exports.settingsIndex=[null,"upload_bandwidth","download_bandwidth","round_trip_time","max_concurrent_streams","current_cwnd","download_retrans_rate","initial_window_size","client_certificate_vector_size"],exports.DEFAULT_WINDOW=65536,exports.MAX_INITIAL_WINDOW_SIZE=2147483647,exports.goaway={OK:0,PROTOCOL_ERROR:1,INTERNAL_ERROR:2},exports.goawayByCode=base.utils.reverse(exports.goaway),exports.statusReason={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},function(module,exports,__webpack_require__){"use strict";exports.name="spdy",exports.dictionary=__webpack_require__(797),exports.constants=__webpack_require__(320),exports.parser=__webpack_require__(799),exports.framer=__webpack_require__(798),exports.compressionPool=__webpack_require__(800)},function(module,exports,__webpack_require__){"use strict";(function(process){function prependListener(emitter,event,fn){if("function"==typeof emitter.prependListener)return emitter.prependListener(event,fn);emitter._events&&emitter._events[event]?isArray(emitter._events[event])?emitter._events[event].unshift(fn):emitter._events[event]=[fn,emitter._events[event]]:emitter.on(event,fn)}function ReadableState(options,stream){Duplex=Duplex||__webpack_require__(71),options=options||{},this.objectMode=!!options.objectMode,stream instanceof Duplex&&(this.objectMode=this.objectMode||!!options.readableObjectMode);var hwm=options.highWaterMark,defaultHwm=this.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:defaultHwm,this.highWaterMark=~~this.highWaterMark,this.buffer=new BufferList,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=options.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(StringDecoder||(StringDecoder=__webpack_require__(18).StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding)}function Readable(options){if(Duplex=Duplex||__webpack_require__(71),!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this),this.readable=!0,options&&"function"==typeof options.read&&(this._read=options.read),Stream.call(this)}function readableAddChunk(stream,state,chunk,encoding,addToFront){var er=chunkInvalid(state,chunk);if(er)stream.emit("error",er);else if(null===chunk)state.reading=!1,onEofChunk(stream,state);else if(state.objectMode||chunk&&chunk.length>0)if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var _e=new Error("stream.unshift() after end event");stream.emit("error",_e)}else{var skipAdd;!state.decoder||addToFront||encoding||(chunk=state.decoder.write(chunk),skipAdd=!state.objectMode&&0===chunk.length),addToFront||(state.reading=!1),skipAdd||(state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream))),maybeReadMore(stream,state)}else addToFront||(state.reading=!1);return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||0===state.length&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}function chunkInvalid(state,chunk){var er=null;return Buffer.isBuffer(chunk)||"string"==typeof chunk||null===chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function onEofChunk(stream,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?processNextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,processNextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return nstr.length?str.length:n;if(ret+=nb===str.length?str:str.slice(0,n),0===(n-=nb)){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=bufferShim.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),0===(n-=nb)){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,processNextTick(endReadableNT,state,stream))}function endReadableNT(state,stream){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}function indexOf(xs,x){for(var i=0,l=xs.length;i=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n0?fromList(n,state):null,null===ret?(state.needReadable=!0,n=0):state.length-=n,0===state.length&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),null!==ret&&this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable){debug("onunpipe"),readable===src&&cleanup()}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",cleanup),src.removeListener("data",ondata),cleanedUp=!0,!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain()}function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1,!1!==dest.write(chunk)||increasedAwaitDrain||((1===state.pipesCount&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EElistenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:cleanup;state.endEmitted?processNextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1,increasedAwaitDrain=!1;return src.on("data",ondata),prependListener(dest,"error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState;if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i-1?setImmediate:processNextTick;Writable.WritableState=WritableState;var util=__webpack_require__(6);util.inherits=__webpack_require__(1);var internalUtil={deprecate:__webpack_require__(72)},Stream=__webpack_require__(325),Buffer=__webpack_require__(0).Buffer,bufferShim=__webpack_require__(14);util.inherits(Writable,Stream),WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(_){}}();var realHasInstance;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return!!realHasInstance.call(this,object)||object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=Buffer.isBuffer(chunk);return"function"==typeof encoding&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),"function"!=typeof cb&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,state.writing||state.corked||state.finished||state.bufferProcessing||!state.bufferedRequest||clearBuffer(this,state))},Writable.prototype.setDefaultEncoding=function(encoding){if("string"==typeof encoding&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this},Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;"function"==typeof chunk?(cb=chunk,chunk=null,encoding=null):"function"==typeof encoding&&(cb=encoding,encoding=null),null!==chunk&&void 0!==chunk&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||state.finished||endWritable(this,state,cb)}}).call(exports,__webpack_require__(2),__webpack_require__(22).setImmediate)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(8).EventEmitter},function(module,exports,__webpack_require__){"use strict";(function(process){function prependListener(emitter,event,fn){if("function"==typeof emitter.prependListener)return emitter.prependListener(event,fn);emitter._events&&emitter._events[event]?isArray(emitter._events[event])?emitter._events[event].unshift(fn):emitter._events[event]=[fn,emitter._events[event]]:emitter.on(event,fn)}function ReadableState(options,stream){Duplex=Duplex||__webpack_require__(53),options=options||{},this.objectMode=!!options.objectMode,stream instanceof Duplex&&(this.objectMode=this.objectMode||!!options.readableObjectMode);var hwm=options.highWaterMark,defaultHwm=this.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:defaultHwm,this.highWaterMark=~~this.highWaterMark,this.buffer=new BufferList,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=options.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(StringDecoder||(StringDecoder=__webpack_require__(18).StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding)}function Readable(options){if(Duplex=Duplex||__webpack_require__(53),!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this),this.readable=!0,options&&"function"==typeof options.read&&(this._read=options.read),Stream.call(this)}function readableAddChunk(stream,state,chunk,encoding,addToFront){var er=chunkInvalid(state,chunk);if(er)stream.emit("error",er);else if(null===chunk)state.reading=!1,onEofChunk(stream,state);else if(state.objectMode||chunk&&chunk.length>0)if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var _e=new Error("stream.unshift() after end event");stream.emit("error",_e)}else{var skipAdd;!state.decoder||addToFront||encoding||(chunk=state.decoder.write(chunk),skipAdd=!state.objectMode&&0===chunk.length),addToFront||(state.reading=!1),skipAdd||(state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream))),maybeReadMore(stream,state)}else addToFront||(state.reading=!1);return needMoreData(state)}function needMoreData(state){ -return!state.ended&&(state.needReadable||state.length=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||0===state.length&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}function chunkInvalid(state,chunk){var er=null;return Buffer.isBuffer(chunk)||"string"==typeof chunk||null===chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function onEofChunk(stream,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?processNextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,processNextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return nstr.length?str.length:n;if(ret+=nb===str.length?str:str.slice(0,n),0===(n-=nb)){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=bufferShim.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),0===(n-=nb)){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,processNextTick(endReadableNT,state,stream))}function endReadableNT(state,stream){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}function indexOf(xs,x){for(var i=0,l=xs.length;i=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n0?fromList(n,state):null,null===ret?(state.needReadable=!0,n=0):state.length-=n,0===state.length&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),null!==ret&&this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable){debug("onunpipe"),readable===src&&cleanup()}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",cleanup),src.removeListener("data",ondata),cleanedUp=!0,!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain()}function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1,!1!==dest.write(chunk)||increasedAwaitDrain||((1===state.pipesCount&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EElistenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:cleanup;state.endEmitted?processNextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1,increasedAwaitDrain=!1;return src.on("data",ondata),prependListener(dest,"error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState;if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i2&&(prv=!0,info.shift());var jwk={ext:!0};switch(info[0][0]){case"1.2.840.113549.1.1.1":var rsaComp=["n","e","d","p","q","dp","dq","qi"],rsaKey=b2der(info[1]);prv&&rsaKey.shift();for(var i=0;i2&&(prv=!0,rsaKey.unshift(new Uint8Array([0]))),info[0][0]="1.2.840.113549.1.1.1",key=rsaKey;break;default:throw new TypeError("Unsupported key type")}return info.push(new Uint8Array(der2b(key)).buffer),prv?info.unshift(new Uint8Array([0])):info[1]={tag:3,value:info[1]},new Uint8Array(der2b(info)).buffer}function b2der(buf,ctx){if(buf instanceof ArrayBuffer&&(buf=new Uint8Array(buf)),ctx||(ctx={pos:0,end:buf.length}),ctx.end-ctx.pos<2||ctx.end>buf.length)throw new RangeError("Malformed DER");var tag=buf[ctx.pos++],len=buf[ctx.pos++];if(len>=128){if(len&=127,ctx.end-ctx.pos=128){var xlen=len,len=4;for(buf.splice(pos,0,xlen>>24&255,xlen>>16&255,xlen>>8&255,255&xlen);len>1&&!(xlen>>24);)xlen<<=8,len--;len<4&&buf.splice(pos,4-len),len|=128}return buf.splice(pos-2,2,tag,len),buf}function CryptoKey(key,alg,ext,use){Object.defineProperties(this,{_key:{value:key},type:{value:key.type,enumerable:!0},extractable:{value:void 0===ext?key.extractable:ext,enumerable:!0},algorithm:{value:void 0===alg?key.algorithm:alg,enumerable:!0},usages:{value:void 0===use?key.usages:use,enumerable:!0}})}function isPubKeyUse(u){return"verify"===u||"encrypt"===u||"wrapKey"===u}function isPrvKeyUse(u){return"sign"===u||"decrypt"===u||"unwrapKey"===u}if("function"!=typeof Promise)throw"Promise support required";var _crypto=global.crypto||global.msCrypto;if(_crypto){var _subtle=_crypto.subtle||_crypto.webkitSubtle;if(_subtle){var _Crypto=global.Crypto||_crypto.constructor||Object,_SubtleCrypto=global.SubtleCrypto||_subtle.constructor||Object,isEdge=(global.CryptoKey||global.Key||Object,global.navigator.userAgent.indexOf("Edge/")>-1),isIE=!!global.msCrypto&&!isEdge,isWebkit=!!_crypto.webkitSubtle;if(isIE||isWebkit){var oid2str={KoZIhvcNAQEB:"1.2.840.113549.1.1.1"},str2oid={"1.2.840.113549.1.1.1":"KoZIhvcNAQEB"};if(["generateKey","importKey","unwrapKey"].forEach(function(m){var _fn=_subtle[m];_subtle[m]=function(a,b,c){var ka,kx,ku,args=[].slice.call(arguments);switch(m){case"generateKey":ka=alg(a),kx=b,ku=c;break;case"importKey":ka=alg(c),kx=args[3],ku=args[4],"jwk"===a&&(b=b2jwk(b),b.alg||(b.alg=jwkAlg(ka)),b.key_ops||(b.key_ops="oct"!==b.kty?"d"in b?ku.filter(isPrvKeyUse):ku.filter(isPubKeyUse):ku.slice()),args[1]=jwk2b(b));break;case"unwrapKey":ka=args[4],kx=args[5],ku=args[6],args[2]=c._key}if("generateKey"===m&&"HMAC"===ka.name&&ka.hash)return ka.length=ka.length||{"SHA-1":512,"SHA-256":512,"SHA-384":1024,"SHA-512":1024}[ka.hash.name],_subtle.importKey("raw",_crypto.getRandomValues(new Uint8Array(ka.length+7>>3)),ka,kx,ku);if(isWebkit&&"generateKey"===m&&"RSASSA-PKCS1-v1_5"===ka.name&&(!ka.modulusLength||ka.modulusLength>=2048))return a=alg(a),a.name="RSAES-PKCS1-v1_5",delete a.hash,_subtle.generateKey(a,!0,["encrypt","decrypt"]).then(function(k){return Promise.all([_subtle.exportKey("jwk",k.publicKey),_subtle.exportKey("jwk",k.privateKey)])}).then(function(keys){return keys[0].alg=keys[1].alg=jwkAlg(ka),keys[0].key_ops=ku.filter(isPubKeyUse),keys[1].key_ops=ku.filter(isPrvKeyUse),Promise.all([_subtle.importKey("jwk",keys[0],ka,!0,keys[0].key_ops),_subtle.importKey("jwk",keys[1],ka,kx,keys[1].key_ops)])}).then(function(keys){return{publicKey:keys[0],privateKey:keys[1]}});if((isWebkit||isIE&&"SHA-1"===(ka.hash||{}).name)&&"importKey"===m&&"jwk"===a&&"HMAC"===ka.name&&"oct"===b.kty)return _subtle.importKey("raw",s2b(a2s(b.k)),c,args[3],args[4]);if(isWebkit&&"importKey"===m&&("spki"===a||"pkcs8"===a))return _subtle.importKey("jwk",pkcs2jwk(b),c,args[3],args[4]);if(isIE&&"unwrapKey"===m)return _subtle.decrypt(args[3],c,b).then(function(k){return _subtle.importKey(a,k,args[4],args[5],args[6])});var op;try{op=_fn.apply(_subtle,args)}catch(e){return Promise.reject(e)}return isIE&&(op=new Promise(function(res,rej){op.onabort=op.onerror=function(e){rej(e)},op.oncomplete=function(r){res(r.target.result)}})),op=op.then(function(k){return"HMAC"===ka.name&&(ka.length||(ka.length=8*k.algorithm.length)),0==ka.name.search("RSA")&&(ka.modulusLength||(ka.modulusLength=(k.publicKey||k).algorithm.modulusLength),ka.publicExponent||(ka.publicExponent=(k.publicKey||k).algorithm.publicExponent)),k=k.publicKey&&k.privateKey?{publicKey:new CryptoKey(k.publicKey,ka,kx,ku.filter(isPubKeyUse)),privateKey:new CryptoKey(k.privateKey,ka,kx,ku.filter(isPrvKeyUse))}:new CryptoKey(k,ka,kx,ku)})}}),["exportKey","wrapKey"].forEach(function(m){var _fn=_subtle[m];_subtle[m]=function(a,b,c){var args=[].slice.call(arguments);switch(m){case"exportKey":args[1]=b._key;break;case"wrapKey":args[1]=b._key,args[2]=c._key}if((isWebkit||isIE&&"SHA-1"===(b.algorithm.hash||{}).name)&&"exportKey"===m&&"jwk"===a&&"HMAC"===b.algorithm.name&&(args[0]="raw"),!isWebkit||"exportKey"!==m||"spki"!==a&&"pkcs8"!==a||(args[0]="jwk"),isIE&&"wrapKey"===m)return _subtle.exportKey(a,b).then(function(k){return"jwk"===a&&(k=s2b(unescape(encodeURIComponent(JSON.stringify(b2jwk(k)))))),_subtle.encrypt(args[3],c,k)});var op;try{op=_fn.apply(_subtle,args)}catch(e){return Promise.reject(e)}return isIE&&(op=new Promise(function(res,rej){op.onabort=op.onerror=function(e){rej(e)},op.oncomplete=function(r){res(r.target.result)}})),"exportKey"===m&&"jwk"===a&&(op=op.then(function(k){return(isWebkit||isIE&&"SHA-1"===(b.algorithm.hash||{}).name)&&"HMAC"===b.algorithm.name?{kty:"oct",alg:jwkAlg(b.algorithm),key_ops:b.usages.slice(),ext:!0,k:s2a(b2s(k))}:(k=b2jwk(k),k.alg||(k.alg=jwkAlg(b.algorithm)),k.key_ops||(k.key_ops="public"===b.type?b.usages.filter(isPubKeyUse):"private"===b.type?b.usages.filter(isPrvKeyUse):b.usages.slice()),k)})),!isWebkit||"exportKey"!==m||"spki"!==a&&"pkcs8"!==a||(op=op.then(function(k){return k=jwk2pkcs(b2jwk(k))})),op}}),["encrypt","decrypt","sign","verify"].forEach(function(m){var _fn=_subtle[m];_subtle[m]=function(a,b,c,d){if(isIE&&(!c.byteLength||d&&!d.byteLength))throw new Error("Empy input is not allowed");var args=[].slice.call(arguments),ka=alg(a);if(isIE&&"decrypt"===m&&"AES-GCM"===ka.name){var tl=a.tagLength>>3;args[2]=(c.buffer||c).slice(0,c.byteLength-tl),a.tag=(c.buffer||c).slice(c.byteLength-tl)}args[1]=b._key;var op;try{op=_fn.apply(_subtle,args)}catch(e){return Promise.reject(e)}return isIE&&(op=new Promise(function(res,rej){op.onabort=op.onerror=function(e){rej(e)},op.oncomplete=function(r){var r=r.target.result;if("encrypt"===m&&r instanceof AesGcmEncryptResult){var c=r.ciphertext,t=r.tag;r=new Uint8Array(c.byteLength+t.byteLength),r.set(new Uint8Array(c),0),r.set(new Uint8Array(t),c.byteLength),r=r.buffer}res(r)}})),op}}),isIE){var _digest=_subtle.digest;_subtle.digest=function(a,b){if(!b.byteLength)throw new Error("Empy input is not allowed");var op;try{op=_digest.call(_subtle,a,b)}catch(e){return Promise.reject(e)}return op=new Promise(function(res,rej){op.onabort=op.onerror=function(e){rej(e)},op.oncomplete=function(r){res(r.target.result)}})},global.crypto=Object.create(_crypto,{getRandomValues:{value:function(a){return _crypto.getRandomValues(a)}},subtle:{value:_subtle}}),global.CryptoKey=CryptoKey}isWebkit&&(_crypto.subtle=_subtle,global.Crypto=_Crypto,global.SubtleCrypto=_SubtleCrypto,global.CryptoKey=CryptoKey)}}}}},function(module,exports){function wrappy(fn,cb){function wrapper(){for(var args=new Array(arguments.length),i=0;i0);return encoded}function decode(str){var decoded=0;for(i=0;ibytes&&(end=bytes),start>=bytes||start>=end||0===bytes)return new ArrayBuffer(0);for(var abv=new Uint8Array(arraybuffer),result=new Uint8Array(end-start),i=start,ii=0;i=0&&workersList.splice(index),task.callback.apply(task,arguments),null!=err&&q.error(err,task.data)}numRunning<=q.concurrency-q.buffer&&q.unsaturated(),q.idle()&&q.drain(),q.process()}}if(null==concurrency)concurrency=1;else if(0===concurrency)throw new Error("Concurrency must not be zero");var _worker=(0,_wrapAsync2.default)(worker),numRunning=0,workersList=[],isProcessing=!1,q={_tasks:new _DoublyLinkedList2.default,concurrency:concurrency,payload:payload,saturated:_noop2.default,unsaturated:_noop2.default,buffer:concurrency/4,empty:_noop2.default,drain:_noop2.default,error:_noop2.default,started:!1,paused:!1,push:function(data,callback){_insert(data,!1,callback)},kill:function(){q.drain=_noop2.default,q._tasks.empty()},unshift:function(data,callback){_insert(data,!0,callback)},remove:function(testFn){q._tasks.remove(testFn)},process:function(){if(!isProcessing){for(isProcessing=!0;!q.paused&&numRunning0&&opts.jitter<=1?opts.jitter:0,this.attempts=0}module.exports=Backoff,Backoff.prototype.duration=function(){var ms=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var rand=Math.random(),deviation=Math.floor(rand*this.jitter*ms);ms=0==(1&Math.floor(10*rand))?ms-deviation:ms+deviation}return 0|Math.min(ms,this.max)},Backoff.prototype.reset=function(){this.attempts=0},Backoff.prototype.setMin=function(min){this.ms=min},Backoff.prototype.setMax=function(max){this.max=max},Backoff.prototype.setJitter=function(jitter){this.jitter=jitter}},function(module,exports,__webpack_require__){(function(Buffer){module.exports=function(ALPHABET){function encode(source){if(0===source.length)return"";for(var digits=[0],i=0;i0;)digits.push(carry%BASE),carry=carry/BASE|0}for(var string="",k=0;0===source[k]&&k=0;--q)string+=ALPHABET[digits[q]];return string}function decodeUnsafe(string){if(0===string.length)return Buffer.allocUnsafe(0);for(var bytes=[0],i=0;i>=8;for(;carry>0;)bytes.push(255&carry),carry>>=8}for(var k=0;string[k]===LEADER&&k>2],base64+=chars[(3&bytes[i])<<4|bytes[i+1]>>4],base64+=chars[(15&bytes[i+1])<<2|bytes[i+2]>>6],base64+=chars[63&bytes[i+2]];return len%3==2?base64=base64.substring(0,base64.length-1)+"=":len%3==1&&(base64=base64.substring(0,base64.length-2)+"=="),base64},exports.decode=function(base64){var i,encoded1,encoded2,encoded3,encoded4,bufferLength=.75*base64.length,len=base64.length,p=0;"="===base64[base64.length-1]&&(bufferLength--,"="===base64[base64.length-2]&&bufferLength--);var arraybuffer=new ArrayBuffer(bufferLength),bytes=new Uint8Array(arraybuffer);for(i=0;i>4,bytes[p++]=(15&encoded2)<<4|encoded3>>2,bytes[p++]=(3&encoded3)<<6|63&encoded4;return arraybuffer}}()},function(module,exports,__webpack_require__){"use strict";function placeHoldersCount(b64){var len=b64.length;if(len%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===b64[len-2]?2:"="===b64[len-1]?1:0}function byteLength(b64){return 3*b64.length/4-placeHoldersCount(b64)}function toByteArray(b64){var i,j,l,tmp,placeHolders,arr,len=b64.length;placeHolders=placeHoldersCount(b64),arr=new Arr(3*len/4-placeHolders),l=placeHolders>0?len-4:len;var L=0;for(i=0,j=0;i>16&255,arr[L++]=tmp>>8&255,arr[L++]=255&tmp;return 2===placeHolders?(tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4,arr[L++]=255&tmp):1===placeHolders&&(tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2,arr[L++]=tmp>>8&255,arr[L++]=255&tmp),arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[63&num]}function encodeChunk(uint8,start,end){for(var tmp,output=[],i=start;ilen2?len2:i+16383));return 1===extraBytes?(tmp=uint8[len-1],output+=lookup[tmp>>2],output+=lookup[tmp<<4&63],output+="=="):2===extraBytes&&(tmp=(uint8[len-2]<<8)+uint8[len-1],output+=lookup[tmp>>10],output+=lookup[tmp>>4&63],output+=lookup[tmp<<2&63],output+="="),parts.push(output),parts.join("")}exports.byteLength=byteLength,exports.toByteArray=toByteArray,exports.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i72)return!1;if(48!==buffer[0])return!1;if(buffer[1]!==buffer.length-2)return!1;if(2!==buffer[2])return!1;var lenR=buffer[3];if(0===lenR)return!1;if(5+lenR>=buffer.length)return!1;if(2!==buffer[4+lenR])return!1;var lenS=buffer[5+lenR];return 0!==lenS&&(6+lenR+lenS===buffer.length&&(!(128&buffer[4])&&(!(lenR>1&&0===buffer[4]&&!(128&buffer[5]))&&(!(128&buffer[lenR+6])&&!(lenS>1&&0===buffer[lenR+6]&&!(128&buffer[lenR+7]))))))}function decode(buffer){if(buffer.length<8)throw new Error("DER sequence length is too short");if(buffer.length>72)throw new Error("DER sequence length is too long");if(48!==buffer[0])throw new Error("Expected DER sequence");if(buffer[1]!==buffer.length-2)throw new Error("DER sequence length is invalid");if(2!==buffer[2])throw new Error("Expected DER integer");var lenR=buffer[3];if(0===lenR)throw new Error("R length is zero");if(5+lenR>=buffer.length)throw new Error("R length is too long");if(2!==buffer[4+lenR])throw new Error("Expected DER integer (2)");var lenS=buffer[5+lenR];if(0===lenS)throw new Error("S length is zero");if(6+lenR+lenS!==buffer.length)throw new Error("S length is invalid");if(128&buffer[4])throw new Error("R value is negative");if(lenR>1&&0===buffer[4]&&!(128&buffer[5]))throw new Error("R value excessively padded");if(128&buffer[lenR+6])throw new Error("S value is negative");if(lenS>1&&0===buffer[lenR+6]&&!(128&buffer[lenR+7]))throw new Error("S value excessively padded");return{r:buffer.slice(4,4+lenR),s:buffer.slice(6+lenR)}}function encode(r,s){var lenR=r.length,lenS=s.length;if(0===lenR)throw new Error("R length is zero");if(0===lenS)throw new Error("S length is zero");if(lenR>33)throw new Error("R length is too long");if(lenS>33)throw new Error("S length is too long");if(128&r[0])throw new Error("R value is negative");if(128&s[0])throw new Error("S value is negative");if(lenR>1&&0===r[0]&&!(128&r[1]))throw new Error("R value excessively padded");if(lenS>1&&0===s[0]&&!(128&s[1]))throw new Error("S value excessively padded");var signature=Buffer.allocUnsafe(6+lenR+lenS);return signature[0]=48,signature[1]=signature.length-2,signature[2]=2,signature[3]=r.length,r.copy(signature,4),signature[4+lenR]=2,signature[5+lenR]=s.length,s.copy(signature,6+lenR),signature}var Buffer=__webpack_require__(13).Buffer;module.exports={check:check,decode:decode,encode:encode}},function(module,exports,__webpack_require__){function ADD64AA(v,a,b){var o0=v[a]+v[b],o1=v[a+1]+v[b+1];o0>=4294967296&&o1++,v[a]=o0,v[a+1]=o1}function ADD64AC(v,a,b0,b1){var o0=v[a]+b0;b0<0&&(o0+=4294967296);var o1=v[a+1]+b1;o0>=4294967296&&o1++,v[a]=o0,v[a+1]=o1}function B2B_GET32(arr,i){return arr[i]^arr[i+1]<<8^arr[i+2]<<16^arr[i+3]<<24}function B2B_G(a,b,c,d,ix,iy){var x0=m[ix],x1=m[ix+1],y0=m[iy],y1=m[iy+1];ADD64AA(v,a,b),ADD64AC(v,a,x0,x1);var xor0=v[d]^v[a],xor1=v[d+1]^v[a+1];v[d]=xor1,v[d+1]=xor0,ADD64AA(v,c,d),xor0=v[b]^v[c],xor1=v[b+1]^v[c+1],v[b]=xor0>>>24^xor1<<8,v[b+1]=xor1>>>24^xor0<<8,ADD64AA(v,a,b),ADD64AC(v,a,y0,y1),xor0=v[d]^v[a],xor1=v[d+1]^v[a+1],v[d]=xor0>>>16^xor1<<16,v[d+1]=xor1>>>16^xor0<<16,ADD64AA(v,c,d),xor0=v[b]^v[c],xor1=v[b+1]^v[c+1],v[b]=xor1>>>31^xor0<<1,v[b+1]=xor0>>>31^xor1<<1}function blake2bCompress(ctx,last){var i=0;for(i=0;i<16;i++)v[i]=ctx.h[i],v[i+16]=BLAKE2B_IV32[i];for(v[24]=v[24]^ctx.t,v[25]=v[25]^ctx.t/4294967296,last&&(v[28]=~v[28],v[29]=~v[29]),i=0;i<32;i++)m[i]=B2B_GET32(ctx.b,4*i);for(i=0;i<12;i++)B2B_G(0,8,16,24,SIGMA82[16*i+0],SIGMA82[16*i+1]),B2B_G(2,10,18,26,SIGMA82[16*i+2],SIGMA82[16*i+3]),B2B_G(4,12,20,28,SIGMA82[16*i+4],SIGMA82[16*i+5]),B2B_G(6,14,22,30,SIGMA82[16*i+6],SIGMA82[16*i+7]),B2B_G(0,10,20,30,SIGMA82[16*i+8],SIGMA82[16*i+9]),B2B_G(2,12,22,24,SIGMA82[16*i+10],SIGMA82[16*i+11]),B2B_G(4,14,16,26,SIGMA82[16*i+12],SIGMA82[16*i+13]),B2B_G(6,8,18,28,SIGMA82[16*i+14],SIGMA82[16*i+15]);for(i=0;i<16;i++)ctx.h[i]=ctx.h[i]^v[i]^v[i+16]}function blake2bInit(outlen,key){if(0===outlen||outlen>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(key&&key.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");for(var ctx={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:outlen},i=0;i<16;i++)ctx.h[i]=BLAKE2B_IV32[i];var keylen=key?key.length:0;return ctx.h[0]^=16842752^keylen<<8^outlen,key&&(blake2bUpdate(ctx,key),ctx.c=128),ctx}function blake2bUpdate(ctx,input){for(var i=0;i>2]>>8*(3&i);return out}function blake2b(input,key,outlen){outlen=outlen||64,input=util.normalizeInput(input);var ctx=blake2bInit(outlen,key);return blake2bUpdate(ctx,input),blake2bFinal(ctx)}function blake2bHex(input,key,outlen){var output=blake2b(input,key,outlen);return util.toHex(output)}var util=__webpack_require__(183),BLAKE2B_IV32=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),SIGMA8=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],SIGMA82=new Uint8Array(SIGMA8.map(function(x){return 2*x})),v=new Uint32Array(32),m=new Uint32Array(32);module.exports={blake2b:blake2b,blake2bHex:blake2bHex,blake2bInit:blake2bInit,blake2bUpdate:blake2bUpdate,blake2bFinal:blake2bFinal}},function(module,exports,__webpack_require__){function B2S_GET32(v,i){return v[i]^v[i+1]<<8^v[i+2]<<16^v[i+3]<<24}function B2S_G(a,b,c,d,x,y){v[a]=v[a]+v[b]+x,v[d]=ROTR32(v[d]^v[a],16),v[c]=v[c]+v[d],v[b]=ROTR32(v[b]^v[c],12),v[a]=v[a]+v[b]+y,v[d]=ROTR32(v[d]^v[a],8),v[c]=v[c]+v[d],v[b]=ROTR32(v[b]^v[c],7)}function ROTR32(x,y){return x>>>y^x<<32-y}function blake2sCompress(ctx,last){var i=0;for(i=0;i<8;i++)v[i]=ctx.h[i],v[i+8]=BLAKE2S_IV[i];for(v[12]^=ctx.t,v[13]^=ctx.t/4294967296,last&&(v[14]=~v[14]),i=0;i<16;i++)m[i]=B2S_GET32(ctx.b,4*i);for(i=0;i<10;i++)B2S_G(0,4,8,12,m[SIGMA[16*i+0]],m[SIGMA[16*i+1]]),B2S_G(1,5,9,13,m[SIGMA[16*i+2]],m[SIGMA[16*i+3]]),B2S_G(2,6,10,14,m[SIGMA[16*i+4]],m[SIGMA[16*i+5]]),B2S_G(3,7,11,15,m[SIGMA[16*i+6]],m[SIGMA[16*i+7]]),B2S_G(0,5,10,15,m[SIGMA[16*i+8]],m[SIGMA[16*i+9]]),B2S_G(1,6,11,12,m[SIGMA[16*i+10]],m[SIGMA[16*i+11]]),B2S_G(2,7,8,13,m[SIGMA[16*i+12]],m[SIGMA[16*i+13]]),B2S_G(3,4,9,14,m[SIGMA[16*i+14]],m[SIGMA[16*i+15]]);for(i=0;i<8;i++)ctx.h[i]^=v[i]^v[i+8]}function blake2sInit(outlen,key){if(!(outlen>0&&outlen<=32))throw new Error("Incorrect output length, should be in [1, 32]");var keylen=key?key.length:0;if(key&&!(keylen>0&&keylen<=32))throw new Error("Incorrect key length, should be in [1, 32]");var ctx={h:new Uint32Array(BLAKE2S_IV),b:new Uint32Array(64),c:0,t:0,outlen:outlen};return ctx.h[0]^=16842752^keylen<<8^outlen,keylen>0&&(blake2sUpdate(ctx,key),ctx.c=64),ctx}function blake2sUpdate(ctx,input){for(var i=0;i>2]>>8*(3&i)&255;return out}function blake2s(input,key,outlen){outlen=outlen||32,input=util.normalizeInput(input);var ctx=blake2sInit(outlen,key);return blake2sUpdate(ctx,input),blake2sFinal(ctx)}function blake2sHex(input,key,outlen){var output=blake2s(input,key,outlen);return util.toHex(output)}var util=__webpack_require__(183),BLAKE2S_IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SIGMA=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),v=new Uint32Array(16),m=new Uint32Array(16);module.exports={blake2s:blake2s,blake2sHex:blake2sHex,blake2sInit:blake2sInit,blake2sUpdate:blake2sUpdate,blake2sFinal:blake2sFinal}},function(module,exports,__webpack_require__){var b2b=__webpack_require__(364),b2s=__webpack_require__(365);module.exports={blake2b:b2b.blake2b,blake2bHex:b2b.blake2bHex,blake2bInit:b2b.blake2bInit,blake2bUpdate:b2b.blake2bUpdate,blake2bFinal:b2b.blake2bFinal,blake2s:b2s.blake2s,blake2sHex:b2s.blake2sHex,blake2sInit:b2s.blake2sInit,blake2sUpdate:b2s.blake2sUpdate,blake2sFinal:b2s.blake2sFinal}},function(module,exports,__webpack_require__){(function(global){function mapArrayBufferViews(ary){for(var i=0;i0){break}}return code|0}function checkOffset(n){n=n|0;if(((offset|0)+(n|0)|0)<(inputLength|0)){return 0}return 1}function readUInt16(n){n=n|0;return heap[n|0]<<8|heap[n+1|0]|0}function INT_P(octet){octet=octet|0;pushInt(octet|0);offset=offset+1|0;return 0}function UINT_P_8(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushInt(heap[offset+1|0]|0);offset=offset+2|0;return 0}function UINT_P_16(octet){octet=octet|0;if(checkOffset(2)|0){return 1}pushInt(readUInt16(offset+1|0)|0);offset=offset+3|0;return 0}function UINT_P_32(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushInt32(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function UINT_P_64(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushInt64(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function INT_N(octet){octet=octet|0;pushInt(-1-(octet-32|0)|0);offset=offset+1|0;return 0}function UINT_N_8(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushInt(-1-(heap[offset+1|0]|0)|0);offset=offset+2|0;return 0}function UINT_N_16(octet){octet=octet|0;var val=0;if(checkOffset(2)|0){return 1}val=readUInt16(offset+1|0)|0;pushInt(-1-(val|0)|0);offset=offset+3|0;return 0}function UINT_N_32(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushInt32Neg(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function UINT_N_64(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushInt64Neg(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function BYTE_STRING(octet){octet=octet|0;var start=0;var end=0;var step=0;step=octet-64|0;if(checkOffset(step|0)|0){return 1}start=offset+1|0;end=(offset+1|0)+(step|0)|0;pushByteString(start|0,end|0);offset=end|0;return 0}function BYTE_STRING_8(octet){octet=octet|0;var start=0;var end=0;var length=0;if(checkOffset(1)|0){return 1}length=heap[offset+1|0]|0;start=offset+2|0;end=(offset+2|0)+(length|0)|0;if(checkOffset(length+1|0)|0){return 1}pushByteString(start|0,end|0);offset=end|0;return 0}function BYTE_STRING_16(octet){octet=octet|0;var start=0;var end=0;var length=0;if(checkOffset(2)|0){return 1}length=readUInt16(offset+1|0)|0;start=offset+3|0;end=(offset+3|0)+(length|0)|0;if(checkOffset(length+2|0)|0){return 1}pushByteString(start|0,end|0);offset=end|0;return 0}function BYTE_STRING_32(octet){octet=octet|0;return 1}function BYTE_STRING_64(octet){octet=octet|0;return 1}function BYTE_STRING_BREAK(octet){octet=octet|0;pushByteStringStart();offset=offset+1|0;return 0}function UTF8_STRING(octet){octet=octet|0;var start=0;var end=0;var step=0;step=octet-96|0;if(checkOffset(step|0)|0){return 1}start=offset+1|0;end=(offset+1|0)+(step|0)|0;pushUtf8String(start|0,end|0);offset=end|0;return 0}function UTF8_STRING_8(octet){octet=octet|0;var start=0;var end=0;var length=0;if(checkOffset(1)|0){return 1}length=heap[offset+1|0]|0;start=offset+2|0;end=(offset+2|0)+(length|0)|0;if(checkOffset(length+1|0)|0){return 1}pushUtf8String(start|0,end|0);offset=end|0;return 0}function UTF8_STRING_16(octet){octet=octet|0;var start=0;var end=0;var length=0;if(checkOffset(2)|0){return 1}length=readUInt16(offset+1|0)|0;start=offset+3|0;end=(offset+3|0)+(length|0)|0;if(checkOffset(length+2|0)|0){return 1}pushUtf8String(start|0,end|0);offset=end|0;return 0}function UTF8_STRING_32(octet){octet=octet|0;return 1}function UTF8_STRING_64(octet){octet=octet|0;return 1}function UTF8_STRING_BREAK(octet){octet=octet|0;pushUtf8StringStart();offset=offset+1|0;return 0}function ARRAY(octet){octet=octet|0;pushArrayStartFixed(octet-128|0);offset=offset+1|0;return 0}function ARRAY_8(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushArrayStartFixed(heap[offset+1|0]|0);offset=offset+2|0;return 0}function ARRAY_16(octet){octet=octet|0;if(checkOffset(2)|0){return 1}pushArrayStartFixed(readUInt16(offset+1|0)|0);offset=offset+3|0;return 1}function ARRAY_32(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushArrayStartFixed32(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function ARRAY_64(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushArrayStartFixed64(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function ARRAY_BREAK(octet){octet=octet|0;pushArrayStart();offset=offset+1|0;return 0}function MAP(octet){octet=octet|0;var step=0;step=octet-160|0;if(checkOffset(step|0)|0){return 1}pushObjectStartFixed(step|0);offset=offset+1|0;return 0}function MAP_8(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushObjectStartFixed(heap[offset+1|0]|0);offset=offset+2|0;return 0}function MAP_16(octet){octet=octet|0;if(checkOffset(2)|0){return 1}pushObjectStartFixed(readUInt16(offset+1|0)|0);offset=offset+3|0;return 0}function MAP_32(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushObjectStartFixed32(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function MAP_64(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushObjectStartFixed64(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function MAP_BREAK(octet){octet=octet|0;pushObjectStart();offset=offset+1|0;return 0}function TAG_KNOWN(octet){octet=octet|0;pushTagStart(octet-192|0|0);offset=offset+1|0;return 0}function TAG_BIGNUM_POS(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_BIGNUM_NEG(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_FRAC(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_BIGNUM_FLOAT(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_UNASSIGNED(octet){octet=octet|0;pushTagStart(octet-192|0|0);offset=offset+1|0;return 0}function TAG_BASE64_URL(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_BASE64(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_BASE16(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_MORE_1(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushTagStart(heap[offset+1|0]|0);offset=offset+2|0;return 0}function TAG_MORE_2(octet){octet=octet|0;if(checkOffset(2)|0){return 1}pushTagStart(readUInt16(offset+1|0)|0);offset=offset+3|0;return 0}function TAG_MORE_4(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushTagStart4(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function TAG_MORE_8(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushTagStart8(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function SIMPLE_UNASSIGNED(octet){octet=octet|0;pushSimpleUnassigned((octet|0)-224|0);offset=offset+1|0;return 0}function SIMPLE_FALSE(octet){octet=octet|0;pushFalse();offset=offset+1|0;return 0}function SIMPLE_TRUE(octet){octet=octet|0;pushTrue();offset=offset+1|0;return 0}function SIMPLE_NULL(octet){octet=octet|0;pushNull();offset=offset+1|0;return 0}function SIMPLE_UNDEFINED(octet){octet=octet|0;pushUndefined();offset=offset+1|0;return 0}function SIMPLE_BYTE(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushSimpleUnassigned(heap[offset+1|0]|0);offset=offset+2|0;return 0}function SIMPLE_FLOAT_HALF(octet){octet=octet|0;var f=0;var g=0;var sign=1;var exp=0;var mant=0;var r=0;if(checkOffset(2)|0){return 1}f=heap[offset+1|0]|0;g=heap[offset+2|0]|0;if((f|0)&128){sign=-1}exp=+(((f|0)&124)>>2);mant=+(((f|0)&3)<<8|g);if(+exp==0){pushFloat(+(+sign*+5.960464477539063e-8*+mant))}else if(+exp==31){if(+sign==1){if(+mant>0){pushNaN()}else{pushInfinity()}}else{if(+mant>0){pushNaNNeg()}else{pushInfinityNeg()}}}else{pushFloat(+(+sign*pow(+2,+(+exp-25))*+(1024+mant)))}offset=offset+3|0;return 0}function SIMPLE_FLOAT_SINGLE(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushFloatSingle(heap[offset+1|0]|0,heap[offset+2|0]|0,heap[offset+3|0]|0,heap[offset+4|0]|0);offset=offset+5|0;return 0}function SIMPLE_FLOAT_DOUBLE(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushFloatDouble(heap[offset+1|0]|0,heap[offset+2|0]|0,heap[offset+3|0]|0,heap[offset+4|0]|0,heap[offset+5|0]|0,heap[offset+6|0]|0,heap[offset+7|0]|0,heap[offset+8|0]|0);offset=offset+9|0;return 0}function ERROR(octet){octet=octet|0;return 1}function BREAK(octet){octet=octet|0;pushBreak();offset=offset+1|0;return 0}var jumpTable=[INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,UINT_P_8,UINT_P_16,UINT_P_32,UINT_P_64,ERROR,ERROR,ERROR,ERROR,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,UINT_N_8,UINT_N_16,UINT_N_32,UINT_N_64,ERROR,ERROR,ERROR,ERROR,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING_8,BYTE_STRING_16,BYTE_STRING_32,BYTE_STRING_64,ERROR,ERROR,ERROR,BYTE_STRING_BREAK,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING_8,UTF8_STRING_16,UTF8_STRING_32,UTF8_STRING_64,ERROR,ERROR,ERROR,UTF8_STRING_BREAK,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY_8,ARRAY_16,ARRAY_32,ARRAY_64,ERROR,ERROR,ERROR,ARRAY_BREAK,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP_8,MAP_16,MAP_32,MAP_64,ERROR,ERROR,ERROR,MAP_BREAK,TAG_KNOWN,TAG_KNOWN,TAG_KNOWN,TAG_KNOWN,TAG_KNOWN,TAG_KNOWN,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_MORE_1,TAG_MORE_2,TAG_MORE_4,TAG_MORE_8,ERROR,ERROR,ERROR,ERROR,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_FALSE,SIMPLE_TRUE,SIMPLE_NULL,SIMPLE_UNDEFINED,SIMPLE_BYTE,SIMPLE_FLOAT_HALF,SIMPLE_FLOAT_SINGLE,SIMPLE_FLOAT_DOUBLE,ERROR,ERROR,ERROR,BREAK];return{parse:parse}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function collectObject(val){return(acc,key)=>{return acc?`${acc}, ${key}: ${val[key]}`:`${key}: ${val[key]}`}}const Decoder=__webpack_require__(184),utils=__webpack_require__(127);class Diagnose extends Decoder{createTag(tagNumber,value){return`${tagNumber}(${value})`}createInt(val){return super.createInt(val).toString()}createInt32(f,g){return super.createInt32(f,g).toString()}createInt64(f1,f2,g1,g2){return super.createInt64(f1,f2,g1,g2).toString()}createInt32Neg(f,g){return super.createInt32Neg(f,g).toString()}createInt64Neg(f1,f2,g1,g2){return super.createInt64Neg(f1,f2,g1,g2).toString()}createTrue(){return"true"}createFalse(){return"false"}createFloat(val){const fl=super.createFloat(val);return utils.isNegativeZero(val)?"-0_1":`${fl}_1`}createFloatSingle(a,b,c,d){return`${super.createFloatSingle(a,b,c,d)}_2`}createFloatDouble(a,b,c,d,e,f,g,h){return`${super.createFloatDouble(a,b,c,d,e,f,g,h)}_3`}createByteString(raw,len){const val=raw.join(", ");return len===-1?`(_ ${val})`:`h'${val}`}createByteStringFromHeap(start,end){return`h'${new Buffer(super.createByteStringFromHeap(start,end)).toString("hex")}'`}createInfinity(){return"Infinity_1"}createInfinityNeg(){return"-Infinity_1"}createNaN(){return"NaN_1"}createNaNNeg(){return"-NaN_1"}createNull(){return"null"}createUndefined(){return"undefined"}createSimpleUnassigned(val){return`simple(${val})`}createArray(arr,len){const val=super.createArray(arr,len);return len===-1?`[_ ${val.join(", ")}]`:`[${val.join(", ")}]`}createMap(map,len){const val=super.createMap(map),list=Array.from(val.keys()).reduce(collectObject(val),"");return len===-1?`{_ ${list}}`:`{${list}}`}createObject(obj,len){const val=super.createObject(obj),map=Object.keys(val).reduce(collectObject(val),"");return len===-1?`{_ ${map}}`:`{${map}}`}createUtf8String(raw,len){const val=raw.join(", ");return len===-1?`(_ ${val})`:`"${val}"`}createUtf8StringFromHeap(start,end){return`"${new Buffer(super.createUtf8StringFromHeap(start,end)).toString("utf8")}"`}static diagnose(input,enc){return"string"==typeof input&&(input=new Buffer(input,enc||"hex")),(new Diagnose).decodeFirst(input)}}module.exports=Diagnose}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function toType(obj){return{}.toString.call(obj).slice(8,-1)}const url=__webpack_require__(167),Bignumber=__webpack_require__(91),utils=__webpack_require__(127),constants=__webpack_require__(92),MT=constants.MT,NUMBYTES=constants.NUMBYTES,SHIFT32=constants.SHIFT32,SYMS=constants.SYMS,TAG=constants.TAG,HALF=constants.MT.SIMPLE_FLOAT<<5|constants.NUMBYTES.TWO,FLOAT=constants.MT.SIMPLE_FLOAT<<5|constants.NUMBYTES.FOUR,DOUBLE=constants.MT.SIMPLE_FLOAT<<5|constants.NUMBYTES.EIGHT,TRUE=constants.MT.SIMPLE_FLOAT<<5|constants.SIMPLE.TRUE,FALSE=constants.MT.SIMPLE_FLOAT<<5|constants.SIMPLE.FALSE,UNDEFINED=constants.MT.SIMPLE_FLOAT<<5|constants.SIMPLE.UNDEFINED,NULL=constants.MT.SIMPLE_FLOAT<<5|constants.SIMPLE.NULL,MAXINT_BN=new Bignumber("0x20000000000000"),BUF_NAN=new Buffer("f97e00","hex"),BUF_INF_NEG=new Buffer("f9fc00","hex"),BUF_INF_POS=new Buffer("f97c00","hex");class Encoder{constructor(options){options=options||{},this.streaming="function"==typeof options.stream,this.onData=options.stream,this.semanticTypes=[[url.Url,this._pushUrl],[Bignumber,this._pushBigNumber]];const addTypes=options.genTypes||[],len=addTypes.length;for(let i=0;i[k,obj[k]]))}_pushRawMap(len,map){map=map.map(function(a){return a[0]=Encoder.encode(a[0]),a}).sort(utils.keySorter);for(var j=0;j16)return out=this.cache.slice(0,16),this.cache=this.cache.slice(16),out}else if(this.cache.length>=16)return out=this.cache.slice(0,16),this.cache=this.cache.slice(16),out;return null},Splitter.prototype.flush=function(){if(this.cache.length)return this.cache};var modelist={ECB:__webpack_require__(192),CBC:__webpack_require__(188),CFB:__webpack_require__(189),CFB8:__webpack_require__(191),CFB1:__webpack_require__(190),OFB:__webpack_require__(193),CTR:__webpack_require__(94),GCM:__webpack_require__(94)};exports.createDecipher=createDecipher,exports.createDecipheriv=createDecipheriv}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Cipher(mode,key,iv){if(!(this instanceof Cipher))return new Cipher(mode,key,iv);Transform.call(this),this._cache=new Splitter,this._cipher=new aes.AES(key),this._prev=new Buffer(iv.length),iv.copy(this._prev),this._mode=mode,this._autopadding=!0}function Splitter(){if(!(this instanceof Splitter))return new Splitter;this.cache=new Buffer("")}function createCipheriv(suite,password,iv){var config=modes[suite.toLowerCase()];if(!config)throw new TypeError("invalid suite type");if("string"==typeof iv&&(iv=new Buffer(iv)),"string"==typeof password&&(password=new Buffer(password)),password.length!==config.key/8)throw new TypeError("invalid key length "+password.length);if(iv.length!==config.iv)throw new TypeError("invalid iv length "+iv.length);return"stream"===config.type?new StreamCipher(modelist[config.mode],password,iv):"auth"===config.type?new AuthCipher(modelist[config.mode],password,iv):new Cipher(modelist[config.mode],password,iv)}function createCipher(suite,password){var config=modes[suite.toLowerCase()];if(!config)throw new TypeError("invalid suite type");var keys=ebtk(password,!1,config.key,config.iv);return createCipheriv(suite,keys.key,keys.iv)}var aes=__webpack_require__(93),Transform=__webpack_require__(47),inherits=__webpack_require__(1),modes=__webpack_require__(128),ebtk=__webpack_require__(211),StreamCipher=__webpack_require__(194),AuthCipher=__webpack_require__(187);inherits(Cipher,Transform),Cipher.prototype._update=function(data){this._cache.add(data);for(var chunk,thing,out=[];chunk=this._cache.get();)thing=this._mode.encrypt(this,chunk),out.push(thing);return Buffer.concat(out)},Cipher.prototype._final=function(){var chunk=this._cache.flush();if(this._autopadding)return chunk=this._mode.encrypt(this,chunk),this._cipher.scrub(),chunk;if("10101010101010101010101010101010"!==chunk.toString("hex"))throw this._cipher.scrub(),new Error("data not multiple of block length")},Cipher.prototype.setAutoPadding=function(setTo){return this._autopadding=!!setTo,this},Splitter.prototype.add=function(data){this.cache=Buffer.concat([this.cache,data])},Splitter.prototype.get=function(){if(this.cache.length>15){var out=this.cache.slice(0,16);return this.cache=this.cache.slice(16),out}return null},Splitter.prototype.flush=function(){for(var len=16-this.cache.length,padBuff=new Buffer(len),i=-1;++iuint_max||x<0?(x_pos=Math.abs(x)%uint_max,x<0?uint_max-x_pos:x_pos):x}function xor(a,b){return[a[0]^b[0],a[1]^b[1],a[2]^b[2],a[3]^b[3]]}var zeros=new Buffer(16);zeros.fill(0),module.exports=GHASH,GHASH.prototype.ghash=function(block){for(var i=-1;++i0;j--)Vi[j]=Vi[j]>>>1|(1&Vi[j-1])<<31;Vi[0]=Vi[0]>>>1,lsb_Vi&&(Vi[0]=Vi[0]^225<<24)}this.state=fromArray(Zi)},GHASH.prototype.update=function(buf){this.cache=Buffer.concat([this.cache,buf]);for(var chunk;this.cache.length>=16;)chunk=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(chunk)},GHASH.prototype.final=function(abl,bl){return this.cache.length&&this.ghash(Buffer.concat([this.cache,zeros],16)),this.ghash(fromArray([0,abl,0,bl])),this.state};var uint_max=Math.pow(2,32)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){const Sha3=__webpack_require__(378),hashLengths=[224,256,384,512];var hash=function(bitcount){if(void 0!==bitcount&&hashLengths.indexOf(bitcount)==-1)throw new Error("Unsupported hash length");this.content=[],this.bitcount=bitcount?"keccak_"+bitcount:"keccak_512"};hash.prototype.update=function(i){if(Buffer.isBuffer(i))this.content.push(i);else{if("string"!=typeof i)throw new Error("Unsupported argument to update");this.content.push(new Buffer(i))}return this},hash.prototype.digest=function(encoding){var result=Sha3[this.bitcount](Buffer.concat(this.content));if("hex"===encoding)return result;if("binary"===encoding||void 0===encoding)return new Buffer(result,"hex").toString("binary");throw new Error("Unsupported encoding for digest: "+encoding)},module.exports={SHA3Hash:hash}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(global){!function(root,undefined){"use strict";var NODE_JS=void 0!==module;NODE_JS&&(root=global,root.JS_SHA3_TEST&&(root.navigator={userAgent:"Chrome"}));var CHROME=(root.JS_SHA3_TEST||!NODE_JS)&&navigator.userAgent.indexOf("Chrome")!=-1,HEX_CHARS="0123456789abcdef".split(""),KECCAK_PADDING=[1,256,65536,16777216],PADDING=[6,1536,393216,100663296],SHIFT=[0,8,16,24],RC=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],blocks=[],s=[],keccak_224=function(message){return keccak(message,224,KECCAK_PADDING)},keccak_256=function(message){return keccak(message,256,KECCAK_PADDING)},keccak_384=function(message){return keccak(message,384,KECCAK_PADDING)},sha3_224=function(message){return keccak(message,224,PADDING)},sha3_256=function(message){return keccak(message,256,PADDING)},sha3_384=function(message){return keccak(message,384,PADDING)},sha3_512=function(message){return keccak(message,512,PADDING)},keccak=function(message,bits,padding){var notString="string"!=typeof message;notString&&message.constructor==root.ArrayBuffer&&(message=new Uint8Array(message)),void 0===bits&&(bits=512,padding=KECCAK_PADDING);var block,code,n,i,h,l,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49,end=!1,index=0,start=0,length=message.length,blockCount=(1600-2*bits)/32,byteCount=4*blockCount;for(i=0;i<50;++i)s[i]=0;block=0;do{for(blocks[0]=block,i=1;i>2]|=message[index]<>2]|=code<>2]|=(192|code>>6)<>2]|=(128|63&code)<=57344?(blocks[i>>2]|=(224|code>>12)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<>2]|=(240|code>>18)<>2]|=(128|code>>12&63)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<>2]|=padding[3&i],++index),block=blocks[blockCount],index>length&&i>>31),l=c9^(c3<<1|c2>>>31),s[0]^=h,s[1]^=l,s[10]^=h,s[11]^=l,s[20]^=h,s[21]^=l,s[30]^=h,s[31]^=l,s[40]^=h,s[41]^=l,h=c0^(c4<<1|c5>>>31),l=c1^(c5<<1|c4>>>31),s[2]^=h,s[3]^=l,s[12]^=h,s[13]^=l,s[22]^=h,s[23]^=l,s[32]^=h,s[33]^=l,s[42]^=h,s[43]^=l,h=c2^(c6<<1|c7>>>31),l=c3^(c7<<1|c6>>>31),s[4]^=h,s[5]^=l,s[14]^=h,s[15]^=l,s[24]^=h,s[25]^=l,s[34]^=h,s[35]^=l,s[44]^=h,s[45]^=l,h=c4^(c8<<1|c9>>>31),l=c5^(c9<<1|c8>>>31),s[6]^=h,s[7]^=l,s[16]^=h,s[17]^=l,s[26]^=h,s[27]^=l,s[36]^=h,s[37]^=l,s[46]^=h,s[47]^=l,h=c6^(c0<<1|c1>>>31),l=c7^(c1<<1|c0>>>31),s[8]^=h,s[9]^=l,s[18]^=h,s[19]^=l,s[28]^=h,s[29]^=l,s[38]^=h,s[39]^=l,s[48]^=h,s[49]^=l,b0=s[0],b1=s[1],b32=s[11]<<4|s[10]>>>28,b33=s[10]<<4|s[11]>>>28,b14=s[20]<<3|s[21]>>>29,b15=s[21]<<3|s[20]>>>29,b46=s[31]<<9|s[30]>>>23,b47=s[30]<<9|s[31]>>>23,b28=s[40]<<18|s[41]>>>14,b29=s[41]<<18|s[40]>>>14,b20=s[2]<<1|s[3]>>>31,b21=s[3]<<1|s[2]>>>31,b2=s[13]<<12|s[12]>>>20,b3=s[12]<<12|s[13]>>>20,b34=s[22]<<10|s[23]>>>22,b35=s[23]<<10|s[22]>>>22,b16=s[33]<<13|s[32]>>>19,b17=s[32]<<13|s[33]>>>19,b48=s[42]<<2|s[43]>>>30,b49=s[43]<<2|s[42]>>>30,b40=s[5]<<30|s[4]>>>2,b41=s[4]<<30|s[5]>>>2,b22=s[14]<<6|s[15]>>>26,b23=s[15]<<6|s[14]>>>26,b4=s[25]<<11|s[24]>>>21,b5=s[24]<<11|s[25]>>>21,b36=s[34]<<15|s[35]>>>17,b37=s[35]<<15|s[34]>>>17,b18=s[45]<<29|s[44]>>>3,b19=s[44]<<29|s[45]>>>3,b10=s[6]<<28|s[7]>>>4,b11=s[7]<<28|s[6]>>>4,b42=s[17]<<23|s[16]>>>9,b43=s[16]<<23|s[17]>>>9,b24=s[26]<<25|s[27]>>>7,b25=s[27]<<25|s[26]>>>7,b6=s[36]<<21|s[37]>>>11,b7=s[37]<<21|s[36]>>>11,b38=s[47]<<24|s[46]>>>8,b39=s[46]<<24|s[47]>>>8,b30=s[8]<<27|s[9]>>>5,b31=s[9]<<27|s[8]>>>5,b12=s[18]<<20|s[19]>>>12,b13=s[19]<<20|s[18]>>>12,b44=s[29]<<7|s[28]>>>25,b45=s[28]<<7|s[29]>>>25,b26=s[38]<<8|s[39]>>>24,b27=s[39]<<8|s[38]>>>24,b8=s[48]<<14|s[49]>>>18,b9=s[49]<<14|s[48]>>>18,s[0]=b0^~b2&b4,s[1]=b1^~b3&b5,s[10]=b10^~b12&b14,s[11]=b11^~b13&b15,s[20]=b20^~b22&b24,s[21]=b21^~b23&b25,s[30]=b30^~b32&b34,s[31]=b31^~b33&b35,s[40]=b40^~b42&b44,s[41]=b41^~b43&b45,s[2]=b2^~b4&b6,s[3]=b3^~b5&b7,s[12]=b12^~b14&b16,s[13]=b13^~b15&b17,s[22]=b22^~b24&b26,s[23]=b23^~b25&b27,s[32]=b32^~b34&b36,s[33]=b33^~b35&b37,s[42]=b42^~b44&b46,s[43]=b43^~b45&b47,s[4]=b4^~b6&b8,s[5]=b5^~b7&b9,s[14]=b14^~b16&b18,s[15]=b15^~b17&b19,s[24]=b24^~b26&b28,s[25]=b25^~b27&b29,s[34]=b34^~b36&b38,s[35]=b35^~b37&b39,s[44]=b44^~b46&b48,s[45]=b45^~b47&b49,s[6]=b6^~b8&b0,s[7]=b7^~b9&b1,s[16]=b16^~b18&b10,s[17]=b17^~b19&b11,s[26]=b26^~b28&b20,s[27]=b27^~b29&b21,s[36]=b36^~b38&b30,s[37]=b37^~b39&b31,s[46]=b46^~b48&b40,s[47]=b47^~b49&b41,s[8]=b8^~b0&b2,s[9]=b9^~b1&b3,s[18]=b18^~b10&b12,s[19]=b19^~b11&b13,s[28]=b28^~b20&b22,s[29]=b29^~b21&b23,s[38]=b38^~b30&b32,s[39]=b39^~b31&b33,s[48]=b48^~b40&b42,s[49]=b49^~b41&b43,s[0]^=RC[n],s[1]^=RC[n+1]}while(!end);var hex="";if(CHROME)b0=s[0],b1=s[1],b2=s[2],b3=s[3],b4=s[4],b5=s[5],b6=s[6],b7=s[7],b8=s[8],b9=s[9],b10=s[10],b11=s[11],b12=s[12],b13=s[13],b14=s[14],b15=s[15],hex+=HEX_CHARS[b0>>4&15]+HEX_CHARS[15&b0]+HEX_CHARS[b0>>12&15]+HEX_CHARS[b0>>8&15]+HEX_CHARS[b0>>20&15]+HEX_CHARS[b0>>16&15]+HEX_CHARS[b0>>28&15]+HEX_CHARS[b0>>24&15]+HEX_CHARS[b1>>4&15]+HEX_CHARS[15&b1]+HEX_CHARS[b1>>12&15]+HEX_CHARS[b1>>8&15]+HEX_CHARS[b1>>20&15]+HEX_CHARS[b1>>16&15]+HEX_CHARS[b1>>28&15]+HEX_CHARS[b1>>24&15]+HEX_CHARS[b2>>4&15]+HEX_CHARS[15&b2]+HEX_CHARS[b2>>12&15]+HEX_CHARS[b2>>8&15]+HEX_CHARS[b2>>20&15]+HEX_CHARS[b2>>16&15]+HEX_CHARS[b2>>28&15]+HEX_CHARS[b2>>24&15]+HEX_CHARS[b3>>4&15]+HEX_CHARS[15&b3]+HEX_CHARS[b3>>12&15]+HEX_CHARS[b3>>8&15]+HEX_CHARS[b3>>20&15]+HEX_CHARS[b3>>16&15]+HEX_CHARS[b3>>28&15]+HEX_CHARS[b3>>24&15]+HEX_CHARS[b4>>4&15]+HEX_CHARS[15&b4]+HEX_CHARS[b4>>12&15]+HEX_CHARS[b4>>8&15]+HEX_CHARS[b4>>20&15]+HEX_CHARS[b4>>16&15]+HEX_CHARS[b4>>28&15]+HEX_CHARS[b4>>24&15]+HEX_CHARS[b5>>4&15]+HEX_CHARS[15&b5]+HEX_CHARS[b5>>12&15]+HEX_CHARS[b5>>8&15]+HEX_CHARS[b5>>20&15]+HEX_CHARS[b5>>16&15]+HEX_CHARS[b5>>28&15]+HEX_CHARS[b5>>24&15]+HEX_CHARS[b6>>4&15]+HEX_CHARS[15&b6]+HEX_CHARS[b6>>12&15]+HEX_CHARS[b6>>8&15]+HEX_CHARS[b6>>20&15]+HEX_CHARS[b6>>16&15]+HEX_CHARS[b6>>28&15]+HEX_CHARS[b6>>24&15],bits>=256&&(hex+=HEX_CHARS[b7>>4&15]+HEX_CHARS[15&b7]+HEX_CHARS[b7>>12&15]+HEX_CHARS[b7>>8&15]+HEX_CHARS[b7>>20&15]+HEX_CHARS[b7>>16&15]+HEX_CHARS[b7>>28&15]+HEX_CHARS[b7>>24&15]),bits>=384&&(hex+=HEX_CHARS[b8>>4&15]+HEX_CHARS[15&b8]+HEX_CHARS[b8>>12&15]+HEX_CHARS[b8>>8&15]+HEX_CHARS[b8>>20&15]+HEX_CHARS[b8>>16&15]+HEX_CHARS[b8>>28&15]+HEX_CHARS[b8>>24&15]+HEX_CHARS[b9>>4&15]+HEX_CHARS[15&b9]+HEX_CHARS[b9>>12&15]+HEX_CHARS[b9>>8&15]+HEX_CHARS[b9>>20&15]+HEX_CHARS[b9>>16&15]+HEX_CHARS[b9>>28&15]+HEX_CHARS[b9>>24&15]+HEX_CHARS[b10>>4&15]+HEX_CHARS[15&b10]+HEX_CHARS[b10>>12&15]+HEX_CHARS[b10>>8&15]+HEX_CHARS[b10>>20&15]+HEX_CHARS[b10>>16&15]+HEX_CHARS[b10>>28&15]+HEX_CHARS[b10>>24&15]+HEX_CHARS[b11>>4&15]+HEX_CHARS[15&b11]+HEX_CHARS[b11>>12&15]+HEX_CHARS[b11>>8&15]+HEX_CHARS[b11>>20&15]+HEX_CHARS[b11>>16&15]+HEX_CHARS[b11>>28&15]+HEX_CHARS[b11>>24&15]),512==bits&&(hex+=HEX_CHARS[b12>>4&15]+HEX_CHARS[15&b12]+HEX_CHARS[b12>>12&15]+HEX_CHARS[b12>>8&15]+HEX_CHARS[b12>>20&15]+HEX_CHARS[b12>>16&15]+HEX_CHARS[b12>>28&15]+HEX_CHARS[b12>>24&15]+HEX_CHARS[b13>>4&15]+HEX_CHARS[15&b13]+HEX_CHARS[b13>>12&15]+HEX_CHARS[b13>>8&15]+HEX_CHARS[b13>>20&15]+HEX_CHARS[b13>>16&15]+HEX_CHARS[b13>>28&15]+HEX_CHARS[b13>>24&15]+HEX_CHARS[b14>>4&15]+HEX_CHARS[15&b14]+HEX_CHARS[b14>>12&15]+HEX_CHARS[b14>>8&15]+HEX_CHARS[b14>>20&15]+HEX_CHARS[b14>>16&15]+HEX_CHARS[b14>>28&15]+HEX_CHARS[b14>>24&15]+HEX_CHARS[b15>>4&15]+HEX_CHARS[15&b15]+HEX_CHARS[b15>>12&15]+HEX_CHARS[b15>>8&15]+HEX_CHARS[b15>>20&15]+HEX_CHARS[b15>>16&15]+HEX_CHARS[b15>>28&15]+HEX_CHARS[b15>>24&15]);else for(i=0,n=bits/32;i>4&15]+HEX_CHARS[15&h]+HEX_CHARS[h>>12&15]+HEX_CHARS[h>>8&15]+HEX_CHARS[h>>20&15]+HEX_CHARS[h>>16&15]+HEX_CHARS[h>>28&15]+HEX_CHARS[h>>24&15];return hex};!root.JS_SHA3_TEST&&NODE_JS?module.exports={sha3_512:sha3_512,sha3_384:sha3_384,sha3_256:sha3_256,sha3_224:sha3_224,keccak_512:keccak,keccak_384:keccak_384,keccak_256:keccak_256,keccak_224:keccak_224}:root&&(root.sha3_512=sha3_512,root.sha3_384=sha3_384,root.sha3_256=sha3_256,root.sha3_224=sha3_224,root.keccak_512=keccak,root.keccak_384=keccak_384,root.keccak_256=keccak_256,root.keccak_224=keccak_224)}(this)}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){"use strict";(function(Buffer,process){function Zlib(mode){if("number"!=typeof mode||modeexports.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=mode,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}var assert=__webpack_require__(7),Zstream=__webpack_require__(711),zlib_deflate=__webpack_require__(705),zlib_inflate=__webpack_require__(707),constants=__webpack_require__(704);for(var key in constants)exports[key]=constants[key];exports.NONE=0,exports.DEFLATE=1,exports.INFLATE=2,exports.GZIP=3,exports.GUNZIP=4,exports.DEFLATERAW=5,exports.INFLATERAW=6,exports.UNZIP=7;Zlib.prototype.close=function(){if(this.write_in_progress)return void(this.pending_close=!0);this.pending_close=!1,assert(this.init_done,"close before init"),assert(this.mode<=exports.UNZIP),this.mode===exports.DEFLATE||this.mode===exports.GZIP||this.mode===exports.DEFLATERAW?zlib_deflate.deflateEnd(this.strm):this.mode!==exports.INFLATE&&this.mode!==exports.GUNZIP&&this.mode!==exports.INFLATERAW&&this.mode!==exports.UNZIP||zlib_inflate.inflateEnd(this.strm),this.mode=exports.NONE,this.dictionary=null},Zlib.prototype.write=function(flush,input,in_off,in_len,out,out_off,out_len){return this._write(!0,flush,input,in_off,in_len,out,out_off,out_len)},Zlib.prototype.writeSync=function(flush,input,in_off,in_len,out,out_off,out_len){return this._write(!1,flush,input,in_off,in_len,out,out_off,out_len)},Zlib.prototype._write=function(async,flush,input,in_off,in_len,out,out_off,out_len){if(assert.equal(arguments.length,8),assert(this.init_done,"write before init"),assert(this.mode!==exports.NONE,"already finalized"),assert.equal(!1,this.write_in_progress,"write already in progress"),assert.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,assert.equal(!1,void 0===flush,"must provide flush value"),this.write_in_progress=!0,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)throw new Error("Invalid flush value");if(null==input&&(input=new Buffer(0),in_len=0,in_off=0),this.strm.avail_in=in_len,this.strm.input=input,this.strm.next_in=in_off,this.strm.avail_out=out_len,this.strm.output=out,this.strm.next_out=out_off,this.flush=flush,async){var self=this;return process.nextTick(function(){self._process(),self._after()}),this}if(this._process(),this._checkError())return this._afterSync()},Zlib.prototype._afterSync=function(){var avail_out=this.strm.avail_out,avail_in=this.strm.avail_in;return this.write_in_progress=!1,[avail_in,avail_out]},Zlib.prototype._process=function(){var next_expected_header_byte=null;switch(this.mode){case exports.DEFLATE:case exports.GZIP:case exports.DEFLATERAW:this.err=zlib_deflate.deflate(this.strm,this.flush);break;case exports.UNZIP:switch(this.strm.avail_in>0&&(next_expected_header_byte=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===next_expected_header_byte)break;if(31!==this.strm.input[next_expected_header_byte]){this.mode=exports.INFLATE;break}if(this.gzip_id_bytes_read=1,next_expected_header_byte++,1===this.strm.avail_in)break;case 1:if(null===next_expected_header_byte)break;139===this.strm.input[next_expected_header_byte]?(this.gzip_id_bytes_read=2,this.mode=exports.GUNZIP):this.mode=exports.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case exports.INFLATE:case exports.GUNZIP:case exports.INFLATERAW:for(this.err=zlib_inflate.inflate(this.strm,this.flush),this.err===exports.Z_NEED_DICT&&this.dictionary&&(this.err=zlib_inflate.inflateSetDictionary(this.strm,this.dictionary),this.err===exports.Z_OK?this.err=zlib_inflate.inflate(this.strm,this.flush):this.err===exports.Z_DATA_ERROR&&(this.err=exports.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===exports.GUNZIP&&this.err===exports.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=zlib_inflate.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},Zlib.prototype._checkError=function(){switch(this.err){case exports.Z_OK:case exports.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===exports.Z_FINISH)return this._error("unexpected end of file"),!1;break;case exports.Z_STREAM_END:break;case exports.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},Zlib.prototype._after=function(){if(this._checkError()){var avail_out=this.strm.avail_out,avail_in=this.strm.avail_in;this.write_in_progress=!1,this.callback(avail_in,avail_out),this.pending_close&&this.close()}},Zlib.prototype._error=function(message){this.strm.msg&&(message=this.strm.msg),this.onerror(message,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},Zlib.prototype.init=function(windowBits,level,memLevel,strategy,dictionary){assert(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),assert(windowBits>=8&&windowBits<=15,"invalid windowBits"),assert(level>=-1&&level<=9,"invalid compression level"),assert(memLevel>=1&&memLevel<=9,"invalid memlevel"),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"),this._init(level,windowBits,memLevel,strategy,dictionary),this._setDictionary()},Zlib.prototype.params=function(){throw new Error("deflateParams Not supported")},Zlib.prototype.reset=function(){this._reset(),this._setDictionary()},Zlib.prototype._init=function(level,windowBits,memLevel,strategy,dictionary){switch(this.level=level,this.windowBits=windowBits,this.memLevel=memLevel,this.strategy=strategy,this.flush=exports.Z_NO_FLUSH,this.err=exports.Z_OK,this.mode!==exports.GZIP&&this.mode!==exports.GUNZIP||(this.windowBits+=16),this.mode===exports.UNZIP&&(this.windowBits+=32),this.mode!==exports.DEFLATERAW&&this.mode!==exports.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new Zstream,this.mode){case exports.DEFLATE:case exports.GZIP:case exports.DEFLATERAW:this.err=zlib_deflate.deflateInit2(this.strm,this.level,exports.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case exports.INFLATE:case exports.GUNZIP:case exports.INFLATERAW:case exports.UNZIP:this.err=zlib_inflate.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==exports.Z_OK&&this._error("Init error"),this.dictionary=dictionary,this.write_in_progress=!1,this.init_done=!0},Zlib.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=exports.Z_OK,this.mode){case exports.DEFLATE:case exports.DEFLATERAW:this.err=zlib_deflate.deflateSetDictionary(this.strm,this.dictionary)}this.err!==exports.Z_OK&&this._error("Failed to set dictionary")}},Zlib.prototype._reset=function(){switch(this.err=exports.Z_OK,this.mode){case exports.DEFLATE:case exports.DEFLATERAW:case exports.GZIP:this.err=zlib_deflate.deflateReset(this.strm);break;case exports.INFLATE:case exports.INFLATERAW:case exports.GUNZIP:this.err=zlib_inflate.inflateReset(this.strm)}this.err!==exports.Z_OK&&this._error("Failed to reset stream")},exports.Zlib=Zlib}).call(exports,__webpack_require__(0).Buffer,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";(function(process){function zlibBuffer(engine,buffer,callback){function flow(){for(var chunk;null!==(chunk=engine.read());)buffers.push(chunk),nread+=chunk.length;engine.once("readable",flow)}function onError(err){ -engine.removeListener("end",onEnd),engine.removeListener("readable",flow),callback(err)}function onEnd(){var buf,err=null;nread>=kMaxLength?err=new RangeError(kRangeErrorMessage):buf=Buffer.concat(buffers,nread),buffers=[],engine.close(),callback(err,buf)}var buffers=[],nread=0;engine.on("error",onError),engine.on("end",onEnd),engine.end(buffer),flow()}function zlibBufferSync(engine,buffer){if("string"==typeof buffer&&(buffer=Buffer.from(buffer)),!Buffer.isBuffer(buffer))throw new TypeError("Not a string or buffer");var flushFlag=engine._finishFlushFlag;return engine._processChunk(buffer,flushFlag)}function Deflate(opts){if(!(this instanceof Deflate))return new Deflate(opts);Zlib.call(this,opts,binding.DEFLATE)}function Inflate(opts){if(!(this instanceof Inflate))return new Inflate(opts);Zlib.call(this,opts,binding.INFLATE)}function Gzip(opts){if(!(this instanceof Gzip))return new Gzip(opts);Zlib.call(this,opts,binding.GZIP)}function Gunzip(opts){if(!(this instanceof Gunzip))return new Gunzip(opts);Zlib.call(this,opts,binding.GUNZIP)}function DeflateRaw(opts){if(!(this instanceof DeflateRaw))return new DeflateRaw(opts);Zlib.call(this,opts,binding.DEFLATERAW)}function InflateRaw(opts){if(!(this instanceof InflateRaw))return new InflateRaw(opts);Zlib.call(this,opts,binding.INFLATERAW)}function Unzip(opts){if(!(this instanceof Unzip))return new Unzip(opts);Zlib.call(this,opts,binding.UNZIP)}function isValidFlushFlag(flag){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}function Zlib(opts,mode){var _this=this;if(this._opts=opts=opts||{},this._chunkSize=opts.chunkSize||exports.Z_DEFAULT_CHUNK,Transform.call(this,opts),opts.flush&&!isValidFlushFlag(opts.flush))throw new Error("Invalid flush flag: "+opts.flush);if(opts.finishFlush&&!isValidFlushFlag(opts.finishFlush))throw new Error("Invalid flush flag: "+opts.finishFlush);if(this._flushFlag=opts.flush||binding.Z_NO_FLUSH,this._finishFlushFlag=void 0!==opts.finishFlush?opts.finishFlush:binding.Z_FINISH,opts.chunkSize&&(opts.chunkSizeexports.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+opts.chunkSize);if(opts.windowBits&&(opts.windowBitsexports.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+opts.windowBits);if(opts.level&&(opts.levelexports.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+opts.level);if(opts.memLevel&&(opts.memLevelexports.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+opts.memLevel);if(opts.strategy&&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)throw new Error("Invalid strategy: "+opts.strategy);if(opts.dictionary&&!Buffer.isBuffer(opts.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new binding.Zlib(mode);var self=this;this._hadError=!1,this._handle.onerror=function(message,errno){_close(self),self._hadError=!0;var error=new Error(message);error.errno=errno,error.code=exports.codes[errno],self.emit("error",error)};var level=exports.Z_DEFAULT_COMPRESSION;"number"==typeof opts.level&&(level=opts.level);var strategy=exports.Z_DEFAULT_STRATEGY;"number"==typeof opts.strategy&&(strategy=opts.strategy),this._handle.init(opts.windowBits||exports.Z_DEFAULT_WINDOWBITS,level,opts.memLevel||exports.Z_DEFAULT_MEMLEVEL,strategy,opts.dictionary),this._buffer=Buffer.allocUnsafe(this._chunkSize),this._offset=0,this._level=level,this._strategy=strategy,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!_this._handle},configurable:!0,enumerable:!0})}function _close(engine,callback){callback&&process.nextTick(callback),engine._handle&&(engine._handle.close(),engine._handle=null)}function emitCloseNT(self){self.emit("close")}var Buffer=__webpack_require__(0).Buffer,Transform=__webpack_require__(26).Transform,binding=__webpack_require__(379),util=__webpack_require__(10),assert=__webpack_require__(7).ok,kMaxLength=__webpack_require__(0).kMaxLength,kRangeErrorMessage="Cannot create final Buffer. It would be larger than 0x"+kMaxLength.toString(16)+" bytes";binding.Z_MIN_WINDOWBITS=8,binding.Z_MAX_WINDOWBITS=15,binding.Z_DEFAULT_WINDOWBITS=15,binding.Z_MIN_CHUNK=64,binding.Z_MAX_CHUNK=1/0,binding.Z_DEFAULT_CHUNK=16384,binding.Z_MIN_MEMLEVEL=1,binding.Z_MAX_MEMLEVEL=9,binding.Z_DEFAULT_MEMLEVEL=8,binding.Z_MIN_LEVEL=-1,binding.Z_MAX_LEVEL=9,binding.Z_DEFAULT_LEVEL=binding.Z_DEFAULT_COMPRESSION;for(var bkeys=Object.keys(binding),bk=0;bkexports.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+level);if(strategy!=exports.Z_FILTERED&&strategy!=exports.Z_HUFFMAN_ONLY&&strategy!=exports.Z_RLE&&strategy!=exports.Z_FIXED&&strategy!=exports.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+strategy);if(this._level!==level||this._strategy!==strategy){var self=this;this.flush(binding.Z_SYNC_FLUSH,function(){assert(self._handle,"zlib binding closed"),self._handle.params(level,strategy),self._hadError||(self._level=level,self._strategy=strategy,callback&&callback())})}else process.nextTick(callback)},Zlib.prototype.reset=function(){return assert(this._handle,"zlib binding closed"),this._handle.reset()},Zlib.prototype._flush=function(callback){this._transform(Buffer.alloc(0),"",callback)},Zlib.prototype.flush=function(kind,callback){var _this2=this,ws=this._writableState;("function"==typeof kind||void 0===kind&&!callback)&&(callback=kind,kind=binding.Z_FULL_FLUSH),ws.ended?callback&&process.nextTick(callback):ws.ending?callback&&this.once("end",callback):ws.needDrain?callback&&this.once("drain",function(){return _this2.flush(kind,callback)}):(this._flushFlag=kind,this.write(Buffer.alloc(0),"",callback))},Zlib.prototype.close=function(callback){_close(this,callback),process.nextTick(emitCloseNT,this)},Zlib.prototype._transform=function(chunk,encoding,cb){var flushFlag,ws=this._writableState,ending=ws.ending||ws.ended,last=ending&&(!chunk||ws.length===chunk.length);return null===chunk||Buffer.isBuffer(chunk)?this._handle?(last?flushFlag=this._finishFlushFlag:(flushFlag=this._flushFlag,chunk.length>=ws.length&&(this._flushFlag=this._opts.flush||binding.Z_NO_FLUSH)),void this._processChunk(chunk,flushFlag,cb)):cb(new Error("zlib binding closed")):cb(new Error("invalid input"))},Zlib.prototype._processChunk=function(chunk,flushFlag,cb){function callback(availInAfter,availOutAfter){if(this&&(this.buffer=null,this.callback=null),!self._hadError){var have=availOutBefore-availOutAfter;if(assert(have>=0,"have should not go down"),have>0){var out=self._buffer.slice(self._offset,self._offset+have);self._offset+=have,async?self.push(out):(buffers.push(out),nread+=out.length)}if((0===availOutAfter||self._offset>=self._chunkSize)&&(availOutBefore=self._chunkSize,self._offset=0,self._buffer=Buffer.allocUnsafe(self._chunkSize)),0===availOutAfter){if(inOff+=availInBefore-availInAfter,availInBefore=availInAfter,!async)return!0;var newReq=self._handle.write(flushFlag,chunk,inOff,availInBefore,self._buffer,self._offset,self._chunkSize);return newReq.callback=callback,void(newReq.buffer=chunk)}if(!async)return!1;cb()}}var availInBefore=chunk&&chunk.length,availOutBefore=this._chunkSize-this._offset,inOff=0,self=this,async="function"==typeof cb;if(!async){var error,buffers=[],nread=0;this.on("error",function(er){error=er}),assert(this._handle,"zlib binding closed");do{var res=this._handle.writeSync(flushFlag,chunk,inOff,availInBefore,this._buffer,this._offset,availOutBefore)}while(!this._hadError&&callback(res[0],res[1]));if(this._hadError)throw error;if(nread>=kMaxLength)throw _close(this),new RangeError(kRangeErrorMessage);var buf=Buffer.concat(buffers,nread);return _close(this),buf}assert(this._handle,"zlib binding closed");var req=this._handle.write(flushFlag,chunk,inOff,availInBefore,this._buffer,this._offset,availOutBefore);req.buffer=chunk,req.callback=callback},util.inherits(Deflate,Zlib),util.inherits(Inflate,Zlib),util.inherits(Gzip,Zlib),util.inherits(Gunzip,Zlib),util.inherits(DeflateRaw,Zlib),util.inherits(InflateRaw,Zlib),util.inherits(Unzip,Zlib)}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){var Buffer=__webpack_require__(13).Buffer;module.exports=function(ALPHABET){function encode(source){if(0===source.length)return"";for(var digits=[0],i=0;i0;)digits.push(carry%BASE),carry=carry/BASE|0}for(var string="",k=0;0===source[k]&&k=0;--q)string+=ALPHABET[digits[q]];return string}function decodeUnsafe(string){if(0===string.length)return Buffer.allocUnsafe(0);for(var bytes=[0],i=0;i>=8;for(;carry>0;)bytes.push(255&carry),carry>>=8}for(var k=0;string[k]===LEADER&&k>>2),i=0,j=0;iblocksize){key=("rmd160"===alg?new RIPEMD160:sha(alg)).update(key).digest()}else key.lengthblocksize?key=alg(key):key.length{return err?callback(err):exists?void callback(null,this.data[key.toString()]):callback(new Error("No value"))})}has(key,callback){setImmediate(()=>{callback(null,void 0!==this.data[key.toString()])})}delete(key,callback){delete this.data[key.toString()],setImmediate(()=>{callback()})}batch(){let puts=[],dels=[];return{put(key,value){puts.push([key,value])},delete(key){dels.push(key)},commit:callback=>{puts.forEach(v=>{this.data[v[0].toString()]=v[1]}),puts=[],dels.forEach(key=>{delete this.data[key.toString()]}),dels=[],setImmediate(callback)}}}query(q){let tasks=[pull.keys(this.data),pull.map(k=>({key:new Key(k),value:this.data[k]}))],filters=[];if(null!=q.prefix){const prefix=q.prefix;filters.push((e,cb)=>cb(null,e.key.toString().startsWith(prefix)))}if(null!=q.filters&&(filters=filters.concat(q.filters)),tasks=tasks.concat(filters.map(f=>asyncFilter(f))),null!=q.orders&&(tasks=tasks.concat(q.orders.map(o=>asyncSort(o)))),null!=q.offset){let i=0;tasks.push(pull.filter(()=>i++>=q.offset))}return null!=q.limit&&tasks.push(pull.take(q.limit)),q.keysOnly===!0&&tasks.push(pull.map(e=>({key:e.key}))),pull.apply(null,tasks)}close(callback){setImmediate(callback)}}module.exports=MemoryDatastore},function(module,exports,__webpack_require__){"use strict";const each=__webpack_require__(32),many=__webpack_require__(727),pull=__webpack_require__(5),Key=__webpack_require__(76).Key,utils=__webpack_require__(76).utils,asyncFilter=utils.asyncFilter,asyncSort=utils.asyncSort,replaceStartWith=utils.replaceStartWith,Keytransform=__webpack_require__(96);class MountDatastore{constructor(mounts){this.mounts=mounts.slice()}open(callback){each(this.mounts,(m,cb)=>{m.datastore.open(cb)},callback)}_lookup(key){for(let mount of this.mounts)if(mount.prefix.toString()===key.toString()||mount.prefix.isAncestorOf(key)){const s=replaceStartWith(key.toString(),mount.prefix.toString());return{datastore:mount.datastore,mountpoint:mount.prefix,rest:new Key(s)}}}put(key,value,callback){const match=this._lookup(key);if(null==match)return void callback(new Error("No datastore mounted for this key"));match.datastore.put(match.rest,value,callback)}get(key,callback){const match=this._lookup(key);if(null==match)return void callback(new Error("No datastore mounted for this key"));match.datastore.get(match.rest,callback)}has(key,callback){const match=this._lookup(key);if(null==match)return void callback(null,!1);match.datastore.has(match.rest,callback)}delete(key,callback){const match=this._lookup(key);if(null==match)return void callback(new Error("No datastore mounted for this key"));match.datastore.delete(match.rest,callback)}close(callback){each(this.mounts,(m,cb)=>{m.datastore.close(cb)},callback)}batch(){const batchMounts={},lookup=key=>{const match=this._lookup(key);if(null==match)throw new Error("No datastore mounted for this key");const m=match.mountpoint.toString();return null==batchMounts[m]&&(batchMounts[m]=match.datastore.batch()),{batch:batchMounts[m],rest:match.rest}};return{put:(key,value)=>{const match=lookup(key);match.batch.put(match.rest,value)},delete:key=>{const match=lookup(key);match.batch.delete(match.rest)},commit:callback=>{each(Object.keys(batchMounts),(p,cb)=>{batchMounts[p].commit(cb)},callback)}}}query(q){const qs=this.mounts.map(m=>{const ks=new Keytransform(m.datastore,{convert:key=>{throw new Error("should never be called")},invert:key=>{return m.prefix.child(key)}});let prefix;return null!=q.prefix&&(prefix=replaceStartWith(q.prefix,m.prefix.toString())),ks.query({prefix:prefix,filters:q.filters,keysOnly:q.keysOnly})});let tasks=[many(qs)];if(null!=q.filters&&(tasks=tasks.concat(q.filters.map(f=>asyncFilter(f)))),null!=q.orders&&(tasks=tasks.concat(q.orders.map(o=>asyncSort(o)))),null!=q.offset){let i=0;tasks.push(pull.filter(()=>i++>=q.offset))}return null!=q.limit&&tasks.push(pull.take(q.limit)),pull.apply(null,tasks)}}module.exports=MountDatastore},function(module,exports,__webpack_require__){"use strict";const Key=__webpack_require__(76).Key,KeytransformDatastore=__webpack_require__(96);class NamespaceDatastore extends KeytransformDatastore{constructor(child,prefix){super(child,{convert(key){return prefix.child(key)},invert(key){if("/"===prefix.toString())return key;if(!prefix.isAncestorOf(key))throw new Error(`Expected prefix: (${prefix.toString()}) in key: ${key.toString()}`);return new Key(key.toString().slice(prefix.toString().length),!1)}}),this.prefix=prefix}query(q){return q.prefix&&"/"!==this.prefix.toString()?super.query(Object.assign({},q,{prefix:this.prefix.child(new Key(q.prefix)).toString()})):super.query(q)}}module.exports=NamespaceDatastore},function(module,exports,__webpack_require__){"use strict";module.exports=`This is a repository of IPLD objects. Each IPLD object is in a single file, +`);module.exports=protobuf(schema).Identify}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";module.exports="/mplex/6.7.0"},function(module,exports,__webpack_require__){"use strict";function getPeerInfo(peer,peerBook){let p;if(PeerInfo.isPeerInfo(peer))p=peer;else if(multiaddr.isMultiaddr(peer)){const peerIdB58Str=peer.getPeerId();try{p=peerBook.get(peerIdB58Str)}catch(err){p=new PeerInfo(PeerId.createFromB58String(peerIdB58Str))}p.multiaddrs.add(peer)}else{if(!PeerId.isPeerId(peer))throw new Error("peer type not recognized");{const peerIdB58Str=peer.toB58String();try{p=peerBook.get(peerIdB58Str)}catch(err){throw new Error("Couldnt get PeerInfo")}}}return p}const PeerId=__webpack_require__(22),PeerInfo=__webpack_require__(35),multiaddr=__webpack_require__(24);module.exports=getPeerInfo},function(module,exports,__webpack_require__){"use strict";module.exports={tag:"/plaintext/1.0.0",encrypt(id,privKey,conn){return conn}}},function(module,exports,__webpack_require__){(function(global){function debounce(func,wait,options){function invokeFunc(time){var args=lastArgs,thisArg=lastThis;return lastArgs=lastThis=void 0,lastInvokeTime=time,result=func.apply(thisArg,args)}function leadingEdge(time){return lastInvokeTime=time,timerId=setTimeout(timerExpired,wait),leading?invokeFunc(time):result}function remainingWait(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime,result=wait-timeSinceLastCall;return maxing?nativeMin(result,maxWait-timeSinceLastInvoke):result}function shouldInvoke(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime;return void 0===lastCallTime||timeSinceLastCall>=wait||timeSinceLastCall<0||maxing&&timeSinceLastInvoke>=maxWait}function timerExpired(){var time=now();if(shouldInvoke(time))return trailingEdge(time);timerId=setTimeout(timerExpired,remainingWait(time))}function trailingEdge(time){return timerId=void 0,trailing&&lastArgs?invokeFunc(time):(lastArgs=lastThis=void 0,result)}function cancel(){void 0!==timerId&&clearTimeout(timerId),lastInvokeTime=0,lastArgs=lastCallTime=lastThis=timerId=void 0}function flush(){return void 0===timerId?result:trailingEdge(now())}function debounced(){var time=now(),isInvoking=shouldInvoke(time);if(lastArgs=arguments,lastThis=this,lastCallTime=time,isInvoking){if(void 0===timerId)return leadingEdge(lastCallTime);if(maxing)return timerId=setTimeout(timerExpired,wait),invokeFunc(lastCallTime)}return void 0===timerId&&(timerId=setTimeout(timerExpired,wait)),result}var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime=0,leading=!1,maxing=!1,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return wait=toNumber(wait)||0,isObject(options)&&(leading=!!options.leading,maxing="maxWait"in options,maxWait=maxing?nativeMax(toNumber(options.maxWait)||0,wait):maxWait,trailing="trailing"in options?!!options.trailing:trailing),debounced.cancel=cancel,debounced.flush=flush,debounced}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}var FUNC_ERROR_TEXT="Expected a function",NAN=NaN,symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),objectProto=Object.prototype,objectToString=objectProto.toString,nativeMax=Math.max,nativeMin=Math.min,now=function(){return root.Date.now()};module.exports=debounce}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(global){function getValue(object,key){return null==object?void 0:object[key]}function isHostObject(value){var result=!1;if(null!=value&&"function"!=typeof value.toString)try{result=!!(value+"")}catch(e){}return result}function Hash(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index-1&&value%1==0&&value-1:!!length&&baseIndexOf(collection,value,fromIndex)>-1}function isArguments(value){return isArrayLikeObject(value)&&hasOwnProperty.call(value,"callee")&&(!propertyIsEnumerable.call(value,"callee")||objectToString.call(value)==argsTag)}function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isString(value){return"string"==typeof value||!isArray(value)&&isObjectLike(value)&&objectToString.call(value)==stringTag}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toFinite(value){if(!value)return 0===value?value:0;if((value=toNumber(value))===INFINITY||value===-INFINITY){return(value<0?-1:1)*MAX_INTEGER}return value===value?value:0}function toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function values(object){return object?baseValues(object,keys(object)):[]}var INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,MAX_INTEGER=1.7976931348623157e308,NAN=NaN,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",stringTag="[object String]",symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,reIsUint=/^(?:0|[1-9]\d*)$/,freeParseInt=parseInt,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,propertyIsEnumerable=objectProto.propertyIsEnumerable,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),nativeMax=Math.max,isArray=Array.isArray;module.exports=includes},function(module,exports,__webpack_require__){var root=__webpack_require__(232),Symbol=root.Symbol;module.exports=Symbol},function(module,exports,__webpack_require__){(function(global){var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global;module.exports=freeGlobal}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){var freeGlobal=__webpack_require__(231),freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")();module.exports=root},function(module,exports){function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}var MAX_SAFE_INTEGER=9007199254740991;module.exports=isLength},function(module,exports){function isObject(value){var type=typeof value;return null!=value&&("object"==type||"function"==type)}module.exports=isObject},function(module,exports){module.exports=function(fun){!function next(){var loop=!0,sync=!1;do{sync=!0,loop=!1,fun.call(this,function(){sync?loop=!0:next()}),sync=!1}while(loop)}()}},function(module,exports,__webpack_require__){"use strict";function toArray(msg,enc){if(Array.isArray(msg))return msg.slice();if(!msg)return[];var res=[];if("string"!=typeof msg){for(var i=0;i>8,lo=255&c;hi?res.push(hi,lo):res.push(lo)}return res}function zero2(word){return 1===word.length?"0"+word:word}function toHex(msg){for(var res="",i=0;i{return function(input,callback){const done=(err,res)=>setImmediate(()=>{callback(err,res)});let res;try{res=doWork(input)}catch(err){return void done(err)}done(null,res)}}),exports.toBuf=((doWork,other)=>input=>{return new Buffer(doWork(input,other),"hex")}),exports.fromString=((doWork,other)=>_input=>{return doWork(Buffer.isBuffer(_input)?_input.toString():_input,other)}),exports.fromNumberTo32BitBuf=((doWork,other)=>input=>{let number=doWork(input,other);const bytes=new Array(4);for(let i=0;i<4;i++)bytes[i]=255&number,number>>=8;return Buffer.from(bytes)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports=module.exports,exports.PROTOCOL_ID="/multistream/1.0.0"},function(module,exports,__webpack_require__){"use strict";function matchExact(myProtocol,senderProtocol,callback){callback(null,myProtocol===senderProtocol)}module.exports=matchExact},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function select(multicodec,callback,log){const stream=handshake({timeout:6e4},callback),shake=stream.handshake;return log("writing multicodec: "+multicodec),writeEncoded(shake,new Buffer(multicodec+"\n"),callback),pullLP.decodeFromReader(shake,(err,data)=>{if(err)return callback(err);const protocol=data.toString().slice(0,-1);if(protocol!==multicodec)return callback(new Error(`"${multicodec}" not supported`),shake.rest());log("received ack: "+protocol),callback(null,shake.rest())}),stream}const handshake=__webpack_require__(55),pullLP=__webpack_require__(23),util=__webpack_require__(91),writeEncoded=util.writeEncoded;module.exports=select}).call(exports,__webpack_require__(0).Buffer)},function(module,exports){exports.endianness=function(){return"LE"},exports.hostname=function(){return"undefined"!=typeof location?location.hostname:""},exports.loadavg=function(){return[]},exports.uptime=function(){return 0},exports.freemem=function(){return Number.MAX_VALUE},exports.totalmem=function(){return Number.MAX_VALUE},exports.cpus=function(){return[]},exports.type=function(){return"Browser"},exports.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},exports.networkInterfaces=exports.getNetworkInterfaces=function(){return{}},exports.arch=function(){return"javascript"},exports.platform=function(){return"browser"},exports.tmpdir=exports.tmpDir=function(){return"/tmp"},exports.EOL="\n"},function(module,exports){var re=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,parts=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];module.exports=function(str){var src=str,b=str.indexOf("["),e=str.indexOf("]");b!=-1&&e!=-1&&(str=str.substring(0,b)+str.substring(b,e).replace(/:/g,";")+str.substring(e,str.length));for(var m=re.exec(str||""),uri={},i=14;i--;)uri[parts[i]]=m[i]||"";return b!=-1&&e!=-1&&(uri.source=src,uri.host=uri.host.substring(1,uri.host.length-1).replace(/;/g,":"),uri.authority=uri.authority.replace("[","").replace("]","").replace(/;/g,":"),uri.ipv6uri=!0),uri}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function getB58Str(peer){let b58Str;if("string"==typeof peer)b58Str=peer;else if(Buffer.isBuffer(peer))b58Str=bs58.encode(peer).toString();else if(PeerId.isPeerId(peer))b58Str=peer.toB58String();else{if(!PeerInfo.isPeerInfo(peer))throw new Error("not valid PeerId or PeerInfo, or B58Str");b58Str=peer.id.toB58String()}return b58Str}const bs58=__webpack_require__(79),PeerId=__webpack_require__(22),PeerInfo=__webpack_require__(35);class PeerBook{constructor(){this._peers={}}has(peer){const b58Str=getB58Str(peer);return Boolean(this._peers[b58Str])}put(peerInfo,replace){const localPeerInfo=this._peers[peerInfo.id.toB58String()];if(!localPeerInfo||replace)return this._peers[peerInfo.id.toB58String()]=peerInfo,peerInfo;peerInfo.multiaddrs.forEach(ma=>localPeerInfo.multiaddrs.add(ma));const ma=peerInfo.isConnected();return ma&&localPeerInfo.connect(ma),peerInfo.protocols.forEach(p=>localPeerInfo.protocols.add(p)),!localPeerInfo.id.privKey&&peerInfo.id.privKey&&(localPeerInfo.id.privKey=peerInfo.id.privKey),!localPeerInfo.id.pubKey&&peerInfo.id.pubKey&&(localPeerInfo.id.pubKey=peerInfo.id.pubKey),localPeerInfo}get(peer){const b58Str=getB58Str(peer),peerInfo=this._peers[b58Str];if(peerInfo)return peerInfo;throw new Error("PeerInfo not found")}getAll(){return this._peers}getAllArray(){return Object.keys(this._peers).map(b58Str=>this._peers[b58Str])}getMultiaddrs(peer){return this.get(peer).multiaddrs.toArray()}remove(peer){const b58Str=getB58Str(peer);this._peers[b58Str]&&delete this._peers[b58Str]}}module.exports=PeerBook}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function ensureMultiaddr(ma){return multiaddr.isMultiaddr(ma)?ma:multiaddr(ma)}const multiaddr=__webpack_require__(24);module.exports={ensureMultiaddr:ensureMultiaddr}},function(module,exports,__webpack_require__){var Source=__webpack_require__(96),Sink=__webpack_require__(248);module.exports=function(){var source=Source(),sink=Sink();return{source:source,sink:sink,resolve:function(duplex){source.resolve(duplex.source),sink.resolve(duplex.sink)}}}},function(module,exports){module.exports=function(stream){function consume(_read){if(!_read)throw new Error("must be passed a readable");read=_read,started&&stream(read)}var read,started=!1;Math.random();return consume.resolve=consume.ready=consume.start=function(_stream){return started=!0,stream=_stream||stream,read&&stream(read),consume},consume}},function(module,exports){module.exports=function(onPause){function reader(_read){return read=_read,function(abort,cb){paused?wait=[abort,cb]:read(abort,cb)}}var wait,read,paused;return reader.pause=function(){paused||onPause&&onPause(paused=!0)},reader.resume=function(){if(paused&&(paused=!1,onPause&&onPause(paused),wait)){var _wait=wait;wait=null,read(_wait[0],_wait[1])}},reader}},function(module,exports,__webpack_require__){"use strict";function isInteger(i){return Number.isFinite(i)}function isFunction(f){return"function"==typeof f}function maxDelay(fn,delay){return delay?function(a,cb){var timer=setTimeout(function(){fn(new Error("pull-reader: read exceeded timeout"),cb)},delay);fn(a,function(err,value){clearTimeout(timer),cb(err,value)})}:fn}var State=__webpack_require__(601);module.exports=function(timeout){function drain(){for(;queue.length;)if(null==queue[0].length&&state.has(1))queue.shift().cb(null,state.get());else if(state.has(queue[0].length)){var next=queue.shift();next.cb(null,state.get(next.length))}else{if(!ended)return!!queue.length;queue.shift().cb(ended)}return queue.length||!state.has(1)||abort}function more(){drain()&&!reading&&(!read||reading||streaming||(reading=!0,readTimed(null,function(err,data){if(reading=!1,err)return ended=err,drain();state.add(data),more()})))}function reader(_read){if(abort){for(;queue.length;)queue.shift().cb(abort);return cb&&cb(abort)}readTimed=maxDelay(_read,timeout),read=_read,more()}var read,readTimed,ended,streaming,abort,queue=[],reading=!1,state=State();return reader.abort=function(err,cb){abort=err||!0,read?(reading=!0,read(abort,function(){for(;queue.length;)queue.shift().cb(abort);cb&&cb(abort)})):cb()},reader.read=function(len,_timeout,cb){if(isFunction(_timeout)&&(cb=_timeout,_timeout=timeout),!isFunction(cb))return streaming=!0,function(abort,cb){if(reading||state.has(1)){if(abort)return read(abort,cb);queue.push({length:null,cb:cb}),more()}else maxDelay(read,_timeout)(abort,function(err,data){cb(err,data)})};queue.push({length:isInteger(len)?len:null,cb:cb}),more()},reader}},function(module,exports,__webpack_require__){(function(setImmediate,process){function duplex(reader,read){function drain(){if(waiting=!1,read&&!busy){for(;output.length&&!s.paused;)s.emit("data",output.shift());if(!s.paused){if(_ended)return s.emit("end");busy=!0,read(null,function next(end,data){busy=!1,s.paused?(end===!0?_ended=end:end?s.emit("error",end):output.push(data),waiting=!0):end&&(ended=end)!==!0?s.emit("error",end):(ended=ended||end)?s.emit("end"):(s.emit("data",data),busy=!0,read(null,next))})}}}reader&&"object"==typeof reader&&(read=reader.source,reader=reader.sink);var ended,needDrain,cbs=[],input=[],s=new Stream;s.writable=s.readable=!0,s.write=function(data){return cbs.length?cbs.shift()(null,data):input.push(data),cbs.length||(needDrain=!0),!!cbs.length},s.end=function(){read?input.length?drain():read(ended=!0,cbs.length?cbs.shift():function(){}):cbs.length&&cbs.shift()(!0)},s.source=function(end,cb){input.length?(cb(null,input.shift()),input.length||s.emit("drain")):((ended=ended||end)?cb(ended):cbs.push(cb),needDrain&&(needDrain=!1,s.emit("drain")))};var n;reader&&(n=reader(s.source)),n&&!read&&(read=n);var output=[],_ended=!1,waiting=!1,busy=!1;if(s.sink=function(_read){read=_read,next(drain)},read){s.sink(read);var pipe=s.pipe.bind(s);s.pipe=function(dest,opts){var res=pipe(dest,opts);return s.paused&&s.resume(),res}}return s.pause=function(){return s.paused=!0,s},s.resume=function(){return s.paused=!1,drain(),s},s.destroy=function(){!ended&&read&&read(ended=!0,function(){}),ended=!0,cbs.length&&cbs.shift()(!0),s.emit("close")},s}var Stream=__webpack_require__(25);module.exports=duplex,module.exports.source=function(source){return duplex(null,source)},module.exports.sink=function(sink){return duplex(sink,null)};var next=void 0===setImmediate?process.nextTick:setImmediate}).call(exports,__webpack_require__(37).setImmediate,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";module.exports=function pull(a){var length=arguments.length;if("function"==typeof a&&1===a.length){for(var args=new Array(length),i=0;i0?("string"==typeof chunk||state.objectMode||Object.getPrototypeOf(chunk)===Buffer.prototype||(chunk=_uint8ArrayToBuffer(chunk)),addToFront?state.endEmitted?stream.emit("error",new Error("stream.unshift() after end event")):addChunk(stream,state,chunk,!0):state.ended?stream.emit("error",new Error("stream.push() after EOF")):(state.reading=!1,state.decoder&&!encoding?(chunk=state.decoder.write(chunk),state.objectMode||0!==chunk.length?addChunk(stream,state,chunk,!1):maybeReadMore(stream,state)):addChunk(stream,state,chunk,!1))):addToFront||(state.reading=!1)}return needMoreData(state)}function addChunk(stream,state,chunk,addToFront){state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream)),maybeReadMore(stream,state)}function chunkInvalid(state,chunk){var er;return _isUint8Array(chunk)||"string"==typeof chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||0===state.length&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}function onEofChunk(stream,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?processNextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,processNextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return nstr.length?str.length:n;if(ret+=nb===str.length?str:str.slice(0,n),0===(n-=nb)){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=Buffer.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),0===(n-=nb)){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,processNextTick(endReadableNT,state,stream))}function endReadableNT(state,stream){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}function indexOf(xs,x){for(var i=0,l=xs.length;i=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n0?fromList(n,state):null,null===ret?(state.needReadable=!0,n=0):state.length-=n,0===state.length&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),null!==ret&&this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable,unpipeInfo){debug("onunpipe"),readable===src&&unpipeInfo&&unpipeInfo.hasUnpiped===!1&&(unpipeInfo.hasUnpiped=!0,cleanup())}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",unpipe),src.removeListener("data",ondata),cleanedUp=!0,!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain()}function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1,!1!==dest.write(chunk)||increasedAwaitDrain||((1===state.pipesCount&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EElistenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:unpipe;state.endEmitted?processNextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1,increasedAwaitDrain=!1;return src.on("data",ondata),prependListener(dest,"error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState,unpipeInfo={hasUnpiped:!1};if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this,unpipeInfo),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i>>32-n}function fn1(a,b,c,d,e,m,k,s){return rotl(a+(b^c^d)+m+k|0,s)+e|0}function fn2(a,b,c,d,e,m,k,s){return rotl(a+(b&c|~b&d)+m+k|0,s)+e|0}function fn3(a,b,c,d,e,m,k,s){return rotl(a+((b|~c)^d)+m+k|0,s)+e|0}function fn4(a,b,c,d,e,m,k,s){return rotl(a+(b&d|c&~d)+m+k|0,s)+e|0}function fn5(a,b,c,d,e,m,k,s){return rotl(a+(b^(c|~d))+m+k|0,s)+e|0}var inherits=__webpack_require__(1),HashBase=__webpack_require__(376);inherits(RIPEMD160,HashBase),RIPEMD160.prototype._update=function(){for(var m=new Array(16),i=0;i<16;++i)m[i]=this._block.readInt32LE(4*i);var al=this._a,bl=this._b,cl=this._c,dl=this._d,el=this._e;al=fn1(al,bl,cl,dl,el,m[0],0,11),cl=rotl(cl,10),el=fn1(el,al,bl,cl,dl,m[1],0,14),bl=rotl(bl,10),dl=fn1(dl,el,al,bl,cl,m[2],0,15),al=rotl(al,10),cl=fn1(cl,dl,el,al,bl,m[3],0,12),el=rotl(el,10),bl=fn1(bl,cl,dl,el,al,m[4],0,5),dl=rotl(dl,10),al=fn1(al,bl,cl,dl,el,m[5],0,8),cl=rotl(cl,10),el=fn1(el,al,bl,cl,dl,m[6],0,7),bl=rotl(bl,10),dl=fn1(dl,el,al,bl,cl,m[7],0,9),al=rotl(al,10),cl=fn1(cl,dl,el,al,bl,m[8],0,11),el=rotl(el,10),bl=fn1(bl,cl,dl,el,al,m[9],0,13),dl=rotl(dl,10),al=fn1(al,bl,cl,dl,el,m[10],0,14),cl=rotl(cl,10),el=fn1(el,al,bl,cl,dl,m[11],0,15),bl=rotl(bl,10),dl=fn1(dl,el,al,bl,cl,m[12],0,6),al=rotl(al,10),cl=fn1(cl,dl,el,al,bl,m[13],0,7),el=rotl(el,10),bl=fn1(bl,cl,dl,el,al,m[14],0,9),dl=rotl(dl,10),al=fn1(al,bl,cl,dl,el,m[15],0,8),cl=rotl(cl,10),el=fn2(el,al,bl,cl,dl,m[7],1518500249,7),bl=rotl(bl,10),dl=fn2(dl,el,al,bl,cl,m[4],1518500249,6),al=rotl(al,10),cl=fn2(cl,dl,el,al,bl,m[13],1518500249,8),el=rotl(el,10),bl=fn2(bl,cl,dl,el,al,m[1],1518500249,13),dl=rotl(dl,10),al=fn2(al,bl,cl,dl,el,m[10],1518500249,11),cl=rotl(cl,10),el=fn2(el,al,bl,cl,dl,m[6],1518500249,9),bl=rotl(bl,10),dl=fn2(dl,el,al,bl,cl,m[15],1518500249,7),al=rotl(al,10),cl=fn2(cl,dl,el,al,bl,m[3],1518500249,15),el=rotl(el,10),bl=fn2(bl,cl,dl,el,al,m[12],1518500249,7),dl=rotl(dl,10),al=fn2(al,bl,cl,dl,el,m[0],1518500249,12),cl=rotl(cl,10),el=fn2(el,al,bl,cl,dl,m[9],1518500249,15),bl=rotl(bl,10),dl=fn2(dl,el,al,bl,cl,m[5],1518500249,9),al=rotl(al,10),cl=fn2(cl,dl,el,al,bl,m[2],1518500249,11),el=rotl(el,10),bl=fn2(bl,cl,dl,el,al,m[14],1518500249,7),dl=rotl(dl,10),al=fn2(al,bl,cl,dl,el,m[11],1518500249,13),cl=rotl(cl,10),el=fn2(el,al,bl,cl,dl,m[8],1518500249,12),bl=rotl(bl,10),dl=fn3(dl,el,al,bl,cl,m[3],1859775393,11),al=rotl(al,10),cl=fn3(cl,dl,el,al,bl,m[10],1859775393,13),el=rotl(el,10),bl=fn3(bl,cl,dl,el,al,m[14],1859775393,6),dl=rotl(dl,10),al=fn3(al,bl,cl,dl,el,m[4],1859775393,7),cl=rotl(cl,10),el=fn3(el,al,bl,cl,dl,m[9],1859775393,14),bl=rotl(bl,10),dl=fn3(dl,el,al,bl,cl,m[15],1859775393,9),al=rotl(al,10),cl=fn3(cl,dl,el,al,bl,m[8],1859775393,13),el=rotl(el,10),bl=fn3(bl,cl,dl,el,al,m[1],1859775393,15),dl=rotl(dl,10),al=fn3(al,bl,cl,dl,el,m[2],1859775393,14),cl=rotl(cl,10),el=fn3(el,al,bl,cl,dl,m[7],1859775393,8),bl=rotl(bl,10),dl=fn3(dl,el,al,bl,cl,m[0],1859775393,13),al=rotl(al,10),cl=fn3(cl,dl,el,al,bl,m[6],1859775393,6),el=rotl(el,10),bl=fn3(bl,cl,dl,el,al,m[13],1859775393,5),dl=rotl(dl,10),al=fn3(al,bl,cl,dl,el,m[11],1859775393,12),cl=rotl(cl,10),el=fn3(el,al,bl,cl,dl,m[5],1859775393,7),bl=rotl(bl,10),dl=fn3(dl,el,al,bl,cl,m[12],1859775393,5),al=rotl(al,10),cl=fn4(cl,dl,el,al,bl,m[1],2400959708,11),el=rotl(el,10),bl=fn4(bl,cl,dl,el,al,m[9],2400959708,12),dl=rotl(dl,10),al=fn4(al,bl,cl,dl,el,m[11],2400959708,14),cl=rotl(cl,10),el=fn4(el,al,bl,cl,dl,m[10],2400959708,15),bl=rotl(bl,10),dl=fn4(dl,el,al,bl,cl,m[0],2400959708,14),al=rotl(al,10),cl=fn4(cl,dl,el,al,bl,m[8],2400959708,15),el=rotl(el,10),bl=fn4(bl,cl,dl,el,al,m[12],2400959708,9),dl=rotl(dl,10),al=fn4(al,bl,cl,dl,el,m[4],2400959708,8),cl=rotl(cl,10),el=fn4(el,al,bl,cl,dl,m[13],2400959708,9),bl=rotl(bl,10),dl=fn4(dl,el,al,bl,cl,m[3],2400959708,14),al=rotl(al,10),cl=fn4(cl,dl,el,al,bl,m[7],2400959708,5),el=rotl(el,10),bl=fn4(bl,cl,dl,el,al,m[15],2400959708,6),dl=rotl(dl,10),al=fn4(al,bl,cl,dl,el,m[14],2400959708,8),cl=rotl(cl,10),el=fn4(el,al,bl,cl,dl,m[5],2400959708,6),bl=rotl(bl,10),dl=fn4(dl,el,al,bl,cl,m[6],2400959708,5),al=rotl(al,10),cl=fn4(cl,dl,el,al,bl,m[2],2400959708,12),el=rotl(el,10),bl=fn5(bl,cl,dl,el,al,m[4],2840853838,9),dl=rotl(dl,10),al=fn5(al,bl,cl,dl,el,m[0],2840853838,15),cl=rotl(cl,10),el=fn5(el,al,bl,cl,dl,m[5],2840853838,5),bl=rotl(bl,10),dl=fn5(dl,el,al,bl,cl,m[9],2840853838,11),al=rotl(al,10),cl=fn5(cl,dl,el,al,bl,m[7],2840853838,6),el=rotl(el,10),bl=fn5(bl,cl,dl,el,al,m[12],2840853838,8),dl=rotl(dl,10),al=fn5(al,bl,cl,dl,el,m[2],2840853838,13),cl=rotl(cl,10),el=fn5(el,al,bl,cl,dl,m[10],2840853838,12),bl=rotl(bl,10),dl=fn5(dl,el,al,bl,cl,m[14],2840853838,5),al=rotl(al,10),cl=fn5(cl,dl,el,al,bl,m[1],2840853838,12),el=rotl(el,10),bl=fn5(bl,cl,dl,el,al,m[3],2840853838,13),dl=rotl(dl,10),al=fn5(al,bl,cl,dl,el,m[8],2840853838,14),cl=rotl(cl,10),el=fn5(el,al,bl,cl,dl,m[11],2840853838,11),bl=rotl(bl,10),dl=fn5(dl,el,al,bl,cl,m[6],2840853838,8),al=rotl(al,10),cl=fn5(cl,dl,el,al,bl,m[15],2840853838,5),el=rotl(el,10),bl=fn5(bl,cl,dl,el,al,m[13],2840853838,6),dl=rotl(dl,10);var ar=this._a,br=this._b,cr=this._c,dr=this._d,er=this._e;ar=fn5(ar,br,cr,dr,er,m[5],1352829926,8),cr=rotl(cr,10),er=fn5(er,ar,br,cr,dr,m[14],1352829926,9),br=rotl(br,10),dr=fn5(dr,er,ar,br,cr,m[7],1352829926,9),ar=rotl(ar,10),cr=fn5(cr,dr,er,ar,br,m[0],1352829926,11),er=rotl(er,10),br=fn5(br,cr,dr,er,ar,m[9],1352829926,13),dr=rotl(dr,10),ar=fn5(ar,br,cr,dr,er,m[2],1352829926,15),cr=rotl(cr,10),er=fn5(er,ar,br,cr,dr,m[11],1352829926,15),br=rotl(br,10),dr=fn5(dr,er,ar,br,cr,m[4],1352829926,5),ar=rotl(ar,10),cr=fn5(cr,dr,er,ar,br,m[13],1352829926,7),er=rotl(er,10),br=fn5(br,cr,dr,er,ar,m[6],1352829926,7),dr=rotl(dr,10),ar=fn5(ar,br,cr,dr,er,m[15],1352829926,8),cr=rotl(cr,10),er=fn5(er,ar,br,cr,dr,m[8],1352829926,11),br=rotl(br,10),dr=fn5(dr,er,ar,br,cr,m[1],1352829926,14),ar=rotl(ar,10),cr=fn5(cr,dr,er,ar,br,m[10],1352829926,14),er=rotl(er,10),br=fn5(br,cr,dr,er,ar,m[3],1352829926,12),dr=rotl(dr,10),ar=fn5(ar,br,cr,dr,er,m[12],1352829926,6),cr=rotl(cr,10),er=fn4(er,ar,br,cr,dr,m[6],1548603684,9),br=rotl(br,10),dr=fn4(dr,er,ar,br,cr,m[11],1548603684,13),ar=rotl(ar,10),cr=fn4(cr,dr,er,ar,br,m[3],1548603684,15),er=rotl(er,10),br=fn4(br,cr,dr,er,ar,m[7],1548603684,7),dr=rotl(dr,10),ar=fn4(ar,br,cr,dr,er,m[0],1548603684,12),cr=rotl(cr,10),er=fn4(er,ar,br,cr,dr,m[13],1548603684,8),br=rotl(br,10),dr=fn4(dr,er,ar,br,cr,m[5],1548603684,9),ar=rotl(ar,10),cr=fn4(cr,dr,er,ar,br,m[10],1548603684,11),er=rotl(er,10),br=fn4(br,cr,dr,er,ar,m[14],1548603684,7),dr=rotl(dr,10),ar=fn4(ar,br,cr,dr,er,m[15],1548603684,7),cr=rotl(cr,10),er=fn4(er,ar,br,cr,dr,m[8],1548603684,12),br=rotl(br,10),dr=fn4(dr,er,ar,br,cr,m[12],1548603684,7),ar=rotl(ar,10),cr=fn4(cr,dr,er,ar,br,m[4],1548603684,6),er=rotl(er,10),br=fn4(br,cr,dr,er,ar,m[9],1548603684,15),dr=rotl(dr,10),ar=fn4(ar,br,cr,dr,er,m[1],1548603684,13),cr=rotl(cr,10),er=fn4(er,ar,br,cr,dr,m[2],1548603684,11),br=rotl(br,10),dr=fn3(dr,er,ar,br,cr,m[15],1836072691,9),ar=rotl(ar,10),cr=fn3(cr,dr,er,ar,br,m[5],1836072691,7),er=rotl(er,10),br=fn3(br,cr,dr,er,ar,m[1],1836072691,15),dr=rotl(dr,10),ar=fn3(ar,br,cr,dr,er,m[3],1836072691,11),cr=rotl(cr,10),er=fn3(er,ar,br,cr,dr,m[7],1836072691,8),br=rotl(br,10),dr=fn3(dr,er,ar,br,cr,m[14],1836072691,6),ar=rotl(ar,10),cr=fn3(cr,dr,er,ar,br,m[6],1836072691,6),er=rotl(er,10),br=fn3(br,cr,dr,er,ar,m[9],1836072691,14),dr=rotl(dr,10),ar=fn3(ar,br,cr,dr,er,m[11],1836072691,12),cr=rotl(cr,10),er=fn3(er,ar,br,cr,dr,m[8],1836072691,13),br=rotl(br,10),dr=fn3(dr,er,ar,br,cr,m[12],1836072691,5),ar=rotl(ar,10),cr=fn3(cr,dr,er,ar,br,m[2],1836072691,14),er=rotl(er,10),br=fn3(br,cr,dr,er,ar,m[10],1836072691,13),dr=rotl(dr,10),ar=fn3(ar,br,cr,dr,er,m[0],1836072691,13),cr=rotl(cr,10),er=fn3(er,ar,br,cr,dr,m[4],1836072691,7),br=rotl(br,10),dr=fn3(dr,er,ar,br,cr,m[13],1836072691,5),ar=rotl(ar,10),cr=fn2(cr,dr,er,ar,br,m[8],2053994217,15),er=rotl(er,10),br=fn2(br,cr,dr,er,ar,m[6],2053994217,5),dr=rotl(dr,10),ar=fn2(ar,br,cr,dr,er,m[4],2053994217,8),cr=rotl(cr,10),er=fn2(er,ar,br,cr,dr,m[1],2053994217,11),br=rotl(br,10),dr=fn2(dr,er,ar,br,cr,m[3],2053994217,14),ar=rotl(ar,10),cr=fn2(cr,dr,er,ar,br,m[11],2053994217,14),er=rotl(er,10),br=fn2(br,cr,dr,er,ar,m[15],2053994217,6),dr=rotl(dr,10),ar=fn2(ar,br,cr,dr,er,m[0],2053994217,14),cr=rotl(cr,10),er=fn2(er,ar,br,cr,dr,m[5],2053994217,6),br=rotl(br,10),dr=fn2(dr,er,ar,br,cr,m[12],2053994217,9),ar=rotl(ar,10),cr=fn2(cr,dr,er,ar,br,m[2],2053994217,12),er=rotl(er,10),br=fn2(br,cr,dr,er,ar,m[13],2053994217,9),dr=rotl(dr,10),ar=fn2(ar,br,cr,dr,er,m[9],2053994217,12),cr=rotl(cr,10),er=fn2(er,ar,br,cr,dr,m[7],2053994217,5),br=rotl(br,10),dr=fn2(dr,er,ar,br,cr,m[10],2053994217,15),ar=rotl(ar,10),cr=fn2(cr,dr,er,ar,br,m[14],2053994217,8),er=rotl(er,10),br=fn1(br,cr,dr,er,ar,m[12],0,8),dr=rotl(dr,10),ar=fn1(ar,br,cr,dr,er,m[15],0,5),cr=rotl(cr,10),er=fn1(er,ar,br,cr,dr,m[10],0,12),br=rotl(br,10),dr=fn1(dr,er,ar,br,cr,m[4],0,9),ar=rotl(ar,10),cr=fn1(cr,dr,er,ar,br,m[1],0,12),er=rotl(er,10),br=fn1(br,cr,dr,er,ar,m[5],0,5),dr=rotl(dr,10),ar=fn1(ar,br,cr,dr,er,m[8],0,14),cr=rotl(cr,10),er=fn1(er,ar,br,cr,dr,m[7],0,6),br=rotl(br,10),dr=fn1(dr,er,ar,br,cr,m[6],0,8),ar=rotl(ar,10),cr=fn1(cr,dr,er,ar,br,m[2],0,13),er=rotl(er,10),br=fn1(br,cr,dr,er,ar,m[13],0,6),dr=rotl(dr,10),ar=fn1(ar,br,cr,dr,er,m[14],0,5),cr=rotl(cr,10),er=fn1(er,ar,br,cr,dr,m[0],0,15),br=rotl(br,10),dr=fn1(dr,er,ar,br,cr,m[3],0,13),ar=rotl(ar,10),cr=fn1(cr,dr,er,ar,br,m[9],0,11),er=rotl(er,10),br=fn1(br,cr,dr,er,ar,m[11],0,11),dr=rotl(dr,10);var t=this._b+cl+dr|0;this._b=this._c+dl+er|0,this._c=this._d+el+ar|0,this._d=this._e+al+br|0,this._e=this._a+bl+cr|0,this._a=t},RIPEMD160.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var buffer=new Buffer(20);return buffer.writeInt32LE(this._a,0),buffer.writeInt32LE(this._b,4),buffer.writeInt32LE(this._c,8),buffer.writeInt32LE(this._d,12),buffer.writeInt32LE(this._e,16),buffer},module.exports=RIPEMD160}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function initCompressedValue(value,defaultValue){return void 0===value?defaultValue:(assert.isBoolean(value,messages.COMPRESSED_TYPE_INVALID),value)}var assert=__webpack_require__(645),der=__webpack_require__(646),messages=__webpack_require__(121);module.exports=function(secp256k1){return{privateKeyVerify:function(privateKey){return assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),32===privateKey.length&&secp256k1.privateKeyVerify(privateKey)},privateKeyExport:function(privateKey,compressed){assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),assert.isBufferLength(privateKey,32,messages.EC_PRIVATE_KEY_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0);var publicKey=secp256k1.privateKeyExport(privateKey,compressed);return der.privateKeyExport(privateKey,publicKey,compressed)},privateKeyImport:function(privateKey){if(assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),(privateKey=der.privateKeyImport(privateKey))&&32===privateKey.length&&secp256k1.privateKeyVerify(privateKey))return privateKey;throw new Error(messages.EC_PRIVATE_KEY_IMPORT_DER_FAIL)},privateKeyTweakAdd:function(privateKey,tweak){return assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),assert.isBufferLength(privateKey,32,messages.EC_PRIVATE_KEY_LENGTH_INVALID),assert.isBuffer(tweak,messages.TWEAK_TYPE_INVALID),assert.isBufferLength(tweak,32,messages.TWEAK_LENGTH_INVALID),secp256k1.privateKeyTweakAdd(privateKey,tweak)},privateKeyTweakMul:function(privateKey,tweak){return assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),assert.isBufferLength(privateKey,32,messages.EC_PRIVATE_KEY_LENGTH_INVALID),assert.isBuffer(tweak,messages.TWEAK_TYPE_INVALID),assert.isBufferLength(tweak,32,messages.TWEAK_LENGTH_INVALID),secp256k1.privateKeyTweakMul(privateKey,tweak)},publicKeyCreate:function(privateKey,compressed){return assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),assert.isBufferLength(privateKey,32,messages.EC_PRIVATE_KEY_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0),secp256k1.publicKeyCreate(privateKey,compressed)},publicKeyConvert:function(publicKey,compressed){return assert.isBuffer(publicKey,messages.EC_PUBLIC_KEY_TYPE_INVALID),assert.isBufferLength2(publicKey,33,65,messages.EC_PUBLIC_KEY_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0),secp256k1.publicKeyConvert(publicKey,compressed)},publicKeyVerify:function(publicKey){return assert.isBuffer(publicKey,messages.EC_PUBLIC_KEY_TYPE_INVALID), +secp256k1.publicKeyVerify(publicKey)},publicKeyTweakAdd:function(publicKey,tweak,compressed){return assert.isBuffer(publicKey,messages.EC_PUBLIC_KEY_TYPE_INVALID),assert.isBufferLength2(publicKey,33,65,messages.EC_PUBLIC_KEY_LENGTH_INVALID),assert.isBuffer(tweak,messages.TWEAK_TYPE_INVALID),assert.isBufferLength(tweak,32,messages.TWEAK_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0),secp256k1.publicKeyTweakAdd(publicKey,tweak,compressed)},publicKeyTweakMul:function(publicKey,tweak,compressed){return assert.isBuffer(publicKey,messages.EC_PUBLIC_KEY_TYPE_INVALID),assert.isBufferLength2(publicKey,33,65,messages.EC_PUBLIC_KEY_LENGTH_INVALID),assert.isBuffer(tweak,messages.TWEAK_TYPE_INVALID),assert.isBufferLength(tweak,32,messages.TWEAK_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0),secp256k1.publicKeyTweakMul(publicKey,tweak,compressed)},publicKeyCombine:function(publicKeys,compressed){assert.isArray(publicKeys,messages.EC_PUBLIC_KEYS_TYPE_INVALID),assert.isLengthGTZero(publicKeys,messages.EC_PUBLIC_KEYS_LENGTH_INVALID);for(var i=0;i=0||y.ucmp(BN.p)>=0?null:6!==first&&7!==first||y.isOdd()===(7===first)?0!==x.redSqr().redMul(x).redIAdd7().ucmp(y.redSqr())?null:new ECPoint(x,y):null):(x=BN.fromBuffer(publicKey.slice(1,33)),x.ucmp(BN.p)>=0?null:null===(y=x.redSqr().redMul(x).redIAdd7().redSqrt())?null:(3===first!==y.isOdd()&&(y=y.redNeg()),new ECPoint(x,y)))},ECPoint.prototype.toPublicKey=function(compressed){var publicKey,x=this.x,y=this.y;return compressed?(publicKey=Buffer.alloc(33),publicKey[0]=y.isOdd()?3:2,x.toBuffer().copy(publicKey,1)):(publicKey=Buffer.alloc(65),publicKey[0]=4,x.toBuffer().copy(publicKey,1),y.toBuffer().copy(publicKey,33)),publicKey},ECPoint.fromECJPoint=function(p){if(p.inf)return new ECPoint(null,null);var zinv=p.z.redInvm(),zinv2=zinv.redSqr();return new ECPoint(p.x.redMul(zinv2),p.y.redMul(zinv2).redMul(zinv))},ECPoint.prototype.toECJPoint=function(){return this.inf?new ECJPoint(null,null,null):new ECJPoint(this.x,this.y,ECJPoint.one)},ECPoint.prototype.neg=function(){return this.inf?this:new ECPoint(this.x,this.y.redNeg())},ECPoint.prototype.add=function(p){if(this.inf)return p;if(p.inf)return this;if(0===this.x.ucmp(p.x))return 0===this.y.ucmp(p.y)?this.dbl():new ECPoint(null,null);var s=this.y.redSub(p.y);s.isZero()||(s=s.redMul(this.x.redSub(p.x).redInvm()));var nx=s.redSqr().redISub(this.x).redISub(p.x);return new ECPoint(nx,s.redMul(this.x.redSub(nx)).redISub(this.y))},ECPoint.prototype.dbl=function(){if(this.inf)return this;var yy=this.y.redAdd(this.y);if(yy.isZero())return new ECPoint(null,null);var x2=this.x.redSqr(),s=x2.redAdd(x2).redIAdd(x2).redMul(yy.redInvm()),nx=s.redSqr().redISub(this.x.redAdd(this.x));return new ECPoint(nx,s.redMul(this.x.redSub(nx)).redISub(this.y))},ECPoint.prototype.mul=function(num){for(var nafPoints=this._getNAFPoints(4),points=nafPoints.points,naf=num.getNAF(nafPoints.wnd),acc=new ECJPoint(null,null,null),i=naf.length-1;i>=0;i--){for(var k=0;i>=0&&0===naf[i];i--,++k);if(i>=0&&(k+=1),acc=acc.dblp(k),i<0)break;var z=naf[i];acc=z>0?acc.mixedAdd(points[z-1>>1]):acc.mixedAdd(points[-z-1>>1].neg())}return ECPoint.fromECJPoint(acc)},ECPoint.prototype._getNAFPoints1=function(){return{wnd:1,points:[this]}},ECPoint.prototype._getNAFPoints=function(wnd){var points=new Array((1<>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10)}function sigma1(x){return(x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7)}function gamma0(x){return(x>>>7|x<<25)^(x>>>18|x<<14)^x>>>3}function gamma1(x){return(x>>>17|x<<15)^(x>>>19|x<<13)^x>>>10}var inherits=__webpack_require__(1),Hash=__webpack_require__(56),K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],W=new Array(64);inherits(Sha256,Hash),Sha256.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},Sha256.prototype._update=function(M){for(var W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,f=0|this._f,g=0|this._g,h=0|this._h,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<64;++i)W[i]=gamma1(W[i-2])+W[i-7]+gamma0(W[i-15])+W[i-16]|0;for(var j=0;j<64;++j){var T1=h+sigma1(e)+ch(e,f,g)+K[j]+W[j]|0,T2=sigma0(a)+maj(a,b,c)|0;h=g,g=f,f=e,e=d+T1|0,d=c,c=b,b=a,a=T1+T2|0}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0,this._f=f+this._f|0,this._g=g+this._g|0,this._h=h+this._h|0},Sha256.prototype._hash=function(){var H=new Buffer(32);return H.writeInt32BE(this._a,0),H.writeInt32BE(this._b,4),H.writeInt32BE(this._c,8),H.writeInt32BE(this._d,12),H.writeInt32BE(this._e,16),H.writeInt32BE(this._f,20),H.writeInt32BE(this._g,24),H.writeInt32BE(this._h,28),H},module.exports=Sha256}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Sha512(){this.init(),this._w=W,Hash.call(this,128,112)}function Ch(x,y,z){return z^x&(y^z)}function maj(x,y,z){return x&y|z&(x|y)}function sigma0(x,xl){return(x>>>28|xl<<4)^(xl>>>2|x<<30)^(xl>>>7|x<<25)}function sigma1(x,xl){return(x>>>14|xl<<18)^(x>>>18|xl<<14)^(xl>>>9|x<<23)}function Gamma0(x,xl){return(x>>>1|xl<<31)^(x>>>8|xl<<24)^x>>>7}function Gamma0l(x,xl){return(x>>>1|xl<<31)^(x>>>8|xl<<24)^(x>>>7|xl<<25)}function Gamma1(x,xl){return(x>>>19|xl<<13)^(xl>>>29|x<<3)^x>>>6}function Gamma1l(x,xl){return(x>>>19|xl<<13)^(xl>>>29|x<<3)^(x>>>6|xl<<26)}function getCarry(a,b){return a>>>0>>0?1:0}var inherits=__webpack_require__(1),Hash=__webpack_require__(56),K=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],W=new Array(160);inherits(Sha512,Hash),Sha512.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},Sha512.prototype._update=function(M){for(var W=this._w,ah=0|this._ah,bh=0|this._bh,ch=0|this._ch,dh=0|this._dh,eh=0|this._eh,fh=0|this._fh,gh=0|this._gh,hh=0|this._hh,al=0|this._al,bl=0|this._bl,cl=0|this._cl,dl=0|this._dl,el=0|this._el,fl=0|this._fl,gl=0|this._gl,hl=0|this._hl,i=0;i<32;i+=2)W[i]=M.readInt32BE(4*i),W[i+1]=M.readInt32BE(4*i+4);for(;i<160;i+=2){var xh=W[i-30],xl=W[i-30+1],gamma0=Gamma0(xh,xl),gamma0l=Gamma0l(xl,xh);xh=W[i-4],xl=W[i-4+1];var gamma1=Gamma1(xh,xl),gamma1l=Gamma1l(xl,xh),Wi7h=W[i-14],Wi7l=W[i-14+1],Wi16h=W[i-32],Wi16l=W[i-32+1],Wil=gamma0l+Wi7l|0,Wih=gamma0+Wi7h+getCarry(Wil,gamma0l)|0;Wil=Wil+gamma1l|0,Wih=Wih+gamma1+getCarry(Wil,gamma1l)|0,Wil=Wil+Wi16l|0,Wih=Wih+Wi16h+getCarry(Wil,Wi16l)|0,W[i]=Wih,W[i+1]=Wil}for(var j=0;j<160;j+=2){Wih=W[j],Wil=W[j+1];var majh=maj(ah,bh,ch),majl=maj(al,bl,cl),sigma0h=sigma0(ah,al),sigma0l=sigma0(al,ah),sigma1h=sigma1(eh,el),sigma1l=sigma1(el,eh),Kih=K[j],Kil=K[j+1],chh=Ch(eh,fh,gh),chl=Ch(el,fl,gl),t1l=hl+sigma1l|0,t1h=hh+sigma1h+getCarry(t1l,hl)|0;t1l=t1l+chl|0,t1h=t1h+chh+getCarry(t1l,chl)|0,t1l=t1l+Kil|0,t1h=t1h+Kih+getCarry(t1l,Kil)|0,t1l=t1l+Wil|0,t1h=t1h+Wih+getCarry(t1l,Wil)|0;var t2l=sigma0l+majl|0,t2h=sigma0h+majh+getCarry(t2l,sigma0l)|0;hh=gh,hl=gl,gh=fh,gl=fl,fh=eh,fl=el,el=dl+t1l|0,eh=dh+t1h+getCarry(el,dl)|0,dh=ch,dl=cl,ch=bh,cl=bl,bh=ah,bl=al,al=t1l+t2l|0,ah=t1h+t2h+getCarry(al,t1l)|0}this._al=this._al+al|0,this._bl=this._bl+bl|0,this._cl=this._cl+cl|0,this._dl=this._dl+dl|0,this._el=this._el+el|0,this._fl=this._fl+fl|0,this._gl=this._gl+gl|0,this._hl=this._hl+hl|0,this._ah=this._ah+ah+getCarry(this._al,al)|0,this._bh=this._bh+bh+getCarry(this._bl,bl)|0,this._ch=this._ch+ch+getCarry(this._cl,cl)|0,this._dh=this._dh+dh+getCarry(this._dl,dl)|0,this._eh=this._eh+eh+getCarry(this._el,el)|0,this._fh=this._fh+fh+getCarry(this._fl,fl)|0,this._gh=this._gh+gh+getCarry(this._gl,gl)|0,this._hh=this._hh+hh+getCarry(this._hl,hl)|0},Sha512.prototype._hash=function(){function writeInt64BE(h,l,offset){H.writeInt32BE(h,offset),H.writeInt32BE(l,offset+4)}var H=new Buffer(64);return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),writeInt64BE(this._gh,this._gl,48),writeInt64BE(this._hh,this._hl,56),H},module.exports=Sha512}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function Manager(uri,opts){if(!(this instanceof Manager))return new Manager(uri,opts);uri&&"object"==typeof uri&&(opts=uri,uri=void 0),opts=opts||{},opts.path=opts.path||"/socket.io",this.nsps={},this.subs=[],this.opts=opts,this.reconnection(opts.reconnection!==!1),this.reconnectionAttempts(opts.reconnectionAttempts||1/0),this.reconnectionDelay(opts.reconnectionDelay||1e3),this.reconnectionDelayMax(opts.reconnectionDelayMax||5e3),this.randomizationFactor(opts.randomizationFactor||.5),this.backoff=new Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==opts.timeout?2e4:opts.timeout),this.readyState="closed",this.uri=uri,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var _parser=opts.parser||parser;this.encoder=new _parser.Encoder,this.decoder=new _parser.Decoder,this.autoConnect=opts.autoConnect!==!1,this.autoConnect&&this.open()}var eio=__webpack_require__(354),Socket=__webpack_require__(271),Emitter=__webpack_require__(49),parser=__webpack_require__(145),on=__webpack_require__(270),bind=__webpack_require__(173),debug=__webpack_require__(3)("socket.io-client:manager"),indexOf=__webpack_require__(114),Backoff=__webpack_require__(301),has=Object.prototype.hasOwnProperty;module.exports=Manager,Manager.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var nsp in this.nsps)has.call(this.nsps,nsp)&&this.nsps[nsp].emit.apply(this.nsps[nsp],arguments)},Manager.prototype.updateSocketIds=function(){for(var nsp in this.nsps)has.call(this.nsps,nsp)&&(this.nsps[nsp].id=this.generateId(nsp))},Manager.prototype.generateId=function(nsp){return("/"===nsp?"":nsp+"#")+this.engine.id},Emitter(Manager.prototype),Manager.prototype.reconnection=function(v){return arguments.length?(this._reconnection=!!v,this):this._reconnection},Manager.prototype.reconnectionAttempts=function(v){return arguments.length?(this._reconnectionAttempts=v,this):this._reconnectionAttempts},Manager.prototype.reconnectionDelay=function(v){return arguments.length?(this._reconnectionDelay=v,this.backoff&&this.backoff.setMin(v),this):this._reconnectionDelay},Manager.prototype.randomizationFactor=function(v){return arguments.length?(this._randomizationFactor=v,this.backoff&&this.backoff.setJitter(v),this):this._randomizationFactor},Manager.prototype.reconnectionDelayMax=function(v){return arguments.length?(this._reconnectionDelayMax=v,this.backoff&&this.backoff.setMax(v),this):this._reconnectionDelayMax},Manager.prototype.timeout=function(v){return arguments.length?(this._timeout=v,this):this._timeout},Manager.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},Manager.prototype.open=Manager.prototype.connect=function(fn,opts){if(debug("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;debug("opening %s",this.uri),this.engine=eio(this.uri,this.opts);var socket=this.engine,self=this;this.readyState="opening",this.skipReconnect=!1;var openSub=on(socket,"open",function(){self.onopen(),fn&&fn()}),errorSub=on(socket,"error",function(data){if(debug("connect_error"),self.cleanup(),self.readyState="closed",self.emitAll("connect_error",data),fn){var err=new Error("Connection error");err.data=data,fn(err)}else self.maybeReconnectOnOpen()});if(!1!==this._timeout){var timeout=this._timeout;debug("connect attempt will timeout after %d",timeout);var timer=setTimeout(function(){debug("connect attempt timed out after %d",timeout),openSub.destroy(),socket.close(),socket.emit("error","timeout"),self.emitAll("connect_timeout",timeout)},timeout);this.subs.push({destroy:function(){clearTimeout(timer)}})}return this.subs.push(openSub),this.subs.push(errorSub),this},Manager.prototype.onopen=function(){debug("open"),this.cleanup(),this.readyState="open",this.emit("open");var socket=this.engine;this.subs.push(on(socket,"data",bind(this,"ondata"))),this.subs.push(on(socket,"ping",bind(this,"onping"))),this.subs.push(on(socket,"pong",bind(this,"onpong"))),this.subs.push(on(socket,"error",bind(this,"onerror"))),this.subs.push(on(socket,"close",bind(this,"onclose"))),this.subs.push(on(this.decoder,"decoded",bind(this,"ondecoded")))},Manager.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},Manager.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},Manager.prototype.ondata=function(data){this.decoder.add(data)},Manager.prototype.ondecoded=function(packet){this.emit("packet",packet)},Manager.prototype.onerror=function(err){debug("error",err),this.emitAll("error",err)},Manager.prototype.socket=function(nsp,opts){function onConnecting(){~indexOf(self.connecting,socket)||self.connecting.push(socket)}var socket=this.nsps[nsp];if(!socket){socket=new Socket(this,nsp,opts),this.nsps[nsp]=socket;var self=this;socket.on("connecting",onConnecting),socket.on("connect",function(){socket.id=self.generateId(nsp)}),this.autoConnect&&onConnecting()}return socket},Manager.prototype.destroy=function(socket){var index=indexOf(this.connecting,socket);~index&&this.connecting.splice(index,1),this.connecting.length||this.close()},Manager.prototype.packet=function(packet){debug("writing packet %j",packet);var self=this;packet.query&&0===packet.type&&(packet.nsp+="?"+packet.query),self.encoding?self.packetBuffer.push(packet):(self.encoding=!0,this.encoder.encode(packet,function(encodedPackets){for(var i=0;i0&&!this.encoding){var pack=this.packetBuffer.shift();this.packet(pack)}},Manager.prototype.cleanup=function(){debug("cleanup");for(var subsLength=this.subs.length,i=0;i=this._reconnectionAttempts)debug("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var delay=this.backoff.duration();debug("will wait %dms before reconnect attempt",delay),this.reconnecting=!0;var timer=setTimeout(function(){self.skipReconnect||(debug("attempting reconnect"),self.emitAll("reconnect_attempt",self.backoff.attempts),self.emitAll("reconnecting",self.backoff.attempts),self.skipReconnect||self.open(function(err){err?(debug("reconnect attempt error"),self.reconnecting=!1,self.reconnect(),self.emitAll("reconnect_error",err.data)):(debug("reconnect success"),self.onreconnect())}))},delay);this.subs.push({destroy:function(){clearTimeout(timer)}})}},Manager.prototype.onreconnect=function(){var attempt=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",attempt)}},function(module,exports){function on(obj,ev,fn){return obj.on(ev,fn),{destroy:function(){obj.removeListener(ev,fn)}}}module.exports=on},function(module,exports,__webpack_require__){function Socket(io,nsp,opts){this.io=io,this.nsp=nsp,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,opts&&opts.query&&(this.query=opts.query),this.io.autoConnect&&this.open()}var parser=__webpack_require__(145),Emitter=__webpack_require__(49),toArray=__webpack_require__(668),on=__webpack_require__(270),bind=__webpack_require__(173),debug=__webpack_require__(3)("socket.io-client:socket"),parseqs=__webpack_require__(93);module.exports=Socket;var events={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},emit=Emitter.prototype.emit;Emitter(Socket.prototype),Socket.prototype.subEvents=function(){if(!this.subs){var io=this.io;this.subs=[on(io,"open",bind(this,"onopen")),on(io,"packet",bind(this,"onpacket")),on(io,"close",bind(this,"onclose"))]}},Socket.prototype.open=Socket.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting"),this)},Socket.prototype.send=function(){var args=toArray(arguments);return args.unshift("message"),this.emit.apply(this,args),this},Socket.prototype.emit=function(ev){if(events.hasOwnProperty(ev))return emit.apply(this,arguments),this;var args=toArray(arguments),packet={type:parser.EVENT,data:args};return packet.options={},packet.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof args[args.length-1]&&(debug("emitting packet with ack id %d",this.ids),this.acks[this.ids]=args.pop(),packet.id=this.ids++),this.connected?this.packet(packet):this.sendBuffer.push(packet),delete this.flags,this},Socket.prototype.packet=function(packet){packet.nsp=this.nsp,this.io.packet(packet)},Socket.prototype.onopen=function(){if(debug("transport is open - connecting"),"/"!==this.nsp)if(this.query){var query="object"==typeof this.query?parseqs.encode(this.query):this.query;debug("sending connect packet with query %s",query),this.packet({type:parser.CONNECT,query:query})}else this.packet({type:parser.CONNECT})},Socket.prototype.onclose=function(reason){debug("close (%s)",reason),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",reason)},Socket.prototype.onpacket=function(packet){if(packet.nsp===this.nsp)switch(packet.type){case parser.CONNECT:this.onconnect();break;case parser.EVENT:this.onevent(packet);break;case parser.BINARY_EVENT:this.onevent(packet);break;case parser.ACK:this.onack(packet);break;case parser.BINARY_ACK:this.onack(packet);break;case parser.DISCONNECT:this.ondisconnect();break;case parser.ERROR:this.emit("error",packet.data)}},Socket.prototype.onevent=function(packet){var args=packet.data||[];debug("emitting event %j",args),null!=packet.id&&(debug("attaching ack callback to event"),args.push(this.ack(packet.id))),this.connected?emit.apply(this,args):this.receiveBuffer.push(args)},Socket.prototype.ack=function(id){var self=this,sent=!1;return function(){if(!sent){sent=!0;var args=toArray(arguments);debug("sending ack %j",args),self.packet({type:parser.ACK,id:id,data:args})}}},Socket.prototype.onack=function(packet){var ack=this.acks[packet.id];"function"==typeof ack?(debug("calling ack %s with %j",packet.id,packet.data),ack.apply(this,packet.data),delete this.acks[packet.id]):debug("bad ack %s",packet.id)},Socket.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},Socket.prototype.emitBuffered=function(){var i;for(i=0;i0);return encoded}function decode(str){var decoded=0;for(i=0;ibytes&&(end=bytes),start>=bytes||start>=end||0===bytes)return new ArrayBuffer(0);for(var abv=new Uint8Array(arraybuffer),result=new Uint8Array(end-start),i=start,ii=0;i=0&&workersList.splice(index,1),task.callback.apply(task,arguments),null!=err&&q.error(err,task.data)}numRunning<=q.concurrency-q.buffer&&q.unsaturated(),q.idle()&&q.drain(),q.process()}}if(null==concurrency)concurrency=1;else if(0===concurrency)throw new Error("Concurrency must not be zero");var _worker=(0,_wrapAsync2.default)(worker),numRunning=0,workersList=[],isProcessing=!1,q={_tasks:new _DoublyLinkedList2.default,concurrency:concurrency,payload:payload,saturated:_noop2.default,unsaturated:_noop2.default,buffer:concurrency/4,empty:_noop2.default,drain:_noop2.default,error:_noop2.default,started:!1,paused:!1,push:function(data,callback){_insert(data,!1,callback)},kill:function(){q.drain=_noop2.default,q._tasks.empty()},unshift:function(data,callback){_insert(data,!0,callback)},remove:function(testFn){q._tasks.remove(testFn)},process:function(){if(!isProcessing){for(isProcessing=!0;!q.paused&&numRunning0&&opts.jitter<=1?opts.jitter:0, +this.attempts=0}module.exports=Backoff,Backoff.prototype.duration=function(){var ms=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var rand=Math.random(),deviation=Math.floor(rand*this.jitter*ms);ms=0==(1&Math.floor(10*rand))?ms-deviation:ms+deviation}return 0|Math.min(ms,this.max)},Backoff.prototype.reset=function(){this.attempts=0},Backoff.prototype.setMin=function(min){this.ms=min},Backoff.prototype.setMax=function(max){this.max=max},Backoff.prototype.setJitter=function(jitter){this.jitter=jitter}},function(module,exports,__webpack_require__){(function(Buffer){module.exports=function(ALPHABET){function encode(source){if(0===source.length)return"";for(var digits=[0],i=0;i0;)digits.push(carry%BASE),carry=carry/BASE|0}for(var string="",k=0;0===source[k]&&k=0;--q)string+=ALPHABET[digits[q]];return string}function decodeUnsafe(string){if(0===string.length)return Buffer.allocUnsafe(0);for(var bytes=[0],i=0;i>=8;for(;carry>0;)bytes.push(255&carry),carry>>=8}for(var k=0;string[k]===LEADER&&k>2],base64+=chars[(3&bytes[i])<<4|bytes[i+1]>>4],base64+=chars[(15&bytes[i+1])<<2|bytes[i+2]>>6],base64+=chars[63&bytes[i+2]];return len%3==2?base64=base64.substring(0,base64.length-1)+"=":len%3==1&&(base64=base64.substring(0,base64.length-2)+"=="),base64},exports.decode=function(base64){var i,encoded1,encoded2,encoded3,encoded4,bufferLength=.75*base64.length,len=base64.length,p=0;"="===base64[base64.length-1]&&(bufferLength--,"="===base64[base64.length-2]&&bufferLength--);var arraybuffer=new ArrayBuffer(bufferLength),bytes=new Uint8Array(arraybuffer);for(i=0;i>4,bytes[p++]=(15&encoded2)<<4|encoded3>>2,bytes[p++]=(3&encoded3)<<6|63&encoded4;return arraybuffer}}()},function(module,exports,__webpack_require__){"use strict";function placeHoldersCount(b64){var len=b64.length;if(len%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===b64[len-2]?2:"="===b64[len-1]?1:0}function byteLength(b64){return 3*b64.length/4-placeHoldersCount(b64)}function toByteArray(b64){var i,l,tmp,placeHolders,arr,len=b64.length;placeHolders=placeHoldersCount(b64),arr=new Arr(3*len/4-placeHolders),l=placeHolders>0?len-4:len;var L=0;for(i=0;i>16&255,arr[L++]=tmp>>8&255,arr[L++]=255&tmp;return 2===placeHolders?(tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4,arr[L++]=255&tmp):1===placeHolders&&(tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2,arr[L++]=tmp>>8&255,arr[L++]=255&tmp),arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[63&num]}function encodeChunk(uint8,start,end){for(var tmp,output=[],i=start;ilen2?len2:i+16383));return 1===extraBytes?(tmp=uint8[len-1],output+=lookup[tmp>>2],output+=lookup[tmp<<4&63],output+="=="):2===extraBytes&&(tmp=(uint8[len-2]<<8)+uint8[len-1],output+=lookup[tmp>>10],output+=lookup[tmp>>4&63],output+=lookup[tmp<<2&63],output+="="),parts.push(output),parts.join("")}exports.byteLength=byteLength,exports.toByteArray=toByteArray,exports.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i72)return!1;if(48!==buffer[0])return!1;if(buffer[1]!==buffer.length-2)return!1;if(2!==buffer[2])return!1;var lenR=buffer[3];if(0===lenR)return!1;if(5+lenR>=buffer.length)return!1;if(2!==buffer[4+lenR])return!1;var lenS=buffer[5+lenR];return 0!==lenS&&(6+lenR+lenS===buffer.length&&(!(128&buffer[4])&&(!(lenR>1&&0===buffer[4]&&!(128&buffer[5]))&&(!(128&buffer[lenR+6])&&!(lenS>1&&0===buffer[lenR+6]&&!(128&buffer[lenR+7]))))))}function decode(buffer){if(buffer.length<8)throw new Error("DER sequence length is too short");if(buffer.length>72)throw new Error("DER sequence length is too long");if(48!==buffer[0])throw new Error("Expected DER sequence");if(buffer[1]!==buffer.length-2)throw new Error("DER sequence length is invalid");if(2!==buffer[2])throw new Error("Expected DER integer");var lenR=buffer[3];if(0===lenR)throw new Error("R length is zero");if(5+lenR>=buffer.length)throw new Error("R length is too long");if(2!==buffer[4+lenR])throw new Error("Expected DER integer (2)");var lenS=buffer[5+lenR];if(0===lenS)throw new Error("S length is zero");if(6+lenR+lenS!==buffer.length)throw new Error("S length is invalid");if(128&buffer[4])throw new Error("R value is negative");if(lenR>1&&0===buffer[4]&&!(128&buffer[5]))throw new Error("R value excessively padded");if(128&buffer[lenR+6])throw new Error("S value is negative");if(lenS>1&&0===buffer[lenR+6]&&!(128&buffer[lenR+7]))throw new Error("S value excessively padded");return{r:buffer.slice(4,4+lenR),s:buffer.slice(6+lenR)}}function encode(r,s){var lenR=r.length,lenS=s.length;if(0===lenR)throw new Error("R length is zero");if(0===lenS)throw new Error("S length is zero");if(lenR>33)throw new Error("R length is too long");if(lenS>33)throw new Error("S length is too long");if(128&r[0])throw new Error("R value is negative");if(128&s[0])throw new Error("S value is negative");if(lenR>1&&0===r[0]&&!(128&r[1]))throw new Error("R value excessively padded");if(lenS>1&&0===s[0]&&!(128&s[1]))throw new Error("S value excessively padded");var signature=Buffer.allocUnsafe(6+lenR+lenS);return signature[0]=48,signature[1]=signature.length-2,signature[2]=2,signature[3]=r.length,r.copy(signature,4),signature[4+lenR]=2,signature[5+lenR]=s.length,s.copy(signature,6+lenR),signature}var Buffer=__webpack_require__(6).Buffer;module.exports={check:check,decode:decode,encode:encode}},function(module,exports,__webpack_require__){function ADD64AA(v,a,b){var o0=v[a]+v[b],o1=v[a+1]+v[b+1];o0>=4294967296&&o1++,v[a]=o0,v[a+1]=o1}function ADD64AC(v,a,b0,b1){var o0=v[a]+b0;b0<0&&(o0+=4294967296);var o1=v[a+1]+b1;o0>=4294967296&&o1++,v[a]=o0,v[a+1]=o1}function B2B_GET32(arr,i){return arr[i]^arr[i+1]<<8^arr[i+2]<<16^arr[i+3]<<24}function B2B_G(a,b,c,d,ix,iy){var x0=m[ix],x1=m[ix+1],y0=m[iy],y1=m[iy+1];ADD64AA(v,a,b),ADD64AC(v,a,x0,x1);var xor0=v[d]^v[a],xor1=v[d+1]^v[a+1];v[d]=xor1,v[d+1]=xor0,ADD64AA(v,c,d),xor0=v[b]^v[c],xor1=v[b+1]^v[c+1],v[b]=xor0>>>24^xor1<<8,v[b+1]=xor1>>>24^xor0<<8,ADD64AA(v,a,b),ADD64AC(v,a,y0,y1),xor0=v[d]^v[a],xor1=v[d+1]^v[a+1],v[d]=xor0>>>16^xor1<<16,v[d+1]=xor1>>>16^xor0<<16,ADD64AA(v,c,d),xor0=v[b]^v[c],xor1=v[b+1]^v[c+1],v[b]=xor1>>>31^xor0<<1,v[b+1]=xor0>>>31^xor1<<1}function blake2bCompress(ctx,last){var i=0;for(i=0;i<16;i++)v[i]=ctx.h[i],v[i+16]=BLAKE2B_IV32[i];for(v[24]=v[24]^ctx.t,v[25]=v[25]^ctx.t/4294967296,last&&(v[28]=~v[28],v[29]=~v[29]),i=0;i<32;i++)m[i]=B2B_GET32(ctx.b,4*i);for(i=0;i<12;i++)B2B_G(0,8,16,24,SIGMA82[16*i+0],SIGMA82[16*i+1]),B2B_G(2,10,18,26,SIGMA82[16*i+2],SIGMA82[16*i+3]),B2B_G(4,12,20,28,SIGMA82[16*i+4],SIGMA82[16*i+5]),B2B_G(6,14,22,30,SIGMA82[16*i+6],SIGMA82[16*i+7]),B2B_G(0,10,20,30,SIGMA82[16*i+8],SIGMA82[16*i+9]),B2B_G(2,12,22,24,SIGMA82[16*i+10],SIGMA82[16*i+11]),B2B_G(4,14,16,26,SIGMA82[16*i+12],SIGMA82[16*i+13]),B2B_G(6,8,18,28,SIGMA82[16*i+14],SIGMA82[16*i+15]);for(i=0;i<16;i++)ctx.h[i]=ctx.h[i]^v[i]^v[i+16]}function blake2bInit(outlen,key){if(0===outlen||outlen>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(key&&key.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");for(var ctx={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:outlen},i=0;i<16;i++)ctx.h[i]=BLAKE2B_IV32[i];var keylen=key?key.length:0;return ctx.h[0]^=16842752^keylen<<8^outlen,key&&(blake2bUpdate(ctx,key),ctx.c=128),ctx}function blake2bUpdate(ctx,input){for(var i=0;i>2]>>8*(3&i);return out}function blake2b(input,key,outlen){outlen=outlen||64,input=util.normalizeInput(input);var ctx=blake2bInit(outlen,key);return blake2bUpdate(ctx,input),blake2bFinal(ctx)}function blake2bHex(input,key,outlen){var output=blake2b(input,key,outlen);return util.toHex(output)}var util=__webpack_require__(161),BLAKE2B_IV32=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),SIGMA8=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],SIGMA82=new Uint8Array(SIGMA8.map(function(x){return 2*x})),v=new Uint32Array(32),m=new Uint32Array(32);module.exports={blake2b:blake2b,blake2bHex:blake2bHex,blake2bInit:blake2bInit,blake2bUpdate:blake2bUpdate,blake2bFinal:blake2bFinal}},function(module,exports,__webpack_require__){function B2S_GET32(v,i){return v[i]^v[i+1]<<8^v[i+2]<<16^v[i+3]<<24}function B2S_G(a,b,c,d,x,y){v[a]=v[a]+v[b]+x,v[d]=ROTR32(v[d]^v[a],16),v[c]=v[c]+v[d],v[b]=ROTR32(v[b]^v[c],12),v[a]=v[a]+v[b]+y,v[d]=ROTR32(v[d]^v[a],8),v[c]=v[c]+v[d],v[b]=ROTR32(v[b]^v[c],7)}function ROTR32(x,y){return x>>>y^x<<32-y}function blake2sCompress(ctx,last){var i=0;for(i=0;i<8;i++)v[i]=ctx.h[i],v[i+8]=BLAKE2S_IV[i];for(v[12]^=ctx.t,v[13]^=ctx.t/4294967296,last&&(v[14]=~v[14]),i=0;i<16;i++)m[i]=B2S_GET32(ctx.b,4*i);for(i=0;i<10;i++)B2S_G(0,4,8,12,m[SIGMA[16*i+0]],m[SIGMA[16*i+1]]),B2S_G(1,5,9,13,m[SIGMA[16*i+2]],m[SIGMA[16*i+3]]),B2S_G(2,6,10,14,m[SIGMA[16*i+4]],m[SIGMA[16*i+5]]),B2S_G(3,7,11,15,m[SIGMA[16*i+6]],m[SIGMA[16*i+7]]),B2S_G(0,5,10,15,m[SIGMA[16*i+8]],m[SIGMA[16*i+9]]),B2S_G(1,6,11,12,m[SIGMA[16*i+10]],m[SIGMA[16*i+11]]),B2S_G(2,7,8,13,m[SIGMA[16*i+12]],m[SIGMA[16*i+13]]),B2S_G(3,4,9,14,m[SIGMA[16*i+14]],m[SIGMA[16*i+15]]);for(i=0;i<8;i++)ctx.h[i]^=v[i]^v[i+8]}function blake2sInit(outlen,key){if(!(outlen>0&&outlen<=32))throw new Error("Incorrect output length, should be in [1, 32]");var keylen=key?key.length:0;if(key&&!(keylen>0&&keylen<=32))throw new Error("Incorrect key length, should be in [1, 32]");var ctx={h:new Uint32Array(BLAKE2S_IV),b:new Uint32Array(64),c:0,t:0,outlen:outlen};return ctx.h[0]^=16842752^keylen<<8^outlen,keylen>0&&(blake2sUpdate(ctx,key),ctx.c=64),ctx}function blake2sUpdate(ctx,input){for(var i=0;i>2]>>8*(3&i)&255;return out}function blake2s(input,key,outlen){outlen=outlen||32,input=util.normalizeInput(input);var ctx=blake2sInit(outlen,key);return blake2sUpdate(ctx,input),blake2sFinal(ctx)}function blake2sHex(input,key,outlen){var output=blake2s(input,key,outlen);return util.toHex(output)}var util=__webpack_require__(161),BLAKE2S_IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SIGMA=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),v=new Uint32Array(16),m=new Uint32Array(16);module.exports={blake2s:blake2s,blake2sHex:blake2sHex,blake2sInit:blake2sInit,blake2sUpdate:blake2sUpdate,blake2sFinal:blake2sFinal}},function(module,exports,__webpack_require__){var b2b=__webpack_require__(307),b2s=__webpack_require__(308);module.exports={blake2b:b2b.blake2b,blake2bHex:b2b.blake2bHex,blake2bInit:b2b.blake2bInit,blake2bUpdate:b2b.blake2bUpdate,blake2bFinal:b2b.blake2bFinal,blake2s:b2s.blake2s,blake2sHex:b2s.blake2sHex,blake2sInit:b2s.blake2sInit,blake2sUpdate:b2s.blake2sUpdate,blake2sFinal:b2s.blake2sFinal}},function(module,exports,__webpack_require__){(function(global){function mapArrayBufferViews(ary){for(var i=0;i0){break}}return code|0}function checkOffset(n){n=n|0;if(((offset|0)+(n|0)|0)<(inputLength|0)){return 0}return 1}function readUInt16(n){n=n|0;return heap[n|0]<<8|heap[n+1|0]|0}function INT_P(octet){octet=octet|0;pushInt(octet|0);offset=offset+1|0;return 0}function UINT_P_8(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushInt(heap[offset+1|0]|0);offset=offset+2|0;return 0}function UINT_P_16(octet){octet=octet|0;if(checkOffset(2)|0){return 1}pushInt(readUInt16(offset+1|0)|0);offset=offset+3|0;return 0}function UINT_P_32(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushInt32(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function UINT_P_64(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushInt64(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function INT_N(octet){octet=octet|0;pushInt(-1-(octet-32|0)|0);offset=offset+1|0;return 0}function UINT_N_8(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushInt(-1-(heap[offset+1|0]|0)|0);offset=offset+2|0;return 0}function UINT_N_16(octet){octet=octet|0;var val=0;if(checkOffset(2)|0){return 1}val=readUInt16(offset+1|0)|0;pushInt(-1-(val|0)|0);offset=offset+3|0;return 0}function UINT_N_32(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushInt32Neg(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function UINT_N_64(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushInt64Neg(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function BYTE_STRING(octet){octet=octet|0;var start=0;var end=0;var step=0;step=octet-64|0;if(checkOffset(step|0)|0){return 1}start=offset+1|0;end=(offset+1|0)+(step|0)|0;pushByteString(start|0,end|0);offset=end|0;return 0}function BYTE_STRING_8(octet){octet=octet|0;var start=0;var end=0;var length=0;if(checkOffset(1)|0){return 1}length=heap[offset+1|0]|0;start=offset+2|0;end=(offset+2|0)+(length|0)|0;if(checkOffset(length+1|0)|0){return 1}pushByteString(start|0,end|0);offset=end|0;return 0}function BYTE_STRING_16(octet){octet=octet|0;var start=0;var end=0;var length=0;if(checkOffset(2)|0){return 1}length=readUInt16(offset+1|0)|0;start=offset+3|0;end=(offset+3|0)+(length|0)|0;if(checkOffset(length+2|0)|0){return 1}pushByteString(start|0,end|0);offset=end|0;return 0}function BYTE_STRING_32(octet){octet=octet|0;return 1}function BYTE_STRING_64(octet){octet=octet|0;return 1}function BYTE_STRING_BREAK(octet){octet=octet|0;pushByteStringStart();offset=offset+1|0;return 0}function UTF8_STRING(octet){octet=octet|0;var start=0;var end=0;var step=0;step=octet-96|0;if(checkOffset(step|0)|0){return 1}start=offset+1|0;end=(offset+1|0)+(step|0)|0;pushUtf8String(start|0,end|0);offset=end|0;return 0}function UTF8_STRING_8(octet){octet=octet|0;var start=0;var end=0;var length=0;if(checkOffset(1)|0){return 1}length=heap[offset+1|0]|0;start=offset+2|0;end=(offset+2|0)+(length|0)|0;if(checkOffset(length+1|0)|0){return 1}pushUtf8String(start|0,end|0);offset=end|0;return 0}function UTF8_STRING_16(octet){octet=octet|0;var start=0;var end=0;var length=0;if(checkOffset(2)|0){return 1}length=readUInt16(offset+1|0)|0;start=offset+3|0;end=(offset+3|0)+(length|0)|0;if(checkOffset(length+2|0)|0){return 1}pushUtf8String(start|0,end|0);offset=end|0;return 0}function UTF8_STRING_32(octet){octet=octet|0;return 1}function UTF8_STRING_64(octet){octet=octet|0;return 1}function UTF8_STRING_BREAK(octet){octet=octet|0;pushUtf8StringStart();offset=offset+1|0;return 0}function ARRAY(octet){octet=octet|0;pushArrayStartFixed(octet-128|0);offset=offset+1|0;return 0}function ARRAY_8(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushArrayStartFixed(heap[offset+1|0]|0);offset=offset+2|0;return 0}function ARRAY_16(octet){octet=octet|0;if(checkOffset(2)|0){return 1}pushArrayStartFixed(readUInt16(offset+1|0)|0);offset=offset+3|0;return 1}function ARRAY_32(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushArrayStartFixed32(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function ARRAY_64(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushArrayStartFixed64(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function ARRAY_BREAK(octet){octet=octet|0;pushArrayStart();offset=offset+1|0;return 0}function MAP(octet){octet=octet|0;var step=0;step=octet-160|0;if(checkOffset(step|0)|0){return 1}pushObjectStartFixed(step|0);offset=offset+1|0;return 0}function MAP_8(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushObjectStartFixed(heap[offset+1|0]|0);offset=offset+2|0;return 0}function MAP_16(octet){octet=octet|0;if(checkOffset(2)|0){return 1}pushObjectStartFixed(readUInt16(offset+1|0)|0);offset=offset+3|0;return 0}function MAP_32(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushObjectStartFixed32(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function MAP_64(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushObjectStartFixed64(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function MAP_BREAK(octet){octet=octet|0;pushObjectStart();offset=offset+1|0;return 0}function TAG_KNOWN(octet){octet=octet|0;pushTagStart(octet-192|0|0);offset=offset+1|0;return 0}function TAG_BIGNUM_POS(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_BIGNUM_NEG(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_FRAC(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_BIGNUM_FLOAT(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_UNASSIGNED(octet){octet=octet|0;pushTagStart(octet-192|0|0);offset=offset+1|0;return 0}function TAG_BASE64_URL(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_BASE64(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_BASE16(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_MORE_1(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushTagStart(heap[offset+1|0]|0);offset=offset+2|0;return 0}function TAG_MORE_2(octet){octet=octet|0;if(checkOffset(2)|0){return 1}pushTagStart(readUInt16(offset+1|0)|0);offset=offset+3|0;return 0}function TAG_MORE_4(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushTagStart4(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function TAG_MORE_8(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushTagStart8(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function SIMPLE_UNASSIGNED(octet){octet=octet|0;pushSimpleUnassigned((octet|0)-224|0);offset=offset+1|0;return 0}function SIMPLE_FALSE(octet){octet=octet|0;pushFalse();offset=offset+1|0;return 0}function SIMPLE_TRUE(octet){octet=octet|0;pushTrue();offset=offset+1|0;return 0}function SIMPLE_NULL(octet){octet=octet|0;pushNull();offset=offset+1|0;return 0}function SIMPLE_UNDEFINED(octet){octet=octet|0;pushUndefined();offset=offset+1|0;return 0}function SIMPLE_BYTE(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushSimpleUnassigned(heap[offset+1|0]|0);offset=offset+2|0;return 0}function SIMPLE_FLOAT_HALF(octet){octet=octet|0;var f=0;var g=0;var sign=1;var exp=0;var mant=0;var r=0;if(checkOffset(2)|0){return 1}f=heap[offset+1|0]|0;g=heap[offset+2|0]|0;if((f|0)&128){sign=-1}exp=+(((f|0)&124)>>2);mant=+(((f|0)&3)<<8|g);if(+exp==0){pushFloat(+(+sign*+5.960464477539063e-8*+mant))}else if(+exp==31){if(+sign==1){if(+mant>0){pushNaN()}else{pushInfinity()}}else{if(+mant>0){pushNaNNeg()}else{pushInfinityNeg()}}}else{pushFloat(+(+sign*pow(+2,+(+exp-25))*+(1024+mant)))}offset=offset+3|0;return 0}function SIMPLE_FLOAT_SINGLE(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushFloatSingle(heap[offset+1|0]|0,heap[offset+2|0]|0,heap[offset+3|0]|0,heap[offset+4|0]|0);offset=offset+5|0;return 0}function SIMPLE_FLOAT_DOUBLE(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushFloatDouble(heap[offset+1|0]|0,heap[offset+2|0]|0,heap[offset+3|0]|0,heap[offset+4|0]|0,heap[offset+5|0]|0,heap[offset+6|0]|0,heap[offset+7|0]|0,heap[offset+8|0]|0);offset=offset+9|0;return 0}function ERROR(octet){octet=octet|0;return 1}function BREAK(octet){octet=octet|0;pushBreak();offset=offset+1|0;return 0}var jumpTable=[INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,UINT_P_8,UINT_P_16,UINT_P_32,UINT_P_64,ERROR,ERROR,ERROR,ERROR,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,UINT_N_8,UINT_N_16,UINT_N_32,UINT_N_64,ERROR,ERROR,ERROR,ERROR,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING_8,BYTE_STRING_16,BYTE_STRING_32,BYTE_STRING_64,ERROR,ERROR,ERROR,BYTE_STRING_BREAK,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING_8,UTF8_STRING_16,UTF8_STRING_32,UTF8_STRING_64,ERROR,ERROR,ERROR,UTF8_STRING_BREAK,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY_8,ARRAY_16,ARRAY_32,ARRAY_64,ERROR,ERROR,ERROR,ARRAY_BREAK,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP_8,MAP_16,MAP_32,MAP_64,ERROR,ERROR,ERROR,MAP_BREAK,TAG_KNOWN,TAG_KNOWN,TAG_KNOWN,TAG_KNOWN,TAG_KNOWN,TAG_KNOWN,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_MORE_1,TAG_MORE_2,TAG_MORE_4,TAG_MORE_8,ERROR,ERROR,ERROR,ERROR,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_FALSE,SIMPLE_TRUE,SIMPLE_NULL,SIMPLE_UNDEFINED,SIMPLE_BYTE,SIMPLE_FLOAT_HALF,SIMPLE_FLOAT_SINGLE,SIMPLE_FLOAT_DOUBLE,ERROR,ERROR,ERROR,BREAK];return{parse:parse}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function collectObject(val){return(acc,key)=>{return acc?`${acc}, ${key}: ${val[key]}`:`${key}: ${val[key]}`}}const Decoder=__webpack_require__(162),utils=__webpack_require__(107);class Diagnose extends Decoder{createTag(tagNumber,value){return`${tagNumber}(${value})`}createInt(val){return super.createInt(val).toString()}createInt32(f,g){return super.createInt32(f,g).toString()}createInt64(f1,f2,g1,g2){return super.createInt64(f1,f2,g1,g2).toString()}createInt32Neg(f,g){return super.createInt32Neg(f,g).toString()} +createInt64Neg(f1,f2,g1,g2){return super.createInt64Neg(f1,f2,g1,g2).toString()}createTrue(){return"true"}createFalse(){return"false"}createFloat(val){const fl=super.createFloat(val);return utils.isNegativeZero(val)?"-0_1":`${fl}_1`}createFloatSingle(a,b,c,d){return`${super.createFloatSingle(a,b,c,d)}_2`}createFloatDouble(a,b,c,d,e,f,g,h){return`${super.createFloatDouble(a,b,c,d,e,f,g,h)}_3`}createByteString(raw,len){const val=raw.join(", ");return len===-1?`(_ ${val})`:`h'${val}`}createByteStringFromHeap(start,end){return`h'${new Buffer(super.createByteStringFromHeap(start,end)).toString("hex")}'`}createInfinity(){return"Infinity_1"}createInfinityNeg(){return"-Infinity_1"}createNaN(){return"NaN_1"}createNaNNeg(){return"-NaN_1"}createNull(){return"null"}createUndefined(){return"undefined"}createSimpleUnassigned(val){return`simple(${val})`}createArray(arr,len){const val=super.createArray(arr,len);return len===-1?`[_ ${val.join(", ")}]`:`[${val.join(", ")}]`}createMap(map,len){const val=super.createMap(map),list=Array.from(val.keys()).reduce(collectObject(val),"");return len===-1?`{_ ${list}}`:`{${list}}`}createObject(obj,len){const val=super.createObject(obj),map=Object.keys(val).reduce(collectObject(val),"");return len===-1?`{_ ${map}}`:`{${map}}`}createUtf8String(raw,len){const val=raw.join(", ");return len===-1?`(_ ${val})`:`"${val}"`}createUtf8StringFromHeap(start,end){return`"${new Buffer(super.createUtf8StringFromHeap(start,end)).toString("utf8")}"`}static diagnose(input,enc){return"string"==typeof input&&(input=new Buffer(input,enc||"hex")),(new Diagnose).decodeFirst(input)}}module.exports=Diagnose}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function toType(obj){return{}.toString.call(obj).slice(8,-1)}const url=__webpack_require__(147),Bignumber=__webpack_require__(75),utils=__webpack_require__(107),constants=__webpack_require__(76),MT=constants.MT,NUMBYTES=constants.NUMBYTES,SHIFT32=constants.SHIFT32,SYMS=constants.SYMS,TAG=constants.TAG,HALF=constants.MT.SIMPLE_FLOAT<<5|constants.NUMBYTES.TWO,FLOAT=constants.MT.SIMPLE_FLOAT<<5|constants.NUMBYTES.FOUR,DOUBLE=constants.MT.SIMPLE_FLOAT<<5|constants.NUMBYTES.EIGHT,TRUE=constants.MT.SIMPLE_FLOAT<<5|constants.SIMPLE.TRUE,FALSE=constants.MT.SIMPLE_FLOAT<<5|constants.SIMPLE.FALSE,UNDEFINED=constants.MT.SIMPLE_FLOAT<<5|constants.SIMPLE.UNDEFINED,NULL=constants.MT.SIMPLE_FLOAT<<5|constants.SIMPLE.NULL,MAXINT_BN=new Bignumber("0x20000000000000"),BUF_NAN=new Buffer("f97e00","hex"),BUF_INF_NEG=new Buffer("f9fc00","hex"),BUF_INF_POS=new Buffer("f97c00","hex");class Encoder{constructor(options){options=options||{},this.streaming="function"==typeof options.stream,this.onData=options.stream,this.semanticTypes=[[url.Url,this._pushUrl],[Bignumber,this._pushBigNumber]];const addTypes=options.genTypes||[],len=addTypes.length;for(let i=0;i[k,obj[k]]))}_pushRawMap(len,map){map=map.map(function(a){return a[0]=Encoder.encode(a[0]),a}).sort(utils.keySorter);for(var j=0;j16)return out=this.cache.slice(0,16),this.cache=this.cache.slice(16),out}else if(this.cache.length>=16)return out=this.cache.slice(0,16),this.cache=this.cache.slice(16),out;return null},Splitter.prototype.flush=function(){if(this.cache.length)return this.cache};var modelist={ECB:__webpack_require__(170),CBC:__webpack_require__(166),CFB:__webpack_require__(167),CFB8:__webpack_require__(169),CFB1:__webpack_require__(168),OFB:__webpack_require__(171),CTR:__webpack_require__(78),GCM:__webpack_require__(78)};exports.createDecipher=createDecipher,exports.createDecipheriv=createDecipheriv}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Cipher(mode,key,iv){if(!(this instanceof Cipher))return new Cipher(mode,key,iv);Transform.call(this),this._cache=new Splitter,this._cipher=new aes.AES(key),this._prev=new Buffer(iv.length),iv.copy(this._prev),this._mode=mode,this._autopadding=!0}function Splitter(){if(!(this instanceof Splitter))return new Splitter;this.cache=new Buffer("")}function createCipheriv(suite,password,iv){var config=modes[suite.toLowerCase()];if(!config)throw new TypeError("invalid suite type");if("string"==typeof iv&&(iv=new Buffer(iv)),"string"==typeof password&&(password=new Buffer(password)),password.length!==config.key/8)throw new TypeError("invalid key length "+password.length);if(iv.length!==config.iv)throw new TypeError("invalid iv length "+iv.length);return"stream"===config.type?new StreamCipher(modelist[config.mode],password,iv):"auth"===config.type?new AuthCipher(modelist[config.mode],password,iv):new Cipher(modelist[config.mode],password,iv)}function createCipher(suite,password){var config=modes[suite.toLowerCase()];if(!config)throw new TypeError("invalid suite type");var keys=ebtk(password,!1,config.key,config.iv);return createCipheriv(suite,keys.key,keys.iv)}var aes=__webpack_require__(77),Transform=__webpack_require__(40),inherits=__webpack_require__(1),modes=__webpack_require__(108),ebtk=__webpack_require__(185),StreamCipher=__webpack_require__(172),AuthCipher=__webpack_require__(165);inherits(Cipher,Transform),Cipher.prototype._update=function(data){this._cache.add(data);for(var chunk,thing,out=[];chunk=this._cache.get();)thing=this._mode.encrypt(this,chunk),out.push(thing);return Buffer.concat(out)},Cipher.prototype._final=function(){var chunk=this._cache.flush();if(this._autopadding)return chunk=this._mode.encrypt(this,chunk),this._cipher.scrub(),chunk;if("10101010101010101010101010101010"!==chunk.toString("hex"))throw this._cipher.scrub(),new Error("data not multiple of block length")},Cipher.prototype.setAutoPadding=function(setTo){return this._autopadding=!!setTo,this},Splitter.prototype.add=function(data){this.cache=Buffer.concat([this.cache,data])},Splitter.prototype.get=function(){if(this.cache.length>15){var out=this.cache.slice(0,16);return this.cache=this.cache.slice(16),out}return null},Splitter.prototype.flush=function(){for(var len=16-this.cache.length,padBuff=new Buffer(len),i=-1;++iuint_max||x<0?(x_pos=Math.abs(x)%uint_max,x<0?uint_max-x_pos:x_pos):x}function xor(a,b){return[a[0]^b[0],a[1]^b[1],a[2]^b[2],a[3]^b[3]]}var zeros=new Buffer(16);zeros.fill(0),module.exports=GHASH,GHASH.prototype.ghash=function(block){for(var i=-1;++i0;j--)Vi[j]=Vi[j]>>>1|(1&Vi[j-1])<<31;Vi[0]=Vi[0]>>>1,lsb_Vi&&(Vi[0]=Vi[0]^225<<24)}this.state=fromArray(Zi)},GHASH.prototype.update=function(buf){this.cache=Buffer.concat([this.cache,buf]);for(var chunk;this.cache.length>=16;)chunk=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(chunk)},GHASH.prototype.final=function(abl,bl){return this.cache.length&&this.ghash(Buffer.concat([this.cache,zeros],16)),this.ghash(fromArray([0,abl,0,bl])),this.state};var uint_max=Math.pow(2,32)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){const Sha3=__webpack_require__(321),hashLengths=[224,256,384,512];var hash=function(bitcount){if(void 0!==bitcount&&hashLengths.indexOf(bitcount)==-1)throw new Error("Unsupported hash length");this.content=[],this.bitcount=bitcount?"keccak_"+bitcount:"keccak_512"};hash.prototype.update=function(i){if(Buffer.isBuffer(i))this.content.push(i);else{if("string"!=typeof i)throw new Error("Unsupported argument to update");this.content.push(new Buffer(i))}return this},hash.prototype.digest=function(encoding){var result=Sha3[this.bitcount](Buffer.concat(this.content));if("hex"===encoding)return result;if("binary"===encoding||void 0===encoding)return new Buffer(result,"hex").toString("binary");throw new Error("Unsupported encoding for digest: "+encoding)},module.exports={SHA3Hash:hash}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(global){!function(root,undefined){"use strict";var NODE_JS=void 0!==module;NODE_JS&&(root=global,root.JS_SHA3_TEST&&(root.navigator={userAgent:"Chrome"}));var CHROME=(root.JS_SHA3_TEST||!NODE_JS)&&navigator.userAgent.indexOf("Chrome")!=-1,HEX_CHARS="0123456789abcdef".split(""),KECCAK_PADDING=[1,256,65536,16777216],PADDING=[6,1536,393216,100663296],SHIFT=[0,8,16,24],RC=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],blocks=[],s=[],keccak_224=function(message){return keccak(message,224,KECCAK_PADDING)},keccak_256=function(message){return keccak(message,256,KECCAK_PADDING)},keccak_384=function(message){return keccak(message,384,KECCAK_PADDING)},sha3_224=function(message){return keccak(message,224,PADDING)},sha3_256=function(message){return keccak(message,256,PADDING)},sha3_384=function(message){return keccak(message,384,PADDING)},sha3_512=function(message){return keccak(message,512,PADDING)},keccak=function(message,bits,padding){var notString="string"!=typeof message;notString&&message.constructor==root.ArrayBuffer&&(message=new Uint8Array(message)),void 0===bits&&(bits=512,padding=KECCAK_PADDING);var block,code,n,i,h,l,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49,end=!1,index=0,start=0,length=message.length,blockCount=(1600-2*bits)/32,byteCount=4*blockCount;for(i=0;i<50;++i)s[i]=0;block=0;do{for(blocks[0]=block,i=1;i>2]|=message[index]<>2]|=code<>2]|=(192|code>>6)<>2]|=(128|63&code)<=57344?(blocks[i>>2]|=(224|code>>12)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<>2]|=(240|code>>18)<>2]|=(128|code>>12&63)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<>2]|=padding[3&i],++index),block=blocks[blockCount],index>length&&i>>31),l=c9^(c3<<1|c2>>>31),s[0]^=h,s[1]^=l,s[10]^=h,s[11]^=l,s[20]^=h,s[21]^=l,s[30]^=h,s[31]^=l,s[40]^=h,s[41]^=l,h=c0^(c4<<1|c5>>>31),l=c1^(c5<<1|c4>>>31),s[2]^=h,s[3]^=l,s[12]^=h,s[13]^=l,s[22]^=h,s[23]^=l,s[32]^=h,s[33]^=l,s[42]^=h,s[43]^=l,h=c2^(c6<<1|c7>>>31),l=c3^(c7<<1|c6>>>31),s[4]^=h,s[5]^=l,s[14]^=h,s[15]^=l,s[24]^=h,s[25]^=l,s[34]^=h,s[35]^=l,s[44]^=h,s[45]^=l,h=c4^(c8<<1|c9>>>31),l=c5^(c9<<1|c8>>>31),s[6]^=h,s[7]^=l,s[16]^=h,s[17]^=l,s[26]^=h,s[27]^=l,s[36]^=h,s[37]^=l,s[46]^=h,s[47]^=l,h=c6^(c0<<1|c1>>>31),l=c7^(c1<<1|c0>>>31),s[8]^=h,s[9]^=l,s[18]^=h,s[19]^=l,s[28]^=h,s[29]^=l,s[38]^=h,s[39]^=l,s[48]^=h,s[49]^=l,b0=s[0],b1=s[1],b32=s[11]<<4|s[10]>>>28,b33=s[10]<<4|s[11]>>>28,b14=s[20]<<3|s[21]>>>29,b15=s[21]<<3|s[20]>>>29,b46=s[31]<<9|s[30]>>>23,b47=s[30]<<9|s[31]>>>23,b28=s[40]<<18|s[41]>>>14,b29=s[41]<<18|s[40]>>>14,b20=s[2]<<1|s[3]>>>31,b21=s[3]<<1|s[2]>>>31,b2=s[13]<<12|s[12]>>>20,b3=s[12]<<12|s[13]>>>20,b34=s[22]<<10|s[23]>>>22,b35=s[23]<<10|s[22]>>>22,b16=s[33]<<13|s[32]>>>19,b17=s[32]<<13|s[33]>>>19,b48=s[42]<<2|s[43]>>>30,b49=s[43]<<2|s[42]>>>30,b40=s[5]<<30|s[4]>>>2,b41=s[4]<<30|s[5]>>>2,b22=s[14]<<6|s[15]>>>26,b23=s[15]<<6|s[14]>>>26,b4=s[25]<<11|s[24]>>>21,b5=s[24]<<11|s[25]>>>21,b36=s[34]<<15|s[35]>>>17,b37=s[35]<<15|s[34]>>>17,b18=s[45]<<29|s[44]>>>3,b19=s[44]<<29|s[45]>>>3,b10=s[6]<<28|s[7]>>>4,b11=s[7]<<28|s[6]>>>4,b42=s[17]<<23|s[16]>>>9,b43=s[16]<<23|s[17]>>>9,b24=s[26]<<25|s[27]>>>7,b25=s[27]<<25|s[26]>>>7,b6=s[36]<<21|s[37]>>>11,b7=s[37]<<21|s[36]>>>11,b38=s[47]<<24|s[46]>>>8,b39=s[46]<<24|s[47]>>>8,b30=s[8]<<27|s[9]>>>5,b31=s[9]<<27|s[8]>>>5,b12=s[18]<<20|s[19]>>>12,b13=s[19]<<20|s[18]>>>12,b44=s[29]<<7|s[28]>>>25,b45=s[28]<<7|s[29]>>>25,b26=s[38]<<8|s[39]>>>24,b27=s[39]<<8|s[38]>>>24,b8=s[48]<<14|s[49]>>>18,b9=s[49]<<14|s[48]>>>18,s[0]=b0^~b2&b4,s[1]=b1^~b3&b5,s[10]=b10^~b12&b14,s[11]=b11^~b13&b15,s[20]=b20^~b22&b24,s[21]=b21^~b23&b25,s[30]=b30^~b32&b34,s[31]=b31^~b33&b35,s[40]=b40^~b42&b44,s[41]=b41^~b43&b45,s[2]=b2^~b4&b6,s[3]=b3^~b5&b7,s[12]=b12^~b14&b16,s[13]=b13^~b15&b17,s[22]=b22^~b24&b26,s[23]=b23^~b25&b27,s[32]=b32^~b34&b36,s[33]=b33^~b35&b37,s[42]=b42^~b44&b46,s[43]=b43^~b45&b47,s[4]=b4^~b6&b8,s[5]=b5^~b7&b9,s[14]=b14^~b16&b18,s[15]=b15^~b17&b19,s[24]=b24^~b26&b28,s[25]=b25^~b27&b29,s[34]=b34^~b36&b38,s[35]=b35^~b37&b39,s[44]=b44^~b46&b48,s[45]=b45^~b47&b49,s[6]=b6^~b8&b0,s[7]=b7^~b9&b1,s[16]=b16^~b18&b10,s[17]=b17^~b19&b11,s[26]=b26^~b28&b20,s[27]=b27^~b29&b21,s[36]=b36^~b38&b30,s[37]=b37^~b39&b31,s[46]=b46^~b48&b40,s[47]=b47^~b49&b41,s[8]=b8^~b0&b2,s[9]=b9^~b1&b3,s[18]=b18^~b10&b12,s[19]=b19^~b11&b13,s[28]=b28^~b20&b22,s[29]=b29^~b21&b23,s[38]=b38^~b30&b32,s[39]=b39^~b31&b33,s[48]=b48^~b40&b42,s[49]=b49^~b41&b43,s[0]^=RC[n],s[1]^=RC[n+1]}while(!end);var hex="";if(CHROME)b0=s[0],b1=s[1],b2=s[2],b3=s[3],b4=s[4],b5=s[5],b6=s[6],b7=s[7],b8=s[8],b9=s[9],b10=s[10],b11=s[11],b12=s[12],b13=s[13],b14=s[14],b15=s[15],hex+=HEX_CHARS[b0>>4&15]+HEX_CHARS[15&b0]+HEX_CHARS[b0>>12&15]+HEX_CHARS[b0>>8&15]+HEX_CHARS[b0>>20&15]+HEX_CHARS[b0>>16&15]+HEX_CHARS[b0>>28&15]+HEX_CHARS[b0>>24&15]+HEX_CHARS[b1>>4&15]+HEX_CHARS[15&b1]+HEX_CHARS[b1>>12&15]+HEX_CHARS[b1>>8&15]+HEX_CHARS[b1>>20&15]+HEX_CHARS[b1>>16&15]+HEX_CHARS[b1>>28&15]+HEX_CHARS[b1>>24&15]+HEX_CHARS[b2>>4&15]+HEX_CHARS[15&b2]+HEX_CHARS[b2>>12&15]+HEX_CHARS[b2>>8&15]+HEX_CHARS[b2>>20&15]+HEX_CHARS[b2>>16&15]+HEX_CHARS[b2>>28&15]+HEX_CHARS[b2>>24&15]+HEX_CHARS[b3>>4&15]+HEX_CHARS[15&b3]+HEX_CHARS[b3>>12&15]+HEX_CHARS[b3>>8&15]+HEX_CHARS[b3>>20&15]+HEX_CHARS[b3>>16&15]+HEX_CHARS[b3>>28&15]+HEX_CHARS[b3>>24&15]+HEX_CHARS[b4>>4&15]+HEX_CHARS[15&b4]+HEX_CHARS[b4>>12&15]+HEX_CHARS[b4>>8&15]+HEX_CHARS[b4>>20&15]+HEX_CHARS[b4>>16&15]+HEX_CHARS[b4>>28&15]+HEX_CHARS[b4>>24&15]+HEX_CHARS[b5>>4&15]+HEX_CHARS[15&b5]+HEX_CHARS[b5>>12&15]+HEX_CHARS[b5>>8&15]+HEX_CHARS[b5>>20&15]+HEX_CHARS[b5>>16&15]+HEX_CHARS[b5>>28&15]+HEX_CHARS[b5>>24&15]+HEX_CHARS[b6>>4&15]+HEX_CHARS[15&b6]+HEX_CHARS[b6>>12&15]+HEX_CHARS[b6>>8&15]+HEX_CHARS[b6>>20&15]+HEX_CHARS[b6>>16&15]+HEX_CHARS[b6>>28&15]+HEX_CHARS[b6>>24&15],bits>=256&&(hex+=HEX_CHARS[b7>>4&15]+HEX_CHARS[15&b7]+HEX_CHARS[b7>>12&15]+HEX_CHARS[b7>>8&15]+HEX_CHARS[b7>>20&15]+HEX_CHARS[b7>>16&15]+HEX_CHARS[b7>>28&15]+HEX_CHARS[b7>>24&15]),bits>=384&&(hex+=HEX_CHARS[b8>>4&15]+HEX_CHARS[15&b8]+HEX_CHARS[b8>>12&15]+HEX_CHARS[b8>>8&15]+HEX_CHARS[b8>>20&15]+HEX_CHARS[b8>>16&15]+HEX_CHARS[b8>>28&15]+HEX_CHARS[b8>>24&15]+HEX_CHARS[b9>>4&15]+HEX_CHARS[15&b9]+HEX_CHARS[b9>>12&15]+HEX_CHARS[b9>>8&15]+HEX_CHARS[b9>>20&15]+HEX_CHARS[b9>>16&15]+HEX_CHARS[b9>>28&15]+HEX_CHARS[b9>>24&15]+HEX_CHARS[b10>>4&15]+HEX_CHARS[15&b10]+HEX_CHARS[b10>>12&15]+HEX_CHARS[b10>>8&15]+HEX_CHARS[b10>>20&15]+HEX_CHARS[b10>>16&15]+HEX_CHARS[b10>>28&15]+HEX_CHARS[b10>>24&15]+HEX_CHARS[b11>>4&15]+HEX_CHARS[15&b11]+HEX_CHARS[b11>>12&15]+HEX_CHARS[b11>>8&15]+HEX_CHARS[b11>>20&15]+HEX_CHARS[b11>>16&15]+HEX_CHARS[b11>>28&15]+HEX_CHARS[b11>>24&15]),512==bits&&(hex+=HEX_CHARS[b12>>4&15]+HEX_CHARS[15&b12]+HEX_CHARS[b12>>12&15]+HEX_CHARS[b12>>8&15]+HEX_CHARS[b12>>20&15]+HEX_CHARS[b12>>16&15]+HEX_CHARS[b12>>28&15]+HEX_CHARS[b12>>24&15]+HEX_CHARS[b13>>4&15]+HEX_CHARS[15&b13]+HEX_CHARS[b13>>12&15]+HEX_CHARS[b13>>8&15]+HEX_CHARS[b13>>20&15]+HEX_CHARS[b13>>16&15]+HEX_CHARS[b13>>28&15]+HEX_CHARS[b13>>24&15]+HEX_CHARS[b14>>4&15]+HEX_CHARS[15&b14]+HEX_CHARS[b14>>12&15]+HEX_CHARS[b14>>8&15]+HEX_CHARS[b14>>20&15]+HEX_CHARS[b14>>16&15]+HEX_CHARS[b14>>28&15]+HEX_CHARS[b14>>24&15]+HEX_CHARS[b15>>4&15]+HEX_CHARS[15&b15]+HEX_CHARS[b15>>12&15]+HEX_CHARS[b15>>8&15]+HEX_CHARS[b15>>20&15]+HEX_CHARS[b15>>16&15]+HEX_CHARS[b15>>28&15]+HEX_CHARS[b15>>24&15]);else for(i=0,n=bits/32;i>4&15]+HEX_CHARS[15&h]+HEX_CHARS[h>>12&15]+HEX_CHARS[h>>8&15]+HEX_CHARS[h>>20&15]+HEX_CHARS[h>>16&15]+HEX_CHARS[h>>28&15]+HEX_CHARS[h>>24&15];return hex};!root.JS_SHA3_TEST&&NODE_JS?module.exports={sha3_512:sha3_512,sha3_384:sha3_384,sha3_256:sha3_256,sha3_224:sha3_224,keccak_512:keccak,keccak_384:keccak_384,keccak_256:keccak_256,keccak_224:keccak_224}:root&&(root.sha3_512=sha3_512,root.sha3_384=sha3_384,root.sha3_256=sha3_256,root.sha3_224=sha3_224,root.keccak_512=keccak,root.keccak_384=keccak_384,root.keccak_256=keccak_256,root.keccak_224=keccak_224)}(this)}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){var Buffer=__webpack_require__(6).Buffer;module.exports=function(ALPHABET){function encode(source){if(0===source.length)return"";for(var digits=[0],i=0;i0;)digits.push(carry%BASE),carry=carry/BASE|0}for(var string="",k=0;0===source[k]&&k=0;--q)string+=ALPHABET[digits[q]];return string}function decodeUnsafe(string){if(0===string.length)return Buffer.allocUnsafe(0);for(var bytes=[0],i=0;i>=8;for(;carry>0;)bytes.push(255&carry),carry>>=8}for(var k=0;string[k]===LEADER&&k>>2),i=0,j=0;iblocksize){key=("rmd160"===alg?new RIPEMD160:sha(alg)).update(key).digest()}else key.lengthblocksize?key=alg(key):key.length{m.datastore.open(cb)},callback)}_lookup(key){for(let mount of this.mounts)if(mount.prefix.toString()===key.toString()||mount.prefix.isAncestorOf(key)){const s=replaceStartWith(key.toString(),mount.prefix.toString());return{datastore:mount.datastore,mountpoint:mount.prefix,rest:new Key(s)}}}put(key,value,callback){const match=this._lookup(key);if(null==match)return void callback(new Error("No datastore mounted for this key"));match.datastore.put(match.rest,value,callback)}get(key,callback){const match=this._lookup(key);if(null==match)return void callback(new Error("No datastore mounted for this key"));match.datastore.get(match.rest,callback)}has(key,callback){const match=this._lookup(key);if(null==match)return void callback(null,!1);match.datastore.has(match.rest,callback)}delete(key,callback){const match=this._lookup(key);if(null==match)return void callback(new Error("No datastore mounted for this key"));match.datastore.delete(match.rest,callback)}close(callback){each(this.mounts,(m,cb)=>{m.datastore.close(cb)},callback)}batch(){const batchMounts={},lookup=key=>{const match=this._lookup(key);if(null==match)throw new Error("No datastore mounted for this key");const m=match.mountpoint.toString();return null==batchMounts[m]&&(batchMounts[m]=match.datastore.batch()),{batch:batchMounts[m],rest:match.rest}};return{put:(key,value)=>{const match=lookup(key);match.batch.put(match.rest,value)},delete:key=>{const match=lookup(key);match.batch.delete(match.rest)},commit:callback=>{each(Object.keys(batchMounts),(p,cb)=>{batchMounts[p].commit(cb)},callback)}}}query(q){const qs=this.mounts.map(m=>{const ks=new Keytransform(m.datastore,{convert:key=>{throw new Error("should never be called")},invert:key=>{return m.prefix.child(key)}});let prefix;return null!=q.prefix&&(prefix=replaceStartWith(q.prefix,m.prefix.toString())),ks.query({prefix:prefix,filters:q.filters,keysOnly:q.keysOnly})});let tasks=[many(qs)];if(null!=q.filters&&(tasks=tasks.concat(q.filters.map(f=>asyncFilter(f)))),null!=q.orders&&(tasks=tasks.concat(q.orders.map(o=>asyncSort(o)))),null!=q.offset){let i=0;tasks.push(pull.filter(()=>i++>=q.offset))}return null!=q.limit&&tasks.push(pull.take(q.limit)),pull.apply(null,tasks)}}module.exports=MountDatastore},function(module,exports,__webpack_require__){"use strict";const Key=__webpack_require__(16).Key,KeytransformDatastore=__webpack_require__(81);class NamespaceDatastore extends KeytransformDatastore{constructor(child,prefix){super(child,{convert(key){return prefix.child(key)},invert(key){if("/"===prefix.toString())return key;if(!prefix.isAncestorOf(key))throw new Error(`Expected prefix: (${prefix.toString()}) in key: ${key.toString()}`);return new Key(key.toString().slice(prefix.toString().length),!1)}}),this.prefix=prefix}query(q){return q.prefix&&"/"!==this.prefix.toString()?super.query(Object.assign({},q,{prefix:this.prefix.child(new Key(q.prefix)).toString()})):super.query(q)}}module.exports=NamespaceDatastore},function(module,exports,__webpack_require__){"use strict";module.exports=`This is a repository of IPLD objects. Each IPLD object is in a single file, named .data. Where is the "base32" encoding of the CID (as specified in https://github.com/multiformats/multibase) without the 'B' prefix. @@ -85,13 +78,13 @@ and will be placed at with 'SC' being the last-to-next two characters and the 'B' at the beginning of the CIDv1 string is the multibase prefix that is not stored in the filename. -`},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const waterfall=__webpack_require__(9),parallel=__webpack_require__(46),pull=__webpack_require__(5),Key=__webpack_require__(76).Key,sh=__webpack_require__(198),KeytransformStore=__webpack_require__(96),shardKey=new Key(sh.SHARDING_FN),shardReadmeKey=new Key(sh.README_FN);class ShardingDatastore{constructor(store,shard){this.child=new KeytransformStore(store,{convert:this._convertKey.bind(this),invert:this._invertKey.bind(this)}),this.shard=shard}open(callback){this.child.open(callback)}_convertKey(key){const s=key.toString();return s===shardKey.toString()||s===shardReadmeKey.toString()?key:new Key(this.shard.fun(s)).child(key)}_invertKey(key){const s=key.toString();return s===shardKey.toString()||s===shardReadmeKey.toString()?key:Key.withNamespaces(key.list().slice(1))}static createOrOpen(store,shard,callback){ShardingDatastore.create(store,shard,err=>{if(err&&"datastore exists"!==err.message)return callback(err);ShardingDatastore.open(store,callback)})}static open(store,callback){waterfall([cb=>sh.readShardFun("/",store,cb),(shard,cb)=>{cb(null,new ShardingDatastore(store,shard))}],callback)}static create(store,shard,callback){store.has(shardKey,(err,exists)=>{if(err)return callback(err);if(!exists){const put="function"==typeof store.putRaw?store.putRaw.bind(store):store.put.bind(store);return parallel([cb=>put(shardKey,new Buffer(shard.toString()+"\n"),cb),cb=>put(shardReadmeKey,new Buffer(sh.readme),cb)],err=>callback(err))}sh.readShardFun("/",store,(err,diskShard)=>{if(err)return callback(err);const a=(diskShard||"").toString(),b=shard.toString();if(a!==b)return callback(new Error(`specified fun ${b} does not match repo shard fun ${a}`));callback(new Error("datastore exists"))})})}put(key,val,callback){this.child.put(key,val,callback)}get(key,callback){this.child.get(key,callback)}has(key,callback){this.child.has(key,callback)}delete(key,callback){this.child.delete(key,callback)}batch(){return this.child.batch()}query(q){const tq={keysOnly:q.keysOnly};return null!=q.prefix&&(tq.prefix=q.prefix),null!=q.filters&&(tq.filters=q.filters.map(f=>(e,cb)=>{f(Object.assign({},e,{key:this._invertKey(e.key)}),cb)})),null!=q.orders&&(tq.orders=q.orders.map(o=>(res,cb)=>{o(res.map(e=>{return Object.assign({},e,{key:this._invertKey(e.key)})}),cb)})),null!=q.offset&&(tq.offset=q.offset+2),null!=q.limit&&(tq.limit=q.limit+2),pull(this.child.query(tq),pull.filter(e=>{return e.key.toString()!==shardKey.toString()&&e.key.toString()!==shardReadmeKey.toString()}))}close(callback){this.child.close(callback)}}module.exports=ShardingDatastore}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const each=__webpack_require__(32),whilst=__webpack_require__(90);class TieredDatastore{constructor(stores){this.stores=stores.slice()}open(callback){each(this.stores,(store,cb)=>{store.open(cb)},callback)}put(key,value,callback){each(this.stores,(store,cb)=>{store.put(key,value,cb)},callback)}get(key,callback){const storeLength=this.stores.length;let done=!1,i=0;whilst(()=>!done&&i{this.stores[i++].get(key,(err,res)=>{if(null==err)return done=!0,cb(null,res);cb()})},callback)}has(key,callback){const storeLength=this.stores.length;let done=!1,i=0;whilst(()=>!done&&i{this.stores[i++].has(key,(err,exists)=>{if(null==err)return done=!0,cb(null,exists);cb()})},callback)}delete(key,callback){each(this.stores,(store,cb)=>{store.delete(key,cb)},callback)}close(callback){each(this.stores,(store,cb)=>{store.close(cb)},callback)}batch(){const batches=this.stores.map(store=>store.batch());return{put:(key,value)=>{batches.forEach(b=>b.put(key,value))},delete:key=>{batches.forEach(b=>b.delete(key))},commit:callback=>{each(batches,(b,cb)=>{b.commit(cb)},callback)}}}query(q){return this.stores[this.stores.length-1].query(q)}}module.exports=TieredDatastore},function(module,exports,__webpack_require__){function selectColor(namespace){var i,hash=0;for(i in namespace)hash=(hash<<5)-hash+namespace.charCodeAt(i),hash|=0;return exports.colors[Math.abs(hash)%exports.colors.length]}function createDebug(namespace){function debug(){if(debug.enabled){var self=debug,curr=+new Date,ms=curr-(prevTime||curr);self.diff=ms,self.prev=prevTime,self.curr=curr,prevTime=curr;for(var args=new Array(arguments.length),i=0;ithis._reseedInterval)throw new Error("Reseed is required");add&&0===add.length&&(add=void 0),add&&this._update(add);for(var temp=new Buffer(0);temp.length0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};0===this.length&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(0!==this.length){var ret=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s){if(0===this.length)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s+p.data;return ret},BufferList.prototype.concat=function(n){if(0===this.length)return bufferShim.alloc(0);if(1===this.length)return this.head.data;for(var ret=bufferShim.allocUnsafe(n>>>0),p=this.head,i=0;p;)p.data.copy(ret,i),i+=p.data.length,p=p.next;return ret}},function(module,exports,__webpack_require__){exports=module.exports=__webpack_require__(205),exports.Stream=exports,exports.Readable=exports,exports.Writable=__webpack_require__(207),exports.Duplex=__webpack_require__(57),exports.Transform=__webpack_require__(206),exports.PassThrough=__webpack_require__(399)},function(module,exports,__webpack_require__){"use strict";function BaseCurve(type,conf){this.type=type,this.p=new BN(conf.p,16),this.red=conf.prime?BN.red(conf.prime):BN.mont(this.p),this.zero=new BN(0).toRed(this.red),this.one=new BN(1).toRed(this.red),this.two=new BN(2).toRed(this.red),this.n=conf.n&&new BN(conf.n,16),this.g=conf.g&&this.pointFromJSON(conf.g,conf.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var adjustCount=this.n&&this.p.div(this.n);!adjustCount||adjustCount.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function BasePoint(curve,type){this.curve=curve,this.type=type,this.precomputed=null}var BN=__webpack_require__(20),elliptic=__webpack_require__(27),utils=elliptic.utils,getNAF=utils.getNAF,getJSF=utils.getJSF,assert=utils.assert;module.exports=BaseCurve,BaseCurve.prototype.point=function(){throw new Error("Not implemented")},BaseCurve.prototype.validate=function(){throw new Error("Not implemented")},BaseCurve.prototype._fixedNafMul=function(p,k){assert(p.precomputed);var doubles=p._getDoubles(),naf=getNAF(k,1),I=(1<=j;k--)nafW=(nafW<<1)+naf[k];repr.push(nafW)}for(var a=this.jpoint(null,null,null),b=this.jpoint(null,null,null),i=I;i>0;i--){for(var j=0;j=0;i--){for(var k=0;i>=0&&0===naf[i];i--)k++;if(i>=0&&k++,acc=acc.dblp(k),i<0)break;var z=naf[i];assert(0!==z),acc="affine"===p.type?z>0?acc.mixedAdd(wnd[z-1>>1]):acc.mixedAdd(wnd[-z-1>>1].neg()):z>0?acc.add(wnd[z-1>>1]):acc.add(wnd[-z-1>>1].neg())}return"affine"===p.type?acc.toP():acc},BaseCurve.prototype._wnafMulAdd=function(defW,points,coeffs,len,jacobianResult){for(var wndWidth=this._wnafT1,wnd=this._wnafT2,naf=this._wnafT3,max=0,i=0;i=1;i-=2){var a=i-1,b=i;if(1===wndWidth[a]&&1===wndWidth[b]){var comb=[points[a],null,null,points[b]];0===points[a].y.cmp(points[b].y)?(comb[1]=points[a].add(points[b]),comb[2]=points[a].toJ().mixedAdd(points[b].neg())):0===points[a].y.cmp(points[b].y.redNeg())?(comb[1]=points[a].toJ().mixedAdd(points[b]),comb[2]=points[a].add(points[b].neg())):(comb[1]=points[a].toJ().mixedAdd(points[b]),comb[2]=points[a].toJ().mixedAdd(points[b].neg()));var index=[-3,-1,-5,-7,0,7,5,1,3],jsf=getJSF(coeffs[a],coeffs[b]);max=Math.max(jsf[0].length,max),naf[a]=new Array(max),naf[b]=new Array(max);for(var j=0;j=0;i--){for(var k=0;i>=0;){for(var zero=!0,j=0;j=0&&k++,acc=acc.dblp(k),i<0)break;for(var j=0;j0?p=wnd[j][z-1>>1]:z<0&&(p=wnd[j][-z-1>>1].neg()),acc="affine"===p.type?acc.mixedAdd(p):acc.add(p))}}for(var i=0;i=Math.ceil((k.bitLength()+1)/doubles.step)},BasePoint.prototype._getDoubles=function(step,power){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var doubles=[this],acc=this,i=0;i":""},Point.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},Point.prototype._extDbl=function(){var a=this.x.redSqr(),b=this.y.redSqr(),c=this.z.redSqr();c=c.redIAdd(c);var d=this.curve._mulA(a),e=this.x.redAdd(this.y).redSqr().redISub(a).redISub(b),g=d.redAdd(b),f=g.redSub(c),h=d.redSub(b),nx=e.redMul(f),ny=g.redMul(h),nt=e.redMul(h),nz=f.redMul(g);return this.curve.point(nx,ny,nz,nt)},Point.prototype._projDbl=function(){var nx,ny,nz,b=this.x.redAdd(this.y).redSqr(),c=this.x.redSqr(),d=this.y.redSqr();if(this.curve.twisted){var e=this.curve._mulA(c),f=e.redAdd(d);if(this.zOne)nx=b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two)),ny=f.redMul(e.redSub(d)),nz=f.redSqr().redSub(f).redSub(f);else{var h=this.z.redSqr(),j=f.redSub(h).redISub(h);nx=b.redSub(c).redISub(d).redMul(j),ny=f.redMul(e.redSub(d)),nz=f.redMul(j)}}else{var e=c.redAdd(d),h=this.curve._mulC(this.c.redMul(this.z)).redSqr(),j=e.redSub(h).redSub(h);nx=this.curve._mulC(b.redISub(e)).redMul(j),ny=this.curve._mulC(e).redMul(c.redISub(d)),nz=e.redMul(j)}return this.curve.point(nx,ny,nz)},Point.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Point.prototype._extAdd=function(p){var a=this.y.redSub(this.x).redMul(p.y.redSub(p.x)),b=this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)),c=this.t.redMul(this.curve.dd).redMul(p.t),d=this.z.redMul(p.z.redAdd(p.z)),e=b.redSub(a),f=d.redSub(c),g=d.redAdd(c),h=b.redAdd(a),nx=e.redMul(f),ny=g.redMul(h),nt=e.redMul(h),nz=f.redMul(g);return this.curve.point(nx,ny,nz,nt)},Point.prototype._projAdd=function(p){var ny,nz,a=this.z.redMul(p.z),b=a.redSqr(),c=this.x.redMul(p.x),d=this.y.redMul(p.y),e=this.curve.d.redMul(c).redMul(d),f=b.redSub(e),g=b.redAdd(e),tmp=this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d),nx=a.redMul(f).redMul(tmp);return this.curve.twisted?(ny=a.redMul(g).redMul(d.redSub(this.curve._mulA(c))),nz=f.redMul(g)):(ny=a.redMul(g).redMul(d.redSub(c)),nz=this.curve._mulC(f).redMul(g)),this.curve.point(nx,ny,nz)},Point.prototype.add=function(p){return this.isInfinity()?p:p.isInfinity()?this:this.curve.extended?this._extAdd(p):this._projAdd(p)},Point.prototype.mul=function(k){return this._hasDoubles(k)?this.curve._fixedNafMul(this,k):this.curve._wnafMul(this,k)},Point.prototype.mulAdd=function(k1,p,k2){return this.curve._wnafMulAdd(1,[this,p],[k1,k2],2,!1)},Point.prototype.jmulAdd=function(k1,p,k2){return this.curve._wnafMulAdd(1,[this,p],[k1,k2],2,!0)},Point.prototype.normalize=function(){if(this.zOne)return this;var zi=this.z.redInvm();return this.x=this.x.redMul(zi),this.y=this.y.redMul(zi),this.t&&(this.t=this.t.redMul(zi)),this.z=this.curve.one,this.zOne=!0,this},Point.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Point.prototype.getY=function(){return this.normalize(),this.y.fromRed()},Point.prototype.eq=function(other){return this===other||0===this.getX().cmp(other.getX())&&0===this.getY().cmp(other.getY())},Point.prototype.eqXToP=function(x){var rx=x.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(rx))return!0;for(var xc=x.clone(),t=this.curve.redN.redMul(this.z);;){if(xc.iadd(this.curve.n),xc.cmp(this.curve.p)>=0)return!1;if(rx.redIAdd(t),0===this.x.cmp(rx))return!0}return!1},Point.prototype.toP=Point.prototype.normalize,Point.prototype.mixedAdd=Point.prototype.add},function(module,exports,__webpack_require__){"use strict";function MontCurve(conf){Base.call(this,"mont",conf),this.a=new BN(conf.a,16).toRed(this.red),this.b=new BN(conf.b,16).toRed(this.red),this.i4=new BN(4).toRed(this.red).redInvm(),this.two=new BN(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function Point(curve,x,z){Base.BasePoint.call(this,curve,"projective"),null===x&&null===z?(this.x=this.curve.one, -this.z=this.curve.zero):(this.x=new BN(x,16),this.z=new BN(z,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var curve=__webpack_require__(98),BN=__webpack_require__(20),inherits=__webpack_require__(1),Base=curve.base,elliptic=__webpack_require__(27),utils=elliptic.utils;inherits(MontCurve,Base),module.exports=MontCurve,MontCurve.prototype.validate=function(point){var x=point.normalize().x,x2=x.redSqr(),rhs=x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);return 0===rhs.redSqrt().redSqr().cmp(rhs)},inherits(Point,Base.BasePoint),MontCurve.prototype.decodePoint=function(bytes,enc){return this.point(utils.toArray(bytes,enc),1)},MontCurve.prototype.point=function(x,z){return new Point(this,x,z)},MontCurve.prototype.pointFromJSON=function(obj){return Point.fromJSON(this,obj)},Point.prototype.precompute=function(){},Point.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Point.fromJSON=function(curve,obj){return new Point(curve,obj[0],obj[1]||curve.one)},Point.prototype.inspect=function(){return this.isInfinity()?"":""},Point.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Point.prototype.dbl=function(){var a=this.x.redAdd(this.z),aa=a.redSqr(),b=this.x.redSub(this.z),bb=b.redSqr(),c=aa.redSub(bb),nx=aa.redMul(bb),nz=c.redMul(bb.redAdd(this.curve.a24.redMul(c)));return this.curve.point(nx,nz)},Point.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.diffAdd=function(p,diff){var a=this.x.redAdd(this.z),b=this.x.redSub(this.z),c=p.x.redAdd(p.z),d=p.x.redSub(p.z),da=d.redMul(a),cb=c.redMul(b),nx=diff.z.redMul(da.redAdd(cb).redSqr()),nz=diff.x.redMul(da.redISub(cb).redSqr());return this.curve.point(nx,nz)},Point.prototype.mul=function(k){for(var t=k.clone(),a=this,b=this.curve.point(null,null),c=this,bits=[];0!==t.cmpn(0);t.iushrn(1))bits.push(t.andln(1));for(var i=bits.length-1;i>=0;i--)0===bits[i]?(a=a.diffAdd(b,c),b=b.dbl()):(b=a.diffAdd(b,c),a=a.dbl());return b},Point.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.eq=function(other){return 0===this.getX().cmp(other.getX())},Point.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(module,exports,__webpack_require__){"use strict";function ShortCurve(conf){Base.call(this,"short",conf),this.a=new BN(conf.a,16).toRed(this.red),this.b=new BN(conf.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(conf),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function Point(curve,x,y,isRed){Base.BasePoint.call(this,curve,"affine"),null===x&&null===y?(this.x=null,this.y=null,this.inf=!0):(this.x=new BN(x,16),this.y=new BN(y,16),isRed&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function JPoint(curve,x,y,z){Base.BasePoint.call(this,curve,"jacobian"),null===x&&null===y&&null===z?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN(0)):(this.x=new BN(x,16),this.y=new BN(y,16),this.z=new BN(z,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}var curve=__webpack_require__(98),elliptic=__webpack_require__(27),BN=__webpack_require__(20),inherits=__webpack_require__(1),Base=curve.base,assert=elliptic.utils.assert;inherits(ShortCurve,Base),module.exports=ShortCurve,ShortCurve.prototype._getEndomorphism=function(conf){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var beta,lambda;if(conf.beta)beta=new BN(conf.beta,16).toRed(this.red);else{var betas=this._getEndoRoots(this.p);beta=betas[0].cmp(betas[1])<0?betas[0]:betas[1],beta=beta.toRed(this.red)}if(conf.lambda)lambda=new BN(conf.lambda,16);else{var lambdas=this._getEndoRoots(this.n);0===this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta))?lambda=lambdas[0]:(lambda=lambdas[1],assert(0===this.g.mul(lambda).x.cmp(this.g.x.redMul(beta))))}var basis;return basis=conf.basis?conf.basis.map(function(vec){return{a:new BN(vec.a,16),b:new BN(vec.b,16)}}):this._getEndoBasis(lambda),{beta:beta,lambda:lambda,basis:basis}}},ShortCurve.prototype._getEndoRoots=function(num){var red=num===this.p?this.red:BN.mont(num),tinv=new BN(2).toRed(red).redInvm(),ntinv=tinv.redNeg(),s=new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);return[ntinv.redAdd(s).fromRed(),ntinv.redSub(s).fromRed()]},ShortCurve.prototype._getEndoBasis=function(lambda){for(var a0,b0,a1,b1,a2,b2,prevR,r,x,aprxSqrt=this.n.ushrn(Math.floor(this.n.bitLength()/2)),u=lambda,v=this.n.clone(),x1=new BN(1),y1=new BN(0),x2=new BN(0),y2=new BN(1),i=0;0!==u.cmpn(0);){var q=v.div(u);r=v.sub(q.mul(u)),x=x2.sub(q.mul(x1));var y=y2.sub(q.mul(y1));if(!a1&&r.cmp(aprxSqrt)<0)a0=prevR.neg(),b0=x1,a1=r.neg(),b1=x;else if(a1&&2==++i)break;prevR=r,v=u,u=r,x2=x1,x1=x,y2=y1,y1=y}a2=r.neg(),b2=x;var len1=a1.sqr().add(b1.sqr());return a2.sqr().add(b2.sqr()).cmp(len1)>=0&&(a2=a0,b2=b0),a1.negative&&(a1=a1.neg(),b1=b1.neg()),a2.negative&&(a2=a2.neg(),b2=b2.neg()),[{a:a1,b:b1},{a:a2,b:b2}]},ShortCurve.prototype._endoSplit=function(k){var basis=this.endo.basis,v1=basis[0],v2=basis[1],c1=v2.b.mul(k).divRound(this.n),c2=v1.b.neg().mul(k).divRound(this.n),p1=c1.mul(v1.a),p2=c2.mul(v2.a),q1=c1.mul(v1.b),q2=c2.mul(v2.b);return{k1:k.sub(p1).sub(p2),k2:q1.add(q2).neg()}},ShortCurve.prototype.pointFromX=function(x,odd){x=new BN(x,16),x.red||(x=x.toRed(this.red));var y2=x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b),y=y2.redSqrt();if(0!==y.redSqr().redSub(y2).cmp(this.zero))throw new Error("invalid point");var isOdd=y.fromRed().isOdd();return(odd&&!isOdd||!odd&&isOdd)&&(y=y.redNeg()),this.point(x,y)},ShortCurve.prototype.validate=function(point){if(point.inf)return!0;var x=point.x,y=point.y,ax=this.a.redMul(x),rhs=x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);return 0===y.redSqr().redISub(rhs).cmpn(0)},ShortCurve.prototype._endoWnafMulAdd=function(points,coeffs,jacobianResult){for(var npoints=this._endoWnafT1,ncoeffs=this._endoWnafT2,i=0;i":""},Point.prototype.isInfinity=function(){return this.inf},Point.prototype.add=function(p){if(this.inf)return p;if(p.inf)return this;if(this.eq(p))return this.dbl();if(this.neg().eq(p))return this.curve.point(null,null);if(0===this.x.cmp(p.x))return this.curve.point(null,null);var c=this.y.redSub(p.y);0!==c.cmpn(0)&&(c=c.redMul(this.x.redSub(p.x).redInvm()));var nx=c.redSqr().redISub(this.x).redISub(p.x),ny=c.redMul(this.x.redSub(nx)).redISub(this.y);return this.curve.point(nx,ny)},Point.prototype.dbl=function(){if(this.inf)return this;var ys1=this.y.redAdd(this.y);if(0===ys1.cmpn(0))return this.curve.point(null,null);var a=this.curve.a,x2=this.x.redSqr(),dyinv=ys1.redInvm(),c=x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv),nx=c.redSqr().redISub(this.x.redAdd(this.x)),ny=c.redMul(this.x.redSub(nx)).redISub(this.y);return this.curve.point(nx,ny)},Point.prototype.getX=function(){return this.x.fromRed()},Point.prototype.getY=function(){return this.y.fromRed()},Point.prototype.mul=function(k){return k=new BN(k,16),this._hasDoubles(k)?this.curve._fixedNafMul(this,k):this.curve.endo?this.curve._endoWnafMulAdd([this],[k]):this.curve._wnafMul(this,k)},Point.prototype.mulAdd=function(k1,p2,k2){var points=[this,p2],coeffs=[k1,k2];return this.curve.endo?this.curve._endoWnafMulAdd(points,coeffs):this.curve._wnafMulAdd(1,points,coeffs,2)},Point.prototype.jmulAdd=function(k1,p2,k2){var points=[this,p2],coeffs=[k1,k2];return this.curve.endo?this.curve._endoWnafMulAdd(points,coeffs,!0):this.curve._wnafMulAdd(1,points,coeffs,2,!0)},Point.prototype.eq=function(p){return this===p||this.inf===p.inf&&(this.inf||0===this.x.cmp(p.x)&&0===this.y.cmp(p.y))},Point.prototype.neg=function(_precompute){if(this.inf)return this;var res=this.curve.point(this.x,this.y.redNeg());if(_precompute&&this.precomputed){var pre=this.precomputed,negate=function(p){return p.neg()};res.precomputed={naf:pre.naf&&{wnd:pre.naf.wnd,points:pre.naf.points.map(negate)},doubles:pre.doubles&&{step:pre.doubles.step,points:pre.doubles.points.map(negate)}}}return res},Point.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},inherits(JPoint,Base.BasePoint),ShortCurve.prototype.jpoint=function(x,y,z){return new JPoint(this,x,y,z)},JPoint.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var zinv=this.z.redInvm(),zinv2=zinv.redSqr(),ax=this.x.redMul(zinv2),ay=this.y.redMul(zinv2).redMul(zinv);return this.curve.point(ax,ay)},JPoint.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},JPoint.prototype.add=function(p){if(this.isInfinity())return p;if(p.isInfinity())return this;var pz2=p.z.redSqr(),z2=this.z.redSqr(),u1=this.x.redMul(pz2),u2=p.x.redMul(z2),s1=this.y.redMul(pz2.redMul(p.z)),s2=p.y.redMul(z2.redMul(this.z)),h=u1.redSub(u2),r=s1.redSub(s2);if(0===h.cmpn(0))return 0!==r.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h2=h.redSqr(),h3=h2.redMul(h),v=u1.redMul(h2),nx=r.redSqr().redIAdd(h3).redISub(v).redISub(v),ny=r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)),nz=this.z.redMul(p.z).redMul(h);return this.curve.jpoint(nx,ny,nz)},JPoint.prototype.mixedAdd=function(p){if(this.isInfinity())return p.toJ();if(p.isInfinity())return this;var z2=this.z.redSqr(),u1=this.x,u2=p.x.redMul(z2),s1=this.y,s2=p.y.redMul(z2).redMul(this.z),h=u1.redSub(u2),r=s1.redSub(s2);if(0===h.cmpn(0))return 0!==r.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h2=h.redSqr(),h3=h2.redMul(h),v=u1.redMul(h2),nx=r.redSqr().redIAdd(h3).redISub(v).redISub(v),ny=r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)),nz=this.z.redMul(h);return this.curve.jpoint(nx,ny,nz)},JPoint.prototype.dblp=function(pow){if(0===pow)return this;if(this.isInfinity())return this;if(!pow)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var r=this,i=0;i=0)return!1;if(rx.redIAdd(t),0===this.x.cmp(rx))return!0}return!1},JPoint.prototype.inspect=function(){return this.isInfinity()?"":""},JPoint.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(module,exports,__webpack_require__){"use strict";function PresetCurve(options){"short"===options.type?this.curve=new elliptic.curve.short(options):"edwards"===options.type?this.curve=new elliptic.curve.edwards(options):this.curve=new elliptic.curve.mont(options),this.g=this.curve.g,this.n=this.curve.n,this.hash=options.hash,assert(this.g.validate(),"Invalid curve"),assert(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function defineCurve(name,options){Object.defineProperty(curves,name,{configurable:!0,enumerable:!0,get:function(){var curve=new PresetCurve(options);return Object.defineProperty(curves,name,{configurable:!0,enumerable:!0,value:curve}),curve}})}var curves=exports,hash=__webpack_require__(48),elliptic=__webpack_require__(27),assert=elliptic.utils.assert;curves.PresetCurve=PresetCurve,defineCurve("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:hash.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),defineCurve("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:hash.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),defineCurve("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:hash.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),defineCurve("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:hash.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),defineCurve("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:hash.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),defineCurve("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hash.sha256,gRed:!1,g:["9"]}),defineCurve("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hash.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var pre;try{pre=__webpack_require__(413)}catch(e){pre=void 0}defineCurve("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:hash.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",pre]})},function(module,exports,__webpack_require__){"use strict";function EC(options){if(!(this instanceof EC))return new EC(options);"string"==typeof options&&(assert(elliptic.curves.hasOwnProperty(options),"Unknown curve "+options),options=elliptic.curves[options]),options instanceof elliptic.curves.PresetCurve&&(options={curve:options}),this.curve=options.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=options.curve.g,this.g.precompute(options.curve.n.bitLength()+1),this.hash=options.hash||options.curve.hash}var BN=__webpack_require__(20),HmacDRBG=__webpack_require__(437),elliptic=__webpack_require__(27),utils=elliptic.utils,assert=utils.assert,KeyPair=__webpack_require__(408),Signature=__webpack_require__(409);module.exports=EC,EC.prototype.keyPair=function(options){return new KeyPair(this,options)},EC.prototype.keyFromPrivate=function(priv,enc){return KeyPair.fromPrivate(this,priv,enc)},EC.prototype.keyFromPublic=function(pub,enc){return KeyPair.fromPublic(this,pub,enc)},EC.prototype.genKeyPair=function(options){options||(options={});for(var drbg=new HmacDRBG({hash:this.hash,pers:options.pers,persEnc:options.persEnc||"utf8",entropy:options.entropy||elliptic.rand(this.hash.hmacStrength),entropyEnc:options.entropy&&options.entropyEnc||"utf8",nonce:this.n.toArray()}),bytes=this.n.byteLength(),ns2=this.n.sub(new BN(2));;){var priv=new BN(drbg.generate(bytes));if(!(priv.cmp(ns2)>0))return priv.iaddn(1),this.keyFromPrivate(priv)}},EC.prototype._truncateToN=function(msg,truncOnly){var delta=8*msg.byteLength()-this.n.bitLength();return delta>0&&(msg=msg.ushrn(delta)),!truncOnly&&msg.cmp(this.n)>=0?msg.sub(this.n):msg},EC.prototype.sign=function(msg,key,enc,options){"object"==typeof enc&&(options=enc,enc=null),options||(options={}),key=this.keyFromPrivate(key,enc),msg=this._truncateToN(new BN(msg,16));for(var bytes=this.n.byteLength(),bkey=key.getPrivate().toArray("be",bytes),nonce=msg.toArray("be",bytes),drbg=new HmacDRBG({hash:this.hash,entropy:bkey,nonce:nonce,pers:options.pers,persEnc:options.persEnc||"utf8"}),ns1=this.n.sub(new BN(1)),iter=0;!0;iter++){var k=options.k?options.k(iter):new BN(drbg.generate(this.n.byteLength()));if(k=this._truncateToN(k,!0),!(k.cmpn(1)<=0||k.cmp(ns1)>=0)){var kp=this.g.mul(k);if(!kp.isInfinity()){var kpX=kp.getX(),r=kpX.umod(this.n);if(0!==r.cmpn(0)){var s=k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));if(s=s.umod(this.n),0!==s.cmpn(0)){var recoveryParam=(kp.getY().isOdd()?1:0)|(0!==kpX.cmp(r)?2:0);return options.canonical&&s.cmp(this.nh)>0&&(s=this.n.sub(s),recoveryParam^=1),new Signature({r:r,s:s,recoveryParam:recoveryParam})}}}}}},EC.prototype.verify=function(msg,signature,key,enc){msg=this._truncateToN(new BN(msg,16)),key=this.keyFromPublic(key,enc),signature=new Signature(signature,"hex");var r=signature.r,s=signature.s;if(r.cmpn(1)<0||r.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var sinv=s.invm(this.n),u1=sinv.mul(msg).umod(this.n),u2=sinv.mul(r).umod(this.n);if(!this.curve._maxwellTrick){var p=this.g.mulAdd(u1,key.getPublic(),u2);return!p.isInfinity()&&0===p.getX().umod(this.n).cmp(r)}var p=this.g.jmulAdd(u1,key.getPublic(),u2);return!p.isInfinity()&&p.eqXToP(r)},EC.prototype.recoverPubKey=function(msg,signature,j,enc){assert((3&j)===j,"The recovery param is more than two bits"),signature=new Signature(signature,enc);var n=this.n,e=new BN(msg),r=signature.r,s=signature.s,isYOdd=1&j,isSecondKey=j>>1;if(r.cmp(this.curve.p.umod(this.curve.n))>=0&&isSecondKey)throw new Error("Unable to find sencond key candinate");r=isSecondKey?this.curve.pointFromX(r.add(this.curve.n),isYOdd):this.curve.pointFromX(r,isYOdd);var rInv=signature.r.invm(n),s1=n.sub(e).mul(rInv).umod(n),s2=s.mul(rInv).umod(n);return this.g.mulAdd(s1,r,s2)},EC.prototype.getKeyRecoveryParam=function(e,signature,Q,enc){if(signature=new Signature(signature,enc),null!==signature.recoveryParam)return signature.recoveryParam;for(var i=0;i<4;i++){var Qprime;try{Qprime=this.recoverPubKey(e,signature,i)}catch(e){continue}if(Qprime.eq(Q))return i}throw new Error("Unable to find valid recovery factor")}},function(module,exports,__webpack_require__){"use strict";function KeyPair(ec,options){this.ec=ec,this.priv=null,this.pub=null,options.priv&&this._importPrivate(options.priv,options.privEnc),options.pub&&this._importPublic(options.pub,options.pubEnc)}var BN=__webpack_require__(20),elliptic=__webpack_require__(27),utils=elliptic.utils,assert=utils.assert;module.exports=KeyPair,KeyPair.fromPublic=function(ec,pub,enc){return pub instanceof KeyPair?pub:new KeyPair(ec,{pub:pub,pubEnc:enc})},KeyPair.fromPrivate=function(ec,priv,enc){return priv instanceof KeyPair?priv:new KeyPair(ec,{priv:priv,privEnc:enc})},KeyPair.prototype.validate=function(){var pub=this.getPublic();return pub.isInfinity()?{result:!1,reason:"Invalid public key"}:pub.validate()?pub.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},KeyPair.prototype.getPublic=function(compact,enc){return"string"==typeof compact&&(enc=compact,compact=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),enc?this.pub.encode(enc,compact):this.pub},KeyPair.prototype.getPrivate=function(enc){return"hex"===enc?this.priv.toString(16,2):this.priv},KeyPair.prototype._importPrivate=function(key,enc){this.priv=new BN(key,enc||16),this.priv=this.priv.umod(this.ec.curve.n)},KeyPair.prototype._importPublic=function(key,enc){if(key.x||key.y)return"mont"===this.ec.curve.type?assert(key.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||assert(key.x&&key.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(key.x,key.y));this.pub=this.ec.curve.decodePoint(key,enc)},KeyPair.prototype.derive=function(pub){return pub.mul(this.priv).getX()},KeyPair.prototype.sign=function(msg,enc,options){return this.ec.sign(msg,this,enc,options)},KeyPair.prototype.verify=function(msg,signature){return this.ec.verify(msg,signature,this)},KeyPair.prototype.inspect=function(){return""}},function(module,exports,__webpack_require__){"use strict";function Signature(options,enc){if(options instanceof Signature)return options;this._importDER(options,enc)||(assert(options.r&&options.s,"Signature without r or s"),this.r=new BN(options.r,16),this.s=new BN(options.s,16),void 0===options.recoveryParam?this.recoveryParam=null:this.recoveryParam=options.recoveryParam)}function Position(){this.place=0}function getLength(buf,p){var initial=buf[p.place++];if(!(128&initial))return initial;for(var octetLen=15&initial,val=0,i=0,off=p.place;i>>3);for(arr.push(128|octets);--octets;)arr.push(len>>>(octets<<3)&255);arr.push(len)}var BN=__webpack_require__(20),elliptic=__webpack_require__(27),utils=elliptic.utils,assert=utils.assert;module.exports=Signature,Signature.prototype._importDER=function(data,enc){data=utils.toArray(data,enc);var p=new Position;if(48!==data[p.place++])return!1;if(getLength(data,p)+p.place!==data.length)return!1;if(2!==data[p.place++])return!1;var rlen=getLength(data,p),r=data.slice(p.place,rlen+p.place);if(p.place+=rlen,2!==data[p.place++])return!1;var slen=getLength(data,p);if(data.length!==slen+p.place)return!1;var s=data.slice(p.place,slen+p.place);return 0===r[0]&&128&r[1]&&(r=r.slice(1)),0===s[0]&&128&s[1]&&(s=s.slice(1)),this.r=new BN(r),this.s=new BN(s),this.recoveryParam=null,!0},Signature.prototype.toDER=function(enc){var r=this.r.toArray(),s=this.s.toArray();for(128&r[0]&&(r=[0].concat(r)),128&s[0]&&(s=[0].concat(s)),r=rmPadding(r),s=rmPadding(s);!(s[0]||128&s[1]);)s=s.slice(1);var arr=[2];constructLength(arr,r.length),arr=arr.concat(r),arr.push(2),constructLength(arr,s.length);var backHalf=arr.concat(s),res=[48];return constructLength(res,backHalf.length),res=res.concat(backHalf),utils.encode(res,enc)}},function(module,exports,__webpack_require__){"use strict";function EDDSA(curve){if(assert("ed25519"===curve,"only tested with ed25519 so far"),!(this instanceof EDDSA))return new EDDSA(curve);var curve=elliptic.curves[curve].curve;this.curve=curve,this.g=curve.g,this.g.precompute(curve.n.bitLength()+1),this.pointClass=curve.point().constructor,this.encodingLength=Math.ceil(curve.n.bitLength()/8),this.hash=hash.sha512}var hash=__webpack_require__(48),elliptic=__webpack_require__(27),utils=elliptic.utils,assert=utils.assert,parseBytes=utils.parseBytes,KeyPair=__webpack_require__(411),Signature=__webpack_require__(412);module.exports=EDDSA,EDDSA.prototype.sign=function(message,secret){message=parseBytes(message);var key=this.keyFromSecret(secret),r=this.hashInt(key.messagePrefix(),message),R=this.g.mul(r),Rencoded=this.encodePoint(R),s_=this.hashInt(Rencoded,key.pubBytes(),message).mul(key.priv()),S=r.add(s_).umod(this.curve.n);return this.makeSignature({R:R,S:S,Rencoded:Rencoded})},EDDSA.prototype.verify=function(message,sig,pub){ -message=parseBytes(message),sig=this.makeSignature(sig);var key=this.keyFromPublic(pub),h=this.hashInt(sig.Rencoded(),key.pubBytes(),message),SG=this.g.mul(sig.S());return sig.R().add(key.pub().mul(h)).eq(SG)},EDDSA.prototype.hashInt=function(){for(var hash=this.hash(),i=0;i=0;){var z;if(k.isOdd()){var mod=k.andln(ws-1);z=mod>(ws>>1)-1?(ws>>1)-mod:mod,k.isubn(z)}else z=0;naf.push(z);for(var shift=0!==k.cmpn(0)&&0===k.andln(ws-1)?w+1:1,i=1;i0||k2.cmpn(-d2)>0;){var m14=k1.andln(3)+d1&3,m24=k2.andln(3)+d2&3;3===m14&&(m14=-1),3===m24&&(m24=-1);var u1;if(0==(1&m14))u1=0;else{var m8=k1.andln(7)+d1&7;u1=3!==m8&&5!==m8||2!==m24?m14:-m14}jsf[0].push(u1);var u2;if(0==(1&m24))u2=0;else{var m8=k2.andln(7)+d2&7;u2=3!==m8&&5!==m8||2!==m14?m24:-m24}jsf[1].push(u2),2*d1===u1+1&&(d1=1-d1),2*d2===u2+1&&(d2=1-d2),k1.iushrn(1),k2.iushrn(1)}return jsf}function cachedProperty(obj,name,computer){var key="_"+name;obj.prototype[name]=function(){return void 0!==this[key]?this[key]:this[key]=computer.call(this)}}function parseBytes(bytes){return"string"==typeof bytes?utils.toArray(bytes,"hex"):bytes}function intFromLE(bytes){return new BN(bytes,"hex","le")}var utils=exports,BN=__webpack_require__(20),minAssert=__webpack_require__(111),minUtils=__webpack_require__(277);utils.assert=minAssert,utils.toArray=minUtils.toArray,utils.zero2=minUtils.zero2,utils.toHex=minUtils.toHex,utils.encode=minUtils.encode,utils.getNAF=getNAF,utils.getJSF=getJSF,utils.cachedProperty=cachedProperty, -utils.parseBytes=parseBytes,utils.intFromLE=intFromLE},function(module,exports,__webpack_require__){var once=__webpack_require__(82),noop=function(){},isRequest=function(stream){return stream.setHeader&&"function"==typeof stream.abort},isChildProcess=function(stream){return stream.stdio&&Array.isArray(stream.stdio)&&3===stream.stdio.length},eos=function(stream,opts,callback){if("function"==typeof opts)return eos(stream,null,opts);opts||(opts={}),callback=once(callback||noop);var ws=stream._writableState,rs=stream._readableState,readable=opts.readable||opts.readable!==!1&&stream.readable,writable=opts.writable||opts.writable!==!1&&stream.writable,onlegacyfinish=function(){stream.writable||onfinish()},onfinish=function(){writable=!1,readable||callback.call(stream)},onend=function(){readable=!1,writable||callback.call(stream)},onexit=function(exitCode){callback.call(stream,exitCode?new Error("exited with error code: "+exitCode):null)},onclose=function(){return(!readable||rs&&rs.ended)&&(!writable||ws&&ws.ended)?void 0:callback.call(stream,new Error("premature close"))},onrequest=function(){stream.req.on("finish",onfinish)};return isRequest(stream)?(stream.on("complete",onfinish),stream.on("abort",onclose),stream.req?onrequest():stream.on("request",onrequest)):writable&&!ws&&(stream.on("end",onlegacyfinish),stream.on("close",onlegacyfinish)),isChildProcess(stream)&&stream.on("exit",onexit),stream.on("end",onend),stream.on("finish",onfinish),opts.error!==!1&&stream.on("error",callback),stream.on("close",onclose),function(){stream.removeListener("complete",onfinish),stream.removeListener("abort",onclose),stream.removeListener("request",onrequest),stream.req&&stream.req.removeListener("finish",onfinish),stream.removeListener("end",onlegacyfinish),stream.removeListener("close",onlegacyfinish),stream.removeListener("finish",onfinish),stream.removeListener("exit",onexit),stream.removeListener("end",onend),stream.removeListener("error",callback),stream.removeListener("close",onclose)}};module.exports=eos},function(module,exports,__webpack_require__){function init(type,message,cause){prr(this,{type:type,name:type,cause:"string"!=typeof message?message:cause,message:message&&"string"!=typeof message?message.message:message},"ewr")}function CustomError(message,cause){Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,arguments.callee),init.call(this,"CustomError",message,cause)}function createError(errno,type,proto){var err=function(message,cause){init.call(this,type,message,cause),"FilesystemError"==type&&(this.code=this.cause.code,this.path=this.cause.path,this.errno=this.cause.errno,this.message=(errno.errno[this.cause.errno]?errno.errno[this.cause.errno].description:this.cause.message)+(this.cause.path?" ["+this.cause.path+"]":"")),Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,arguments.callee)};return err.prototype=proto?new proto:new CustomError,err}var prr=__webpack_require__(418);CustomError.prototype=new Error,module.exports=function(errno){var ce=function(type,proto){return createError(errno,type,proto)};return{CustomError:CustomError,FilesystemError:ce("FilesystemError"),createError:ce}}},function(module,exports,__webpack_require__){var all=module.exports.all=[{errno:-2,code:"ENOENT",description:"no such file or directory"},{errno:-1,code:"UNKNOWN",description:"unknown error"},{errno:0,code:"OK",description:"success"},{errno:1,code:"EOF",description:"end of file"},{errno:2,code:"EADDRINFO",description:"getaddrinfo error"},{errno:3,code:"EACCES",description:"permission denied"},{errno:4,code:"EAGAIN",description:"resource temporarily unavailable"},{errno:5,code:"EADDRINUSE",description:"address already in use"},{errno:6,code:"EADDRNOTAVAIL",description:"address not available"},{errno:7,code:"EAFNOSUPPORT",description:"address family not supported"},{errno:8,code:"EALREADY",description:"connection already in progress"},{errno:9,code:"EBADF",description:"bad file descriptor"},{errno:10,code:"EBUSY",description:"resource busy or locked"},{errno:11,code:"ECONNABORTED",description:"software caused connection abort"},{errno:12,code:"ECONNREFUSED",description:"connection refused"},{errno:13,code:"ECONNRESET",description:"connection reset by peer"},{errno:14,code:"EDESTADDRREQ",description:"destination address required"},{errno:15,code:"EFAULT",description:"bad address in system call argument"},{errno:16,code:"EHOSTUNREACH",description:"host is unreachable"},{errno:17,code:"EINTR",description:"interrupted system call"},{errno:18,code:"EINVAL",description:"invalid argument"},{errno:19,code:"EISCONN",description:"socket is already connected"},{errno:20,code:"EMFILE",description:"too many open files"},{errno:21,code:"EMSGSIZE",description:"message too long"},{errno:22,code:"ENETDOWN",description:"network is down"},{errno:23,code:"ENETUNREACH",description:"network is unreachable"},{errno:24,code:"ENFILE",description:"file table overflow"},{errno:25,code:"ENOBUFS",description:"no buffer space available"},{errno:26,code:"ENOMEM",description:"not enough memory"},{errno:27,code:"ENOTDIR",description:"not a directory"},{errno:28,code:"EISDIR",description:"illegal operation on a directory"},{errno:29,code:"ENONET",description:"machine is not on the network"},{errno:31,code:"ENOTCONN",description:"socket is not connected"},{errno:32,code:"ENOTSOCK",description:"socket operation on non-socket"},{errno:33,code:"ENOTSUP",description:"operation not supported on socket"},{errno:34,code:"ENOENT",description:"no such file or directory"},{errno:35,code:"ENOSYS",description:"function not implemented"},{errno:36,code:"EPIPE",description:"broken pipe"},{errno:37,code:"EPROTO",description:"protocol error"},{errno:38,code:"EPROTONOSUPPORT",description:"protocol not supported"},{errno:39,code:"EPROTOTYPE",description:"protocol wrong type for socket"},{errno:40,code:"ETIMEDOUT",description:"connection timed out"},{errno:41,code:"ECHARSET",description:"invalid Unicode character"},{errno:42,code:"EAIFAMNOSUPPORT",description:"address family for hostname not supported"},{errno:44,code:"EAISERVICE",description:"servname not supported for ai_socktype"},{errno:45,code:"EAISOCKTYPE",description:"ai_socktype not supported"},{errno:46,code:"ESHUTDOWN",description:"cannot send after transport endpoint shutdown"},{errno:47,code:"EEXIST",description:"file already exists"},{errno:48,code:"ESRCH",description:"no such process"},{errno:49,code:"ENAMETOOLONG",description:"name too long"},{errno:50,code:"EPERM",description:"operation not permitted"},{errno:51,code:"ELOOP",description:"too many symbolic links encountered"},{errno:52,code:"EXDEV",description:"cross-device link not permitted"},{errno:53,code:"ENOTEMPTY",description:"directory not empty"},{errno:54,code:"ENOSPC",description:"no space left on device"},{errno:55,code:"EIO",description:"i/o error"},{errno:56,code:"EROFS",description:"read-only file system"},{errno:57,code:"ENODEV",description:"no such device"},{errno:58,code:"ESPIPE",description:"invalid seek"},{errno:59,code:"ECANCELED",description:"operation canceled"}];module.exports.errno={},module.exports.code={},all.forEach(function(error){module.exports.errno[error.errno]=error,module.exports.code[error.code]=error}),module.exports.custom=__webpack_require__(416)(module.exports),module.exports.create=module.exports.custom.createError},function(module,exports){!function(name,context,definition){void 0!==module&&module.exports?module.exports=definition():context.prr=definition()}(0,this,function(){var setProperty="function"==typeof Object.defineProperty?function(obj,key,options){return Object.defineProperty(obj,key,options),obj}:function(obj,key,options){return obj[key]=options.value,obj},makeOptions=function(value,options){var oo="object"==typeof options,os=!oo&&"string"==typeof options,op=function(p){return oo?!!options[p]:!!os&&options.indexOf(p[0])>-1};return{enumerable:op("enumerable"),configurable:op("configurable"),writable:op("writable"),value:value}};return function(obj,key,value,options){var k;if(options=makeOptions(value,options),"object"==typeof key){for(k in key)Object.hasOwnProperty.call(key,k)&&(options.value=key[k],setProperty(obj,k,options));return obj}return setProperty(obj,key,options)}})},function(module,exports,__webpack_require__){(function(Buffer){const ethUtil=__webpack_require__(420),rlp=__webpack_require__(52);var Account=module.exports=function(data){var fields=[{name:"nonce",default:new Buffer([])},{name:"balance",default:new Buffer([])},{name:"stateRoot",length:32,default:ethUtil.SHA3_RLP},{name:"codeHash",length:32,default:ethUtil.SHA3_NULL}];ethUtil.defineProperties(this,fields,data)};Account.prototype.serialize=function(){return rlp.encode(this.raw)},Account.prototype.isContract=function(){return this.codeHash.toString("hex")!==ethUtil.SHA3_NULL_S},Account.prototype.getCode=function(state,cb){if(!this.isContract())return void cb(null,new Buffer([]));state.getRaw(this.codeHash,cb)},Account.prototype.setCode=function(trie,code,cb){var self=this;if(this.codeHash=ethUtil.sha3(code),this.codeHash.toString("hex")===ethUtil.SHA3_NULL_S)return void cb(null,new Buffer([]));trie.putRaw(this.codeHash,code,function(err){cb(err,self.codeHash)})},Account.prototype.getStorage=function(trie,key,cb){var t=trie.copy();t.root=this.stateRoot,t.get(key,cb)},Account.prototype.setStorage=function(trie,key,val,cb){var self=this,t=trie.copy();t.root=self.stateRoot,t.put(key,val,function(err){if(err)return cb();self.stateRoot=t.root,cb()})},Account.prototype.isEmpty=function(){return""===this.balance.toString("hex")&&""===this.nonce.toString("hex")&&this.stateRoot.toString("hex")===ethUtil.SHA3_RLP_S&&this.codeHash.toString("hex")===ethUtil.SHA3_NULL_S}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){const SHA3=__webpack_require__(241),secp256k1=__webpack_require__(162),assert=__webpack_require__(7),rlp=__webpack_require__(52),BN=__webpack_require__(20),createHash=__webpack_require__(75);exports.MAX_INTEGER=new BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),exports.TWO_POW256=new BN("10000000000000000000000000000000000000000000000000000000000000000",16),exports.SHA3_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",exports.SHA3_NULL=new Buffer(exports.SHA3_NULL_S,"hex"),exports.SHA3_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",exports.SHA3_RLP_ARRAY=new Buffer(exports.SHA3_RLP_ARRAY_S,"hex"),exports.SHA3_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",exports.SHA3_RLP=new Buffer(exports.SHA3_RLP_S,"hex"),exports.BN=BN,exports.rlp=rlp,exports.secp256k1=secp256k1,exports.zeros=function(bytes){var buf=new Buffer(bytes);return buf.fill(0),buf},exports.setLengthLeft=exports.setLength=function(msg,length,right){var buf=exports.zeros(length);return msg=exports.toBuffer(msg),right?msg.length0&&"0"===first.toString();)a=a.slice(1),first=a[0];return a},exports.toBuffer=function(v){if(!Buffer.isBuffer(v))if(Array.isArray(v))v=new Buffer(v);else if("string"==typeof v)v=exports.isHexPrefixed(v)?new Buffer(exports.padToEven(exports.stripHexPrefix(v)),"hex"):new Buffer(v);else if("number"==typeof v)v=exports.intToBuffer(v);else if(null===v||void 0===v)v=new Buffer([]);else{if(!v.toArray)throw new Error("invalid type");v=new Buffer(v.toArray())}return v},exports.intToHex=function(i){assert(i%1==0,"number is not a integer"),assert(i>=0,"number must be positive");var hex=i.toString(16);return hex.length%2&&(hex="0"+hex),"0x"+hex},exports.intToBuffer=function(i){return new Buffer(exports.intToHex(i).slice(2),"hex")},exports.bufferToInt=function(buf){return parseInt(exports.bufferToHex(buf),16)},exports.bufferToHex=function(buf){return buf=exports.toBuffer(buf),0===buf.length?0:"0x"+buf.toString("hex")},exports.fromSigned=function(num){return new BN(num).fromTwos(256)},exports.toUnsigned=function(num){return new Buffer(num.toTwos(256).toArray())},exports.sha3=function(a,bytes){a=exports.toBuffer(a),bytes||(bytes=256);var h=new SHA3(bytes);return a&&h.update(a),new Buffer(h.digest("hex"),"hex")},exports.sha256=function(a){return a=exports.toBuffer(a),createHash("sha256").update(a).digest()},exports.ripemd160=function(a,padded){a=exports.toBuffer(a);var hash=createHash("rmd160").update(a).digest();return padded===!0?exports.setLength(hash,32):hash},exports.rlphash=function(a){return exports.sha3(rlp.encode(a))},exports.isValidPrivate=function(privateKey){return secp256k1.privateKeyVerify(privateKey)},exports.isValidPublic=function(publicKey,sanitize){return 64===publicKey.length?secp256k1.publicKeyVerify(Buffer.concat([new Buffer([4]),publicKey])):!!sanitize&&secp256k1.publicKeyVerify(publicKey)},exports.pubToAddress=exports.publicToAddress=function(pubKey,sanitize){return pubKey=exports.toBuffer(pubKey),sanitize&&64!==pubKey.length&&(pubKey=secp256k1.publicKeyConvert(pubKey,!1).slice(1)),assert(64===pubKey.length),exports.sha3(pubKey).slice(-20)};var privateToPublic=exports.privateToPublic=function(privateKey){return privateKey=exports.toBuffer(privateKey),secp256k1.publicKeyCreate(privateKey,!1).slice(1)};exports.importPublic=function(publicKey){return publicKey=exports.toBuffer(publicKey),64!==publicKey.length&&(publicKey=secp256k1.publicKeyConvert(publicKey,!1).slice(1)),publicKey},exports.ecsign=function(msgHash,privateKey){var sig=secp256k1.sign(msgHash,privateKey),ret={};return ret.r=sig.signature.slice(0,32),ret.s=sig.signature.slice(32,64),ret.v=sig.recovery+27,ret},exports.ecrecover=function(msgHash,v,r,s){var signature=Buffer.concat([exports.setLength(r,32),exports.setLength(s,32)],64),recovery=exports.bufferToInt(v)-27;if(0!==recovery&&1!==recovery)throw new Error("Invalid signature v value");var senderPubKey=secp256k1.recover(msgHash,signature,recovery);return secp256k1.publicKeyConvert(senderPubKey,!1).slice(1)},exports.toRpcSig=function(v,r,s){return exports.bufferToHex(Buffer.concat([r,s,exports.toBuffer(v-27)]))},exports.fromRpcSig=function(sig){sig=exports.toBuffer(sig);var v=sig[64];return v<27&&(v+=27),{v:v,r:sig.slice(0,32),s:sig.slice(32,64)}},exports.privateToAddress=function(privateKey){return exports.publicToAddress(privateToPublic(privateKey))},exports.isValidAddress=function(address){return/^0x[0-9a-fA-F]{40}$/i.test(address)},exports.toChecksumAddress=function(address){address=exports.stripHexPrefix(address).toLowerCase();for(var hash=exports.sha3(address).toString("hex"),ret="0x",i=0;i=8?address[i].toUpperCase():address[i];return ret},exports.isValidChecksumAddress=function(address){return exports.isValidAddress(address)&&exports.toChecksumAddress(address)===address},exports.generateAddress=function(from,nonce){return from=exports.toBuffer(from),nonce=new BN(nonce),nonce=nonce.isZero()?null:new Buffer(nonce.toArray()),exports.rlphash([from,nonce]).slice(-20)},exports.isPrecompiled=function(address){var a=exports.unpad(address);return 1===a.length&&a[0]>0&&a[0]<5},exports.isHexPrefixed=function(str){return"0x"===str.slice(0,2)},exports.stripHexPrefix=function(str){return"string"!=typeof str?str:exports.isHexPrefixed(str)?str.slice(2):str},exports.addHexPrefix=function(str){return"string"!=typeof str?str:exports.isHexPrefixed(str)?str:"0x"+str},exports.padToEven=function(a){return a.length%2&&(a="0"+a),a},exports.baToJSON=function(ba){if(Buffer.isBuffer(ba))return"0x"+ba.toString("hex");if(ba instanceof Array){for(var array=[],i=0;i=v.length,"The field "+field.name+" must not have more "+field.length+" bytes")):field.allowZero&&0===v.length||!field.length||assert(field.length===v.length,"The field "+field.name+" must have byte length of "+field.length),self.raw[i]=v}self._fields.push(field.name),Object.defineProperty(self,field.name,{enumerable:!0,configurable:!0,get:getter,set:setter}),field.default&&(self[field.name]=field.default),field.alias&&Object.defineProperty(self,field.alias,{enumerable:!1,configurable:!0,set:setter,get:getter})}),data)if("string"==typeof data&&(data=new Buffer(exports.stripHexPrefix(data),"hex")),Buffer.isBuffer(data)&&(data=rlp.decode(data)),Array.isArray(data)){if(data.length>self._fields.length)throw new Error("wrong number of fields in data");data.forEach(function(d,i){self[self._fields[i]]=exports.toBuffer(d)})}else{if("object"!=typeof data)throw new Error("invalid data");for(var prop in data)self._fields.indexOf(prop)!==-1&&(self[prop]=data[prop])}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const ethUtil=__webpack_require__(210),fees=__webpack_require__(238),BN=ethUtil.BN,N_DIV_2=new BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16);class Transaction{constructor(data){data=data||{};const fields=[{name:"nonce",length:32,allowLess:!0,default:new Buffer([])},{name:"gasPrice",length:32,allowLess:!0,default:new Buffer([])},{name:"gasLimit",alias:"gas",length:32,allowLess:!0,default:new Buffer([])},{name:"to",allowZero:!0,length:20,default:new Buffer([])},{name:"value",length:32,allowLess:!0,default:new Buffer([])},{name:"data",alias:"input",allowZero:!0,default:new Buffer([])},{name:"v",default:new Buffer([28])},{name:"r",length:32,allowLess:!0,default:new Buffer([])},{name:"s",length:32,allowLess:!0,default:new Buffer([])}];ethUtil.defineProperties(this,fields,data),Object.defineProperty(this,"from",{enumerable:!0,configurable:!0,get:this.getSenderAddress.bind(this)});let sigV=ethUtil.bufferToInt(this.v),chainId=Math.floor((sigV-35)/2);chainId<0&&(chainId=0),this._chainId=chainId||data.chainId||0,this._homestead=!0}toCreationAddress(){return""===this.to.toString("hex")}hash(includeSignature){void 0===includeSignature&&(includeSignature=!0);let items;if(includeSignature)items=this.raw;else if(this._chainId>0){const raw=this.raw.slice();this.v=this._chainId,this.r=0,this.s=0,items=this.raw,this.raw=raw}else items=this.raw.slice(0,6);return ethUtil.rlphash(items)}getChainId(){return this._chainId}getSenderAddress(){if(this._from)return this._from;const pubkey=this.getSenderPublicKey();return this._from=ethUtil.publicToAddress(pubkey),this._from}getSenderPublicKey(){if(!(this._senderPubKey&&this._senderPubKey.length||this.verifySignature()))throw new Error("Invalid Signature");return this._senderPubKey}verifySignature(){const msgHash=this.hash(!1);if(this._homestead&&1===new BN(this.s).cmp(N_DIV_2))return!1;try{let v=ethUtil.bufferToInt(this.v);this._chainId>0&&(v-=2*this._chainId+8),this._senderPubKey=ethUtil.ecrecover(msgHash,v,this.r,this.s)}catch(e){return!1}return!!this._senderPubKey}sign(privateKey){const msgHash=this.hash(!1),sig=ethUtil.ecsign(msgHash,privateKey);this._chainId>0&&(sig.v+=2*this._chainId+8),Object.assign(this,sig)}getDataFee(){const data=this.raw[5],cost=new BN(0);for(let i=0;i0&&errors.push([`gas limit is too low. Need at least ${this.getBaseFee()}`]),void 0===stringError||stringError===!1?0===errors.length:errors.join(" ")}}module.exports=Transaction}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function padToEven(value){var a=value;if("string"!=typeof a)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof a+", while padToEven.");return a.length%2&&(a="0"+a),a}function intToHex(i){return"0x"+padToEven(i.toString(16))}function intToBuffer(i){return new Buffer(intToHex(i).slice(2),"hex")}function getBinarySize(str){if("string"!=typeof str)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof str+"'.");return Buffer.byteLength(str,"utf8")}function arrayContainsArray(superset,subset,some){if(Array.isArray(superset)!==!0)throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof superset+"'");if(Array.isArray(subset)!==!0)throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof subset+"'");return subset[Boolean(some)&&"some"||"every"](function(value){return superset.indexOf(value)>=0})}function toUtf8(hex){return new Buffer(padToEven(stripHexPrefix(hex).replace(/^0+|0+$/g,"")),"hex").toString("utf8")}function toAscii(hex){var str="",i=0,l=hex.length;for("0x"===hex.substring(0,2)&&(i=2);i "+str;return emitter.emit("error",err)}const leaveEv=emit._state+":leave",enterEv=nwState+":enter";return emit._state?function(){emitter._events[leaveEv]?emitter.emit(leaveEv,enter):enter()}():enter()}"object"==typeof start&&(events=start,start="START"),assert.equal(typeof start,"string"),assert.equal(typeof events,"object"),assert.ok(events[start],"invalid starting state "+start),assert.ok(fsm.validate(events));const emitter=new EventEmitter;return emit._graph=fsm.reachable(events),emit._emitter=emitter,emit._events=events,emit._state=start,emit.emit=emit,emit.on=on,emit}function reach(curr,next,reachable){if(!next)return!1;if(!curr)return!0;const here=reachable[curr];return!(!here||!here[next])&&1===here[next].length}const EventEmitter=__webpack_require__(8).EventEmitter,assert=__webpack_require__(7),fsm=__webpack_require__(424);module.exports=fsmEvent},function(module,exports){function each(obj,iter){for(var key in obj){iter(obj[key],key,obj)}}function keys(obj){return Object.keys(obj).sort()}function contains(a,v){return~a.indexOf(v)}function union(a,b){return a.filter(function(v){return contains(b,v)})}function disunion(a,b){return a.filter(function(v){return!contains(b,v)}).concat(b.filter(function(v){return!contains(a,v)})).sort()}function empty(v){for(var k in v)return!1;return!0}function events(fsm){var events=[];return each(fsm,function(state,name){each(state,function(_state,event){contains(events,event)||events.push(event)})}),events.sort()}var reachable=(exports.validate=function(fsm){Object.keys(fsm);return each(fsm,function(state,name){each(state,function(_state,event){if(!fsm[_state])throw new Error("invalid transition from state:"+name+" to state:"+_state+" on event:"+event)})}),!0},exports.reachable=function(fsm){var reachable={},added=!1;do{added=!1,each(fsm,function(state,name){var reach=reachable[name]=reachable[name]||{};each(state,function(_name,event){reach[_name]||(reach[_name]=[event],added=!0)}),each(state,function(_name,event){each(reachable[_name],function(path,_name){reach[_name]||(reach[_name]=[event].concat(path),added=!0)})})})}while(added);return reachable});exports.terminal=exports.deadlock=function(fsm){var dead=[];return each(fsm,function(state,name){empty(state)&&dead.push(name)}),dead};exports.livelock=function(fsm,terminals){var reach=reachable(fsm),locked=[];return each(reach,function(reaches,name){contains(terminals,name)||each(terminals,function(_name){reaches[_name]||contains(locked,name)||locked.push(name)})}),locked.sort()},exports.combine=function(fsm1,fsm2,start1,start2){function expand(name1,name2){var state,cName=name1+"-"+name2;combined[cName]||(combined[cName]={}),state=combined[cName];var trans1=keys(fsm1[name1]),trans2=keys(fsm2[name2]);return union(trans1,trans2).forEach(function(event){state[event]=fsm1[name1][event]+"-"+fsm2[name2][event],combined[state[event]]||expand(fsm1[name1][event],fsm2[name2][event])}),union(independent,trans1).forEach(function(event){state[event]=fsm1[name1][event]+"-"+name2,combined[state[event]]||expand(fsm1[name1][event],name2)}),union(independent,trans2).forEach(function(event){state[event]=name1+"-"+fsm2[name2][event],combined[state[event]]||expand(name1,fsm2[name2][event])}),combined[cName]}var combined={},events1=events(fsm1),events2=events(fsm2),independent=disunion(events1,events2);return expand(start1,start2),combined}},function(module,exports,__webpack_require__){"use strict";function RBNode(color,key,value,left,right,count){this._color=color,this.key=key,this.value=value,this.left=left,this.right=right,this._count=count}function cloneNode(node){return new RBNode(node._color,node.key,node.value,node.left,node.right,node._count)}function repaint(color,node){return new RBNode(color,node.key,node.value,node.left,node.right,node._count)}function recount(node){node._count=1+(node.left?node.left._count:0)+(node.right?node.right._count:0)}function RedBlackTree(compare,root){this._compare=compare,this.root=root}function doVisitFull(visit,node){if(node.left){var v=doVisitFull(visit,node.left);if(v)return v}var v=visit(node.key,node.value);return v?v:node.right?doVisitFull(visit,node.right):void 0}function doVisitHalf(lo,compare,visit,node){if(compare(lo,node.key)<=0){if(node.left){var v=doVisitHalf(lo,compare,visit,node.left);if(v)return v}var v=visit(node.key,node.value);if(v)return v}if(node.right)return doVisitHalf(lo,compare,visit,node.right)}function doVisit(lo,hi,compare,visit,node){var v,l=compare(lo,node.key),h=compare(hi,node.key);if(l<=0){if(node.left&&(v=doVisit(lo,hi,compare,visit,node.left)))return v;if(h>0&&(v=visit(node.key,node.value)))return v}if(h>0&&node.right)return doVisit(lo,hi,compare,visit,node.right)}function RedBlackTreeIterator(tree,stack){this.tree=tree,this._stack=stack}function swapNode(n,v){n.key=v.key,n.value=v.value,n.left=v.left,n.right=v.right,n._color=v._color,n._count=v._count}function fixDoubleBlack(stack){for(var n,p,s,z,i=stack.length-1;i>=0;--i){if(n=stack[i],0===i)return void(n._color=BLACK);if(p=stack[i-1],p.left===n){if(s=p.right,s.right&&s.right._color===RED){if(s=p.right=cloneNode(s),z=s.right=cloneNode(s.right),p.right=s.left,s.left=p,s.right=z,s._color=p._color,n._color=BLACK,p._color=BLACK,z._color=BLACK,recount(p),recount(s),i>1){var pp=stack[i-2];pp.left===p?pp.left=s:pp.right=s}return void(stack[i-1]=s)}if(s.left&&s.left._color===RED){if(s=p.right=cloneNode(s),z=s.left=cloneNode(s.left),p.right=z.left,s.left=z.right,z.left=p,z.right=s,z._color=p._color,p._color=BLACK,s._color=BLACK,n._color=BLACK,recount(p),recount(s),recount(z),i>1){var pp=stack[i-2];pp.left===p?pp.left=z:pp.right=z}return void(stack[i-1]=z)}if(s._color===BLACK){if(p._color===RED)return p._color=BLACK,void(p.right=repaint(RED,s));p.right=repaint(RED,s);continue}if(s=cloneNode(s),p.right=s.left,s.left=p,s._color=p._color,p._color=RED,recount(p),recount(s),i>1){var pp=stack[i-2];pp.left===p?pp.left=s:pp.right=s}stack[i-1]=s,stack[i]=p,i+11){var pp=stack[i-2];pp.right===p?pp.right=s:pp.left=s}return void(stack[i-1]=s)}if(s.right&&s.right._color===RED){if(s=p.left=cloneNode(s),z=s.right=cloneNode(s.right),p.left=z.right,s.right=z.left,z.right=p,z.left=s,z._color=p._color,p._color=BLACK,s._color=BLACK,n._color=BLACK,recount(p),recount(s),recount(z),i>1){var pp=stack[i-2];pp.right===p?pp.right=z:pp.left=z}return void(stack[i-1]=z)}if(s._color===BLACK){if(p._color===RED)return p._color=BLACK,void(p.left=repaint(RED,s));p.left=repaint(RED,s);continue}if(s=cloneNode(s),p.left=s.right,s.right=p,s._color=p._color,p._color=RED,recount(p),recount(s),i>1){var pp=stack[i-2];pp.right===p?pp.right=s:pp.left=s}stack[i-1]=s,stack[i]=p,i+1b?1:0}function createRBTree(compare){return new RedBlackTree(compare||defaultCompare,null)}module.exports=createRBTree;var RED=0,BLACK=1,proto=RedBlackTree.prototype;Object.defineProperty(proto,"keys",{get:function(){var result=[];return this.forEach(function(k,v){result.push(k)}),result}}),Object.defineProperty(proto,"values",{get:function(){var result=[];return this.forEach(function(k,v){result.push(v)}),result}}),Object.defineProperty(proto,"length",{get:function(){return this.root?this.root._count:0}}),proto.insert=function(key,value){for(var cmp=this._compare,n=this.root,n_stack=[],d_stack=[];n;){var d=cmp(key,n.key);n_stack.push(n),d_stack.push(d),n=d<=0?n.left:n.right}n_stack.push(new RBNode(RED,key,value,null,null,1));for(var s=n_stack.length-2;s>=0;--s){var n=n_stack[s];d_stack[s]<=0?n_stack[s]=new RBNode(n._color,n.key,n.value,n_stack[s+1],n.right,n._count+1):n_stack[s]=new RBNode(n._color,n.key,n.value,n.left,n_stack[s+1],n._count+1)}for(var s=n_stack.length-1;s>1;--s){var p=n_stack[s-1],n=n_stack[s];if(p._color===BLACK||n._color===BLACK)break;var pp=n_stack[s-2];if(pp.left===p)if(p.left===n){var y=pp.right;if(!y||y._color!==RED){if(pp._color=RED, -pp.left=p.right,p._color=BLACK,p.right=pp,n_stack[s-2]=p,n_stack[s-1]=n,recount(pp),recount(p),s>=3){var ppp=n_stack[s-3];ppp.left===pp?ppp.left=p:ppp.right=p}break}p._color=BLACK,pp.right=repaint(BLACK,y),pp._color=RED,s-=1}else{var y=pp.right;if(!y||y._color!==RED){if(p.right=n.left,pp._color=RED,pp.left=n.right,n._color=BLACK,n.left=p,n.right=pp,n_stack[s-2]=n,n_stack[s-1]=p,recount(pp),recount(p),recount(n),s>=3){var ppp=n_stack[s-3];ppp.left===pp?ppp.left=n:ppp.right=n}break}p._color=BLACK,pp.right=repaint(BLACK,y),pp._color=RED,s-=1}else if(p.right===n){var y=pp.left;if(!y||y._color!==RED){if(pp._color=RED,pp.right=p.left,p._color=BLACK,p.left=pp,n_stack[s-2]=p,n_stack[s-1]=n,recount(pp),recount(p),s>=3){var ppp=n_stack[s-3];ppp.right===pp?ppp.right=p:ppp.left=p}break}p._color=BLACK,pp.left=repaint(BLACK,y),pp._color=RED,s-=1}else{var y=pp.left;if(!y||y._color!==RED){if(p.left=n.right,pp._color=RED,pp.right=n.left,n._color=BLACK,n.right=p,n.left=pp,n_stack[s-2]=n,n_stack[s-1]=p,recount(pp),recount(p),recount(n),s>=3){var ppp=n_stack[s-3];ppp.right===pp?ppp.right=n:ppp.left=n}break}p._color=BLACK,pp.left=repaint(BLACK,y),pp._color=RED,s-=1}}return n_stack[0]._color=BLACK,new RedBlackTree(cmp,n_stack[0])},proto.forEach=function(visit,lo,hi){if(this.root)switch(arguments.length){case 1:return doVisitFull(visit,this.root);case 2:return doVisitHalf(lo,this._compare,visit,this.root);case 3:if(this._compare(lo,hi)>=0)return;return doVisit(lo,hi,this._compare,visit,this.root)}},Object.defineProperty(proto,"begin",{get:function(){for(var stack=[],n=this.root;n;)stack.push(n),n=n.left;return new RedBlackTreeIterator(this,stack)}}),Object.defineProperty(proto,"end",{get:function(){for(var stack=[],n=this.root;n;)stack.push(n),n=n.right;return new RedBlackTreeIterator(this,stack)}}),proto.at=function(idx){if(idx<0)return new RedBlackTreeIterator(this,[]);for(var n=this.root,stack=[];;){if(stack.push(n),n.left){if(idx=n.right._count)break;n=n.right}return new RedBlackTreeIterator(this,[])},proto.ge=function(key){for(var cmp=this._compare,n=this.root,stack=[],last_ptr=0;n;){var d=cmp(key,n.key);stack.push(n),d<=0&&(last_ptr=stack.length),n=d<=0?n.left:n.right}return stack.length=last_ptr,new RedBlackTreeIterator(this,stack)},proto.gt=function(key){for(var cmp=this._compare,n=this.root,stack=[],last_ptr=0;n;){var d=cmp(key,n.key);stack.push(n),d<0&&(last_ptr=stack.length),n=d<0?n.left:n.right}return stack.length=last_ptr,new RedBlackTreeIterator(this,stack)},proto.lt=function(key){for(var cmp=this._compare,n=this.root,stack=[],last_ptr=0;n;){var d=cmp(key,n.key);stack.push(n),d>0&&(last_ptr=stack.length),n=d<=0?n.left:n.right}return stack.length=last_ptr,new RedBlackTreeIterator(this,stack)},proto.le=function(key){for(var cmp=this._compare,n=this.root,stack=[],last_ptr=0;n;){var d=cmp(key,n.key);stack.push(n),d>=0&&(last_ptr=stack.length),n=d<0?n.left:n.right}return stack.length=last_ptr,new RedBlackTreeIterator(this,stack)},proto.find=function(key){for(var cmp=this._compare,n=this.root,stack=[];n;){var d=cmp(key,n.key);if(stack.push(n),0===d)return new RedBlackTreeIterator(this,stack);n=d<=0?n.left:n.right}return new RedBlackTreeIterator(this,[])},proto.remove=function(key){var iter=this.find(key);return iter?iter.remove():this},proto.get=function(key){for(var cmp=this._compare,n=this.root;n;){var d=cmp(key,n.key);if(0===d)return n.value;n=d<=0?n.left:n.right}};var iproto=RedBlackTreeIterator.prototype;Object.defineProperty(iproto,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(iproto,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),iproto.clone=function(){return new RedBlackTreeIterator(this.tree,this._stack.slice())},iproto.remove=function(){var stack=this._stack;if(0===stack.length)return this.tree;var cstack=new Array(stack.length),n=stack[stack.length-1];cstack[cstack.length-1]=new RBNode(n._color,n.key,n.value,n.left,n.right,n._count);for(var i=stack.length-2;i>=0;--i){var n=stack[i];n.left===stack[i+1]?cstack[i]=new RBNode(n._color,n.key,n.value,cstack[i+1],n.right,n._count):cstack[i]=new RBNode(n._color,n.key,n.value,n.left,cstack[i+1],n._count)}if(n=cstack[cstack.length-1],n.left&&n.right){var split=cstack.length;for(n=n.left;n.right;)cstack.push(n),n=n.right;var v=cstack[split-1];cstack.push(new RBNode(n._color,v.key,v.value,n.left,n.right,n._count)),cstack[split-1].key=n.key,cstack[split-1].value=n.value;for(var i=cstack.length-2;i>=split;--i)n=cstack[i],cstack[i]=new RBNode(n._color,n.key,n.value,n.left,cstack[i+1],n._count);cstack[split-1].left=cstack[split]}if(n=cstack[cstack.length-1],n._color===RED){var p=cstack[cstack.length-2];p.left===n?p.left=null:p.right===n&&(p.right=null),cstack.pop();for(var i=0;i0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(iproto,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(iproto,"index",{get:function(){var idx=0,stack=this._stack;if(0===stack.length){var r=this.tree.root;return r?r._count:0}stack[stack.length-1].left&&(idx=stack[stack.length-1].left._count);for(var s=stack.length-2;s>=0;--s)stack[s+1]===stack[s].right&&(++idx,stack[s].left&&(idx+=stack[s].left._count));return idx},enumerable:!0}),iproto.next=function(){var stack=this._stack;if(0!==stack.length){var n=stack[stack.length-1];if(n.right)for(n=n.right;n;)stack.push(n),n=n.left;else for(stack.pop();stack.length>0&&stack[stack.length-1].right===n;)n=stack[stack.length-1],stack.pop()}},Object.defineProperty(iproto,"hasNext",{get:function(){var stack=this._stack;if(0===stack.length)return!1;if(stack[stack.length-1].right)return!0;for(var s=stack.length-1;s>0;--s)if(stack[s-1].left===stack[s])return!0;return!1}}),iproto.update=function(value){var stack=this._stack;if(0===stack.length)throw new Error("Can't update empty node!");var cstack=new Array(stack.length),n=stack[stack.length-1];cstack[cstack.length-1]=new RBNode(n._color,n.key,value,n.left,n.right,n._count);for(var i=stack.length-2;i>=0;--i)n=stack[i],n.left===stack[i+1]?cstack[i]=new RBNode(n._color,n.key,n.value,cstack[i+1],n.right,n._count):cstack[i]=new RBNode(n._color,n.key,n.value,n.left,cstack[i+1],n._count);return new RedBlackTree(this.tree._compare,cstack[0])},iproto.prev=function(){var stack=this._stack;if(0!==stack.length){var n=stack[stack.length-1];if(n.left)for(n=n.left;n;)stack.push(n),n=n.right;else for(stack.pop();stack.length>0&&stack[stack.length-1].left===n;)n=stack[stack.length-1],stack.pop()}},Object.defineProperty(iproto,"hasPrev",{get:function(){var stack=this._stack;if(0===stack.length)return!1;if(stack[stack.length-1].left)return!0;for(var s=stack.length-1;s>0;--s)if(stack[s-1].right===stack[s])return!0;return!1}})},function(module,exports,__webpack_require__){var util=__webpack_require__(10),INDENT_START=/[\{\[]/,INDENT_END=/[\}\]]/;module.exports=function(){var lines=[],indent=0,push=function(str){for(var spaces="";spaces.length<2*indent;)spaces+=" ";lines.push(spaces+str)},line=function(fmt){return fmt?INDENT_END.test(fmt.trim()[0])&&INDENT_START.test(fmt[fmt.length-1])?(indent--,push(util.format.apply(util,arguments)),indent++,line):INDENT_START.test(fmt[fmt.length-1])?(push(util.format.apply(util,arguments)),indent++,line):INDENT_END.test(fmt.trim()[0])?(indent--,push(util.format.apply(util,arguments)),line):(push(util.format.apply(util,arguments)),line):line};return line.toString=function(){return lines.join("\n")},line.toFunction=function(scope){var src="return ("+line.toString()+")",keys=Object.keys(scope||{}).map(function(key){return key}),vals=keys.map(function(key){return scope[key]});return Function.apply(null,keys.concat(src)).apply(null,vals)},arguments.length&&line.apply(null,arguments),line}},function(module,exports,__webpack_require__){var isProperty=__webpack_require__(542),gen=function(obj,prop){return isProperty(prop)?obj+"."+prop:obj+"["+JSON.stringify(prop)+"]"};gen.valid=isProperty,gen.property=function(prop){return isProperty(prop)?prop:JSON.stringify(prop)},module.exports=gen},function(module,exports){module.exports=function(){if("undefined"==typeof window)return null;var wrtc={RTCPeerConnection:window.RTCPeerConnection||window.mozRTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.RTCSessionDescription||window.mozRTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.RTCIceCandidate||window.mozRTCIceCandidate||window.webkitRTCIceCandidate};return wrtc.RTCPeerConnection?wrtc:null}},function(module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return"[object Array]"==toString.call(arr)}},function(module,exports){try{module.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(err){module.exports=!1}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function HashBase(blockSize){Transform.call(this),this._block=new Buffer(blockSize),this._blockSize=blockSize,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}var Transform=__webpack_require__(26).Transform;__webpack_require__(1)(HashBase,Transform),HashBase.prototype._transform=function(chunk,encoding,callback){var error=null;try{"buffer"!==encoding&&(chunk=new Buffer(chunk,encoding)),this.update(chunk)}catch(err){error=err}callback(error)},HashBase.prototype._flush=function(callback){var error=null;try{this.push(this._digest())}catch(err){error=err}callback(error)},HashBase.prototype.update=function(data,encoding){if(!Buffer.isBuffer(data)&&"string"!=typeof data)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");Buffer.isBuffer(data)||(data=new Buffer(data,encoding||"binary"));for(var block=this._block,offset=0;this._blockOffset+data.length-offset>=this._blockSize;){for(var i=this._blockOffset;i0;++j)this._length[j]+=carry,(carry=this._length[j]/4294967296|0)>0&&(this._length[j]-=4294967296*carry);return this},HashBase.prototype._update=function(data){throw new Error("_update is not implemented")},HashBase.prototype.digest=function(encoding){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var digest=this._digest();return void 0!==encoding&&(digest=digest.toString(encoding)),digest},HashBase.prototype._digest=function(){throw new Error("_digest is not implemented")},module.exports=HashBase}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function BlockHash(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var hash=__webpack_require__(48),utils=hash.utils,assert=utils.assert;exports.BlockHash=BlockHash,BlockHash.prototype.update=function(msg,enc){if(msg=utils.toArray(msg,enc),this.pending?this.pending=this.pending.concat(msg):this.pending=msg,this.pendingTotal+=msg.length,this.pending.length>=this._delta8){msg=this.pending;var r=msg.length%this._delta8;this.pending=msg.slice(msg.length-r,msg.length),0===this.pending.length&&(this.pending=null),msg=utils.join32(msg,0,msg.length-r,this.endian);for(var i=0;i>>24&255,res[i++]=len>>>16&255,res[i++]=len>>>8&255,res[i++]=255&len}else{res[i++]=255&len,res[i++]=len>>>8&255,res[i++]=len>>>16&255,res[i++]=len>>>24&255,res[i++]=0,res[i++]=0,res[i++]=0,res[i++]=0;for(var t=8;tthis.blockSize&&(key=(new this.Hash).update(key).digest()),assert(key.length<=this.blockSize);for(var i=key.length;i>>3}function g1_256(x){return rotr32(x,17)^rotr32(x,19)^x>>>10}function ft_1(s,x,y,z){return 0===s?ch32(x,y,z):1===s||3===s?p32(x,y,z):2===s?maj32(x,y,z):void 0}function ch64_hi(xh,xl,yh,yl,zh,zl){var r=xh&yh^~xh&zh;return r<0&&(r+=4294967296),r}function ch64_lo(xh,xl,yh,yl,zh,zl){var r=xl&yl^~xl&zl;return r<0&&(r+=4294967296),r}function maj64_hi(xh,xl,yh,yl,zh,zl){var r=xh&yh^xh&zh^yh&zh;return r<0&&(r+=4294967296),r}function maj64_lo(xh,xl,yh,yl,zh,zl){var r=xl&yl^xl&zl^yl&zl;return r<0&&(r+=4294967296),r}function s0_512_hi(xh,xl){var c0_hi=rotr64_hi(xh,xl,28),c1_hi=rotr64_hi(xl,xh,2),c2_hi=rotr64_hi(xl,xh,7),r=c0_hi^c1_hi^c2_hi;return r<0&&(r+=4294967296),r}function s0_512_lo(xh,xl){var c0_lo=rotr64_lo(xh,xl,28),c1_lo=rotr64_lo(xl,xh,2),c2_lo=rotr64_lo(xl,xh,7),r=c0_lo^c1_lo^c2_lo;return r<0&&(r+=4294967296),r}function s1_512_hi(xh,xl){var c0_hi=rotr64_hi(xh,xl,14),c1_hi=rotr64_hi(xh,xl,18),c2_hi=rotr64_hi(xl,xh,9),r=c0_hi^c1_hi^c2_hi;return r<0&&(r+=4294967296),r}function s1_512_lo(xh,xl){var c0_lo=rotr64_lo(xh,xl,14),c1_lo=rotr64_lo(xh,xl,18),c2_lo=rotr64_lo(xl,xh,9),r=c0_lo^c1_lo^c2_lo;return r<0&&(r+=4294967296),r}function g0_512_hi(xh,xl){var c0_hi=rotr64_hi(xh,xl,1),c1_hi=rotr64_hi(xh,xl,8),c2_hi=shr64_hi(xh,xl,7),r=c0_hi^c1_hi^c2_hi;return r<0&&(r+=4294967296),r}function g0_512_lo(xh,xl){var c0_lo=rotr64_lo(xh,xl,1),c1_lo=rotr64_lo(xh,xl,8),c2_lo=shr64_lo(xh,xl,7),r=c0_lo^c1_lo^c2_lo;return r<0&&(r+=4294967296),r}function g1_512_hi(xh,xl){var c0_hi=rotr64_hi(xh,xl,19),c1_hi=rotr64_hi(xl,xh,29),c2_hi=shr64_hi(xh,xl,6),r=c0_hi^c1_hi^c2_hi;return r<0&&(r+=4294967296),r}function g1_512_lo(xh,xl){var c0_lo=rotr64_lo(xh,xl,19),c1_lo=rotr64_lo(xl,xh,29),c2_lo=shr64_lo(xh,xl,6),r=c0_lo^c1_lo^c2_lo;return r<0&&(r+=4294967296),r}var hash=__webpack_require__(48),utils=hash.utils,assert=utils.assert,rotr32=utils.rotr32,rotl32=utils.rotl32,sum32=utils.sum32,sum32_4=utils.sum32_4,sum32_5=utils.sum32_5,rotr64_hi=utils.rotr64_hi,rotr64_lo=utils.rotr64_lo,shr64_hi=utils.shr64_hi,shr64_lo=utils.shr64_lo,sum64=utils.sum64,sum64_hi=utils.sum64_hi,sum64_lo=utils.sum64_lo,sum64_4_hi=utils.sum64_4_hi,sum64_4_lo=utils.sum64_4_lo,sum64_5_hi=utils.sum64_5_hi,sum64_5_lo=utils.sum64_5_lo,BlockHash=hash.common.BlockHash,sha256_K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],sha512_K=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],sha1_K=[1518500249,1859775393,2400959708,3395469782];utils.inherits(SHA256,BlockHash),exports.sha256=SHA256,SHA256.blockSize=512,SHA256.outSize=256,SHA256.hmacStrength=192,SHA256.padLength=64,SHA256.prototype._update=function(msg,start){for(var W=this.W,i=0;i<16;i++)W[i]=msg[start+i];for(;i>8,lo=255&c;hi?res.push(hi,lo):res.push(lo)}else for(var i=0;i>>24|w>>>8&65280|w<<8&16711680|(255&w)<<24)>>>0}function toHex32(msg,endian){for(var res="",i=0;i>>0}return res}function split32(msg,endian){for(var res=new Array(4*msg.length),i=0,k=0;i>>24,res[k+1]=m>>>16&255,res[k+2]=m>>>8&255,res[k+3]=255&m):(res[k+3]=m>>>24,res[k+2]=m>>>16&255,res[k+1]=m>>>8&255,res[k]=255&m)}return res}function rotr32(w,b){return w>>>b|w<<32-b}function rotl32(w,b){return w<>>32-b}function sum32(a,b){return a+b>>>0}function sum32_3(a,b,c){return a+b+c>>>0}function sum32_4(a,b,c,d){return a+b+c+d>>>0}function sum32_5(a,b,c,d,e){return a+b+c+d+e>>>0}function assert(cond,msg){if(!cond)throw new Error(msg||"Assertion failed")}function sum64(buf,pos,ah,al){var bh=buf[pos],bl=buf[pos+1],lo=al+bl>>>0,hi=(lo>>0,buf[pos+1]=lo}function sum64_hi(ah,al,bh,bl){return(al+bl>>>0>>0}function sum64_lo(ah,al,bh,bl){return al+bl>>>0}function sum64_4_hi(ah,al,bh,bl,ch,cl,dh,dl){var carry=0,lo=al;return lo=lo+bl>>>0,carry+=lo>>0,carry+=lo>>0,carry+=lo>>0}function sum64_4_lo(ah,al,bh,bl,ch,cl,dh,dl){return al+bl+cl+dl>>>0}function sum64_5_hi(ah,al,bh,bl,ch,cl,dh,dl,eh,el){var carry=0,lo=al;return lo=lo+bl>>>0,carry+=lo>>0,carry+=lo>>0,carry+=lo>>0,carry+=lo>>0}function sum64_5_lo(ah,al,bh,bl,ch,cl,dh,dl,eh,el){return al+bl+cl+dl+el>>>0}function rotr64_hi(ah,al,num){return(al<<32-num|ah>>>num)>>>0}function rotr64_lo(ah,al,num){return(ah<<32-num|al>>>num)>>>0}function shr64_hi(ah,al,num){return ah>>>num}function shr64_lo(ah,al,num){return(ah<<32-num|al>>>num)>>>0}var utils=exports,inherits=__webpack_require__(1);utils.toArray=toArray,utils.toHex=toHex,utils.htonl=htonl,utils.toHex32=toHex32,utils.zero2=zero2,utils.zero8=zero8,utils.join32=join32,utils.split32=split32,utils.rotr32=rotr32,utils.rotl32=rotl32,utils.sum32=sum32,utils.sum32_3=sum32_3,utils.sum32_4=sum32_4,utils.sum32_5=sum32_5,utils.assert=assert,utils.inherits=inherits,exports.sum64=sum64,exports.sum64_hi=sum64_hi,exports.sum64_lo=sum64_lo,exports.sum64_4_hi=sum64_4_hi,exports.sum64_4_lo=sum64_4_lo,exports.sum64_5_hi=sum64_5_hi,exports.sum64_5_lo=sum64_5_lo,exports.rotr64_hi=rotr64_hi,exports.rotr64_lo=rotr64_lo,exports.shr64_hi=shr64_hi,exports.shr64_lo=shr64_lo},function(module,exports,__webpack_require__){"use strict";function HmacDRBG(options){if(!(this instanceof HmacDRBG))return new HmacDRBG(options);this.hash=options.hash,this.predResist=!!options.predResist,this.outLen=this.hash.outSize,this.minEntropy=options.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var entropy=utils.toArray(options.entropy,options.entropyEnc||"hex"),nonce=utils.toArray(options.nonce,options.nonceEnc||"hex"),pers=utils.toArray(options.pers,options.persEnc||"hex");assert(entropy.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(entropy,nonce,pers)}var hash=__webpack_require__(48),utils=__webpack_require__(277),assert=__webpack_require__(111);module.exports=HmacDRBG,HmacDRBG.prototype._init=function(entropy,nonce,pers){var seed=entropy.concat(nonce).concat(pers);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(entropy.concat(add||[])),this._reseed=1},HmacDRBG.prototype.generate=function(len,enc,add,addEnc){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof enc&&(addEnc=add,add=enc,enc=null),add&&(add=utils.toArray(add,addEnc||"hex"),this._update(add));for(var temp=[];temp.length=this._table.protocolMaxSize){size=this._table.protocolMaxSize;var enc=encoder.create();enc.encodeBits(1,3),enc.encodeInt(size);for(var data=enc.render(),i=0;i0,isIncremental=header.incremental!==!1,neverIndex=0;if(this._encoder.encodeBit(isIndexed),isIndexed)return void this._encoder.encodeInt(index);var name=utils.toArray(header.name),value=utils.toArray(header.value);this._encoder.encodeBit(isIncremental),isIncremental?this._table.add(header.name,header.value,name.length,value.length):(this._encoder.encodeBit(0),this._encoder.encodeBit(neverIndex)),this._encoder.encodeInt(-index),0===index&&this._encoder.encodeStr(name,header.huffman!==!1),this._encoder.encodeStr(value,header.huffman!==!1)}},function(module,exports,__webpack_require__){function Decoder(){this.buffer=new OffsetBuffer,this.bitOffset=0,this._huffmanNode=null}var hpack=__webpack_require__(58),utils=hpack.utils,huffman=hpack.huffman.decode,assert=utils.assert,OffsetBuffer=__webpack_require__(113);module.exports=Decoder,Decoder.create=function(){return new Decoder},Decoder.prototype.isEmpty=function(){return this.buffer.isEmpty()},Decoder.prototype.push=function(chunk){this.buffer.push(chunk)},Decoder.prototype.decodeBit=function(){assert(this.buffer.has(1),"Buffer too small for an int");var octet,offset=this.bitOffset;return 8==++this.bitOffset?(octet=this.buffer.readUInt8(),this.bitOffset=0):octet=this.buffer.peekUInt8(),octet>>>7-offset&1},Decoder.prototype.skipBits=function(n){this.bitOffset+=n,this.buffer.skip(this.bitOffset>>3),this.bitOffset&=7},Decoder.prototype.decodeInt=function(){assert(this.buffer.has(1),"Buffer too small for an int");var prefix=8-this.bitOffset;this.bitOffset=0;var max=(1<>>21|(res>>14&127)<<7|(res>>7&127)<<14|(127&res)<<21,res>>=7*(4-len),res+=max},Decoder.prototype.decodeHuffmanWord=function(input,inputBits,out){for(var root=huffman,node=this._huffmanNode,word=input,bits=inputBits;bits>0;word&=(1<>>i];if("number"!=typeof subnode){node=subnode,bits=i;break}if(0!==subnode){if(subnode>>>9==bits-i){var octet=511&subnode;assert(256!==octet,"EOS in encoding"),out.push(octet),node=root,bits=i;break}subnode=0}}if(0===subnode)break}return this._huffmanNode=node,bits},Decoder.prototype.decodeStr=function(){var isHuffman=this.decodeBit(),len=this.decodeInt();if(assert(this.buffer.has(len),"Not enough octets for string"),!isHuffman)return this.buffer.take(len);this._huffmanNode=huffman;for(var out=[],word=0,bits=0,i=0;i>bits,word&=(1<0;){var avail=Math.min(leftLen,8-this.bitOffset),toWrite=left>>>leftLen-avail;8===avail?this.buffer.writeUInt8(toWrite):(this.word<<=avail,this.word|=toWrite,this.bitOffset+=avail,8===this.bitOffset&&(this.buffer.writeUInt8(this.word),this.word=0,this.bitOffset=0)),leftLen-=avail,left&=(1<>3),this.bitOffset&=7},Encoder.prototype.encodeInt=function(num){var prefix=8-this.bitOffset;this.bitOffset=0;var max=(1<>=7,0!==left&&(octet|=128),this.buffer.writeUInt8(octet)}while(0!==left)},Encoder.prototype.encodeStr=function(value,isHuffman){if(this.encodeBit(isHuffman?1:0),isHuffman){for(var codes=[],len=0,pad=0,i=0;i>>8-pad,pad)}else{this.buffer.reserve(value.length+1),this.encodeInt(value.length);for(var i=0;i=limit;i--){var entry=this.dynamic[i];if(entry.name===name&&entry.value===value)return this.length-i;if(entry.name===name){if(staticEntry)break;return-(this.length-i)}}return staticEntry?-staticEntry.index:0},Table.prototype.add=function(name,value,nameSize,valueSize){var totalSize=nameSize+valueSize+32;this.dynamic.push({name:name,value:value,nameSize:nameSize,totalSize:totalSize}),this.size+=totalSize,this.length++,this.evict()},Table.prototype.evict=function(){for(;this.size>this.maxSize;){var entry=this.dynamic.shift();this.size-=entry.totalSize,this.length--}assert(this.size>=0,"Table size sanity check failed")},Table.prototype.updateSize=function(size){assert(size<=this.protocolMaxSize,"Table size bigger than maximum"),this.maxSize=size,this.evict()}},function(module,exports){exports.assert=function(cond,text){if(!cond)throw new Error(text)},exports.stringify=function(arr){for(var res="",i=0;i>>8,lo=255&c;hi?res.push(hi,lo):res.push(lo)}return res}},function(module,exports,__webpack_require__){"use strict";function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}module.exports=PassThrough;var Transform=__webpack_require__(214),util=__webpack_require__(6);util.inherits=__webpack_require__(1),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},function(module,exports,__webpack_require__){"use strict";function BufferList(){this.head=null,this.tail=null,this.length=0}var bufferShim=(__webpack_require__(0).Buffer,__webpack_require__(14));module.exports=BufferList,BufferList.prototype.push=function(v){var entry={data:v,next:null};this.length>0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};0===this.length&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(0!==this.length){var ret=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s){if(0===this.length)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s+p.data;return ret},BufferList.prototype.concat=function(n){if(0===this.length)return bufferShim.alloc(0);if(1===this.length)return this.head.data;for(var ret=bufferShim.allocUnsafe(n>>>0),p=this.head,i=0;p;)p.data.copy(ret,i),i+=p.data.length,p=p.next;return ret}},function(module,exports,__webpack_require__){"use strict";function idbReadableStream(db,storeName,opts){function startCursor(){function proceed(cursor){try{cursor.continue()}catch(err){"TransactionInactiveError"!==err.name||opts.snapshot?transformer.emit("error",err):startCursor()}}var lower,upper,lowerOpen,upperOpen,direction=opts.direction||"next",range=opts.range||{};lower=range.lower,upper=range.upper,lowerOpen=!!range.lowerOpen,upperOpen=!!range.upperOpen,lastIteratedKey&&("next"===direction?(lowerOpen=!0,lower=lastIteratedKey):(upperOpen=!0,upper=lastIteratedKey));var keyRange;lower&&upper?keyRange=IDBKeyRange.bound(lower,upper,lowerOpen,upperOpen):lower?keyRange=IDBKeyRange.lowerBound(lower,lowerOpen):upper&&(keyRange=IDBKeyRange.upperBound(upper,upperOpen));var tx=db.transaction(storeName,"readonly"),store=tx.objectStore(storeName);transformer._cursorsOpened++;var req=store.openCursor(keyRange,opts.direction);req.onsuccess=function(){var cursor=req.result;if(cursor){lastIteratedKey=cursor.key;var go=transformer.write({key:cursor.key,value:cursor.value});opts.snapshot||go?proceed(cursor):transformer.once("drain",function(){proceed(cursor)})}else transformer.end()},tx.onabort=function(){transformer.emit("error",tx.error)},tx.onerror=function(){transformer.emit("error",tx.error)}}if("object"!=typeof db)throw new TypeError("db must be an object");if("string"!=typeof storeName)throw new TypeError("storeName must be a string");if(null==opts&&(opts={}),"object"!=typeof opts)throw new TypeError("opts must be an object");var transformer=new stream.Transform(xtend(opts,{objectMode:!0,transform:function(obj,enc,cb){cb(null,obj)}}));opts=xtend({snapshot:!1},opts);var lastIteratedKey=null;return transformer._cursorsOpened=0,startCursor(),transformer}var stream=__webpack_require__(26),xtend=__webpack_require__(37);module.exports=idbReadableStream},function(module,exports,__webpack_require__){"use strict";function cleanUpNextTick(){draining&¤tQueue&&(draining=!1, -currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&nextTick())}function nextTick(){if(!draining){scheduled=!1,draining=!0;for(var len=queue.length,timeout=setTimeout(cleanUpNextTick);len;){for(currentQueue=queue,queue=[];currentQueue&&++queueIndex1)for(var i=1;i{return err?callback(err):exists?void callback(null,this.data[key.toString()]):callback(new Error("No value"))})}has(key,callback){setImmediate(()=>{callback(null,void 0!==this.data[key.toString()])})}delete(key,callback){delete this.data[key.toString()],setImmediate(()=>{callback()})}batch(){let puts=[],dels=[];return{put(key,value){puts.push([key,value])},delete(key){dels.push(key)},commit:callback=>{puts.forEach(v=>{this.data[v[0].toString()]=v[1]}),puts=[],dels.forEach(key=>{delete this.data[key.toString()]}),dels=[],setImmediate(callback)}}}query(q){let tasks=[pull.keys(this.data),pull.map(k=>({key:new Key(k),value:this.data[k]}))],filters=[];if(null!=q.prefix){const prefix=q.prefix;filters.push((e,cb)=>cb(null,e.key.toString().startsWith(prefix)))}if(null!=q.filters&&(filters=filters.concat(q.filters)),tasks=tasks.concat(filters.map(f=>asyncFilter(f))),null!=q.orders&&(tasks=tasks.concat(q.orders.map(o=>asyncSort(o)))),null!=q.offset){let i=0;tasks.push(pull.filter(()=>i++>=q.offset))}return null!=q.limit&&tasks.push(pull.take(q.limit)),q.keysOnly===!0&&tasks.push(pull.map(e=>({key:e.key}))),pull.apply(null,tasks)}close(callback){setImmediate(callback)}}module.exports=MemoryDatastore},function(module,exports,__webpack_require__){"use strict";function _normalizeFamily(family){return family?family.toLowerCase():"ipv4"}var ip=exports,Buffer=__webpack_require__(0).Buffer,os=__webpack_require__(153);ip.toBuffer=function(ip,buff,offset){offset=~~offset;var result;if(this.isV4Format(ip))result=buff||new Buffer(offset+4),ip.split(/\./g).map(function(byte){result[offset++]=255&parseInt(byte,10)});else if(this.isV6Format(ip)){var i,sections=ip.split(":",8);for(i=0;i0;i--)argv.push("0");sections.splice.apply(sections,argv)}for(result=buff||new Buffer(offset+16),i=0;i>8&255,result[offset++]=255&word}}if(!result)throw Error("Invalid ip address: "+ip);return result},ip.toString=function(buff,offset,length){offset=~~offset,length=length||buff.length-offset;var result=[];if(4===length){for(var i=0;i32?"ipv6":_normalizeFamily(family);var len=4;"ipv6"===family&&(len=16);for(var buff=new Buffer(len),i=0,n=buff.length;i>bits)}return ip.toString(buff)},ip.mask=function(addr,mask){addr=ip.toBuffer(addr),mask=ip.toBuffer(mask);var result=new Buffer(Math.max(addr.length,mask.length)),i=0;if(addr.length===mask.length)for(i=0;ia.length&&(buff=b,other=a);for(var offset=buff.length-other.length,i=offset;i>>0},ip.fromLong=function(ipl){return(ipl>>>24)+"."+(ipl>>16&255)+"."+(ipl>>8&255)+"."+(255&ipl)}},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),each=__webpack_require__(32),eachSeries=__webpack_require__(87),waterfall=__webpack_require__(9),map=__webpack_require__(89),debounce=__webpack_require__(261),uniqWith=__webpack_require__(640),find=__webpack_require__(628),values=__webpack_require__(149),groupBy=__webpack_require__(630),pullAllWith=__webpack_require__(635),log=debug("bitswap:engine");log.error=debug("bitswap:engine:error");const Message=__webpack_require__(99),Wantlist=__webpack_require__(100),Ledger=__webpack_require__(459);class DecisionEngine{constructor(blockstore,network){this.blockstore=blockstore,this.network=network,this.ledgerMap=new Map,this._running=!1,this._tasks=[],this._outbox=debounce(this._processTasks.bind(this),100)}_sendBlocks(env,cb){const blocks=env.blocks;if(blocks.reduce((acc,b)=>{return acc+b.data.byteLength},0)<524288)return this._sendSafeBlocks(env.peer,blocks,cb);let size=0,batch=[];eachSeries(blocks,(b,cb)=>{if(batch.push(b),(size+=b.data.byteLength)>=524288){const nextBatch=batch.slice();batch=[],this._sendSafeBlocks(env.peer,nextBatch,cb)}else cb()},cb)}_sendSafeBlocks(peer,blocks,cb){const msg=new Message(!1);blocks.forEach(b=>{msg.addBlock(b)}),this.network.sendMessage(peer,msg,err=>{err&&log("sendblock error: %s",err.message),cb()})}_processTasks(){if(this._running&&this._tasks.length){const tasks=this._tasks;this._tasks=[];const entries=tasks.map(t=>t.entry),cids=entries.map(e=>e.cid),uniqCids=uniqWith(cids,(a,b)=>a.equals(b)),groupedTasks=groupBy(tasks,task=>task.target.toB58String());waterfall([cb=>map(uniqCids,(cid,cb)=>{this.blockstore.get(cid,cb)},cb),(blocks,cb)=>each(values(groupedTasks),(tasks,cb)=>{const peer=tasks[0].target,blockList=cids.map(cid=>{return find(blocks,b=>b.cid.equals(cid))});this._sendBlocks({peer:peer,blocks:blockList},err=>{err&&log.error("failed to send",err),blockList.forEach(block=>{this.messageSent(peer,block)}),cb()})})],err=>{this._tasks=[],err&&log.error(err)})}}wantlistForPeer(peerId){const peerIdStr=peerId.toB58String();return this.ledgerMap.has(peerIdStr)?this.ledgerMap.get(peerIdStr).wantlist.sortedEntries():new Map}peers(){return Array.from(this.ledgerMap.values()).map(l=>l.partner)}receivedBlocks(cids){cids.length&&(this.ledgerMap.forEach(ledger=>{cids.map(cid=>ledger.wantlistContains(cid)).filter(Boolean).forEach(entry=>{this._tasks.push({entry:entry,target:ledger.partner})})}),this._outbox())}messageReceived(peerId,msg,cb){const ledger=this._findOrCreate(peerId);if(msg.empty)return cb();if(msg.full&&(ledger.wantlist=new Wantlist),this._processBlocks(msg.blocks,ledger),0===msg.wantlist.size)return cb();let cancels=[],wants=[];msg.wantlist.forEach(entry=>{entry.cancel?(ledger.cancelWant(entry.cid),cancels.push(entry)):(ledger.wants(entry.cid,entry.priority),wants.push(entry))}),this._cancelWants(ledger,peerId,cancels),this._addWants(ledger,peerId,wants,cb)}_cancelWants(ledger,peerId,entries){const id=peerId.toB58String();pullAllWith(this._tasks,entries,(t,e)=>{const sameTarget=t.target.toB58String()===id,sameCid=t.entry.cid.equals(e.cid);return sameTarget&&sameCid})}_addWants(ledger,peerId,entries,cb){each(entries,(entry,cb)=>{this.blockstore.has(entry.cid,(err,exists)=>{err?log.error("failed existence check"):exists&&this._tasks.push({entry:entry.entry,target:peerId}),cb()})},()=>{this._outbox(),cb()})}_processBlocks(blocks,ledger,callback){const cids=[];blocks.forEach((b,cidStr)=>{log("got block (%s bytes)",b.data.length),ledger.receivedBytes(b.data.length),cids.push(b.cid)}),this.receivedBlocks(cids)}messageSent(peerId,block){const ledger=this._findOrCreate(peerId);ledger.sentBytes(block?block.data.length:0),block&&block.cid&&ledger.wantlist.remove(block.cid)}numBytesSentTo(peerId){return this._findOrCreate(peerId).accounting.bytesSent}numBytesReceivedFrom(peerId){return this._findOrCreate(peerId).accounting.bytesRecv}peerDisconnected(peerId){}_findOrCreate(peerId){const peerIdStr=peerId.toB58String();if(this.ledgerMap.has(peerIdStr))return this.ledgerMap.get(peerIdStr);const l=new Ledger(peerId);return this.ledgerMap.set(peerIdStr,l),l}start(){this._running=!0}stop(){this._running=!1}}module.exports=DecisionEngine},function(module,exports,__webpack_require__){"use strict";const Wantlist=__webpack_require__(100);class Ledger{constructor(peerId){this.partner=peerId,this.wantlist=new Wantlist,this.exchangeCount=0,this.sentToPeer=new Map,this.accounting={bytesSent:0,bytesRecv:0}}sentBytes(n){this.exchangeCount++,this.lastExchange=(new Date).getTime(),this.accounting.bytesSent+=n}receivedBytes(n){this.exchangeCount++,this.lastExchange=(new Date).getTime(),this.accounting.bytesRecv+=n}wants(cid,priority){this.wantlist.add(cid,priority)}cancelWant(cid){this.wantlist.remove(cid)}wantlistContains(cid){return this.wantlist.contains(cid)}}module.exports=Ledger},function(module,exports,__webpack_require__){"use strict";function writeMessage(conn,msg,callback){pull(pull.values([msg]),lp.encode(),conn,pull.onEnd(callback))}const debug=__webpack_require__(3),lp=__webpack_require__(28),pull=__webpack_require__(5),setImmediate=__webpack_require__(11),Message=__webpack_require__(99),CONSTANTS=__webpack_require__(133),log=debug("bitswap:network");log.error=debug("bitswap:network:error");const BITSWAP100="/ipfs/bitswap/1.0.0",BITSWAP110="/ipfs/bitswap/1.1.0";class Network{constructor(libp2p,peerBook,bitswap,b100Only){this.libp2p=libp2p,this.peerBook=peerBook,this.bitswap=bitswap,this.b100Only=b100Only||!1,this._running=!1,this.libp2p.swarm.setMaxListeners(CONSTANTS.maxListeners)}start(){this._running=!0,this._onPeerConnect=this._onPeerConnect.bind(this),this._onPeerDisconnect=this._onPeerDisconnect.bind(this),this._onConnection=this._onConnection.bind(this),this.libp2p.handle(BITSWAP100,this._onConnection),this.b100Only||this.libp2p.handle(BITSWAP110,this._onConnection),this.libp2p.on("peer:connect",this._onPeerConnect),this.libp2p.on("peer:disconnect",this._onPeerDisconnect),Object.keys(this.peerBook.getAll()).forEach(k=>this._onPeerConnect(this.peerBook.get(k)))}stop(){this._running=!1,this.libp2p.unhandle(BITSWAP100),this.b100Only||this.libp2p.unhandle(BITSWAP110),this.libp2p.removeListener("peer:connect",this._onPeerConnect),this.libp2p.removeListener("peer:disconnect",this._onPeerDisconnect)}_onConnection(protocol,conn){this._running&&(log("incomming new bitswap connection: %s",protocol),pull(conn,lp.decode(),pull.asyncMap((data,cb)=>Message.deserialize(data,cb)),pull.asyncMap((msg,cb)=>{conn.getPeerInfo((err,peerInfo)=>{if(err)return cb(err);this.bitswap._receiveMessage(peerInfo.id,msg,cb)})}),pull.onEnd(err=>{if(log("ending connection"),err)return this.bitswap._receiveError(err)})))}_onPeerConnect(peerInfo){this._running&&this.bitswap._onPeerConnected(peerInfo.id)}_onPeerDisconnect(peerInfo){this._running&&this.bitswap._onPeerDisconnected(peerInfo.id)}connectTo(peerId,callback){const done=err=>setImmediate(()=>callback(err));if(!this._running)return done(new Error("No running network"));this.libp2p.swarm.muxedConns[peerId.toB58String()]?done():done(new Error("Could not connect to peer with peerId:",peerId.toB58String()))}sendMessage(peerId,msg,callback){if(!this._running)return callback(new Error("No running network"));const stringId=peerId.toB58String();log("sendMessage to %s",stringId,msg);let peerInfo;try{peerInfo=this.peerBook.get(stringId)}catch(err){return callback(err)}this._dialPeer(peerInfo,(err,conn,protocol)=>{if(err)return callback(err);let serialized;switch(protocol){case BITSWAP100:serialized=msg.serializeToBitswap100();break;case BITSWAP110:serialized=msg.serializeToBitswap110();break;default:return callback(new Error("Unkown protocol: "+protocol))}writeMessage(conn,serialized,err=>{err&&log(err)}),callback()})}_dialPeer(peerInfo,callback){try{this.libp2p.dial(peerInfo,BITSWAP110,(err,conn)=>{if(err)return void this.libp2p.dial(peerInfo,BITSWAP100,(err,conn)=>{if(err)return callback(err);callback(null,conn,BITSWAP100)});callback(null,conn,BITSWAP110)})}catch(err){return callback(err)}}}module.exports=Network},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),Message=__webpack_require__(99),Wantlist=__webpack_require__(100),CONSTANTS=__webpack_require__(133),MsgQueue=__webpack_require__(462),log=debug("bitswap:wantmanager");log.error=debug("bitswap:wantmanager:error"),module.exports=class WantManager{constructor(network){this.peers=new Map,this.wantlist=new Wantlist,this.network=network}_addEntries(cids,cancel,force){const entries=cids.map((cid,i)=>{return new Message.Entry(cid,CONSTANTS.kMaxPriority-i,cancel)});entries.forEach(e=>{e.cancel?force?this.wantlist.removeForce(e.cid):this.wantlist.remove(e.cid):(log("adding to wl"),this.wantlist.add(e.cid,e.priority))});for(let p of this.peers.values())p.addEntries(entries)}_startPeerHandler(peerId){let mq=this.peers.get(peerId.toB58String());if(mq)return void mq.refcnt++;mq=new MsgQueue(peerId,this.network);const fullwantlist=new Message(!0);for(let entry of this.wantlist.entries())fullwantlist.addEntry(entry[1].cid,entry[1].priority);return mq.addMessage(fullwantlist),this.peers.set(peerId.toB58String(),mq),mq}_stopPeerHandler(peerId){const mq=this.peers.get(peerId.toB58String());mq&&(--mq.refcnt>0||this.peers.delete(peerId.toB58String()))}wantBlocks(cids){this._addEntries(cids,!1)}unwantBlocks(cids){log("unwant blocks: %s",cids.length),this._addEntries(cids,!0,!0)}cancelWants(cids){log("cancel wants: %s",cids.length),this._addEntries(cids,!0)}connectedPeers(){return Array.from(this.peers.keys())}connected(peerId){this._startPeerHandler(peerId)}disconnected(peerId){this._stopPeerHandler(peerId)}run(){this.timer=setInterval(()=>{const fullwantlist=new Message(!0);for(let entry of this.wantlist.entries())fullwantlist.addEntry(entry[1].cid,entry[1].priority);this.peers.forEach(p=>{p.addMessage(fullwantlist)})},1e4)}stop(){for(let mq of this.peers.values())this.disconnected(mq.peerId);clearInterval(this.timer)}}},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),debounce=__webpack_require__(261),Message=__webpack_require__(99),log=debug("bitswap:wantmanager:queue");log.error=debug("bitswap:wantmanager:queue:error"),module.exports=class MsgQueue{constructor(peerId,network){this.peerId=peerId,this.network=network,this.refcnt=1,this._entries=[],this.sendEntries=debounce(this._sendEntries.bind(this),200)}addMessage(msg){msg.empty||this.send(msg)}addEntries(entries){this._entries=this._entries.concat(entries),this.sendEntries()}_sendEntries(){if(this._entries.length){const msg=new Message(!1);this._entries.forEach(entry=>{entry.cancel?msg.cancel(entry.cid):msg.addEntry(entry.cid,entry.priority)}),this._entries=[],this.addMessage(msg)}}send(msg){this.network.connectTo(this.peerId,err=>{if(err)return void log.error("cant connect to peer %s: %s",this.peerId.toB58String(),err.message);log("sending message"),this.network.sendMessage(this.peerId,msg,err=>{err&&log.error("send error: %s",err.message)})})}}},function(module,exports,__webpack_require__){"use strict";const waterfall=__webpack_require__(9),reject=__webpack_require__(182),each=__webpack_require__(32),EventEmitter=__webpack_require__(8).EventEmitter,debug=__webpack_require__(3),CONSTANTS=__webpack_require__(133),WantManager=__webpack_require__(461),Network=__webpack_require__(460),DecisionEngine=__webpack_require__(458),log=debug("bitswap");log.error=debug("bitswap:error");class Bitswap{constructor(libp2p,blockstore,peerBook){this.libp2p=libp2p,this.network=new Network(libp2p,peerBook,this),this.blockstore=blockstore,this.engine=new DecisionEngine(blockstore,this.network),this.wm=new WantManager(this.network),this.blocksRecvd=0,this.dupBlocksRecvd=0,this.dupDataRecvd=0,this.notifications=new EventEmitter,this.notifications.setMaxListeners(CONSTANTS.maxListeners)}_receiveMessage(peerId,incoming,callback){this.engine.messageReceived(peerId,incoming,err=>{if(err&&log("failed to receive message",incoming),0===incoming.blocks.size)return callback();const blocks=Array.from(incoming.blocks.values()),toCancel=blocks.filter(b=>this.wm.wantlist.contains(b.cid)).map(b=>b.cid);this.wm.cancelWants(toCancel),each(blocks,(b,cb)=>this._handleReceivedBlock(peerId,b,cb),callback)})}_handleReceivedBlock(peerId,block,callback){log("received block"),waterfall([cb=>this.blockstore.has(block.cid,cb),(has,cb)=>{if(this._updateReceiveCounters(block,has),has)return cb();this._putBlock(block,cb)}],callback)}_updateReceiveCounters(block,exists){this.blocksRecvd++,exists&&(this.dupBlocksRecvd++,this.dupDataRecvd+=block.data.length)}_receiveError(err){log.error("ReceiveError: %s",err.message)}_onPeerConnected(peerId){this.wm.connected(peerId)}_onPeerDisconnected(peerId){this.wm.disconnected(peerId),this.engine.peerDisconnected(peerId)}_putBlock(block,callback){this.blockstore.put(block,err=>{if(err)return callback(err);this.notifications.emit(`block:${block.cid.buffer.toString()}`,block),this.engine.receivedBlocks([block.cid]),callback()})}wantlistForPeer(peerId){return this.engine.wantlistForPeer(peerId)}get(cid,callback){const unwantListeners={},blockListeners={},cidStr=cid.buffer.toString(),unwantEvent=`unwant:${cidStr}`,blockEvent=`block:${cidStr}`;log("get: %s",cidStr);const cleanupListener=()=>{unwantListeners[cidStr]&&(this.notifications.removeListener(unwantEvent,unwantListeners[cidStr]),delete unwantListeners[cidStr]),blockListeners[cidStr]&&(this.notifications.removeListener(blockEvent,blockListeners[cidStr]),delete blockListeners[cidStr])},addListener=()=>{unwantListeners[cidStr]=(()=>{log(`manual unwant: ${cidStr}`),cleanupListener(),this.wm.cancelWants([cid]),callback()}),blockListeners[cidStr]=(block=>{this.wm.cancelWants([cid]),cleanupListener(cid),callback(null,block)}),this.notifications.once(unwantEvent,unwantListeners[cidStr]),this.notifications.once(blockEvent,blockListeners[cidStr])};this.blockstore.has(cid,(err,has)=>{return err?callback(err):has?(log("already have block: %s",cidStr),this.blockstore.get(cid,callback)):(addListener(),void this.wm.wantBlocks([cid]))})}unwant(cids){Array.isArray(cids)||(cids=[cids]),this.wm.unwantBlocks(cids),cids.forEach(cid=>{this.notifications.emit(`unwant:${cid.buffer.toString()}`)})}cancelWants(cids){Array.isArray(cids)||(cids=[cids]),this.wm.cancelWants(cids)}put(block,callback){log("putting block"),waterfall([cb=>this.blockstore.has(block.cid,cb),(has,cb)=>{if(has)return cb();this._putBlock(block,cb)}],callback)}putMany(blocks,callback){waterfall([cb=>reject(blocks,(b,cb)=>{this.blockstore.has(b.cid,cb)},cb),(newBlocks,cb)=>this.blockstore.putMany(newBlocks,err=>{if(err)return cb(err);newBlocks.forEach(block=>{this.notifications.emit(`block:${block.cid.buffer.toString()}`,block),this.engine.receivedBlocks([block.cid])}),cb()})],callback)}getWantlist(){return this.wm.wantlist.entries()}stat(){return{wantlist:this.getWantlist(),blocksReceived:this.blocksRecvd,dupBlksReceived:this.dupBlocksRecvd,dupDataReceived:this.dupDataRecvd,peers:this.engine.peers()}}start(){this.wm.run(),this.network.start(),this.engine.start()}stop(){this.wm.stop(this.libp2p.peerInfo.id),this.network.stop(),this.engine.stop()}}module.exports=Bitswap},function(module,exports,__webpack_require__){"use strict";const WantlistEntry=__webpack_require__(100).Entry,CID=__webpack_require__(12),assert=__webpack_require__(7);module.exports=class BitswapMessageEntry{constructor(cid,priority,cancel){assert(CID.isCID(cid),"needs valid cid"),this.entry=new WantlistEntry(cid,priority),this.cancel=Boolean(cancel)}get cid(){return this.entry.cid}set cid(cid){this.entry.cid=cid}get priority(){return this.entry.priority}set priority(val){this.entry.priority=val}get[Symbol.toStringTag](){return`BitswapMessageEntry ${this.cid.toBaseEncodedString()} `}equals(other){return this.cancel===other.cancel&&this.entry.equals(other.entry)}}},function(module,exports,__webpack_require__){"use strict";module.exports=` +`},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const waterfall=__webpack_require__(7),parallel=__webpack_require__(39),pull=__webpack_require__(4),Key=__webpack_require__(16).Key,sh=__webpack_require__(174),KeytransformStore=__webpack_require__(81),shardKey=new Key(sh.SHARDING_FN),shardReadmeKey=new Key(sh.README_FN);class ShardingDatastore{constructor(store,shard){this.child=new KeytransformStore(store,{convert:this._convertKey.bind(this),invert:this._invertKey.bind(this)}),this.shard=shard}open(callback){this.child.open(callback)}_convertKey(key){const s=key.toString();return s===shardKey.toString()||s===shardReadmeKey.toString()?key:new Key(this.shard.fun(s)).child(key)}_invertKey(key){const s=key.toString();return s===shardKey.toString()||s===shardReadmeKey.toString()?key:Key.withNamespaces(key.list().slice(1))}static createOrOpen(store,shard,callback){ShardingDatastore.create(store,shard,err=>{if(err&&"datastore exists"!==err.message)return callback(err);ShardingDatastore.open(store,callback)})}static open(store,callback){waterfall([cb=>sh.readShardFun("/",store,cb),(shard,cb)=>{cb(null,new ShardingDatastore(store,shard))}],callback)}static create(store,shard,callback){store.has(shardKey,(err,exists)=>{if(err)return callback(err);if(!exists){const put="function"==typeof store.putRaw?store.putRaw.bind(store):store.put.bind(store);return parallel([cb=>put(shardKey,new Buffer(shard.toString()+"\n"),cb),cb=>put(shardReadmeKey,new Buffer(sh.readme),cb)],err=>callback(err))}sh.readShardFun("/",store,(err,diskShard)=>{if(err)return callback(err);const a=(diskShard||"").toString(),b=shard.toString();if(a!==b)return callback(new Error(`specified fun ${b} does not match repo shard fun ${a}`));callback(new Error("datastore exists"))})})}put(key,val,callback){this.child.put(key,val,callback)}get(key,callback){this.child.get(key,callback)}has(key,callback){this.child.has(key,callback)}delete(key,callback){this.child.delete(key,callback)}batch(){return this.child.batch()}query(q){const tq={keysOnly:q.keysOnly};return null!=q.prefix&&(tq.prefix=q.prefix),null!=q.filters&&(tq.filters=q.filters.map(f=>(e,cb)=>{f(Object.assign({},e,{key:this._invertKey(e.key)}),cb)})),null!=q.orders&&(tq.orders=q.orders.map(o=>(res,cb)=>{o(res.map(e=>{return Object.assign({},e,{key:this._invertKey(e.key)})}),cb)})),null!=q.offset&&(tq.offset=q.offset+2),null!=q.limit&&(tq.limit=q.limit+2),pull(this.child.query(tq),pull.filter(e=>{return e.key.toString()!==shardKey.toString()&&e.key.toString()!==shardReadmeKey.toString()}))}close(callback){this.child.close(callback)}}module.exports=ShardingDatastore}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const each=__webpack_require__(19),whilst=__webpack_require__(74);class TieredDatastore{constructor(stores){this.stores=stores.slice()}open(callback){each(this.stores,(store,cb)=>{store.open(cb)},callback)}put(key,value,callback){each(this.stores,(store,cb)=>{store.put(key,value,cb)},callback)}get(key,callback){const storeLength=this.stores.length;let done=!1,i=0;whilst(()=>!done&&i{this.stores[i++].get(key,(err,res)=>{if(null==err)return done=!0,cb(null,res);cb()})},callback)}has(key,callback){const storeLength=this.stores.length;let done=!1,i=0;whilst(()=>!done&&i{this.stores[i++].has(key,(err,exists)=>{if(null==err)return done=!0,cb(null,exists);cb()})},callback)}delete(key,callback){each(this.stores,(store,cb)=>{store.delete(key,cb)},callback)}close(callback){each(this.stores,(store,cb)=>{store.close(cb)},callback)}batch(){const batches=this.stores.map(store=>store.batch());return{put:(key,value)=>{batches.forEach(b=>b.put(key,value))},delete:key=>{batches.forEach(b=>b.delete(key))},commit:callback=>{each(batches,(b,cb)=>{b.commit(cb)},callback)}}}query(q){return this.stores[this.stores.length-1].query(q)}}module.exports=TieredDatastore},function(module,exports,__webpack_require__){function selectColor(namespace){var i,hash=0;for(i in namespace)hash=(hash<<5)-hash+namespace.charCodeAt(i),hash|=0;return exports.colors[Math.abs(hash)%exports.colors.length]}function createDebug(namespace){function debug(){if(debug.enabled){var self=debug,curr=+new Date,ms=curr-(prevTime||curr);self.diff=ms,self.prev=prevTime,self.curr=curr,prevTime=curr;for(var args=new Array(arguments.length),i=0;ithis._reseedInterval)throw new Error("Reseed is required");add&&0===add.length&&(add=void 0),add&&this._update(add);for(var temp=new Buffer(0);temp.length0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function BasePoint(curve,type){this.curve=curve,this.type=type,this.precomputed=null}var BN=__webpack_require__(14),elliptic=__webpack_require__(20),utils=elliptic.utils,getNAF=utils.getNAF,getJSF=utils.getJSF,assert=utils.assert;module.exports=BaseCurve,BaseCurve.prototype.point=function(){throw new Error("Not implemented")},BaseCurve.prototype.validate=function(){throw new Error("Not implemented")},BaseCurve.prototype._fixedNafMul=function(p,k){assert(p.precomputed);var doubles=p._getDoubles(),naf=getNAF(k,1),I=(1<=j;k--)nafW=(nafW<<1)+naf[k];repr.push(nafW)}for(var a=this.jpoint(null,null,null),b=this.jpoint(null,null,null),i=I;i>0;i--){for(var j=0;j=0;i--){for(var k=0;i>=0&&0===naf[i];i--)k++;if(i>=0&&k++,acc=acc.dblp(k),i<0)break;var z=naf[i];assert(0!==z),acc="affine"===p.type?z>0?acc.mixedAdd(wnd[z-1>>1]):acc.mixedAdd(wnd[-z-1>>1].neg()):z>0?acc.add(wnd[z-1>>1]):acc.add(wnd[-z-1>>1].neg())}return"affine"===p.type?acc.toP():acc},BaseCurve.prototype._wnafMulAdd=function(defW,points,coeffs,len,jacobianResult){for(var wndWidth=this._wnafT1,wnd=this._wnafT2,naf=this._wnafT3,max=0,i=0;i=1;i-=2){var a=i-1,b=i;if(1===wndWidth[a]&&1===wndWidth[b]){var comb=[points[a],null,null,points[b]];0===points[a].y.cmp(points[b].y)?(comb[1]=points[a].add(points[b]),comb[2]=points[a].toJ().mixedAdd(points[b].neg())):0===points[a].y.cmp(points[b].y.redNeg())?(comb[1]=points[a].toJ().mixedAdd(points[b]),comb[2]=points[a].add(points[b].neg())):(comb[1]=points[a].toJ().mixedAdd(points[b]),comb[2]=points[a].toJ().mixedAdd(points[b].neg()));var index=[-3,-1,-5,-7,0,7,5,1,3],jsf=getJSF(coeffs[a],coeffs[b]);max=Math.max(jsf[0].length,max),naf[a]=new Array(max),naf[b]=new Array(max);for(var j=0;j=0;i--){for(var k=0;i>=0;){for(var zero=!0,j=0;j=0&&k++,acc=acc.dblp(k),i<0)break;for(var j=0;j0?p=wnd[j][z-1>>1]:z<0&&(p=wnd[j][-z-1>>1].neg()),acc="affine"===p.type?acc.mixedAdd(p):acc.add(p))}}for(var i=0;i=Math.ceil((k.bitLength()+1)/doubles.step)},BasePoint.prototype._getDoubles=function(step,power){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var doubles=[this],acc=this,i=0;i":""},Point.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},Point.prototype._extDbl=function(){var a=this.x.redSqr(),b=this.y.redSqr(),c=this.z.redSqr();c=c.redIAdd(c);var d=this.curve._mulA(a),e=this.x.redAdd(this.y).redSqr().redISub(a).redISub(b),g=d.redAdd(b),f=g.redSub(c),h=d.redSub(b),nx=e.redMul(f),ny=g.redMul(h),nt=e.redMul(h),nz=f.redMul(g);return this.curve.point(nx,ny,nz,nt)},Point.prototype._projDbl=function(){var nx,ny,nz,b=this.x.redAdd(this.y).redSqr(),c=this.x.redSqr(),d=this.y.redSqr();if(this.curve.twisted){var e=this.curve._mulA(c),f=e.redAdd(d);if(this.zOne)nx=b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two)),ny=f.redMul(e.redSub(d)),nz=f.redSqr().redSub(f).redSub(f);else{var h=this.z.redSqr(),j=f.redSub(h).redISub(h);nx=b.redSub(c).redISub(d).redMul(j),ny=f.redMul(e.redSub(d)),nz=f.redMul(j)}}else{var e=c.redAdd(d),h=this.curve._mulC(this.c.redMul(this.z)).redSqr(),j=e.redSub(h).redSub(h);nx=this.curve._mulC(b.redISub(e)).redMul(j),ny=this.curve._mulC(e).redMul(c.redISub(d)),nz=e.redMul(j)}return this.curve.point(nx,ny,nz)},Point.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Point.prototype._extAdd=function(p){var a=this.y.redSub(this.x).redMul(p.y.redSub(p.x)),b=this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)),c=this.t.redMul(this.curve.dd).redMul(p.t),d=this.z.redMul(p.z.redAdd(p.z)),e=b.redSub(a),f=d.redSub(c),g=d.redAdd(c),h=b.redAdd(a),nx=e.redMul(f),ny=g.redMul(h),nt=e.redMul(h),nz=f.redMul(g);return this.curve.point(nx,ny,nz,nt)},Point.prototype._projAdd=function(p){var ny,nz,a=this.z.redMul(p.z),b=a.redSqr(),c=this.x.redMul(p.x),d=this.y.redMul(p.y),e=this.curve.d.redMul(c).redMul(d),f=b.redSub(e),g=b.redAdd(e),tmp=this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d),nx=a.redMul(f).redMul(tmp);return this.curve.twisted?(ny=a.redMul(g).redMul(d.redSub(this.curve._mulA(c))),nz=f.redMul(g)):(ny=a.redMul(g).redMul(d.redSub(c)),nz=this.curve._mulC(f).redMul(g)),this.curve.point(nx,ny,nz)},Point.prototype.add=function(p){return this.isInfinity()?p:p.isInfinity()?this:this.curve.extended?this._extAdd(p):this._projAdd(p)},Point.prototype.mul=function(k){return this._hasDoubles(k)?this.curve._fixedNafMul(this,k):this.curve._wnafMul(this,k)},Point.prototype.mulAdd=function(k1,p,k2){return this.curve._wnafMulAdd(1,[this,p],[k1,k2],2,!1)},Point.prototype.jmulAdd=function(k1,p,k2){return this.curve._wnafMulAdd(1,[this,p],[k1,k2],2,!0)},Point.prototype.normalize=function(){if(this.zOne)return this;var zi=this.z.redInvm();return this.x=this.x.redMul(zi),this.y=this.y.redMul(zi),this.t&&(this.t=this.t.redMul(zi)),this.z=this.curve.one,this.zOne=!0,this},Point.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Point.prototype.getY=function(){return this.normalize(),this.y.fromRed()},Point.prototype.eq=function(other){return this===other||0===this.getX().cmp(other.getX())&&0===this.getY().cmp(other.getY())},Point.prototype.eqXToP=function(x){var rx=x.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(rx))return!0;for(var xc=x.clone(),t=this.curve.redN.redMul(this.z);;){if(xc.iadd(this.curve.n),xc.cmp(this.curve.p)>=0)return!1;if(rx.redIAdd(t),0===this.x.cmp(rx))return!0}return!1},Point.prototype.toP=Point.prototype.normalize,Point.prototype.mixedAdd=Point.prototype.add},function(module,exports,__webpack_require__){"use strict";function MontCurve(conf){Base.call(this,"mont",conf),this.a=new BN(conf.a,16).toRed(this.red),this.b=new BN(conf.b,16).toRed(this.red),this.i4=new BN(4).toRed(this.red).redInvm(),this.two=new BN(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function Point(curve,x,z){Base.BasePoint.call(this,curve,"projective"),null===x&&null===z?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new BN(x,16),this.z=new BN(z,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var curve=__webpack_require__(82),BN=__webpack_require__(14),inherits=__webpack_require__(1),Base=curve.base,elliptic=__webpack_require__(20),utils=elliptic.utils;inherits(MontCurve,Base),module.exports=MontCurve,MontCurve.prototype.validate=function(point){var x=point.normalize().x,x2=x.redSqr(),rhs=x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);return 0===rhs.redSqrt().redSqr().cmp(rhs)},inherits(Point,Base.BasePoint),MontCurve.prototype.decodePoint=function(bytes,enc){return this.point(utils.toArray(bytes,enc),1)},MontCurve.prototype.point=function(x,z){return new Point(this,x,z)},MontCurve.prototype.pointFromJSON=function(obj){return Point.fromJSON(this,obj)},Point.prototype.precompute=function(){},Point.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Point.fromJSON=function(curve,obj){return new Point(curve,obj[0],obj[1]||curve.one)},Point.prototype.inspect=function(){return this.isInfinity()?"":""},Point.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Point.prototype.dbl=function(){var a=this.x.redAdd(this.z),aa=a.redSqr(),b=this.x.redSub(this.z),bb=b.redSqr(),c=aa.redSub(bb),nx=aa.redMul(bb),nz=c.redMul(bb.redAdd(this.curve.a24.redMul(c)));return this.curve.point(nx,nz)},Point.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.diffAdd=function(p,diff){var a=this.x.redAdd(this.z),b=this.x.redSub(this.z),c=p.x.redAdd(p.z),d=p.x.redSub(p.z),da=d.redMul(a),cb=c.redMul(b),nx=diff.z.redMul(da.redAdd(cb).redSqr()),nz=diff.x.redMul(da.redISub(cb).redSqr());return this.curve.point(nx,nz)}, +Point.prototype.mul=function(k){for(var t=k.clone(),a=this,b=this.curve.point(null,null),c=this,bits=[];0!==t.cmpn(0);t.iushrn(1))bits.push(t.andln(1));for(var i=bits.length-1;i>=0;i--)0===bits[i]?(a=a.diffAdd(b,c),b=b.dbl()):(b=a.diffAdd(b,c),a=a.dbl());return b},Point.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.eq=function(other){return 0===this.getX().cmp(other.getX())},Point.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(module,exports,__webpack_require__){"use strict";function ShortCurve(conf){Base.call(this,"short",conf),this.a=new BN(conf.a,16).toRed(this.red),this.b=new BN(conf.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(conf),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function Point(curve,x,y,isRed){Base.BasePoint.call(this,curve,"affine"),null===x&&null===y?(this.x=null,this.y=null,this.inf=!0):(this.x=new BN(x,16),this.y=new BN(y,16),isRed&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function JPoint(curve,x,y,z){Base.BasePoint.call(this,curve,"jacobian"),null===x&&null===y&&null===z?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN(0)):(this.x=new BN(x,16),this.y=new BN(y,16),this.z=new BN(z,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}var curve=__webpack_require__(82),elliptic=__webpack_require__(20),BN=__webpack_require__(14),inherits=__webpack_require__(1),Base=curve.base,assert=elliptic.utils.assert;inherits(ShortCurve,Base),module.exports=ShortCurve,ShortCurve.prototype._getEndomorphism=function(conf){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var beta,lambda;if(conf.beta)beta=new BN(conf.beta,16).toRed(this.red);else{var betas=this._getEndoRoots(this.p);beta=betas[0].cmp(betas[1])<0?betas[0]:betas[1],beta=beta.toRed(this.red)}if(conf.lambda)lambda=new BN(conf.lambda,16);else{var lambdas=this._getEndoRoots(this.n);0===this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta))?lambda=lambdas[0]:(lambda=lambdas[1],assert(0===this.g.mul(lambda).x.cmp(this.g.x.redMul(beta))))}var basis;return basis=conf.basis?conf.basis.map(function(vec){return{a:new BN(vec.a,16),b:new BN(vec.b,16)}}):this._getEndoBasis(lambda),{beta:beta,lambda:lambda,basis:basis}}},ShortCurve.prototype._getEndoRoots=function(num){var red=num===this.p?this.red:BN.mont(num),tinv=new BN(2).toRed(red).redInvm(),ntinv=tinv.redNeg(),s=new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);return[ntinv.redAdd(s).fromRed(),ntinv.redSub(s).fromRed()]},ShortCurve.prototype._getEndoBasis=function(lambda){for(var a0,b0,a1,b1,a2,b2,prevR,r,x,aprxSqrt=this.n.ushrn(Math.floor(this.n.bitLength()/2)),u=lambda,v=this.n.clone(),x1=new BN(1),y1=new BN(0),x2=new BN(0),y2=new BN(1),i=0;0!==u.cmpn(0);){var q=v.div(u);r=v.sub(q.mul(u)),x=x2.sub(q.mul(x1));var y=y2.sub(q.mul(y1));if(!a1&&r.cmp(aprxSqrt)<0)a0=prevR.neg(),b0=x1,a1=r.neg(),b1=x;else if(a1&&2==++i)break;prevR=r,v=u,u=r,x2=x1,x1=x,y2=y1,y1=y}a2=r.neg(),b2=x;var len1=a1.sqr().add(b1.sqr());return a2.sqr().add(b2.sqr()).cmp(len1)>=0&&(a2=a0,b2=b0),a1.negative&&(a1=a1.neg(),b1=b1.neg()),a2.negative&&(a2=a2.neg(),b2=b2.neg()),[{a:a1,b:b1},{a:a2,b:b2}]},ShortCurve.prototype._endoSplit=function(k){var basis=this.endo.basis,v1=basis[0],v2=basis[1],c1=v2.b.mul(k).divRound(this.n),c2=v1.b.neg().mul(k).divRound(this.n),p1=c1.mul(v1.a),p2=c2.mul(v2.a),q1=c1.mul(v1.b),q2=c2.mul(v2.b);return{k1:k.sub(p1).sub(p2),k2:q1.add(q2).neg()}},ShortCurve.prototype.pointFromX=function(x,odd){x=new BN(x,16),x.red||(x=x.toRed(this.red));var y2=x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b),y=y2.redSqrt();if(0!==y.redSqr().redSub(y2).cmp(this.zero))throw new Error("invalid point");var isOdd=y.fromRed().isOdd();return(odd&&!isOdd||!odd&&isOdd)&&(y=y.redNeg()),this.point(x,y)},ShortCurve.prototype.validate=function(point){if(point.inf)return!0;var x=point.x,y=point.y,ax=this.a.redMul(x),rhs=x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);return 0===y.redSqr().redISub(rhs).cmpn(0)},ShortCurve.prototype._endoWnafMulAdd=function(points,coeffs,jacobianResult){for(var npoints=this._endoWnafT1,ncoeffs=this._endoWnafT2,i=0;i":""},Point.prototype.isInfinity=function(){return this.inf},Point.prototype.add=function(p){if(this.inf)return p;if(p.inf)return this;if(this.eq(p))return this.dbl();if(this.neg().eq(p))return this.curve.point(null,null);if(0===this.x.cmp(p.x))return this.curve.point(null,null);var c=this.y.redSub(p.y);0!==c.cmpn(0)&&(c=c.redMul(this.x.redSub(p.x).redInvm()));var nx=c.redSqr().redISub(this.x).redISub(p.x),ny=c.redMul(this.x.redSub(nx)).redISub(this.y);return this.curve.point(nx,ny)},Point.prototype.dbl=function(){if(this.inf)return this;var ys1=this.y.redAdd(this.y);if(0===ys1.cmpn(0))return this.curve.point(null,null);var a=this.curve.a,x2=this.x.redSqr(),dyinv=ys1.redInvm(),c=x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv),nx=c.redSqr().redISub(this.x.redAdd(this.x)),ny=c.redMul(this.x.redSub(nx)).redISub(this.y);return this.curve.point(nx,ny)},Point.prototype.getX=function(){return this.x.fromRed()},Point.prototype.getY=function(){return this.y.fromRed()},Point.prototype.mul=function(k){return k=new BN(k,16),this._hasDoubles(k)?this.curve._fixedNafMul(this,k):this.curve.endo?this.curve._endoWnafMulAdd([this],[k]):this.curve._wnafMul(this,k)},Point.prototype.mulAdd=function(k1,p2,k2){var points=[this,p2],coeffs=[k1,k2];return this.curve.endo?this.curve._endoWnafMulAdd(points,coeffs):this.curve._wnafMulAdd(1,points,coeffs,2)},Point.prototype.jmulAdd=function(k1,p2,k2){var points=[this,p2],coeffs=[k1,k2];return this.curve.endo?this.curve._endoWnafMulAdd(points,coeffs,!0):this.curve._wnafMulAdd(1,points,coeffs,2,!0)},Point.prototype.eq=function(p){return this===p||this.inf===p.inf&&(this.inf||0===this.x.cmp(p.x)&&0===this.y.cmp(p.y))},Point.prototype.neg=function(_precompute){if(this.inf)return this;var res=this.curve.point(this.x,this.y.redNeg());if(_precompute&&this.precomputed){var pre=this.precomputed,negate=function(p){return p.neg()};res.precomputed={naf:pre.naf&&{wnd:pre.naf.wnd,points:pre.naf.points.map(negate)},doubles:pre.doubles&&{step:pre.doubles.step,points:pre.doubles.points.map(negate)}}}return res},Point.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},inherits(JPoint,Base.BasePoint),ShortCurve.prototype.jpoint=function(x,y,z){return new JPoint(this,x,y,z)},JPoint.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var zinv=this.z.redInvm(),zinv2=zinv.redSqr(),ax=this.x.redMul(zinv2),ay=this.y.redMul(zinv2).redMul(zinv);return this.curve.point(ax,ay)},JPoint.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},JPoint.prototype.add=function(p){if(this.isInfinity())return p;if(p.isInfinity())return this;var pz2=p.z.redSqr(),z2=this.z.redSqr(),u1=this.x.redMul(pz2),u2=p.x.redMul(z2),s1=this.y.redMul(pz2.redMul(p.z)),s2=p.y.redMul(z2.redMul(this.z)),h=u1.redSub(u2),r=s1.redSub(s2);if(0===h.cmpn(0))return 0!==r.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h2=h.redSqr(),h3=h2.redMul(h),v=u1.redMul(h2),nx=r.redSqr().redIAdd(h3).redISub(v).redISub(v),ny=r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)),nz=this.z.redMul(p.z).redMul(h);return this.curve.jpoint(nx,ny,nz)},JPoint.prototype.mixedAdd=function(p){if(this.isInfinity())return p.toJ();if(p.isInfinity())return this;var z2=this.z.redSqr(),u1=this.x,u2=p.x.redMul(z2),s1=this.y,s2=p.y.redMul(z2).redMul(this.z),h=u1.redSub(u2),r=s1.redSub(s2);if(0===h.cmpn(0))return 0!==r.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h2=h.redSqr(),h3=h2.redMul(h),v=u1.redMul(h2),nx=r.redSqr().redIAdd(h3).redISub(v).redISub(v),ny=r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)),nz=this.z.redMul(h);return this.curve.jpoint(nx,ny,nz)},JPoint.prototype.dblp=function(pow){if(0===pow)return this;if(this.isInfinity())return this;if(!pow)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var r=this,i=0;i=0)return!1;if(rx.redIAdd(t),0===this.x.cmp(rx))return!0}return!1},JPoint.prototype.inspect=function(){return this.isInfinity()?"":""},JPoint.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(module,exports,__webpack_require__){"use strict";function PresetCurve(options){"short"===options.type?this.curve=new elliptic.curve.short(options):"edwards"===options.type?this.curve=new elliptic.curve.edwards(options):this.curve=new elliptic.curve.mont(options),this.g=this.curve.g,this.n=this.curve.n,this.hash=options.hash,assert(this.g.validate(),"Invalid curve"),assert(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function defineCurve(name,options){Object.defineProperty(curves,name,{configurable:!0,enumerable:!0,get:function(){var curve=new PresetCurve(options);return Object.defineProperty(curves,name,{configurable:!0,enumerable:!0,value:curve}),curve}})}var curves=exports,hash=__webpack_require__(113),elliptic=__webpack_require__(20),assert=elliptic.utils.assert;curves.PresetCurve=PresetCurve,defineCurve("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:hash.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),defineCurve("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:hash.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),defineCurve("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:hash.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),defineCurve("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:hash.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),defineCurve("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:hash.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),defineCurve("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hash.sha256,gRed:!1,g:["9"]}),defineCurve("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hash.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var pre;try{pre=__webpack_require__(351)}catch(e){pre=void 0}defineCurve("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:hash.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",pre]})},function(module,exports,__webpack_require__){"use strict";function EC(options){if(!(this instanceof EC))return new EC(options);"string"==typeof options&&(assert(elliptic.curves.hasOwnProperty(options),"Unknown curve "+options),options=elliptic.curves[options]),options instanceof elliptic.curves.PresetCurve&&(options={curve:options}),this.curve=options.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=options.curve.g,this.g.precompute(options.curve.n.bitLength()+1),this.hash=options.hash||options.curve.hash}var BN=__webpack_require__(14),HmacDRBG=__webpack_require__(383),elliptic=__webpack_require__(20),utils=elliptic.utils,assert=utils.assert,KeyPair=__webpack_require__(346),Signature=__webpack_require__(347);module.exports=EC,EC.prototype.keyPair=function(options){return new KeyPair(this,options)},EC.prototype.keyFromPrivate=function(priv,enc){return KeyPair.fromPrivate(this,priv,enc)},EC.prototype.keyFromPublic=function(pub,enc){return KeyPair.fromPublic(this,pub,enc)},EC.prototype.genKeyPair=function(options){options||(options={});for(var drbg=new HmacDRBG({hash:this.hash,pers:options.pers,persEnc:options.persEnc||"utf8",entropy:options.entropy||elliptic.rand(this.hash.hmacStrength),entropyEnc:options.entropy&&options.entropyEnc||"utf8",nonce:this.n.toArray()}),bytes=this.n.byteLength(),ns2=this.n.sub(new BN(2));;){var priv=new BN(drbg.generate(bytes));if(!(priv.cmp(ns2)>0))return priv.iaddn(1),this.keyFromPrivate(priv)}},EC.prototype._truncateToN=function(msg,truncOnly){var delta=8*msg.byteLength()-this.n.bitLength();return delta>0&&(msg=msg.ushrn(delta)),!truncOnly&&msg.cmp(this.n)>=0?msg.sub(this.n):msg},EC.prototype.sign=function(msg,key,enc,options){"object"==typeof enc&&(options=enc,enc=null),options||(options={}),key=this.keyFromPrivate(key,enc),msg=this._truncateToN(new BN(msg,16));for(var bytes=this.n.byteLength(),bkey=key.getPrivate().toArray("be",bytes),nonce=msg.toArray("be",bytes),drbg=new HmacDRBG({hash:this.hash,entropy:bkey,nonce:nonce,pers:options.pers,persEnc:options.persEnc||"utf8"}),ns1=this.n.sub(new BN(1)),iter=0;!0;iter++){var k=options.k?options.k(iter):new BN(drbg.generate(this.n.byteLength()));if(k=this._truncateToN(k,!0),!(k.cmpn(1)<=0||k.cmp(ns1)>=0)){var kp=this.g.mul(k);if(!kp.isInfinity()){var kpX=kp.getX(),r=kpX.umod(this.n);if(0!==r.cmpn(0)){var s=k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));if(s=s.umod(this.n),0!==s.cmpn(0)){var recoveryParam=(kp.getY().isOdd()?1:0)|(0!==kpX.cmp(r)?2:0);return options.canonical&&s.cmp(this.nh)>0&&(s=this.n.sub(s),recoveryParam^=1),new Signature({r:r,s:s,recoveryParam:recoveryParam})}}}}}},EC.prototype.verify=function(msg,signature,key,enc){msg=this._truncateToN(new BN(msg,16)),key=this.keyFromPublic(key,enc),signature=new Signature(signature,"hex");var r=signature.r,s=signature.s;if(r.cmpn(1)<0||r.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var sinv=s.invm(this.n),u1=sinv.mul(msg).umod(this.n),u2=sinv.mul(r).umod(this.n);if(!this.curve._maxwellTrick){var p=this.g.mulAdd(u1,key.getPublic(),u2);return!p.isInfinity()&&0===p.getX().umod(this.n).cmp(r)}var p=this.g.jmulAdd(u1,key.getPublic(),u2);return!p.isInfinity()&&p.eqXToP(r)},EC.prototype.recoverPubKey=function(msg,signature,j,enc){assert((3&j)===j,"The recovery param is more than two bits"),signature=new Signature(signature,enc);var n=this.n,e=new BN(msg),r=signature.r,s=signature.s,isYOdd=1&j,isSecondKey=j>>1;if(r.cmp(this.curve.p.umod(this.curve.n))>=0&&isSecondKey)throw new Error("Unable to find sencond key candinate");r=isSecondKey?this.curve.pointFromX(r.add(this.curve.n),isYOdd):this.curve.pointFromX(r,isYOdd);var rInv=signature.r.invm(n),s1=n.sub(e).mul(rInv).umod(n),s2=s.mul(rInv).umod(n);return this.g.mulAdd(s1,r,s2)},EC.prototype.getKeyRecoveryParam=function(e,signature,Q,enc){if(signature=new Signature(signature,enc),null!==signature.recoveryParam)return signature.recoveryParam;for(var i=0;i<4;i++){var Qprime;try{Qprime=this.recoverPubKey(e,signature,i)}catch(e){continue}if(Qprime.eq(Q))return i}throw new Error("Unable to find valid recovery factor")}},function(module,exports,__webpack_require__){"use strict";function KeyPair(ec,options){this.ec=ec,this.priv=null,this.pub=null,options.priv&&this._importPrivate(options.priv,options.privEnc),options.pub&&this._importPublic(options.pub,options.pubEnc)}var BN=__webpack_require__(14),elliptic=__webpack_require__(20),utils=elliptic.utils,assert=utils.assert;module.exports=KeyPair,KeyPair.fromPublic=function(ec,pub,enc){return pub instanceof KeyPair?pub:new KeyPair(ec,{pub:pub,pubEnc:enc})},KeyPair.fromPrivate=function(ec,priv,enc){return priv instanceof KeyPair?priv:new KeyPair(ec,{priv:priv,privEnc:enc})},KeyPair.prototype.validate=function(){var pub=this.getPublic();return pub.isInfinity()?{result:!1,reason:"Invalid public key"}:pub.validate()?pub.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},KeyPair.prototype.getPublic=function(compact,enc){return"string"==typeof compact&&(enc=compact,compact=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),enc?this.pub.encode(enc,compact):this.pub},KeyPair.prototype.getPrivate=function(enc){return"hex"===enc?this.priv.toString(16,2):this.priv},KeyPair.prototype._importPrivate=function(key,enc){this.priv=new BN(key,enc||16),this.priv=this.priv.umod(this.ec.curve.n)},KeyPair.prototype._importPublic=function(key,enc){if(key.x||key.y)return"mont"===this.ec.curve.type?assert(key.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||assert(key.x&&key.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(key.x,key.y));this.pub=this.ec.curve.decodePoint(key,enc)},KeyPair.prototype.derive=function(pub){return pub.mul(this.priv).getX()},KeyPair.prototype.sign=function(msg,enc,options){return this.ec.sign(msg,this,enc,options)},KeyPair.prototype.verify=function(msg,signature){return this.ec.verify(msg,signature,this)},KeyPair.prototype.inspect=function(){return""}},function(module,exports,__webpack_require__){"use strict";function Signature(options,enc){if(options instanceof Signature)return options;this._importDER(options,enc)||(assert(options.r&&options.s,"Signature without r or s"),this.r=new BN(options.r,16),this.s=new BN(options.s,16),void 0===options.recoveryParam?this.recoveryParam=null:this.recoveryParam=options.recoveryParam)}function Position(){this.place=0}function getLength(buf,p){var initial=buf[p.place++];if(!(128&initial))return initial;for(var octetLen=15&initial,val=0,i=0,off=p.place;i>>3);for(arr.push(128|octets);--octets;)arr.push(len>>>(octets<<3)&255);arr.push(len)}var BN=__webpack_require__(14),elliptic=__webpack_require__(20),utils=elliptic.utils,assert=utils.assert;module.exports=Signature,Signature.prototype._importDER=function(data,enc){data=utils.toArray(data,enc);var p=new Position;if(48!==data[p.place++])return!1;if(getLength(data,p)+p.place!==data.length)return!1;if(2!==data[p.place++])return!1;var rlen=getLength(data,p),r=data.slice(p.place,rlen+p.place);if(p.place+=rlen,2!==data[p.place++])return!1;var slen=getLength(data,p);if(data.length!==slen+p.place)return!1;var s=data.slice(p.place,slen+p.place);return 0===r[0]&&128&r[1]&&(r=r.slice(1)),0===s[0]&&128&s[1]&&(s=s.slice(1)),this.r=new BN(r),this.s=new BN(s),this.recoveryParam=null,!0},Signature.prototype.toDER=function(enc){var r=this.r.toArray(),s=this.s.toArray();for(128&r[0]&&(r=[0].concat(r)),128&s[0]&&(s=[0].concat(s)),r=rmPadding(r),s=rmPadding(s);!(s[0]||128&s[1]);)s=s.slice(1);var arr=[2];constructLength(arr,r.length),arr=arr.concat(r),arr.push(2),constructLength(arr,s.length);var backHalf=arr.concat(s),res=[48];return constructLength(res,backHalf.length),res=res.concat(backHalf),utils.encode(res,enc)}},function(module,exports,__webpack_require__){"use strict";function EDDSA(curve){if(assert("ed25519"===curve,"only tested with ed25519 so far"),!(this instanceof EDDSA))return new EDDSA(curve);var curve=elliptic.curves[curve].curve;this.curve=curve,this.g=curve.g,this.g.precompute(curve.n.bitLength()+1),this.pointClass=curve.point().constructor,this.encodingLength=Math.ceil(curve.n.bitLength()/8),this.hash=hash.sha512}var hash=__webpack_require__(113),elliptic=__webpack_require__(20),utils=elliptic.utils,assert=utils.assert,parseBytes=utils.parseBytes,KeyPair=__webpack_require__(349),Signature=__webpack_require__(350);module.exports=EDDSA,EDDSA.prototype.sign=function(message,secret){message=parseBytes(message);var key=this.keyFromSecret(secret),r=this.hashInt(key.messagePrefix(),message),R=this.g.mul(r),Rencoded=this.encodePoint(R),s_=this.hashInt(Rencoded,key.pubBytes(),message).mul(key.priv()),S=r.add(s_).umod(this.curve.n);return this.makeSignature({R:R,S:S,Rencoded:Rencoded})},EDDSA.prototype.verify=function(message,sig,pub){message=parseBytes(message),sig=this.makeSignature(sig);var key=this.keyFromPublic(pub),h=this.hashInt(sig.Rencoded(),key.pubBytes(),message),SG=this.g.mul(sig.S());return sig.R().add(key.pub().mul(h)).eq(SG)},EDDSA.prototype.hashInt=function(){for(var hash=this.hash(),i=0;i=0;){var z;if(k.isOdd()){var mod=k.andln(ws-1);z=mod>(ws>>1)-1?(ws>>1)-mod:mod,k.isubn(z)}else z=0;naf.push(z);for(var shift=0!==k.cmpn(0)&&0===k.andln(ws-1)?w+1:1,i=1;i0||k2.cmpn(-d2)>0;){var m14=k1.andln(3)+d1&3,m24=k2.andln(3)+d2&3;3===m14&&(m14=-1),3===m24&&(m24=-1);var u1;if(0==(1&m14))u1=0;else{var m8=k1.andln(7)+d1&7;u1=3!==m8&&5!==m8||2!==m24?m14:-m14}jsf[0].push(u1);var u2;if(0==(1&m24))u2=0;else{var m8=k2.andln(7)+d2&7;u2=3!==m8&&5!==m8||2!==m14?m24:-m24}jsf[1].push(u2),2*d1===u1+1&&(d1=1-d1),2*d2===u2+1&&(d2=1-d2),k1.iushrn(1),k2.iushrn(1)}return jsf}function cachedProperty(obj,name,computer){var key="_"+name;obj.prototype[name]=function(){return void 0!==this[key]?this[key]:this[key]=computer.call(this)}}function parseBytes(bytes){return"string"==typeof bytes?utils.toArray(bytes,"hex"):bytes}function intFromLE(bytes){return new BN(bytes,"hex","le")}var utils=exports,BN=__webpack_require__(14),minAssert=__webpack_require__(34),minUtils=__webpack_require__(236);utils.assert=minAssert,utils.toArray=minUtils.toArray,utils.zero2=minUtils.zero2,utils.toHex=minUtils.toHex,utils.encode=minUtils.encode,utils.getNAF=getNAF,utils.getJSF=getJSF,utils.cachedProperty=cachedProperty,utils.parseBytes=parseBytes,utils.intFromLE=intFromLE},function(module,exports,__webpack_require__){var once=__webpack_require__(67),noop=function(){},isRequest=function(stream){return stream.setHeader&&"function"==typeof stream.abort},isChildProcess=function(stream){return stream.stdio&&Array.isArray(stream.stdio)&&3===stream.stdio.length},eos=function(stream,opts,callback){if("function"==typeof opts)return eos(stream,null,opts);opts||(opts={}),callback=once(callback||noop);var ws=stream._writableState,rs=stream._readableState,readable=opts.readable||opts.readable!==!1&&stream.readable,writable=opts.writable||opts.writable!==!1&&stream.writable,onlegacyfinish=function(){stream.writable||onfinish()},onfinish=function(){writable=!1,readable||callback.call(stream)},onend=function(){readable=!1,writable||callback.call(stream)},onexit=function(exitCode){callback.call(stream,exitCode?new Error("exited with error code: "+exitCode):null)},onclose=function(){return(!readable||rs&&rs.ended)&&(!writable||ws&&ws.ended)?void 0:callback.call(stream,new Error("premature close"))},onrequest=function(){stream.req.on("finish",onfinish)};return isRequest(stream)?(stream.on("complete",onfinish),stream.on("abort",onclose),stream.req?onrequest():stream.on("request",onrequest)):writable&&!ws&&(stream.on("end",onlegacyfinish),stream.on("close",onlegacyfinish)),isChildProcess(stream)&&stream.on("exit",onexit),stream.on("end",onend),stream.on("finish",onfinish),opts.error!==!1&&stream.on("error",callback),stream.on("close",onclose),function(){stream.removeListener("complete",onfinish),stream.removeListener("abort",onclose),stream.removeListener("request",onrequest),stream.req&&stream.req.removeListener("finish",onfinish),stream.removeListener("end",onlegacyfinish),stream.removeListener("close",onlegacyfinish),stream.removeListener("finish",onfinish),stream.removeListener("exit",onexit), +stream.removeListener("end",onend),stream.removeListener("error",callback),stream.removeListener("close",onclose)}};module.exports=eos},function(module,exports,__webpack_require__){module.exports=__webpack_require__(355)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(356),module.exports.parser=__webpack_require__(50)},function(module,exports,__webpack_require__){(function(global){function Socket(uri,opts){if(!(this instanceof Socket))return new Socket(uri,opts);opts=opts||{},uri&&"object"==typeof uri&&(opts=uri,uri=null),uri?(uri=parseuri(uri),opts.hostname=uri.host,opts.secure="https"===uri.protocol||"wss"===uri.protocol,opts.port=uri.port,uri.query&&(opts.query=uri.query)):opts.host&&(opts.hostname=parseuri(opts.host).host),this.secure=null!=opts.secure?opts.secure:global.location&&"https:"===location.protocol,opts.hostname&&!opts.port&&(opts.port=this.secure?"443":"80"),this.agent=opts.agent||!1,this.hostname=opts.hostname||(global.location?location.hostname:"localhost"),this.port=opts.port||(global.location&&location.port?location.port:this.secure?443:80),this.query=opts.query||{},"string"==typeof this.query&&(this.query=parseqs.decode(this.query)),this.upgrade=!1!==opts.upgrade,this.path=(opts.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!opts.forceJSONP,this.jsonp=!1!==opts.jsonp,this.forceBase64=!!opts.forceBase64,this.enablesXDR=!!opts.enablesXDR,this.timestampParam=opts.timestampParam||"t",this.timestampRequests=opts.timestampRequests,this.transports=opts.transports||["polling","websocket"],this.transportOptions=opts.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=opts.policyPort||843,this.rememberUpgrade=opts.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=opts.onlyBinaryUpgrades,this.perMessageDeflate=!1!==opts.perMessageDeflate&&(opts.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=opts.pfx||null,this.key=opts.key||null,this.passphrase=opts.passphrase||null,this.cert=opts.cert||null,this.ca=opts.ca||null,this.ciphers=opts.ciphers||null,this.rejectUnauthorized=void 0===opts.rejectUnauthorized||opts.rejectUnauthorized,this.forceNode=!!opts.forceNode;var freeGlobal="object"==typeof global&&global;freeGlobal.global===freeGlobal&&(opts.extraHeaders&&Object.keys(opts.extraHeaders).length>0&&(this.extraHeaders=opts.extraHeaders),opts.localAddress&&(this.localAddress=opts.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}function clone(obj){var o={};for(var i in obj)obj.hasOwnProperty(i)&&(o[i]=obj[i]);return o}var transports=__webpack_require__(180),Emitter=__webpack_require__(49),debug=__webpack_require__(3)("engine.io-client:socket"),index=__webpack_require__(114),parser=__webpack_require__(50),parseuri=__webpack_require__(244),parsejson=__webpack_require__(584),parseqs=__webpack_require__(93);module.exports=Socket,Socket.priorWebsocketSuccess=!1,Emitter(Socket.prototype),Socket.protocol=parser.protocol,Socket.Socket=Socket,Socket.Transport=__webpack_require__(111),Socket.transports=__webpack_require__(180),Socket.parser=__webpack_require__(50),Socket.prototype.createTransport=function(name){debug('creating transport "%s"',name);var query=clone(this.query);query.EIO=parser.protocol,query.transport=name;var options=this.transportOptions[name]||{};return this.id&&(query.sid=this.id),new transports[name]({query:query,socket:this,agent:options.agent||this.agent,hostname:options.hostname||this.hostname,port:options.port||this.port,secure:options.secure||this.secure,path:options.path||this.path,forceJSONP:options.forceJSONP||this.forceJSONP,jsonp:options.jsonp||this.jsonp,forceBase64:options.forceBase64||this.forceBase64,enablesXDR:options.enablesXDR||this.enablesXDR,timestampRequests:options.timestampRequests||this.timestampRequests,timestampParam:options.timestampParam||this.timestampParam,policyPort:options.policyPort||this.policyPort,pfx:options.pfx||this.pfx,key:options.key||this.key,passphrase:options.passphrase||this.passphrase,cert:options.cert||this.cert,ca:options.ca||this.ca,ciphers:options.ciphers||this.ciphers,rejectUnauthorized:options.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:options.perMessageDeflate||this.perMessageDeflate,extraHeaders:options.extraHeaders||this.extraHeaders,forceNode:options.forceNode||this.forceNode,localAddress:options.localAddress||this.localAddress,requestTimeout:options.requestTimeout||this.requestTimeout,protocols:options.protocols||void 0})},Socket.prototype.open=function(){var transport;if(this.rememberUpgrade&&Socket.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)transport="websocket";else{if(0===this.transports.length){var self=this;return void setTimeout(function(){self.emit("error","No transports available")},0)}transport=this.transports[0]}this.readyState="opening";try{transport=this.createTransport(transport)}catch(e){return this.transports.shift(),void this.open()}transport.open(),this.setTransport(transport)},Socket.prototype.setTransport=function(transport){debug("setting transport %s",transport.name);var self=this;this.transport&&(debug("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=transport,transport.on("drain",function(){self.onDrain()}).on("packet",function(packet){self.onPacket(packet)}).on("error",function(e){self.onError(e)}).on("close",function(){self.onClose("transport close")})},Socket.prototype.probe=function(name){function onTransportOpen(){if(self.onlyBinaryUpgrades){var upgradeLosesBinary=!this.supportsBinary&&self.transport.supportsBinary;failed=failed||upgradeLosesBinary}failed||(debug('probe transport "%s" opened',name),transport.send([{type:"ping",data:"probe"}]),transport.once("packet",function(msg){if(!failed)if("pong"===msg.type&&"probe"===msg.data){if(debug('probe transport "%s" pong',name),self.upgrading=!0,self.emit("upgrading",transport),!transport)return;Socket.priorWebsocketSuccess="websocket"===transport.name,debug('pausing current transport "%s"',self.transport.name),self.transport.pause(function(){failed||"closed"!==self.readyState&&(debug("changing transport and sending upgrade packet"),cleanup(),self.setTransport(transport),transport.send([{type:"upgrade"}]),self.emit("upgrade",transport),transport=null,self.upgrading=!1,self.flush())})}else{debug('probe transport "%s" failed',name);var err=new Error("probe error");err.transport=transport.name,self.emit("upgradeError",err)}}))}function freezeTransport(){failed||(failed=!0,cleanup(),transport.close(),transport=null)}function onerror(err){var error=new Error("probe error: "+err);error.transport=transport.name,freezeTransport(),debug('probe transport "%s" failed because of error: %s',name,err),self.emit("upgradeError",error)}function onTransportClose(){onerror("transport closed")}function onclose(){onerror("socket closed")}function onupgrade(to){transport&&to.name!==transport.name&&(debug('"%s" works - aborting "%s"',to.name,transport.name),freezeTransport())}function cleanup(){transport.removeListener("open",onTransportOpen),transport.removeListener("error",onerror),transport.removeListener("close",onTransportClose),self.removeListener("close",onclose),self.removeListener("upgrading",onupgrade)}debug('probing transport "%s"',name);var transport=this.createTransport(name,{probe:1}),failed=!1,self=this;Socket.priorWebsocketSuccess=!1,transport.once("open",onTransportOpen),transport.once("error",onerror),transport.once("close",onTransportClose),this.once("close",onclose),this.once("upgrading",onupgrade),transport.open()},Socket.prototype.onOpen=function(){if(debug("socket open"),this.readyState="open",Socket.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){debug("starting upgrade probes");for(var i=0,l=this.upgrades.length;i';iframe=document.createElement(html)}catch(e){iframe=document.createElement("iframe"),iframe.name=self.iframeId,iframe.src="javascript:0"}iframe.id=self.iframeId,self.form.appendChild(iframe),self.iframe=iframe}var self=this;if(!this.form){var iframe,form=document.createElement("form"),area=document.createElement("textarea"),id=this.iframeId="eio_iframe_"+this.index;form.className="socketio",form.style.position="absolute",form.style.top="-1000px",form.style.left="-1000px",form.target=id,form.method="POST",form.setAttribute("accept-charset","utf-8"),area.name="d",form.appendChild(area),document.body.appendChild(form),this.form=form,this.area=area}this.form.action=this.uri(),initIframe(),data=data.replace(/\\n/g,"\\\n"),this.area.value=data.replace(/\n/g,"\\n");try{this.form.submit()}catch(e){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===self.iframe.readyState&&complete()}:this.iframe.onload=complete}}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(global){function empty(){}function XHR(opts){if(Polling.call(this,opts),this.requestTimeout=opts.requestTimeout,this.extraHeaders=opts.extraHeaders,global.location){var isSSL="https:"===location.protocol,port=location.port;port||(port=isSSL?443:80),this.xd=opts.hostname!==global.location.hostname||port!==opts.port,this.xs=opts.secure!==isSSL}}function Request(opts){this.method=opts.method||"GET",this.uri=opts.uri,this.xd=!!opts.xd,this.xs=!!opts.xs,this.async=!1!==opts.async,this.data=void 0!==opts.data?opts.data:null,this.agent=opts.agent,this.isBinary=opts.isBinary,this.supportsBinary=opts.supportsBinary,this.enablesXDR=opts.enablesXDR,this.requestTimeout=opts.requestTimeout,this.pfx=opts.pfx,this.key=opts.key,this.passphrase=opts.passphrase,this.cert=opts.cert,this.ca=opts.ca,this.ciphers=opts.ciphers,this.rejectUnauthorized=opts.rejectUnauthorized,this.extraHeaders=opts.extraHeaders,this.create()}function unloadHandler(){for(var i in Request.requests)Request.requests.hasOwnProperty(i)&&Request.requests[i].abort()}var XMLHttpRequest=__webpack_require__(112),Polling=__webpack_require__(181),Emitter=__webpack_require__(49),inherit=__webpack_require__(80),debug=__webpack_require__(3)("engine.io-client:polling-xhr");module.exports=XHR,module.exports.Request=Request,inherit(XHR,Polling),XHR.prototype.supportsBinary=!0,XHR.prototype.request=function(opts){return opts=opts||{},opts.uri=this.uri(),opts.xd=this.xd,opts.xs=this.xs,opts.agent=this.agent||!1,opts.supportsBinary=this.supportsBinary,opts.enablesXDR=this.enablesXDR,opts.pfx=this.pfx,opts.key=this.key,opts.passphrase=this.passphrase,opts.cert=this.cert,opts.ca=this.ca,opts.ciphers=this.ciphers,opts.rejectUnauthorized=this.rejectUnauthorized,opts.requestTimeout=this.requestTimeout,opts.extraHeaders=this.extraHeaders,new Request(opts)},XHR.prototype.doWrite=function(data,fn){var isBinary="string"!=typeof data&&void 0!==data,req=this.request({method:"POST",data:data,isBinary:isBinary}),self=this;req.on("success",fn),req.on("error",function(err){self.onError("xhr post error",err)}),this.sendXhr=req},XHR.prototype.doPoll=function(){debug("xhr poll");var req=this.request(),self=this;req.on("data",function(data){self.onData(data)}),req.on("error",function(err){self.onError("xhr poll error",err)}),this.pollXhr=req},Emitter(Request.prototype),Request.prototype.create=function(){var opts={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};opts.pfx=this.pfx,opts.key=this.key,opts.passphrase=this.passphrase,opts.cert=this.cert,opts.ca=this.ca,opts.ciphers=this.ciphers,opts.rejectUnauthorized=this.rejectUnauthorized;var xhr=this.xhr=new XMLHttpRequest(opts),self=this;try{debug("xhr open %s: %s",this.method,this.uri),xhr.open(this.method,this.uri,this.async);try{if(this.extraHeaders){xhr.setDisableHeaderCheck&&xhr.setDisableHeaderCheck(!0);for(var i in this.extraHeaders)this.extraHeaders.hasOwnProperty(i)&&xhr.setRequestHeader(i,this.extraHeaders[i])}}catch(e){}if("POST"===this.method)try{this.isBinary?xhr.setRequestHeader("Content-type","application/octet-stream"):xhr.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{xhr.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in xhr&&(xhr.withCredentials=!0),this.requestTimeout&&(xhr.timeout=this.requestTimeout),this.hasXDR()?(xhr.onload=function(){self.onLoad()},xhr.onerror=function(){self.onError(xhr.responseText)}):xhr.onreadystatechange=function(){if(2===xhr.readyState){var contentType;try{contentType=xhr.getResponseHeader("Content-Type")}catch(e){}"application/octet-stream"===contentType&&(xhr.responseType="arraybuffer")}4===xhr.readyState&&(200===xhr.status||1223===xhr.status?self.onLoad():setTimeout(function(){self.onError(xhr.status)},0))},debug("xhr data %s",this.data),xhr.send(this.data)}catch(e){return void setTimeout(function(){self.onError(e)},0)}global.document&&(this.index=Request.requestsCount++,Request.requests[this.index]=this)},Request.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},Request.prototype.onData=function(data){this.emit("data",data),this.onSuccess()},Request.prototype.onError=function(err){this.emit("error",err),this.cleanup(!0)},Request.prototype.cleanup=function(fromError){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=empty:this.xhr.onreadystatechange=empty,fromError)try{this.xhr.abort()}catch(e){}global.document&&delete Request.requests[this.index],this.xhr=null}},Request.prototype.onLoad=function(){var data;try{var contentType;try{contentType=this.xhr.getResponseHeader("Content-Type")}catch(e){}data="application/octet-stream"===contentType?this.xhr.response||this.xhr.responseText:this.xhr.responseText}catch(e){this.onError(e)}null!=data&&this.onData(data)},Request.prototype.hasXDR=function(){return void 0!==global.XDomainRequest&&!this.xs&&this.enablesXDR},Request.prototype.abort=function(){this.cleanup()},Request.requestsCount=0,Request.requests={},global.document&&(global.attachEvent?global.attachEvent("onunload",unloadHandler):global.addEventListener&&global.addEventListener("beforeunload",unloadHandler,!1))}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(global){function WS(opts){opts&&opts.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=opts.perMessageDeflate,this.usingBrowserWebSocket=BrowserWebSocket&&!opts.forceNode,this.protocols=opts.protocols,this.usingBrowserWebSocket||(WebSocket=NodeWebSocket),Transport.call(this,opts)}var NodeWebSocket,Transport=__webpack_require__(111),parser=__webpack_require__(50),parseqs=__webpack_require__(93),inherit=__webpack_require__(80),yeast=__webpack_require__(275),debug=__webpack_require__(3)("engine.io-client:websocket"),BrowserWebSocket=global.WebSocket||global.MozWebSocket;if("undefined"==typeof window)try{NodeWebSocket=__webpack_require__(711)}catch(e){}var WebSocket=BrowserWebSocket;WebSocket||"undefined"!=typeof window||(WebSocket=NodeWebSocket),module.exports=WS,inherit(WS,Transport),WS.prototype.name="websocket",WS.prototype.supportsBinary=!0,WS.prototype.doOpen=function(){if(this.check()){var uri=this.uri(),protocols=this.protocols,opts={agent:this.agent,perMessageDeflate:this.perMessageDeflate};opts.pfx=this.pfx,opts.key=this.key,opts.passphrase=this.passphrase,opts.cert=this.cert,opts.ca=this.ca,opts.ciphers=this.ciphers,opts.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(opts.headers=this.extraHeaders),this.localAddress&&(opts.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket?protocols?new WebSocket(uri,protocols):new WebSocket(uri):new WebSocket(uri,protocols,opts)}catch(err){return this.emit("error",err)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},WS.prototype.addEventListeners=function(){var self=this;this.ws.onopen=function(){self.onOpen()},this.ws.onclose=function(){self.onClose()},this.ws.onmessage=function(ev){self.onData(ev.data)},this.ws.onerror=function(e){self.onError("websocket error",e)}},WS.prototype.write=function(packets){function done(){self.emit("flush"),setTimeout(function(){self.writable=!0,self.emit("drain")},0)}var self=this;this.writable=!1;for(var total=packets.length,i=0,l=total;i=55296&&value<=56319&&counter65535&&(value-=65536,output+=stringFromCharCode(value>>>10&1023|55296),value=56320|1023&value),output+=stringFromCharCode(value);return output}function checkScalarValue(codePoint,strict){if(codePoint>=55296&&codePoint<=57343){if(strict)throw Error("Lone surrogate U+"+codePoint.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function createByte(codePoint,shift){return stringFromCharCode(codePoint>>shift&63|128)}function encodeCodePoint(codePoint,strict){if(0==(4294967168&codePoint))return stringFromCharCode(codePoint);var symbol="";return 0==(4294965248&codePoint)?symbol=stringFromCharCode(codePoint>>6&31|192):0==(4294901760&codePoint)?(checkScalarValue(codePoint,strict)||(codePoint=65533),symbol=stringFromCharCode(codePoint>>12&15|224),symbol+=createByte(codePoint,6)):0==(4292870144&codePoint)&&(symbol=stringFromCharCode(codePoint>>18&7|240),symbol+=createByte(codePoint,12),symbol+=createByte(codePoint,6)),symbol+=stringFromCharCode(63&codePoint|128)}function utf8encode(string,opts){opts=opts||{};for(var codePoint,strict=!1!==opts.strict,codePoints=ucs2decode(string),length=codePoints.length,index=-1,byteString="";++index=byteCount)throw Error("Invalid byte index");var continuationByte=255&byteArray[byteIndex];if(byteIndex++,128==(192&continuationByte))return 63&continuationByte;throw Error("Invalid continuation byte")}function decodeSymbol(strict){var byte1,byte2,byte3,byte4,codePoint;if(byteIndex>byteCount)throw Error("Invalid byte index");if(byteIndex==byteCount)return!1;if(byte1=255&byteArray[byteIndex],byteIndex++,0==(128&byte1))return byte1;if(192==(224&byte1)){if(byte2=readContinuationByte(),(codePoint=(31&byte1)<<6|byte2)>=128)return codePoint;throw Error("Invalid continuation byte")}if(224==(240&byte1)){if(byte2=readContinuationByte(),byte3=readContinuationByte(),(codePoint=(15&byte1)<<12|byte2<<6|byte3)>=2048)return checkScalarValue(codePoint,strict)?codePoint:65533;throw Error("Invalid continuation byte")}if(240==(248&byte1)&&(byte2=readContinuationByte(),byte3=readContinuationByte(),byte4=readContinuationByte(),(codePoint=(7&byte1)<<18|byte2<<12|byte3<<6|byte4)>=65536&&codePoint<=1114111))return codePoint;throw Error("Invalid UTF-8 detected")}function utf8decode(byteString,opts){opts=opts||{};var strict=!1!==opts.strict;byteArray=ucs2decode(byteString),byteCount=byteArray.length,byteIndex=0;for(var tmp,codePoints=[];(tmp=decodeSymbol(strict))!==!1;)codePoints.push(tmp);return ucs2encode(codePoints)}var freeExports="object"==typeof exports&&exports,freeGlobal=("object"==typeof module&&module&&module.exports,"object"==typeof global&&global);freeGlobal.global!==freeGlobal&&freeGlobal.window;var byteArray,byteCount,byteIndex,stringFromCharCode=String.fromCharCode,utf8={version:"2.1.2",encode:utf8encode,decode:utf8decode};void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(){return utf8}.call(exports,__webpack_require__,exports,module))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)}()}).call(exports,__webpack_require__(18)(module),__webpack_require__(2))},function(module,exports,__webpack_require__){function init(type,message,cause){prr(this,{type:type,name:type,cause:"string"!=typeof message?message:cause,message:message&&"string"!=typeof message?message.message:message},"ewr")}function CustomError(message,cause){Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,arguments.callee),init.call(this,"CustomError",message,cause)}function createError(errno,type,proto){var err=function(message,cause){init.call(this,type,message,cause),"FilesystemError"==type&&(this.code=this.cause.code,this.path=this.cause.path,this.errno=this.cause.errno,this.message=(errno.errno[this.cause.errno]?errno.errno[this.cause.errno].description:this.cause.message)+(this.cause.path?" ["+this.cause.path+"]":"")),Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,arguments.callee)};return err.prototype=proto?new proto:new CustomError,err}var prr=__webpack_require__(364);CustomError.prototype=new Error,module.exports=function(errno){var ce=function(type,proto){return createError(errno,type,proto)};return{CustomError:CustomError,FilesystemError:ce("FilesystemError"),createError:ce}}},function(module,exports,__webpack_require__){var all=module.exports.all=[{errno:-2,code:"ENOENT",description:"no such file or directory"},{errno:-1,code:"UNKNOWN",description:"unknown error"},{errno:0,code:"OK",description:"success"},{errno:1,code:"EOF",description:"end of file"},{errno:2,code:"EADDRINFO",description:"getaddrinfo error"},{errno:3,code:"EACCES",description:"permission denied"},{errno:4,code:"EAGAIN",description:"resource temporarily unavailable"},{errno:5,code:"EADDRINUSE",description:"address already in use"},{errno:6,code:"EADDRNOTAVAIL",description:"address not available"},{errno:7,code:"EAFNOSUPPORT",description:"address family not supported"},{errno:8,code:"EALREADY",description:"connection already in progress"},{errno:9,code:"EBADF",description:"bad file descriptor"},{errno:10,code:"EBUSY",description:"resource busy or locked"},{errno:11,code:"ECONNABORTED",description:"software caused connection abort"},{errno:12,code:"ECONNREFUSED",description:"connection refused"},{errno:13,code:"ECONNRESET",description:"connection reset by peer"},{errno:14,code:"EDESTADDRREQ",description:"destination address required"},{errno:15,code:"EFAULT",description:"bad address in system call argument"},{errno:16,code:"EHOSTUNREACH",description:"host is unreachable"},{errno:17,code:"EINTR",description:"interrupted system call"},{errno:18,code:"EINVAL",description:"invalid argument"},{errno:19,code:"EISCONN",description:"socket is already connected"},{errno:20,code:"EMFILE",description:"too many open files"},{errno:21,code:"EMSGSIZE",description:"message too long"},{errno:22,code:"ENETDOWN",description:"network is down"},{errno:23,code:"ENETUNREACH",description:"network is unreachable"},{errno:24,code:"ENFILE",description:"file table overflow"},{errno:25,code:"ENOBUFS",description:"no buffer space available"},{errno:26,code:"ENOMEM",description:"not enough memory"},{errno:27,code:"ENOTDIR",description:"not a directory"},{errno:28,code:"EISDIR",description:"illegal operation on a directory"},{errno:29,code:"ENONET",description:"machine is not on the network"},{errno:31,code:"ENOTCONN",description:"socket is not connected"},{errno:32,code:"ENOTSOCK",description:"socket operation on non-socket"},{errno:33,code:"ENOTSUP",description:"operation not supported on socket"},{errno:34,code:"ENOENT",description:"no such file or directory"},{errno:35,code:"ENOSYS",description:"function not implemented"},{errno:36,code:"EPIPE",description:"broken pipe"},{errno:37,code:"EPROTO",description:"protocol error"},{errno:38,code:"EPROTONOSUPPORT",description:"protocol not supported"},{errno:39,code:"EPROTOTYPE",description:"protocol wrong type for socket"},{errno:40,code:"ETIMEDOUT",description:"connection timed out"},{errno:41,code:"ECHARSET",description:"invalid Unicode character"},{errno:42,code:"EAIFAMNOSUPPORT",description:"address family for hostname not supported"},{errno:44,code:"EAISERVICE", +description:"servname not supported for ai_socktype"},{errno:45,code:"EAISOCKTYPE",description:"ai_socktype not supported"},{errno:46,code:"ESHUTDOWN",description:"cannot send after transport endpoint shutdown"},{errno:47,code:"EEXIST",description:"file already exists"},{errno:48,code:"ESRCH",description:"no such process"},{errno:49,code:"ENAMETOOLONG",description:"name too long"},{errno:50,code:"EPERM",description:"operation not permitted"},{errno:51,code:"ELOOP",description:"too many symbolic links encountered"},{errno:52,code:"EXDEV",description:"cross-device link not permitted"},{errno:53,code:"ENOTEMPTY",description:"directory not empty"},{errno:54,code:"ENOSPC",description:"no space left on device"},{errno:55,code:"EIO",description:"i/o error"},{errno:56,code:"EROFS",description:"read-only file system"},{errno:57,code:"ENODEV",description:"no such device"},{errno:58,code:"ESPIPE",description:"invalid seek"},{errno:59,code:"ECANCELED",description:"operation canceled"}];module.exports.errno={},module.exports.code={},all.forEach(function(error){module.exports.errno[error.errno]=error,module.exports.code[error.code]=error}),module.exports.custom=__webpack_require__(362)(module.exports),module.exports.create=module.exports.custom.createError},function(module,exports){!function(name,context,definition){void 0!==module&&module.exports?module.exports=definition():context.prr=definition()}(0,this,function(){var setProperty="function"==typeof Object.defineProperty?function(obj,key,options){return Object.defineProperty(obj,key,options),obj}:function(obj,key,options){return obj[key]=options.value,obj},makeOptions=function(value,options){var oo="object"==typeof options,os=!oo&&"string"==typeof options,op=function(p){return oo?!!options[p]:!!os&&options.indexOf(p[0])>-1};return{enumerable:op("enumerable"),configurable:op("configurable"),writable:op("writable"),value:value}};return function(obj,key,value,options){var k;if(options=makeOptions(value,options),"object"==typeof key){for(k in key)Object.hasOwnProperty.call(key,k)&&(options.value=key[k],setProperty(obj,k,options));return obj}return setProperty(obj,key,options)}})},function(module,exports,__webpack_require__){(function(Buffer){const ethUtil=__webpack_require__(183),rlp=__webpack_require__(45);var Account=module.exports=function(data){var fields=[{name:"nonce",default:new Buffer([])},{name:"balance",default:new Buffer([])},{name:"stateRoot",length:32,default:ethUtil.SHA3_RLP},{name:"codeHash",length:32,default:ethUtil.SHA3_NULL}];ethUtil.defineProperties(this,fields,data)};Account.prototype.serialize=function(){return rlp.encode(this.raw)},Account.prototype.isContract=function(){return this.codeHash.toString("hex")!==ethUtil.SHA3_NULL_S},Account.prototype.getCode=function(state,cb){if(!this.isContract())return void cb(null,new Buffer([]));state.getRaw(this.codeHash,cb)},Account.prototype.setCode=function(trie,code,cb){var self=this;if(this.codeHash=ethUtil.sha3(code),this.codeHash.toString("hex")===ethUtil.SHA3_NULL_S)return void cb(null,new Buffer([]));trie.putRaw(this.codeHash,code,function(err){cb(err,self.codeHash)})},Account.prototype.getStorage=function(trie,key,cb){var t=trie.copy();t.root=this.stateRoot,t.get(key,cb)},Account.prototype.setStorage=function(trie,key,val,cb){var self=this,t=trie.copy();t.root=self.stateRoot,t.put(key,val,function(err){if(err)return cb();self.stateRoot=t.root,cb()})},Account.prototype.isEmpty=function(){return""===this.balance.toString("hex")&&""===this.nonce.toString("hex")&&this.stateRoot.toString("hex")===ethUtil.SHA3_RLP_S&&this.codeHash.toString("hex")===ethUtil.SHA3_NULL_S}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){const createKeccakHash=__webpack_require__(208),secp256k1=__webpack_require__(144),assert=__webpack_require__(9),rlp=__webpack_require__(45),BN=__webpack_require__(14),createHash=__webpack_require__(59);Object.assign(exports,__webpack_require__(184)),exports.MAX_INTEGER=new BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),exports.TWO_POW256=new BN("10000000000000000000000000000000000000000000000000000000000000000",16),exports.SHA3_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",exports.SHA3_NULL=Buffer.from(exports.SHA3_NULL_S,"hex"),exports.SHA3_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",exports.SHA3_RLP_ARRAY=Buffer.from(exports.SHA3_RLP_ARRAY_S,"hex"),exports.SHA3_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",exports.SHA3_RLP=Buffer.from(exports.SHA3_RLP_S,"hex"),exports.BN=BN,exports.rlp=rlp,exports.secp256k1=secp256k1,exports.zeros=function(bytes){return Buffer.allocUnsafe(bytes).fill(0)},exports.setLengthLeft=exports.setLength=function(msg,length,right){var buf=exports.zeros(length);return msg=exports.toBuffer(msg),right?msg.length0&&"0"===first.toString();)a=a.slice(1),first=a[0];return a},exports.toBuffer=function(v){if(!Buffer.isBuffer(v))if(Array.isArray(v))v=Buffer.from(v);else if("string"==typeof v)v=exports.isHexString(v)?Buffer.from(exports.padToEven(exports.stripHexPrefix(v)),"hex"):Buffer.from(v);else if("number"==typeof v)v=exports.intToBuffer(v);else if(null===v||void 0===v)v=Buffer.allocUnsafe(0);else{if(!v.toArray)throw new Error("invalid type");v=Buffer.from(v.toArray())}return v},exports.bufferToInt=function(buf){return new BN(exports.toBuffer(buf)).toNumber()},exports.bufferToHex=function(buf){return buf=exports.toBuffer(buf),"0x"+buf.toString("hex")},exports.fromSigned=function(num){return new BN(num).fromTwos(256)},exports.toUnsigned=function(num){return Buffer.from(num.toTwos(256).toArray())},exports.sha3=function(a,bits){return a=exports.toBuffer(a),bits||(bits=256),createKeccakHash("keccak"+bits).update(a).digest()},exports.sha256=function(a){return a=exports.toBuffer(a),createHash("sha256").update(a).digest()},exports.ripemd160=function(a,padded){a=exports.toBuffer(a);var hash=createHash("rmd160").update(a).digest();return padded===!0?exports.setLength(hash,32):hash},exports.rlphash=function(a){return exports.sha3(rlp.encode(a))},exports.isValidPrivate=function(privateKey){return secp256k1.privateKeyVerify(privateKey)},exports.isValidPublic=function(publicKey,sanitize){return 64===publicKey.length?secp256k1.publicKeyVerify(Buffer.concat([Buffer.from([4]),publicKey])):!!sanitize&&secp256k1.publicKeyVerify(publicKey)},exports.pubToAddress=exports.publicToAddress=function(pubKey,sanitize){return pubKey=exports.toBuffer(pubKey),sanitize&&64!==pubKey.length&&(pubKey=secp256k1.publicKeyConvert(pubKey,!1).slice(1)),assert(64===pubKey.length),exports.sha3(pubKey).slice(-20)};var privateToPublic=exports.privateToPublic=function(privateKey){return privateKey=exports.toBuffer(privateKey),secp256k1.publicKeyCreate(privateKey,!1).slice(1)};exports.importPublic=function(publicKey){return publicKey=exports.toBuffer(publicKey),64!==publicKey.length&&(publicKey=secp256k1.publicKeyConvert(publicKey,!1).slice(1)),publicKey},exports.ecsign=function(msgHash,privateKey){var sig=secp256k1.sign(msgHash,privateKey),ret={};return ret.r=sig.signature.slice(0,32),ret.s=sig.signature.slice(32,64),ret.v=sig.recovery+27,ret},exports.hashPersonalMessage=function(message){var prefix=exports.toBuffer("Ethereum Signed Message:\n"+message.length.toString());return exports.sha3(Buffer.concat([prefix,message]))},exports.ecrecover=function(msgHash,v,r,s){var signature=Buffer.concat([exports.setLength(r,32),exports.setLength(s,32)],64),recovery=v-27;if(0!==recovery&&1!==recovery)throw new Error("Invalid signature v value");var senderPubKey=secp256k1.recover(msgHash,signature,recovery);return secp256k1.publicKeyConvert(senderPubKey,!1).slice(1)},exports.toRpcSig=function(v,r,s){if(27!==v&&28!==v)throw new Error("Invalid recovery id");return exports.bufferToHex(Buffer.concat([exports.setLengthLeft(r,32),exports.setLengthLeft(s,32),exports.toBuffer(v-27)]))},exports.fromRpcSig=function(sig){if(sig=exports.toBuffer(sig),65!==sig.length)throw new Error("Invalid signature length");var v=sig[64];return v<27&&(v+=27),{v:v,r:sig.slice(0,32),s:sig.slice(32,64)}},exports.privateToAddress=function(privateKey){return exports.publicToAddress(privateToPublic(privateKey))},exports.isValidAddress=function(address){return/^0x[0-9a-fA-F]{40}$/i.test(address)},exports.toChecksumAddress=function(address){address=exports.stripHexPrefix(address).toLowerCase();for(var hash=exports.sha3(address).toString("hex"),ret="0x",i=0;i=8?address[i].toUpperCase():address[i];return ret},exports.isValidChecksumAddress=function(address){return exports.isValidAddress(address)&&exports.toChecksumAddress(address)===address},exports.generateAddress=function(from,nonce){return from=exports.toBuffer(from),nonce=new BN(nonce),nonce=nonce.isZero()?null:Buffer.from(nonce.toArray()),exports.rlphash([from,nonce]).slice(-20)},exports.isPrecompiled=function(address){var a=exports.unpad(address);return 1===a.length&&a[0]>0&&a[0]<5},exports.addHexPrefix=function(str){return"string"!=typeof str?str:exports.isHexPrefixed(str)?str:"0x"+str},exports.isValidSignature=function(v,r,s,homestead){const SECP256K1_N_DIV_2=new BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),SECP256K1_N=new BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===r.length&&32===s.length&&((27===v||28===v)&&(r=new BN(r),s=new BN(s),!(r.isZero()||r.gt(SECP256K1_N)||s.isZero()||s.gt(SECP256K1_N))&&(homestead!==!1||1!==new BN(s).cmp(SECP256K1_N_DIV_2))))},exports.baToJSON=function(ba){if(Buffer.isBuffer(ba))return"0x"+ba.toString("hex");if(ba instanceof Array){for(var array=[],i=0;i=v.length,"The field "+field.name+" must not have more "+field.length+" bytes")):field.allowZero&&0===v.length||!field.length||assert(field.length===v.length,"The field "+field.name+" must have byte length of "+field.length),self.raw[i]=v}self._fields.push(field.name),Object.defineProperty(self,field.name,{enumerable:!0,configurable:!0,get:getter,set:setter}),field.default&&(self[field.name]=field.default),field.alias&&Object.defineProperty(self,field.alias,{enumerable:!1,configurable:!0,set:setter,get:getter})}),data)if("string"==typeof data&&(data=Buffer.from(exports.stripHexPrefix(data),"hex")),Buffer.isBuffer(data)&&(data=rlp.decode(data)),Array.isArray(data)){if(data.length>self._fields.length)throw new Error("wrong number of fields in data");data.forEach(function(d,i){self[self._fields[i]]=exports.toBuffer(d)})}else{if("object"!=typeof data)throw new Error("invalid data");{const keys=Object.keys(data);fields.forEach(function(field){keys.indexOf(field.name)!==-1&&(self[field.name]=data[field.name]),keys.indexOf(field.alias)!==-1&&(self[field.alias]=data[field.alias])})}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var ethUtil=__webpack_require__(368),fees=__webpack_require__(206),BN=ethUtil.BN,N_DIV_2=new BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),Transaction=function(){function Transaction(data){_classCallCheck(this,Transaction),data=data||{};var fields=[{name:"nonce",length:32,allowLess:!0,default:new Buffer([])},{name:"gasPrice",length:32,allowLess:!0,default:new Buffer([])},{name:"gasLimit",alias:"gas",length:32,allowLess:!0,default:new Buffer([])},{name:"to",allowZero:!0,length:20,default:new Buffer([])},{name:"value",length:32,allowLess:!0,default:new Buffer([])},{name:"data",alias:"input",allowZero:!0,default:new Buffer([])},{name:"v",allowZero:!0,default:new Buffer([28])},{name:"r",length:32,allowZero:!0,allowLess:!0,default:new Buffer([])},{name:"s",length:32,allowZero:!0,allowLess:!0,default:new Buffer([])}];ethUtil.defineProperties(this,fields,data),Object.defineProperty(this,"from",{enumerable:!0,configurable:!0,get:this.getSenderAddress.bind(this)});var sigV=ethUtil.bufferToInt(this.v),chainId=Math.floor((sigV-35)/2);chainId<0&&(chainId=0),this._chainId=chainId||data.chainId||0,this._homestead=!0}return Transaction.prototype.toCreationAddress=function(){return""===this.to.toString("hex")},Transaction.prototype.hash=function(includeSignature){void 0===includeSignature&&(includeSignature=!0);var items=void 0;if(includeSignature)items=this.raw;else if(this._chainId>0){var raw=this.raw.slice();this.v=this._chainId,this.r=0,this.s=0,items=this.raw,this.raw=raw}else items=this.raw.slice(0,6);return ethUtil.rlphash(items)},Transaction.prototype.getChainId=function(){return this._chainId},Transaction.prototype.getSenderAddress=function(){if(this._from)return this._from;var pubkey=this.getSenderPublicKey();return this._from=ethUtil.publicToAddress(pubkey),this._from},Transaction.prototype.getSenderPublicKey=function(){if(!(this._senderPubKey&&this._senderPubKey.length||this.verifySignature()))throw new Error("Invalid Signature");return this._senderPubKey},Transaction.prototype.verifySignature=function(){var msgHash=this.hash(!1);if(this._homestead&&1===new BN(this.s).cmp(N_DIV_2))return!1;try{var v=ethUtil.bufferToInt(this.v);this._chainId>0&&(v-=2*this._chainId+8),this._senderPubKey=ethUtil.ecrecover(msgHash,v,this.r,this.s)}catch(e){return!1}return!!this._senderPubKey},Transaction.prototype.sign=function(privateKey){var msgHash=this.hash(!1),sig=ethUtil.ecsign(msgHash,privateKey);this._chainId>0&&(sig.v+=2*this._chainId+8),Object.assign(this,sig)},Transaction.prototype.getDataFee=function(){for(var data=this.raw[5],cost=new BN(0),i=0;i0&&errors.push(["gas limit is too low. Need at least "+this.getBaseFee()]),void 0===stringError||stringError===!1?0===errors.length:errors.join(" ")},Transaction}();module.exports=Transaction}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){const createKeccakHash=__webpack_require__(208),secp256k1=__webpack_require__(144),assert=__webpack_require__(9),rlp=__webpack_require__(45),BN=__webpack_require__(14),createHash=__webpack_require__(59);Object.assign(exports,__webpack_require__(184)),exports.MAX_INTEGER=new BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),exports.TWO_POW256=new BN("10000000000000000000000000000000000000000000000000000000000000000",16),exports.SHA3_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",exports.SHA3_NULL=Buffer.from(exports.SHA3_NULL_S,"hex"),exports.SHA3_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",exports.SHA3_RLP_ARRAY=Buffer.from(exports.SHA3_RLP_ARRAY_S,"hex"),exports.SHA3_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",exports.SHA3_RLP=Buffer.from(exports.SHA3_RLP_S,"hex"),exports.BN=BN,exports.rlp=rlp,exports.secp256k1=secp256k1,exports.zeros=function(bytes){return Buffer.allocUnsafe(bytes).fill(0)},exports.setLengthLeft=exports.setLength=function(msg,length,right){var buf=exports.zeros(length);return msg=exports.toBuffer(msg),right?msg.length0&&"0"===first.toString();)a=a.slice(1),first=a[0];return a},exports.toBuffer=function(v){if(!Buffer.isBuffer(v))if(Array.isArray(v))v=Buffer.from(v);else if("string"==typeof v)v=exports.isHexString(v)?Buffer.from(exports.padToEven(exports.stripHexPrefix(v)),"hex"):Buffer.from(v);else if("number"==typeof v)v=exports.intToBuffer(v);else if(null===v||void 0===v)v=Buffer.allocUnsafe(0);else{if(!v.toArray)throw new Error("invalid type");v=Buffer.from(v.toArray())}return v},exports.bufferToInt=function(buf){return new BN(exports.toBuffer(buf)).toNumber()},exports.bufferToHex=function(buf){return buf=exports.toBuffer(buf),"0x"+buf.toString("hex")},exports.fromSigned=function(num){return new BN(num).fromTwos(256)},exports.toUnsigned=function(num){return Buffer.from(num.toTwos(256).toArray())},exports.sha3=function(a,bits){return a=exports.toBuffer(a),bits||(bits=256),createKeccakHash("keccak"+bits).update(a).digest()},exports.sha256=function(a){return a=exports.toBuffer(a),createHash("sha256").update(a).digest()},exports.ripemd160=function(a,padded){a=exports.toBuffer(a);var hash=createHash("rmd160").update(a).digest();return padded===!0?exports.setLength(hash,32):hash},exports.rlphash=function(a){return exports.sha3(rlp.encode(a))},exports.isValidPrivate=function(privateKey){return secp256k1.privateKeyVerify(privateKey)},exports.isValidPublic=function(publicKey,sanitize){return 64===publicKey.length?secp256k1.publicKeyVerify(Buffer.concat([Buffer.from([4]),publicKey])):!!sanitize&&secp256k1.publicKeyVerify(publicKey)},exports.pubToAddress=exports.publicToAddress=function(pubKey,sanitize){return pubKey=exports.toBuffer(pubKey),sanitize&&64!==pubKey.length&&(pubKey=secp256k1.publicKeyConvert(pubKey,!1).slice(1)),assert(64===pubKey.length),exports.sha3(pubKey).slice(-20)};var privateToPublic=exports.privateToPublic=function(privateKey){return privateKey=exports.toBuffer(privateKey),secp256k1.publicKeyCreate(privateKey,!1).slice(1)};exports.importPublic=function(publicKey){return publicKey=exports.toBuffer(publicKey),64!==publicKey.length&&(publicKey=secp256k1.publicKeyConvert(publicKey,!1).slice(1)),publicKey},exports.ecsign=function(msgHash,privateKey){var sig=secp256k1.sign(msgHash,privateKey),ret={};return ret.r=sig.signature.slice(0,32),ret.s=sig.signature.slice(32,64),ret.v=sig.recovery+27,ret},exports.hashPersonalMessage=function(message){var prefix=exports.toBuffer("Ethereum Signed Message:\n"+message.length.toString());return exports.sha3(Buffer.concat([prefix,message]))},exports.ecrecover=function(msgHash,v,r,s){var signature=Buffer.concat([exports.setLength(r,32),exports.setLength(s,32)],64),recovery=v-27;if(0!==recovery&&1!==recovery)throw new Error("Invalid signature v value");var senderPubKey=secp256k1.recover(msgHash,signature,recovery);return secp256k1.publicKeyConvert(senderPubKey,!1).slice(1)},exports.toRpcSig=function(v,r,s){if(27!==v&&28!==v)throw new Error("Invalid recovery id");return exports.bufferToHex(Buffer.concat([exports.setLengthLeft(r,32),exports.setLengthLeft(s,32),exports.toBuffer(v-27)]))},exports.fromRpcSig=function(sig){if(sig=exports.toBuffer(sig),65!==sig.length)throw new Error("Invalid signature length");var v=sig[64];return v<27&&(v+=27),{v:v,r:sig.slice(0,32),s:sig.slice(32,64)}},exports.privateToAddress=function(privateKey){return exports.publicToAddress(privateToPublic(privateKey))},exports.isValidAddress=function(address){return/^0x[0-9a-fA-F]{40}$/i.test(address)},exports.toChecksumAddress=function(address){address=exports.stripHexPrefix(address).toLowerCase();for(var hash=exports.sha3(address).toString("hex"),ret="0x",i=0;i=8?address[i].toUpperCase():address[i];return ret},exports.isValidChecksumAddress=function(address){return exports.isValidAddress(address)&&exports.toChecksumAddress(address)===address},exports.generateAddress=function(from,nonce){return from=exports.toBuffer(from),nonce=new BN(nonce),nonce=nonce.isZero()?null:Buffer.from(nonce.toArray()),exports.rlphash([from,nonce]).slice(-20)},exports.isPrecompiled=function(address){var a=exports.unpad(address);return 1===a.length&&a[0]>0&&a[0]<5},exports.addHexPrefix=function(str){return"string"!=typeof str?str:exports.isHexPrefixed(str)?str:"0x"+str},exports.isValidSignature=function(v,r,s,homestead){const SECP256K1_N_DIV_2=new BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),SECP256K1_N=new BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===r.length&&32===s.length&&((27===v||28===v)&&(r=new BN(r),s=new BN(s),!(r.isZero()||r.gt(SECP256K1_N)||s.isZero()||s.gt(SECP256K1_N))&&(homestead!==!1||1!==new BN(s).cmp(SECP256K1_N_DIV_2))))},exports.baToJSON=function(ba){if(Buffer.isBuffer(ba))return"0x"+ba.toString("hex");if(ba instanceof Array){for(var array=[],i=0;i=v.length,"The field "+field.name+" must not have more "+field.length+" bytes")):field.allowZero&&0===v.length||!field.length||assert(field.length===v.length,"The field "+field.name+" must have byte length of "+field.length),self.raw[i]=v}self._fields.push(field.name),Object.defineProperty(self,field.name,{enumerable:!0,configurable:!0,get:getter,set:setter}),field.default&&(self[field.name]=field.default),field.alias&&Object.defineProperty(self,field.alias,{enumerable:!1,configurable:!0,set:setter,get:getter})}),data)if("string"==typeof data&&(data=Buffer.from(exports.stripHexPrefix(data),"hex")),Buffer.isBuffer(data)&&(data=rlp.decode(data)),Array.isArray(data)){if(data.length>self._fields.length)throw new Error("wrong number of fields in data");data.forEach(function(d,i){self[self._fields[i]]=exports.toBuffer(d)})}else{if("object"!=typeof data)throw new Error("invalid data");{const keys=Object.keys(data);fields.forEach(function(field){keys.indexOf(field.name)!==-1&&(self[field.name]=data[field.name]),keys.indexOf(field.alias)!==-1&&(self[field.alias]=data[field.alias])})}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function fsmEvent(start,events){function on(event,cb){emitter.on(event,cb)}function emit(str){function enter(){emitter._events[enterEv]?emitter.emit(enterEv,done):done()}function done(){emit._state=nwState,emitter.emit(nwState),emitter.emit("done")}const nwState=emit._events[emit._state][str];if(!reach(emit._state,nwState,emit._graph)){const err="invalid transition: "+emit._state+" -> "+str;return emitter.emit("error",err)}const leaveEv=emit._state+":leave",enterEv=nwState+":enter";return emit._state?function(){emitter._events[leaveEv]?emitter.emit(leaveEv,enter):enter()}():enter()}"object"==typeof start&&(events=start,start="START"),assert.equal(typeof start,"string"),assert.equal(typeof events,"object"),assert.ok(events[start],"invalid starting state "+start),assert.ok(fsm.validate(events));const emitter=new EventEmitter;return emit._graph=fsm.reachable(events),emit._emitter=emitter,emit._events=events,emit._state=start,emit.emit=emit,emit.on=on,emit}function reach(curr,next,reachable){if(!next)return!1;if(!curr)return!0;const here=reachable[curr];return!(!here||!here[next])&&1===here[next].length}const EventEmitter=__webpack_require__(11).EventEmitter,assert=__webpack_require__(9),fsm=__webpack_require__(370);module.exports=fsmEvent},function(module,exports){function each(obj,iter){for(var key in obj){iter(obj[key],key,obj)}}function keys(obj){return Object.keys(obj).sort()}function contains(a,v){return~a.indexOf(v)}function union(a,b){return a.filter(function(v){return contains(b,v)})}function disunion(a,b){return a.filter(function(v){return!contains(b,v)}).concat(b.filter(function(v){return!contains(a,v)})).sort()}function empty(v){for(var k in v)return!1;return!0}function events(fsm){var events=[];return each(fsm,function(state,name){each(state,function(_state,event){contains(events,event)||events.push(event)})}),events.sort()}var reachable=(exports.validate=function(fsm){Object.keys(fsm);return each(fsm,function(state,name){each(state,function(_state,event){if(!fsm[_state])throw new Error("invalid transition from state:"+name+" to state:"+_state+" on event:"+event)})}),!0},exports.reachable=function(fsm){var reachable={},added=!1;do{added=!1,each(fsm,function(state,name){var reach=reachable[name]=reachable[name]||{};each(state,function(_name,event){reach[_name]||(reach[_name]=[event],added=!0)}),each(state,function(_name,event){each(reachable[_name],function(path,_name){reach[_name]||(reach[_name]=[event].concat(path),added=!0)})})})}while(added);return reachable});exports.terminal=exports.deadlock=function(fsm){var dead=[];return each(fsm,function(state,name){empty(state)&&dead.push(name)}),dead};exports.livelock=function(fsm,terminals){var reach=reachable(fsm),locked=[];return each(reach,function(reaches,name){contains(terminals,name)||each(terminals,function(_name){reaches[_name]||contains(locked,name)||locked.push(name)})}),locked.sort()},exports.combine=function(fsm1,fsm2,start1,start2){function expand(name1,name2){var state,cName=name1+"-"+name2;combined[cName]||(combined[cName]={}),state=combined[cName];var trans1=keys(fsm1[name1]),trans2=keys(fsm2[name2]);return union(trans1,trans2).forEach(function(event){state[event]=fsm1[name1][event]+"-"+fsm2[name2][event],combined[state[event]]||expand(fsm1[name1][event],fsm2[name2][event])}),union(independent,trans1).forEach(function(event){state[event]=fsm1[name1][event]+"-"+name2,combined[state[event]]||expand(fsm1[name1][event],name2)}),union(independent,trans2).forEach(function(event){state[event]=name1+"-"+fsm2[name2][event],combined[state[event]]||expand(name1,fsm2[name2][event])}),combined[cName]}var combined={},events1=events(fsm1),events2=events(fsm2),independent=disunion(events1,events2);return expand(start1,start2),combined}},function(module,exports,__webpack_require__){var util=__webpack_require__(32),INDENT_START=/[\{\[]/,INDENT_END=/[\}\]]/;module.exports=function(){var lines=[],indent=0,push=function(str){for(var spaces="";spaces.length<2*indent;)spaces+=" ";lines.push(spaces+str)},line=function(fmt){return fmt?INDENT_END.test(fmt.trim()[0])&&INDENT_START.test(fmt[fmt.length-1])?(indent--,push(util.format.apply(util,arguments)),indent++,line):INDENT_START.test(fmt[fmt.length-1])?(push(util.format.apply(util,arguments)),indent++,line):INDENT_END.test(fmt.trim()[0])?(indent--,push(util.format.apply(util,arguments)),line):(push(util.format.apply(util,arguments)),line):line};return line.toString=function(){return lines.join("\n")},line.toFunction=function(scope){var src="return ("+line.toString()+")",keys=Object.keys(scope||{}).map(function(key){return key}),vals=keys.map(function(key){return scope[key]});return Function.apply(null,keys.concat(src)).apply(null,vals)},arguments.length&&line.apply(null,arguments),line}},function(module,exports,__webpack_require__){var isProperty=__webpack_require__(449),gen=function(obj,prop){return isProperty(prop)?obj+"."+prop:obj+"["+JSON.stringify(prop)+"]"};gen.valid=isProperty,gen.property=function(prop){return isProperty(prop)?prop:JSON.stringify(prop)},module.exports=gen},function(module,exports){module.exports=function(){if("undefined"==typeof window)return null;var wrtc={RTCPeerConnection:window.RTCPeerConnection||window.mozRTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.RTCSessionDescription||window.mozRTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.RTCIceCandidate||window.mozRTCIceCandidate||window.webkitRTCIceCandidate};return wrtc.RTCPeerConnection?wrtc:null}},function(module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return"[object Array]"==toString.call(arr)}},function(module,exports){try{module.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(err){module.exports=!1}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function HashBase(blockSize){Transform.call(this),this._block=new Buffer(blockSize),this._blockSize=blockSize,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}var Transform=__webpack_require__(25).Transform;__webpack_require__(1)(HashBase,Transform),HashBase.prototype._transform=function(chunk,encoding,callback){var error=null;try{"buffer"!==encoding&&(chunk=new Buffer(chunk,encoding)),this.update(chunk)}catch(err){error=err}callback(error)},HashBase.prototype._flush=function(callback){var error=null;try{this.push(this._digest())}catch(err){error=err}callback(error)},HashBase.prototype.update=function(data,encoding){if(!Buffer.isBuffer(data)&&"string"!=typeof data)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");Buffer.isBuffer(data)||(data=new Buffer(data,encoding||"binary"));for(var block=this._block,offset=0;this._blockOffset+data.length-offset>=this._blockSize;){for(var i=this._blockOffset;i0;++j)this._length[j]+=carry,(carry=this._length[j]/4294967296|0)>0&&(this._length[j]-=4294967296*carry);return this},HashBase.prototype._update=function(data){throw new Error("_update is not implemented")},HashBase.prototype.digest=function(encoding){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var digest=this._digest();return void 0!==encoding&&(digest=digest.toString(encoding)),digest},HashBase.prototype._digest=function(){throw new Error("_digest is not implemented")},module.exports=HashBase}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function Hmac(hash,key,enc){if(!(this instanceof Hmac))return new Hmac(hash,key,enc);this.Hash=hash,this.blockSize=hash.blockSize/8,this.outSize=hash.outSize/8,this.inner=null,this.outer=null,this._init(utils.toArray(key,enc))}var utils=__webpack_require__(27),assert=__webpack_require__(34);module.exports=Hmac,Hmac.prototype._init=function(key){key.length>this.blockSize&&(key=(new this.Hash).update(key).digest()),assert(key.length<=this.blockSize);for(var i=key.length;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(entropy,nonce,pers)}var hash=__webpack_require__(113),utils=__webpack_require__(236),assert=__webpack_require__(34);module.exports=HmacDRBG,HmacDRBG.prototype._init=function(entropy,nonce,pers){var seed=entropy.concat(nonce).concat(pers);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(entropy.concat(add||[])),this._reseed=1},HmacDRBG.prototype.generate=function(len,enc,add,addEnc){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof enc&&(addEnc=add,add=enc,enc=null),add&&(add=utils.toArray(add,addEnc||"hex"),this._update(add));for(var temp=[];temp.length{return err?callback(err):exists?void callback(null,this.data[key.toString()]):callback(new Error("No value"))})}has(key,callback){setImmediate(()=>{callback(null,void 0!==this.data[key.toString()])})}delete(key,callback){delete this.data[key.toString()],setImmediate(()=>{callback()})}batch(){let puts=[],dels=[];return{put(key,value){puts.push([key,value])},delete(key){dels.push(key)},commit:callback=>{puts.forEach(v=>{this.data[v[0].toString()]=v[1]}),puts=[],dels.forEach(key=>{delete this.data[key.toString()]}),dels=[],setImmediate(callback)}}}query(q){let tasks=[pull.keys(this.data),pull.map(k=>({key:new Key(k),value:this.data[k]}))],filters=[];if(null!=q.prefix){const prefix=q.prefix;filters.push((e,cb)=>cb(null,e.key.toString().startsWith(prefix)))}if(null!=q.filters&&(filters=filters.concat(q.filters)),tasks=tasks.concat(filters.map(f=>asyncFilter(f))),null!=q.orders&&(tasks=tasks.concat(q.orders.map(o=>asyncSort(o)))),null!=q.offset){let i=0;tasks.push(pull.filter(()=>i++>=q.offset))}return null!=q.limit&&tasks.push(pull.take(q.limit)),q.keysOnly===!0&&tasks.push(pull.map(e=>({key:e.key}))),pull.apply(null,tasks)}close(callback){setImmediate(callback)}}module.exports=MemoryDatastore},function(module,exports,__webpack_require__){"use strict";function _normalizeFamily(family){return family?family.toLowerCase():"ipv4"}var ip=exports,Buffer=__webpack_require__(0).Buffer,os=__webpack_require__(243);ip.toBuffer=function(ip,buff,offset){offset=~~offset;var result;if(this.isV4Format(ip))result=buff||new Buffer(offset+4),ip.split(/\./g).map(function(byte){result[offset++]=255&parseInt(byte,10)});else if(this.isV6Format(ip)){var i,sections=ip.split(":",8);for(i=0;i0;i--)argv.push("0");sections.splice.apply(sections,argv)}for(result=buff||new Buffer(offset+16),i=0;i>8&255,result[offset++]=255&word}}if(!result)throw Error("Invalid ip address: "+ip);return result},ip.toString=function(buff,offset,length){offset=~~offset,length=length||buff.length-offset;var result=[];if(4===length){for(var i=0;i32?"ipv6":_normalizeFamily(family);var len=4;"ipv6"===family&&(len=16);for(var buff=new Buffer(len),i=0,n=buff.length;i>bits)}return ip.toString(buff)},ip.mask=function(addr,mask){addr=ip.toBuffer(addr),mask=ip.toBuffer(mask);var result=new Buffer(Math.max(addr.length,mask.length)),i=0;if(addr.length===mask.length)for(i=0;ia.length&&(buff=b,other=a);for(var offset=buff.length-other.length,i=offset;i>>0},ip.fromLong=function(ipl){return(ipl>>>24)+"."+(ipl>>16&255)+"."+(ipl>>8&255)+"."+(255&ipl)}},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),each=__webpack_require__(19),eachSeries=__webpack_require__(71),waterfall=__webpack_require__(7),map=__webpack_require__(73),debounce=__webpack_require__(227),uniqWith=__webpack_require__(532),find=__webpack_require__(521),values=__webpack_require__(129),groupBy=__webpack_require__(523),pullAllWith=__webpack_require__(527),log=debug("bitswap:engine");log.error=debug("bitswap:engine:error");const Message=__webpack_require__(83),Wantlist=__webpack_require__(84),Ledger=__webpack_require__(389);class DecisionEngine{constructor(blockstore,network){this.blockstore=blockstore,this.network=network,this.ledgerMap=new Map,this._running=!1,this._tasks=[],this._outbox=debounce(this._processTasks.bind(this),100)}_sendBlocks(env,cb){const blocks=env.blocks;if(blocks.reduce((acc,b)=>{return acc+b.data.byteLength},0)<524288)return this._sendSafeBlocks(env.peer,blocks,cb);let size=0,batch=[];eachSeries(blocks,(b,cb)=>{if(batch.push(b),(size+=b.data.byteLength)>=524288){const nextBatch=batch.slice();batch=[],this._sendSafeBlocks(env.peer,nextBatch,cb)}else cb()},cb)}_sendSafeBlocks(peer,blocks,cb){const msg=new Message(!1);blocks.forEach(b=>{msg.addBlock(b)}),this.network.sendMessage(peer,msg,err=>{err&&log("sendblock error: %s",err.message),cb()})}_processTasks(){if(this._running&&this._tasks.length){const tasks=this._tasks;this._tasks=[];const entries=tasks.map(t=>t.entry),cids=entries.map(e=>e.cid),uniqCids=uniqWith(cids,(a,b)=>a.equals(b)),groupedTasks=groupBy(tasks,task=>task.target.toB58String());waterfall([cb=>map(uniqCids,(cid,cb)=>{this.blockstore.get(cid,cb)},cb),(blocks,cb)=>each(values(groupedTasks),(tasks,cb)=>{const peer=tasks[0].target,blockList=cids.map(cid=>{return find(blocks,b=>b.cid.equals(cid))});this._sendBlocks({peer:peer,blocks:blockList},err=>{err&&log.error("failed to send",err),blockList.forEach(block=>{this.messageSent(peer,block)}),cb()})})],err=>{this._tasks=[],err&&log.error(err)})}}wantlistForPeer(peerId){const peerIdStr=peerId.toB58String();return this.ledgerMap.has(peerIdStr)?this.ledgerMap.get(peerIdStr).wantlist.sortedEntries():new Map}peers(){return Array.from(this.ledgerMap.values()).map(l=>l.partner)}receivedBlocks(cids){cids.length&&(this.ledgerMap.forEach(ledger=>{cids.map(cid=>ledger.wantlistContains(cid)).filter(Boolean).forEach(entry=>{this._tasks.push({entry:entry,target:ledger.partner})})}),this._outbox())}messageReceived(peerId,msg,cb){const ledger=this._findOrCreate(peerId);if(msg.empty)return cb();if(msg.full&&(ledger.wantlist=new Wantlist),this._processBlocks(msg.blocks,ledger),0===msg.wantlist.size)return cb();let cancels=[],wants=[];msg.wantlist.forEach(entry=>{entry.cancel?(ledger.cancelWant(entry.cid),cancels.push(entry)):(ledger.wants(entry.cid,entry.priority),wants.push(entry))}),this._cancelWants(ledger,peerId,cancels),this._addWants(ledger,peerId,wants,cb)}_cancelWants(ledger,peerId,entries){const id=peerId.toB58String();pullAllWith(this._tasks,entries,(t,e)=>{const sameTarget=t.target.toB58String()===id,sameCid=t.entry.cid.equals(e.cid);return sameTarget&&sameCid})}_addWants(ledger,peerId,entries,cb){each(entries,(entry,cb)=>{this.blockstore.has(entry.cid,(err,exists)=>{err?log.error("failed existence check"):exists&&this._tasks.push({entry:entry.entry,target:peerId}),cb()})},()=>{this._outbox(),cb()})}_processBlocks(blocks,ledger,callback){const cids=[];blocks.forEach((b,cidStr)=>{log("got block (%s bytes)",b.data.length),ledger.receivedBytes(b.data.length),cids.push(b.cid)}),this.receivedBlocks(cids)}messageSent(peerId,block){const ledger=this._findOrCreate(peerId);ledger.sentBytes(block?block.data.length:0),block&&block.cid&&ledger.wantlist.remove(block.cid)}numBytesSentTo(peerId){return this._findOrCreate(peerId).accounting.bytesSent}numBytesReceivedFrom(peerId){return this._findOrCreate(peerId).accounting.bytesRecv}peerDisconnected(peerId){}_findOrCreate(peerId){const peerIdStr=peerId.toB58String();if(this.ledgerMap.has(peerIdStr))return this.ledgerMap.get(peerIdStr);const l=new Ledger(peerId);return this.ledgerMap.set(peerIdStr,l),l}start(){this._running=!0}stop(){this._running=!1}}module.exports=DecisionEngine},function(module,exports,__webpack_require__){"use strict";const Wantlist=__webpack_require__(84);class Ledger{constructor(peerId){this.partner=peerId,this.wantlist=new Wantlist,this.exchangeCount=0,this.sentToPeer=new Map,this.accounting={bytesSent:0,bytesRecv:0}}sentBytes(n){this.exchangeCount++,this.lastExchange=(new Date).getTime(),this.accounting.bytesSent+=n}receivedBytes(n){this.exchangeCount++,this.lastExchange=(new Date).getTime(),this.accounting.bytesRecv+=n}wants(cid,priority){this.wantlist.add(cid,priority)}cancelWant(cid){this.wantlist.remove(cid)}wantlistContains(cid){return this.wantlist.contains(cid)}}module.exports=Ledger},function(module,exports,__webpack_require__){"use strict";function writeMessage(conn,msg,callback){pull(pull.values([msg]),lp.encode(),conn,pull.onEnd(callback))}const debug=__webpack_require__(3),lp=__webpack_require__(23),pull=__webpack_require__(4),setImmediate=__webpack_require__(10),Message=__webpack_require__(83),CONSTANTS=__webpack_require__(116),log=debug("bitswap:network");log.error=debug("bitswap:network:error");const BITSWAP100="/ipfs/bitswap/1.0.0",BITSWAP110="/ipfs/bitswap/1.1.0";class Network{constructor(libp2p,peerBook,bitswap,b100Only){this.libp2p=libp2p,this.peerBook=peerBook,this.bitswap=bitswap,this.b100Only=b100Only||!1,this._running=!1,this.libp2p.swarm.setMaxListeners(CONSTANTS.maxListeners)}start(){this._running=!0,this._onPeerConnect=this._onPeerConnect.bind(this),this._onPeerDisconnect=this._onPeerDisconnect.bind(this),this._onConnection=this._onConnection.bind(this),this.libp2p.handle(BITSWAP100,this._onConnection),this.b100Only||this.libp2p.handle(BITSWAP110,this._onConnection),this.libp2p.on("peer:connect",this._onPeerConnect),this.libp2p.on("peer:disconnect",this._onPeerDisconnect),Object.keys(this.peerBook.getAll()).forEach(k=>this._onPeerConnect(this.peerBook.get(k)))}stop(){this._running=!1,this.libp2p.unhandle(BITSWAP100),this.b100Only||this.libp2p.unhandle(BITSWAP110),this.libp2p.removeListener("peer:connect",this._onPeerConnect),this.libp2p.removeListener("peer:disconnect",this._onPeerDisconnect)}_onConnection(protocol,conn){this._running&&(log("incomming new bitswap connection: %s",protocol),pull(conn,lp.decode(),pull.asyncMap((data,cb)=>Message.deserialize(data,cb)),pull.asyncMap((msg,cb)=>{conn.getPeerInfo((err,peerInfo)=>{if(err)return cb(err);this.bitswap._receiveMessage(peerInfo.id,msg,cb)})}),pull.onEnd(err=>{if(log("ending connection"),err)return this.bitswap._receiveError(err)})))}_onPeerConnect(peerInfo){this._running&&this.bitswap._onPeerConnected(peerInfo.id)}_onPeerDisconnect(peerInfo){this._running&&this.bitswap._onPeerDisconnected(peerInfo.id)}connectTo(peerId,callback){const done=err=>setImmediate(()=>callback(err));if(!this._running)return done(new Error("No running network"));this.libp2p.swarm.muxedConns[peerId.toB58String()]?done():done(new Error("Could not connect to peer with peerId:",peerId.toB58String()))}sendMessage(peerId,msg,callback){if(!this._running)return callback(new Error("No running network"));const stringId=peerId.toB58String();log("sendMessage to %s",stringId,msg);let peerInfo;try{peerInfo=this.peerBook.get(stringId)}catch(err){return callback(err)}this._dialPeer(peerInfo,(err,conn,protocol)=>{if(err)return callback(err);let serialized;switch(protocol){case BITSWAP100:serialized=msg.serializeToBitswap100();break;case BITSWAP110:serialized=msg.serializeToBitswap110();break;default:return callback(new Error("Unkown protocol: "+protocol))}writeMessage(conn,serialized,err=>{err&&log(err)}),callback()})}_dialPeer(peerInfo,callback){try{this.libp2p.dial(peerInfo,BITSWAP110,(err,conn)=>{if(err)return void this.libp2p.dial(peerInfo,BITSWAP100,(err,conn)=>{if(err)return callback(err);callback(null,conn,BITSWAP100)});callback(null,conn,BITSWAP110)})}catch(err){return callback(err)}}}module.exports=Network},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),Message=__webpack_require__(83),Wantlist=__webpack_require__(84),CONSTANTS=__webpack_require__(116),MsgQueue=__webpack_require__(392),log=debug("bitswap:wantmanager");log.error=debug("bitswap:wantmanager:error"),module.exports=class WantManager{constructor(network){this.peers=new Map,this.wantlist=new Wantlist,this.network=network}_addEntries(cids,cancel,force){const entries=cids.map((cid,i)=>{return new Message.Entry(cid,CONSTANTS.kMaxPriority-i,cancel)});entries.forEach(e=>{e.cancel?force?this.wantlist.removeForce(e.cid):this.wantlist.remove(e.cid):(log("adding to wl"),this.wantlist.add(e.cid,e.priority))});for(let p of this.peers.values())p.addEntries(entries)}_startPeerHandler(peerId){let mq=this.peers.get(peerId.toB58String());if(mq)return void mq.refcnt++;mq=new MsgQueue(peerId,this.network);const fullwantlist=new Message(!0);for(let entry of this.wantlist.entries())fullwantlist.addEntry(entry[1].cid,entry[1].priority);return mq.addMessage(fullwantlist),this.peers.set(peerId.toB58String(),mq),mq}_stopPeerHandler(peerId){const mq=this.peers.get(peerId.toB58String());mq&&(--mq.refcnt>0||this.peers.delete(peerId.toB58String()))}wantBlocks(cids){this._addEntries(cids,!1)}unwantBlocks(cids){log("unwant blocks: %s",cids.length),this._addEntries(cids,!0,!0)}cancelWants(cids){log("cancel wants: %s",cids.length),this._addEntries(cids,!0)}connectedPeers(){return Array.from(this.peers.keys())}connected(peerId){this._startPeerHandler(peerId)}disconnected(peerId){this._stopPeerHandler(peerId)}run(){this.timer=setInterval(()=>{const fullwantlist=new Message(!0);for(let entry of this.wantlist.entries())fullwantlist.addEntry(entry[1].cid,entry[1].priority);this.peers.forEach(p=>{p.addMessage(fullwantlist)})},1e4)}stop(){for(let mq of this.peers.values())this.disconnected(mq.peerId);clearInterval(this.timer)}}},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),debounce=__webpack_require__(227),Message=__webpack_require__(83),log=debug("bitswap:wantmanager:queue");log.error=debug("bitswap:wantmanager:queue:error"),module.exports=class MsgQueue{constructor(peerId,network){this.peerId=peerId,this.network=network,this.refcnt=1,this._entries=[],this.sendEntries=debounce(this._sendEntries.bind(this),200)}addMessage(msg){msg.empty||this.send(msg)}addEntries(entries){this._entries=this._entries.concat(entries),this.sendEntries()}_sendEntries(){if(this._entries.length){const msg=new Message(!1);this._entries.forEach(entry=>{entry.cancel?msg.cancel(entry.cid):msg.addEntry(entry.cid,entry.priority)}),this._entries=[],this.addMessage(msg)}}send(msg){this.network.connectTo(this.peerId,err=>{if(err)return void log.error("cant connect to peer %s: %s",this.peerId.toB58String(),err.message);log("sending message"),this.network.sendMessage(this.peerId,msg,err=>{err&&log.error("send error: %s",err.message)})})}}},function(module,exports,__webpack_require__){"use strict";const waterfall=__webpack_require__(7),reject=__webpack_require__(160),each=__webpack_require__(19),EventEmitter=__webpack_require__(11).EventEmitter,debug=__webpack_require__(3),CONSTANTS=__webpack_require__(116),WantManager=__webpack_require__(391),Network=__webpack_require__(390),DecisionEngine=__webpack_require__(388),log=debug("bitswap");log.error=debug("bitswap:error");class Bitswap{constructor(libp2p,blockstore,peerBook){this.libp2p=libp2p,this.network=new Network(libp2p,peerBook,this),this.blockstore=blockstore,this.engine=new DecisionEngine(blockstore,this.network),this.wm=new WantManager(this.network),this.blocksRecvd=0,this.dupBlocksRecvd=0,this.dupDataRecvd=0,this.notifications=new EventEmitter,this.notifications.setMaxListeners(CONSTANTS.maxListeners)}_receiveMessage(peerId,incoming,callback){this.engine.messageReceived(peerId,incoming,err=>{if(err&&log("failed to receive message",incoming),0===incoming.blocks.size)return callback();const blocks=Array.from(incoming.blocks.values()),toCancel=blocks.filter(b=>this.wm.wantlist.contains(b.cid)).map(b=>b.cid);this.wm.cancelWants(toCancel),each(blocks,(b,cb)=>this._handleReceivedBlock(peerId,b,cb),callback)})}_handleReceivedBlock(peerId,block,callback){log("received block"),waterfall([cb=>this.blockstore.has(block.cid,cb),(has,cb)=>{if(this._updateReceiveCounters(block,has),has)return cb();this._putBlock(block,cb)}],callback)}_updateReceiveCounters(block,exists){this.blocksRecvd++,exists&&(this.dupBlocksRecvd++,this.dupDataRecvd+=block.data.length)}_receiveError(err){log.error("ReceiveError: %s",err.message)}_onPeerConnected(peerId){this.wm.connected(peerId)}_onPeerDisconnected(peerId){this.wm.disconnected(peerId),this.engine.peerDisconnected(peerId)}_putBlock(block,callback){this.blockstore.put(block,err=>{if(err)return callback(err);this.notifications.emit(`block:${block.cid.buffer.toString()}`,block),this.engine.receivedBlocks([block.cid]),callback()})}wantlistForPeer(peerId){return this.engine.wantlistForPeer(peerId)}get(cid,callback){const unwantListeners={},blockListeners={},cidStr=cid.buffer.toString(),unwantEvent=`unwant:${cidStr}`,blockEvent=`block:${cidStr}`;log("get: %s",cidStr);const cleanupListener=()=>{ +unwantListeners[cidStr]&&(this.notifications.removeListener(unwantEvent,unwantListeners[cidStr]),delete unwantListeners[cidStr]),blockListeners[cidStr]&&(this.notifications.removeListener(blockEvent,blockListeners[cidStr]),delete blockListeners[cidStr])},addListener=()=>{unwantListeners[cidStr]=(()=>{log(`manual unwant: ${cidStr}`),cleanupListener(),this.wm.cancelWants([cid]),callback()}),blockListeners[cidStr]=(block=>{this.wm.cancelWants([cid]),cleanupListener(cid),callback(null,block)}),this.notifications.once(unwantEvent,unwantListeners[cidStr]),this.notifications.once(blockEvent,blockListeners[cidStr])};this.blockstore.has(cid,(err,has)=>{return err?callback(err):has?(log("already have block: %s",cidStr),this.blockstore.get(cid,callback)):(addListener(),void this.wm.wantBlocks([cid]))})}unwant(cids){Array.isArray(cids)||(cids=[cids]),this.wm.unwantBlocks(cids),cids.forEach(cid=>{this.notifications.emit(`unwant:${cid.buffer.toString()}`)})}cancelWants(cids){Array.isArray(cids)||(cids=[cids]),this.wm.cancelWants(cids)}put(block,callback){log("putting block"),waterfall([cb=>this.blockstore.has(block.cid,cb),(has,cb)=>{if(has)return cb();this._putBlock(block,cb)}],callback)}putMany(blocks,callback){waterfall([cb=>reject(blocks,(b,cb)=>{this.blockstore.has(b.cid,cb)},cb),(newBlocks,cb)=>this.blockstore.putMany(newBlocks,err=>{if(err)return cb(err);newBlocks.forEach(block=>{this.notifications.emit(`block:${block.cid.buffer.toString()}`,block),this.engine.receivedBlocks([block.cid])}),cb()})],callback)}getWantlist(){return this.wm.wantlist.entries()}stat(){return{wantlist:this.getWantlist(),blocksReceived:this.blocksRecvd,dupBlksReceived:this.dupBlocksRecvd,dupDataReceived:this.dupDataRecvd,peers:this.engine.peers()}}start(){this.wm.run(),this.network.start(),this.engine.start()}stop(){this.wm.stop(this.libp2p.peerInfo.id),this.network.stop(),this.engine.stop()}}module.exports=Bitswap},function(module,exports,__webpack_require__){"use strict";const WantlistEntry=__webpack_require__(84).Entry,CID=__webpack_require__(8),assert=__webpack_require__(9);module.exports=class BitswapMessageEntry{constructor(cid,priority,cancel){assert(CID.isCID(cid),"needs valid cid"),this.entry=new WantlistEntry(cid,priority),this.cancel=Boolean(cancel)}get cid(){return this.entry.cid}set cid(cid){this.entry.cid=cid}get priority(){return this.entry.priority}set priority(val){this.entry.priority=val}get[Symbol.toStringTag](){return`BitswapMessageEntry ${this.cid.toBaseEncodedString()} `}equals(other){return this.cancel===other.cancel&&this.entry.equals(other.entry)}}},function(module,exports,__webpack_require__){"use strict";module.exports=` message Message { message Wantlist { message Entry { @@ -114,8 +107,8 @@ currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length& repeated bytes blocks = 2; // used to send Blocks in bitswap 1.0.0 repeated Block payload = 3; // used to send Blocks in bitswap 1.1.0 } -`},function(module,exports,__webpack_require__){"use strict";const assert=__webpack_require__(7),CID=__webpack_require__(12);class WantListEntry{constructor(cid,priority){assert(CID.isCID(cid),"must be valid CID"),this._refCounter=1,this.cid=cid,this.priority=priority||1}inc(){this._refCounter+=1}dec(){this._refCounter=Math.max(0,this._refCounter-1)}hasRefs(){return this._refCounter>0}get[Symbol.toStringTag](){return`WantlistEntry `}equals(other){return this._refCounter===other._refCounter&&this.cid.equals(other.cid)&&this.priority===other.priority}}module.exports=WantListEntry},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(17),multibase=__webpack_require__(43),multicodec=__webpack_require__(44),codecs=__webpack_require__(35),codecVarints=__webpack_require__(38),multihash=__webpack_require__(17);class CID{constructor(version,codec,multihash){if("string"==typeof version)if(multibase.isEncoded(version)){const cid=multibase.decode(version);this.version=parseInt(cid.slice(0,1).toString("hex"),16),this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=mh.fromB58String(version),this.version=0;else if(Buffer.isBuffer(version)){const firstByte=version.slice(0,1),v=parseInt(firstByte.toString("hex"),16);if(0===v||1===v){const cid=version;this.version=v,this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=version,this.version=0}else if("number"==typeof version){if("string"!=typeof codec)throw new Error("codec must be string");if(0!==version&&1!==version)throw new Error("version must be a number equal to 0 or 1");mh.validate(multihash),this.codec=codec,this.version=version,this.multihash=multihash}}get buffer(){switch(this.version){case 0:return this.multihash;case 1:return Buffer.concat([Buffer("01","hex"),Buffer(codecVarints[this.codec]),this.multihash]);default:throw new Error("unsupported version")}}get prefix(){return Buffer.concat([new Buffer(`0${this.version}`,"hex"),codecVarints[this.codec],multihash.prefix(this.multihash)])}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");return new CID(0,this.codec,this.multihash)}toV1(){return new CID(1,this.codec,this.multihash)}toBaseEncodedString(base){switch(base=base||"base58btc",this.version){case 0:if("base58btc"!==base)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");return mh.toB58String(this.multihash);case 1:return multibase.encode(base,this.buffer).toString();default:throw new Error("Unsupported version")}}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(other){return this.codec===other.codec&&this.version===other.version&&this.multihash.equals(other.multihash)}}CID.codecs=codecs,CID.isCID=(other=>{return"CID"===other.constructor.name}),module.exports=CID}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const NamespaceStore=__webpack_require__(197).NamespaceDatastore,Key=__webpack_require__(41).Key,base32=__webpack_require__(360),Block=__webpack_require__(60),setImmediate=__webpack_require__(11),reject=__webpack_require__(182),CID=__webpack_require__(12),blockPrefix=new Key("blocks"),keyFromBuffer=rawKey=>{return new Key("/"+(new base32.Encoder).write(rawKey).finalize(),!1)},cidToDsKey=cid=>{return keyFromBuffer(cid.buffer)};module.exports=(repo=>{const store=new NamespaceStore(repo.store,blockPrefix);return{get(cid,callback){if(!CID.isCID(cid))return setImmediate(()=>{callback(new Error("Not a valid cid"))});const k=cidToDsKey(cid);store.get(k,(err,blockData)=>{if(err)return callback(err);callback(null,new Block(blockData,cid))})},put(block,callback){if(!Block.isBlock(block))return setImmediate(()=>{callback(new Error("invalid block"))});const k=cidToDsKey(block.cid);store.has(k,(err,exists)=>{return err?callback(err):exists?callback():void store.put(k,block.data,callback)})},putMany(blocks,callback){const keys=blocks.map(b=>({key:cidToDsKey(b.cid),block:b})),batch=store.batch();reject(keys,(k,cb)=>store.has(k.key,cb),(err,newKeys)=>{if(err)return callback(err);newKeys.forEach(k=>{batch.put(k.key,k.block.data)}),batch.commit(callback)})},has(cid,callback){if(!CID.isCID(cid))return setImmediate(()=>{callback(new Error("Not a valid cid"))});store.has(cidToDsKey(cid),callback)},delete(cid,callback){if(!CID.isCID(cid))return setImmediate(()=>{callback(new Error("Not a valid cid"))});store.delete(cidToDsKey(cid),callback)}}})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const Key=__webpack_require__(41).Key,configKey=new Key("config");module.exports=(store=>{return{get(callback){store.get(configKey,(err,value)=>{if(err)return callback(err);let config;try{config=JSON.parse(value.toString())}catch(err){return callback(err)}callback(null,config)})},set(config,callback){const buf=new Buffer(JSON.stringify(config,null,2));store.put(configKey,buf,callback)},exists(callback){store.has(configKey,callback)}}})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";module.exports={fs:__webpack_require__(199),sharding:!1,fsOptions:{db:__webpack_require__(243)},level:__webpack_require__(243)}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const Key=__webpack_require__(41).Key,debug=__webpack_require__(3),log=debug("repo:version"),versionKey=new Key("version");module.exports=(store=>{return{exists(callback){store.has(versionKey,callback)},get(callback){store.get(versionKey,(err,buf)=>{if(err)return callback(err);callback(null,parseInt(buf.toString().trim(),10))})},set(version,callback){store.put(versionKey,new Buffer(String(version)),callback)},check(expected,callback){this.get((err,version)=>{return err?callback(err):(log("comparing version: %s and %s",version,expected),version!==expected?callback(new Error(`version mismatch: expected v${expected}, found v${version}`)):void callback())})}}})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function isSpecificValue(val){return val instanceof Buffer||val instanceof Date||val instanceof RegExp}function cloneSpecificValue(val){if(val instanceof Buffer){var x=new Buffer(val.length);return val.copy(x),x}if(val instanceof Date)return new Date(val.getTime());if(val instanceof RegExp)return new RegExp(val);throw new Error("Unexpected situation")}function deepCloneArray(arr){var clone=[];return arr.forEach(function(item,index){"object"==typeof item&&null!==item?Array.isArray(item)?clone[index]=deepCloneArray(item):isSpecificValue(item)?clone[index]=cloneSpecificValue(item):clone[index]=deepExtend({},item):clone[index]=item}),clone}var deepExtend=module.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var val,src,target=arguments[0],args=Array.prototype.slice.call(arguments,1);return args.forEach(function(obj){"object"!=typeof obj||null===obj||Array.isArray(obj)||Object.keys(obj).forEach(function(key){return src=target[key],val=obj[key],val===target?void 0:"object"!=typeof val||null===val?void(target[key]=val):Array.isArray(val)?void(target[key]=deepCloneArray(val)):isSpecificValue(val)?void(target[key]=cloneSpecificValue(val)):"object"!=typeof src||null===src||Array.isArray(src)?void(target[key]=deepExtend({},val)):void(target[key]=deepExtend(src,val))})}),target}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(5),pushable=__webpack_require__(36),pullPair=__webpack_require__(115),batch=__webpack_require__(155);module.exports=function(reduce,options){function reduceToParents(_chunks,callback){function reduced(err,roots){err?callback(err):roots.length>1?reduceToParents(roots,callback):callback(null,roots)}let chunks=_chunks;Array.isArray(chunks)&&(chunks=pull.values(chunks)),pull(chunks,batch(options.maxChildrenPerNode),pull.asyncMap(reduce),pull.collect(reduced))}const pair=pullPair(),source=pair.source,result=pushable();return reduceToParents(source,(err,roots)=>{if(err)return void result.end(err);1===roots.length?(result.push(roots[0]),result.end()):roots.length>1?result.end(new Error("expected a maximum of 1 roots and got "+roots.length)):result.end()}),{sink:pair.sink,source:result}}},function(module,exports,__webpack_require__){"use strict";const balancedReducer=__webpack_require__(473),defaultOptions={maxChildrenPerNode:174};module.exports=function(reduce,_options){return balancedReducer(reduce,Object.assign({},defaultOptions,_options))}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const extend=__webpack_require__(472),UnixFS=__webpack_require__(42),pull=__webpack_require__(5),through=__webpack_require__(116),parallel=__webpack_require__(46),waterfall=__webpack_require__(9),dagPB=__webpack_require__(62),CID=__webpack_require__(12),reduce=__webpack_require__(479),DAGNode=dagPB.DAGNode,defaultOptions={chunkerOptions:{maxChunkSize:262144}};module.exports=function(createChunker,ipldResolver,createReducer,_options){function createAndStoreDir(item,callback){const d=new UnixFS("directory");waterfall([cb=>DAGNode.create(d.marshal(),cb),(node,cb)=>{ipldResolver.put(node,{cid:new CID(node.multihash)},err=>cb(err,node))}],(err,node)=>{if(err)return callback(err);callback(null,{path:item.path,multihash:node.multihash,size:node.size})})}function createAndStoreFile(file,callback){if(Buffer.isBuffer(file.content)&&(file.content=pull.values([file.content])),"function"!=typeof file.content)return callback(new Error("invalid content"));const reducer=createReducer(reduce(file,ipldResolver,options),options);let previous,count=0;pull(file.content,createChunker(options.chunkerOptions),pull.map(chunk=>new Buffer(chunk)),pull.map(buffer=>new UnixFS("file",buffer)),pull.asyncMap((fileNode,callback)=>{DAGNode.create(fileNode.marshal(),(err,node)=>{callback(err,{DAGNode:node,fileNode:fileNode})})}),pull.asyncMap((leaf,callback)=>{ipldResolver.put(leaf.DAGNode,{cid:new CID(leaf.DAGNode.multihash)},err=>callback(err,leaf))}),pull.map(leaf=>{return{path:file.path,multihash:leaf.DAGNode.multihash,size:leaf.DAGNode.size,leafSize:leaf.fileNode.fileSize(),name:""}}),through(function(data){count++,previous&&this.queue(previous),previous=data},function(){previous&&(1===count&&(previous.single=!0),this.queue(previous)),this.queue(null)}),reducer,pull.collect((err,roots)=>{err?callback(err):callback(null,roots[0])}))}const options=extend({},defaultOptions,_options);return function(source){return function(items,cb){parallel(items.map(item=>cb=>{if(!item.content)return createAndStoreDir(item,(err,node)=>{if(err)return cb(err);node&&source.push(node),cb()});createAndStoreFile(item,(err,node)=>{if(err)return cb(err);node&&source.push(node),cb()})}),cb)}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const pullPushable=__webpack_require__(36),pullWrite=__webpack_require__(117);module.exports=function(createStrategy,ipldResolver,options){const source=pullPushable();return{source:source,sink:pullWrite(createStrategy(source),null,options.highWaterMark,err=>source.end(err))}}},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(5),pushable=__webpack_require__(36),pullPair=__webpack_require__(115),batch=__webpack_require__(155);module.exports=function(reduce,options){const pair=pullPair(),source=pair.source,result=pushable();return pull(source,batch(1/0),pull.asyncMap(reduce),pull.collect((err,roots)=>{if(err)return void result.end(err);1===roots.length?(result.push(roots[0]),result.end()):roots.length>1?result.end(new Error("expected a maximum of 1 roots and got "+roots.length)):result.end()})),{sink:pair.sink,source:result}}},function(module,exports,__webpack_require__){"use strict";const assert=__webpack_require__(7),createBuildStream=__webpack_require__(476),Builder=__webpack_require__(475),reducers={flat:__webpack_require__(477),balanced:__webpack_require__(474),trickle:__webpack_require__(480)},defaultOptions={strategy:"balanced",highWaterMark:100,reduceSingleLeafToSelf:!1};module.exports=function(Chunker,ipldResolver,_options){assert(Chunker,"Missing chunker creator function"),assert(ipldResolver,"Missing IPLD Resolver");const options=Object.assign({},defaultOptions,_options),strategyName=options.strategy,reducer=reducers[strategyName];return assert(reducer,"Unknown importer build strategy name: "+strategyName),createBuildStream(Builder(Chunker,ipldResolver,reducer,options),ipldResolver,options)}},function(module,exports,__webpack_require__){"use strict";const waterfall=__webpack_require__(9),dagPB=__webpack_require__(62),UnixFS=__webpack_require__(42),CID=__webpack_require__(12),DAGLink=dagPB.DAGLink,DAGNode=dagPB.DAGNode;module.exports=function(file,ipldResolver,options){return function(leaves,callback){if(1===leaves.length&&(leaves[0].single||options.reduceSingleLeafToSelf)){const leave=leaves[0];return void callback(null,{path:file.path,multihash:leave.multihash,size:leave.size,leafSize:leave.leafSize,name:leave.name})}const f=new UnixFS("file"),links=leaves.map(leaf=>{return f.addBlockSize(leaf.leafSize),new DAGLink(leaf.name,leaf.size,leaf.multihash)});waterfall([cb=>DAGNode.create(f.marshal(),links,cb),(node,cb)=>{ipldResolver.put(node,{cid:new CID(node.multihash)},err=>cb(err,node))}],(err,node)=>{if(err)return void callback(err);callback(null,{name:"",path:file.path,multihash:node.multihash,size:node.size,leafSize:f.fileSize()})})}}},function(module,exports,__webpack_require__){"use strict";const trickleReducer=__webpack_require__(481),defaultOptions={maxChildrenPerNode:174,layerRepeat:4};module.exports=function(reduce,_options){return trickleReducer(reduce,Object.assign({},defaultOptions,_options))}},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(5),pushable=__webpack_require__(36),batch=__webpack_require__(155),pullPair=__webpack_require__(115),through=__webpack_require__(116),pullWrite=__webpack_require__(117),pause=__webpack_require__(297);module.exports=function(reduce,options){function trickle(indent,maxDepth){function write(nodes,callback){let ended=!1;const node=nodes[0];depth&&!deeper&&(deeper=pushable(),pull(deeper,trickle(indent+1,depth-1),through(function(d){this.queue(d)},function(err){if(err)return void this.emit("error",err);ended||(ended=!0,pendingResumes++,pausable.pause()),this.queue(null)}),batch(1/0),pull.asyncMap(reduce),pull.collect((err,nodes)=>{if(pendingResumes--,err)return void result.end(err);nodes.forEach(node=>{result.push(node)}),iterate()}))),deeper?deeper.push(node):(result.push(node),iterate()),callback()}function iterate(){deeper=null,iteration++,(0===depth&&iteration===options.maxChildrenPerNode||depth>0&&iteration===options.layerRepeat)&&(iteration=0,depth++),(!aborting&&maxDepth>=0&&depth>maxDepth||aborting&&!pendingResumes)&&(aborting=!0,result.end()),pendingResumes||pausable.resume()}function end(err){if(err)return void result.end(err);deeper?aborting||(aborting=!0,deeper.end()):result.end()}let deeper,iteration=0,depth=0,aborting=!1;const result=pushable();return{source:result,sink:pullWrite(write,null,1,end)}}const pair=pullPair(),result=pushable(),pausable=pause(()=>{});let pendingResumes=0;return pull(pair.source,pausable,trickle(0,-1),batch(1/0),pull.asyncMap(reduce),pull.collect((err,roots)=>{err?result.end(err):1===roots.length?(result.push(roots[0]),result.end()):roots.length>1?result.end(new Error("expected a maximum of 1 roots and got "+roots.length)):result.end()})),{sink:pair.sink,source:result}}},function(module,exports,__webpack_require__){"use strict";const pullBlock=__webpack_require__(722);module.exports=(options=>{return pullBlock("number"==typeof options?options:options.maxChunkSize,{zeroPadding:!1,emitEmpty:!0})})},function(module,exports,__webpack_require__){"use strict";function dirExporter(node,name,ipldResolver,resolve,parent){const dir={path:name,hash:node.multihash};return cat([pull.values([dir]),pull(pull.values(node.links),pull.map(link=>({path:path.join(name,link.name),hash:link.multihash})),paramap((item,cb)=>ipldResolver.get(new CID(item.hash),(err,n)=>{if(err)return cb(err);cb(null,resolve(n.value,item.path,ipldResolver,name,parent))})),pull.flatten())])}const path=__webpack_require__(45),pull=__webpack_require__(5),paramap=__webpack_require__(157),CID=__webpack_require__(12),cat=__webpack_require__(156);module.exports=dirExporter},function(module,exports,__webpack_require__){"use strict";function shardedDirExporter(node,name,ipldResolver,resolve,parent){let dir;return parent&&parent.path===name||(dir=[{path:name,hash:cleanHash(node.multihash)}]),cat([pull.values(dir),pull(pull.values(node.links),pull.map(link=>{let p=link.name.substring(2);return p=p?path.join(name,p):name,{name:link.name,path:p,hash:link.multihash}}),paramap((item,cb)=>ipldResolver.get(new CID(item.hash),(err,n)=>{if(err)return cb(err);cb(null,resolve(n.value,item.path,ipldResolver,dir&&dir[0]||parent))})),pull.flatten())])}const path=__webpack_require__(45),pull=__webpack_require__(5),paramap=__webpack_require__(157),CID=__webpack_require__(12),cat=__webpack_require__(156),cleanHash=__webpack_require__(223);module.exports=shardedDirExporter},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const traverse=__webpack_require__(304),UnixFS=__webpack_require__(42),CID=__webpack_require__(12),pull=__webpack_require__(5),paramap=__webpack_require__(157);module.exports=((node,name,ipldResolver)=>{function getData(node){try{const file=UnixFS.unmarshal(node.data);return file.data||new Buffer(0)}catch(err){throw new Error("Failed to unmarshal node")}}function visitor(node){return pull(pull.values(node.links),paramap((link,cb)=>ipldResolver.get(new CID(link.multihash),cb)),pull.map(result=>result.value))}let content=pull(traverse.depthFirst(node,visitor),pull.map(getData));const file=UnixFS.unmarshal(node.data);return pull.values([{content:content,path:name,size:file.fileSize()}])})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(5),CID=__webpack_require__(12),isIPFS=__webpack_require__(541),resolve=__webpack_require__(487).resolve,cleanMultihash=__webpack_require__(223);module.exports=((hash,ipldResolver)=>{return isIPFS.multihash(hash)?(hash=cleanMultihash(hash),pull(ipldResolver.getStream(new CID(hash)),pull.map(result=>result.value),pull.map(node=>resolve(node,hash,ipldResolver)),pull.flatten())):pull.error(new Error("not valid multihash"))})},function(module,exports,__webpack_require__){"use strict";function resolve(node,name,ipldResolver,parentNode){const type=typeOf(node),resolver=resolvers[type];return resolver?resolver(node,name,ipldResolver,resolve,parentNode):pull.error(new Error("Unkown node type "+type))}function typeOf(node){return UnixFS.unmarshal(node.data).type}const UnixFS=__webpack_require__(42),pull=__webpack_require__(5),resolvers={directory:__webpack_require__(483),"hamt-sharded-directory":__webpack_require__(484),file:__webpack_require__(485)};module.exports=Object.assign({resolve:resolve,typeOf:typeOf},resolvers)},function(module,exports,__webpack_require__){"use strict";(function(process){function exists(o){return Boolean(o)}function mapNode(node,index){return node.key}function reduceNodes(nodes){return nodes}function asyncTransformBucket(bucket,asyncMap,asyncReduce,callback){map(bucket._children.compactArray(),(child,callback)=>{child instanceof Bucket?asyncTransformBucket(child,asyncMap,asyncReduce,callback):asyncMap(child,(err,mappedChildren)=>{err?callback(err):callback(null,{bitField:bucket._children.bitField(),children:mappedChildren})})},(err,mappedChildren)=>{err?callback(err):asyncReduce(mappedChildren,callback)})}const SparseArray=__webpack_require__(785),map=__webpack_require__(89),eachSeries=__webpack_require__(87),wrapHash=__webpack_require__(490),defaultOptions={bits:8};class Bucket{constructor(options,parent,posAtParent){if(this._options=Object.assign({},defaultOptions,options),this._popCount=0,this._parent=parent,this._posAtParent=posAtParent,!this._options.hashFn)throw new Error("please define an options.hashFn");this._options.hash||(this._options.hash=wrapHash(this._options.hashFn)),this._children=new SparseArray}static isBucket(o){return o instanceof Bucket}put(key,value,callback){this._findNewBucketAndPos(key,(err,place)=>{if(err)return void callback(err);place.bucket._putAt(place,key,value),callback()})}get(key,callback){this._findChild(key,(err,child)=>{err?callback(err):callback(null,child&&child.value)})}del(key,callback){this._findPlace(key,(err,place)=>{if(err)return void callback(err);const child=place.bucket._at(place.pos);child&&child.key===key&&place.bucket._delAt(place.pos),callback(null)})}leafCount(){this._children.reduce((acc,child)=>{return child instanceof Bucket?acc+child.leafCount():acc+1},0)}childrenCount(){return this._children.length}onlyChild(callback){process.nextTick(()=>callback(null,this._children.get(0)))}eachLeafSeries(iterator,callback){eachSeries(this._children.compactArray(),(child,cb)=>{child instanceof Bucket?child.eachLeafSeries(iterator,cb):iterator(child.key,child.value,cb)},callback)}serialize(map,reduce){return reduce(this._children.reduce((acc,child,index)=>{return child&&(child instanceof Bucket?acc.push(child.serialize(map,reduce)):acc.push(map(child,index))),acc},[]))}asyncTransform(asyncMap,asyncReduce,callback){asyncTransformBucket(this,asyncMap,asyncReduce,callback)}toJSON(){return this.serialize(mapNode,reduceNodes)}prettyPrint(){return JSON.stringify(this.toJSON(),null," ")}tableSize(){return Math.pow(2,this._options.bits)}_findChild(key,callback){this._findPlace(key,(err,result)=>{if(err)return void callback(err);const child=result.bucket._at(result.pos);child&&child.key===key?callback(null,child):callback(null,void 0)})}_findPlace(key,callback){const hashValue=this._options.hash(key);hashValue.take(this._options.bits,(err,index)=>{if(err)return void callback(err);const child=this._children.get(index);if(child instanceof Bucket)child._findPlace(hashValue,callback);else{const place={bucket:this,pos:index,hash:hashValue};callback(null,place)}})}_findNewBucketAndPos(key,callback){this._findPlace(key,(err,place)=>{if(err)return void callback(err);const child=place.bucket._at(place.pos);if(child&&child.key!==key){const bucket=new Bucket(this._options,place.bucket,place.pos);place.bucket._putObjectAt(place.pos,bucket),bucket._findPlace(child.hash,(err,newPlace)=>{if(err)return void callback(err);newPlace.bucket._putAt(newPlace,child.key,child.value),bucket._findNewBucketAndPos(place.hash,callback)})}else callback(null,place)})}_putAt(place,key,value){this._putObjectAt(place.pos,{key:key,value:value,hash:place.hash})}_putObjectAt(pos,object){this._children.get(pos)||this._popCount++,this._children.set(pos,object)}_delAt(pos){this._children.get(pos)&&this._popCount--,this._children.unset(pos),this._level()}_level(){if(this._parent&&this._popCount<=1)if(1===this._popCount){const onlyChild=this._children.find(exists);if(!(onlyChild instanceof Bucket)){const hash=onlyChild.hash;hash.untake(this._options.bits);const place={pos:this._posAtParent,hash:hash};this._parent._putAt(place,onlyChild.key,onlyChild.value)}}else this._parent._delAt(this._posAtParent)}_at(index){return this._children.get(index)}}module.exports=Bucket}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";function byteBitsToInt(byte,start,length){return(byte&maskFor(start,length))>>>start}function maskFor(start,length){return START_MASKS[start]&STOP_MASKS[Math.min(length+start-1,7)]}const START_MASKS=[255,254,252,248,240,224,192,128],STOP_MASKS=[1,3,7,15,31,63,127,255];module.exports=class ConsumableBuffer{constructor(value){this._value=value,this._currentBytePos=value.length-1,this._currentBitPos=7}availableBits(){return this._currentBitPos+1+8*this._currentBytePos}totalBits(){return 8*this._value.length}take(bits){let pendingBits=bits,result=0;for(;pendingBits&&this._haveBits();){const byte=this._value[this._currentBytePos],availableBits=this._currentBitPos+1,taking=Math.min(availableBits,pendingBits),value=byteBitsToInt(byte,availableBits-taking,taking);result=(result<7;)this._currentBitPos-=8,this._currentBytePos+=1}_haveBits(){return this._currentBytePos>=0}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer,process){const whilst=__webpack_require__(90),ConsumableBuffer=__webpack_require__(489);module.exports=function(hashFn){return function(value){return value instanceof InfiniteHash?value:new InfiniteHash(value,hashFn)}};class InfiniteHash{constructor(value,hashFn){if("string"!=typeof value&&!Buffer.isBuffer(value))throw new Error("can only hash strings or buffers");this._value=value,this._hashFn=hashFn,this._depth=-1,this._availableBits=0,this._currentBufferIndex=0,this._buffers=[]}take(bits,callback){let pendingBits=bits;whilst(()=>this._availableBits{this._produceMoreBits(callback)},err=>{if(err)return void callback(err);let result=0;whilst(()=>pendingBits>0,callback=>{const hash=this._buffers[this._currentBufferIndex],available=Math.min(hash.availableBits(),pendingBits);result=(result<{if(err)return void callback(err);process.nextTick(()=>callback(null,result))})})}untake(bits){let pendingBits=bits;for(;pendingBits>0;){const hash=this._buffers[this._currentBufferIndex],availableForUntake=Math.min(hash.totalBits()-hash.availableBits(),pendingBits);hash.untake(availableForUntake),pendingBits-=availableForUntake,this._availableBits+=availableForUntake,this._currentBufferIndex>0&&hash.totalBits()===hash.availableBits()&&(this._depth--,this._currentBufferIndex--)}}_produceMoreBits(callback){this._depth++;const value=this._depth?this._value+this._depth:this._value;this._hashFn(value,(err,hashValue)=>{if(err)return void callback(err);const buffer=new ConsumableBuffer(hashValue);this._buffers.push(buffer),this._availableBits+=buffer.availableBits(),callback()})}}}).call(exports,__webpack_require__(0).Buffer,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";const Bucket=__webpack_require__(488);module.exports=function(options){return new Bucket(options)},module.exports.isBucket=Bucket.isBucket},function(module,exports,__webpack_require__){"use strict";(function(process){function createDirFlat(props){return new DirFlat(props)}const asyncEachSeries=__webpack_require__(87),waterfall=__webpack_require__(9),CID=__webpack_require__(12),dagPB=__webpack_require__(62),UnixFS=__webpack_require__(42),DAGLink=dagPB.DAGLink,DAGNode=dagPB.DAGNode,Dir=__webpack_require__(134);class DirFlat extends Dir{constructor(props){super(),this._children={},Object.assign(this,props)}put(name,value,callback){this.multihash=void 0,this.size=void 0,this._children[name]=value,process.nextTick(callback)}get(name,callback){process.nextTick(()=>callback(null,this._children[name]))}childCount(){return Object.keys(this._children).length}directChildrenCount(){return this.childCount()}onlyChild(callback){process.nextTick(()=>callback(null,this._children[Object.keys(this._children)[0]]))}eachChildSeries(iterator,callback){asyncEachSeries(Object.keys(this._children),(key,callback)=>{iterator(key,this._children[key],callback)},callback)}flush(path,ipldResolver,source,callback){const links=Object.keys(this._children).map(key=>{const child=this._children[key];return new DAGLink(key,child.size,child.multihash)}),dir=new UnixFS("directory");waterfall([callback=>DAGNode.create(dir.marshal(),links,callback),(node,callback)=>{ipldResolver.put(node,{cid:new CID(node.multihash)},err=>callback(err,node))},(node,callback)=>{this.multihash=node.multihash,this.size=node.size;const pushable={path:path,multihash:node.multihash,size:node.size};source.push(pushable),callback(null,node)}],callback)}}module.exports=createDirFlat}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function createDirSharded(props){return new DirSharded(props)}function flush(options,bucket,path,ipldResolver,source,callback){function collectChild(child,index,callback){const labelPrefix=leftPad(index.toString(16).toUpperCase(),2,"0");if(Bucket.isBucket(child))flush(options,child,path,ipldResolver,null,(err,node)=>{if(err)return void callback(err);links.push(new DAGLink(labelPrefix,node.size,node.multihash)),callback()});else{const value=child.value,label=labelPrefix+child.key;links.push(new DAGLink(label,value.size,value.multihash)),callback()}}function haveLinks(links){const data=new Buffer(children.bitField().reverse()),dir=new UnixFS("hamt-sharded-directory",data);dir.fanout=bucket.tableSize(),dir.hashType=options.hashFn.code,waterfall([callback=>DAGNode.create(dir.marshal(),links,callback),(node,callback)=>{ipldResolver.put(node,{cid:new CID(node.multihash)},err=>callback(err,node))},(node,callback)=>{const pushable={path:path,multihash:node.multihash,size:node.size};source&&source.push(pushable),callback(null,node)}],callback)}const children=bucket._children;let index=0;const links=[];whilst(()=>index{const child=children.get(index);child?collectChild(child,index,err=>{index++,callback(err)}):(index++,callback())},err=>{if(err)return void callback(err);haveLinks(links)})}const leftPad=__webpack_require__(242),whilst=__webpack_require__(90),waterfall=__webpack_require__(9),CID=__webpack_require__(12),dagPB=__webpack_require__(62),UnixFS=__webpack_require__(42),DAGLink=dagPB.DAGLink,DAGNode=dagPB.DAGNode,multihashing=__webpack_require__(30),Dir=__webpack_require__(134),Bucket=__webpack_require__(491),hashFn=function(value,callback){multihashing(value,"murmur3-128",(err,hash)=>{if(err)callback(err);else{const justHash=hash.slice(2,10),length=justHash.length,result=new Buffer(length);for(let i=0;i{err?callback(err):(this.multihash=node.multihash,this.size=node.size),callback(null,node)})}}module.exports=createDirSharded}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function flatToShard(child,dir,threshold,callback){maybeFlatToShardOne(dir,threshold,(err,newDir)=>{if(err)return void callback(err);const parent=newDir.parent;parent?waterfall([callback=>{ -newDir!==dir?(child&&(child.parent=newDir),parent.put(newDir.parentKey,newDir,callback)):callback()},callback=>{parent?flatToShard(newDir,parent,threshold,callback):callback(null,newDir)}],callback):callback(null,newDir)})}function maybeFlatToShardOne(dir,threshold,callback){dir.flat&&dir.directChildrenCount()>=threshold?definitelyShardOne(dir,callback):callback(null,dir)}function definitelyShardOne(oldDir,callback){const newDir=DirSharded({root:oldDir.root,dir:!0,parent:oldDir.parent,parentKey:oldDir.parentKey,path:oldDir.path,dirty:oldDir.dirty,flat:!1});oldDir.eachChildSeries((key,value,callback)=>{newDir.put(key,value,callback)},err=>{err?callback(err):callback(err,newDir)})}const waterfall=__webpack_require__(9),DirSharded=__webpack_require__(493);module.exports=flatToShard},function(module,exports,__webpack_require__){"use strict";(function(process){const pause=__webpack_require__(297),pull=__webpack_require__(5),writable=__webpack_require__(117),pushable=__webpack_require__(36),assert=__webpack_require__(7),setImmediate=__webpack_require__(11),DAGBuilder=__webpack_require__(478),createTreeBuilder=__webpack_require__(496),chunkers={fixed:__webpack_require__(482)},defaultOptions={chunker:"fixed"};module.exports=function(ipldResolver,_options){function flush(callback){function proceed(){treeBuilder.flush((err,hash)=>{if(err)return treeBuilderStream.source.end(err),void callback(err);pausable.resume(),callback(null,hash)})}pausable.pause(),pending?waitingPending.push(proceed):proceed()}const options=Object.assign({},defaultOptions,_options),Chunker=chunkers[options.chunker];assert(Chunker,"Unknkown chunker named "+options.chunker);let pending=0;const waitingPending=[],entry={sink:writable((nodes,callback)=>{pending+=nodes.length,nodes.forEach(node=>entry.source.push(node)),setImmediate(callback)},null,1,err=>entry.source.end(err)),source:pushable()},dagStream=DAGBuilder(Chunker,ipldResolver,options),treeBuilder=createTreeBuilder(ipldResolver,options),treeBuilderStream=treeBuilder.stream(),pausable=pause(()=>{});return pull(entry,pausable,dagStream,pull.map(node=>{return pending--,pending||process.nextTick(()=>{for(;waitingPending.length;)waitingPending.shift()()}),node}),treeBuilderStream),{sink:entry.sink,source:treeBuilderStream.source,flush:flush}}}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";(function(process){function createTreeBuilder(ipldResolver,_options){function consumeQueue(action,callback){const args=action.args.concat(function(){action.cb.apply(null,arguments),callback()});action.fn.apply(null,args)}function getStream(){return stream}function addToTree(elem,callback){const pathElems=elem.path.split("/").filter(notEmpty);let parent=tree;const lastIndex=pathElems.length-1;let currentPath="";eachOfSeries(pathElems,(pathElem,index,callback)=>{currentPath&&(currentPath+="/"),currentPath+=pathElem;const last=index===lastIndex;parent.dirty=!0,parent.multihash=null,parent.size=null,last?waterfall([callback=>parent.put(pathElem,elem,callback),callback=>flatToShard(null,parent,options.shardSplitThreshold,callback),(newRoot,callback)=>{tree=newRoot,callback()}],callback):parent.get(pathElem,(err,treeNode)=>{if(err)return void callback(err);let dir=treeNode;dir&&dir instanceof Dir||(dir=DirFlat({dir:!0,parent:parent,parentKey:pathElem,path:currentPath,dirty:!0,flat:!0}));const parentDir=parent;parent=dir,parentDir.put(pathElem,dir,callback)})},callback)}function flushRoot(callback){queue.push({fn:flush,args:["",tree],cb:(err,node)=>{err?callback(err):callback(null,node&&node.multihash)}})}function flush(path,tree,callback){if(tree.dir){if(tree.root&&tree.childCount()>1&&!options.wrap)return void callback(new Error("detected more than one root"));tree.eachChildSeries((key,child,callback)=>{flush(path?path+"/"+key:key,child,callback)},err=>{if(err)return void callback(err);flushDir(path,tree,callback)})}else process.nextTick(callback)}function flushDir(path,tree,callback){return tree.root&&!options.wrap?void tree.onlyChild((err,onlyChild)=>{if(err)return void callback(err);callback(null,onlyChild)}):tree.dirty?(tree.dirty=!1,void tree.flush(path,ipldResolver,stream.source,(err,node)=>{err?callback(err):callback(null,node)})):void callback(null,tree.multihash)}const options=Object.assign({},defaultOptions,_options),queue=createQueue(consumeQueue,1);let stream=function(){function write(elems,callback){eachSeries(elems,(elem,callback)=>{queue.push({fn:addToTree,args:[elem],cb:err=>{err?callback(err):(source.push(elem),callback())}})},callback)}function ended(err){flushRoot(flushErr=>{source.end(flushErr||err)})}const sink=writable(write,null,1,ended),source=pushable();return{sink:sink,source:source}}(),tree=DirFlat({path:"",root:!0,dir:!0,dirty:!1,flat:!0});return{flush:flushRoot,stream:getStream}}function notEmpty(str){return Boolean(str)}const eachSeries=__webpack_require__(87),eachOfSeries=__webpack_require__(175),waterfall=__webpack_require__(9),createQueue=__webpack_require__(181),writable=__webpack_require__(117),pushable=__webpack_require__(36),DirFlat=__webpack_require__(492),flatToShard=__webpack_require__(494),Dir=__webpack_require__(134);module.exports=createTreeBuilder;const defaultOptions={wrap:!1,shardSplitThreshold:1e3}}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";exports.importer=exports.Importer=__webpack_require__(495),exports.exporter=exports.Exporter=__webpack_require__(486)},function(module,exports,__webpack_require__){"use strict";module.exports=`message Data { +`},function(module,exports,__webpack_require__){"use strict";const assert=__webpack_require__(9),CID=__webpack_require__(8);class WantListEntry{constructor(cid,priority){assert(CID.isCID(cid),"must be valid CID"),this._refCounter=1,this.cid=cid,this.priority=priority||1}inc(){this._refCounter+=1}dec(){this._refCounter=Math.max(0,this._refCounter-1)}hasRefs(){return this._refCounter>0}get[Symbol.toStringTag](){return`WantlistEntry `}equals(other){return this._refCounter===other._refCounter&&this.cid.equals(other.cid)&&this.priority===other.priority}}module.exports=WantListEntry},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(12),multibase=__webpack_require__(134),multicodec=__webpack_require__(135),codecs=__webpack_require__(65),codecVarints=__webpack_require__(90),multihash=__webpack_require__(12);class CID{constructor(version,codec,multihash){if("string"==typeof version)if(multibase.isEncoded(version)){const cid=multibase.decode(version);this.version=parseInt(cid.slice(0,1).toString("hex"),16),this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=mh.fromB58String(version),this.version=0;else if(Buffer.isBuffer(version)){const firstByte=version.slice(0,1),v=parseInt(firstByte.toString("hex"),16);if(0===v||1===v){const cid=version;this.version=v,this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=version,this.version=0}else if("number"==typeof version){if("string"!=typeof codec)throw new Error("codec must be string");if(0!==version&&1!==version)throw new Error("version must be a number equal to 0 or 1");mh.validate(multihash),this.codec=codec,this.version=version,this.multihash=multihash}}get buffer(){switch(this.version){case 0:return this.multihash;case 1:return Buffer.concat([Buffer("01","hex"),Buffer(codecVarints[this.codec]),this.multihash]);default:throw new Error("unsupported version")}}get prefix(){return Buffer.concat([new Buffer(`0${this.version}`,"hex"),codecVarints[this.codec],multihash.prefix(this.multihash)])}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");return new CID(0,this.codec,this.multihash)}toV1(){return new CID(1,this.codec,this.multihash)}toBaseEncodedString(base){switch(base=base||"base58btc",this.version){case 0:if("base58btc"!==base)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");return mh.toB58String(this.multihash);case 1:return multibase.encode(base,this.buffer).toString();default:throw new Error("Unsupported version")}}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(other){return this.codec===other.codec&&this.version===other.version&&this.multihash.equals(other.multihash)}}CID.codecs=codecs,CID.isCID=(other=>{return"CID"===other.constructor.name}),module.exports=CID}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const Key=__webpack_require__(16).Key,Buffer=__webpack_require__(6).Buffer,apiFile=new Key("api");module.exports=(store=>{return{get(callback){store.get(apiFile,(err,value)=>callback(err,value&&value.toString()))},set(value,callback){store.put(apiFile,Buffer.from(value.toString()),callback)},delete(callback){store.delete(apiFile,callback)}}})},function(module,exports,__webpack_require__){"use strict";exports.create=function(name,path,options){return new(0,options.storageBackends[name])(path,Object.assign({},options.storageBackendOptions[name]||{}))}},function(module,exports,__webpack_require__){"use strict";function maybeWithSharding(filestore,options,callback){if(options.sharding){const shard=new core.shard.NextToLast(2);ShardingStore.createOrOpen(filestore,shard,callback)}else setImmediate(()=>callback(null,filestore))}function createBaseStore(store){return{get(cid,callback){if(!CID.isCID(cid))return setImmediate(()=>{callback(new Error("Not a valid cid"))});const k=cidToDsKey(cid);store.get(k,(err,blockData)=>{if(err)return callback(err);callback(null,new Block(blockData,cid))})},put(block,callback){if(!Block.isBlock(block))return setImmediate(()=>{callback(new Error("invalid block"))});const k=cidToDsKey(block.cid);store.has(k,(err,exists)=>{return err?callback(err):exists?callback():void store.put(k,block.data,callback)})},putMany(blocks,callback){const keys=blocks.map(b=>({key:cidToDsKey(b.cid),block:b})),batch=store.batch();reject(keys,(k,cb)=>store.has(k.key,cb),(err,newKeys)=>{if(err)return callback(err);newKeys.forEach(k=>{batch.put(k.key,k.block.data)}),batch.commit(callback)})},has(cid,callback){if(!CID.isCID(cid))return setImmediate(()=>{callback(new Error("Not a valid cid"))});store.has(cidToDsKey(cid),callback)},delete(cid,callback){if(!CID.isCID(cid))return setImmediate(()=>{callback(new Error("Not a valid cid"))});store.delete(cidToDsKey(cid),callback)},close(callback){store.close(callback)}}}const core=__webpack_require__(326),ShardingStore=core.ShardingDatastore,Key=__webpack_require__(16).Key,base32=__webpack_require__(303),Block=__webpack_require__(61),setImmediate=__webpack_require__(10),reject=__webpack_require__(160),CID=__webpack_require__(8),keyFromBuffer=rawKey=>{return new Key("/"+(new base32.Encoder).write(rawKey).finalize(),!1)},cidToDsKey=cid=>{return keyFromBuffer(cid.buffer)};module.exports=((filestore,options,callback)=>{maybeWithSharding(filestore,options,(err,store)=>{if(err)return callback(err);callback(null,createBaseStore(store))})})},function(module,exports,__webpack_require__){"use strict";const Key=__webpack_require__(16).Key,queue=__webpack_require__(106),waterfall=__webpack_require__(7),_get=__webpack_require__(228),_set=__webpack_require__(528),_has=__webpack_require__(524),Buffer=__webpack_require__(6).Buffer,configKey=new Key("config");module.exports=(store=>{function _doSet(m,callback){const key=m.key,value=m.value;key?waterfall([cb=>configStore.get(cb),(config,cb)=>cb(null,_set(config,key,value)),_saveAll],callback):_saveAll(value,callback)}function _saveAll(config,callback){const buf=Buffer.from(JSON.stringify(config,null,2));store.put(configKey,buf,callback)}const setQueue=queue(_doSet,1),configStore={get(key,callback){"function"==typeof key&&(callback=key,key=void 0),key||(key=void 0),store.get(configKey,(err,encodedValue)=>{if(err)return callback(err);let config;try{config=JSON.parse(encodedValue.toString())}catch(err){return callback(err)}if(void 0!==key&&!_has(config,key))return callback(new Error("Key "+key+" does not exist in config"));callback(null,void 0!==key?_get(config,key):config)})},set(key,value,callback){if("function"==typeof value)callback=value,value=key,key=void 0;else if(!key||"string"!=typeof key)return callback(new Error("Invalid key type"));if(void 0===value||Buffer.isBuffer(value))return callback(new Error("Invalid value type"));setQueue.push({key:key,value:value},callback)},exists(callback){store.has(configKey,callback)}};return configStore})},function(module,exports,__webpack_require__){"use strict";module.exports={lock:"memory",storageBackends:{root:__webpack_require__(110),blocks:__webpack_require__(110),datastore:__webpack_require__(110)},storageBackendOptions:{root:{db:__webpack_require__(122),extension:""},blocks:{sharding:!1,db:__webpack_require__(122)},datastore:{db:__webpack_require__(122)}}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const Key=__webpack_require__(16).Key,debug=__webpack_require__(3),log=debug("repo:version"),versionKey=new Key("version");module.exports=(store=>{return{exists(callback){store.has(versionKey,callback)},get(callback){store.get(versionKey,(err,buf)=>{if(err)return callback(err);callback(null,parseInt(buf.toString().trim(),10))})},set(version,callback){store.put(versionKey,new Buffer(String(version)),callback)},check(expected,callback){this.get((err,version)=>{return err?callback(err):(log("comparing version: %s and %s",version,expected),version!==expected?callback(new Error(`version mismatch: expected v${expected}, found v${version}`)):void callback())})}}})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function isSpecificValue(val){return val instanceof Buffer||val instanceof Date||val instanceof RegExp}function cloneSpecificValue(val){if(val instanceof Buffer){var x=new Buffer(val.length);return val.copy(x),x}if(val instanceof Date)return new Date(val.getTime());if(val instanceof RegExp)return new RegExp(val);throw new Error("Unexpected situation")}function deepCloneArray(arr){var clone=[];return arr.forEach(function(item,index){"object"==typeof item&&null!==item?Array.isArray(item)?clone[index]=deepCloneArray(item):isSpecificValue(item)?clone[index]=cloneSpecificValue(item):clone[index]=deepExtend({},item):clone[index]=item}),clone}var deepExtend=module.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var val,src,target=arguments[0],args=Array.prototype.slice.call(arguments,1);return args.forEach(function(obj){"object"!=typeof obj||null===obj||Array.isArray(obj)||Object.keys(obj).forEach(function(key){return src=target[key],val=obj[key],val===target?void 0:"object"!=typeof val||null===val?void(target[key]=val):Array.isArray(val)?void(target[key]=deepCloneArray(val)):isSpecificValue(val)?void(target[key]=cloneSpecificValue(val)):"object"!=typeof src||null===src||Array.isArray(src)?void(target[key]=deepExtend({},val)):void(target[key]=deepExtend(src,val))})}),target}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(4),pushable=__webpack_require__(30),pullPair=__webpack_require__(97),batch=__webpack_require__(137);module.exports=function(reduce,options){function reduceToParents(_chunks,callback){function reduced(err,roots){err?callback(err):roots.length>1?reduceToParents(roots,callback):callback(null,roots)}let chunks=_chunks;Array.isArray(chunks)&&(chunks=pull.values(chunks)),pull(chunks,batch(options.maxChildrenPerNode),pull.asyncMap(reduce),pull.collect(reduced))}const pair=pullPair(),source=pair.source,result=pushable();return reduceToParents(source,(err,roots)=>{if(err)return void result.end(err);1===roots.length?(result.push(roots[0]),result.end()):roots.length>1?result.end(new Error("expected a maximum of 1 roots and got "+roots.length)):result.end()}),{sink:pair.sink,source:result}}},function(module,exports,__webpack_require__){"use strict";const balancedReducer=__webpack_require__(405),defaultOptions={maxChildrenPerNode:174};module.exports=function(reduce,_options){return balancedReducer(reduce,Object.assign({},defaultOptions,_options))}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const extend=__webpack_require__(404),UnixFS=__webpack_require__(41),pull=__webpack_require__(4),through=__webpack_require__(98),parallel=__webpack_require__(39),waterfall=__webpack_require__(7),dagPB=__webpack_require__(52),CID=__webpack_require__(8),reduce=__webpack_require__(411),DAGNode=dagPB.DAGNode,defaultOptions={chunkerOptions:{maxChunkSize:262144}};module.exports=function(createChunker,ipldResolver,createReducer,_options){function createAndStoreDir(item,callback){const d=new UnixFS("directory");waterfall([cb=>DAGNode.create(d.marshal(),cb),(node,cb)=>{ipldResolver.put(node,{cid:new CID(node.multihash)},err=>cb(err,node))}],(err,node)=>{if(err)return callback(err);callback(null,{path:item.path,multihash:node.multihash,size:node.size})})}function createAndStoreFile(file,callback){if(Buffer.isBuffer(file.content)&&(file.content=pull.values([file.content])),"function"!=typeof file.content)return callback(new Error("invalid content"));const reducer=createReducer(reduce(file,ipldResolver,options),options);let previous,count=0;pull(file.content,createChunker(options.chunkerOptions),pull.map(chunk=>new Buffer(chunk)),pull.map(buffer=>new UnixFS("file",buffer)),pull.asyncMap((fileNode,callback)=>{DAGNode.create(fileNode.marshal(),(err,node)=>{callback(err,{DAGNode:node,fileNode:fileNode})})}),pull.asyncMap((leaf,callback)=>{ipldResolver.put(leaf.DAGNode,{cid:new CID(leaf.DAGNode.multihash)},err=>callback(err,leaf))}),pull.map(leaf=>{return{path:file.path,multihash:leaf.DAGNode.multihash,size:leaf.DAGNode.size,leafSize:leaf.fileNode.fileSize(),name:""}}),through(function(data){count++,previous&&this.queue(previous),previous=data},function(){previous&&(1===count&&(previous.single=!0),this.queue(previous)),this.queue(null)}),reducer,pull.collect((err,roots)=>{err?callback(err):callback(null,roots[0])}))}const options=extend({},defaultOptions,_options);return function(source){return function(items,cb){parallel(items.map(item=>cb=>{if(!item.content)return createAndStoreDir(item,(err,node)=>{if(err)return cb(err);node&&source.push(node),cb()});createAndStoreFile(item,(err,node)=>{if(err)return cb(err);node&&source.push(node),cb()})}),cb)}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const pullPushable=__webpack_require__(30),pullWrite=__webpack_require__(99);module.exports=function(createStrategy,ipldResolver,options){const source=pullPushable();return{source:source,sink:pullWrite(createStrategy(source),null,options.highWaterMark,err=>source.end(err))}}},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(4),pushable=__webpack_require__(30),pullPair=__webpack_require__(97),batch=__webpack_require__(137);module.exports=function(reduce,options){const pair=pullPair(),source=pair.source,result=pushable();return pull(source,batch(1/0),pull.asyncMap(reduce),pull.collect((err,roots)=>{if(err)return void result.end(err);1===roots.length?(result.push(roots[0]),result.end()):roots.length>1?result.end(new Error("expected a maximum of 1 roots and got "+roots.length)):result.end()})),{sink:pair.sink,source:result}}},function(module,exports,__webpack_require__){"use strict";const assert=__webpack_require__(9),createBuildStream=__webpack_require__(408),Builder=__webpack_require__(407),reducers={flat:__webpack_require__(409),balanced:__webpack_require__(406),trickle:__webpack_require__(412)},defaultOptions={strategy:"balanced",highWaterMark:100,reduceSingleLeafToSelf:!1};module.exports=function(Chunker,ipldResolver,_options){assert(Chunker,"Missing chunker creator function"),assert(ipldResolver,"Missing IPLD Resolver");const options=Object.assign({},defaultOptions,_options),strategyName=options.strategy,reducer=reducers[strategyName];return assert(reducer,"Unknown importer build strategy name: "+strategyName),createBuildStream(Builder(Chunker,ipldResolver,reducer,options),ipldResolver,options)}},function(module,exports,__webpack_require__){"use strict";const waterfall=__webpack_require__(7),dagPB=__webpack_require__(52),UnixFS=__webpack_require__(41),CID=__webpack_require__(8),DAGLink=dagPB.DAGLink,DAGNode=dagPB.DAGNode;module.exports=function(file,ipldResolver,options){return function(leaves,callback){if(1===leaves.length&&(leaves[0].single||options.reduceSingleLeafToSelf)){const leave=leaves[0];return void callback(null,{path:file.path,multihash:leave.multihash,size:leave.size,leafSize:leave.leafSize,name:leave.name})}const f=new UnixFS("file"),links=leaves.map(leaf=>{return f.addBlockSize(leaf.leafSize),new DAGLink(leaf.name,leaf.size,leaf.multihash)});waterfall([cb=>DAGNode.create(f.marshal(),links,cb),(node,cb)=>{ipldResolver.put(node,{cid:new CID(node.multihash)},err=>cb(err,node))}],(err,node)=>{if(err)return void callback(err);callback(null,{name:"",path:file.path,multihash:node.multihash,size:node.size,leafSize:f.fileSize()})})}}},function(module,exports,__webpack_require__){"use strict";const trickleReducer=__webpack_require__(413),defaultOptions={maxChildrenPerNode:174,layerRepeat:4};module.exports=function(reduce,_options){return trickleReducer(reduce,Object.assign({},defaultOptions,_options))}},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(4),pushable=__webpack_require__(30),batch=__webpack_require__(137),pullPair=__webpack_require__(97),through=__webpack_require__(98),pullWrite=__webpack_require__(99),pause=__webpack_require__(249);module.exports=function(reduce,options){function trickle(indent,maxDepth){function write(nodes,callback){let ended=!1;const node=nodes[0];depth&&!deeper&&(deeper=pushable(),pull(deeper,trickle(indent+1,depth-1),through(function(d){this.queue(d)},function(err){if(err)return void this.emit("error",err);ended||(ended=!0,pendingResumes++,pausable.pause()),this.queue(null)}),batch(1/0),pull.asyncMap(reduce),pull.collect((err,nodes)=>{if(pendingResumes--,err)return void result.end(err);nodes.forEach(node=>{result.push(node)}),iterate()}))),deeper?deeper.push(node):(result.push(node),iterate()),callback()}function iterate(){deeper=null,iteration++,(0===depth&&iteration===options.maxChildrenPerNode||depth>0&&iteration===options.layerRepeat)&&(iteration=0,depth++),(!aborting&&maxDepth>=0&&depth>maxDepth||aborting&&!pendingResumes)&&(aborting=!0,result.end()),pendingResumes||pausable.resume()}function end(err){if(err)return void result.end(err);deeper?aborting||(aborting=!0,deeper.end()):result.end()}let deeper,iteration=0,depth=0,aborting=!1;const result=pushable();return{source:result,sink:pullWrite(write,null,1,end)}}const pair=pullPair(),result=pushable(),pausable=pause(()=>{});let pendingResumes=0;return pull(pair.source,pausable,trickle(0,-1),batch(1/0),pull.asyncMap(reduce),pull.collect((err,roots)=>{err?result.end(err):1===roots.length?(result.push(roots[0]),result.end()):roots.length>1?result.end(new Error("expected a maximum of 1 roots and got "+roots.length)):result.end()})),{sink:pair.sink,source:result}}},function(module,exports,__webpack_require__){"use strict";const pullBlock=__webpack_require__(594);module.exports=(options=>{return pullBlock("number"==typeof options?options:options.maxChunkSize,{zeroPadding:!1,emitEmpty:!0})})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(12);module.exports=(multihash=>{return Buffer.isBuffer(multihash)?mh.toB58String(multihash):multihash})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function dirExporter(node,name,pathRest,ipldResolver,resolve,parent){const accepts=pathRest[0],dir={path:name,hash:node.multihash},streams=[pull(pull.values(node.links),pull.map(link=>({linkName:link.name,path:path.join(name,link.name),hash:link.multihash})),pull.filter(item=>void 0===accepts||item.linkName===accepts),paramap((item,cb)=>ipldResolver.get(new CID(item.hash),(err,n)=>{if(err)return cb(err);cb(null,resolve(n.value,accepts||item.path,pathRest,ipldResolver,name,parent))})),pull.flatten())];return pathRest.length||streams.unshift(pull.values([dir])),pathRest.shift(),cat(streams)}const path=__webpack_require__(43),pull=__webpack_require__(4),paramap=__webpack_require__(139),CID=__webpack_require__(8),cat=__webpack_require__(138);module.exports=dirExporter},function(module,exports,__webpack_require__){"use strict";function shardedDirExporter(node,name,pathRest,ipldResolver,resolve,parent){let dir;parent&&parent.path===name||(dir=[{path:name,hash:cleanHash(node.multihash)}]);const streams=[pull(pull.values(node.links),pull.map(link=>{const p=link.name.substring(2),pp=p?path.join(name,p):name;let accept=!0,fromPathRest=!1;return p&&pathRest.length&&(fromPathRest=!0,accept=p===pathRest[0]),accept?{fromPathRest:fromPathRest,name:p,path:pp,hash:link.multihash,pathRest:p?pathRest.slice(1):pathRest}:""}),pull.filter(Boolean),paramap((item,cb)=>ipldResolver.get(new CID(item.hash),(err,n)=>{if(err)return cb(err);cb(null,resolve(n.value,item.fromPathRest?item.name:item.path,item.pathRest,ipldResolver,dir&&dir[0]||parent))})),pull.flatten())];return pathRest.length||streams.unshift(pull.values(dir)),cat(streams)}const path=__webpack_require__(43),pull=__webpack_require__(4),paramap=__webpack_require__(139),CID=__webpack_require__(8),cat=__webpack_require__(138),cleanHash=__webpack_require__(415);module.exports=shardedDirExporter},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const traverse=__webpack_require__(257),UnixFS=__webpack_require__(41),CID=__webpack_require__(8),pull=__webpack_require__(4),paramap=__webpack_require__(139);module.exports=((node,name,pathRest,ipldResolver)=>{function getData(node){try{const file=UnixFS.unmarshal(node.data);return file.data||new Buffer(0)}catch(err){throw new Error("Failed to unmarshal node")}}function visitor(node){return pull(pull.values(node.links),paramap((link,cb)=>ipldResolver.get(new CID(link.multihash),cb)),pull.map(result=>result.value))}const accepts=pathRest.shift();if(void 0!==accepts&&accepts!==name)return pull.empty();let content=pull(traverse.depthFirst(node,visitor),pull.map(getData));const file=UnixFS.unmarshal(node.data);return pull.values([{content:content,path:name,size:file.fileSize()}])})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function pathBaseAndRest(path){let pathBase=path,pathRest="/";if(Buffer.isBuffer(path)&&(pathBase=new CID(path).toBaseEncodedString()),"string"==typeof path){0===path.indexOf("/ipfs/")&&(path=pathBase=path.substring(6));const subtreeStart=path.indexOf("/");subtreeStart>0&&(pathBase=path.substring(0,subtreeStart),pathRest=path.substring(subtreeStart))}else CID.isCID(pathBase)&&(pathBase=pathBase.toBaseEncodedString());return pathBase=new CID(pathBase).toBaseEncodedString(),{base:pathBase,rest:pathRest.split("/").filter(Boolean)}}const pull=__webpack_require__(4),CID=__webpack_require__(8),pullDefer=__webpack_require__(95),resolve=__webpack_require__(421).resolve;module.exports=((path,dag)=>{try{path=pathBaseAndRest(path)}catch(err){return pull.error(err)}const d=pullDefer.source(),cid=new CID(path.base);return dag.get(cid,(err,node)=>{if(err)return pull.error(err);d.resolve(pull.values([node]))}),pull(d,pull.map(result=>result.value),pull.map(node=>resolve(node,path.base,path.rest,dag)),pull.flatten())})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function sanitizeCID(cid){return new CID(cid.version,cid.codec,cid.multihash)}const path=__webpack_require__(43),CID=__webpack_require__(8),pull=__webpack_require__(4),pullDefer=__webpack_require__(95);module.exports=((node,name,pathRest,ipldResolver,resolve)=>{let newNode;if(pathRest.length){const pathElem=pathRest.shift();newNode=node[pathElem];const newName=path.join(name,pathElem);if(CID.isCID(newNode)){const d=pullDefer.source();return ipldResolver.get(sanitizeCID(newNode),(err,newNode)=>{err?d.resolve(pull.error(err)):d.resolve(resolve(newNode.value,newName,pathRest,ipldResolver,node))}),d}return void 0!==newNode?resolve(newNode,newName,pathRest,ipldResolver,node):pull.error("not found")}return pull.error(new Error("invalid node type"))})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function resolve(node,hash,pathRest,ipldResolver,parentNode){const type=typeOf(node),resolver=resolvers[type];return resolver?resolver(node,hash,pathRest,ipldResolver,resolve,parentNode):pull.error(new Error("Unkown node type "+type))}function typeOf(node){return Buffer.isBuffer(node.data)?UnixFS.unmarshal(node.data).type:"object"}const UnixFS=__webpack_require__(41),pull=__webpack_require__(4),resolvers={directory:__webpack_require__(416),"hamt-sharded-directory":__webpack_require__(417),file:__webpack_require__(418),object:__webpack_require__(420)};module.exports=Object.assign({resolve:resolve,typeOf:typeOf},resolvers)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(process){function exists(o){return Boolean(o)}function mapNode(node,index){return node.key}function reduceNodes(nodes){return nodes}function asyncTransformBucket(bucket,asyncMap,asyncReduce,callback){map(bucket._children.compactArray(),(child,callback)=>{child instanceof Bucket?asyncTransformBucket(child,asyncMap,asyncReduce,callback):asyncMap(child,(err,mappedChildren)=>{err?callback(err):callback(null,{bitField:bucket._children.bitField(),children:mappedChildren})})},(err,mappedChildren)=>{err?callback(err):asyncReduce(mappedChildren,callback)})}const SparseArray=__webpack_require__(663),map=__webpack_require__(73),eachSeries=__webpack_require__(71),wrapHash=__webpack_require__(424),defaultOptions={bits:8};class Bucket{constructor(options,parent,posAtParent){if(this._options=Object.assign({},defaultOptions,options),this._popCount=0,this._parent=parent,this._posAtParent=posAtParent,!this._options.hashFn)throw new Error("please define an options.hashFn");this._options.hash||(this._options.hash=wrapHash(this._options.hashFn)),this._children=new SparseArray}static isBucket(o){return o instanceof Bucket}put(key,value,callback){this._findNewBucketAndPos(key,(err,place)=>{if(err)return void callback(err);place.bucket._putAt(place,key,value),callback()})}get(key,callback){this._findChild(key,(err,child)=>{err?callback(err):callback(null,child&&child.value)})}del(key,callback){this._findPlace(key,(err,place)=>{if(err)return void callback(err);const child=place.bucket._at(place.pos);child&&child.key===key&&place.bucket._delAt(place.pos),callback(null)})}leafCount(){this._children.reduce((acc,child)=>{return child instanceof Bucket?acc+child.leafCount():acc+1},0)}childrenCount(){return this._children.length}onlyChild(callback){process.nextTick(()=>callback(null,this._children.get(0)))}eachLeafSeries(iterator,callback){eachSeries(this._children.compactArray(),(child,cb)=>{child instanceof Bucket?child.eachLeafSeries(iterator,cb):iterator(child.key,child.value,cb)},callback)}serialize(map,reduce){return reduce(this._children.reduce((acc,child,index)=>{return child&&(child instanceof Bucket?acc.push(child.serialize(map,reduce)):acc.push(map(child,index))),acc},[]))}asyncTransform(asyncMap,asyncReduce,callback){asyncTransformBucket(this,asyncMap,asyncReduce,callback)}toJSON(){return this.serialize(mapNode,reduceNodes)}prettyPrint(){return JSON.stringify(this.toJSON(),null," ")}tableSize(){return Math.pow(2,this._options.bits)}_findChild(key,callback){this._findPlace(key,(err,result)=>{if(err)return void callback(err);const child=result.bucket._at(result.pos);child&&child.key===key?callback(null,child):callback(null,void 0)})}_findPlace(key,callback){const hashValue=this._options.hash(key);hashValue.take(this._options.bits,(err,index)=>{if(err)return void callback(err);const child=this._children.get(index);if(child instanceof Bucket)child._findPlace(hashValue,callback);else{const place={bucket:this,pos:index,hash:hashValue};callback(null,place)}})}_findNewBucketAndPos(key,callback){this._findPlace(key,(err,place)=>{if(err)return void callback(err);const child=place.bucket._at(place.pos);if(child&&child.key!==key){const bucket=new Bucket(this._options,place.bucket,place.pos);place.bucket._putObjectAt(place.pos,bucket),bucket._findPlace(child.hash,(err,newPlace)=>{if(err)return void callback(err);newPlace.bucket._putAt(newPlace,child.key,child.value),bucket._findNewBucketAndPos(place.hash,callback)})}else callback(null,place)})}_putAt(place,key,value){this._putObjectAt(place.pos,{key:key,value:value,hash:place.hash})}_putObjectAt(pos,object){this._children.get(pos)||this._popCount++,this._children.set(pos,object)}_delAt(pos){this._children.get(pos)&&this._popCount--,this._children.unset(pos),this._level()}_level(){if(this._parent&&this._popCount<=1)if(1===this._popCount){const onlyChild=this._children.find(exists);if(!(onlyChild instanceof Bucket)){const hash=onlyChild.hash;hash.untake(this._options.bits);const place={pos:this._posAtParent,hash:hash};this._parent._putAt(place,onlyChild.key,onlyChild.value)}}else this._parent._delAt(this._posAtParent)}_at(index){return this._children.get(index)}}module.exports=Bucket}).call(exports,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";function byteBitsToInt(byte,start,length){return(byte&maskFor(start,length))>>>start}function maskFor(start,length){return START_MASKS[start]&STOP_MASKS[Math.min(length+start-1,7)]}const START_MASKS=[255,254,252,248,240,224,192,128],STOP_MASKS=[1,3,7,15,31,63,127,255];module.exports=class ConsumableBuffer{constructor(value){this._value=value,this._currentBytePos=value.length-1,this._currentBitPos=7}availableBits(){return this._currentBitPos+1+8*this._currentBytePos}totalBits(){return 8*this._value.length}take(bits){let pendingBits=bits,result=0;for(;pendingBits&&this._haveBits();){const byte=this._value[this._currentBytePos],availableBits=this._currentBitPos+1,taking=Math.min(availableBits,pendingBits),value=byteBitsToInt(byte,availableBits-taking,taking);result=(result<7;)this._currentBitPos-=8,this._currentBytePos+=1}_haveBits(){return this._currentBytePos>=0}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer,process){const whilst=__webpack_require__(74),ConsumableBuffer=__webpack_require__(423);module.exports=function(hashFn){return function(value){return value instanceof InfiniteHash?value:new InfiniteHash(value,hashFn)}};class InfiniteHash{constructor(value,hashFn){if("string"!=typeof value&&!Buffer.isBuffer(value))throw new Error("can only hash strings or buffers");this._value=value,this._hashFn=hashFn,this._depth=-1,this._availableBits=0,this._currentBufferIndex=0,this._buffers=[]}take(bits,callback){let pendingBits=bits;whilst(()=>this._availableBits{this._produceMoreBits(callback)},err=>{if(err)return void callback(err);let result=0;whilst(()=>pendingBits>0,callback=>{const hash=this._buffers[this._currentBufferIndex],available=Math.min(hash.availableBits(),pendingBits);result=(result<{if(err)return void callback(err);process.nextTick(()=>callback(null,result))})})}untake(bits){let pendingBits=bits;for(;pendingBits>0;){const hash=this._buffers[this._currentBufferIndex],availableForUntake=Math.min(hash.totalBits()-hash.availableBits(),pendingBits);hash.untake(availableForUntake),pendingBits-=availableForUntake,this._availableBits+=availableForUntake,this._currentBufferIndex>0&&hash.totalBits()===hash.availableBits()&&(this._depth--,this._currentBufferIndex--)}}_produceMoreBits(callback){this._depth++;const value=this._depth?this._value+this._depth:this._value;this._hashFn(value,(err,hashValue)=>{if(err)return void callback(err);const buffer=new ConsumableBuffer(hashValue);this._buffers.push(buffer),this._availableBits+=buffer.availableBits(),callback()})}}}).call(exports,__webpack_require__(0).Buffer,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";const Bucket=__webpack_require__(422);module.exports=function(options){return new Bucket(options)},module.exports.isBucket=Bucket.isBucket},function(module,exports,__webpack_require__){"use strict";(function(process){function createDirFlat(props){return new DirFlat(props)} +const asyncEachSeries=__webpack_require__(71),waterfall=__webpack_require__(7),CID=__webpack_require__(8),dagPB=__webpack_require__(52),UnixFS=__webpack_require__(41),DAGLink=dagPB.DAGLink,DAGNode=dagPB.DAGNode,Dir=__webpack_require__(117);class DirFlat extends Dir{constructor(props){super(),this._children={},Object.assign(this,props)}put(name,value,callback){this.multihash=void 0,this.size=void 0,this._children[name]=value,process.nextTick(callback)}get(name,callback){process.nextTick(()=>callback(null,this._children[name]))}childCount(){return Object.keys(this._children).length}directChildrenCount(){return this.childCount()}onlyChild(callback){process.nextTick(()=>callback(null,this._children[Object.keys(this._children)[0]]))}eachChildSeries(iterator,callback){asyncEachSeries(Object.keys(this._children),(key,callback)=>{iterator(key,this._children[key],callback)},callback)}flush(path,ipldResolver,source,callback){const links=Object.keys(this._children).map(key=>{const child=this._children[key];return new DAGLink(key,child.size,child.multihash)}),dir=new UnixFS("directory");waterfall([callback=>DAGNode.create(dir.marshal(),links,callback),(node,callback)=>{ipldResolver.put(node,{cid:new CID(node.multihash)},err=>callback(err,node))},(node,callback)=>{this.multihash=node.multihash,this.size=node.size;const pushable={path:path,multihash:node.multihash,size:node.size};source.push(pushable),callback(null,node)}],callback)}}module.exports=createDirFlat}).call(exports,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function createDirSharded(props){return new DirSharded(props)}function flush(options,bucket,path,ipldResolver,source,callback){function collectChild(child,index,callback){const labelPrefix=leftPad(index.toString(16).toUpperCase(),2,"0");if(Bucket.isBucket(child))flush(options,child,path,ipldResolver,null,(err,node)=>{if(err)return void callback(err);links.push(new DAGLink(labelPrefix,node.size,node.multihash)),callback()});else{const value=child.value,label=labelPrefix+child.key;links.push(new DAGLink(label,value.size,value.multihash)),callback()}}function haveLinks(links){const data=new Buffer(children.bitField().reverse()),dir=new UnixFS("hamt-sharded-directory",data);dir.fanout=bucket.tableSize(),dir.hashType=options.hashFn.code,waterfall([callback=>DAGNode.create(dir.marshal(),links,callback),(node,callback)=>{ipldResolver.put(node,{cid:new CID(node.multihash)},err=>callback(err,node))},(node,callback)=>{const pushable={path:path,multihash:node.multihash,size:node.size};source&&source.push(pushable),callback(null,node)}],callback)}const children=bucket._children;let index=0;const links=[];whilst(()=>index{const child=children.get(index);child?collectChild(child,index,err=>{index++,callback(err)}):(index++,callback())},err=>{if(err)return void callback(err);haveLinks(links)})}const leftPad=__webpack_require__(209),whilst=__webpack_require__(74),waterfall=__webpack_require__(7),CID=__webpack_require__(8),dagPB=__webpack_require__(52),UnixFS=__webpack_require__(41),DAGLink=dagPB.DAGLink,DAGNode=dagPB.DAGNode,multihashing=__webpack_require__(21),Dir=__webpack_require__(117),Bucket=__webpack_require__(425),hashFn=function(value,callback){multihashing(value,"murmur3-128",(err,hash)=>{if(err)callback(err);else{const justHash=hash.slice(2,10),length=justHash.length,result=new Buffer(length);for(let i=0;i{err?callback(err):(this.multihash=node.multihash,this.size=node.size),callback(null,node)})}}module.exports=createDirSharded}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function flatToShard(child,dir,threshold,callback){maybeFlatToShardOne(dir,threshold,(err,newDir)=>{if(err)return void callback(err);const parent=newDir.parent;parent?waterfall([callback=>{newDir!==dir?(child&&(child.parent=newDir),parent.put(newDir.parentKey,newDir,callback)):callback()},callback=>{parent?flatToShard(newDir,parent,threshold,callback):callback(null,newDir)}],callback):callback(null,newDir)})}function maybeFlatToShardOne(dir,threshold,callback){dir.flat&&dir.directChildrenCount()>=threshold?definitelyShardOne(dir,callback):callback(null,dir)}function definitelyShardOne(oldDir,callback){const newDir=DirSharded({root:oldDir.root,dir:!0,parent:oldDir.parent,parentKey:oldDir.parentKey,path:oldDir.path,dirty:oldDir.dirty,flat:!1});oldDir.eachChildSeries((key,value,callback)=>{newDir.put(key,value,callback)},err=>{err?callback(err):callback(err,newDir)})}const waterfall=__webpack_require__(7),DirSharded=__webpack_require__(427);module.exports=flatToShard},function(module,exports,__webpack_require__){"use strict";(function(process){const pause=__webpack_require__(249),pull=__webpack_require__(4),writable=__webpack_require__(99),pushable=__webpack_require__(30),assert=__webpack_require__(9),setImmediate=__webpack_require__(10),DAGBuilder=__webpack_require__(410),createTreeBuilder=__webpack_require__(430),chunkers={fixed:__webpack_require__(414)},defaultOptions={chunker:"fixed"};module.exports=function(ipldResolver,_options){function flush(callback){function proceed(){treeBuilder.flush((err,hash)=>{if(err)return treeBuilderStream.source.end(err),void callback(err);pausable.resume(),callback(null,hash)})}pausable.pause(),pending?waitingPending.push(proceed):proceed()}const options=Object.assign({},defaultOptions,_options),Chunker=chunkers[options.chunker];assert(Chunker,"Unknkown chunker named "+options.chunker);let pending=0;const waitingPending=[],entry={sink:writable((nodes,callback)=>{pending+=nodes.length,nodes.forEach(node=>entry.source.push(node)),setImmediate(callback)},null,1,err=>entry.source.end(err)),source:pushable()},dagStream=DAGBuilder(Chunker,ipldResolver,options),treeBuilder=createTreeBuilder(ipldResolver,options),treeBuilderStream=treeBuilder.stream(),pausable=pause(()=>{});return pull(entry,pausable,dagStream,pull.map(node=>{return pending--,pending||process.nextTick(()=>{for(;waitingPending.length;)waitingPending.shift()()}),node}),treeBuilderStream),{sink:entry.sink,source:treeBuilderStream.source,flush:flush}}}).call(exports,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";(function(process){function createTreeBuilder(ipldResolver,_options){function consumeQueue(action,callback){const args=action.args.concat(function(){action.cb.apply(null,arguments),callback()});action.fn.apply(null,args)}function getStream(){return stream}function addToTree(elem,callback){const pathElems=elem.path.split("/").filter(notEmpty);let parent=tree;const lastIndex=pathElems.length-1;let currentPath="";eachOfSeries(pathElems,(pathElem,index,callback)=>{currentPath&&(currentPath+="/"),currentPath+=pathElem;const last=index===lastIndex;parent.dirty=!0,parent.multihash=null,parent.size=null,last?waterfall([callback=>parent.put(pathElem,elem,callback),callback=>flatToShard(null,parent,options.shardSplitThreshold,callback),(newRoot,callback)=>{tree=newRoot,callback()}],callback):parent.get(pathElem,(err,treeNode)=>{if(err)return void callback(err);let dir=treeNode;dir&&dir instanceof Dir||(dir=DirFlat({dir:!0,parent:parent,parentKey:pathElem,path:currentPath,dirty:!0,flat:!0}));const parentDir=parent;parent=dir,parentDir.put(pathElem,dir,callback)})},callback)}function flushRoot(callback){queue.push({fn:flush,args:["",tree],cb:(err,node)=>{err?callback(err):callback(null,node&&node.multihash)}})}function flush(path,tree,callback){if(tree.dir){if(tree.root&&tree.childCount()>1&&!options.wrap)return void callback(new Error("detected more than one root"));tree.eachChildSeries((key,child,callback)=>{flush(path?path+"/"+key:key,child,callback)},err=>{if(err)return void callback(err);flushDir(path,tree,callback)})}else process.nextTick(callback)}function flushDir(path,tree,callback){return tree.root&&!options.wrap?void tree.onlyChild((err,onlyChild)=>{if(err)return void callback(err);callback(null,onlyChild)}):tree.dirty?(tree.dirty=!1,void tree.flush(path,ipldResolver,stream.source,(err,node)=>{err?callback(err):callback(null,node)})):void callback(null,tree.multihash)}const options=Object.assign({},defaultOptions,_options),queue=createQueue(consumeQueue,1);let stream=function(){function write(elems,callback){eachSeries(elems,(elem,callback)=>{queue.push({fn:addToTree,args:[elem],cb:err=>{err?callback(err):(source.push(elem),callback())}})},callback)}function ended(err){flushRoot(flushErr=>{source.end(flushErr||err)})}const sink=writable(write,null,1,ended),source=pushable();return{sink:sink,source:source}}(),tree=DirFlat({path:"",root:!0,dir:!0,dirty:!1,flat:!0});return{flush:flushRoot,stream:getStream}}function notEmpty(str){return Boolean(str)}const eachSeries=__webpack_require__(71),eachOfSeries=__webpack_require__(154),waterfall=__webpack_require__(7),createQueue=__webpack_require__(106),writable=__webpack_require__(99),pushable=__webpack_require__(30),DirFlat=__webpack_require__(426),flatToShard=__webpack_require__(428),Dir=__webpack_require__(117);module.exports=createTreeBuilder;const defaultOptions={wrap:!1,shardSplitThreshold:1e3}}).call(exports,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";exports.importer=exports.Importer=__webpack_require__(429),exports.exporter=exports.Exporter=__webpack_require__(419)},function(module,exports,__webpack_require__){"use strict";module.exports=`message Data { enum DataType { Raw = 0; Directory = 1; @@ -136,7 +129,7 @@ newDir!==dir?(child&&(child.parent=newDir),parent.put(newDir.parentKey,newDir,ca message Metadata { required string MimeType = 1; -}`},function(module,exports,__webpack_require__){"use strict";exports.util=__webpack_require__(225),exports.resolver=__webpack_require__(224)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(17),multibase=__webpack_require__(43),multicodec=__webpack_require__(44),codecs=__webpack_require__(35),codecVarints=__webpack_require__(38),multihash=__webpack_require__(17);class CID{constructor(version,codec,multihash){if("string"==typeof version)if(multibase.isEncoded(version)){const cid=multibase.decode(version);this.version=parseInt(cid.slice(0,1).toString("hex"),16),this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=mh.fromB58String(version),this.version=0;else if(Buffer.isBuffer(version)){const firstByte=version.slice(0,1),v=parseInt(firstByte.toString("hex"),16);if(0===v||1===v){const cid=version;this.version=v,this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=version,this.version=0}else if("number"==typeof version){if("string"!=typeof codec)throw new Error("codec must be string");if(0!==version&&1!==version)throw new Error("version must be a number equal to 0 or 1");mh.validate(multihash),this.codec=codec,this.version=version,this.multihash=multihash}}get buffer(){switch(this.version){case 0:return this.multihash;case 1:return Buffer.concat([Buffer("01","hex"),Buffer(codecVarints[this.codec]),this.multihash]);default:throw new Error("unsupported version")}}get prefix(){return Buffer.concat([new Buffer(`0${this.version}`,"hex"),codecVarints[this.codec],multihash.prefix(this.multihash)])}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");return new CID(0,this.codec,this.multihash)}toV1(){return new CID(1,this.codec,this.multihash)}toBaseEncodedString(base){switch(base=base||"base58btc",this.version){case 0:if("base58btc"!==base)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");return mh.toB58String(this.multihash);case 1:return multibase.encode(base,this.buffer).toString();default:throw new Error("Unsupported version")}}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(other){return this.codec===other.codec&&this.version===other.version&&this.multihash.equals(other.multihash)}}CID.codecs=codecs,CID.isCID=(other=>{return"CID"===other.constructor.name}),module.exports=CID}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function create(name,size,multihash,callback){callback(null,new DAGLink(name,size,multihash))}const DAGLink=__webpack_require__(61);module.exports=create},function(module,exports,__webpack_require__){"use strict";function addLink(node,link,callback){const links=cloneLinks(node),data=cloneData(node);if(link.constructor&&"DAGLink"===link.constructor.name);else if(link.constructor&&"DAGNode"===link.constructor.name)link=toDAGLink(link);else{link.multihash=link.multihash||link.hash;try{link=new DAGLink(link.name,link.size,link.multihash)}catch(err){return callback(err)}}links.push(link),create(data,links,callback)}const dagNodeUtil=__webpack_require__(102),cloneLinks=dagNodeUtil.cloneLinks,cloneData=dagNodeUtil.cloneData,toDAGLink=dagNodeUtil.toDAGLink,DAGLink=__webpack_require__(61),create=__webpack_require__(101);module.exports=addLink},function(module,exports,__webpack_require__){"use strict";function clone(dagNode,callback){create(cloneData(dagNode),cloneLinks(dagNode),callback)}const dagNodeUtil=__webpack_require__(102),cloneLinks=dagNodeUtil.cloneLinks,cloneData=dagNodeUtil.cloneData,create=__webpack_require__(101);module.exports=clone},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function rmLink(dagNode,nameOrMultihash,callback){const data=cloneData(dagNode);let links=cloneLinks(dagNode);if("string"==typeof nameOrMultihash)links=links.filter(link=>link.name!==nameOrMultihash);else{if(!Buffer.isBuffer(nameOrMultihash))return callback(new Error("second arg needs to be a name or multihash"),null);links=links.filter(link=>!link.multihash.equals(nameOrMultihash))}create(data,links,callback)}const dagNodeUtil=__webpack_require__(102),cloneLinks=dagNodeUtil.cloneLinks,cloneData=dagNodeUtil.cloneData,create=__webpack_require__(101);module.exports=rmLink}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";module.exports=`// An IPFS MerkleDAG Link +}`},function(module,exports,__webpack_require__){"use strict";exports.util=__webpack_require__(196),exports.resolver=__webpack_require__(195)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(12),multibase=__webpack_require__(134),multicodec=__webpack_require__(135),codecs=__webpack_require__(65),codecVarints=__webpack_require__(90),multihash=__webpack_require__(12);class CID{constructor(version,codec,multihash){if("string"==typeof version)if(multibase.isEncoded(version)){const cid=multibase.decode(version);this.version=parseInt(cid.slice(0,1).toString("hex"),16),this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=mh.fromB58String(version),this.version=0;else if(Buffer.isBuffer(version)){const firstByte=version.slice(0,1),v=parseInt(firstByte.toString("hex"),16);if(0===v||1===v){const cid=version;this.version=v,this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=version,this.version=0}else if("number"==typeof version){if("string"!=typeof codec)throw new Error("codec must be string");if(0!==version&&1!==version)throw new Error("version must be a number equal to 0 or 1");mh.validate(multihash),this.codec=codec,this.version=version,this.multihash=multihash}}get buffer(){switch(this.version){case 0:return this.multihash;case 1:return Buffer.concat([Buffer("01","hex"),Buffer(codecVarints[this.codec]),this.multihash]);default:throw new Error("unsupported version")}}get prefix(){return Buffer.concat([new Buffer(`0${this.version}`,"hex"),codecVarints[this.codec],multihash.prefix(this.multihash)])}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");return new CID(0,this.codec,this.multihash)}toV1(){return new CID(1,this.codec,this.multihash)}toBaseEncodedString(base){switch(base=base||"base58btc",this.version){case 0:if("base58btc"!==base)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");return mh.toB58String(this.multihash);case 1:return multibase.encode(base,this.buffer).toString();default:throw new Error("Unsupported version")}}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(other){return this.codec===other.codec&&this.version===other.version&&this.multihash.equals(other.multihash)}}CID.codecs=codecs,CID.isCID=(other=>{return"CID"===other.constructor.name}),module.exports=CID}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function create(name,size,multihash,callback){callback(null,new DAGLink(name,size,multihash))}const DAGLink=__webpack_require__(51);module.exports=create},function(module,exports,__webpack_require__){"use strict";function addLink(node,link,callback){const links=cloneLinks(node),data=cloneData(node);if(link.constructor&&"DAGLink"===link.constructor.name);else if(link.constructor&&"DAGNode"===link.constructor.name)link=toDAGLink(link);else{link.multihash=link.multihash||link.hash;try{link=new DAGLink(link.name,link.size,link.multihash)}catch(err){return callback(err)}}links.push(link),create(data,links,callback)}const dagNodeUtil=__webpack_require__(86),cloneLinks=dagNodeUtil.cloneLinks,cloneData=dagNodeUtil.cloneData,toDAGLink=dagNodeUtil.toDAGLink,DAGLink=__webpack_require__(51),create=__webpack_require__(85);module.exports=addLink},function(module,exports,__webpack_require__){"use strict";function clone(dagNode,callback){create(cloneData(dagNode),cloneLinks(dagNode),callback)}const dagNodeUtil=__webpack_require__(86),cloneLinks=dagNodeUtil.cloneLinks,cloneData=dagNodeUtil.cloneData,create=__webpack_require__(85);module.exports=clone},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function rmLink(dagNode,nameOrMultihash,callback){const data=cloneData(dagNode);let links=cloneLinks(dagNode);if("string"==typeof nameOrMultihash)links=links.filter(link=>link.name!==nameOrMultihash);else{if(!Buffer.isBuffer(nameOrMultihash))return callback(new Error("second arg needs to be a name or multihash"),null);links=links.filter(link=>!link.multihash.equals(nameOrMultihash))}create(data,links,callback)}const dagNodeUtil=__webpack_require__(86),cloneLinks=dagNodeUtil.cloneLinks,cloneData=dagNodeUtil.cloneData,create=__webpack_require__(85);module.exports=rmLink}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";module.exports=`// An IPFS MerkleDAG Link message PBLink { // multihash of the target object @@ -157,11 +150,10 @@ message PBNode { // opaque user data optional bytes Data = 1; -}`},function(module,exports,__webpack_require__){"use strict";const waterfall=__webpack_require__(9),util=__webpack_require__(136);exports=module.exports,exports.multicodec="dag-pb",exports.resolve=((block,path,callback)=>{waterfall([cb=>util.deserialize(block.data,cb),(node,cb)=>{const split=path.split("/");if("Links"===split[0]){let remainderPath="";if(!split[1])return cb(null,{value:node.links.map(l=>l.toJSON()),remainderPath:""});const values={};node.links.forEach((l,i)=>{const link=l.toJSON();values[i]={hash:link.multihash,name:link.name,size:link.size},values[link.name]=link.multihash});let value=values[split[1]];"Hash"===split[2]?value={"/":value.hash}:"Tsize"===split[2]?value={"/":value.size}:"Name"===split[2]&&(value={"/":value.name}),remainderPath=split.slice(3).join("/"),cb(null,{value:value,remainderPath:remainderPath})}else"Data"===split[0]?cb(null,{value:node.data,remainderPath:""}):cb(new Error("path not available"))}],callback)}),exports.tree=((block,options,callback)=>{"function"==typeof options&&(callback=options,options={}),options=options||{},util.deserialize(block.data,(err,node)=>{if(err)return callback(err);const paths=[];paths.push("Links"),node.links.forEach((link,i)=>{paths.push(`Links/${i}/Name`),paths.push(`Links/${i}/Tsize`),paths.push(`Links/${i}/Hash`)}),paths.push("Data"),callback(null,paths)})}),exports.isLink=((block,path,callback)=>{exports.resolve(block,path,(err,result)=>{return err?callback(err):result.remainderPath.length>0?callback(new Error("path out of scope")):void("object"==typeof result.value&&result.value["/"]?callback(null,result.value):callback(null,!1))})})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(137),multibase=__webpack_require__(43),multicodec=__webpack_require__(44),codecs=__webpack_require__(35),codecVarints=__webpack_require__(38),multihash=__webpack_require__(137);class CID{constructor(version,codec,multihash){if("string"==typeof version)if(multibase.isEncoded(version)){const cid=multibase.decode(version);this.version=parseInt(cid.slice(0,1).toString("hex"),16),this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=mh.fromB58String(version),this.version=0;else if(Buffer.isBuffer(version)){const firstByte=version.slice(0,1),v=parseInt(firstByte.toString("hex"),16);if(0===v||1===v){const cid=version;this.version=v,this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=version,this.version=0}else if("number"==typeof version){if("string"!=typeof codec)throw new Error("codec must be string");if(0!==version&&1!==version)throw new Error("version must be a number equal to 0 or 1");mh.validate(multihash),this.codec=codec,this.version=version,this.multihash=multihash}}get buffer(){switch(this.version){case 0:return this.multihash;case 1:return Buffer.concat([Buffer("01","hex"),Buffer(codecVarints[this.codec]),this.multihash]);default:throw new Error("unsupported version")}}get prefix(){return Buffer.concat([new Buffer(`0${this.version}`,"hex"),codecVarints[this.codec],multihash.prefix(this.multihash)])}toV0(){return this.multihash}toV1(){return this.buffer}toBaseEncodedString(base){switch(base=base||"base58btc",this.version){case 0:return mh.toB58String(this.multihash);case 1:return multibase.encode(base,this.buffer).toString();default:throw new Error("Unsupported version")}}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(other){return this.codec===other.codec&&this.version===other.version&&this.multihash.equals(other.multihash)}}CID.codecs=codecs,CID.isCID=(other=>{return"CID"===other.constructor.name}),module.exports=CID}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.names={sha1:17,"sha2-256":18,"sha2-512":19,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,murmur3:34,blake2b:64,blake2s:65},exports.codes={17:"sha1",18:"sha2-256",19:"sha2-512",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384",29:"keccak-512",34:"murmur3",64:"blake2b",65:"blake2s"},exports.defaultLengths={17:20,18:32,19:64,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,64:64,65:32}},function(module,exports,__webpack_require__){"use strict";function cidForHash(codec,rawhash){return new CID(1,codec,multihashes.encode(rawhash,"keccak-256"))}const CID=__webpack_require__(507),multihashes=__webpack_require__(137);module.exports={cidForHash:cidForHash}},function(module,exports,__webpack_require__){"use strict";exports.util=__webpack_require__(226),exports.resolver=__webpack_require__(511)},function(module,exports,__webpack_require__){"use strict";const util=__webpack_require__(226);exports=module.exports,exports.multicodec="eth-account-snapshot",exports.resolve=((block,path,callback)=>{let result;util.deserialize(block.data,(err,node)=>{if(err)return callback(err);if(!path||"/"===path)return result={value:node,remainderPath:""},callback(null,result);let pathParts=path.split("/"),firstPart=pathParts.shift(),remainderPath=pathParts.join("/");exports.tree(block,(err,paths)=>{if(err)return callback(err);let treeResult=paths.find(child=>child.path===firstPart);if(!treeResult){let err=new Error('Path not found ("'+firstPart+'").');return callback(err)}return result={value:treeResult.value,remainderPath:remainderPath},callback(null,result)})})}),exports.tree=((block,options,callback)=>{"function"==typeof options&&(callback=options,options=void 0),options||(options={}),util.deserialize(block.data,(err,account)=>{if(err)return callback(err);const paths=[];paths.push({path:"stateRoot",value:account.stateRoot}),paths.push({path:"codeHash",value:account.codeHash}),paths.push({path:"nonce",value:account.nonce}),paths.push({path:"balance",value:account.balance}),paths.push({path:"isEmpty",value:account.isEmpty()}),paths.push({path:"isContract",value:account.isContract()}),callback(null,paths)})})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(103),multibase=__webpack_require__(43),multicodec=__webpack_require__(44),codecs=__webpack_require__(35),codecVarints=__webpack_require__(38),multihash=__webpack_require__(103);class CID{constructor(version,codec,multihash){if("string"==typeof version)if(multibase.isEncoded(version)){const cid=multibase.decode(version);this.version=parseInt(cid.slice(0,1).toString("hex"),16),this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=mh.fromB58String(version),this.version=0;else if(Buffer.isBuffer(version)){const firstByte=version.slice(0,1),v=parseInt(firstByte.toString("hex"),16);if(0===v||1===v){const cid=version;this.version=v,this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=version,this.version=0}else if("number"==typeof version){if("string"!=typeof codec)throw new Error("codec must be string");if(0!==version&&1!==version)throw new Error("version must be a number equal to 0 or 1");mh.validate(multihash),this.codec=codec,this.version=version,this.multihash=multihash}}get buffer(){switch(this.version){case 0:return this.multihash;case 1:return Buffer.concat([Buffer("01","hex"),Buffer(codecVarints[this.codec]),this.multihash]);default:throw new Error("unsupported version")}}get prefix(){return Buffer.concat([new Buffer(`0${this.version}`,"hex"),codecVarints[this.codec],multihash.prefix(this.multihash)])}toV0(){return this.multihash}toV1(){return this.buffer}toBaseEncodedString(base){switch(base=base||"base58btc",this.version){case 0:return mh.toB58String(this.multihash);case 1:return multibase.encode(base,this.buffer).toString();default:throw new Error("Unsupported version")}}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(other){return this.codec===other.codec&&this.version===other.version&&this.multihash.equals(other.multihash)}}CID.codecs=codecs,CID.isCID=(other=>{return"CID"===other.constructor.name}),module.exports=CID}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.names={sha1:17,"sha2-256":18,"sha2-512":19,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,murmur3:34,blake2b:64,blake2s:65},exports.codes={17:"sha1",18:"sha2-256",19:"sha2-512",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384",29:"keccak-512",34:"murmur3",64:"blake2b",65:"blake2s"},exports.defaultLengths={17:20,18:32,19:64,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,64:64,65:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function webCryptoHash(type){if(!webCrypto)throw new Error("Please use a browser with webcrypto support");return(data,callback)=>{const res=webCrypto.digest({name:type},data);if("function"!=typeof res.then)return res.onerror=(()=>{callback(`Error hashing data using ${type}`)}),void(res.oncomplete=(e=>{callback(null,e.target.result)}));nodeify(res.then(raw=>new Buffer(new Uint8Array(raw))),callback)}}function sha1(buf,callback){webCryptoHash("SHA-1")(buf,callback)}function sha2256(buf,callback){webCryptoHash("SHA-256")(buf,callback)}function sha2512(buf,callback){webCryptoHash("SHA-512")(buf,callback)}const nodeify=__webpack_require__(81),webCrypto=function(){if("undefined"!=typeof window){if(window.crypto)return window.crypto.subtle||window.crypto.webkitSubtle;if(window.msCrypto)return window.msCrypto.subtle}}();module.exports={sha1:sha1,sha2256:sha2256,sha2512:sha2512}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const sha3=__webpack_require__(237),toCallback=__webpack_require__(517),sha=__webpack_require__(514),toBuf=(doWork,other)=>input=>{return new Buffer(doWork(input,other),"hex")};module.exports={sha1:sha.sha1,sha2256:sha.sha2256,sha2512:sha.sha2512,sha3512:toCallback(toBuf(sha3.sha3_512)),sha3384:toCallback(toBuf(sha3.sha3_384)),sha3256:toCallback(toBuf(sha3.sha3_256)),sha3224:toCallback(toBuf(sha3.sha3_224)),shake128:toCallback(toBuf(sha3.shake_128,256)),shake256:toCallback(toBuf(sha3.shake_256,512)),keccak224:toCallback(toBuf(sha3.keccak_224)),keccak256:toCallback(toBuf(sha3.keccak_256)),keccak384:toCallback(toBuf(sha3.keccak_384)),keccak512:toCallback(toBuf(sha3.keccak_512))}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function Multihashing(buf,func,length,callback){if("function"==typeof length&&(callback=length,length=void 0),!callback)throw new Error("Missing callback");Multihashing.digest(buf,func,length,(err,digest)=>{if(err)return callback(err);callback(null,multihash.encode(digest,func,length))})}const multihash=__webpack_require__(103),crypto=__webpack_require__(515);module.exports=Multihashing,Multihashing.Buffer=Buffer,Multihashing.multihash=multihash,Multihashing.digest=function(buf,func,length,callback){if("function"==typeof length&&(callback=length,length=void 0),!callback)throw new Error("Missing callback");let cb=callback;length&&(cb=((err,digest)=>{if(err)return callback(err);callback(null,digest.slice(0,length))}));let hash;try{hash=Multihashing.createHash(func)}catch(err){return cb(err)}hash(buf,cb)},Multihashing.createHash=function(func){if(func=multihash.coerceCode(func),!Multihashing.functions[func])throw new Error("multihash function "+func+" not yet supported");return Multihashing.functions[func]},Multihashing.functions={17:crypto.sha1,18:crypto.sha2256,19:crypto.sha2512,20:crypto.sha3512,21:crypto.sha3384,22:crypto.sha3256,23:crypto.sha3224,24:crypto.shake128,25:crypto.shake256,26:crypto.keccak224,27:crypto.keccak256,28:crypto.keccak384,29:crypto.keccak512}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const setImmediate=__webpack_require__(11);module.exports=function(doWork){return function(input,callback){const done=(err,res)=>setImmediate(()=>{callback(err,res)});let res;try{res=doWork(input)}catch(err){return void done(err)}done(null,res)}}},function(module,exports,__webpack_require__){"use strict";exports.util=__webpack_require__(228),exports.resolver=__webpack_require__(519)},function(module,exports,__webpack_require__){"use strict";const async=__webpack_require__(86),EthBlockHead=__webpack_require__(209),IpldEthBlock=__webpack_require__(231),util=__webpack_require__(228);__webpack_require__(227).cidForHash;exports=module.exports,exports.multicodec="eth-block-list",exports.resolve=((block,path,callback)=>{util.deserialize(block.data,(err,ethBlockList)=>{if(err)return callback(err);exports.resolveFromObject(ethBlockList,path,callback)})}),exports.resolveFromObject=((ethBlockList,path,callback)=>{let result;if(!path||"/"===path)return result={value:ethBlockList,remainderPath:""},callback(null,result);exports.treeFromObject(ethBlockList,{},(err,paths)=>{if(err)return callback(err);let matches=paths.filter(child=>child.path===path.slice(0,child.path.length)),sortedMatches=matches.sort((a,b)=>a.path.length{"function"==typeof options&&(callback=options,options=void 0),options||(options={}),util.deserialize(block.data,(err,ethBlockList)=>{if(err)return callback(err);exports.treeFromObject(ethBlockList,options,callback)})}),exports.treeFromObject=((ethBlockList,options,callback)=>{let paths=[];paths.push({path:"count",value:ethBlockList.length}),async.each(ethBlockList,(rawBlock,next)=>{let index=ethBlockList.indexOf(rawBlock),blockPath=index.toString(),ethBlock=new EthBlockHead(rawBlock);paths.push({path:blockPath,value:ethBlock}),IpldEthBlock.resolver.treeFromObject(ethBlock,{},(err,subpaths)=>{if(err)return next(err);subpaths.forEach(path=>path.path=blockPath+"/"+path.path),paths=paths.concat(subpaths),next()})},err=>{if(err)return callback(err);callback(null,paths)})})},function(module,exports,__webpack_require__){"use strict";exports.names={sha1:17,"sha2-256":18,"sha2-512":19,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,"murmur3-128":34,"murmur3-32":35,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664},exports.codes={17:"sha1",18:"sha2-256",19:"sha2-512",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384",29:"keccak-512",34:"murmur3-128",35:"murmur3-32",45569:"blake2b-8",45570:"blake2b-16",45571:"blake2b-24",45572:"blake2b-32",45573:"blake2b-40",45574:"blake2b-48",45575:"blake2b-56",45576:"blake2b-64",45577:"blake2b-72",45578:"blake2b-80",45579:"blake2b-88",45580:"blake2b-96",45581:"blake2b-104",45582:"blake2b-112",45583:"blake2b-120",45584:"blake2b-128",45585:"blake2b-136",45586:"blake2b-144",45587:"blake2b-152",45588:"blake2b-160",45589:"blake2b-168",45590:"blake2b-176",45591:"blake2b-184",45592:"blake2b-192",45593:"blake2b-200",45594:"blake2b-208",45595:"blake2b-216",45596:"blake2b-224",45597:"blake2b-232",45598:"blake2b-240",45599:"blake2b-248",45600:"blake2b-256",45601:"blake2b-264",45602:"blake2b-272",45603:"blake2b-280",45604:"blake2b-288",45605:"blake2b-296",45606:"blake2b-304",45607:"blake2b-312",45608:"blake2b-320",45609:"blake2b-328",45610:"blake2b-336",45611:"blake2b-344",45612:"blake2b-352",45613:"blake2b-360",45614:"blake2b-368",45615:"blake2b-376",45616:"blake2b-384",45617:"blake2b-392",45618:"blake2b-400",45619:"blake2b-408",45620:"blake2b-416",45621:"blake2b-424",45622:"blake2b-432",45623:"blake2b-440",45624:"blake2b-448",45625:"blake2b-456",45626:"blake2b-464",45627:"blake2b-472",45628:"blake2b-480",45629:"blake2b-488",45630:"blake2b-496",45631:"blake2b-504",45632:"blake2b-512",45633:"blake2s-8",45634:"blake2s-16",45635:"blake2s-24",45636:"blake2s-32",45637:"blake2s-40",45638:"blake2s-48",45639:"blake2s-56",45640:"blake2s-64",45641:"blake2s-72",45642:"blake2s-80",45643:"blake2s-88",45644:"blake2s-96",45645:"blake2s-104",45646:"blake2s-112",45647:"blake2s-120",45648:"blake2s-128",45649:"blake2s-136",45650:"blake2s-144",45651:"blake2s-152",45652:"blake2s-160",45653:"blake2s-168",45654:"blake2s-176",45655:"blake2s-184",45656:"blake2s-192",45657:"blake2s-200",45658:"blake2s-208",45659:"blake2s-216",45660:"blake2s-224",45661:"blake2s-232",45662:"blake2s-240",45663:"blake2s-248",45664:"blake2s-256"},exports.defaultLengths={17:20,18:32,19:64,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,45569:1,45570:2,45571:3,45572:4,45573:5,45574:6,45575:7,45576:8,45577:9,45578:10,45579:11,45580:12,45581:13,45582:14,45583:15,45584:16,45585:17,45586:18,45587:19,45588:20,45589:21,45590:22,45591:23,45592:24,45593:25,45594:26,45595:27,45596:28,45597:29,45598:30,45599:31,45600:32,45601:33,45602:34,45603:35,45604:36,45605:37,45606:38,45607:39,45608:40,45609:41,45610:42,45611:43,45612:44,45613:45,45614:46,45615:47,45616:48,45617:49,45618:50,45619:51,45620:52,45621:53,45622:54,45623:55,45624:56,45625:57,45626:58,45627:59,45628:60,45629:61,45630:62,45631:63,45632:64,45633:1,45634:2,45635:3,45636:4,45637:5,45638:6,45639:7,45640:8,45641:9,45642:10,45643:11,45644:12,45645:13,45646:14,45647:15,45648:16,45649:17,45650:18,45651:19,45652:20,45653:21,45654:22,45655:23,45656:24,45657:25,45658:26,45659:27,45660:28,45661:29,45662:30,45663:31,45664:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(229),multibase=__webpack_require__(43),multicodec=__webpack_require__(44),codecs=__webpack_require__(35),codecVarints=__webpack_require__(38),multihash=__webpack_require__(229);class CID{constructor(version,codec,multihash){if("string"==typeof version)if(multibase.isEncoded(version)){const cid=multibase.decode(version);this.version=parseInt(cid.slice(0,1).toString("hex"),16),this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=mh.fromB58String(version),this.version=0;else if(Buffer.isBuffer(version)){const firstByte=version.slice(0,1),v=parseInt(firstByte.toString("hex"),16);if(0===v||1===v){const cid=version;this.version=v,this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=version,this.version=0}else if("number"==typeof version){if("string"!=typeof codec)throw new Error("codec must be string");if(0!==version&&1!==version)throw new Error("version must be a number equal to 0 or 1");mh.validate(multihash),this.codec=codec,this.version=version,this.multihash=multihash}}get buffer(){switch(this.version){case 0:return this.multihash;case 1:return Buffer.concat([Buffer("01","hex"),Buffer(codecVarints[this.codec]),this.multihash]);default:throw new Error("unsupported version")}}get prefix(){return Buffer.concat([new Buffer(`0${this.version}`,"hex"),codecVarints[this.codec],multihash.prefix(this.multihash)])}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");return new CID(0,this.codec,this.multihash)}toV1(){return new CID(1,this.codec,this.multihash)}toBaseEncodedString(base){switch(base=base||"base58btc",this.version){case 0:if("base58btc"!==base)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");return mh.toB58String(this.multihash);case 1:return multibase.encode(base,this.buffer).toString();default:throw new Error("Unsupported version")}}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(other){return this.codec===other.codec&&this.version===other.version&&this.multihash.equals(other.multihash)}}CID.codecs=codecs,CID.isCID=(other=>{return"CID"===other.constructor.name}),module.exports=CID}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.names={sha1:17,"sha2-256":18,"sha2-512":19,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,murmur3:34,blake2b:64,blake2s:65},exports.codes={17:"sha1",18:"sha2-256",19:"sha2-512",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384",29:"keccak-512",34:"murmur3",64:"blake2b",65:"blake2s"},exports.defaultLengths={17:20,18:32,19:64,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,64:64,65:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function validate(multihash){if(!Buffer.isBuffer(multihash))throw new Error("multihash must be a Buffer");if(multihash.length<3)throw new Error("multihash too short. must be > 3 bytes.");if(multihash.length>129)throw new Error("multihash too long. must be < 129 bytes.");let code=multihash[0];if(!exports.isValidCode(code))throw new Error(`multihash unknown function code: 0x${code.toString(16)}`);if(multihash.slice(2).length!==multihash[1])throw new Error(`multihash length inconsistent: 0x${multihash.toString("hex")}`)}const bs58=__webpack_require__(24),cs=__webpack_require__(522);exports.toHexString=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return hash.toString("hex")},exports.fromHexString=function(hash){return new Buffer(hash,"hex")},exports.toB58String=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return bs58.encode(hash)},exports.fromB58String=function(hash){let encoded=hash;return Buffer.isBuffer(hash)&&(encoded=hash.toString()),new Buffer(bs58.decode(encoded))},exports.decode=function(buf){exports.validate(buf);const code=buf[0];return{code:code,name:cs.codes[code],length:buf[1],digest:buf.slice(2)}},exports.encode=function(digest,code,length){if(!digest||!code)throw new Error("multihash encode requires at least two args: digest, code");const hashfn=exports.coerceCode(code);if(!Buffer.isBuffer(digest))throw new Error("digest should be a Buffer");if(null==length&&(length=digest.length),length&&digest.length!==length)throw new Error("digest length should be equal to specified length.");if(length>127)throw new Error("multihash does not yet support digest lengths greater than 127 bytes.");return Buffer.concat([new Buffer([hashfn,length]),digest])},exports.coerceCode=function(name){let code=name;if("string"==typeof name){if(!cs.names[name])throw new Error(`Unrecognized hash function named: ${name}`);code=cs.names[name]}if("number"!=typeof code)throw new Error(`Hash function code should be a number. Got: ${code}`);if(!cs.codes[code]&&!exports.isAppCode(code))throw new Error(`Unrecognized function code: ${code}`);return code},exports.isAppCode=function(code){return code>0&&code<16},exports.isValidCode=function(code){return!!exports.isAppCode(code)||!!cs.codes[code]},exports.validate=validate,exports.prefix=function(multihash){return validate(multihash),multihash.slice(0,2)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const util=__webpack_require__(232),cidForHash=__webpack_require__(230).cidForHash;exports=module.exports,exports.multicodec="eth-block",exports.resolve=((block,path,callback)=>{util.deserialize(block.data,(err,ethBlock)=>{if(err)return callback(err);exports.resolveFromObject(ethBlock,path,callback)})}),exports.resolveFromObject=((ethBlock,path,callback)=>{let result;if(!path||"/"===path)return result={value:ethBlock,remainderPath:""},callback(null,result);let pathParts=path.split("/"),firstPart=pathParts.shift(),remainderPath=pathParts.join("/");exports.treeFromObject(ethBlock,{},(err,paths)=>{if(err)return callback(err);let treeResult=paths.find(child=>child.path===firstPart);if(!treeResult){let err=new Error('Path not found ("'+firstPart+'").');return callback(err)}return result={value:treeResult.value,remainderPath:remainderPath},callback(null,result)})}),exports.tree=((block,options,callback)=>{"function"==typeof options&&(callback=options,options=void 0),options||(options={}),util.deserialize(block.data,(err,ethBlock)=>{if(err)return callback(err);exports.treeFromObject(ethBlock,options,callback)})}),exports.treeFromObject=((ethBlock,options,callback)=>{const paths=[];paths.push({path:"parent",value:{"/":cidForHash("eth-block",ethBlock.parentHash).toBaseEncodedString()}}),paths.push({path:"ommers",value:{"/":cidForHash("eth-block-list",ethBlock.uncleHash).toBaseEncodedString()}}),paths.push({path:"transactions",value:{"/":cidForHash("eth-tx-trie",ethBlock.transactionsTrie).toBaseEncodedString()}}),paths.push({path:"transactionReceipts",value:{"/":cidForHash("eth-tx-receipt-trie",ethBlock.receiptTrie).toBaseEncodedString()}}),paths.push({path:"state",value:{"/":cidForHash("eth-state-trie",ethBlock.stateRoot).toBaseEncodedString()}}),paths.push({path:"parentHash",value:ethBlock.parentHash}),paths.push({path:"ommerHash",value:ethBlock.uncleHash}),paths.push({path:"transactionTrieRoot",value:ethBlock.transactionsTrie}),paths.push({path:"transactionReceiptTrieRoot",value:ethBlock.receiptTrie}),paths.push({path:"stateRoot",value:ethBlock.stateRoot}),paths.push({path:"authorAddress",value:ethBlock.coinbase}),paths.push({path:"bloom",value:ethBlock.bloom}),paths.push({path:"difficulty",value:ethBlock.difficulty}),paths.push({path:"number",value:ethBlock.number}),paths.push({path:"gasLimit",value:ethBlock.gasLimit}),paths.push({path:"gasUsed",value:ethBlock.gasUsed}),paths.push({path:"timestamp",value:ethBlock.timestamp}),paths.push({path:"extraData",value:ethBlock.extraData}),paths.push({path:"mixHash",value:ethBlock.mixHash}),paths.push({path:"nonce",value:ethBlock.nonce}),callback(null,paths)})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function resolve(block,path,callback){waterfall([cb=>resolver.resolve(trieIpldFormat,block,path,cb),(result,cb)=>{if(isExternalLink(result.value)||0===result.remainderPath.length)return cb(null,result);toIpfsBlock(result.value,(err,block)=>{if(err)return cb(err);IpldEthAccountSnapshotResolver.resolve(block,result.remainderPath,cb)})}],callback)}function tree(block,options,callback){exports.util.deserialize(block.data,(err,trieNode)=>{return err?callback(err):"leaf"===trieNode.type?waterfall([cb=>toIpfsBlock(trieNode.getValue(),cb),(block,cb)=>IpldEthAccountSnapshotResolver.tree(block,options,cb)],callback):void waterfall([cb=>resolver.treeFromObject(trieIpldFormat,trieNode,options,cb),(result,cb)=>{let paths=[];each(result,(child,next)=>{if(!Buffer.isBuffer(child.value))return paths.push(child),next();let key=child.key;waterfall([cb=>toIpfsBlock(child.value,cb),(block,cb)=>IpldEthAccountSnapshotResolver.tree(block,options,cb),(subpaths,cb)=>{paths=paths.concat(subpaths.map(p=>{p.path=key+"/"+p.path})),cb()}],next)},err=>{if(err)return cb(err);cb(null,paths)})}],callback)})}function toIpfsBlock(value,callback){multihashing(value,"keccak-256",(err,hash)=>{if(err)return callback(err);callback(null,new IpfsBlock(value,new CID(1,IpldEthAccountSnapshotResolver.multicodec,hash)))})}const each=__webpack_require__(32),waterfall=__webpack_require__(9),util=__webpack_require__(104),resolver=__webpack_require__(139),isExternalLink=__webpack_require__(77).isExternalLink,IpldEthAccountSnapshotResolver=__webpack_require__(510).resolver,IpfsBlock=__webpack_require__(60),CID=__webpack_require__(12),multihashing=__webpack_require__(30),trieIpldFormat="eth-state-trie";exports.util={deserialize:util.deserialize,serialize:util.serialize,cid:util.cid.bind(null,trieIpldFormat)},exports.resolver={multicodec:trieIpldFormat,tree:tree,resolve:resolve}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function resolve(block,path,callback){resolver.resolve(trieIpldFormat,block,path,(err,result)=>{return err?callback(err):callback(null,result)})}function tree(block,options,callback){"function"==typeof options&&(callback=options,options={}),exports.util.deserialize(block.data,(err,trieNode)=>{if(err)return callback(err);resolver.treeFromObject(trieIpldFormat,trieNode,options,(err,result)=>{if(err)return callback(err);callback(null,result)})})}const util=__webpack_require__(104),resolver=__webpack_require__(139),trieIpldFormat="eth-storage-trie";exports.util={deserialize:util.deserialize,serialize:util.serialize,cid:util.cid.bind(null,trieIpldFormat)},exports.resolver={multicodec:trieIpldFormat,tree:tree,resolve:resolve}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(138),multibase=__webpack_require__(43),multicodec=__webpack_require__(44),codecs=__webpack_require__(35),codecVarints=__webpack_require__(38),multihash=__webpack_require__(138);class CID{constructor(version,codec,multihash){if("string"==typeof version)if(multibase.isEncoded(version)){const cid=multibase.decode(version);this.version=parseInt(cid.slice(0,1).toString("hex"),16),this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=mh.fromB58String(version),this.version=0;else if(Buffer.isBuffer(version)){const firstByte=version.slice(0,1),v=parseInt(firstByte.toString("hex"),16);if(0===v||1===v){const cid=version;this.version=v,this.codec=multicodec.getCodec(cid.slice(1)), -this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=version,this.version=0}else if("number"==typeof version){if("string"!=typeof codec)throw new Error("codec must be string");if(0!==version&&1!==version)throw new Error("version must be a number equal to 0 or 1");mh.validate(multihash),this.codec=codec,this.version=version,this.multihash=multihash}}get buffer(){switch(this.version){case 0:return this.multihash;case 1:return Buffer.concat([Buffer("01","hex"),Buffer(codecVarints[this.codec]),this.multihash]);default:throw new Error("unsupported version")}}get prefix(){return Buffer.concat([new Buffer(`0${this.version}`,"hex"),codecVarints[this.codec],multihash.prefix(this.multihash)])}toV0(){return this.multihash}toV1(){return this.buffer}toBaseEncodedString(base){switch(base=base||"base58btc",this.version){case 0:return mh.toB58String(this.multihash);case 1:return multibase.encode(base,this.buffer).toString();default:throw new Error("Unsupported version")}}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(other){return this.codec===other.codec&&this.version===other.version&&this.multihash.equals(other.multihash)}}CID.codecs=codecs,CID.isCID=(other=>{return"CID"===other.constructor.name}),module.exports=CID}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.names={sha1:17,"sha2-256":18,"sha2-512":19,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,murmur3:34,blake2b:64,blake2s:65},exports.codes={17:"sha1",18:"sha2-256",19:"sha2-512",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384",29:"keccak-512",34:"murmur3",64:"blake2b",65:"blake2s"},exports.defaultLengths={17:20,18:32,19:64,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,64:64,65:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function resolve(block,path,callback){resolver.resolve(trieIpldFormat,block,path,(err,result)=>{if(err)return callback(err);if(isExternalLink(result.value)||0===result.remainderPath.length)return callback(null,result);let block=new IpfsBlock(result.value);IpldEthTxResolver.resolve(block,result.remainderPath,callback)})}function tree(block,options,callback){exports.util.deserialize(block.data,(err,trieNode)=>{if(err)return callback(err);if("leaf"===trieNode.type){let block=new IpfsBlock(trieNode.getValue());return void IpldEthTxResolver.tree(block,options,(err,paths)=>{if(err)return callback(err);callback(null,paths)})}resolver.treeFromObject(trieIpldFormat,trieNode,options,(err,result)=>{if(err)return callback(err);let paths=[];async.each(result,(child,next)=>{if(Buffer.isBuffer(child.value)){let key=child.key,block=new IpfsBlock(child.value);IpldEthTxResolver.tree(block,options,(err,subpaths)=>{if(err)return next(err);subpaths.forEach(path=>{path.path=key+"/"+path.path}),paths=paths.concat(subpaths)})}else paths.push(child),next()},err=>{if(err)return callback(err);callback(null,paths)})})})}const async=__webpack_require__(86),util=__webpack_require__(104),resolver=__webpack_require__(139),isExternalLink=__webpack_require__(77).isExternalLink,IpldEthTxResolver=__webpack_require__(535).resolver,IpfsBlock=__webpack_require__(60),trieIpldFormat="eth-tx-trie";exports.util={deserialize:util.deserialize,serialize:util.serialize,cid:util.cid.bind(null,trieIpldFormat)},exports.resolver={multicodec:trieIpldFormat,tree:tree,resolve:resolve}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.names={sha1:17,"sha2-256":18,"sha2-512":19,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,"murmur3-128":34,"murmur3-32":35,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664},exports.codes={17:"sha1",18:"sha2-256",19:"sha2-512",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384",29:"keccak-512",34:"murmur3-128",35:"murmur3-32",45569:"blake2b-8",45570:"blake2b-16",45571:"blake2b-24",45572:"blake2b-32",45573:"blake2b-40",45574:"blake2b-48",45575:"blake2b-56",45576:"blake2b-64",45577:"blake2b-72",45578:"blake2b-80",45579:"blake2b-88",45580:"blake2b-96",45581:"blake2b-104",45582:"blake2b-112",45583:"blake2b-120",45584:"blake2b-128",45585:"blake2b-136",45586:"blake2b-144",45587:"blake2b-152",45588:"blake2b-160",45589:"blake2b-168",45590:"blake2b-176",45591:"blake2b-184",45592:"blake2b-192",45593:"blake2b-200",45594:"blake2b-208",45595:"blake2b-216",45596:"blake2b-224",45597:"blake2b-232",45598:"blake2b-240",45599:"blake2b-248",45600:"blake2b-256",45601:"blake2b-264",45602:"blake2b-272",45603:"blake2b-280",45604:"blake2b-288",45605:"blake2b-296",45606:"blake2b-304",45607:"blake2b-312",45608:"blake2b-320",45609:"blake2b-328",45610:"blake2b-336",45611:"blake2b-344",45612:"blake2b-352",45613:"blake2b-360",45614:"blake2b-368",45615:"blake2b-376",45616:"blake2b-384",45617:"blake2b-392",45618:"blake2b-400",45619:"blake2b-408",45620:"blake2b-416",45621:"blake2b-424",45622:"blake2b-432",45623:"blake2b-440",45624:"blake2b-448",45625:"blake2b-456",45626:"blake2b-464",45627:"blake2b-472",45628:"blake2b-480",45629:"blake2b-488",45630:"blake2b-496",45631:"blake2b-504",45632:"blake2b-512",45633:"blake2s-8",45634:"blake2s-16",45635:"blake2s-24",45636:"blake2s-32",45637:"blake2s-40",45638:"blake2s-48",45639:"blake2s-56",45640:"blake2s-64",45641:"blake2s-72",45642:"blake2s-80",45643:"blake2s-88",45644:"blake2s-96",45645:"blake2s-104",45646:"blake2s-112",45647:"blake2s-120",45648:"blake2s-128",45649:"blake2s-136",45650:"blake2s-144",45651:"blake2s-152",45652:"blake2s-160",45653:"blake2s-168",45654:"blake2s-176",45655:"blake2s-184",45656:"blake2s-192",45657:"blake2s-200",45658:"blake2s-208",45659:"blake2s-216",45660:"blake2s-224",45661:"blake2s-232",45662:"blake2s-240",45663:"blake2s-248",45664:"blake2s-256"},exports.defaultLengths={17:20,18:32,19:64,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,45569:1,45570:2,45571:3,45572:4,45573:5,45574:6,45575:7,45576:8,45577:9,45578:10,45579:11,45580:12,45581:13,45582:14,45583:15,45584:16,45585:17,45586:18,45587:19,45588:20,45589:21,45590:22,45591:23,45592:24,45593:25,45594:26,45595:27,45596:28,45597:29,45598:30,45599:31,45600:32,45601:33,45602:34,45603:35,45604:36,45605:37,45606:38,45607:39,45608:40,45609:41,45610:42,45611:43,45612:44,45613:45,45614:46,45615:47,45616:48,45617:49,45618:50,45619:51,45620:52,45621:53,45622:54,45623:55,45624:56,45625:57,45626:58,45627:59,45628:60,45629:61,45630:62,45631:63,45632:64,45633:1,45634:2,45635:3,45636:4,45637:5,45638:6,45639:7,45640:8,45641:9,45642:10,45643:11,45644:12,45645:13,45646:14,45647:15,45648:16,45649:17,45650:18,45651:19,45652:20,45653:21,45654:22,45655:23,45656:24,45657:25,45658:26,45659:27,45660:28,45661:29,45662:30,45663:31,45664:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(233),multibase=__webpack_require__(43),multicodec=__webpack_require__(44),codecs=__webpack_require__(35),codecVarints=__webpack_require__(38),multihash=__webpack_require__(233);class CID{constructor(version,codec,multihash){if("string"==typeof version)if(multibase.isEncoded(version)){const cid=multibase.decode(version);this.version=parseInt(cid.slice(0,1).toString("hex"),16),this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=mh.fromB58String(version),this.version=0;else if(Buffer.isBuffer(version)){const firstByte=version.slice(0,1),v=parseInt(firstByte.toString("hex"),16);if(0===v||1===v){const cid=version;this.version=v,this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=version,this.version=0}else if("number"==typeof version){if("string"!=typeof codec)throw new Error("codec must be string");if(0!==version&&1!==version)throw new Error("version must be a number equal to 0 or 1");mh.validate(multihash),this.codec=codec,this.version=version,this.multihash=multihash}}get buffer(){switch(this.version){case 0:return this.multihash;case 1:return Buffer.concat([Buffer("01","hex"),Buffer(codecVarints[this.codec]),this.multihash]);default:throw new Error("unsupported version")}}get prefix(){return Buffer.concat([new Buffer(`0${this.version}`,"hex"),codecVarints[this.codec],multihash.prefix(this.multihash)])}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");return new CID(0,this.codec,this.multihash)}toV1(){return new CID(1,this.codec,this.multihash)}toBaseEncodedString(base){switch(base=base||"base58btc",this.version){case 0:if("base58btc"!==base)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");return mh.toB58String(this.multihash);case 1:return multibase.encode(base,this.buffer).toString();default:throw new Error("Unsupported version")}}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(other){return this.codec===other.codec&&this.version===other.version&&this.multihash.equals(other.multihash)}}CID.codecs=codecs,CID.isCID=(other=>{return"CID"===other.constructor.name}),module.exports=CID}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.names={sha1:17,"sha2-256":18,"sha2-512":19,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,murmur3:34,blake2b:64,blake2s:65},exports.codes={17:"sha1",18:"sha2-256",19:"sha2-512",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384",29:"keccak-512",34:"murmur3",64:"blake2b",65:"blake2s"},exports.defaultLengths={17:20,18:32,19:64,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,64:64,65:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function validate(multihash){if(!Buffer.isBuffer(multihash))throw new Error("multihash must be a Buffer");if(multihash.length<3)throw new Error("multihash too short. must be > 3 bytes.");if(multihash.length>129)throw new Error("multihash too long. must be < 129 bytes.");let code=multihash[0];if(!exports.isValidCode(code))throw new Error(`multihash unknown function code: 0x${code.toString(16)}`);if(multihash.slice(2).length!==multihash[1])throw new Error(`multihash length inconsistent: 0x${multihash.toString("hex")}`)}const bs58=__webpack_require__(24),cs=__webpack_require__(532);exports.toHexString=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return hash.toString("hex")},exports.fromHexString=function(hash){return new Buffer(hash,"hex")},exports.toB58String=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return bs58.encode(hash)},exports.fromB58String=function(hash){let encoded=hash;return Buffer.isBuffer(hash)&&(encoded=hash.toString()),new Buffer(bs58.decode(encoded))},exports.decode=function(buf){exports.validate(buf);const code=buf[0];return{code:code,name:cs.codes[code],length:buf[1],digest:buf.slice(2)}},exports.encode=function(digest,code,length){if(!digest||!code)throw new Error("multihash encode requires at least two args: digest, code");const hashfn=exports.coerceCode(code);if(!Buffer.isBuffer(digest))throw new Error("digest should be a Buffer");if(null==length&&(length=digest.length),length&&digest.length!==length)throw new Error("digest length should be equal to specified length.");if(length>127)throw new Error("multihash does not yet support digest lengths greater than 127 bytes.");return Buffer.concat([new Buffer([hashfn,length]),digest])},exports.coerceCode=function(name){let code=name;if("string"==typeof name){if(!cs.names[name])throw new Error(`Unrecognized hash function named: ${name}`);code=cs.names[name]}if("number"!=typeof code)throw new Error(`Hash function code should be a number. Got: ${code}`);if(!cs.codes[code]&&!exports.isAppCode(code))throw new Error(`Unrecognized function code: ${code}`);return code},exports.isAppCode=function(code){return code>0&&code<16},exports.isValidCode=function(code){return!!exports.isAppCode(code)||!!cs.codes[code]},exports.validate=validate,exports.prefix=function(multihash){return validate(multihash),multihash.slice(0,2)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function cidForHash(codec,rawhash){return new CID(1,codec,multihashes.encode(rawhash,"keccak-256"))}const CID=__webpack_require__(531),multihashes=__webpack_require__(533);module.exports={cidForHash:cidForHash}},function(module,exports,__webpack_require__){"use strict";exports.util=__webpack_require__(234),exports.resolver=__webpack_require__(536)},function(module,exports,__webpack_require__){"use strict";const util=__webpack_require__(234);exports=module.exports,exports.multicodec="eth-tx",exports.resolve=((block,path,callback)=>{let result;util.deserialize(block.data,(err,node)=>{if(err)return callback(err);if(!path||"/"===path)return result={value:node,remainderPath:""},callback(null,result);let pathParts=path.split("/"),firstPart=pathParts.shift(),remainderPath=pathParts.join("/");exports.tree(block,(err,paths)=>{if(err)return callback(err);let treeResult=paths.find(child=>child.path===firstPart);if(!treeResult){let err=new Error('Path not found ("'+firstPart+'").');return callback(err)}return result={value:treeResult.value,remainderPath:remainderPath},callback(null,result)})})}),exports.tree=((block,options,callback)=>{"function"==typeof options&&(callback=options,options=void 0),options||(options={}),util.deserialize(block.data,(err,tx)=>{if(err)return callback(err);const paths=[];paths.push({path:"nonce",value:tx.nonce}),paths.push({path:"gasPrice",value:tx.gasPrice}),paths.push({path:"gasLimit",value:tx.gasLimit}),paths.push({path:"toAddress",value:tx.to}),paths.push({path:"value",value:tx.value}),paths.push({path:"data",value:tx.data}),paths.push({path:"v",value:tx.v}),paths.push({path:"r",value:tx.r}),paths.push({path:"s",value:tx.s}),paths.push({path:"fromAddress",value:tx.from}),paths.push({path:"signature",value:[tx.v,tx.r,tx.s]}),paths.push({path:"isContractPublish",value:tx.toCreationAddress()}),callback(null,paths)})})},function(module,exports,__webpack_require__){"use strict";(function(setImmediate){function noop(){}const Block=__webpack_require__(60),pull=__webpack_require__(5),CID=__webpack_require__(12),doUntil=__webpack_require__(344),IPFSRepo=__webpack_require__(221),BlockService=__webpack_require__(220),joinPath=__webpack_require__(45).join,pullDeferSource=__webpack_require__(295).source,pullTraverse=__webpack_require__(304),map=__webpack_require__(89),series=__webpack_require__(40),waterfall=__webpack_require__(9),MemoryStore=__webpack_require__(41).MemoryDatastore,dagPB=__webpack_require__(62),dagCBOR=__webpack_require__(499),ipldEthBlock=__webpack_require__(231),ipldEthBlockList=__webpack_require__(518),ipldEthTxTrie=__webpack_require__(529),ipldEthStateTrie=__webpack_require__(525),ipldEthStorageTrie=__webpack_require__(526);class IPLDResolver{constructor(blockService){if(!blockService)throw new Error("Missing blockservice");this.bs=blockService,this.resolvers={},this.support={},this.support.add=((multicodec,resolver,util)=>{if(this.resolvers[multicodec])throw new Error(multicodec+"already supported");this.resolvers[multicodec]={resolver:resolver,util:util}}),this.support.rm=(multicodec=>{this.resolvers[multicodec]&&delete this.resolvers[multicodec]}),this.support.add(dagPB.resolver.multicodec,dagPB.resolver,dagPB.util),this.support.add(dagCBOR.resolver.multicodec,dagCBOR.resolver,dagCBOR.util),this.support.add(ipldEthBlock.resolver.multicodec,ipldEthBlock.resolver,ipldEthBlock.util),this.support.add(ipldEthBlockList.resolver.multicodec,ipldEthBlockList.resolver,ipldEthBlockList.util),this.support.add(ipldEthTxTrie.resolver.multicodec,ipldEthTxTrie.resolver,ipldEthTxTrie.util),this.support.add(ipldEthStateTrie.resolver.multicodec,ipldEthStateTrie.resolver,ipldEthStateTrie.util),this.support.add(ipldEthStorageTrie.resolver.multicodec,ipldEthStorageTrie.resolver,ipldEthStorageTrie.util)}get(cid,path,options,callback){if("function"==typeof path&&(callback=path,path=void 0),"function"==typeof options&&(callback=options,options={}),"string"==typeof path&&(path=joinPath("/",path).substr(1)),""===path||!path)return this._get(cid,(err,node)=>{if(err)return callback(err);callback(null,{value:node,remainderPath:""})});let value;doUntil(cb=>{this.bs.get(cid,(err,block)=>{if(err)return cb(err);this.resolvers[cid.codec].resolver.resolve(block,path,(err,result)=>{if(err)return cb(err);value=result.value,path=result.remainderPath,cb()})})},()=>{const endReached=!path||""===path||"/"===path,isTerminal=value&&!value["/"];return!!(endReached&&isTerminal||options.localResolve)||(value&&(cid=new CID(value["/"])),!1)},(err,results)=>{return err?callback(err):callback(null,{value:value,remainderPath:path})})}getStream(cid,path,options){const deferred=pullDeferSource();return this.get(cid,path,options,(err,result)=>{if(err)return deferred.resolve(pull.error(err));deferred.resolve(pull.values([result]))}),deferred}put(node,options,callback){return"function"==typeof options?setImmediate(()=>callback(new Error("no options were passed"))):(callback=callback||noop,options.cid&&CID.isCID(options.cid)?this._put(options.cid,node,callback):(options.hashAlg=options.hashAlg||"sha2-256",void this.resolvers[options.format].util.cid(node,(err,cid)=>{if(err)return callback(err);this._put(cid,node,callback)})))}treeStream(cid,path,options){"object"==typeof path&&(options=path,path=void 0),options=options||{};let p;if(!options.recursive){p=pullDeferSource();const r=this.resolvers[cid.codec];waterfall([cb=>this.bs.get(cid,cb),(block,cb)=>r.resolver.tree(block,cb)],(err,paths)=>{if(err)return p.abort(err);p.resolve(pull.values(paths))})}return options.recursive&&(p=pull(pullTraverse.widthFirst({basePath:null,cid:cid},el=>{if("string"==typeof el)return pull.empty();const deferred=pullDeferSource(),r=this.resolvers[el.cid.codec];return waterfall([cb=>this.bs.get(el.cid,cb),(block,cb)=>r.resolver.tree(block,(err,paths)=>{if(err)return cb(err);map(paths,(p,cb)=>{r.resolver.isLink(block,p,(err,link)=>{if(err)return cb(err);cb(null,{path:p,link:link})})},cb)})],(err,paths)=>{if(err)return deferred.abort(err);deferred.resolve(pull.values(paths.map(p=>{const base=el.basePath?el.basePath+"/"+p.path:p.path;return p.link?{basePath:base,cid:new CID(p.link["/"])}:base})))}),deferred}),pull.map(e=>{return"string"==typeof e?e:e.basePath}),pull.filter(Boolean))),path?pull(p,pull.map(el=>{if(0===el.indexOf(path))return el=el.slice(path.length+1)}),pull.filter(Boolean)):p}remove(cids,callback){this.bs.delete(cids,callback)}_get(cid,callback){const r=this.resolvers[cid.codec];waterfall([cb=>this.bs.get(cid,cb),(block,cb)=>{r?r.util.deserialize(block.data,(err,deserialized)=>{if(err)return cb(err);cb(null,deserialized)}):cb(null,block.data)}],callback)}_put(cid,node,callback){callback=callback||noop;const r=this.resolvers[cid.codec];waterfall([cb=>r.util.serialize(node,cb),(buf,cb)=>this.bs.put(new Block(buf,cid),cb)],err=>{if(err)return callback(err);callback(null,cid)})}}IPLDResolver.inMemory=function(callback){const repo=new IPFSRepo("in-memory",{fs:MemoryStore,level:__webpack_require__(674),lock:"memory"}),blockService=new BlockService(repo);series([cb=>repo.init({},cb),cb=>repo.open(cb)],err=>{if(err)return callback(err);callback(null,new IPLDResolver(blockService))})},module.exports=IPLDResolver}).call(exports,__webpack_require__(22).setImmediate)},function(module,exports){function isCircular(obj){return new CircularChecker(obj).isCircular()}function CircularChecker(obj){this.obj=obj}module.exports=isCircular,CircularChecker.prototype.isCircular=function(obj,seen){if(obj=obj||this.obj,seen=seen||[],!(obj instanceof Object))throw new TypeError('"obj" must be an object (or inherit from it)');var self=this;seen.push(obj);for(var key in obj){var val=obj[key];if(val instanceof Object&&(~seen.indexOf(val)||self.isCircular(val,seen.slice())))return!0}return!1}},function(module,exports,__webpack_require__){"use strict";exports.names={sha1:17,"sha2-256":18,"sha2-512":19,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,murmur3:34,blake2b:64,blake2s:65},exports.codes={17:"sha1",18:"sha2-256",19:"sha2-512",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384",29:"keccak-512",34:"murmur3",64:"blake2b",65:"blake2s"},exports.defaultLengths={17:20,18:32,19:64,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,64:64,65:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function validate(multihash){if(!Buffer.isBuffer(multihash))throw new Error("multihash must be a Buffer");if(multihash.length<3)throw new Error("multihash too short. must be > 3 bytes.");if(multihash.length>129)throw new Error("multihash too long. must be < 129 bytes.");let code=multihash[0];if(!exports.isValidCode(code))throw new Error(`multihash unknown function code: 0x${code.toString(16)}`);if(multihash.slice(2).length!==multihash[1])throw new Error(`multihash length inconsistent: 0x${multihash.toString("hex")}`)}const bs58=__webpack_require__(24),cs=__webpack_require__(539);exports.toHexString=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return hash.toString("hex")},exports.fromHexString=function(hash){return new Buffer(hash,"hex")},exports.toB58String=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return bs58.encode(hash)},exports.fromB58String=function(hash){let encoded=hash;return Buffer.isBuffer(hash)&&(encoded=hash.toString()),new Buffer(bs58.decode(encoded))},exports.decode=function(buf){exports.validate(buf);const code=buf[0];return{code:code,name:cs.codes[code],length:buf[1],digest:buf.slice(2)}},exports.encode=function(digest,code,length){if(!digest||!code)throw new Error("multihash encode requires at least two args: digest, code");const hashfn=exports.coerceCode(code);if(!Buffer.isBuffer(digest))throw new Error("digest should be a Buffer");if(null==length&&(length=digest.length),length&&digest.length!==length)throw new Error("digest length should be equal to specified length.");if(length>127)throw new Error("multihash does not yet support digest lengths greater than 127 bytes.");return Buffer.concat([new Buffer([hashfn,length]),digest])},exports.coerceCode=function(name){let code=name;if("string"==typeof name){if(!cs.names[name])throw new Error(`Unrecognized hash function named: ${name}`);code=cs.names[name]}if("number"!=typeof code)throw new Error(`Hash function code should be a number. Got: ${code}`);if(!cs.codes[code]&&!exports.isAppCode(code))throw new Error(`Unrecognized function code: ${code}`);return code},exports.isAppCode=function(code){return code>0&&code<16},exports.isValidCode=function(code){return!!exports.isAppCode(code)||!!cs.codes[code]},exports.validate=validate,exports.prefix=function(multihash){return validate(multihash),multihash.slice(0,2)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function isMultihash(hash){const formatted=convertToString(hash);try{const buffer=new Buffer(base58.decode(formatted));return multihash.decode(buffer),!0}catch(e){return!1}}function isIpfs(input,pattern){const formatted=convertToString(input);if(!formatted)return!1;const match=formatted.match(pattern);return!!match&&("ipfs"===match[1]&&isMultihash(match[4]))}function isIpns(input,pattern){const formatted=convertToString(input);if(!formatted)return!1;const match=formatted.match(pattern);return!!match&&"ipns"===match[1]}function convertToString(input){return Buffer.isBuffer(input)?base58.encode(input):"string"==typeof input&&input}const base58=__webpack_require__(24),multihash=__webpack_require__(540),urlPattern=/^https?:\/\/[^\/]+\/(ip(f|n)s)\/((\w+).*)/,pathPattern=/^\/(ip(f|n)s)\/((\w+).*)/;module.exports={multihash:isMultihash,ipfsUrl:url=>isIpfs(url,urlPattern),ipnsUrl:url=>isIpns(url,urlPattern),url:url=>isIpfs(url,urlPattern)||isIpns(url,urlPattern),urlPattern:urlPattern,ipfsPath:path=>isIpfs(path,pathPattern),ipnsPath:path=>isIpns(path,pathPattern),path:path=>isIpfs(path,pathPattern)||isIpns(path,pathPattern),pathPattern:pathPattern,urlOrPath:x=>isIpfs(x,urlPattern)||isIpns(x,urlPattern)||isIpfs(x,pathPattern)||isIpns(x,pathPattern)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function isProperty(str){ -return/^[$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(str)}module.exports=isProperty},function(module,exports,__webpack_require__){function isStream(obj){return obj instanceof stream.Stream}function isReadable(obj){return isStream(obj)&&"function"==typeof obj._read&&"object"==typeof obj._readableState}function isWritable(obj){return isStream(obj)&&"function"==typeof obj._write&&"object"==typeof obj._writableState}function isDuplex(obj){return isReadable(obj)&&isWritable(obj)}var stream=__webpack_require__(26);module.exports=isStream,module.exports.isReadable=isReadable,module.exports.isWritable=isWritable,module.exports.isDuplex=isDuplex},function(module,exports){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}}},function(module,exports){module.exports={_from:"elliptic@^6.2.3",_id:"elliptic@6.4.0",_inBundle:!1,_integrity:"sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=",_location:"/elliptic",_phantomChildren:{},_requested:{type:"range",registry:!0,raw:"elliptic@^6.2.3",name:"elliptic",escapedName:"elliptic",rawSpec:"^6.2.3",saveSpec:null,fetchSpec:"^6.2.3"},_requiredBy:["/browserify-sign","/create-ecdh","/secp256k1"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz",_shasum:"cac9af8762c85836187003c8dfe193e5e2eae5df",_spec:"elliptic@^6.2.3",_where:"/Users/koruza/code/js-ipfs/node_modules/secp256k1",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},bundleDependencies:!1,dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},deprecated:!1,description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},files:["lib"],homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.0"}},function(module,exports){module.exports={name:"ipfs",version:"0.24.0",description:"JavaScript implementation of the IPFS specification",bin:{jsipfs:"src/cli/bin.js"},main:"src/core/index.js",browser:{"libp2p-ipfs-nodejs":"libp2p-ipfs-browser","./src/core/default-repo.js":"./src/core/default-repo-browser.js","./src/core/components/init-assets.js":!1,"./test/utils/create-repo-node.js":"./test/utils/create-repo-browser.js",stream:"readable-stream"},engines:{node:">=4.0.0",npm:">=3.0.0"},scripts:{lint:"aegir-lint",coverage:"gulp coverage",test:"gulp test --dom","test:node":"npm run test:unit:node","test:browser":"npm run test:unit:browser","test:unit:node":"gulp test:node","test:unit:node:core":"TEST=core npm run test:unit:node","test:unit:node:http":"TEST=http npm run test:unit:node","test:unit:node:cli":"TEST=cli npm run test:unit:node","test:unit:browser":"gulp test:browser","test:interop":"npm run test:interop:node","test:interop:node":"mocha -t 60000 test/interop/node.js","test:interop:browser":"mocha -t 60000 test/interop/browser.js","test:benchmark":'echo "Error: no benchmarks yet" && exit 1',"test:benchmark:node":'echo "Error: no benchmarks yet" && exit 1',"test:benchmark:node:core":'echo "Error: no benchmarks yet" && exit 1',"test:benchmark:node:http":'echo "Error: no benchmarks yet" && exit 1',"test:benchmark:browser":'echo "Error: no benchmarks yet" && exit 1',build:"gulp build",release:"gulp release","release-minor":"gulp release --type minor","release-major":"gulp release --type major","coverage-publish":"aegir-coverage publish"},"pre-commit":["lint","test"],repository:{type:"git",url:"git+https://github.com/ipfs/js-ipfs.git"},keywords:["IPFS"],author:"David Dias ",license:"MIT",bugs:{url:"https://github.com/ipfs/js-ipfs/issues"},homepage:"https://github.com/ipfs/js-ipfs#readme",devDependencies:{aegir:"^11.0.2","buffer-loader":"0.0.1",chai:"^4.0.0",delay:"^2.0.0","detect-node":"^2.0.3","dir-compare":"^1.4.0","dirty-chai":"^1.2.2","eslint-plugin-react":"^7.0.1",execa:"^0.6.3","expose-loader":"^0.7.3","form-data":"^2.1.4",gulp:"^3.9.1","interface-ipfs-core":"~0.28.0","ipfsd-ctl":"~0.21.0","left-pad":"^1.1.3",lodash:"^4.17.4",mocha:"^3.4.2",ncp:"^2.0.0",nexpect:"^0.5.0","pre-commit":"^1.2.2","pretty-bytes":"^4.0.2",qs:"^6.4.0","random-fs":"^1.0.3",rimraf:"^2.6.1","stream-to-promise":"^2.2.0","transform-loader":"^0.2.4"},dependencies:{async:"^2.4.1",bl:"^1.2.1",boom:"^5.1.0",cids:"^0.5.0",debug:"^2.6.8","fsm-event":"^2.1.0",glob:"^7.1.2",hapi:"^16.1.1","hapi-set-header":"^1.0.2",hoek:"^4.1.1","ipfs-api":"^14.0.2","ipfs-bitswap":"~0.13.1","ipfs-block":"~0.6.0","ipfs-block-service":"~0.9.1","ipfs-multipart":"~0.1.0","ipfs-repo":"~0.13.1","ipfs-unixfs":"~0.1.11","ipfs-unixfs-engine":"~0.19.2","ipld-resolver":"~0.11.1",isstream:"^0.1.2",joi:"^10.5.1","libp2p-floodsub":"~0.9.4","libp2p-ipfs-browser":"~0.24.1","libp2p-ipfs-nodejs":"~0.25.2","lodash.flatmap":"^4.5.0","lodash.get":"^4.4.2","lodash.has":"^4.5.2","lodash.set":"^4.3.2","lodash.sortby":"^4.7.0","lodash.values":"^4.3.0",mafmt:"^2.1.8",mkdirp:"^0.5.1",multiaddr:"^2.3.0",multihashes:"~0.4.5",once:"^1.4.0","path-exists":"^3.0.0","peer-book":"~0.4.0","peer-id":"~0.8.7","peer-info":"~0.9.2","promisify-es6":"^1.0.2","pull-file":"^1.0.0","pull-paramap":"^1.2.2","pull-pushable":"^2.1.1","pull-sort":"^1.0.0","pull-stream":"^3.6.0","pull-stream-to-stream":"^1.3.4","pull-zip":"^2.0.1","read-pkg-up":"^2.0.0","safe-buffer":"^5.0.1","stream-to-pull-stream":"^1.7.2","tar-stream":"^1.5.4",temp:"^0.8.3",through2:"^2.0.3","update-notifier":"^2.1.0",yargs:"8.0.1","readable-stream":"1.1.14"},contributors:["Andrew de Andrade ","CHEVALAY JOSSELIN ","Caio Gondim ","Christian Couder ","Daniel J. O'Quinn ","Daniela Borges Matos de Carvalho ","David Dias ","Enrico Marino ","Felix Yan ","Francisco Baio Dias ","Francisco Baio Dias ","Friedel Ziegelmayer ","Georgios Rassias ","Greenkeeper ","Haad ","Harsh Vakharia ","João Antunes ","Lars Gierth ","Marius Darila ","Michelle Lee ","Mikeal Rogers ","Mithgol ","Nuno Nogueira ","Oskar Nyberg ","Pau Ramon Revilla ","Pedro Teixeira ","Richard Littauer ","Rod Keys ","Sid Harder ","SidHarder ","Stephen Whitmore ","Stephen Whitmore ","Terence Pae ","Xiao Liang ","haad ","jbenet ","kumavis ","nginnever ","npmcdn-to-unpkg-bot ","tcme ","ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ "]}},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(548)(__webpack_require__(552))},function(module,exports,__webpack_require__){"use strict";var createKeccak=__webpack_require__(549),createShake=__webpack_require__(550);module.exports=function(KeccakState){var Keccak=createKeccak(KeccakState),Shake=createShake(KeccakState);return function(algorithm,options){switch("string"==typeof algorithm?algorithm.toLowerCase():algorithm){case"keccak224":return new Keccak(1152,448,null,224,options);case"keccak256":return new Keccak(1088,512,null,256,options);case"keccak384":return new Keccak(832,768,null,384,options);case"keccak512":return new Keccak(576,1024,null,512,options);case"sha3-224":return new Keccak(1152,448,6,224,options);case"sha3-256":return new Keccak(1088,512,6,256,options);case"sha3-384":return new Keccak(832,768,6,384,options);case"sha3-512":return new Keccak(576,1024,6,512,options);case"shake128":return new Shake(1344,256,31,options);case"shake256":return new Shake(1088,512,31,options);default:throw new Error("Invald algorithm: "+algorithm)}}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){var Transform=__webpack_require__(26).Transform,inherits=__webpack_require__(1);module.exports=function(KeccakState){function Keccak(rate,capacity,delimitedSuffix,hashBitLength,options){Transform.call(this,options),this._rate=rate,this._capacity=capacity,this._delimitedSuffix=delimitedSuffix,this._hashBitLength=hashBitLength,this._options=options,this._state=new KeccakState,this._state.initialize(rate,capacity),this._finalized=!1}return inherits(Keccak,Transform),Keccak.prototype._transform=function(chunk,encoding,callback){var error=null;try{this.update(chunk,encoding)}catch(err){error=err}callback(error)},Keccak.prototype._flush=function(callback){var error=null;try{this.push(this.digest())}catch(err){error=err}callback(error)},Keccak.prototype.update=function(data,encoding){if(!Buffer.isBuffer(data)&&"string"!=typeof data)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(data)||(data=new Buffer(data,encoding)),this._state.absorb(data),this},Keccak.prototype.digest=function(encoding){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var digest=this._state.squeeze(this._hashBitLength/8);return void 0!==encoding&&(digest=digest.toString(encoding)),this._resetState(),digest},Keccak.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},Keccak.prototype._clone=function(){var clone=new Keccak(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(clone._state),clone._finalized=this._finalized,clone},Keccak}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){var Transform=__webpack_require__(26).Transform,inherits=__webpack_require__(1);module.exports=function(KeccakState){function Shake(rate,capacity,delimitedSuffix,options){Transform.call(this,options),this._rate=rate,this._capacity=capacity,this._delimitedSuffix=delimitedSuffix,this._options=options,this._state=new KeccakState,this._state.initialize(rate,capacity),this._finalized=!1}return inherits(Shake,Transform),Shake.prototype._transform=function(chunk,encoding,callback){var error=null;try{this.update(chunk,encoding)}catch(err){error=err}callback(error)},Shake.prototype._flush=function(){},Shake.prototype._read=function(size){this.push(this.squeeze(size))},Shake.prototype.update=function(data,encoding){if(!Buffer.isBuffer(data)&&"string"!=typeof data)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(data)||(data=new Buffer(data,encoding)),this._state.absorb(data),this},Shake.prototype.squeeze=function(dataByteLength,encoding){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var data=this._state.squeeze(dataByteLength);return void 0!==encoding&&(data=data.toString(encoding)),data},Shake.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},Shake.prototype._clone=function(){var clone=new Shake(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(clone._state),clone._finalized=this._finalized,clone},Shake}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";var P1600_ROUND_CONSTANTS=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];exports.p1600=function(s){for(var round=0;round<24;++round){var lo0=s[0]^s[10]^s[20]^s[30]^s[40],hi0=s[1]^s[11]^s[21]^s[31]^s[41],lo1=s[2]^s[12]^s[22]^s[32]^s[42],hi1=s[3]^s[13]^s[23]^s[33]^s[43],lo2=s[4]^s[14]^s[24]^s[34]^s[44],hi2=s[5]^s[15]^s[25]^s[35]^s[45],lo3=s[6]^s[16]^s[26]^s[36]^s[46],hi3=s[7]^s[17]^s[27]^s[37]^s[47],lo4=s[8]^s[18]^s[28]^s[38]^s[48],hi4=s[9]^s[19]^s[29]^s[39]^s[49],lo=lo4^(lo1<<1|hi1>>>31),hi=hi4^(hi1<<1|lo1>>>31),t1slo0=s[0]^lo,t1shi0=s[1]^hi,t1slo5=s[10]^lo,t1shi5=s[11]^hi,t1slo10=s[20]^lo,t1shi10=s[21]^hi,t1slo15=s[30]^lo,t1shi15=s[31]^hi,t1slo20=s[40]^lo,t1shi20=s[41]^hi;lo=lo0^(lo2<<1|hi2>>>31),hi=hi0^(hi2<<1|lo2>>>31);var t1slo1=s[2]^lo,t1shi1=s[3]^hi,t1slo6=s[12]^lo,t1shi6=s[13]^hi,t1slo11=s[22]^lo,t1shi11=s[23]^hi,t1slo16=s[32]^lo,t1shi16=s[33]^hi,t1slo21=s[42]^lo,t1shi21=s[43]^hi;lo=lo1^(lo3<<1|hi3>>>31),hi=hi1^(hi3<<1|lo3>>>31);var t1slo2=s[4]^lo,t1shi2=s[5]^hi,t1slo7=s[14]^lo,t1shi7=s[15]^hi,t1slo12=s[24]^lo,t1shi12=s[25]^hi,t1slo17=s[34]^lo,t1shi17=s[35]^hi,t1slo22=s[44]^lo,t1shi22=s[45]^hi;lo=lo2^(lo4<<1|hi4>>>31),hi=hi2^(hi4<<1|lo4>>>31);var t1slo3=s[6]^lo,t1shi3=s[7]^hi,t1slo8=s[16]^lo,t1shi8=s[17]^hi,t1slo13=s[26]^lo,t1shi13=s[27]^hi,t1slo18=s[36]^lo,t1shi18=s[37]^hi,t1slo23=s[46]^lo,t1shi23=s[47]^hi;lo=lo3^(lo0<<1|hi0>>>31),hi=hi3^(hi0<<1|lo0>>>31);var t1slo4=s[8]^lo,t1shi4=s[9]^hi,t1slo9=s[18]^lo,t1shi9=s[19]^hi,t1slo14=s[28]^lo,t1shi14=s[29]^hi,t1slo19=s[38]^lo,t1shi19=s[39]^hi,t1slo24=s[48]^lo,t1shi24=s[49]^hi,t2slo0=t1slo0,t2shi0=t1shi0,t2slo16=t1shi5<<4|t1slo5>>>28,t2shi16=t1slo5<<4|t1shi5>>>28,t2slo7=t1slo10<<3|t1shi10>>>29,t2shi7=t1shi10<<3|t1slo10>>>29,t2slo23=t1shi15<<9|t1slo15>>>23,t2shi23=t1slo15<<9|t1shi15>>>23,t2slo14=t1slo20<<18|t1shi20>>>14,t2shi14=t1shi20<<18|t1slo20>>>14,t2slo10=t1slo1<<1|t1shi1>>>31,t2shi10=t1shi1<<1|t1slo1>>>31,t2slo1=t1shi6<<12|t1slo6>>>20,t2shi1=t1slo6<<12|t1shi6>>>20,t2slo17=t1slo11<<10|t1shi11>>>22,t2shi17=t1shi11<<10|t1slo11>>>22,t2slo8=t1shi16<<13|t1slo16>>>19,t2shi8=t1slo16<<13|t1shi16>>>19,t2slo24=t1slo21<<2|t1shi21>>>30,t2shi24=t1shi21<<2|t1slo21>>>30,t2slo20=t1shi2<<30|t1slo2>>>2,t2shi20=t1slo2<<30|t1shi2>>>2,t2slo11=t1slo7<<6|t1shi7>>>26,t2shi11=t1shi7<<6|t1slo7>>>26,t2slo2=t1shi12<<11|t1slo12>>>21,t2shi2=t1slo12<<11|t1shi12>>>21,t2slo18=t1slo17<<15|t1shi17>>>17,t2shi18=t1shi17<<15|t1slo17>>>17,t2slo9=t1shi22<<29|t1slo22>>>3,t2shi9=t1slo22<<29|t1shi22>>>3,t2slo5=t1slo3<<28|t1shi3>>>4,t2shi5=t1shi3<<28|t1slo3>>>4,t2slo21=t1shi8<<23|t1slo8>>>9,t2shi21=t1slo8<<23|t1shi8>>>9,t2slo12=t1slo13<<25|t1shi13>>>7,t2shi12=t1shi13<<25|t1slo13>>>7,t2slo3=t1slo18<<21|t1shi18>>>11,t2shi3=t1shi18<<21|t1slo18>>>11,t2slo19=t1shi23<<24|t1slo23>>>8,t2shi19=t1slo23<<24|t1shi23>>>8,t2slo15=t1slo4<<27|t1shi4>>>5,t2shi15=t1shi4<<27|t1slo4>>>5,t2slo6=t1slo9<<20|t1shi9>>>12,t2shi6=t1shi9<<20|t1slo9>>>12,t2slo22=t1shi14<<7|t1slo14>>>25,t2shi22=t1slo14<<7|t1shi14>>>25,t2slo13=t1slo19<<8|t1shi19>>>24,t2shi13=t1shi19<<8|t1slo19>>>24,t2slo4=t1slo24<<14|t1shi24>>>18,t2shi4=t1shi24<<14|t1slo24>>>18;s[0]=t2slo0^~t2slo1&t2slo2,s[1]=t2shi0^~t2shi1&t2shi2,s[10]=t2slo5^~t2slo6&t2slo7,s[11]=t2shi5^~t2shi6&t2shi7,s[20]=t2slo10^~t2slo11&t2slo12,s[21]=t2shi10^~t2shi11&t2shi12,s[30]=t2slo15^~t2slo16&t2slo17,s[31]=t2shi15^~t2shi16&t2shi17,s[40]=t2slo20^~t2slo21&t2slo22,s[41]=t2shi20^~t2shi21&t2shi22,s[2]=t2slo1^~t2slo2&t2slo3,s[3]=t2shi1^~t2shi2&t2shi3,s[12]=t2slo6^~t2slo7&t2slo8,s[13]=t2shi6^~t2shi7&t2shi8,s[22]=t2slo11^~t2slo12&t2slo13,s[23]=t2shi11^~t2shi12&t2shi13,s[32]=t2slo16^~t2slo17&t2slo18,s[33]=t2shi16^~t2shi17&t2shi18,s[42]=t2slo21^~t2slo22&t2slo23,s[43]=t2shi21^~t2shi22&t2shi23,s[4]=t2slo2^~t2slo3&t2slo4,s[5]=t2shi2^~t2shi3&t2shi4,s[14]=t2slo7^~t2slo8&t2slo9,s[15]=t2shi7^~t2shi8&t2shi9,s[24]=t2slo12^~t2slo13&t2slo14,s[25]=t2shi12^~t2shi13&t2shi14,s[34]=t2slo17^~t2slo18&t2slo19,s[35]=t2shi17^~t2shi18&t2shi19,s[44]=t2slo22^~t2slo23&t2slo24,s[45]=t2shi22^~t2shi23&t2shi24,s[6]=t2slo3^~t2slo4&t2slo0,s[7]=t2shi3^~t2shi4&t2shi0,s[16]=t2slo8^~t2slo9&t2slo5,s[17]=t2shi8^~t2shi9&t2shi5,s[26]=t2slo13^~t2slo14&t2slo10,s[27]=t2shi13^~t2shi14&t2shi10,s[36]=t2slo18^~t2slo19&t2slo15,s[37]=t2shi18^~t2shi19&t2shi15,s[46]=t2slo23^~t2slo24&t2slo20,s[47]=t2shi23^~t2shi24&t2shi20,s[8]=t2slo4^~t2slo0&t2slo1,s[9]=t2shi4^~t2shi0&t2shi1,s[18]=t2slo9^~t2slo5&t2slo6,s[19]=t2shi9^~t2shi5&t2shi6,s[28]=t2slo14^~t2slo10&t2slo11,s[29]=t2shi14^~t2shi10&t2shi11,s[38]=t2slo19^~t2slo15&t2slo16,s[39]=t2shi19^~t2shi15&t2shi16,s[48]=t2slo24^~t2slo20&t2slo21,s[49]=t2shi24^~t2shi20&t2shi21,s[0]^=P1600_ROUND_CONSTANTS[2*round],s[1]^=P1600_ROUND_CONSTANTS[2*round+1]}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function Keccak(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}var keccakState=__webpack_require__(551);Keccak.prototype.initialize=function(rate,capacity){for(var i=0;i<50;++i)this.state[i]=0;this.blockSize=rate/8,this.count=0,this.squeezing=!1},Keccak.prototype.absorb=function(data){for(var i=0;i>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(keccakState.p1600(this.state),this.count=0);return output},Keccak.prototype.copy=function(dest){for(var i=0;i<50;++i)dest.state[i]=this.state[i];dest.blockSize=this.blockSize,dest.count=this.count,dest.squeezing=this.squeezing},module.exports=Keccak}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function Codec(opts){this.opts=opts||{},this.encodings=encodings}var encodings=__webpack_require__(554);module.exports=Codec,Codec.prototype._encoding=function(encoding){return"string"==typeof encoding&&(encoding=encodings[encoding]),encoding||(encoding=encodings.id),encoding},Codec.prototype._keyEncoding=function(opts,batchOpts){return this._encoding(batchOpts&&batchOpts.keyEncoding||opts&&opts.keyEncoding||this.opts.keyEncoding)},Codec.prototype._valueEncoding=function(opts,batchOpts){return this._encoding(batchOpts&&(batchOpts.valueEncoding||batchOpts.encoding)||opts&&(opts.valueEncoding||opts.encoding)||this.opts.valueEncoding||this.opts.encoding)},Codec.prototype.encodeKey=function(key,opts,batchOpts){return this._keyEncoding(opts,batchOpts).encode(key)},Codec.prototype.encodeValue=function(value,opts,batchOpts){return this._valueEncoding(opts,batchOpts).encode(value)},Codec.prototype.decodeKey=function(key,opts){return this._keyEncoding(opts).decode(key)},Codec.prototype.decodeValue=function(value,opts){return this._valueEncoding(opts).decode(value)},Codec.prototype.encodeBatch=function(ops,opts){var self=this;return ops.map(function(_op){var op={type:_op.type,key:self.encodeKey(_op.key,opts,_op)};return self.keyAsBuffer(opts,_op)&&(op.keyEncoding="binary"),_op.prefix&&(op.prefix=_op.prefix),"value"in _op&&(op.value=self.encodeValue(_op.value,opts,_op),self.valueAsBuffer(opts,_op)&&(op.valueEncoding="binary")),op})};var ltgtKeys=["lt","gt","lte","gte","start","end"];Codec.prototype.encodeLtgt=function(ltgt){var self=this,ret={};return Object.keys(ltgt).forEach(function(key){ret[key]=ltgtKeys.indexOf(key)>-1?self.encodeKey(ltgt[key],ltgt):ltgt[key]}),ret},Codec.prototype.createStreamDecoder=function(opts){var self=this;return opts.keys&&opts.values?function(key,value){return{ -key:self.decodeKey(key,opts),value:self.decodeValue(value,opts)}}:opts.keys?function(key){return self.decodeKey(key,opts)}:opts.values?function(_,value){return self.decodeValue(value,opts)}:function(){}},Codec.prototype.keyAsBuffer=function(opts){return this._keyEncoding(opts).buffer},Codec.prototype.valueAsBuffer=function(opts){return this._valueEncoding(opts).buffer}},function(module,exports,__webpack_require__){(function(Buffer){function identity(value){return value}function isBinary(data){return void 0===data||null===data||Buffer.isBuffer(data)}exports.utf8=exports["utf-8"]={encode:function(data){return isBinary(data)?data:String(data)},decode:identity,buffer:!1,type:"utf8"},exports.json={encode:JSON.stringify,decode:JSON.parse,buffer:!1,type:"json"},exports.binary={encode:function(data){return isBinary(data)?data:new Buffer(data)},decode:identity,buffer:!0,type:"binary"},exports.id={encode:function(data){return data},decode:function(data){return data},buffer:!1,type:"id"},["hex","ascii","base64","ucs2","ucs-2","utf16le","utf-16le"].forEach(function(type){exports[type]={encode:function(data){return isBinary(data)?data:new Buffer(data,type)},decode:function(buffer){return buffer.toString(type)},buffer:!0,type:type}})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function ReadStream(iterator,options){if(!(this instanceof ReadStream))return new ReadStream(iterator,options);Readable.call(this,extend(options,{objectMode:!0})),this._iterator=iterator,this._destroyed=!1,this._decoder=null,options&&options.decoder&&(this._decoder=options.decoder),this.on("end",this._cleanup.bind(this))}var inherits=__webpack_require__(1),Readable=__webpack_require__(308).Readable,extend=__webpack_require__(37),EncodingError=__webpack_require__(105).EncodingError;module.exports=ReadStream,inherits(ReadStream,Readable),ReadStream.prototype._read=function(){var self=this;this._destroyed||this._iterator.next(function(err,key,value){if(!self._destroyed){if(err)return self.emit("error",err);if(void 0===key&&void 0===value)self.push(null);else{if(!self._decoder)return self.push({key:key,value:value});try{var value=self._decoder(key,value)}catch(err){return self.emit("error",new EncodingError(err)),void self.push(null)}self.push(value)}}})},ReadStream.prototype.destroy=ReadStream.prototype._cleanup=function(){var self=this;this._destroyed||(this._destroyed=!0,this._iterator.end(function(err){if(err)return self.emit("error",err);self.emit("close")}))}},function(module,exports,__webpack_require__){(function(Buffer,process){function Iterator(db,options){if(this._db=db._db,this._idbOpts=db._idbOpts,AbstractIterator.call(this,db),this._options=xtend({snapshot:!0},this._idbOpts,options),this._limit=this._options.limit,null!=this._limit&&this._limit!==-1||(this._limit=1/0),"number"!=typeof this._limit)throw new TypeError("options.limit must be a number");0!==this._limit&&(this._count=0,this._startCursor(this._options))}var util=__webpack_require__(10),AbstractIterator=__webpack_require__(247).AbstractIterator,ltgt=__webpack_require__(672),idbReadableStream=__webpack_require__(448),stream=__webpack_require__(26),xtend=__webpack_require__(37),Writable=stream.Writable;module.exports=Iterator,util.inherits(Iterator,AbstractIterator),Iterator.prototype._startCursor=function(options){options=xtend(this._options,options);var self=this,keyRange=null,lower=ltgt.lowerBound(options),upper=ltgt.upperBound(options),lowerOpen=ltgt.lowerBoundExclusive(options),upperOpen=ltgt.upperBoundExclusive(options),direction=options.reverse?"prev":"next";if(lower&&("binary"!==options.keyEncoding||Array.isArray(lower)||(lower=Array.prototype.slice.call(lower))),upper&&("binary"!==options.keyEncoding||Array.isArray(upper)||(upper=Array.prototype.slice.call(upper))),lower&&upper)try{keyRange=IDBKeyRange.bound(lower,upper,lowerOpen,upperOpen)}catch(err){return void(this._keyRangeError=!0)}else lower?keyRange=IDBKeyRange.lowerBound(lower,lowerOpen):upper&&(keyRange=IDBKeyRange.upperBound(upper,upperOpen));this._reader=idbReadableStream(this._db,this._idbOpts.storeName,xtend(options,{range:keyRange,direction:direction})),this._reader.on("error",function(err){var cb=self._callback;self._callback=!1,cb?cb(err):self._readNext=function(cb){cb(err)}}),this._reader.pipe(new Writable({objectMode:!0,write:function(item,enc,cb){if(self._count++>=self._limit)return self._reader.pause(),self._reader.unpipe(this),cb(),void this.end();var cb2=self._callback;self._callback=!1,cb2?self._processItem(item,function(err,key,value){cb(err),cb2(err,key,value)}):self._readNext=function(cb2){self._processItem(item,function(err,key,value){cb(err),cb2(err,key,value)})}}})).on("finish",function(){var cb=self._callback;self._callback=!1,cb?cb():self._readNext=function(cb){cb()}})},Iterator.prototype._processItem=function(item,cb){if("function"!=typeof cb)throw new TypeError("cb must be a function");var key=item.key,value=item.value;if(value instanceof Uint8Array&&(value=new Buffer(value)),"binary"===this._options.keyEncoding&&Array.isArray(key)&&(key=new Buffer(key)),"binary"!==this._options.valueEncoding||Buffer.isBuffer(value)||(value=new Buffer(value)),this._options.keyAsBuffer&&!Buffer.isBuffer(key))if(null==key)key=new Buffer(0);else if("string"==typeof key)key=new Buffer(key);else if("boolean"==typeof key)key=new Buffer(String(key));else if("number"==typeof key)key=new Buffer(String(key));else if(Array.isArray(key))key=new Buffer(String(key));else{if(!(key instanceof Uint8Array))throw new TypeError("can't coerce `"+key.constructor.name+"` into a Buffer");key=new Buffer(key)}if(this._options.valueAsBuffer&&!Buffer.isBuffer(value))if(null==value)value=new Buffer(0);else if("string"==typeof value)value=new Buffer(value);else if("boolean"==typeof value)value=new Buffer(String(value));else if("number"==typeof value)value=new Buffer(String(value));else if(Array.isArray(value))value=new Buffer(String(value));else{if(!(value instanceof Uint8Array))throw new TypeError("can't coerce `"+value.constructor.name+"` into a Buffer");value=new Buffer(value)}cb(null,key,value)},Iterator.prototype._next=function(callback){if(this._callback)throw new Error("callback already exists");if(this._keyRangeError||0===this._limit)return void callback();var readNext=this._readNext;this._readNext=!1,readNext?process.nextTick(function(){readNext(callback)}):this._callback=callback}}).call(exports,__webpack_require__(0).Buffer,__webpack_require__(2))},function(module,exports,__webpack_require__){function isLevelDOWN(db){return!(!db||"object"!=typeof db)&&Object.keys(AbstractLevelDOWN.prototype).filter(function(name){return"_"!=name[0]&&"approximateSize"!=name}).every(function(name){return"function"==typeof db[name]})}var AbstractLevelDOWN=__webpack_require__(246);module.exports=isLevelDOWN},function(module,exports,__webpack_require__){function Batch(levelup,codec){this._levelup=levelup,this._codec=codec,this.batch=levelup.db.batch(),this.ops=[],this.length=0}var util=__webpack_require__(248),WriteError=__webpack_require__(105).WriteError,getOptions=util.getOptions,dispatchError=util.dispatchError;Batch.prototype.put=function(key_,value_,options){options=getOptions(options);var key=this._codec.encodeKey(key_,options),value=this._codec.encodeValue(value_,options);try{this.batch.put(key,value)}catch(e){throw new WriteError(e)}return this.ops.push({type:"put",key:key,value:value}),this.length++,this},Batch.prototype.del=function(key_,options){options=getOptions(options);var key=this._codec.encodeKey(key_,options);try{this.batch.del(key)}catch(err){throw new WriteError(err)}return this.ops.push({type:"del",key:key}),this.length++,this},Batch.prototype.clear=function(){try{this.batch.clear()}catch(err){throw new WriteError(err)}return this.ops=[],this.length=0,this},Batch.prototype.write=function(callback){var levelup=this._levelup,ops=this.ops;try{this.batch.write(function(err){if(err)return dispatchError(levelup,new WriteError(err),callback);levelup.emit("batch",ops),callback&&callback()})}catch(err){throw new WriteError(err)}},module.exports=Batch},function(module,exports,__webpack_require__){(function(process){function getCallback(options,callback){return"function"==typeof options?options:callback}function LevelUP(location,options,callback){if(!(this instanceof LevelUP))return new LevelUP(location,options,callback);var error;if(EventEmitter.call(this),this.setMaxListeners(1/0),"function"==typeof location?(options="object"==typeof options?options:{},options.db=location,location=null):"object"==typeof location&&"function"==typeof location.db&&(options=location,location=null),"function"==typeof options&&(callback=options,options={}),(!options||"function"!=typeof options.db)&&"string"!=typeof location){if(error=new InitializationError("Must provide a location for the database"),callback)return process.nextTick(function(){callback(error)});throw error}options=getOptions(options),this.options=extend(defaultOptions,options),this._codec=new Codec(this.options),this._status="new",prr(this,"location",location,"e"),this.open(callback)}function maybeError(db,options,callback){if(!db._isOpening()&&!db.isOpen())return dispatchError(db,new ReadError("Database is not open"),callback),!0}function writeError(db,message,callback){dispatchError(db,new WriteError(message),callback)}function readError(db,message,callback){dispatchError(db,new ReadError(message),callback)}function utilStatic(name){return function(location,callback){getLevelDOWN()[name](location,callback||function(){})}}var EventEmitter=__webpack_require__(8).EventEmitter,inherits=__webpack_require__(10).inherits,deprecate=__webpack_require__(10).deprecate,extend=__webpack_require__(37),prr=__webpack_require__(721),DeferredLevelDOWN=__webpack_require__(393),IteratorStream=__webpack_require__(555),errors=__webpack_require__(105),WriteError=errors.WriteError,ReadError=errors.ReadError,NotFoundError=errors.NotFoundError,OpenError=errors.OpenError,EncodingError=errors.EncodingError,InitializationError=errors.InitializationError,util=__webpack_require__(248),Batch=__webpack_require__(558),Codec=__webpack_require__(553),getOptions=util.getOptions,defaultOptions=util.defaultOptions,getLevelDOWN=__webpack_require__(858),dispatchError=util.dispatchError;util.isDefined;"function"!=typeof getLevelDOWN&&(getLevelDOWN=function(){}),inherits(LevelUP,EventEmitter),LevelUP.prototype.open=function(callback){var dbFactory,db,self=this;return this.isOpen()?(callback&&process.nextTick(function(){callback(null,self)}),this):this._isOpening()?callback&&this.once("open",function(){callback(null,self)}):(this.emit("opening"),this._status="opening",this.db=new DeferredLevelDOWN(this.location),dbFactory=this.options.db||getLevelDOWN(),db=dbFactory(this.location),void db.open(this.options,function(err){if(err)return dispatchError(self,new OpenError(err),callback);self.db.setDb(db),self.db=db,self._status="open",callback&&callback(null,self),self.emit("open"),self.emit("ready")}))},LevelUP.prototype.close=function(callback){var self=this;if(this.isOpen())this._status="closing",this.db.close(function(){self._status="closed",self.emit("closed"),callback&&callback.apply(null,arguments)}),this.emit("closing"),this.db=new DeferredLevelDOWN(this.location);else{if("closed"==this._status&&callback)return process.nextTick(callback);"closing"==this._status&&callback?this.once("closed",callback):this._isOpening()&&this.once("open",function(){self.close(callback)})}},LevelUP.prototype.isOpen=function(){return"open"==this._status},LevelUP.prototype._isOpening=function(){return"opening"==this._status},LevelUP.prototype.isClosed=function(){return/^clos/.test(this._status)},LevelUP.prototype.get=function(key_,options,callback){var key,self=this;if(callback=getCallback(options,callback),!maybeError(this,options,callback)){if(null===key_||void 0===key_||"function"!=typeof callback)return readError(this,"get() requires key and callback arguments",callback);options=util.getOptions(options),key=this._codec.encodeKey(key_,options),options.asBuffer=this._codec.valueAsBuffer(options),this.db.get(key,options,function(err,value){if(err)return err=/notfound/i.test(err)||err.notFound?new NotFoundError("Key not found in database ["+key_+"]",err):new ReadError(err),dispatchError(self,err,callback);if(callback){try{value=self._codec.decodeValue(value,options)}catch(e){return callback(new EncodingError(e))}callback(null,value)}})}},LevelUP.prototype.put=function(key_,value_,options,callback){var key,value,self=this;if(callback=getCallback(options,callback),null===key_||void 0===key_)return writeError(this,"put() requires a key argument",callback);maybeError(this,options,callback)||(options=getOptions(options),key=this._codec.encodeKey(key_,options),value=this._codec.encodeValue(value_,options),this.db.put(key,value,options,function(err){if(err)return dispatchError(self,new WriteError(err),callback);self.emit("put",key_,value_),callback&&callback()}))},LevelUP.prototype.del=function(key_,options,callback){var key,self=this;if(callback=getCallback(options,callback),null===key_||void 0===key_)return writeError(this,"del() requires a key argument",callback);maybeError(this,options,callback)||(options=getOptions(options),key=this._codec.encodeKey(key_,options),this.db.del(key,options,function(err){if(err)return dispatchError(self,new WriteError(err),callback);self.emit("del",key_),callback&&callback()}))},LevelUP.prototype.batch=function(arr_,options,callback){var arr,self=this;return arguments.length?(callback=getCallback(options,callback),Array.isArray(arr_)?void(maybeError(this,options,callback)||(options=getOptions(options),arr=self._codec.encodeBatch(arr_,options),arr=arr.map(function(op){return op.type||void 0===op.key||void 0===op.value||(op.type="put"),op}),this.db.batch(arr,options,function(err){if(err)return dispatchError(self,new WriteError(err),callback);self.emit("batch",arr_),callback&&callback()}))):writeError(this,"batch() requires an array argument",callback)):new Batch(this,this._codec)},LevelUP.prototype.approximateSize=deprecate(function(start_,end_,options,callback){var start,end,self=this;if(callback=getCallback(options,callback),options=getOptions(options),null===start_||void 0===start_||null===end_||void 0===end_||"function"!=typeof callback)return readError(this,"approximateSize() requires start, end and callback arguments",callback);start=this._codec.encodeKey(start_,options),end=this._codec.encodeKey(end_,options),this.db.approximateSize(start,end,function(err,size){if(err)return dispatchError(self,new OpenError(err),callback);callback&&callback(null,size)})},"db.approximateSize() is deprecated. Use db.db.approximateSize() instead"),LevelUP.prototype.readStream=LevelUP.prototype.createReadStream=function(options){return options=extend({keys:!0,values:!0},this.options,options),options.keyEncoding=options.keyEncoding,options.valueEncoding=options.valueEncoding,options=this._codec.encodeLtgt(options),options.keyAsBuffer=this._codec.keyAsBuffer(options),options.valueAsBuffer=this._codec.valueAsBuffer(options),"number"!=typeof options.limit&&(options.limit=-1),new IteratorStream(this.db.iterator(options),extend(options,{decoder:this._codec.createStreamDecoder(options)}))},LevelUP.prototype.keyStream=LevelUP.prototype.createKeyStream=function(options){return this.createReadStream(extend(options,{keys:!0,values:!1}))},LevelUP.prototype.valueStream=LevelUP.prototype.createValueStream=function(options){return this.createReadStream(extend(options,{keys:!1,values:!0}))},LevelUP.prototype.toString=function(){return"LevelUP"},module.exports=LevelUP,module.exports.errors=__webpack_require__(105),module.exports.destroy=deprecate(utilStatic("destroy"),"levelup.destroy() is deprecated. Use leveldown.destroy() instead"),module.exports.repair=deprecate(utilStatic("repair"),"levelup.repair() is deprecated. Use leveldown.repair() instead")}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";const secp256k1=__webpack_require__(768),multihashing=__webpack_require__(30),setImmediate=__webpack_require__(11),randomBytes=__webpack_require__(50).randomBytes;exports.privateKeyLength=32,exports.generateKey=function(callback){const done=(err,res)=>setImmediate(()=>{callback(err,res)});let privateKey;do{privateKey=randomBytes(32)}while(!secp256k1.privateKeyVerify(privateKey));done(null,privateKey)},exports.hashAndSign=function(key,msg,callback){const done=(err,res)=>setImmediate(()=>{callback(err,res)});multihashing.digest(msg,"sha2-256",(err,digest)=>{if(err)return done(err);try{const sig=secp256k1.sign(digest,key),sigDER=secp256k1.signatureExport(sig.signature);return done(null,sigDER)}catch(err){done(err)}})},exports.hashAndVerify=function(key,sig,msg,callback){const done=(err,res)=>setImmediate(()=>{callback(err,res)});multihashing.digest(msg,"sha2-256",(err,digest)=>{if(err)return done(err);try{sig=secp256k1.signatureImport(sig);const valid=secp256k1.verify(digest,sig,key);return done(null,valid)}catch(err){done(err)}})},exports.compressPublicKey=function(key){if(!secp256k1.publicKeyVerify(key))throw new Error("Invalid public key");return secp256k1.publicKeyConvert(key,!0)},exports.decompressPublicKey=function(key){return secp256k1.publicKeyConvert(key,!1)},exports.validatePrivateKey=function(key){if(!secp256k1.privateKeyVerify(key))throw new Error("Invalid private key")},exports.validatePublicKey=function(key){if(!secp256k1.publicKeyVerify(key))throw new Error("Invalid public key")},exports.computePublicKey=function(privateKey){return exports.validatePrivateKey(privateKey),secp256k1.publicKeyCreate(privateKey)}},function(module,exports,__webpack_require__){"use strict";function unmarshalSecp256k1PrivateKey(bytes,callback){callback(null,new Secp256k1PrivateKey(bytes),null)}function unmarshalSecp256k1PublicKey(bytes){return new Secp256k1PublicKey(bytes)}function generateKeyPair(_bits,cb){void 0===cb&&"function"==typeof _bits&&(cb=_bits),ensure(cb),crypto.generateKey((err,privateKeyBytes)=>{if(err)return cb(err);let privkey;try{privkey=new Secp256k1PrivateKey(privateKeyBytes)}catch(err){return void cb(err)}cb(null,privkey)})}function ensure(cb){if("function"!=typeof cb)throw new Error("callback is required")}const multihashing=__webpack_require__(30),crypto=__webpack_require__(560),pbm=__webpack_require__(50).protobuf;class Secp256k1PublicKey{constructor(key){crypto.validatePublicKey(key),this._key=key}verify(data,sig,callback){ensure(callback),crypto.hashAndVerify(this._key,sig,data,callback)}marshal(){return crypto.compressPublicKey(this._key)}get bytes(){return pbm.PublicKey.encode({Type:pbm.KeyType.Secp256k1,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}class Secp256k1PrivateKey{constructor(key,publicKey){this._key=key,this._publicKey=publicKey||crypto.computePublicKey(key),crypto.validatePrivateKey(this._key),crypto.validatePublicKey(this._publicKey)}sign(message,callback){ensure(callback),crypto.hashAndSign(this._key,message,callback)}get public(){return new Secp256k1PublicKey(this._publicKey)}marshal(){return this._key}get bytes(){return pbm.PrivateKey.encode({Type:pbm.KeyType.Secp256k1,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}module.exports={Secp256k1PublicKey:Secp256k1PublicKey,Secp256k1PrivateKey:Secp256k1PrivateKey,unmarshalSecp256k1PrivateKey:unmarshalSecp256k1PrivateKey,unmarshalSecp256k1PublicKey:unmarshalSecp256k1PublicKey,generateKeyPair:generateKeyPair}},function(module,exports,__webpack_require__){"use strict";const ciphers=__webpack_require__(563),CIPHER_MODES={16:"aes-128-ctr",32:"aes-256-ctr"};exports.create=function(key,iv,callback){const mode=CIPHER_MODES[key.length];if(!mode)return callback(new Error("Invalid key length"));const cipher=ciphers.createCipheriv(mode,key,iv),decipher=ciphers.createDecipheriv(mode,key,iv);callback(null,{encrypt(data,cb){cb(null,cipher.update(data))},decrypt(data,cb){cb(null,decipher.update(data))}})}},function(module,exports,__webpack_require__){"use strict";const crypto=__webpack_require__(373);module.exports={createCipheriv:crypto.createCipheriv,createDecipheriv:crypto.createDecipheriv}},function(module,exports,__webpack_require__){"use strict";function marshalPublicKey(jwk){const byteLen=curveLengths[jwk.crv];return Buffer.concat([Buffer.from([4]),toBn(jwk.x).toArrayLike(Buffer,"be",byteLen),toBn(jwk.y).toArrayLike(Buffer,"be",byteLen)],1+2*byteLen)}function unmarshalPublicKey(curve,key){const byteLen=curveLengths[curve];if(!key.slice(0,1).equals(Buffer.from([4])))throw new Error("Invalid key format");const x=new BN(key.slice(1,byteLen+1)),y=new BN(key.slice(1+byteLen));return{kty:"EC",crv:curve,x:toBase64(x,byteLen),y:toBase64(y,byteLen),ext:!0}}function unmarshalPrivateKey(curve,key){const result=unmarshalPublicKey(curve,key.public);return result.d=toBase64(new BN(key.private)),result}const crypto=__webpack_require__(106)(),nodeify=__webpack_require__(81),BN=__webpack_require__(54).bignum,Buffer=__webpack_require__(13).Buffer,util=__webpack_require__(249),toBase64=util.toBase64,toBn=util.toBn,bits={"P-256":256,"P-384":384,"P-521":521};exports.generateEphmeralKeyPair=function(curve,callback){nodeify(crypto.subtle.generateKey({name:"ECDH",namedCurve:curve},!0,["deriveBits"]).then(pair=>{const genSharedKey=(theirPub,forcePrivate,cb)=>{"function"==typeof forcePrivate&&(cb=forcePrivate,forcePrivate=void 0);let privateKey;privateKey=forcePrivate?crypto.subtle.importKey("jwk",unmarshalPrivateKey(curve,forcePrivate),{name:"ECDH",namedCurve:curve},!1,["deriveBits"]):Promise.resolve(pair.privateKey),nodeify(Promise.all([crypto.subtle.importKey("jwk",unmarshalPublicKey(curve,theirPub),{name:"ECDH",namedCurve:curve},!1,[]),privateKey]).then(keys=>crypto.subtle.deriveBits({name:"ECDH",namedCurve:curve,public:keys[0]},keys[1],bits[curve])).then(bits=>Buffer.from(bits)),cb)};return crypto.subtle.exportKey("jwk",pair.publicKey).then(publicKey=>{return{key:marshalPublicKey(publicKey),genSharedKey:genSharedKey}})}),callback)};const curveLengths={"P-256":32,"P-384":48,"P-521":66}},function(module,exports,__webpack_require__){"use strict";const nacl=__webpack_require__(818),setImmediate=__webpack_require__(11),Buffer=__webpack_require__(13).Buffer;exports.publicKeyLength=nacl.sign.publicKeyLength,exports.privateKeyLength=nacl.sign.secretKeyLength,exports.generateKey=function(callback){const done=(err,res)=>setImmediate(()=>{callback(err,res)});let keys;try{keys=nacl.sign.keyPair()}catch(err){return void done(err)}done(null,keys)},exports.generateKeyFromSeed=function(seed,callback){const done=(err,res)=>setImmediate(()=>{callback(err,res)});let keys;try{keys=nacl.sign.keyPair.fromSeed(seed)}catch(err){return void done(err)}done(null,keys)},exports.hashAndSign=function(key,msg,callback){setImmediate(()=>{callback(null,Buffer.from(nacl.sign.detached(msg,key)))})},exports.hashAndVerify=function(key,sig,msg,callback){setImmediate(()=>{callback(null,nacl.sign.detached.verify(msg,sig,key))})}},function(module,exports,__webpack_require__){"use strict";const nodeify=__webpack_require__(81),Buffer=__webpack_require__(13).Buffer,crypto=__webpack_require__(106)(),lengths=__webpack_require__(567),hashTypes={SHA1:"SHA-1",SHA256:"SHA-256",SHA512:"SHA-512"};exports.create=function(hashType,secret,callback){const hash=hashTypes[hashType];nodeify(crypto.subtle.importKey("raw",secret,{name:"HMAC",hash:{name:hash}},!1,["sign"]).then(key=>{return{digest(data,cb){nodeify(crypto.subtle.sign({name:"HMAC"},key,data).then(raw=>Buffer.from(raw)),cb)},length:lengths[hashType]}}),callback)}},function(module,exports,__webpack_require__){"use strict";module.exports={SHA1:20,SHA256:32,SHA512:64}},function(module,exports,__webpack_require__){"use strict";function exportKey(pair){return Promise.all([crypto.subtle.exportKey("jwk",pair.privateKey),crypto.subtle.exportKey("jwk",pair.publicKey)])}function derivePublicFromPrivate(jwKey){return crypto.subtle.importKey("jwk",{kty:jwKey.kty,n:jwKey.n,e:jwKey.e,alg:jwKey.alg,kid:jwKey.kid},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"])}const nodeify=__webpack_require__(81),Buffer=__webpack_require__(13).Buffer,crypto=__webpack_require__(106)();exports.utils=__webpack_require__(569),exports.generateKey=function(bits,callback){nodeify(crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:bits,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(exportKey).then(keys=>({privateKey:keys[0],publicKey:keys[1]})),callback)},exports.unmarshalPrivateKey=function(key,callback){const privateKey=crypto.subtle.importKey("jwk",key,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]);nodeify(Promise.all([privateKey,derivePublicFromPrivate(key)]).then(keys=>exportKey({privateKey:keys[0],publicKey:keys[1]})).then(keys=>({privateKey:keys[0],publicKey:keys[1]})),callback)},exports.getRandomValues=function(arr){return Buffer.from(crypto.getRandomValues(arr))},exports.hashAndSign=function(key,msg,callback){nodeify(crypto.subtle.importKey("jwk",key,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]).then(privateKey=>{return crypto.subtle.sign({name:"RSASSA-PKCS1-v1_5"},privateKey,Uint8Array.from(msg))}).then(sig=>Buffer.from(sig)),callback)},exports.hashAndVerify=function(key,sig,msg,callback){nodeify(crypto.subtle.importKey("jwk",key,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]).then(publicKey=>{return crypto.subtle.verify({name:"RSASSA-PKCS1-v1_5"},publicKey,sig,msg)}),callback)}},function(module,exports,__webpack_require__){"use strict";const asn1=__webpack_require__(54),util=__webpack_require__(249),toBase64=util.toBase64,toBn=util.toBn,RSAPrivateKey=asn1.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}),AlgorithmIdentifier=asn1.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid({"1.2.840.113549.1.1.1":"rsa"}),this.key("none").optional().null_(),this.key("curve").optional().objid(),this.key("params").optional().seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()))}),PublicKey=asn1.define("RSAPublicKey",function(){this.seq().obj(this.key("algorithm").use(AlgorithmIdentifier),this.key("subjectPublicKey").bitstr())}),RSAPublicKey=asn1.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});exports.pkcs1ToJwk=function(bytes){const asn1=RSAPrivateKey.decode(bytes,"der");return{kty:"RSA",n:toBase64(asn1.modulus),e:toBase64(asn1.publicExponent),d:toBase64(asn1.privateExponent),p:toBase64(asn1.prime1),q:toBase64(asn1.prime2),dp:toBase64(asn1.exponent1),dq:toBase64(asn1.exponent2),qi:toBase64(asn1.coefficient),alg:"RS256",kid:"2011-04-29"}},exports.jwkToPkcs1=function(jwk){return RSAPrivateKey.encode({version:0,modulus:toBn(jwk.n),publicExponent:toBn(jwk.e),privateExponent:toBn(jwk.d),prime1:toBn(jwk.p),prime2:toBn(jwk.q),exponent1:toBn(jwk.dp),exponent2:toBn(jwk.dq),coefficient:toBn(jwk.qi)},"der")},exports.pkixToJwk=function(bytes){const ndata=PublicKey.decode(bytes,"der"),asn1=RSAPublicKey.decode(ndata.subjectPublicKey.data,"der");return{kty:"RSA",n:toBase64(asn1.modulus),e:toBase64(asn1.publicExponent),alg:"RS256",kid:"2011-04-29"}},exports.jwkToPkix=function(jwk){return PublicKey.encode({algorithm:{algorithm:"rsa",none:null},subjectPublicKey:{data:RSAPublicKey.encode({modulus:toBn(jwk.n),publicExponent:toBn(jwk.e)},"der")}},"der")}},function(module,exports,__webpack_require__){"use strict";const crypto=__webpack_require__(78);module.exports=((curve,callback)=>{crypto.ecdh.generateEphmeralKeyPair(curve,callback)})},function(module,exports,__webpack_require__){"use strict";const crypto=__webpack_require__(78),whilst=__webpack_require__(90),Buffer=__webpack_require__(13).Buffer,cipherMap={"AES-128":{ivSize:16,keySize:16},"AES-256":{ivSize:16,keySize:32},Blowfish:{ivSize:8,cipherKeySize:32}};module.exports=((cipherType,hash,secret,callback)=>{const cipher=cipherMap[cipherType];if(!cipher)return callback(new Error("unkown cipherType passed"));if(!hash)return callback(new Error("unkown hashType passed"));const cipherKeySize=cipher.keySize,ivSize=cipher.ivSize,seed=Buffer.from("key expansion"),resultLength=2*(ivSize+cipherKeySize+20);crypto.hmac.create(hash,secret,(err,m)=>{if(err)return callback(err);m.digest(seed,(err,a)=>{function stretch(cb){m.digest(Buffer.concat([a,seed]),(err,b)=>{if(err)return cb(err);let todo=b.length;j+todo>resultLength&&(todo=resultLength-j),result.push(b),j+=todo,m.digest(a,(err,_a)=>{if(err)return cb(err);a=_a,cb()})})}function finish(err){if(err)return callback(err);const half=resultLength/2,resultBuffer=Buffer.concat(result),r1=resultBuffer.slice(0,half),r2=resultBuffer.slice(half,resultLength),createKey=res=>({iv:res.slice(0,ivSize),cipherKey:res.slice(ivSize,ivSize+cipherKeySize),macKey:res.slice(ivSize+cipherKeySize)});callback(null,{k1:createKey(r1),k2:createKey(r2)})}if(err)return callback(err);let result=[],j=0;whilst(()=>j{if(err)return cb(err);let privkey;try{privkey=new Ed25519PrivateKey(keys.secretKey,keys.publicKey)}catch(err){return void cb(err)}cb(null,privkey)})}function generateKeyPairFromSeed(seed,_bits,cb){void 0===cb&&"function"==typeof _bits&&(cb=_bits),crypto.generateKeyFromSeed(seed,(err,keys)=>{if(err)return cb(err);let privkey;try{privkey=new Ed25519PrivateKey(keys.secretKey,keys.publicKey)}catch(err){return void cb(err)}cb(null,privkey)})}function ensure(cb){if("function"!=typeof cb)throw new Error("callback is required")}function ensureKey(key,length){if(Buffer.isBuffer(key)&&(key=new Uint8Array(key)),!(key instanceof Uint8Array)||key.length!==length)throw new Error("Key must be a Uint8Array or Buffer of length "+length);return key}const multihashing=__webpack_require__(30),protobuf=__webpack_require__(39),Buffer=__webpack_require__(13).Buffer,crypto=__webpack_require__(78).ed25519,pbm=protobuf(__webpack_require__(141));class Ed25519PublicKey{constructor(key){this._key=ensureKey(key,crypto.publicKeyLength)}verify(data,sig,callback){ensure(callback),crypto.hashAndVerify(this._key,sig,data,callback)}marshal(){return Buffer.from(this._key)}get bytes(){return pbm.PublicKey.encode({Type:pbm.KeyType.Ed25519,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}class Ed25519PrivateKey{constructor(key,publicKey){this._key=ensureKey(key,crypto.privateKeyLength),this._publicKey=ensureKey(publicKey,crypto.publicKeyLength)}sign(message,callback){ensure(callback),crypto.hashAndSign(this._key,message,callback)}get public(){if(!this._publicKey)throw new Error("public key not provided");return new Ed25519PublicKey(this._publicKey)}marshal(){return Buffer.concat([Buffer.from(this._key),Buffer.from(this._publicKey)])}get bytes(){return pbm.PrivateKey.encode({Type:pbm.KeyType.Ed25519,Data:this.marshal()})}equals(key){ -return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}module.exports={Ed25519PublicKey:Ed25519PublicKey,Ed25519PrivateKey:Ed25519PrivateKey,unmarshalEd25519PrivateKey:unmarshalEd25519PrivateKey,unmarshalEd25519PublicKey:unmarshalEd25519PublicKey,generateKeyPair:generateKeyPair,generateKeyPairFromSeed:generateKeyPairFromSeed}},function(module,exports,__webpack_require__){"use strict";module.exports={rsa:__webpack_require__(574),ed25519:__webpack_require__(572),secp256k1:__webpack_require__(561)}},function(module,exports,__webpack_require__){"use strict";function unmarshalRsaPrivateKey(bytes,callback){const jwk=crypto.utils.pkcs1ToJwk(bytes);crypto.unmarshalPrivateKey(jwk,(err,keys)=>{if(err)return callback(err);callback(null,new RsaPrivateKey(keys.privateKey,keys.publicKey))})}function unmarshalRsaPublicKey(bytes){return new RsaPublicKey(crypto.utils.pkixToJwk(bytes))}function generateKeyPair(bits,cb){crypto.generateKey(bits,(err,keys)=>{if(err)return cb(err);cb(null,new RsaPrivateKey(keys.privateKey,keys.publicKey))})}function ensure(cb){if("function"!=typeof cb)throw new Error("callback is required")}const multihashing=__webpack_require__(30),protobuf=__webpack_require__(39),crypto=__webpack_require__(78).rsa,pbm=protobuf(__webpack_require__(141));class RsaPublicKey{constructor(key){this._key=key}verify(data,sig,callback){ensure(callback),crypto.hashAndVerify(this._key,sig,data,callback)}marshal(){return crypto.utils.jwkToPkix(this._key)}get bytes(){return pbm.PublicKey.encode({Type:pbm.KeyType.RSA,Data:this.marshal()})}encrypt(bytes){return this._key.encrypt(bytes,"RSAES-PKCS1-V1_5")}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}class RsaPrivateKey{constructor(key,publicKey){this._key=key,this._publicKey=publicKey}genSecret(){return crypto.getRandomValues(new Uint8Array(16))}sign(message,callback){ensure(callback),crypto.hashAndSign(this._key,message,callback)}get public(){if(!this._publicKey)throw new Error("public key not provided");return new RsaPublicKey(this._publicKey)}decrypt(msg,callback){crypto.decrypt(this._key,msg,callback)}marshal(){return crypto.utils.jwkToPkcs1(this._key)}get bytes(){return pbm.PrivateKey.encode({Type:pbm.KeyType.RSA,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}module.exports={RsaPublicKey:RsaPublicKey,RsaPrivateKey:RsaPrivateKey,unmarshalRsaPublicKey:unmarshalRsaPublicKey,unmarshalRsaPrivateKey:unmarshalRsaPrivateKey,generateKeyPair:generateKeyPair}},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),log=debug("libp2p:floodsub");log.err=debug("libp2p:floodsub:error"),module.exports={log:log,multicodec:"/floodsub/1.0.0"}},function(module,exports,__webpack_require__){"use strict";const EventEmitter=__webpack_require__(8),TimeCache=__webpack_require__(815),values=__webpack_require__(149),pull=__webpack_require__(5),lp=__webpack_require__(28),assert=__webpack_require__(7),asyncEach=__webpack_require__(32),Peer=__webpack_require__(579),utils=__webpack_require__(580),pb=__webpack_require__(250),config=__webpack_require__(575),Buffer=__webpack_require__(13).Buffer,log=config.log,multicodec=config.multicodec,ensureArray=utils.ensureArray,setImmediate=__webpack_require__(11);class FloodSub extends EventEmitter{constructor(libp2p){super(),this.libp2p=libp2p,this.started=!1,this.cache=new TimeCache,this.peers=new Map,this.subscriptions=new Set,this._onConnection=this._onConnection.bind(this),this._dialPeer=this._dialPeer.bind(this)}_dialPeer(peerInfo,callback){callback=callback||function(){};const idB58Str=peerInfo.id.toB58String();log("dialing %s",idB58Str);const peer=this.peers.get(idB58Str);peer&&peer.isConnected||this.libp2p.dial(peerInfo,multicodec,(err,conn)=>{if(err)return log.err(err);this._onDial(peerInfo,conn,callback)})}_onDial(peerInfo,conn,callback){const idB58Str=peerInfo.id.toB58String();this.peers.has(idB58Str)||this.peers.set(idB58Str,new Peer(peerInfo));const peer=this.peers.get(idB58Str);peer.attachConnection(conn),peer.sendSubscriptions(this.subscriptions),setImmediate(()=>callback())}_onConnection(protocol,conn){conn.getPeerInfo((err,peerInfo)=>{if(err)return log.err("Failed to identify incomming conn",err),pull(pull.empty(),conn);const idB58Str=peerInfo.id.toB58String();this.peers.has(idB58Str)||(log("new peer",idB58Str),this.peers.set(idB58Str,new Peer(peerInfo))),this._processConnection(idB58Str,conn)})}_processConnection(idB58Str,conn){pull(conn,lp.decode(),pull.map(data=>pb.rpc.RPC.decode(data)),pull.drain(rpc=>this._onRpc(idB58Str,rpc),err=>this._onConnectionEnd(idB58Str,err)))}_onRpc(idB58Str,rpc){if(rpc){const subs=rpc.subscriptions,msgs=rpc.msgs;if(msgs&&msgs.length&&this._processRpcMessages(rpc.msgs),subs&&subs.length){const peer=this.peers.get(idB58Str);peer&&peer.updateSubscriptions(subs)}}}_processRpcMessages(msgs){msgs.forEach(msg=>{const seqno=utils.msgId(msg.from,msg.seqno.toString());this.cache.has(seqno)||(this.cache.put(seqno),this._emitMessages(msg.topicCIDs,[msg]),this._forwardMessages(msg.topicCIDs,[msg]))})}_onConnectionEnd(idB58Str,err){err&&"socket hang up"!==err.message&&log.err(err),this.peers.delete(idB58Str)}_emitMessages(topics,messages){topics.forEach(topic=>{this.subscriptions.has(topic)&&messages.forEach(message=>{this.emit(topic,message)})})}_forwardMessages(topics,messages){this.peers.forEach(peer=>{peer.isWritable&&utils.anyMatch(peer.topics,topics)&&(peer.sendMessages(messages),log("publish msgs on topics",topics,peer.info.id.toB58String()))})}start(callback){if(this.started)return setImmediate(()=>callback(new Error("already started")));this.libp2p.handle(multicodec,this._onConnection),this.libp2p.swarm.on("peer-mux-established",this._dialPeer),asyncEach(values(this.libp2p.peerBook.getAll()),(peerInfo,cb)=>{this._dialPeer(peerInfo,cb)},err=>{setImmediate(()=>{this.started=!0,callback(err)})})}stop(callback){if(!this.started)return setImmediate(()=>callback(new Error("not started yet")));this.libp2p.unhandle(multicodec),this.libp2p.swarm.removeListener("peer-mux-established",this._dialPeer),asyncEach(this.peers.values(),(peer,cb)=>peer.close(cb),err=>{if(err)return callback(err);this.peers=new Map,this.started=!1,callback()})}publish(topics,messages){assert(this.started,"FloodSub is not started"),log("publish",topics,messages),topics=ensureArray(topics),messages=ensureArray(messages);const from=this.libp2p.peerInfo.id.toB58String(),buildMessage=msg=>{const seqno=utils.randomSeqno();return this.cache.put(utils.msgId(from,seqno)),{from:from,data:msg,seqno:new Buffer(seqno),topicCIDs:topics}},msgObjects=messages.map(buildMessage);this._emitMessages(topics,msgObjects),this._forwardMessages(topics,messages.map(buildMessage))}subscribe(topics){function checkIfReady(peer){peer&&peer.isWritable?peer.sendSubscriptions(topics):setImmediate(checkIfReady.bind(peer))}assert(this.started,"FloodSub is not started"),topics=ensureArray(topics),topics.forEach(topic=>{this.subscriptions.add(topic)}),this.peers.forEach(peer=>checkIfReady(peer))}unsubscribe(topics){function checkIfReady(peer){peer&&peer.isWritable?peer.sendUnsubscriptions(topics):setImmediate(checkIfReady.bind(peer))}assert(this.started,"FloodSub is not started"),topics=ensureArray(topics),topics.forEach(topic=>{this.subscriptions.delete(topic)}),this.peers.forEach(peer=>checkIfReady(peer))}}module.exports=FloodSub},function(module,exports,__webpack_require__){"use strict";module.exports=` +}`},function(module,exports,__webpack_require__){"use strict";const waterfall=__webpack_require__(7),util=__webpack_require__(119);exports=module.exports,exports.multicodec="dag-pb",exports.resolve=((block,path,callback)=>{waterfall([cb=>util.deserialize(block.data,cb),(node,cb)=>{const split=path.split("/");if("Links"===split[0]){let remainderPath="";if(!split[1])return cb(null,{value:node.links.map(l=>l.toJSON()),remainderPath:""});const values={};node.links.forEach((l,i)=>{const link=l.toJSON();values[i]={hash:link.multihash,name:link.name,size:link.size},values[link.name]=link.multihash});let value=values[split[1]];"Hash"===split[2]?value={"/":value.hash}:"Tsize"===split[2]?value={"/":value.size}:"Name"===split[2]&&(value={"/":value.name}),remainderPath=split.slice(3).join("/"),cb(null,{value:value,remainderPath:remainderPath})}else"Data"===split[0]?cb(null,{value:node.data,remainderPath:""}):cb(new Error("path not available"))}],callback)}),exports.tree=((block,options,callback)=>{"function"==typeof options&&(callback=options,options={}),options=options||{},util.deserialize(block.data,(err,node)=>{if(err)return callback(err);const paths=[];paths.push("Links"),node.links.forEach((link,i)=>{paths.push(`Links/${i}/Name`),paths.push(`Links/${i}/Tsize`),paths.push(`Links/${i}/Hash`)}),paths.push("Data"),callback(null,paths)})}),exports.isLink=((block,path,callback)=>{exports.resolve(block,path,(err,result)=>{return err?callback(err):result.remainderPath.length>0?callback(new Error("path out of scope")):void("object"==typeof result.value&&result.value["/"]?callback(null,result.value):callback(null,!1))})})},function(module,exports,__webpack_require__){"use strict";function mapFromEthObj(ethBlockList,options,callback){let paths=[];paths.push({path:"count",value:ethBlockList.length}),each(ethBlockList,(ethBlock,next)=>{const index=ethBlockList.indexOf(ethBlock),blockPath=index.toString();paths.push({path:blockPath,value:ethBlock}),ethBlockResolver._mapFromEthObject(ethBlock,{},(err,subpaths)=>{if(err)return next(err);subpaths.forEach(path=>path.path=blockPath+"/"+path.path),paths=paths.concat(subpaths),next()})},err=>{if(err)return callback(err);callback(null,paths)})}const waterfall=__webpack_require__(7),each=__webpack_require__(19),asyncify=__webpack_require__(70),RLP=__webpack_require__(45),EthBlockHead=__webpack_require__(182),multihash=__webpack_require__(21),ethBlockResolver=__webpack_require__(198).resolver,createResolver=__webpack_require__(62),cidFromHash=__webpack_require__(53),ethBlockListResolver=createResolver("eth-block-list",void 0,mapFromEthObj),util=ethBlockListResolver.util;util.serialize=asyncify(ethBlockList=>{const rawOmmers=ethBlockList.map(ethBlock=>ethBlock.raw);return RLP.encode(rawOmmers)}),util.deserialize=asyncify(serialized=>{return RLP.decode(serialized).map(rawBlock=>new EthBlockHead(rawBlock))}),util.cid=((blockList,callback)=>{waterfall([cb=>util.serialize(blockList,cb),(data,cb)=>multihash.digest(data,"keccak-256",cb),asyncify(mhash=>cidFromHash("eth-block-list",mhash))],callback)}),module.exports=ethBlockListResolver},function(module,exports,__webpack_require__){"use strict";const ethAccountSnapshotResolver=__webpack_require__(197),createTrieResolver=__webpack_require__(120),ethStateTrieResolver=createTrieResolver("eth-state-trie",ethAccountSnapshotResolver);module.exports=ethStateTrieResolver},function(module,exports,__webpack_require__){"use strict";const createTrieResolver=__webpack_require__(120),ethStorageTrieResolver=createTrieResolver("eth-storage-trie");module.exports=ethStorageTrieResolver},function(module,exports,__webpack_require__){"use strict";const ethTxResolver=__webpack_require__(199),createTrieResolver=__webpack_require__(120),ethTxTrieResolver=createTrieResolver("eth-tx-trie",ethTxResolver);module.exports=ethTxTrieResolver},function(module,exports){function isExternalLink(obj){return Boolean(obj["/"])}module.exports=isExternalLink},function(module,exports,__webpack_require__){function toIpfsBlock(multicodec,value,callback){multihashing(value,"keccak-256",(err,hash)=>{if(err)return callback(err);callback(null,new IpfsBlock(value,new CID(1,multicodec,hash)))})}const IpfsBlock=__webpack_require__(61),CID=__webpack_require__(8),multihashing=__webpack_require__(21);module.exports=toIpfsBlock},function(module,exports,__webpack_require__){"use strict";(function(setImmediate){function noop(){}const Block=__webpack_require__(61),pull=__webpack_require__(4),CID=__webpack_require__(8),doUntil=__webpack_require__(287),IPFSRepo=__webpack_require__(193),BlockService=__webpack_require__(192),joinPath=__webpack_require__(43).join,pullDeferSource=__webpack_require__(95).source,pullTraverse=__webpack_require__(257),map=__webpack_require__(73),series=__webpack_require__(33),waterfall=__webpack_require__(7),MemoryStore=__webpack_require__(16).MemoryDatastore,dagPB=__webpack_require__(52),dagCBOR=__webpack_require__(433),ipldEthAccountSnapshot=__webpack_require__(42).ethAccountSnapshot,ipldEthBlock=__webpack_require__(42).ethBlock,ipldEthBlockList=__webpack_require__(42).ethBlockList,ipldEthStateTrie=__webpack_require__(42).ethStateTrie,ipldEthStorageTrie=__webpack_require__(42).ethStorageTrie,ipldEthTx=__webpack_require__(42).ethTx,ipldEthTxTrie=__webpack_require__(42).ethTxTrie;class IPLDResolver{constructor(blockService){if(!blockService)throw new Error("Missing blockservice");this.bs=blockService,this.resolvers={},this.support={},this.support.add=((multicodec,resolver,util)=>{if(this.resolvers[multicodec])throw new Error(multicodec+"already supported");this.resolvers[multicodec]={resolver:resolver,util:util}}),this.support.rm=(multicodec=>{this.resolvers[multicodec]&&delete this.resolvers[multicodec]}),this.support.add(dagPB.resolver.multicodec,dagPB.resolver,dagPB.util),this.support.add(dagCBOR.resolver.multicodec,dagCBOR.resolver,dagCBOR.util),this.support.add(ipldEthAccountSnapshot.resolver.multicodec,ipldEthAccountSnapshot.resolver,ipldEthAccountSnapshot.util),this.support.add(ipldEthBlock.resolver.multicodec,ipldEthBlock.resolver,ipldEthBlock.util),this.support.add(ipldEthBlockList.resolver.multicodec,ipldEthBlockList.resolver,ipldEthBlockList.util),this.support.add(ipldEthStateTrie.resolver.multicodec,ipldEthStateTrie.resolver,ipldEthStateTrie.util),this.support.add(ipldEthStorageTrie.resolver.multicodec,ipldEthStorageTrie.resolver,ipldEthStorageTrie.util),this.support.add(ipldEthTx.resolver.multicodec,ipldEthTx.resolver,ipldEthTx.util),this.support.add(ipldEthTxTrie.resolver.multicodec,ipldEthTxTrie.resolver,ipldEthTxTrie.util)}get(cid,path,options,callback){if("function"==typeof path&&(callback=path,path=void 0),"function"==typeof options&&(callback=options,options={}),"string"==typeof path&&(path=joinPath("/",path).substr(1)),""===path||!path)return this._get(cid,(err,node)=>{if(err)return callback(err);callback(null,{value:node,remainderPath:""})});let value;doUntil(cb=>{this.bs.get(cid,(err,block)=>{if(err)return cb(err);this.resolvers[cid.codec].resolver.resolve(block,path,(err,result)=>{if(err)return cb(err);value=result.value,path=result.remainderPath,cb()})})},()=>{const endReached=!path||""===path||"/"===path,isTerminal=value&&!value["/"];return!!(endReached&&isTerminal||options.localResolve)||(value&&(cid=new CID(value["/"])),!1)},(err,results)=>{return err?callback(err):callback(null,{value:value,remainderPath:path})})}getStream(cid,path,options){const deferred=pullDeferSource();return this.get(cid,path,options,(err,result)=>{if(err)return deferred.resolve(pull.error(err));deferred.resolve(pull.values([result]))}),deferred}put(node,options,callback){return"function"==typeof options?setImmediate(()=>callback(new Error("no options were passed"))):(callback=callback||noop,options.cid&&CID.isCID(options.cid)?this._put(options.cid,node,callback):(options.hashAlg=options.hashAlg||"sha2-256",void this.resolvers[options.format].util.cid(node,(err,cid)=>{if(err)return callback(err);this._put(cid,node,callback)})))}treeStream(cid,path,options){"object"==typeof path&&(options=path,path=void 0),options=options||{};let p;if(!options.recursive){p=pullDeferSource();const r=this.resolvers[cid.codec];waterfall([cb=>this.bs.get(cid,cb),(block,cb)=>r.resolver.tree(block,cb)],(err,paths)=>{if(err)return p.abort(err);p.resolve(pull.values(paths))})}return options.recursive&&(p=pull(pullTraverse.widthFirst({basePath:null,cid:cid},el=>{if("string"==typeof el)return pull.empty();const deferred=pullDeferSource(),r=this.resolvers[el.cid.codec];return waterfall([cb=>this.bs.get(el.cid,cb),(block,cb)=>r.resolver.tree(block,(err,paths)=>{if(err)return cb(err);map(paths,(p,cb)=>{r.resolver.isLink(block,p,(err,link)=>{if(err)return cb(err);cb(null,{path:p,link:link})})},cb)})],(err,paths)=>{if(err)return deferred.abort(err);deferred.resolve(pull.values(paths.map(p=>{const base=el.basePath?el.basePath+"/"+p.path:p.path;return p.link?{basePath:base,cid:new CID(p.link["/"])}:base})))}),deferred}),pull.map(e=>{return"string"==typeof e?e:e.basePath}),pull.filter(Boolean))),path?pull(p,pull.map(el=>{if(0===el.indexOf(path))return el=el.slice(path.length+1)}),pull.filter(Boolean)):p}remove(cids,callback){this.bs.delete(cids,callback)}_get(cid,callback){const r=this.resolvers[cid.codec];waterfall([cb=>this.bs.get(cid,cb),(block,cb)=>{r?r.util.deserialize(block.data,(err,deserialized)=>{if(err)return cb(err);cb(null,deserialized)}):cb(null,block.data)}],callback)}_put(cid,node,callback){callback=callback||noop;const r=this.resolvers[cid.codec];waterfall([cb=>r.util.serialize(node,cb),(buf,cb)=>this.bs.put(new Block(buf,cid),cb)],err=>{if(err)return callback(err);callback(null,cid)})}}IPLDResolver.inMemory=function(callback){const repo=new IPFSRepo("in-memory",{storageBackends:{root:MemoryStore,blocks:MemoryStore,datastore:MemoryStore},lock:"memory"}),blockService=new BlockService(repo);series([cb=>repo.init({},cb),cb=>repo.open(cb)],err=>{if(err)return callback(err);callback(null,new IPLDResolver(blockService))})},module.exports=IPLDResolver}).call(exports,__webpack_require__(37).setImmediate)},function(module,exports){function isCircular(obj){return new CircularChecker(obj).isCircular()}function CircularChecker(obj){this.obj=obj}module.exports=isCircular,CircularChecker.prototype.isCircular=function(obj,seen){if(obj=obj||this.obj,seen=seen||[],!(obj instanceof Object))throw new TypeError('"obj" must be an object (or inherit from it)');var self=this;seen.push(obj);for(var key in obj){var val=obj[key];if(val instanceof Object&&(~seen.indexOf(val)||self.isCircular(val,seen.slice())))return!0}return!1}},function(module,exports,__webpack_require__){"use strict";function isProperty(str){return/^[$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(str)}module.exports=isProperty},function(module,exports,__webpack_require__){"use strict";var isStream=module.exports=function(stream){return null!==stream&&"object"==typeof stream&&"function"==typeof stream.pipe};isStream.writable=function(stream){return isStream(stream)&&stream.writable!==!1&&"function"==typeof stream._write&&"object"==typeof stream._writableState},isStream.readable=function(stream){return isStream(stream)&&stream.readable!==!1&&"function"==typeof stream._read&&"object"==typeof stream._readableState},isStream.duplex=function(stream){return isStream.writable(stream)&&isStream.readable(stream)},isStream.transform=function(stream){return isStream.duplex(stream)&&"function"==typeof stream._transform&&"object"==typeof stream._transformState}},function(module,exports,__webpack_require__){(function(process,global){!function(){"use strict";function Keccak(bits,padding,outputBits){this.blocks=[],this.s=[],this.padding=padding,this.outputBits=outputBits,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(bits<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=outputBits>>5,this.extraBytes=(31&outputBits)>>3;for(var i=0;i<50;++i)this.s[i]=0}function Kmac(bits,padding,outputBits){Keccak.call(this,bits,padding,outputBits)}var root="object"==typeof window?window:{};!root.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(root=global);var COMMON_JS=!root.JS_SHA3_NO_COMMON_JS&&"object"==typeof module&&module.exports,ARRAY_BUFFER=!root.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),SHAKE_PADDING=[31,7936,2031616,520093696],CSHAKE_PADDING=[4,1024,262144,67108864],KECCAK_PADDING=[1,256,65536,16777216],PADDING=[6,1536,393216,100663296],SHIFT=[0,8,16,24],RC=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],BITS=[224,256,384,512],SHAKE_BITS=[128,256],OUTPUT_TYPES=["hex","buffer","arrayBuffer","array"],CSHAKE_BYTEPAD={128:168,256:136};!root.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(obj){return"[object Array]"===Object.prototype.toString.call(obj)});for(var createOutputMethod=function(bits,padding,outputType){return function(message){return new Keccak(bits,padding,bits).update(message)[outputType]()}},createShakeOutputMethod=function(bits,padding,outputType){return function(message,outputBits){return new Keccak(bits,padding,outputBits).update(message)[outputType]()}},createCshakeOutputMethod=function(bits,padding,outputType){return function(message,outputBits,n,s){return methods["cshake"+bits].update(message,outputBits,n,s)[outputType]()}},createKmacOutputMethod=function(bits,padding,outputType){return function(key,message,outputBits,s){return methods["kmac"+bits].update(key,message,outputBits,s)[outputType]()}},createOutputMethods=function(method,createMethod,bits,padding){for(var i=0;i>2]|=message[index]<>2]|=code<>2]|=(192|code>>6)<>2]|=(128|63&code)<=57344?(blocks[i>>2]|=(224|code>>12)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<>2]|=(240|code>>18)<>2]|=(128|code>>12&63)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<=byteCount){for(this.start=i-byteCount,this.block=blocks[blockCount],i=0;i>=8,o=255&x;o>0;)bytes.unshift(o),x>>=8,o=255&x,++n;return right?bytes.push(n):bytes.unshift(n),this.update(bytes),bytes.length},Keccak.prototype.encodeString=function(str){str=str||"";var notString="string"!=typeof str;notString&&str.constructor===root.ArrayBuffer&&(str=new Uint8Array(str));var length=str.length;if(notString&&("number"!=typeof length||!Array.isArray(str)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(str))))throw"input is invalid type";var bytes=0;if(notString)bytes=length;else for(var i=0;i=57344?bytes+=3:(code=65536+((1023&code)<<10|1023&str.charCodeAt(++i)),bytes+=4)}return bytes+=this.encode(8*bytes),this.update(str),bytes},Keccak.prototype.bytepad=function(strs,w){for(var bytes=this.encode(w),i=0;i>2]|=this.padding[3&i],this.lastByteIndex===this.byteCount)for(blocks[0]=blocks[blockCount],i=1;i>4&15]+HEX_CHARS[15&block]+HEX_CHARS[block>>12&15]+HEX_CHARS[block>>8&15]+HEX_CHARS[block>>20&15]+HEX_CHARS[block>>16&15]+HEX_CHARS[block>>28&15]+HEX_CHARS[block>>24&15];j%blockCount==0&&(f(s),i=0)}return extraBytes&&(block=s[i],extraBytes>0&&(hex+=HEX_CHARS[block>>4&15]+HEX_CHARS[15&block]),extraBytes>1&&(hex+=HEX_CHARS[block>>12&15]+HEX_CHARS[block>>8&15]),extraBytes>2&&(hex+=HEX_CHARS[block>>20&15]+HEX_CHARS[block>>16&15])),hex},Keccak.prototype.arrayBuffer=function(){this.finalize();var buffer,blockCount=this.blockCount,s=this.s,outputBlocks=this.outputBlocks,extraBytes=this.extraBytes,i=0,j=0,bytes=this.outputBits>>3;buffer=extraBytes?new ArrayBuffer(outputBlocks+1<<2):new ArrayBuffer(bytes);for(var array=new Uint32Array(buffer);j>8&255,array[offset+2]=block>>16&255,array[offset+3]=block>>24&255;j%blockCount==0&&f(s)}return extraBytes&&(offset=j<<2,block=s[i],extraBytes>0&&(array[offset]=255&block),extraBytes>1&&(array[offset+1]=block>>8&255),extraBytes>2&&(array[offset+2]=block>>16&255)),array},Kmac.prototype=new Keccak,Kmac.prototype.finalize=function(){return this.encode(this.outputBits,!0), +Keccak.prototype.finalize.call(this)};var f=function(s){var h,l,n,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49;for(n=0;n<48;n+=2)c0=s[0]^s[10]^s[20]^s[30]^s[40],c1=s[1]^s[11]^s[21]^s[31]^s[41],c2=s[2]^s[12]^s[22]^s[32]^s[42],c3=s[3]^s[13]^s[23]^s[33]^s[43],c4=s[4]^s[14]^s[24]^s[34]^s[44],c5=s[5]^s[15]^s[25]^s[35]^s[45],c6=s[6]^s[16]^s[26]^s[36]^s[46],c7=s[7]^s[17]^s[27]^s[37]^s[47],c8=s[8]^s[18]^s[28]^s[38]^s[48],c9=s[9]^s[19]^s[29]^s[39]^s[49],h=c8^(c2<<1|c3>>>31),l=c9^(c3<<1|c2>>>31),s[0]^=h,s[1]^=l,s[10]^=h,s[11]^=l,s[20]^=h,s[21]^=l,s[30]^=h,s[31]^=l,s[40]^=h,s[41]^=l,h=c0^(c4<<1|c5>>>31),l=c1^(c5<<1|c4>>>31),s[2]^=h,s[3]^=l,s[12]^=h,s[13]^=l,s[22]^=h,s[23]^=l,s[32]^=h,s[33]^=l,s[42]^=h,s[43]^=l,h=c2^(c6<<1|c7>>>31),l=c3^(c7<<1|c6>>>31),s[4]^=h,s[5]^=l,s[14]^=h,s[15]^=l,s[24]^=h,s[25]^=l,s[34]^=h,s[35]^=l,s[44]^=h,s[45]^=l,h=c4^(c8<<1|c9>>>31),l=c5^(c9<<1|c8>>>31),s[6]^=h,s[7]^=l,s[16]^=h,s[17]^=l,s[26]^=h,s[27]^=l,s[36]^=h,s[37]^=l,s[46]^=h,s[47]^=l,h=c6^(c0<<1|c1>>>31),l=c7^(c1<<1|c0>>>31),s[8]^=h,s[9]^=l,s[18]^=h,s[19]^=l,s[28]^=h,s[29]^=l,s[38]^=h,s[39]^=l,s[48]^=h,s[49]^=l,b0=s[0],b1=s[1],b32=s[11]<<4|s[10]>>>28,b33=s[10]<<4|s[11]>>>28,b14=s[20]<<3|s[21]>>>29,b15=s[21]<<3|s[20]>>>29,b46=s[31]<<9|s[30]>>>23,b47=s[30]<<9|s[31]>>>23,b28=s[40]<<18|s[41]>>>14,b29=s[41]<<18|s[40]>>>14,b20=s[2]<<1|s[3]>>>31,b21=s[3]<<1|s[2]>>>31,b2=s[13]<<12|s[12]>>>20,b3=s[12]<<12|s[13]>>>20,b34=s[22]<<10|s[23]>>>22,b35=s[23]<<10|s[22]>>>22,b16=s[33]<<13|s[32]>>>19,b17=s[32]<<13|s[33]>>>19,b48=s[42]<<2|s[43]>>>30,b49=s[43]<<2|s[42]>>>30,b40=s[5]<<30|s[4]>>>2,b41=s[4]<<30|s[5]>>>2,b22=s[14]<<6|s[15]>>>26,b23=s[15]<<6|s[14]>>>26,b4=s[25]<<11|s[24]>>>21,b5=s[24]<<11|s[25]>>>21,b36=s[34]<<15|s[35]>>>17,b37=s[35]<<15|s[34]>>>17,b18=s[45]<<29|s[44]>>>3,b19=s[44]<<29|s[45]>>>3,b10=s[6]<<28|s[7]>>>4,b11=s[7]<<28|s[6]>>>4,b42=s[17]<<23|s[16]>>>9,b43=s[16]<<23|s[17]>>>9,b24=s[26]<<25|s[27]>>>7,b25=s[27]<<25|s[26]>>>7,b6=s[36]<<21|s[37]>>>11,b7=s[37]<<21|s[36]>>>11,b38=s[47]<<24|s[46]>>>8,b39=s[46]<<24|s[47]>>>8,b30=s[8]<<27|s[9]>>>5,b31=s[9]<<27|s[8]>>>5,b12=s[18]<<20|s[19]>>>12,b13=s[19]<<20|s[18]>>>12,b44=s[29]<<7|s[28]>>>25,b45=s[28]<<7|s[29]>>>25,b26=s[38]<<8|s[39]>>>24,b27=s[39]<<8|s[38]>>>24,b8=s[48]<<14|s[49]>>>18,b9=s[49]<<14|s[48]>>>18,s[0]=b0^~b2&b4,s[1]=b1^~b3&b5,s[10]=b10^~b12&b14,s[11]=b11^~b13&b15,s[20]=b20^~b22&b24,s[21]=b21^~b23&b25,s[30]=b30^~b32&b34,s[31]=b31^~b33&b35,s[40]=b40^~b42&b44,s[41]=b41^~b43&b45,s[2]=b2^~b4&b6,s[3]=b3^~b5&b7,s[12]=b12^~b14&b16,s[13]=b13^~b15&b17,s[22]=b22^~b24&b26,s[23]=b23^~b25&b27,s[32]=b32^~b34&b36,s[33]=b33^~b35&b37,s[42]=b42^~b44&b46,s[43]=b43^~b45&b47,s[4]=b4^~b6&b8,s[5]=b5^~b7&b9,s[14]=b14^~b16&b18,s[15]=b15^~b17&b19,s[24]=b24^~b26&b28,s[25]=b25^~b27&b29,s[34]=b34^~b36&b38,s[35]=b35^~b37&b39,s[44]=b44^~b46&b48,s[45]=b45^~b47&b49,s[6]=b6^~b8&b0,s[7]=b7^~b9&b1,s[16]=b16^~b18&b10,s[17]=b17^~b19&b11,s[26]=b26^~b28&b20,s[27]=b27^~b29&b21,s[36]=b36^~b38&b30,s[37]=b37^~b39&b31,s[46]=b46^~b48&b40,s[47]=b47^~b49&b41,s[8]=b8^~b0&b2,s[9]=b9^~b1&b3,s[18]=b18^~b10&b12,s[19]=b19^~b11&b13,s[28]=b28^~b20&b22,s[29]=b29^~b21&b23,s[38]=b38^~b30&b32,s[39]=b39^~b31&b33,s[48]=b48^~b40&b42,s[49]=b49^~b41&b43,s[0]^=RC[n],s[1]^=RC[n+1]};if(COMMON_JS)module.exports=methods;else for(var i=0;i=6.2.3 <7.0.0",type:"range"},"/Users/koruza/code/js-ipfs/node_modules/secp256k1"]],_from:"elliptic@>=6.2.3 <7.0.0",_id:"elliptic@6.4.0",_inCache:!0,_location:"/elliptic",_nodeVersion:"7.0.0",_npmOperationalInternal:{host:"packages-18-east.internal.npmjs.com",tmp:"tmp/elliptic-6.4.0.tgz_1487798866428_0.30510620190761983"},_npmUser:{name:"indutny",email:"fedor@indutny.com"},_npmVersion:"3.10.8",_phantomChildren:{},_requested:{raw:"elliptic@^6.2.3",scope:null,escapedName:"elliptic",name:"elliptic",rawSpec:"^6.2.3",spec:">=6.2.3 <7.0.0",type:"range"},_requiredBy:["/browserify-sign","/create-ecdh","/secp256k1"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz",_shasum:"cac9af8762c85836187003c8dfe193e5e2eae5df",_shrinkwrap:null,_spec:"elliptic@^6.2.3",_where:"/Users/koruza/code/js-ipfs/node_modules/secp256k1",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},directories:{},dist:{shasum:"cac9af8762c85836187003c8dfe193e5e2eae5df",tarball:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz"},files:["lib"],gitHead:"6b0d2b76caae91471649c8e21f0b1d3ba0f96090",homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",maintainers:[{name:"indutny",email:"fedor@indutny.com"}],name:"elliptic",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.0"}},function(module,exports){module.exports={name:"ipfs",version:"0.25.0",description:"JavaScript implementation of the IPFS specification",bin:{jsipfs:"src/cli/bin.js"},main:"src/core/index.js",browser:{"./src/core/components/init-assets.js":!1,"./src/core/runtime/config-nodejs.json":"./src/core/runtime/config-browser.json","./src/core/runtime/libp2p-nodejs.js":"./src/core/runtime/libp2p-browser.js","./src/core/runtime/repo-nodejs.js":"./src/core/runtime/repo-browser.js","./test/utils/create-repo-nodejs.js":"./test/utils/create-repo-browser.js",stream:"readable-stream"},engines:{node:">=6.0.0",npm:">=3.0.0"},scripts:{lint:"aegir-lint",coverage:"gulp coverage",test:"gulp test --dom","test:node":"npm run test:unit:node","test:browser":"npm run test:unit:browser","test:unit:node":"gulp test:node","test:unit:node:core":"TEST=core npm run test:unit:node","test:unit:node:http":"TEST=http npm run test:unit:node","test:unit:node:cli":"TEST=cli npm run test:unit:node","test:unit:browser":"gulp test:browser","test:interop":"npm run test:interop:node","test:interop:node":"mocha -t 60000 test/interop/node.js","test:interop:browser":"mocha -t 60000 test/interop/browser.js","test:benchmark":'echo "Error: no benchmarks yet" && exit 1',"test:benchmark:node":'echo "Error: no benchmarks yet" && exit 1',"test:benchmark:node:core":'echo "Error: no benchmarks yet" && exit 1',"test:benchmark:node:http":'echo "Error: no benchmarks yet" && exit 1',"test:benchmark:browser":'echo "Error: no benchmarks yet" && exit 1',build:"gulp build",release:"gulp release","release-minor":"gulp release --type minor","release-major":"gulp release --type major","coverage-publish":"aegir-coverage publish"},"pre-commit":["lint","test"],repository:{type:"git",url:"git+https://github.com/ipfs/js-ipfs.git"},keywords:["IPFS"],author:"David Dias ",license:"MIT",bugs:{url:"https://github.com/ipfs/js-ipfs/issues"},homepage:"https://github.com/ipfs/js-ipfs#readme",devDependencies:{aegir:"^11.0.2","buffer-loader":"0.0.1",chai:"^4.1.0",delay:"^2.0.0","detect-node":"^2.0.3","dir-compare":"^1.4.0","dirty-chai":"^2.0.1","eslint-plugin-react":"^7.1.0",execa:"^0.7.0","expose-loader":"^0.7.3","form-data":"^2.2.0",gulp:"^3.9.1","interface-ipfs-core":"~0.30.1","ipfsd-ctl":"~0.21.0","left-pad":"^1.1.3",lodash:"^4.17.4",mocha:"^3.4.2",ncp:"^2.0.0",nexpect:"^0.5.0","pre-commit":"^1.2.2","pretty-bytes":"^4.0.2",qs:"^6.5.0","random-fs":"^1.0.3",rimraf:"^2.6.1","stream-to-promise":"^2.2.0","transform-loader":"^0.2.4"},dependencies:{async:"^2.5.0",bl:"^1.2.1",boom:"^5.2.0",cids:"^0.5.1",debug:"^2.6.8","fsm-event":"^2.1.0",glob:"^7.1.2",hapi:"^16.5.0","hapi-set-header":"^1.0.2",hoek:"^4.2.0","ipfs-api":"^14.1.1","ipfs-bitswap":"~0.15.0","ipfs-block":"~0.6.0","ipfs-block-service":"~0.12.0","ipfs-multipart":"~0.1.0","ipfs-repo":"~0.17.0","ipfs-unixfs":"~0.1.12","ipfs-unixfs-engine":"~0.22.0","ipld-resolver":"~0.13.0","is-ipfs":"^0.3.0","is-stream":"^1.1.0",joi:"^10.6.0",libp2p:"^0.11.0","libp2p-floodsub":"~0.11.0","libp2p-kad-dht":"^0.4.1","libp2p-mdns":"^0.8.0","libp2p-multiplex":"^0.4.4","libp2p-railing":"^0.6.1","libp2p-secio":"^0.7.1","libp2p-swarm":"^0.31.0","libp2p-tcp":"^0.10.2","libp2p-webrtc-star":"^0.12.0","libp2p-websockets":"^0.10.1","lodash.flatmap":"^4.5.0","lodash.get":"^4.4.2","lodash.sortby":"^4.7.0","lodash.values":"^4.3.0",mafmt:"^2.1.8",mkdirp:"^0.5.1",multiaddr:"^2.3.0",multihashes:"~0.4.5",once:"^1.4.0","path-exists":"^3.0.0","peer-book":"^0.5.0","peer-id":"^0.9.0","peer-info":"^0.10.0","promisify-es6":"^1.0.3","pull-file":"^1.0.0","pull-paramap":"^1.2.2","pull-pushable":"^2.1.1","pull-sort":"^1.0.1","pull-stream":"^3.6.0","pull-stream-to-stream":"^1.3.4","pull-zip":"^2.0.1","read-pkg-up":"^2.0.0","readable-stream":"2.3.3","safe-buffer":"^5.1.1","stream-to-pull-stream":"^1.7.2","tar-stream":"^1.5.4",temp:"^0.8.3",through2:"^2.0.3","update-notifier":"^2.2.0",yargs:"8.0.2"},contributors:["Andrew de Andrade ","CHEVALAY JOSSELIN ","Caio Gondim ","Christian Couder ","Daniel J. O'Quinn ","Daniela Borges Matos de Carvalho ","David Dias ","Enrico Marino ","Felix Yan ","Francisco Baio Dias ","Francisco Baio Dias ","Friedel Ziegelmayer ","Georgios Rassias ","Greenkeeper ","Haad ","Harsh Vakharia ","Jon Schlinkert ","João Antunes ","Kevin Wang ","Lars Gierth ","Marius Darila ","Michelle Lee ","Mikeal Rogers ","Mithgol ","Nuno Nogueira ","Oskar Nyberg ","Pau Ramon Revilla ","Pedro Teixeira ","Richard Littauer ","Rod Keys ","Sid Harder ","SidHarder ","Stephen Whitmore ","Stephen Whitmore ","Terence Pae ","Xiao Liang ","haad ","jbenet ","kumavis ","nginnever ","npmcdn-to-unpkg-bot ","tcme ","ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ "]}},function(module,exports,__webpack_require__){"use strict";var createKeccak=__webpack_require__(456),createShake=__webpack_require__(457);module.exports=function(KeccakState){var Keccak=createKeccak(KeccakState),Shake=createShake(KeccakState);return function(algorithm,options){switch("string"==typeof algorithm?algorithm.toLowerCase():algorithm){case"keccak224":return new Keccak(1152,448,null,224,options);case"keccak256":return new Keccak(1088,512,null,256,options);case"keccak384":return new Keccak(832,768,null,384,options);case"keccak512":return new Keccak(576,1024,null,512,options);case"sha3-224":return new Keccak(1152,448,6,224,options);case"sha3-256":return new Keccak(1088,512,6,256,options);case"sha3-384":return new Keccak(832,768,6,384,options);case"sha3-512":return new Keccak(576,1024,6,512,options);case"shake128":return new Shake(1344,256,31,options);case"shake256":return new Shake(1088,512,31,options);default:throw new Error("Invald algorithm: "+algorithm)}}}},function(module,exports,__webpack_require__){"use strict";var Buffer=__webpack_require__(6).Buffer,Transform=__webpack_require__(25).Transform,inherits=__webpack_require__(1);module.exports=function(KeccakState){function Keccak(rate,capacity,delimitedSuffix,hashBitLength,options){Transform.call(this,options),this._rate=rate,this._capacity=capacity,this._delimitedSuffix=delimitedSuffix,this._hashBitLength=hashBitLength,this._options=options,this._state=new KeccakState,this._state.initialize(rate,capacity),this._finalized=!1}return inherits(Keccak,Transform),Keccak.prototype._transform=function(chunk,encoding,callback){var error=null;try{this.update(chunk,encoding)}catch(err){error=err}callback(error)},Keccak.prototype._flush=function(callback){var error=null;try{this.push(this.digest())}catch(err){error=err}callback(error)},Keccak.prototype.update=function(data,encoding){if(!Buffer.isBuffer(data)&&"string"!=typeof data)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(data)||(data=Buffer.from(data,encoding)),this._state.absorb(data),this},Keccak.prototype.digest=function(encoding){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var digest=this._state.squeeze(this._hashBitLength/8);return void 0!==encoding&&(digest=digest.toString(encoding)),this._resetState(),digest},Keccak.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},Keccak.prototype._clone=function(){var clone=new Keccak(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(clone._state),clone._finalized=this._finalized,clone},Keccak}},function(module,exports,__webpack_require__){"use strict";var Buffer=__webpack_require__(6).Buffer,Transform=__webpack_require__(25).Transform,inherits=__webpack_require__(1);module.exports=function(KeccakState){function Shake(rate,capacity,delimitedSuffix,options){Transform.call(this,options),this._rate=rate,this._capacity=capacity,this._delimitedSuffix=delimitedSuffix,this._options=options,this._state=new KeccakState,this._state.initialize(rate,capacity),this._finalized=!1}return inherits(Shake,Transform),Shake.prototype._transform=function(chunk,encoding,callback){var error=null;try{this.update(chunk,encoding)}catch(err){error=err}callback(error)},Shake.prototype._flush=function(){},Shake.prototype._read=function(size){this.push(this.squeeze(size))},Shake.prototype.update=function(data,encoding){if(!Buffer.isBuffer(data)&&"string"!=typeof data)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(data)||(data=Buffer.from(data,encoding)),this._state.absorb(data),this},Shake.prototype.squeeze=function(dataByteLength,encoding){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var data=this._state.squeeze(dataByteLength);return void 0!==encoding&&(data=data.toString(encoding)),data},Shake.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},Shake.prototype._clone=function(){var clone=new Shake(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(clone._state),clone._finalized=this._finalized,clone},Shake}},function(module,exports,__webpack_require__){"use strict";var P1600_ROUND_CONSTANTS=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];exports.p1600=function(s){for(var round=0;round<24;++round){var lo0=s[0]^s[10]^s[20]^s[30]^s[40],hi0=s[1]^s[11]^s[21]^s[31]^s[41],lo1=s[2]^s[12]^s[22]^s[32]^s[42],hi1=s[3]^s[13]^s[23]^s[33]^s[43],lo2=s[4]^s[14]^s[24]^s[34]^s[44],hi2=s[5]^s[15]^s[25]^s[35]^s[45],lo3=s[6]^s[16]^s[26]^s[36]^s[46],hi3=s[7]^s[17]^s[27]^s[37]^s[47],lo4=s[8]^s[18]^s[28]^s[38]^s[48],hi4=s[9]^s[19]^s[29]^s[39]^s[49],lo=lo4^(lo1<<1|hi1>>>31),hi=hi4^(hi1<<1|lo1>>>31),t1slo0=s[0]^lo,t1shi0=s[1]^hi,t1slo5=s[10]^lo,t1shi5=s[11]^hi,t1slo10=s[20]^lo,t1shi10=s[21]^hi,t1slo15=s[30]^lo,t1shi15=s[31]^hi,t1slo20=s[40]^lo,t1shi20=s[41]^hi;lo=lo0^(lo2<<1|hi2>>>31),hi=hi0^(hi2<<1|lo2>>>31);var t1slo1=s[2]^lo,t1shi1=s[3]^hi,t1slo6=s[12]^lo,t1shi6=s[13]^hi,t1slo11=s[22]^lo,t1shi11=s[23]^hi,t1slo16=s[32]^lo,t1shi16=s[33]^hi,t1slo21=s[42]^lo,t1shi21=s[43]^hi;lo=lo1^(lo3<<1|hi3>>>31),hi=hi1^(hi3<<1|lo3>>>31);var t1slo2=s[4]^lo,t1shi2=s[5]^hi,t1slo7=s[14]^lo,t1shi7=s[15]^hi,t1slo12=s[24]^lo,t1shi12=s[25]^hi,t1slo17=s[34]^lo,t1shi17=s[35]^hi,t1slo22=s[44]^lo,t1shi22=s[45]^hi;lo=lo2^(lo4<<1|hi4>>>31),hi=hi2^(hi4<<1|lo4>>>31);var t1slo3=s[6]^lo,t1shi3=s[7]^hi,t1slo8=s[16]^lo,t1shi8=s[17]^hi,t1slo13=s[26]^lo,t1shi13=s[27]^hi,t1slo18=s[36]^lo,t1shi18=s[37]^hi,t1slo23=s[46]^lo,t1shi23=s[47]^hi;lo=lo3^(lo0<<1|hi0>>>31),hi=hi3^(hi0<<1|lo0>>>31);var t1slo4=s[8]^lo,t1shi4=s[9]^hi,t1slo9=s[18]^lo,t1shi9=s[19]^hi,t1slo14=s[28]^lo,t1shi14=s[29]^hi,t1slo19=s[38]^lo,t1shi19=s[39]^hi,t1slo24=s[48]^lo,t1shi24=s[49]^hi,t2slo0=t1slo0,t2shi0=t1shi0,t2slo16=t1shi5<<4|t1slo5>>>28,t2shi16=t1slo5<<4|t1shi5>>>28,t2slo7=t1slo10<<3|t1shi10>>>29,t2shi7=t1shi10<<3|t1slo10>>>29,t2slo23=t1shi15<<9|t1slo15>>>23,t2shi23=t1slo15<<9|t1shi15>>>23,t2slo14=t1slo20<<18|t1shi20>>>14,t2shi14=t1shi20<<18|t1slo20>>>14,t2slo10=t1slo1<<1|t1shi1>>>31,t2shi10=t1shi1<<1|t1slo1>>>31,t2slo1=t1shi6<<12|t1slo6>>>20,t2shi1=t1slo6<<12|t1shi6>>>20,t2slo17=t1slo11<<10|t1shi11>>>22,t2shi17=t1shi11<<10|t1slo11>>>22,t2slo8=t1shi16<<13|t1slo16>>>19,t2shi8=t1slo16<<13|t1shi16>>>19,t2slo24=t1slo21<<2|t1shi21>>>30,t2shi24=t1shi21<<2|t1slo21>>>30,t2slo20=t1shi2<<30|t1slo2>>>2,t2shi20=t1slo2<<30|t1shi2>>>2,t2slo11=t1slo7<<6|t1shi7>>>26,t2shi11=t1shi7<<6|t1slo7>>>26,t2slo2=t1shi12<<11|t1slo12>>>21,t2shi2=t1slo12<<11|t1shi12>>>21,t2slo18=t1slo17<<15|t1shi17>>>17,t2shi18=t1shi17<<15|t1slo17>>>17,t2slo9=t1shi22<<29|t1slo22>>>3,t2shi9=t1slo22<<29|t1shi22>>>3,t2slo5=t1slo3<<28|t1shi3>>>4,t2shi5=t1shi3<<28|t1slo3>>>4,t2slo21=t1shi8<<23|t1slo8>>>9,t2shi21=t1slo8<<23|t1shi8>>>9,t2slo12=t1slo13<<25|t1shi13>>>7,t2shi12=t1shi13<<25|t1slo13>>>7,t2slo3=t1slo18<<21|t1shi18>>>11,t2shi3=t1shi18<<21|t1slo18>>>11,t2slo19=t1shi23<<24|t1slo23>>>8,t2shi19=t1slo23<<24|t1shi23>>>8,t2slo15=t1slo4<<27|t1shi4>>>5,t2shi15=t1shi4<<27|t1slo4>>>5,t2slo6=t1slo9<<20|t1shi9>>>12,t2shi6=t1shi9<<20|t1slo9>>>12,t2slo22=t1shi14<<7|t1slo14>>>25,t2shi22=t1slo14<<7|t1shi14>>>25,t2slo13=t1slo19<<8|t1shi19>>>24,t2shi13=t1shi19<<8|t1slo19>>>24,t2slo4=t1slo24<<14|t1shi24>>>18,t2shi4=t1shi24<<14|t1slo24>>>18;s[0]=t2slo0^~t2slo1&t2slo2,s[1]=t2shi0^~t2shi1&t2shi2,s[10]=t2slo5^~t2slo6&t2slo7,s[11]=t2shi5^~t2shi6&t2shi7,s[20]=t2slo10^~t2slo11&t2slo12,s[21]=t2shi10^~t2shi11&t2shi12,s[30]=t2slo15^~t2slo16&t2slo17,s[31]=t2shi15^~t2shi16&t2shi17,s[40]=t2slo20^~t2slo21&t2slo22,s[41]=t2shi20^~t2shi21&t2shi22,s[2]=t2slo1^~t2slo2&t2slo3,s[3]=t2shi1^~t2shi2&t2shi3,s[12]=t2slo6^~t2slo7&t2slo8,s[13]=t2shi6^~t2shi7&t2shi8,s[22]=t2slo11^~t2slo12&t2slo13,s[23]=t2shi11^~t2shi12&t2shi13,s[32]=t2slo16^~t2slo17&t2slo18,s[33]=t2shi16^~t2shi17&t2shi18,s[42]=t2slo21^~t2slo22&t2slo23,s[43]=t2shi21^~t2shi22&t2shi23,s[4]=t2slo2^~t2slo3&t2slo4,s[5]=t2shi2^~t2shi3&t2shi4,s[14]=t2slo7^~t2slo8&t2slo9,s[15]=t2shi7^~t2shi8&t2shi9,s[24]=t2slo12^~t2slo13&t2slo14,s[25]=t2shi12^~t2shi13&t2shi14,s[34]=t2slo17^~t2slo18&t2slo19,s[35]=t2shi17^~t2shi18&t2shi19,s[44]=t2slo22^~t2slo23&t2slo24,s[45]=t2shi22^~t2shi23&t2shi24,s[6]=t2slo3^~t2slo4&t2slo0,s[7]=t2shi3^~t2shi4&t2shi0,s[16]=t2slo8^~t2slo9&t2slo5,s[17]=t2shi8^~t2shi9&t2shi5,s[26]=t2slo13^~t2slo14&t2slo10,s[27]=t2shi13^~t2shi14&t2shi10,s[36]=t2slo18^~t2slo19&t2slo15,s[37]=t2shi18^~t2shi19&t2shi15,s[46]=t2slo23^~t2slo24&t2slo20,s[47]=t2shi23^~t2shi24&t2shi20,s[8]=t2slo4^~t2slo0&t2slo1,s[9]=t2shi4^~t2shi0&t2shi1,s[18]=t2slo9^~t2slo5&t2slo6,s[19]=t2shi9^~t2shi5&t2shi6,s[28]=t2slo14^~t2slo10&t2slo11,s[29]=t2shi14^~t2shi10&t2shi11,s[38]=t2slo19^~t2slo15&t2slo16,s[39]=t2shi19^~t2shi15&t2shi16,s[48]=t2slo24^~t2slo20&t2slo21,s[49]=t2shi24^~t2shi20&t2shi21,s[0]^=P1600_ROUND_CONSTANTS[2*round],s[1]^=P1600_ROUND_CONSTANTS[2*round+1]}}},function(module,exports,__webpack_require__){"use strict";function Keccak(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}var Buffer=__webpack_require__(6).Buffer,keccakState=__webpack_require__(458);Keccak.prototype.initialize=function(rate,capacity){for(var i=0;i<50;++i)this.state[i]=0;this.blockSize=rate/8,this.count=0,this.squeezing=!1},Keccak.prototype.absorb=function(data){for(var i=0;i>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(keccakState.p1600(this.state),this.count=0);return output},Keccak.prototype.copy=function(dest){for(var i=0;i<50;++i)dest.state[i]=this.state[i];dest.blockSize=this.blockSize,dest.count=this.count,dest.squeezing=this.squeezing},module.exports=Keccak},function(module,exports,__webpack_require__){module.exports=__webpack_require__(320).SHA3Hash},function(module,exports,__webpack_require__){function Codec(opts){this.opts=opts||{},this.encodings=encodings}var encodings=__webpack_require__(462);module.exports=Codec,Codec.prototype._encoding=function(encoding){return"string"==typeof encoding&&(encoding=encodings[encoding]),encoding||(encoding=encodings.id),encoding},Codec.prototype._keyEncoding=function(opts,batchOpts){return this._encoding(batchOpts&&batchOpts.keyEncoding||opts&&opts.keyEncoding||this.opts.keyEncoding)},Codec.prototype._valueEncoding=function(opts,batchOpts){return this._encoding(batchOpts&&(batchOpts.valueEncoding||batchOpts.encoding)||opts&&(opts.valueEncoding||opts.encoding)||this.opts.valueEncoding||this.opts.encoding)},Codec.prototype.encodeKey=function(key,opts,batchOpts){return this._keyEncoding(opts,batchOpts).encode(key)},Codec.prototype.encodeValue=function(value,opts,batchOpts){return this._valueEncoding(opts,batchOpts).encode(value)},Codec.prototype.decodeKey=function(key,opts){return this._keyEncoding(opts).decode(key)},Codec.prototype.decodeValue=function(value,opts){return this._valueEncoding(opts).decode(value)},Codec.prototype.encodeBatch=function(ops,opts){var self=this;return ops.map(function(_op){var op={type:_op.type,key:self.encodeKey(_op.key,opts,_op)};return self.keyAsBuffer(opts,_op)&&(op.keyEncoding="binary"),_op.prefix&&(op.prefix=_op.prefix),"value"in _op&&(op.value=self.encodeValue(_op.value,opts,_op),self.valueAsBuffer(opts,_op)&&(op.valueEncoding="binary")),op})};var ltgtKeys=["lt","gt","lte","gte","start","end"];Codec.prototype.encodeLtgt=function(ltgt){var self=this,ret={};return Object.keys(ltgt).forEach(function(key){ret[key]=ltgtKeys.indexOf(key)>-1?self.encodeKey(ltgt[key],ltgt):ltgt[key]}),ret},Codec.prototype.createStreamDecoder=function(opts){var self=this;return opts.keys&&opts.values?function(key,value){return{key:self.decodeKey(key,opts),value:self.decodeValue(value,opts)}}:opts.keys?function(key){return self.decodeKey(key,opts)}:opts.values?function(_,value){return self.decodeValue(value,opts)}:function(){}},Codec.prototype.keyAsBuffer=function(opts){return this._keyEncoding(opts).buffer},Codec.prototype.valueAsBuffer=function(opts){return this._valueEncoding(opts).buffer}},function(module,exports,__webpack_require__){(function(Buffer){function identity(value){return value}function isBinary(data){return void 0===data||null===data||Buffer.isBuffer(data)}exports.utf8=exports["utf-8"]={encode:function(data){return isBinary(data)?data:String(data)},decode:function(data){return"string"==typeof data?data:String(data)},buffer:!1,type:"utf8"},exports.json={encode:JSON.stringify,decode:JSON.parse,buffer:!1,type:"json"},exports.binary={encode:function(data){return isBinary(data)?data:new Buffer(data)},decode:identity,buffer:!0,type:"binary"},exports.none={encode:function(data){return data},decode:function(data){return data},buffer:!1,type:"id"},exports.id=exports.none,["hex","ascii","base64","ucs2","ucs-2","utf16le","utf-16le"].forEach(function(type){exports[type]={encode:function(data){return isBinary(data)?data:new Buffer(data,type)},decode:function(buffer){return buffer.toString(type)},buffer:!0,type:type}})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function ReadStream(iterator,options){if(!(this instanceof ReadStream))return new ReadStream(iterator,options);Readable.call(this,extend(options,{objectMode:!0})),this._iterator=iterator,this._destroyed=!1,this._decoder=null,options&&options.decoder&&(this._decoder=options.decoder),this.on("end",this._cleanup.bind(this))}var inherits=__webpack_require__(1),Readable=__webpack_require__(466).Readable,extend=__webpack_require__(38),EncodingError=__webpack_require__(87).EncodingError;module.exports=ReadStream,inherits(ReadStream,Readable),ReadStream.prototype._read=function(){var self=this;this._destroyed||this._iterator.next(function(err,key,value){if(!self._destroyed){if(err)return self.emit("error",err);if(void 0===key&&void 0===value)self.push(null);else{if(!self._decoder)return self.push({key:key,value:value});try{var value=self._decoder(key,value)}catch(err){return self.emit("error",new EncodingError(err)),void self.push(null)}self.push(value)}}})},ReadStream.prototype.destroy=ReadStream.prototype._cleanup=function(){var self=this;this._destroyed||(this._destroyed=!0,this._iterator.end(function(err){if(err)return self.emit("error",err);self.emit("close")}))}},function(module,exports){module.exports=Array.isArray||function(arr){return"[object Array]"==Object.prototype.toString.call(arr)}},function(module,exports,__webpack_require__){function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}module.exports=PassThrough;var Transform=__webpack_require__(211),util=__webpack_require__(26);util.inherits=__webpack_require__(1),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},function(module,exports,__webpack_require__){(function(process){exports=module.exports=__webpack_require__(210),exports.Stream=__webpack_require__(25),exports.Readable=exports,exports.Writable=__webpack_require__(212),exports.Duplex=__webpack_require__(54),exports.Transform=__webpack_require__(211),exports.PassThrough=__webpack_require__(465),process.browser||"disable"!==process.env.READABLE_STREAM||(module.exports=__webpack_require__(25))}).call(exports,__webpack_require__(5))},function(module,exports,__webpack_require__){(function(Buffer,process){function Iterator(db,options){if(this._db=db._db,this._idbOpts=db._idbOpts,AbstractIterator.call(this,db),this._options=xtend({snapshot:!0},this._idbOpts,options),this._limit=this._options.limit,null!=this._limit&&this._limit!==-1||(this._limit=1/0),"number"!=typeof this._limit)throw new TypeError("options.limit must be a number");0!==this._limit&&(this._count=0,this._startCursor(this._options))}var util=__webpack_require__(32),AbstractIterator=__webpack_require__(216).AbstractIterator,ltgt=__webpack_require__(559),idbReadableStream=__webpack_require__(384),stream=__webpack_require__(25),xtend=__webpack_require__(38),Writable=stream.Writable;module.exports=Iterator,util.inherits(Iterator,AbstractIterator),Iterator.prototype._startCursor=function(options){options=xtend(this._options,options);var self=this,keyRange=null,lower=ltgt.lowerBound(options),upper=ltgt.upperBound(options),lowerOpen=ltgt.lowerBoundExclusive(options),upperOpen=ltgt.upperBoundExclusive(options),direction=options.reverse?"prev":"next";if(lower&&("binary"!==options.keyEncoding||Array.isArray(lower)||(lower=Array.prototype.slice.call(lower))),upper&&("binary"!==options.keyEncoding||Array.isArray(upper)||(upper=Array.prototype.slice.call(upper))),lower&&upper)try{keyRange=IDBKeyRange.bound(lower,upper,lowerOpen,upperOpen)}catch(err){return void(this._keyRangeError=!0)}else lower?keyRange=IDBKeyRange.lowerBound(lower,lowerOpen):upper&&(keyRange=IDBKeyRange.upperBound(upper,upperOpen));this._reader=idbReadableStream(this._db,this._idbOpts.storeName,xtend(options,{range:keyRange,direction:direction})),this._reader.on("error",function(err){var cb=self._callback;self._callback=!1,cb?cb(err):self._readNext=function(cb){cb(err)}}),this._reader.pipe(new Writable({objectMode:!0,write:function(item,enc,cb){if(self._count++>=self._limit)return self._reader.pause(),self._reader.unpipe(this),cb(),void this.end();var cb2=self._callback;self._callback=!1,cb2?self._processItem(item,function(err,key,value){cb(err),cb2(err,key,value)}):self._readNext=function(cb2){self._processItem(item,function(err,key,value){cb(err),cb2(err,key,value)})}}})).on("finish",function(){var cb=self._callback;self._callback=!1,cb?cb():self._readNext=function(cb){cb()}})},Iterator.prototype._processItem=function(item,cb){if("function"!=typeof cb)throw new TypeError("cb must be a function");var key=item.key,value=item.value;if(value instanceof Uint8Array&&(value=new Buffer(value)),"binary"===this._options.keyEncoding&&Array.isArray(key)&&(key=new Buffer(key)),"binary"!==this._options.valueEncoding||Buffer.isBuffer(value)||(value=new Buffer(value)),this._options.keyAsBuffer&&!Buffer.isBuffer(key))if(null==key)key=new Buffer(0);else if("string"==typeof key)key=new Buffer(key);else if("boolean"==typeof key)key=new Buffer(String(key));else if("number"==typeof key)key=new Buffer(String(key));else if(Array.isArray(key))key=new Buffer(String(key));else{if(!(key instanceof Uint8Array))throw new TypeError("can't coerce `"+key.constructor.name+"` into a Buffer");key=new Buffer(key)} +if(this._options.valueAsBuffer&&!Buffer.isBuffer(value))if(null==value)value=new Buffer(0);else if("string"==typeof value)value=new Buffer(value);else if("boolean"==typeof value)value=new Buffer(String(value));else if("number"==typeof value)value=new Buffer(String(value));else if(Array.isArray(value))value=new Buffer(String(value));else{if(!(value instanceof Uint8Array))throw new TypeError("can't coerce `"+value.constructor.name+"` into a Buffer");value=new Buffer(value)}cb(null,key,value)},Iterator.prototype._next=function(callback){if(this._callback)throw new Error("callback already exists");if(this._keyRangeError||0===this._limit)return void callback();var readNext=this._readNext;this._readNext=!1,readNext?process.nextTick(function(){readNext(callback)}):this._callback=callback}}).call(exports,__webpack_require__(0).Buffer,__webpack_require__(5))},function(module,exports,__webpack_require__){function isLevelDOWN(db){return!(!db||"object"!=typeof db)&&Object.keys(AbstractLevelDOWN.prototype).filter(function(name){return"_"!=name[0]&&"approximateSize"!=name}).every(function(name){return"function"==typeof db[name]})}var AbstractLevelDOWN=__webpack_require__(215);module.exports=isLevelDOWN},function(module,exports,__webpack_require__){function Batch(levelup,codec){this._levelup=levelup,this._codec=codec,this.batch=levelup.db.batch(),this.ops=[],this.length=0}var util=__webpack_require__(217),WriteError=__webpack_require__(87).WriteError,getOptions=util.getOptions,dispatchError=util.dispatchError;Batch.prototype.put=function(key_,value_,options){options=getOptions(options);var key=this._codec.encodeKey(key_,options),value=this._codec.encodeValue(value_,options);try{this.batch.put(key,value)}catch(e){throw new WriteError(e)}return this.ops.push({type:"put",key:key,value:value}),this.length++,this},Batch.prototype.del=function(key_,options){options=getOptions(options);var key=this._codec.encodeKey(key_,options);try{this.batch.del(key)}catch(err){throw new WriteError(err)}return this.ops.push({type:"del",key:key}),this.length++,this},Batch.prototype.clear=function(){try{this.batch.clear()}catch(err){throw new WriteError(err)}return this.ops=[],this.length=0,this},Batch.prototype.write=function(callback){var levelup=this._levelup,ops=this.ops;try{this.batch.write(function(err){if(err)return dispatchError(levelup,new WriteError(err),callback);levelup.emit("batch",ops),callback&&callback()})}catch(err){throw new WriteError(err)}},module.exports=Batch},function(module,exports,__webpack_require__){(function(process){function getCallback(options,callback){return"function"==typeof options?options:callback}function LevelUP(location,options,callback){if(!(this instanceof LevelUP))return new LevelUP(location,options,callback);var error;if(EventEmitter.call(this),this.setMaxListeners(1/0),"function"==typeof location?(options="object"==typeof options?options:{},options.db=location,location=null):"object"==typeof location&&"function"==typeof location.db&&(options=location,location=null),"function"==typeof options&&(callback=options,options={}),(!options||"function"!=typeof options.db)&&"string"!=typeof location){if(error=new InitializationError("Must provide a location for the database"),callback)return process.nextTick(function(){callback(error)});throw error}options=getOptions(options),this.options=extend(defaultOptions,options),this._codec=new Codec(this.options),this._status="new",prr(this,"location",location,"e"),this.open(callback)}function maybeError(db,options,callback){if(!db._isOpening()&&!db.isOpen())return dispatchError(db,new ReadError("Database is not open"),callback),!0}function writeError(db,message,callback){dispatchError(db,new WriteError(message),callback)}function readError(db,message,callback){dispatchError(db,new ReadError(message),callback)}function utilStatic(name){return function(location,callback){getLevelDOWN()[name](location,callback||function(){})}}var EventEmitter=__webpack_require__(11).EventEmitter,inherits=__webpack_require__(32).inherits,deprecate=__webpack_require__(32).deprecate,extend=__webpack_require__(38),prr=__webpack_require__(593),DeferredLevelDOWN=__webpack_require__(334),IteratorStream=__webpack_require__(463),Batch=__webpack_require__(469),Codec=__webpack_require__(461),getLevelDOWN=__webpack_require__(713),errors=__webpack_require__(87),util=__webpack_require__(217),WriteError=errors.WriteError,ReadError=errors.ReadError,NotFoundError=errors.NotFoundError,OpenError=errors.OpenError,EncodingError=errors.EncodingError,InitializationError=errors.InitializationError,LevelUPError=errors.LevelUPError,getOptions=util.getOptions,defaultOptions=util.defaultOptions,dispatchError=util.dispatchError;inherits(LevelUP,EventEmitter),LevelUP.prototype.open=function(callback){var dbFactory,db,self=this;if(this.isOpen())return callback&&process.nextTick(function(){callback(null,self)}),this;if(this._isOpening())return callback&&this.once("open",function(){callback(null,self)});if(this.emit("opening"),this._status="opening",this.db=new DeferredLevelDOWN(this.location),"function"!=typeof this.options.db&&"function"!=typeof getLevelDOWN)throw new LevelUPError("missing db factory, you need to set options.db");dbFactory=this.options.db||getLevelDOWN(),db=dbFactory(this.location),db.open(this.options,function(err){if(err)return dispatchError(self,new OpenError(err),callback);self.db.setDb(db),self.db=db,self._status="open",callback&&callback(null,self),self.emit("open"),self.emit("ready")})},LevelUP.prototype.close=function(callback){var self=this;if(this.isOpen())this._status="closing",this.db.close(function(){self._status="closed",self.emit("closed"),callback&&callback.apply(null,arguments)}),this.emit("closing"),this.db=new DeferredLevelDOWN(this.location);else{if("closed"===this._status&&callback)return process.nextTick(callback);"closing"===this._status&&callback?this.once("closed",callback):this._isOpening()&&this.once("open",function(){self.close(callback)})}},LevelUP.prototype.isOpen=function(){return"open"===this._status},LevelUP.prototype._isOpening=function(){return"opening"===this._status},LevelUP.prototype.isClosed=function(){return/^clos/.test(this._status)},LevelUP.prototype.get=function(key_,options,callback){var key,self=this;if(callback=getCallback(options,callback),!maybeError(this,options,callback)){if(null===key_||void 0===key_||"function"!=typeof callback)return readError(this,"get() requires key and callback arguments",callback);options=util.getOptions(options),key=this._codec.encodeKey(key_,options),options.asBuffer=this._codec.valueAsBuffer(options),this.db.get(key,options,function(err,value){if(err)return err=/notfound/i.test(err)||err.notFound?new NotFoundError("Key not found in database ["+key_+"]",err):new ReadError(err),dispatchError(self,err,callback);if(callback){try{value=self._codec.decodeValue(value,options)}catch(e){return callback(new EncodingError(e))}callback(null,value)}})}},LevelUP.prototype.put=function(key_,value_,options,callback){var key,value,self=this;if(callback=getCallback(options,callback),null===key_||void 0===key_)return writeError(this,"put() requires a key argument",callback);maybeError(this,options,callback)||(options=getOptions(options),key=this._codec.encodeKey(key_,options),value=this._codec.encodeValue(value_,options),this.db.put(key,value,options,function(err){if(err)return dispatchError(self,new WriteError(err),callback);self.emit("put",key_,value_),callback&&callback()}))},LevelUP.prototype.del=function(key_,options,callback){var key,self=this;if(callback=getCallback(options,callback),null===key_||void 0===key_)return writeError(this,"del() requires a key argument",callback);maybeError(this,options,callback)||(options=getOptions(options),key=this._codec.encodeKey(key_,options),this.db.del(key,options,function(err){if(err)return dispatchError(self,new WriteError(err),callback);self.emit("del",key_),callback&&callback()}))},LevelUP.prototype.batch=function(arr_,options,callback){var arr,self=this;return arguments.length?(callback=getCallback(options,callback),Array.isArray(arr_)?void(maybeError(this,options,callback)||(options=getOptions(options),arr=self._codec.encodeBatch(arr_,options),arr=arr.map(function(op){return op.type||void 0===op.key||void 0===op.value||(op.type="put"),op}),this.db.batch(arr,options,function(err){if(err)return dispatchError(self,new WriteError(err),callback);self.emit("batch",arr_),callback&&callback()}))):writeError(this,"batch() requires an array argument",callback)):new Batch(this,this._codec)},LevelUP.prototype.approximateSize=deprecate(function(start_,end_,options,callback){var start,end,self=this;if(callback=getCallback(options,callback),options=getOptions(options),null===start_||void 0===start_||null===end_||void 0===end_||"function"!=typeof callback)return readError(this,"approximateSize() requires start, end and callback arguments",callback);start=this._codec.encodeKey(start_,options),end=this._codec.encodeKey(end_,options),this.db.approximateSize(start,end,function(err,size){if(err)return dispatchError(self,new OpenError(err),callback);callback&&callback(null,size)})},"db.approximateSize() is deprecated. Use db.db.approximateSize() instead"),LevelUP.prototype.readStream=LevelUP.prototype.createReadStream=function(options){return options=extend({keys:!0,values:!0},this.options,options),options.keyEncoding=options.keyEncoding,options.valueEncoding=options.valueEncoding,options=this._codec.encodeLtgt(options),options.keyAsBuffer=this._codec.keyAsBuffer(options),options.valueAsBuffer=this._codec.valueAsBuffer(options),"number"!=typeof options.limit&&(options.limit=-1),new IteratorStream(this.db.iterator(options),extend(options,{decoder:this._codec.createStreamDecoder(options)}))},LevelUP.prototype.keyStream=LevelUP.prototype.createKeyStream=function(options){return this.createReadStream(extend(options,{keys:!0,values:!1}))},LevelUP.prototype.valueStream=LevelUP.prototype.createValueStream=function(options){return this.createReadStream(extend(options,{keys:!1,values:!0}))},LevelUP.prototype.toString=function(){return"LevelUP"},module.exports=LevelUP,module.exports.errors=__webpack_require__(87),module.exports.destroy=deprecate(utilStatic("destroy"),"levelup.destroy() is deprecated. Use leveldown.destroy() instead"),module.exports.repair=deprecate(utilStatic("repair"),"levelup.repair() is deprecated. Use leveldown.repair() instead")}).call(exports,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";const secp256k1=__webpack_require__(644),multihashing=__webpack_require__(21),setImmediate=__webpack_require__(10),HASH_ALGORITHM="sha2-256";module.exports=(randomBytes=>{function generateKey(callback){const done=(err,res)=>setImmediate(()=>callback(err,res));let privateKey;do{privateKey=randomBytes(32)}while(!secp256k1.privateKeyVerify(privateKey));done(null,privateKey)}function hashAndSign(key,msg,callback){const done=(err,res)=>setImmediate(()=>callback(err,res));multihashing.digest(msg,HASH_ALGORITHM,(err,digest)=>{if(err)return done(err);try{const sig=secp256k1.sign(digest,key),sigDER=secp256k1.signatureExport(sig.signature);return done(null,sigDER)}catch(err){done(err)}})}function hashAndVerify(key,sig,msg,callback){const done=(err,res)=>setImmediate(()=>callback(err,res));multihashing.digest(msg,HASH_ALGORITHM,(err,digest)=>{if(err)return done(err);try{sig=secp256k1.signatureImport(sig);const valid=secp256k1.verify(digest,sig,key);return done(null,valid)}catch(err){done(err)}})}function compressPublicKey(key){if(!secp256k1.publicKeyVerify(key))throw new Error("Invalid public key");return secp256k1.publicKeyConvert(key,!0)}function decompressPublicKey(key){return secp256k1.publicKeyConvert(key,!1)}function validatePrivateKey(key){if(!secp256k1.privateKeyVerify(key))throw new Error("Invalid private key")}function validatePublicKey(key){if(!secp256k1.publicKeyVerify(key))throw new Error("Invalid public key")}function computePublicKey(privateKey){return validatePrivateKey(privateKey),secp256k1.publicKeyCreate(privateKey)}return{generateKey:generateKey,privateKeyLength:32,hashAndSign:hashAndSign,hashAndVerify:hashAndVerify,compressPublicKey:compressPublicKey,decompressPublicKey:decompressPublicKey,validatePrivateKey:validatePrivateKey,validatePublicKey:validatePublicKey,computePublicKey:computePublicKey}})},function(module,exports,__webpack_require__){"use strict";const multihashing=__webpack_require__(21);module.exports=((keysProtobuf,randomBytes,crypto)=>{function unmarshalSecp256k1PrivateKey(bytes,callback){callback(null,new Secp256k1PrivateKey(bytes),null)}function unmarshalSecp256k1PublicKey(bytes){return new Secp256k1PublicKey(bytes)}function generateKeyPair(_bits,callback){void 0===callback&&"function"==typeof _bits&&(callback=_bits),ensure(callback),crypto.generateKey((err,privateKeyBytes)=>{if(err)return callback(err);let privkey;try{privkey=new Secp256k1PrivateKey(privateKeyBytes)}catch(err){return callback(err)}callback(null,privkey)})}function ensure(callback){if("function"!=typeof callback)throw new Error("callback is required")}crypto=crypto||__webpack_require__(471)(randomBytes);class Secp256k1PublicKey{constructor(key){crypto.validatePublicKey(key),this._key=key}verify(data,sig,callback){ensure(callback),crypto.hashAndVerify(this._key,sig,data,callback)}marshal(){return crypto.compressPublicKey(this._key)}get bytes(){return keysProtobuf.PublicKey.encode({Type:keysProtobuf.KeyType.Secp256k1,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}class Secp256k1PrivateKey{constructor(key,publicKey){this._key=key,this._publicKey=publicKey||crypto.computePublicKey(key),crypto.validatePrivateKey(this._key),crypto.validatePublicKey(this._publicKey)}sign(message,callback){ensure(callback),crypto.hashAndSign(this._key,message,callback)}get public(){return new Secp256k1PublicKey(this._publicKey)}marshal(){return this._key}get bytes(){return keysProtobuf.PrivateKey.encode({Type:keysProtobuf.KeyType.Secp256k1,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}return{Secp256k1PublicKey:Secp256k1PublicKey,Secp256k1PrivateKey:Secp256k1PrivateKey,unmarshalSecp256k1PrivateKey:unmarshalSecp256k1PrivateKey,unmarshalSecp256k1PublicKey:unmarshalSecp256k1PublicKey,generateKeyPair:generateKeyPair}})},function(module,exports,__webpack_require__){"use strict";const crypto=__webpack_require__(316);module.exports={createCipheriv:crypto.createCipheriv,createDecipheriv:crypto.createDecipheriv}},function(module,exports,__webpack_require__){"use strict";const ciphers=__webpack_require__(473),CIPHER_MODES={16:"aes-128-ctr",32:"aes-256-ctr"};exports.create=function(key,iv,callback){const mode=CIPHER_MODES[key.length];if(!mode)return callback(new Error("Invalid key length"));const cipher=ciphers.createCipheriv(mode,key,iv),decipher=ciphers.createDecipheriv(mode,key,iv);callback(null,{encrypt(data,cb){cb(null,cipher.update(data))},decrypt(data,cb){cb(null,decipher.update(data))}})}},function(module,exports,__webpack_require__){"use strict";module.exports={SHA1:20,SHA256:32,SHA512:64}},function(module,exports,__webpack_require__){"use strict";function marshalPublicKey(jwk){const byteLen=curveLengths[jwk.crv];return Buffer.concat([Buffer.from([4]),toBn(jwk.x).toArrayLike(Buffer,"be",byteLen),toBn(jwk.y).toArrayLike(Buffer,"be",byteLen)],1+2*byteLen)}function unmarshalPublicKey(curve,key){const byteLen=curveLengths[curve];if(!key.slice(0,1).equals(Buffer.from([4])))throw new Error("Invalid key format");const x=new BN(key.slice(1,byteLen+1)),y=new BN(key.slice(1+byteLen));return{kty:"EC",crv:curve,x:toBase64(x,byteLen),y:toBase64(y,byteLen),ext:!0}}function unmarshalPrivateKey(curve,key){const result=unmarshalPublicKey(curve,key.public);return result.d=toBase64(new BN(key.private)),result}const webcrypto=__webpack_require__(124)(),nodeify=__webpack_require__(92),BN=__webpack_require__(46).bignum,Buffer=__webpack_require__(6).Buffer,util=__webpack_require__(221),toBase64=util.toBase64,toBn=util.toBn,bits={"P-256":256,"P-384":384,"P-521":521};exports.generateEphmeralKeyPair=function(curve,callback){nodeify(webcrypto.subtle.generateKey({name:"ECDH",namedCurve:curve},!0,["deriveBits"]).then(pair=>{const genSharedKey=(theirPub,forcePrivate,cb)=>{"function"==typeof forcePrivate&&(cb=forcePrivate,forcePrivate=void 0);let privateKey;privateKey=forcePrivate?webcrypto.subtle.importKey("jwk",unmarshalPrivateKey(curve,forcePrivate),{name:"ECDH",namedCurve:curve},!1,["deriveBits"]):Promise.resolve(pair.privateKey),nodeify(Promise.all([webcrypto.subtle.importKey("jwk",unmarshalPublicKey(curve,theirPub),{name:"ECDH",namedCurve:curve},!1,[]),privateKey]).then(keys=>webcrypto.subtle.deriveBits({name:"ECDH",namedCurve:curve,public:keys[0]},keys[1],bits[curve])).then(bits=>Buffer.from(bits)),cb)};return webcrypto.subtle.exportKey("jwk",pair.publicKey).then(publicKey=>{return{key:marshalPublicKey(publicKey),genSharedKey:genSharedKey}})}),callback)};const curveLengths={"P-256":32,"P-384":48,"P-521":66}},function(module,exports,__webpack_require__){"use strict";function unmarshalEd25519PrivateKey(bytes,callback){try{bytes=ensureKey(bytes,crypto.privateKeyLength+crypto.publicKeyLength)}catch(err){return callback(err)}callback(null,new Ed25519PrivateKey(bytes.slice(0,crypto.privateKeyLength),bytes.slice(crypto.privateKeyLength,bytes.length)))}function unmarshalEd25519PublicKey(bytes){return bytes=ensureKey(bytes,crypto.publicKeyLength),new Ed25519PublicKey(bytes)}function generateKeyPair(_bits,cb){void 0===cb&&"function"==typeof _bits&&(cb=_bits),crypto.generateKey((err,keys)=>{if(err)return cb(err);let privkey;try{privkey=new Ed25519PrivateKey(keys.secretKey,keys.publicKey)}catch(err){return void cb(err)}cb(null,privkey)})}function generateKeyPairFromSeed(seed,_bits,cb){void 0===cb&&"function"==typeof _bits&&(cb=_bits),crypto.generateKeyFromSeed(seed,(err,keys)=>{if(err)return cb(err);let privkey;try{privkey=new Ed25519PrivateKey(keys.secretKey,keys.publicKey)}catch(err){return void cb(err)}cb(null,privkey)})}function ensure(cb){if("function"!=typeof cb)throw new Error("callback is required")}function ensureKey(key,length){if(Buffer.isBuffer(key)&&(key=new Uint8Array(key)),!(key instanceof Uint8Array)||key.length!==length)throw new Error("Key must be a Uint8Array or Buffer of length "+length);return key}const multihashing=__webpack_require__(21),protobuf=__webpack_require__(31),Buffer=__webpack_require__(6).Buffer,crypto=__webpack_require__(478),pbm=protobuf(__webpack_require__(123));class Ed25519PublicKey{constructor(key){this._key=ensureKey(key,crypto.publicKeyLength)}verify(data,sig,callback){ensure(callback),crypto.hashAndVerify(this._key,sig,data,callback)}marshal(){return Buffer.from(this._key)}get bytes(){return pbm.PublicKey.encode({Type:pbm.KeyType.Ed25519,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}class Ed25519PrivateKey{constructor(key,publicKey){this._key=ensureKey(key,crypto.privateKeyLength),this._publicKey=ensureKey(publicKey,crypto.publicKeyLength)}sign(message,callback){ensure(callback),crypto.hashAndSign(this._key,message,callback)}get public(){if(!this._publicKey)throw new Error("public key not provided");return new Ed25519PublicKey(this._publicKey)}marshal(){return Buffer.concat([Buffer.from(this._key),Buffer.from(this._publicKey)])}get bytes(){return pbm.PrivateKey.encode({Type:pbm.KeyType.Ed25519,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}module.exports={Ed25519PublicKey:Ed25519PublicKey,Ed25519PrivateKey:Ed25519PrivateKey,unmarshalEd25519PrivateKey:unmarshalEd25519PrivateKey,unmarshalEd25519PublicKey:unmarshalEd25519PublicKey,generateKeyPair:generateKeyPair,generateKeyPairFromSeed:generateKeyPairFromSeed}},function(module,exports,__webpack_require__){"use strict";const nacl=__webpack_require__(670),setImmediate=__webpack_require__(10),Buffer=__webpack_require__(6).Buffer;exports.publicKeyLength=nacl.sign.publicKeyLength,exports.privateKeyLength=nacl.sign.secretKeyLength,exports.generateKey=function(callback){const done=(err,res)=>setImmediate(()=>{callback(err,res)});let keys;try{keys=nacl.sign.keyPair()}catch(err){return done(err)}done(null,keys)},exports.generateKeyFromSeed=function(seed,callback){const done=(err,res)=>setImmediate(()=>callback(err,res));let keys;try{keys=nacl.sign.keyPair.fromSeed(seed)}catch(err){return done(err)}done(null,keys)},exports.hashAndSign=function(key,msg,callback){setImmediate(()=>{callback(null,Buffer.from(nacl.sign.detached(msg,key)))})},exports.hashAndVerify=function(key,sig,msg,callback){setImmediate(()=>{callback(null,nacl.sign.detached.verify(msg,sig,key))})}},function(module,exports,__webpack_require__){"use strict";const ecdh=__webpack_require__(476);module.exports=((curve,callback)=>{ecdh.generateEphmeralKeyPair(curve,callback)})},function(module,exports,__webpack_require__){"use strict";function isValidKeyType(keyType){return void 0!==supportedKeys[keyType.toLowerCase()]}const protobuf=__webpack_require__(31),keysPBM=protobuf(__webpack_require__(123));exports=module.exports;const supportedKeys={rsa:__webpack_require__(482),ed25519:__webpack_require__(477),secp256k1:__webpack_require__(472)(keysPBM,__webpack_require__(220))};exports.supportedKeys=supportedKeys,exports.keysPBM=keysPBM,exports.keyStretcher=__webpack_require__(481),exports.generateEphemeralKeyPair=__webpack_require__(479),exports.generateKeyPair=((type,bits,cb)=>{let key=supportedKeys[type.toLowerCase()];if(!key)return cb(new Error("invalid or unsupported key type"));key.generateKeyPair(bits,cb)}),exports.generateKeyPairFromSeed=((type,seed,bits,cb)=>{let key=supportedKeys[type.toLowerCase()];return key?"ed25519"!==type.toLowerCase()?cb(new Error("Seed key derivation is unimplemented for RSA or secp256k1")):void key.generateKeyPairFromSeed(seed,bits,cb):cb(new Error("invalid or unsupported key type"))}),exports.unmarshalPublicKey=(buf=>{const decoded=keysPBM.PublicKey.decode(buf);switch(decoded.Type){case keysPBM.KeyType.RSA:return supportedKeys.rsa.unmarshalRsaPublicKey(decoded.Data);case keysPBM.KeyType.Ed25519:return supportedKeys.ed25519.unmarshalEd25519PublicKey(decoded.Data);case keysPBM.KeyType.Secp256k1:if(supportedKeys.secp256k1)return supportedKeys.secp256k1.unmarshalSecp256k1PublicKey(decoded.Data);throw new Error("secp256k1 support requires libp2p-crypto-secp256k1 package");default:throw new Error("invalid or unsupported key type")}}),exports.marshalPublicKey=((key,type)=>{if(type=(type||"rsa").toLowerCase(),!isValidKeyType(type))throw new Error("invalid or unsupported key type");return key.bytes}),exports.unmarshalPrivateKey=((buf,callback)=>{const decoded=keysPBM.PrivateKey.decode(buf);switch(decoded.Type){case keysPBM.KeyType.RSA:return supportedKeys.rsa.unmarshalRsaPrivateKey(decoded.Data,callback);case keysPBM.KeyType.Ed25519:return supportedKeys.ed25519.unmarshalEd25519PrivateKey(decoded.Data,callback);case keysPBM.KeyType.Secp256k1:return supportedKeys.secp256k1?supportedKeys.secp256k1.unmarshalSecp256k1PrivateKey(decoded.Data,callback):callback(new Error("secp256k1 support requires libp2p-crypto-secp256k1 package"));default:callback(new Error("invalid or unsupported key type"))}}),exports.marshalPrivateKey=((key,type)=>{if(type=(type||"rsa").toLowerCase(),!isValidKeyType(type))throw new Error("invalid or unsupported key type");return key.bytes})},function(module,exports,__webpack_require__){"use strict";const whilst=__webpack_require__(74),Buffer=__webpack_require__(6).Buffer,hmac=__webpack_require__(218),cipherMap={"AES-128":{ivSize:16,keySize:16},"AES-256":{ivSize:16,keySize:32},Blowfish:{ivSize:8,cipherKeySize:32}};module.exports=((cipherType,hash,secret,callback)=>{const cipher=cipherMap[cipherType];if(!cipher)return callback(new Error("unkown cipherType passed"));if(!hash)return callback(new Error("unkown hashType passed"));const cipherKeySize=cipher.keySize,ivSize=cipher.ivSize,seed=Buffer.from("key expansion"),resultLength=2*(ivSize+cipherKeySize+20);hmac.create(hash,secret,(err,m)=>{if(err)return callback(err);m.digest(seed,(err,a)=>{function stretch(cb){m.digest(Buffer.concat([a,seed]),(err,b)=>{if(err)return cb(err);let todo=b.length;j+todo>resultLength&&(todo=resultLength-j),result.push(b),j+=todo,m.digest(a,(err,_a)=>{if(err)return cb(err);a=_a,cb()})})}function finish(err){if(err)return callback(err);const half=resultLength/2,resultBuffer=Buffer.concat(result),r1=resultBuffer.slice(0,half),r2=resultBuffer.slice(half,resultLength),createKey=res=>({iv:res.slice(0,ivSize),cipherKey:res.slice(ivSize,ivSize+cipherKeySize),macKey:res.slice(ivSize+cipherKeySize)});callback(null,{k1:createKey(r1),k2:createKey(r2)})}if(err)return callback(err);let result=[],j=0;whilst(()=>j{if(err)return callback(err);callback(null,new RsaPrivateKey(keys.privateKey,keys.publicKey))})}function unmarshalRsaPublicKey(bytes){return new RsaPublicKey(crypto.utils.pkixToJwk(bytes))}function generateKeyPair(bits,cb){crypto.generateKey(bits,(err,keys)=>{if(err)return cb(err);cb(null,new RsaPrivateKey(keys.privateKey,keys.publicKey))})}function ensure(cb){if("function"!=typeof cb)throw new Error("callback is required")}const multihashing=__webpack_require__(21),protobuf=__webpack_require__(31),crypto=__webpack_require__(219),pbm=protobuf(__webpack_require__(123));class RsaPublicKey{constructor(key){this._key=key}verify(data,sig,callback){ensure(callback),crypto.hashAndVerify(this._key,sig,data,callback)}marshal(){return crypto.utils.jwkToPkix(this._key)}get bytes(){return pbm.PublicKey.encode({Type:pbm.KeyType.RSA,Data:this.marshal()})}encrypt(bytes){return this._key.encrypt(bytes,"RSAES-PKCS1-V1_5")}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}class RsaPrivateKey{constructor(key,publicKey){this._key=key,this._publicKey=publicKey}genSecret(){return crypto.getRandomValues(new Uint8Array(16))}sign(message,callback){ensure(callback),crypto.hashAndSign(this._key,message,callback)}get public(){if(!this._publicKey)throw new Error("public key not provided");return new RsaPublicKey(this._publicKey)}decrypt(msg,callback){crypto.decrypt(this._key,msg,callback)}marshal(){return crypto.utils.jwkToPkcs1(this._key)}get bytes(){return pbm.PrivateKey.encode({Type:pbm.KeyType.RSA,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}module.exports={RsaPublicKey:RsaPublicKey,RsaPrivateKey:RsaPrivateKey,unmarshalRsaPublicKey:unmarshalRsaPublicKey,unmarshalRsaPrivateKey:unmarshalRsaPrivateKey,generateKeyPair:generateKeyPair}},function(module,exports,__webpack_require__){"use strict";const asn1=__webpack_require__(46),util=__webpack_require__(221),toBase64=util.toBase64,toBn=util.toBn,RSAPrivateKey=asn1.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}),AlgorithmIdentifier=asn1.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid({"1.2.840.113549.1.1.1":"rsa"}),this.key("none").optional().null_(),this.key("curve").optional().objid(),this.key("params").optional().seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()))}),PublicKey=asn1.define("RSAPublicKey",function(){this.seq().obj(this.key("algorithm").use(AlgorithmIdentifier),this.key("subjectPublicKey").bitstr())}),RSAPublicKey=asn1.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});exports.pkcs1ToJwk=function(bytes){const asn1=RSAPrivateKey.decode(bytes,"der");return{kty:"RSA",n:toBase64(asn1.modulus),e:toBase64(asn1.publicExponent),d:toBase64(asn1.privateExponent),p:toBase64(asn1.prime1),q:toBase64(asn1.prime2),dp:toBase64(asn1.exponent1),dq:toBase64(asn1.exponent2),qi:toBase64(asn1.coefficient),alg:"RS256",kid:"2011-04-29"}},exports.jwkToPkcs1=function(jwk){return RSAPrivateKey.encode({version:0,modulus:toBn(jwk.n),publicExponent:toBn(jwk.e),privateExponent:toBn(jwk.d),prime1:toBn(jwk.p),prime2:toBn(jwk.q),exponent1:toBn(jwk.dp),exponent2:toBn(jwk.dq),coefficient:toBn(jwk.qi)},"der")},exports.pkixToJwk=function(bytes){const ndata=PublicKey.decode(bytes,"der"),asn1=RSAPublicKey.decode(ndata.subjectPublicKey.data,"der");return{kty:"RSA",n:toBase64(asn1.modulus),e:toBase64(asn1.publicExponent),alg:"RS256",kid:"2011-04-29"}},exports.jwkToPkix=function(jwk){return PublicKey.encode({algorithm:{algorithm:"rsa",none:null},subjectPublicKey:{data:RSAPublicKey.encode({modulus:toBn(jwk.n),publicExponent:toBn(jwk.e)},"der")}},"der")}},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),log=debug("libp2p:floodsub");log.err=debug("libp2p:floodsub:error"),module.exports={log:log,multicodec:"/floodsub/1.0.0"}},function(module,exports,__webpack_require__){"use strict";const EventEmitter=__webpack_require__(11),TimeCache=__webpack_require__(667),values=__webpack_require__(129),pull=__webpack_require__(4),lp=__webpack_require__(23),assert=__webpack_require__(9),asyncEach=__webpack_require__(19),Peer=__webpack_require__(488),utils=__webpack_require__(489),pb=__webpack_require__(222),config=__webpack_require__(484),Buffer=__webpack_require__(6).Buffer,log=config.log,multicodec=config.multicodec,ensureArray=utils.ensureArray,setImmediate=__webpack_require__(10);class FloodSub extends EventEmitter{constructor(libp2p){super(),this.libp2p=libp2p,this.started=!1,this.cache=new TimeCache,this.peers=new Map,this.subscriptions=new Set,this._onConnection=this._onConnection.bind(this),this._dialPeer=this._dialPeer.bind(this)}_dialPeer(peerInfo,callback){callback=callback||function(){};const idB58Str=peerInfo.id.toB58String();log("dialing %s",idB58Str);const peer=this.peers.get(idB58Str);if(peer&&peer.isConnected)return setImmediate(()=>callback());this.libp2p.dial(peerInfo,multicodec,(err,conn)=>{if(err)return log.err(err),callback();this._onDial(peerInfo,conn,callback)})}_onDial(peerInfo,conn,callback){const idB58Str=peerInfo.id.toB58String();this.peers.has(idB58Str)||this.peers.set(idB58Str,new Peer(peerInfo));const peer=this.peers.get(idB58Str);peer.attachConnection(conn),peer.sendSubscriptions(this.subscriptions),setImmediate(()=>callback())}_onConnection(protocol,conn){conn.getPeerInfo((err,peerInfo)=>{if(err)return log.err("Failed to identify incomming conn",err),pull(pull.empty(),conn);const idB58Str=peerInfo.id.toB58String();this.peers.has(idB58Str)||(log("new peer",idB58Str),this.peers.set(idB58Str,new Peer(peerInfo))),this._processConnection(idB58Str,conn)})}_processConnection(idB58Str,conn){pull(conn,lp.decode(),pull.map(data=>pb.rpc.RPC.decode(data)),pull.drain(rpc=>this._onRpc(idB58Str,rpc),err=>this._onConnectionEnd(idB58Str,err)))}_onRpc(idB58Str,rpc){if(rpc){const subs=rpc.subscriptions,msgs=rpc.msgs;if(msgs&&msgs.length&&this._processRpcMessages(rpc.msgs),subs&&subs.length){const peer=this.peers.get(idB58Str);peer&&peer.updateSubscriptions(subs)}}}_processRpcMessages(msgs){msgs.forEach(msg=>{const seqno=utils.msgId(msg.from,msg.seqno.toString());this.cache.has(seqno)||(this.cache.put(seqno),this._emitMessages(msg.topicCIDs,[msg]),this._forwardMessages(msg.topicCIDs,[msg]))})} +_onConnectionEnd(idB58Str,err){err&&"socket hang up"!==err.message&&log.err(err),this.peers.delete(idB58Str)}_emitMessages(topics,messages){topics.forEach(topic=>{this.subscriptions.has(topic)&&messages.forEach(message=>{this.emit(topic,message)})})}_forwardMessages(topics,messages){this.peers.forEach(peer=>{peer.isWritable&&utils.anyMatch(peer.topics,topics)&&(peer.sendMessages(messages),log("publish msgs on topics",topics,peer.info.id.toB58String()))})}start(callback){if(this.started)return setImmediate(()=>callback(new Error("already started")));this.libp2p.handle(multicodec,this._onConnection),this.libp2p.on("peer:connect",this._dialPeer),asyncEach(values(this.libp2p.peerBook.getAll()),(peer,cb)=>this._dialPeer(peer,cb),err=>{setImmediate(()=>{this.started=!0,callback(err)})})}stop(callback){if(!this.started)return setImmediate(()=>callback(new Error("not started yet")));this.libp2p.unhandle(multicodec),this.libp2p.removeListener("peer:connect",this._dialPeer),asyncEach(this.peers.values(),(peer,cb)=>peer.close(cb),err=>{if(err)return callback(err);this.peers=new Map,this.started=!1,callback()})}publish(topics,messages){assert(this.started,"FloodSub is not started"),log("publish",topics,messages),topics=ensureArray(topics),messages=ensureArray(messages);const from=this.libp2p.peerInfo.id.toB58String(),buildMessage=msg=>{const seqno=utils.randomSeqno();return this.cache.put(utils.msgId(from,seqno)),{from:from,data:msg,seqno:new Buffer(seqno),topicCIDs:topics}},msgObjects=messages.map(buildMessage);this._emitMessages(topics,msgObjects),this._forwardMessages(topics,messages.map(buildMessage))}subscribe(topics){function checkIfReady(peer){peer&&peer.isWritable?peer.sendSubscriptions(topics):setImmediate(checkIfReady.bind(peer))}assert(this.started,"FloodSub is not started"),topics=ensureArray(topics),topics.forEach(topic=>this.subscriptions.add(topic)),this.peers.forEach(peer=>checkIfReady(peer))}unsubscribe(topics){function checkIfReady(peer){peer&&peer.isWritable?peer.sendUnsubscriptions(topics):setImmediate(checkIfReady.bind(peer))}assert(this.started,"FloodSub is not started"),topics=ensureArray(topics),topics.forEach(topic=>this.subscriptions.delete(topic)),this.peers.forEach(peer=>checkIfReady(peer))}}module.exports=FloodSub},function(module,exports,__webpack_require__){"use strict";module.exports=` message RPC { repeated SubOpts subscriptions = 1; repeated Message msgs = 2; @@ -205,7 +197,7 @@ message TopicDescriptor { WOT = 2; // web of trust, certificates can allow publisher set to grow } } -}`},function(module,exports,__webpack_require__){"use strict";const lp=__webpack_require__(28),Pushable=__webpack_require__(36),pull=__webpack_require__(5),setImmediate=__webpack_require__(11),rpc=__webpack_require__(250).rpc.RPC;class Peer{constructor(info){this.info=info,this.conn=null,this.topics=new Set,this.stream=null}get isConnected(){return Boolean(this.conn)}get isWritable(){return Boolean(this.stream)}write(msg){if(!this.isWritable){const id=this.info.id.toB58String();throw new Error("No writable connection to "+id)}this.stream.push(msg)}attachConnection(conn){this.conn=conn,this.stream=new Pushable,pull(this.stream,lp.encode(),conn)}_sendRawSubscriptions(topics,subscribe){if(0!==topics.size){const subs=[];topics.forEach(topic=>{subs.push({subscribe:subscribe,topicCID:topic})}),this.write(rpc.encode({subscriptions:subs}))}}sendSubscriptions(topics){this._sendRawSubscriptions(topics,!0)}sendUnsubscriptions(topics){this._sendRawSubscriptions(topics,!1)}sendMessages(msgs){this.write(rpc.encode({msgs:msgs}))}updateSubscriptions(changes){changes.forEach(subopt=>{subopt.subscribe?this.topics.add(subopt.topicCID):this.topics.delete(subopt.topicCID)})}close(callback){!this.conn||this.stream,this.stream&&this.stream.end(),setImmediate(()=>{this.conn=null,this.stream=null,callback()})}}module.exports=Peer},function(module,exports,__webpack_require__){"use strict";const crypto=__webpack_require__(50);exports=module.exports,exports.randomSeqno=(()=>{return crypto.randomBytes(20).toString("hex")}),exports.msgId=((from,seqno)=>{return from+seqno}),exports.anyMatch=((a,b)=>{let bHas;bHas=Array.isArray(b)?val=>b.indexOf(val)>-1:val=>b.has(val);for(let val of a)if(bHas(val))return!0;return!1}),exports.ensureArray=(maybeArray=>{return Array.isArray(maybeArray)?maybeArray:[maybeArray]})},function(module,exports,__webpack_require__){"use strict";function getObservedAddrs(input){if(!hasObservedAddr(input))return[];let addrs=input.observedAddr;return Array.isArray(input.observedAddr)||(addrs=[addrs]),addrs.map(oa=>multiaddr(oa))}function hasObservedAddr(input){return input.observedAddr&&input.observedAddr.length>0}const PeerInfo=__webpack_require__(51),PeerId=__webpack_require__(31),multiaddr=__webpack_require__(34),pull=__webpack_require__(5),lp=__webpack_require__(28),msg=__webpack_require__(251);module.exports=((conn,callback)=>{pull(conn,lp.decode(),pull.take(1),pull.collect((err,data)=>{if(err)return callback(err);if(0===data.length)return callback(new Error("conn was closed, did not receive data"));const input=msg.decode(data[0]);PeerId.createFromPubKey(input.publicKey,(err,id)=>{if(err)return callback(err);const peerInfo=new PeerInfo(id);input.listenAddrs.map(multiaddr).forEach(ma=>peerInfo.multiaddrs.add(ma)),callback(null,peerInfo,getObservedAddrs(input))})}))})},function(module,exports,__webpack_require__){"use strict";exports=module.exports,exports.multicodec="/ipfs/id/1.0.0",exports.listener=__webpack_require__(583),exports.dialer=__webpack_require__(581)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const pull=__webpack_require__(5),lp=__webpack_require__(28),msg=__webpack_require__(251);module.exports=((conn,pInfoSelf)=>{conn.getObservedAddrs((err,observedAddrs)=>{if(!err){observedAddrs=observedAddrs[0];let publicKey=new Buffer(0);pInfoSelf.id.pubKey&&(publicKey=pInfoSelf.id.pubKey.bytes);const msgSend=msg.encode({protocolVersion:"ipfs/0.1.0",agentVersion:"na",publicKey:publicKey,listenAddrs:pInfoSelf.multiaddrs.toArray().map(ma=>ma.buffer),observedAddr:observedAddrs?observedAddrs.buffer:new Buffer("")});pull(pull.values([msgSend]),lp.encode(),conn)}})})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function mapMuxers(list){return list.map(pref=>{if("string"!=typeof pref)return pref;switch(pref.trim().toLowerCase()){case"spdy":return spdy;case"multiplex":return multiplex;default:throw new Error(pref+" muxer not available")}})}function getMuxers(options){return options?mapMuxers(options):[multiplex,spdy]}const WS=__webpack_require__(623),WebRTCStar=__webpack_require__(622),spdy=__webpack_require__(600),multiplex=__webpack_require__(585),secio=__webpack_require__(598),Railing=__webpack_require__(591),libp2p=__webpack_require__(626);class Node extends libp2p{constructor(peerInfo,peerBook,options){options=options||{};const webRTCStar=new WebRTCStar,modules={transport:[new WS,webRTCStar],connection:{muxer:getMuxers(options.muxer),crypto:[secio]},discovery:[]};if(options.webRTCStar&&modules.discovery.push(webRTCStar.discovery),options.bootstrap){const r=new Railing(options.bootstrap);modules.discovery.push(r)}super(modules,peerInfo,peerBook,options)}}module.exports=Node},function(module,exports,__webpack_require__){"use strict";function create(rawConn,isListener){const stream=toStream(rawConn);stream.on("end",()=>stream.destroy());const mpx=new Multiplex({halfOpen:!0,initiator:!isListener});return pump(stream,mpx,stream),new Muxer(rawConn,mpx)}const Multiplex=__webpack_require__(695),toStream=__webpack_require__(158),MULTIPLEX_CODEC=__webpack_require__(252),Muxer=__webpack_require__(586),pump=__webpack_require__(759);exports=module.exports=create,exports.multicodec=MULTIPLEX_CODEC,exports.dialer=(conn=>create(conn,!1)),exports.listener=(conn=>create(conn,!0))},function(module,exports,__webpack_require__){"use strict";function noop(){}function catchError(stream){return{source:pull(stream.source,pullCatch(err=>{if("Channel destroyed"!==err.message)return!1})),sink:stream.sink}}const EventEmitter=__webpack_require__(8).EventEmitter,Connection=__webpack_require__(29).Connection,toPull=__webpack_require__(120),pull=__webpack_require__(5),pullCatch=__webpack_require__(723),setImmediate=__webpack_require__(11),MULTIPLEX_CODEC=__webpack_require__(252);module.exports=class MultiplexMuxer extends EventEmitter{constructor(conn,multiplex){super(),this.multiplex=multiplex,this.conn=conn,this.multicodec=MULTIPLEX_CODEC,multiplex.on("close",()=>this.emit("close")),multiplex.on("error",err=>this.emit("error",err)),multiplex.on("stream",(stream,id)=>{const muxedConn=new Connection(catchError(toPull.duplex(stream)),this.conn);this.emit("stream",muxedConn)})}newStream(callback){callback=callback||noop;let stream=this.multiplex.createStream();const conn=new Connection(catchError(toPull.duplex(stream)),this.conn);return setImmediate(()=>callback(null,conn)),conn}end(callback){callback=callback||noop,this.multiplex.once("close",callback),this.multiplex.destroy()}}},function(module,exports,__webpack_require__){"use strict";function mount(swarm){swarm.handle(PROTOCOL,(protocol,conn)=>{function next(){shake.read(PING_LENGTH,(err,buf)=>{if(err!==!0)return err?log.error(err):(shake.write(buf),next())})}const stream=handshake({timeout:0}),shake=stream.handshake;pull(conn,stream,conn),next()})}function unmount(swarm){swarm.unhandle(PROTOCOL)}const pull=__webpack_require__(5),handshake=__webpack_require__(67),constants=__webpack_require__(142),PROTOCOL=constants.PROTOCOL,PING_LENGTH=constants.PING_LENGTH,debug=__webpack_require__(3),log=debug("libp2p-ping");log.error=debug("libp2p-ping:error"),exports=module.exports,exports.mount=mount,exports.unmount=unmount},function(module,exports,__webpack_require__){"use strict";const handler=__webpack_require__(587);exports=module.exports=__webpack_require__(589),exports.mount=handler.mount,exports.unmount=handler.unmount},function(module,exports,__webpack_require__){"use strict";const EventEmitter=__webpack_require__(8).EventEmitter,pull=__webpack_require__(5),handshake=__webpack_require__(67),constants=__webpack_require__(142),util=__webpack_require__(590),rnd=util.rnd,debug=__webpack_require__(3),log=debug("libp2p-ping");log.error=debug("libp2p-ping:error");const PROTOCOL=constants.PROTOCOL,PING_LENGTH=constants.PING_LENGTH;class Ping extends EventEmitter{constructor(swarm,peer){super();let shake,stop=!1,self=this;log("dialing %s to %s",PROTOCOL,peer.id.toB58String()),swarm.dial(peer,PROTOCOL,(err,conn)=>{function next(){let start=new Date,buf=rnd(PING_LENGTH);shake.write(buf),shake.read(PING_LENGTH,(err,bufBack)=>{let end=new Date;if(err||!buf.equals(bufBack)){const err=new Error("Received wrong ping ack");return self.emit("error",err)}self.emit("ping",end-start),stop||next()})}if(err)return this.emit("error",err);const stream=handshake({timeout:0});shake=stream.handshake,pull(stream,conn,stream),next()}),this.stop=(()=>{!stop&&shake&&(stop=!0,pull(pull.empty(),shake.rest()))})}}module.exports=Ping},function(module,exports,__webpack_require__){"use strict";const crypto=__webpack_require__(50),constants=__webpack_require__(142);exports=module.exports,exports.rnd=(length=>{return length||(length=constants.PING_LENGTH),crypto.randomBytes(length)})},function(module,exports,__webpack_require__){"use strict";const PeerId=__webpack_require__(31),PeerInfo=__webpack_require__(51),multiaddr=__webpack_require__(34),EventEmitter=__webpack_require__(8).EventEmitter,debug=__webpack_require__(3),includes=__webpack_require__(660),setImmediate=__webpack_require__(11),log=debug("libp2p:railing");log.error=debug("libp2p:railing:error");class Railing extends EventEmitter{constructor(bootstrapers){super(),this.bootstrapers=bootstrapers}start(callback){setImmediate(callback),setImmediate(()=>{this.bootstrapers.forEach(candidate=>{candidate=multiaddr(candidate);let ma;includes(candidate.protoNames(),"ipfs")&&(ma=candidate.decapsulate("ipfs"));let peerIdB58Str;try{peerIdB58Str=candidate.stringTuples().filter(tuple=>{if(tuple[0]===candidate.protos().filter(proto=>{return"ipfs"===proto.name})[0].code)return!0})[0][1]}catch(e){throw new Error("Error extracting IPFS id from multiaddr",e)}const peerId=PeerId.createFromB58String(peerIdB58Str);PeerInfo.create(peerId,(err,peerInfo)=>{if(err)return log.error("Error creating PeerInfo from bootstrap peer",err);peerInfo.multiaddrs.add(ma),this.emit("peer",peerInfo)})})})}stop(callback){setImmediate(callback)}}module.exports=Railing},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function ensureBuffer(){return pull.map(c=>{return"string"==typeof c?new Buffer(c,"utf-8"):c})}const pull=__webpack_require__(5),lp=__webpack_require__(28),lpOpts={fixed:!0,bytes:4};exports.createBoxStream=((cipher,mac)=>{return pull(ensureBuffer(),pull.asyncMap((chunk,cb)=>{cipher.encrypt(chunk,(err,data)=>{if(err)return cb(err);mac.digest(data,(err,digest)=>{if(err)return cb(err);cb(null,Buffer.concat([data,digest]))})})}),lp.encode(lpOpts))}),exports.createUnboxStream=((decipher,mac)=>{return pull(ensureBuffer(),lp.decode(lpOpts),pull.asyncMap((chunk,cb)=>{const l=chunk.length,macSize=mac.length;if(l{return err?cb(err):macd.equals(expected)?void decipher.decrypt(data,(err,decrypted)=>{if(err)return cb(err);cb(null,decrypted)}):cb(new Error(`MAC Invalid: ${macd.toString("hex")} != ${expected.toString("hex")}`))})}))})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),waterfall=__webpack_require__(9),support=__webpack_require__(144),crypto=__webpack_require__(143),log=debug("libp2p:secio");log.error=debug("libp2p:secio:error"),module.exports=function(state,cb){log("2. exchange - start"),log("2. exchange - writing exchange"),waterfall([cb=>crypto.createExchange(state,cb),(ex,cb)=>{support.write(state,ex),support.read(state.shake,cb)},(msg,cb)=>{log("2. exchange - reading exchange"),crypto.verify(state,msg,cb)},cb=>crypto.generateKeys(state,cb)],err=>{if(err)return cb(err);log("2. exchange - finish"),cb()})}},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(5),handshake=__webpack_require__(67),debug=__webpack_require__(3),log=debug("libp2p:secio");log.error=debug("libp2p:secio:error");const etm=__webpack_require__(592),crypto=__webpack_require__(143);module.exports=function(state,cb){log("3. finish - start");const proto=state.protocols,stream=state.shake.rest(),shake=handshake({timeout:state.timeout},err=>{if(err)throw err});pull(stream,etm.createUnboxStream(proto.remote.cipher,proto.remote.mac),shake,etm.createBoxStream(proto.local.cipher,proto.local.mac),stream),shake.handshake.write(state.proposal.in.rand),shake.handshake.read(state.proposal.in.rand.length,(err,nonceBack)=>{const fail=err=>{log.error(err),state.secure.resolve({source:pull.error(err),sink(read){}}),cb(err)};if(err)return fail(err);try{crypto.verifyNonce(state,nonceBack)}catch(err){return fail(err)}log("3. finish - finish"),state.secure.resolve(shake.handshake.rest()),cb()})}},function(module,exports,__webpack_require__){"use strict";const series=__webpack_require__(40),propose=__webpack_require__(596),exchange=__webpack_require__(593),finish=__webpack_require__(594);module.exports=function(state){return series([cb=>propose(state,cb),cb=>exchange(state,cb),cb=>finish(state,cb)],err=>{state.cleanSecrets(),err&&(err===!0&&(err=new Error("Stream ended prematurely")),state.shake.abort(err))}),state.stream}},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),waterfall=__webpack_require__(9),support=__webpack_require__(144),crypto=__webpack_require__(143),log=debug("libp2p:secio");log.error=debug("libp2p:secio:error"),module.exports=function(state,cb){log("1. propose - start"),log("1. propose - writing proposal"),support.write(state,crypto.createProposal(state)),waterfall([cb=>support.read(state.shake,cb),(msg,cb)=>{log("1. propose - reading proposal",msg),crypto.identify(state,msg,cb)},cb=>crypto.selectProtocols(state,cb)],err=>{if(err)return cb(err);log("1. propose - finish"),cb()})}},function(module,exports,__webpack_require__){"use strict";module.exports=`message Propose { +}`},function(module,exports,__webpack_require__){"use strict";const lp=__webpack_require__(23),Pushable=__webpack_require__(30),pull=__webpack_require__(4),setImmediate=__webpack_require__(10),rpc=__webpack_require__(222).rpc.RPC;class Peer{constructor(info){this.info=info,this.conn=null,this.topics=new Set,this.stream=null}get isConnected(){return Boolean(this.conn)}get isWritable(){return Boolean(this.stream)}write(msg){if(!this.isWritable){const id=this.info.id.toB58String();throw new Error("No writable connection to "+id)}this.stream.push(msg)}attachConnection(conn){this.conn=conn,this.stream=new Pushable,pull(this.stream,lp.encode(),conn)}_sendRawSubscriptions(topics,subscribe){if(0!==topics.size){const subs=[];topics.forEach(topic=>{subs.push({subscribe:subscribe,topicCID:topic})}),this.write(rpc.encode({subscriptions:subs}))}}sendSubscriptions(topics){this._sendRawSubscriptions(topics,!0)}sendUnsubscriptions(topics){this._sendRawSubscriptions(topics,!1)}sendMessages(msgs){this.write(rpc.encode({msgs:msgs}))}updateSubscriptions(changes){changes.forEach(subopt=>{subopt.subscribe?this.topics.add(subopt.topicCID):this.topics.delete(subopt.topicCID)})}close(callback){!this.conn||this.stream,this.stream&&this.stream.end(),setImmediate(()=>{this.conn=null,this.stream=null,callback()})}}module.exports=Peer},function(module,exports,__webpack_require__){"use strict";const crypto=__webpack_require__(63);exports=module.exports,exports.randomSeqno=(()=>{return crypto.randomBytes(20).toString("hex")}),exports.msgId=((from,seqno)=>{return from+seqno}),exports.anyMatch=((a,b)=>{let bHas;bHas=Array.isArray(b)?val=>b.indexOf(val)>-1:val=>b.has(val);for(let val of a)if(bHas(val))return!0;return!1}),exports.ensureArray=(maybeArray=>{return Array.isArray(maybeArray)?maybeArray:[maybeArray]})},function(module,exports,__webpack_require__){"use strict";function getObservedAddrs(input){if(!hasObservedAddr(input))return[];let addrs=input.observedAddr;return Array.isArray(input.observedAddr)||(addrs=[addrs]),addrs.map(oa=>multiaddr(oa))}function hasObservedAddr(input){return input.observedAddr&&input.observedAddr.length>0}const PeerInfo=__webpack_require__(35),PeerId=__webpack_require__(22),multiaddr=__webpack_require__(24),pull=__webpack_require__(4),lp=__webpack_require__(23),msg=__webpack_require__(223);module.exports=((conn,callback)=>{pull(conn,lp.decode(),pull.take(1),pull.collect((err,data)=>{if(err)return callback(err);if(0===data.length)return callback(new Error("conn was closed, did not receive data"));const input=msg.decode(data[0]);PeerId.createFromPubKey(input.publicKey,(err,id)=>{if(err)return callback(err);const peerInfo=new PeerInfo(id);input.listenAddrs.map(multiaddr).forEach(ma=>peerInfo.multiaddrs.add(ma)),callback(null,peerInfo,getObservedAddrs(input))})}))})},function(module,exports,__webpack_require__){"use strict";exports=module.exports,exports.multicodec="/ipfs/id/1.0.0",exports.listener=__webpack_require__(492),exports.dialer=__webpack_require__(490)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const pull=__webpack_require__(4),lp=__webpack_require__(23),msg=__webpack_require__(223);module.exports=((conn,pInfoSelf)=>{conn.getObservedAddrs((err,observedAddrs)=>{if(!err){observedAddrs=observedAddrs[0];let publicKey=new Buffer(0);pInfoSelf.id.pubKey&&(publicKey=pInfoSelf.id.pubKey.bytes);const msgSend=msg.encode({protocolVersion:"ipfs/0.1.0",agentVersion:"na",publicKey:publicKey,listenAddrs:pInfoSelf.multiaddrs.toArray().map(ma=>ma.buffer),observedAddr:observedAddrs?observedAddrs.buffer:new Buffer("")});pull(pull.values([msgSend]),lp.encode(),conn)}})})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function create(rawConn,isListener){const stream=toStream(rawConn);stream.on("end",()=>stream.destroy());const mpx=new Multiplex({halfOpen:!0,initiator:!isListener});return pump(stream,mpx,stream),new Muxer(rawConn,mpx)}const Multiplex=__webpack_require__(576),toStream=__webpack_require__(251),MULTIPLEX_CODEC=__webpack_require__(224),Muxer=__webpack_require__(494),pump=__webpack_require__(631);exports=module.exports=create,exports.multicodec=MULTIPLEX_CODEC,exports.dialer=(conn=>create(conn,!1)),exports.listener=(conn=>create(conn,!0))},function(module,exports,__webpack_require__){"use strict";function noop(){}function catchError(stream){return{source:pull(stream.source,pullCatch(err=>{if("Channel destroyed"!==err.message)return!1})),sink:stream.sink}}const EventEmitter=__webpack_require__(11).EventEmitter,Connection=__webpack_require__(28).Connection,toPull=__webpack_require__(146),pull=__webpack_require__(4),pullCatch=__webpack_require__(595),setImmediate=__webpack_require__(10),MULTIPLEX_CODEC=__webpack_require__(224);module.exports=class MultiplexMuxer extends EventEmitter{constructor(conn,multiplex){super(),this.multiplex=multiplex,this.conn=conn,this.multicodec=MULTIPLEX_CODEC,multiplex.on("close",()=>this.emit("close")),multiplex.on("error",err=>this.emit("error",err)),multiplex.on("stream",(stream,id)=>{const muxedConn=new Connection(catchError(toPull.duplex(stream)),this.conn);this.emit("stream",muxedConn)})}newStream(callback){callback=callback||noop;let stream=this.multiplex.createStream();const conn=new Connection(catchError(toPull.duplex(stream)),this.conn);return setImmediate(()=>callback(null,conn)),conn}end(callback){callback=callback||noop,this.multiplex.once("close",callback),this.multiplex.destroy()}}},function(module,exports,__webpack_require__){"use strict";function mount(swarm){swarm.handle(PROTOCOL,(protocol,conn)=>{function next(){shake.read(PING_LENGTH,(err,buf)=>{if(err!==!0)return err?log.error(err):(shake.write(buf),next())})}const stream=handshake({timeout:0}),shake=stream.handshake;pull(conn,stream,conn),next()})}function unmount(swarm){swarm.unhandle(PROTOCOL)}const pull=__webpack_require__(4),handshake=__webpack_require__(55),constants=__webpack_require__(125),PROTOCOL=constants.PROTOCOL,PING_LENGTH=constants.PING_LENGTH,debug=__webpack_require__(3),log=debug("libp2p-ping");log.error=debug("libp2p-ping:error"),exports=module.exports,exports.mount=mount,exports.unmount=unmount},function(module,exports,__webpack_require__){"use strict";const handler=__webpack_require__(495);exports=module.exports=__webpack_require__(497),exports.mount=handler.mount,exports.unmount=handler.unmount},function(module,exports,__webpack_require__){"use strict";const EventEmitter=__webpack_require__(11).EventEmitter,pull=__webpack_require__(4),handshake=__webpack_require__(55),constants=__webpack_require__(125),util=__webpack_require__(498),rnd=util.rnd,debug=__webpack_require__(3),log=debug("libp2p-ping");log.error=debug("libp2p-ping:error");const PROTOCOL=constants.PROTOCOL,PING_LENGTH=constants.PING_LENGTH;class Ping extends EventEmitter{constructor(swarm,peer){super();let shake,stop=!1,self=this;log("dialing %s to %s",PROTOCOL,peer.id.toB58String()),swarm.dial(peer,PROTOCOL,(err,conn)=>{function next(){let start=new Date,buf=rnd(PING_LENGTH);shake.write(buf),shake.read(PING_LENGTH,(err,bufBack)=>{let end=new Date;if(err||!buf.equals(bufBack)){const err=new Error("Received wrong ping ack");return self.emit("error",err)}self.emit("ping",end-start),stop||next()})}if(err)return this.emit("error",err);const stream=handshake({timeout:0});shake=stream.handshake,pull(stream,conn,stream),next()}),this.stop=(()=>{!stop&&shake&&(stop=!0,pull(pull.empty(),shake.rest()))})}}module.exports=Ping},function(module,exports,__webpack_require__){"use strict";const crypto=__webpack_require__(63),constants=__webpack_require__(125);exports=module.exports,exports.rnd=(length=>{return length||(length=constants.PING_LENGTH),crypto.randomBytes(length)})},function(module,exports,__webpack_require__){"use strict";const PeerId=__webpack_require__(22),PeerInfo=__webpack_require__(35),multiaddr=__webpack_require__(24),EventEmitter=__webpack_require__(11).EventEmitter,debug=__webpack_require__(3),setImmediate=__webpack_require__(10),log=debug("libp2p:railing");log.error=debug("libp2p:railing:error");class Railing extends EventEmitter{constructor(bootstrapers){super(),this.bootstrapers=bootstrapers,this.interval=null}start(callback){setImmediate(()=>callback()),this.interval||(this.interval=setInterval(()=>{this.bootstrapers.forEach(candidate=>{const ma=multiaddr(candidate),peerId=PeerId.createFromB58String(ma.getPeerId());PeerInfo.create(peerId,(err,peerInfo)=>{if(err)return log.error("Invalid bootstrap peer id",err);peerInfo.multiaddrs.add(ma),this.emit("peer",peerInfo)})})},1e4))}stop(callback){setImmediate(callback),this.interval&&(clearInterval(this.interval),this.interval=null)}}module.exports=Railing},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function ensureBuffer(){return pull.map(c=>{return"string"==typeof c?new Buffer(c,"utf-8"):c})}const pull=__webpack_require__(4),lp=__webpack_require__(23),lpOpts={fixed:!0,bytes:4};exports.createBoxStream=((cipher,mac)=>{return pull(ensureBuffer(),pull.asyncMap((chunk,cb)=>{cipher.encrypt(chunk,(err,data)=>{if(err)return cb(err);mac.digest(data,(err,digest)=>{if(err)return cb(err);cb(null,Buffer.concat([data,digest]))})})}),lp.encode(lpOpts))}),exports.createUnboxStream=((decipher,mac)=>{return pull(ensureBuffer(),lp.decode(lpOpts),pull.asyncMap((chunk,cb)=>{const l=chunk.length,macSize=mac.length;if(l{return err?cb(err):macd.equals(expected)?void decipher.decrypt(data,(err,decrypted)=>{if(err)return cb(err);cb(null,decrypted)}):cb(new Error(`MAC Invalid: ${macd.toString("hex")} != ${expected.toString("hex")}`))})}))})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),waterfall=__webpack_require__(7),support=__webpack_require__(127),crypto=__webpack_require__(126),log=debug("libp2p:secio");log.error=debug("libp2p:secio:error"),module.exports=function(state,cb){log("2. exchange - start"),log("2. exchange - writing exchange"),waterfall([cb=>crypto.createExchange(state,cb),(ex,cb)=>{support.write(state,ex),support.read(state.shake,cb)},(msg,cb)=>{log("2. exchange - reading exchange"),crypto.verify(state,msg,cb)},cb=>crypto.generateKeys(state,cb)],err=>{if(err)return cb(err);log("2. exchange - finish"),cb()})}},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(4),handshake=__webpack_require__(55),debug=__webpack_require__(3),log=debug("libp2p:secio");log.error=debug("libp2p:secio:error");const etm=__webpack_require__(500),crypto=__webpack_require__(126);module.exports=function(state,cb){log("3. finish - start");const proto=state.protocols,stream=state.shake.rest(),shake=handshake({timeout:state.timeout},err=>{if(err)throw err});pull(stream,etm.createUnboxStream(proto.remote.cipher,proto.remote.mac),shake,etm.createBoxStream(proto.local.cipher,proto.local.mac),stream),shake.handshake.write(state.proposal.in.rand),shake.handshake.read(state.proposal.in.rand.length,(err,nonceBack)=>{const fail=err=>{log.error(err),state.secure.resolve({source:pull.error(err),sink(read){}}),cb(err)};if(err)return fail(err);try{crypto.verifyNonce(state,nonceBack)}catch(err){return fail(err)}log("3. finish - finish"),state.secure.resolve(shake.handshake.rest()),cb()})}},function(module,exports,__webpack_require__){"use strict";const series=__webpack_require__(33),propose=__webpack_require__(504),exchange=__webpack_require__(501),finish=__webpack_require__(502);module.exports=function(state){return series([cb=>propose(state,cb),cb=>exchange(state,cb),cb=>finish(state,cb)],err=>{state.cleanSecrets(),err&&(err===!0&&(err=new Error("Stream ended prematurely")),state.shake.abort(err))}),state.stream}},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),waterfall=__webpack_require__(7),support=__webpack_require__(127),crypto=__webpack_require__(126),log=debug("libp2p:secio");log.error=debug("libp2p:secio:error"),module.exports=function(state,cb){log("1. propose - start"),log("1. propose - writing proposal"),support.write(state,crypto.createProposal(state)),waterfall([cb=>support.read(state.shake,cb),(msg,cb)=>{log("1. propose - reading proposal",msg),crypto.identify(state,msg,cb)},cb=>crypto.selectProtocols(state,cb)],err=>{if(err)return cb(err);log("1. propose - finish"),cb()})}},function(module,exports,__webpack_require__){"use strict";module.exports=`message Propose { optional bytes rand = 1; optional bytes pubkey = 2; optional string exchanges = 3; @@ -216,25 +208,20 @@ message TopicDescriptor { message Exchange { optional bytes epubkey = 1; optional bytes signature = 2; -}`},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(5),Connection=__webpack_require__(29).Connection,handshake=__webpack_require__(595),State=__webpack_require__(599);module.exports={tag:"/secio/1.0.0",encrypt(local,key,insecure,callback){if(!local)throw new Error("no local id provided");if(!key)throw new Error("no local private key provided");if(!insecure)throw new Error("no insecure stream provided");callback||(callback=(err=>{err&&console.error(err)}));const state=new State(local,key,3e5,callback);return pull(insecure,handshake(state),insecure),new Connection(state.secure,insecure)}}},function(module,exports,__webpack_require__){"use strict";const handshake=__webpack_require__(67),deferred=__webpack_require__(295);class State{constructor(id,key,timeout,cb){"function"==typeof timeout&&(cb=timeout,timeout=void 0),this.setup(),this.id.local=id,this.key.local=key,this.timeout=timeout||6e4,cb=cb||(()=>{}),this.secure=deferred.duplex(),this.stream=handshake({timeout:this.timeout},cb),this.shake=this.stream.handshake,delete this.stream.handshake}setup(){this.id={local:null,remote:null},this.key={local:null,remote:null},this.shake=null,this.cleanSecrets()}cleanSecrets(){this.shared={},this.ephemeralKey={local:null,remote:null},this.proposal={in:null,out:null},this.proposalEncoded={in:null,out:null},this.protocols={local:null,remote:null},this.exchange={in:null,out:null}}}module.exports=State},function(module,exports,__webpack_require__){"use strict";function create(rawConn,isListener){const conn=toStream(rawConn);return conn.resume(),conn.on("end",()=>{conn.destroy()}),new Muxer(rawConn,spdy.connection.create(conn,{protocol:"spdy",isServer:isListener}))}const spdy=__webpack_require__(21),toStream=__webpack_require__(158),Muxer=__webpack_require__(601),SPDY_CODEC=__webpack_require__(253);exports=module.exports=create,exports.multicodec=SPDY_CODEC,exports.dialer=(conn=>create(conn,!1)),exports.listener=(conn=>create(conn,!0))},function(module,exports,__webpack_require__){"use strict";const EventEmitter=__webpack_require__(8).EventEmitter,noop=__webpack_require__(634),Connection=__webpack_require__(29).Connection,toPull=__webpack_require__(120),SPDY_CODEC=__webpack_require__(253);module.exports=class Muxer extends EventEmitter{constructor(conn,spdy){super(),this.spdy=spdy,this.conn=conn,this.multicodec=SPDY_CODEC,spdy.start(3.1),spdy.on("close",()=>{this.emit("close")}),spdy.on("error",err=>{this.emit("error",err)}),spdy.on("stream",stream=>{stream.respond(200,{});const muxedConn=new Connection(toPull.duplex(stream),this.conn);this.emit("stream",muxedConn)})}newStream(callback){callback||(callback=noop);const conn=new Connection(null,this.conn);return this.spdy.request({method:"POST",path:"/",headers:{}},(err,stream)=>{if(err)return callback(err);conn.setInnerConn(toPull.duplex(stream),this.conn),callback(null,conn)}),conn}end(cb){this.spdy.destroyStreams(),this.spdy.end(cb)}}},function(module,exports,__webpack_require__){"use strict";const identify=__webpack_require__(582),multistream=__webpack_require__(152),waterfall=__webpack_require__(9),debug=__webpack_require__(3),log=debug("libp2p:swarm:connection"),setImmediate=__webpack_require__(11),protocolMuxer=__webpack_require__(107),plaintext=__webpack_require__(254);module.exports=function(swarm){return{addUpgrade(){},addStreamMuxer(muxer){swarm.muxers[muxer.multicodec]=muxer,swarm.handle(muxer.multicodec,(protocol,conn)=>{const muxedConn=muxer.listener(conn);return muxedConn.on("stream",conn=>{protocolMuxer(swarm.protocols,conn)}),swarm.identify&&(conn.getPeerInfo=(cb=>{const conn=muxedConn.newStream(),ms=new multistream.Dialer;waterfall([cb=>ms.handle(conn,cb),cb=>ms.select(identify.multicodec,cb),(conn,cb)=>identify.dialer(conn,cb),(peerInfo,observedAddrs,cb)=>{observedAddrs.forEach(oa=>{swarm._peerInfo.multiaddrs.addSafe(oa)}),cb(null,peerInfo)}],cb)}),conn.getPeerInfo((err,peerInfo)=>{if(err)return log("Identify not successful");const b58Str=peerInfo.id.toB58String();swarm.muxedConns[b58Str]={muxer:muxedConn},peerInfo.multiaddrs.size>0?peerInfo.connect(peerInfo.multiaddrs.toArray()[0]):peerInfo.connect(`/ipfs/${b58Str}`),peerInfo=swarm._peerBook.put(peerInfo),muxedConn.on("close",()=>{delete swarm.muxedConns[b58Str],peerInfo.disconnect(),peerInfo=swarm._peerBook.put(peerInfo),setImmediate(()=>swarm.emit("peer-mux-closed",peerInfo))}),setImmediate(()=>swarm.emit("peer-mux-established",peerInfo))})),conn})},reuse(){swarm.identify=!0,swarm.handle(identify.multicodec,(protocol,conn)=>{identify.listener(conn,swarm._peerInfo)})},crypto(tag,encrypt){tag||encrypt||(tag=plaintext.tag,encrypt=plaintext.encrypt),swarm.unhandle(swarm.crypto.tag),swarm.handle(tag,(protocol,conn)=>{const id=swarm._peerInfo.id,secure=encrypt(id,id.privKey,conn);protocolMuxer(swarm.protocols,secure)}),swarm.crypto={tag:tag,encrypt:encrypt}}}}},function(module,exports,__webpack_require__){"use strict";const multistream=__webpack_require__(152),Connection=__webpack_require__(29).Connection,debug=__webpack_require__(3),log=debug("libp2p:swarm:dial"),setImmediate=__webpack_require__(11),protocolMuxer=__webpack_require__(107);module.exports=function(swarm){return(pi,protocol,callback)=>{function gotWarmedUpConn(conn){conn.setPeerInfo(pi),attemptMuxerUpgrade(conn,(err,muxer)=>{if(!protocol)return err&&(swarm.conns[b58Id]=conn),callback();err?protocolHandshake(conn,protocol,callback):gotMuxer(muxer)})}function gotMuxer(muxer){swarm.identify,openConnInMuxedConn(muxer,conn=>{protocolHandshake(conn,protocol,callback)})}function attemptMuxerUpgrade(conn,cb){function nextMuxer(key){log("selecting %s",key),ms.select(key,(err,conn)=>{if(err)return void(0===muxers.length?cb(new Error("could not upgrade to stream muxing")):nextMuxer(muxers.shift()));const muxedConn=swarm.muxers[key].dialer(conn);swarm.muxedConns[b58Id]={},swarm.muxedConns[b58Id].muxer=muxedConn,muxedConn.once("close",()=>{const b58Str=pi.id.toB58String();delete swarm.muxedConns[b58Str],pi.disconnect(),swarm._peerBook.get(b58Str).disconnect(),setImmediate(()=>swarm.emit("peer-mux-closed",pi))}),muxedConn.on("stream",conn=>{protocolMuxer(swarm.protocols,conn)}),setImmediate(()=>swarm.emit("peer-mux-established",pi)),cb(null,muxedConn)})}const muxers=Object.keys(swarm.muxers);if(0===muxers.length)return cb(new Error("no muxers available"));const ms=new multistream.Dialer;ms.handle(conn,err=>{if(err)return callback(new Error("multistream not supported"));nextMuxer(muxers.shift())})}function openConnInMuxedConn(muxer,cb){cb(muxer.newStream())}function protocolHandshake(conn,protocol,cb){const ms=new multistream.Dialer;ms.handle(conn,err=>{if(err)return callback(err);ms.select(protocol,(err,conn)=>{if(err)return callback(err);proxyConn.setInnerConn(conn),callback(null,proxyConn)})})}"function"==typeof protocol&&(callback=protocol,protocol=null),callback=callback||function(){};const proxyConn=new Connection,b58Id=pi.id.toB58String();if(log("dialing %s",b58Id),swarm.muxedConns[b58Id]){if(!protocol)return callback();gotMuxer(swarm.muxedConns[b58Id].muxer)}else if(swarm.conns[b58Id]){const conn=swarm.conns[b58Id];swarm.conns[b58Id]=void 0,gotWarmedUpConn(conn)}else!function(pi,cb){function nextTransport(key){swarm.transport.dial(key,pi,(err,conn)=>{if(err)return 0===tKeys.length?cb(new Error("Could not dial in any of the transports")):nextTransport(tKeys.shift());!function(){const ms=new multistream.Dialer;ms.handle(conn,err=>{if(err)return cb(err);const id=swarm._peerInfo.id;log("selecting crypto: %s",swarm.crypto.tag),ms.select(swarm.crypto.tag,(err,conn)=>{if(err)return cb(err);cb(null,swarm.crypto.encrypt(id,id.privKey,conn))})})}()})}const tKeys=swarm.availableTransports(pi);if(0===tKeys.length)return cb(new Error("No available transport to dial to"));nextTransport(tKeys.shift())}(pi,(err,conn)=>{if(err)return callback(err);gotWarmedUpConn(conn)});return proxyConn}}},function(module,exports,__webpack_require__){"use strict";function Swarm(peerInfo,peerBook){if(!(this instanceof Swarm))return new Swarm(peerInfo);assert(peerInfo,"You must provide a `peerInfo`"),assert(peerBook,"You must provide a `peerBook`"),this._peerInfo=peerInfo,this._peerBook=peerBook,this.transports={},this.conns={},this.muxedConns={},this.protocols={},this.muxers={},this.identify=!1,this.crypto=plaintext,this.transport=transport(this),this.connection=connection(this),this.availableTransports=(pi=>{const myAddrs=pi.multiaddrs.toArray();return Object.keys(this.transports).filter(ts=>this.transports[ts].filter(myAddrs).length>0)}),this.dial=dial(this),this.listen=(callback=>{each(this.availableTransports(peerInfo),(ts,cb)=>{this.transport.listen(ts,{},null,cb)},callback)}),this.handle=((protocol,handlerFunc,matchFunc)=>{this.protocols[protocol]={handlerFunc:handlerFunc,matchFunc:matchFunc}}),this.handle(this.crypto.tag,(protocol,conn)=>{const peerId=this._peerInfo.id,wrapped=this.crypto.encrypt(peerId,peerId.privKey,conn);return protocolMuxer(this.protocols,wrapped)}),this.unhandle=(protocol=>{this.protocols[protocol]&&delete this.protocols[protocol]}),this.hangUp=((peerInfo,callback)=>{const key=peerInfo.id.toB58String();if(this.muxedConns[key]){const muxer=this.muxedConns[key].muxer;muxer.once("close",()=>{delete this.muxedConns[key],callback()}),muxer.end()}else callback()}),this.close=(callback=>{series([cb=>each(this.muxedConns,(conn,cb)=>{conn.muxer.end(err=>{if(err&&"Fatal error: OK"!==err.message)return cb(err);cb()})},cb),cb=>{each(this.transports,(transport,cb)=>{each(transport.listeners,(listener,cb)=>{listener.close(cb)},cb)},cb)}],callback)})}const util=__webpack_require__(10),EE=__webpack_require__(8).EventEmitter,each=__webpack_require__(32),series=__webpack_require__(40),transport=__webpack_require__(607),connection=__webpack_require__(602),dial=__webpack_require__(603),protocolMuxer=__webpack_require__(107),plaintext=__webpack_require__(254),assert=__webpack_require__(7);module.exports=Swarm,util.inherits(Swarm,EE)},function(module,exports,__webpack_require__){"use strict";const map=__webpack_require__(89),debug=__webpack_require__(3),log=debug("libp2p:swarm:dialer"),DialQueue=__webpack_require__(606);class LimitDialer{constructor(perPeerLimit,dialTimeout){log("create: %s peer limit, %s dial timeout",perPeerLimit,dialTimeout),this.perPeerLimit=perPeerLimit,this.dialTimeout=dialTimeout,this.queues=new Map}dialMany(peer,transport,addrs,callback){log("dialMany:start");const token={cancel:!1};map(addrs,(m,cb)=>{this.dialSingle(peer,transport,m,token,cb)},(err,results)=>{if(err)return callback(err);const success=results.filter(res=>res.conn);if(success.length>0)return log("dialMany:success"),callback(null,success[0]);log("dialMany:error");const error=new Error("Failed to dial any provided address");return error.errors=results.filter(res=>res.error).map(res=>res.error),callback(error)})}dialSingle(peer,transport,addr,token,callback){const ps=peer.toB58String();log("dialSingle: %s:%s",ps,addr.toString());let q;this.queues.has(ps)?q=this.queues.get(ps):(q=new DialQueue(this.perPeerLimit,this.dialTimeout),this.queues.set(ps,q)),q.push(transport,addr,token,callback)}}module.exports=LimitDialer},function(module,exports,__webpack_require__){"use strict";const Connection=__webpack_require__(29).Connection,pull=__webpack_require__(5),timeout=__webpack_require__(357),queue=__webpack_require__(181),debug=__webpack_require__(3),log=debug("libp2p:swarm:dialer:queue");class DialQueue{constructor(limit,dialTimeout){this.dialTimeout=dialTimeout,this.queue=queue((task,cb)=>{this._doWork(task.transport,task.addr,task.token,cb)},limit)}_doWork(transport,addr,token,callback){log("work"),this._dialWithTimeout(transport,addr,(err,conn)=>{return err?(log("work:error"),callback(null,{error:err})):token.cancel?(log("work:cancel"),pull(pull.empty(),conn),callback(null,{cancel:!0})):(token.cancel=!0,log("work:success"),(new Connection).setInnerConn(conn),void callback(null,{multiaddr:addr,conn:conn}))})}_dialWithTimeout(transport,addr,callback){timeout(cb=>{const conn=transport.dial(addr,err=>{if(err)return cb(err);cb(null,conn)})},this.dialTimeout)(callback)}push(transport,addr,token,callback){this.queue.push({transport:transport,addr:addr,token:token},callback)}}module.exports=DialQueue},function(module,exports,__webpack_require__){"use strict";function dialables(tp,multiaddrs){return tp.filter(multiaddrs)}function noop(){}const parallel=__webpack_require__(46),once=__webpack_require__(82),debug=__webpack_require__(3),log=debug("libp2p:swarm:transport"),protocolMuxer=__webpack_require__(107),LimitDialer=__webpack_require__(605);module.exports=function(swarm){const dialer=new LimitDialer(8,1e4);return{add(key,transport,options,callback){if("function"==typeof options&&(callback=options,options={}),callback=callback||noop,log("adding %s",key),swarm.transports[key])throw new Error("There is already a transport with this key");swarm.transports[key]=transport,swarm.transports[key].listeners||(swarm.transports[key].listeners=[]),callback()},dial(key,pi,callback){const t=swarm.transports[key];let multiaddrs=pi.multiaddrs.toArray();Array.isArray(multiaddrs)||(multiaddrs=[multiaddrs]),log("dialing %s",key,multiaddrs.map(m=>m.toString())),multiaddrs=dialables(t,multiaddrs),dialer.dialMany(pi.id,t,multiaddrs,(err,success)=>{if(err)return callback(err);pi.connect(success.multiaddr),swarm._peerBook.put(pi),callback(null,success.conn)})},listen(key,options,handler,callback){handler||(handler=protocolMuxer.bind(null,swarm.protocols));const multiaddrs=dialables(swarm.transports[key],swarm._peerInfo.multiaddrs.distinct()),transport=swarm.transports[key];transport.listeners||(transport.listeners=[]);let freshMultiaddrs=[];parallel(multiaddrs.map(ma=>{return cb=>{const done=once(cb),listener=transport.createListener(handler);listener.once("error",done),listener.listen(ma,err=>{if(err)return done(err);listener.removeListener("error",done),listener.getAddrs((err,addrs)=>{if(err)return done(err);freshMultiaddrs=freshMultiaddrs.concat(addrs),transport.listeners.push(listener),done()})})}}),err=>{if(err)return callback(err);swarm._peerInfo.multiaddrs.replace(multiaddrs,freshMultiaddrs),callback()})},close(key,callback){const transport=swarm.transports[key];if(!transport)return callback(new Error(`Trying to close non existing transport: ${key}`));parallel(transport.listeners.map(listener=>{return cb=>{listener.close(cb)}}),callback)}}}},function(module,exports,__webpack_require__){module.exports=__webpack_require__(609)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(610),module.exports.parser=__webpack_require__(64)},function(module,exports,__webpack_require__){(function(global){function Socket(uri,opts){if(!(this instanceof Socket))return new Socket(uri,opts);opts=opts||{},uri&&"object"==typeof uri&&(opts=uri,uri=null),uri?(uri=parseuri(uri),opts.hostname=uri.host,opts.secure="https"===uri.protocol||"wss"===uri.protocol,opts.port=uri.port,uri.query&&(opts.query=uri.query)):opts.host&&(opts.hostname=parseuri(opts.host).host),this.secure=null!=opts.secure?opts.secure:global.location&&"https:"===location.protocol,opts.hostname&&!opts.port&&(opts.port=this.secure?"443":"80"),this.agent=opts.agent||!1,this.hostname=opts.hostname||(global.location?location.hostname:"localhost"),this.port=opts.port||(global.location&&location.port?location.port:this.secure?443:80),this.query=opts.query||{},"string"==typeof this.query&&(this.query=parseqs.decode(this.query)),this.upgrade=!1!==opts.upgrade,this.path=(opts.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!opts.forceJSONP,this.jsonp=!1!==opts.jsonp,this.forceBase64=!!opts.forceBase64,this.enablesXDR=!!opts.enablesXDR,this.timestampParam=opts.timestampParam||"t",this.timestampRequests=opts.timestampRequests,this.transports=opts.transports||["polling","websocket"],this.transportOptions=opts.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=opts.policyPort||843,this.rememberUpgrade=opts.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=opts.onlyBinaryUpgrades,this.perMessageDeflate=!1!==opts.perMessageDeflate&&(opts.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=opts.pfx||null,this.key=opts.key||null,this.passphrase=opts.passphrase||null,this.cert=opts.cert||null,this.ca=opts.ca||null,this.ciphers=opts.ciphers||null,this.rejectUnauthorized=void 0===opts.rejectUnauthorized||opts.rejectUnauthorized,this.forceNode=!!opts.forceNode;var freeGlobal="object"==typeof global&&global;freeGlobal.global===freeGlobal&&(opts.extraHeaders&&Object.keys(opts.extraHeaders).length>0&&(this.extraHeaders=opts.extraHeaders),opts.localAddress&&(this.localAddress=opts.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}function clone(obj){var o={};for(var i in obj)obj.hasOwnProperty(i)&&(o[i]=obj[i]);return o}var transports=__webpack_require__(255),Emitter=__webpack_require__(63),debug=__webpack_require__(3)("engine.io-client:socket"),index=__webpack_require__(131),parser=__webpack_require__(64),parseuri=__webpack_require__(291),parsejson=__webpack_require__(712),parseqs=__webpack_require__(154);module.exports=Socket,Socket.priorWebsocketSuccess=!1,Emitter(Socket.prototype),Socket.protocol=parser.protocol,Socket.Socket=Socket,Socket.Transport=__webpack_require__(145),Socket.transports=__webpack_require__(255),Socket.parser=__webpack_require__(64),Socket.prototype.createTransport=function(name){debug('creating transport "%s"',name);var query=clone(this.query);query.EIO=parser.protocol,query.transport=name;var options=this.transportOptions[name]||{};return this.id&&(query.sid=this.id),new transports[name]({query:query,socket:this,agent:options.agent||this.agent,hostname:options.hostname||this.hostname,port:options.port||this.port,secure:options.secure||this.secure,path:options.path||this.path,forceJSONP:options.forceJSONP||this.forceJSONP,jsonp:options.jsonp||this.jsonp,forceBase64:options.forceBase64||this.forceBase64,enablesXDR:options.enablesXDR||this.enablesXDR,timestampRequests:options.timestampRequests||this.timestampRequests,timestampParam:options.timestampParam||this.timestampParam,policyPort:options.policyPort||this.policyPort,pfx:options.pfx||this.pfx,key:options.key||this.key,passphrase:options.passphrase||this.passphrase,cert:options.cert||this.cert,ca:options.ca||this.ca,ciphers:options.ciphers||this.ciphers,rejectUnauthorized:options.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:options.perMessageDeflate||this.perMessageDeflate,extraHeaders:options.extraHeaders||this.extraHeaders,forceNode:options.forceNode||this.forceNode,localAddress:options.localAddress||this.localAddress,requestTimeout:options.requestTimeout||this.requestTimeout,protocols:options.protocols||void 0})},Socket.prototype.open=function(){var transport;if(this.rememberUpgrade&&Socket.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)transport="websocket";else{if(0===this.transports.length){var self=this;return void setTimeout(function(){self.emit("error","No transports available")},0)}transport=this.transports[0]}this.readyState="opening";try{transport=this.createTransport(transport)}catch(e){return this.transports.shift(),void this.open()}transport.open(),this.setTransport(transport)},Socket.prototype.setTransport=function(transport){debug("setting transport %s",transport.name);var self=this;this.transport&&(debug("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=transport,transport.on("drain",function(){self.onDrain()}).on("packet",function(packet){self.onPacket(packet)}).on("error",function(e){self.onError(e)}).on("close",function(){self.onClose("transport close")})},Socket.prototype.probe=function(name){function onTransportOpen(){if(self.onlyBinaryUpgrades){var upgradeLosesBinary=!this.supportsBinary&&self.transport.supportsBinary;failed=failed||upgradeLosesBinary}failed||(debug('probe transport "%s" opened',name),transport.send([{type:"ping",data:"probe"}]),transport.once("packet",function(msg){if(!failed)if("pong"===msg.type&&"probe"===msg.data){if(debug('probe transport "%s" pong',name),self.upgrading=!0,self.emit("upgrading",transport),!transport)return;Socket.priorWebsocketSuccess="websocket"===transport.name,debug('pausing current transport "%s"',self.transport.name),self.transport.pause(function(){failed||"closed"!==self.readyState&&(debug("changing transport and sending upgrade packet"),cleanup(),self.setTransport(transport),transport.send([{type:"upgrade"}]),self.emit("upgrade",transport),transport=null,self.upgrading=!1,self.flush())})}else{debug('probe transport "%s" failed',name);var err=new Error("probe error");err.transport=transport.name,self.emit("upgradeError",err)}}))}function freezeTransport(){failed||(failed=!0,cleanup(),transport.close(),transport=null)}function onerror(err){var error=new Error("probe error: "+err);error.transport=transport.name,freezeTransport(),debug('probe transport "%s" failed because of error: %s',name,err),self.emit("upgradeError",error)}function onTransportClose(){onerror("transport closed")}function onclose(){onerror("socket closed")}function onupgrade(to){transport&&to.name!==transport.name&&(debug('"%s" works - aborting "%s"',to.name,transport.name),freezeTransport())}function cleanup(){transport.removeListener("open",onTransportOpen),transport.removeListener("error",onerror),transport.removeListener("close",onTransportClose),self.removeListener("close",onclose),self.removeListener("upgrading",onupgrade)}debug('probing transport "%s"',name);var transport=this.createTransport(name,{probe:1}),failed=!1,self=this;Socket.priorWebsocketSuccess=!1,transport.once("open",onTransportOpen),transport.once("error",onerror),transport.once("close",onTransportClose),this.once("close",onclose),this.once("upgrading",onupgrade),transport.open()},Socket.prototype.onOpen=function(){if(debug("socket open"),this.readyState="open",Socket.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){debug("starting upgrade probes");for(var i=0,l=this.upgrades.length;i';iframe=document.createElement(html)}catch(e){iframe=document.createElement("iframe"),iframe.name=self.iframeId,iframe.src="javascript:0"}iframe.id=self.iframeId,self.form.appendChild(iframe),self.iframe=iframe}var self=this;if(!this.form){var iframe,form=document.createElement("form"),area=document.createElement("textarea"),id=this.iframeId="eio_iframe_"+this.index;form.className="socketio",form.style.position="absolute",form.style.top="-1000px",form.style.left="-1000px",form.target=id,form.method="POST",form.setAttribute("accept-charset","utf-8"),area.name="d",form.appendChild(area),document.body.appendChild(form),this.form=form,this.area=area}this.form.action=this.uri(),initIframe(),data=data.replace(/\\n/g,"\\\n"),this.area.value=data.replace(/\n/g,"\\n");try{this.form.submit()}catch(e){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===self.iframe.readyState&&complete()}:this.iframe.onload=complete}}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){(function(global){function empty(){}function XHR(opts){if(Polling.call(this,opts),this.requestTimeout=opts.requestTimeout,this.extraHeaders=opts.extraHeaders,global.location){var isSSL="https:"===location.protocol,port=location.port;port||(port=isSSL?443:80),this.xd=opts.hostname!==global.location.hostname||port!==opts.port,this.xs=opts.secure!==isSSL}}function Request(opts){this.method=opts.method||"GET",this.uri=opts.uri,this.xd=!!opts.xd,this.xs=!!opts.xs,this.async=!1!==opts.async,this.data=void 0!==opts.data?opts.data:null,this.agent=opts.agent,this.isBinary=opts.isBinary,this.supportsBinary=opts.supportsBinary,this.enablesXDR=opts.enablesXDR,this.requestTimeout=opts.requestTimeout,this.pfx=opts.pfx,this.key=opts.key,this.passphrase=opts.passphrase,this.cert=opts.cert,this.ca=opts.ca,this.ciphers=opts.ciphers,this.rejectUnauthorized=opts.rejectUnauthorized,this.extraHeaders=opts.extraHeaders,this.create()}function unloadHandler(){for(var i in Request.requests)Request.requests.hasOwnProperty(i)&&Request.requests[i].abort()}var XMLHttpRequest=__webpack_require__(146),Polling=__webpack_require__(256),Emitter=__webpack_require__(63),inherit=__webpack_require__(95),debug=__webpack_require__(3)("engine.io-client:polling-xhr");module.exports=XHR,module.exports.Request=Request,inherit(XHR,Polling),XHR.prototype.supportsBinary=!0,XHR.prototype.request=function(opts){return opts=opts||{},opts.uri=this.uri(),opts.xd=this.xd,opts.xs=this.xs,opts.agent=this.agent||!1,opts.supportsBinary=this.supportsBinary,opts.enablesXDR=this.enablesXDR,opts.pfx=this.pfx,opts.key=this.key,opts.passphrase=this.passphrase,opts.cert=this.cert,opts.ca=this.ca,opts.ciphers=this.ciphers,opts.rejectUnauthorized=this.rejectUnauthorized,opts.requestTimeout=this.requestTimeout,opts.extraHeaders=this.extraHeaders,new Request(opts)},XHR.prototype.doWrite=function(data,fn){var isBinary="string"!=typeof data&&void 0!==data,req=this.request({method:"POST",data:data,isBinary:isBinary}),self=this;req.on("success",fn),req.on("error",function(err){self.onError("xhr post error",err)}),this.sendXhr=req},XHR.prototype.doPoll=function(){debug("xhr poll");var req=this.request(),self=this;req.on("data",function(data){self.onData(data)}),req.on("error",function(err){self.onError("xhr poll error",err)}),this.pollXhr=req},Emitter(Request.prototype),Request.prototype.create=function(){var opts={agent:this.agent, -xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};opts.pfx=this.pfx,opts.key=this.key,opts.passphrase=this.passphrase,opts.cert=this.cert,opts.ca=this.ca,opts.ciphers=this.ciphers,opts.rejectUnauthorized=this.rejectUnauthorized;var xhr=this.xhr=new XMLHttpRequest(opts),self=this;try{debug("xhr open %s: %s",this.method,this.uri),xhr.open(this.method,this.uri,this.async);try{if(this.extraHeaders){xhr.setDisableHeaderCheck&&xhr.setDisableHeaderCheck(!0);for(var i in this.extraHeaders)this.extraHeaders.hasOwnProperty(i)&&xhr.setRequestHeader(i,this.extraHeaders[i])}}catch(e){}if("POST"===this.method)try{this.isBinary?xhr.setRequestHeader("Content-type","application/octet-stream"):xhr.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{xhr.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in xhr&&(xhr.withCredentials=!0),this.requestTimeout&&(xhr.timeout=this.requestTimeout),this.hasXDR()?(xhr.onload=function(){self.onLoad()},xhr.onerror=function(){self.onError(xhr.responseText)}):xhr.onreadystatechange=function(){if(2===xhr.readyState){var contentType;try{contentType=xhr.getResponseHeader("Content-Type")}catch(e){}"application/octet-stream"===contentType&&(xhr.responseType="arraybuffer")}4===xhr.readyState&&(200===xhr.status||1223===xhr.status?self.onLoad():setTimeout(function(){self.onError(xhr.status)},0))},debug("xhr data %s",this.data),xhr.send(this.data)}catch(e){return void setTimeout(function(){self.onError(e)},0)}global.document&&(this.index=Request.requestsCount++,Request.requests[this.index]=this)},Request.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},Request.prototype.onData=function(data){this.emit("data",data),this.onSuccess()},Request.prototype.onError=function(err){this.emit("error",err),this.cleanup(!0)},Request.prototype.cleanup=function(fromError){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=empty:this.xhr.onreadystatechange=empty,fromError)try{this.xhr.abort()}catch(e){}global.document&&delete Request.requests[this.index],this.xhr=null}},Request.prototype.onLoad=function(){var data;try{var contentType;try{contentType=this.xhr.getResponseHeader("Content-Type")}catch(e){}data="application/octet-stream"===contentType?this.xhr.response||this.xhr.responseText:this.xhr.responseText}catch(e){this.onError(e)}null!=data&&this.onData(data)},Request.prototype.hasXDR=function(){return void 0!==global.XDomainRequest&&!this.xs&&this.enablesXDR},Request.prototype.abort=function(){this.cleanup()},Request.requestsCount=0,Request.requests={},global.document&&(global.attachEvent?global.attachEvent("onunload",unloadHandler):global.addEventListener&&global.addEventListener("beforeunload",unloadHandler,!1))}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){(function(global){function WS(opts){opts&&opts.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=opts.perMessageDeflate,this.usingBrowserWebSocket=BrowserWebSocket&&!opts.forceNode,this.protocols=opts.protocols,this.usingBrowserWebSocket||(WebSocket=NodeWebSocket),Transport.call(this,opts)}var NodeWebSocket,Transport=__webpack_require__(145),parser=__webpack_require__(64),parseqs=__webpack_require__(154),inherit=__webpack_require__(95),yeast=__webpack_require__(331),debug=__webpack_require__(3)("engine.io-client:websocket"),BrowserWebSocket=global.WebSocket||global.MozWebSocket;if("undefined"==typeof window)try{NodeWebSocket=__webpack_require__(859)}catch(e){}var WebSocket=BrowserWebSocket;WebSocket||"undefined"!=typeof window||(WebSocket=NodeWebSocket),module.exports=WS,inherit(WS,Transport),WS.prototype.name="websocket",WS.prototype.supportsBinary=!0,WS.prototype.doOpen=function(){if(this.check()){var uri=this.uri(),protocols=this.protocols,opts={agent:this.agent,perMessageDeflate:this.perMessageDeflate};opts.pfx=this.pfx,opts.key=this.key,opts.passphrase=this.passphrase,opts.cert=this.cert,opts.ca=this.ca,opts.ciphers=this.ciphers,opts.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(opts.headers=this.extraHeaders),this.localAddress&&(opts.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket?protocols?new WebSocket(uri,protocols):new WebSocket(uri):new WebSocket(uri,protocols,opts)}catch(err){return this.emit("error",err)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},WS.prototype.addEventListeners=function(){var self=this;this.ws.onopen=function(){self.onOpen()},this.ws.onclose=function(){self.onClose()},this.ws.onmessage=function(ev){self.onData(ev.data)},this.ws.onerror=function(e){self.onError("websocket error",e)}},WS.prototype.write=function(packets){function done(){self.emit("flush"),setTimeout(function(){self.writable=!0,self.emit("drain")},0)}var self=this;this.writable=!1;for(var total=packets.length,i=0,l=total;i=55296&&value<=56319&&counter65535&&(value-=65536,output+=stringFromCharCode(value>>>10&1023|55296),value=56320|1023&value),output+=stringFromCharCode(value);return output}function checkScalarValue(codePoint,strict){if(codePoint>=55296&&codePoint<=57343){if(strict)throw Error("Lone surrogate U+"+codePoint.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function createByte(codePoint,shift){return stringFromCharCode(codePoint>>shift&63|128)}function encodeCodePoint(codePoint,strict){if(0==(4294967168&codePoint))return stringFromCharCode(codePoint);var symbol="";return 0==(4294965248&codePoint)?symbol=stringFromCharCode(codePoint>>6&31|192):0==(4294901760&codePoint)?(checkScalarValue(codePoint,strict)||(codePoint=65533),symbol=stringFromCharCode(codePoint>>12&15|224),symbol+=createByte(codePoint,6)):0==(4292870144&codePoint)&&(symbol=stringFromCharCode(codePoint>>18&7|240),symbol+=createByte(codePoint,12),symbol+=createByte(codePoint,6)),symbol+=stringFromCharCode(63&codePoint|128)}function utf8encode(string,opts){opts=opts||{};for(var codePoint,strict=!1!==opts.strict,codePoints=ucs2decode(string),length=codePoints.length,index=-1,byteString="";++index=byteCount)throw Error("Invalid byte index");var continuationByte=255&byteArray[byteIndex];if(byteIndex++,128==(192&continuationByte))return 63&continuationByte;throw Error("Invalid continuation byte")}function decodeSymbol(strict){var byte1,byte2,byte3,byte4,codePoint;if(byteIndex>byteCount)throw Error("Invalid byte index");if(byteIndex==byteCount)return!1;if(byte1=255&byteArray[byteIndex],byteIndex++,0==(128&byte1))return byte1;if(192==(224&byte1)){if(byte2=readContinuationByte(),(codePoint=(31&byte1)<<6|byte2)>=128)return codePoint;throw Error("Invalid continuation byte")}if(224==(240&byte1)){if(byte2=readContinuationByte(),byte3=readContinuationByte(),(codePoint=(15&byte1)<<12|byte2<<6|byte3)>=2048)return checkScalarValue(codePoint,strict)?codePoint:65533;throw Error("Invalid continuation byte")}if(240==(248&byte1)&&(byte2=readContinuationByte(),byte3=readContinuationByte(),byte4=readContinuationByte(),(codePoint=(7&byte1)<<18|byte2<<12|byte3<<6|byte4)>=65536&&codePoint<=1114111))return codePoint;throw Error("Invalid UTF-8 detected")}function utf8decode(byteString,opts){opts=opts||{};var strict=!1!==opts.strict;byteArray=ucs2decode(byteString),byteCount=byteArray.length,byteIndex=0;for(var tmp,codePoints=[];(tmp=decodeSymbol(strict))!==!1;)codePoints.push(tmp);return ucs2encode(codePoints)}var freeExports="object"==typeof exports&&exports,freeGlobal=("object"==typeof module&&module&&module.exports,"object"==typeof global&&global);freeGlobal.global!==freeGlobal&&freeGlobal.window;var byteArray,byteCount,byteIndex,stringFromCharCode=String.fromCharCode,utf8={version:"2.1.2",encode:utf8encode,decode:utf8decode};void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(){return utf8}.call(exports,__webpack_require__,exports,module))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)}()}).call(exports,__webpack_require__(23)(module),__webpack_require__(4))},function(module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return"[object Array]"==toString.call(arr)}},function(module,exports,__webpack_require__){function lookup(uri,opts){"object"==typeof uri&&(opts=uri,uri=void 0),opts=opts||{};var io,parsed=url(uri),source=parsed.source,id=parsed.id,path=parsed.path,sameNamespace=cache[id]&&path in cache[id].nsps,newConnection=opts.forceNew||opts["force new connection"]||!1===opts.multiplex||sameNamespace;return newConnection?(debug("ignoring socket cache for %s",source),io=Manager(source,opts)):(cache[id]||(debug("new io instance for %s",source),cache[id]=Manager(source,opts)),io=cache[id]),parsed.query&&!opts.query?opts.query=parsed.query:opts&&"object"==typeof opts.query&&(opts.query=encodeQueryString(opts.query)),io.socket(parsed.path,opts)}function encodeQueryString(obj){var str=[];for(var p in obj)obj.hasOwnProperty(p)&&str.push(encodeURIComponent(p)+"="+encodeURIComponent(obj[p]));return str.join("&")}var url=__webpack_require__(618),parser=__webpack_require__(147),Manager=__webpack_require__(257),debug=__webpack_require__(108)("socket.io-client");module.exports=exports=lookup;var cache=exports.managers={};exports.protocol=parser.protocol,exports.connect=lookup,exports.Manager=__webpack_require__(257),exports.Socket=__webpack_require__(259)},function(module,exports,__webpack_require__){(function(global){function url(uri,loc){var obj=uri;loc=loc||global.location,null==uri&&(uri=loc.protocol+"//"+loc.host),"string"==typeof uri&&("/"===uri.charAt(0)&&(uri="/"===uri.charAt(1)?loc.protocol+uri:loc.host+uri),/^(https?|wss?):\/\//.test(uri)||(debug("protocol-less url %s",uri),uri=void 0!==loc?loc.protocol+"//"+uri:"https://"+uri),debug("parse %s",uri),obj=parseuri(uri)),obj.port||(/^(http|ws)$/.test(obj.protocol)?obj.port="80":/^(http|ws)s$/.test(obj.protocol)&&(obj.port="443")),obj.path=obj.path||"/";var ipv6=obj.host.indexOf(":")!==-1,host=ipv6?"["+obj.host+"]":obj.host;return obj.id=obj.protocol+"://"+host+":"+obj.port,obj.href=obj.protocol+"://"+host+(loc&&loc.port===obj.port?"":":"+obj.port),obj}var parseuri=__webpack_require__(291),debug=__webpack_require__(108)("socket.io-client:url");module.exports=url}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){function selectColor(namespace){var i,hash=0;for(i in namespace)hash=(hash<<5)-hash+namespace.charCodeAt(i),hash|=0;return exports.colors[Math.abs(hash)%exports.colors.length]}function createDebug(namespace){function debug(){if(debug.enabled){var self=debug,curr=+new Date,ms=curr-(prevTime||curr);self.diff=ms,self.prev=prevTime,self.curr=curr,prevTime=curr;for(var args=new Array(arguments.length),i=0;i1e4)){var match=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);if(match){var n=parseFloat(match[1]);switch((match[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*y;case"days":case"day":case"d":return n*d;case"hours":case"hour":case"hrs":case"hr":case"h":return n*h;case"minutes":case"minute":case"mins":case"min":case"m":return n*m;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function fmtShort(ms){return ms>=d?Math.round(ms/d)+"d":ms>=h?Math.round(ms/h)+"h":ms>=m?Math.round(ms/m)+"m":ms>=s?Math.round(ms/s)+"s":ms+"ms"}function fmtLong(ms){return plural(ms,d,"day")||plural(ms,h,"hour")||plural(ms,m,"minute")||plural(ms,s,"second")||ms+" ms"}function plural(ms,n,name){if(!(ms0)return parse(val);if("number"===type&&isNaN(val)===!1)return options.long?fmtLong(val):fmtShort(val);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(val))}},function(module,exports,__webpack_require__){(function(global){function _deconstructPacket(data,buffers){if(!data)return data;if(isBuf(data)){var placeholder={_placeholder:!0,num:buffers.length};return buffers.push(data),placeholder}if(isArray(data)){for(var newData=new Array(data.length),i=0;i{}),sioOptions={transports:["websocket"],"force new connection":!0};class WebRTCStar{constructor(){this.maSelf=void 0,this.sioOptions={transports:["websocket"],"force new connection":!0},this.discovery=new EE,this.discovery.start=(callback=>{setImmediate(callback)}),this.discovery.stop=(callback=>{setImmediate(callback)}),this.listenersRefs={},this._peerDiscovered=this._peerDiscovered.bind(this)}dial(ma,options,callback){"function"==typeof options&&(callback=options,options={}),callback=callback?once(callback):noop;const intentId=(~~(1e9*Math.random())).toString(36)+Date.now(),sioClient=this.listenersRefs[Object.keys(this.listenersRefs)[0]].io,spOptions={initiator:!0,trickle:!1};isNode&&(spOptions.wrtc=wrtc);const channel=new SimplePeer(spOptions),conn=new Connection(toPull.duplex(channel));let connected=!1;return channel.on("signal",signal=>{sioClient.emit("ss-handshake",{intentId:intentId,srcMultiaddr:this.maSelf.toString(),dstMultiaddr:ma.toString(),signal:signal})}),channel.once("timeout",()=>callback(new Error("timeout"))),channel.once("error",err=>{connected||callback(err)}),sioClient.on("ws-handshake",offer=>{if(offer.intentId===intentId&&offer.err)return callback(new Error(offer.err));offer.intentId===intentId&&offer.answer&&(channel.once("connect",()=>{connected=!0,conn.destroy=channel.destroy.bind(channel),channel.once("close",()=>conn.destroy()),conn.getObservedAddrs=(callback=>callback(null,[ma])),callback(null,conn)}),channel.signal(offer.signal))}),conn}createListener(options,handler){"function"==typeof options&&(handler=options,options={});const listener=new EE;return listener.listen=((ma,callback)=>{function incommingDial(offer){if(!offer.answer&&!offer.err){const spOptions={trickle:!1};isNode&&(spOptions.wrtc=wrtc);const channel=new SimplePeer(spOptions),conn=new Connection(toPull.duplex(channel));channel.once("connect",()=>{conn.getObservedAddrs=(callback=>{return callback(null,[offer.srcMultiaddr])}),listener.emit("connection",conn),handler(conn)}),channel.once("signal",signal=>{offer.signal=signal,offer.answer=!0,listener.io.emit("ss-handshake",offer)}),channel.signal(offer.signal)}}if(callback=callback?once(callback):noop,!webrtcSupport.support&&!isNode)return setImmediate(()=>{callback(new Error("No WebRTC support in this runtime"))});this.maSelf=ma;const sioUrl=cleanUrlSIO(ma);log("Dialing to Signalling Server on: "+sioUrl),listener.io=io.connect(sioUrl,sioOptions),listener.io.once("connect_error",callback),listener.io.once("error",err=>{listener.emit("error",err),listener.emit("close")}),listener.io.on("ws-handshake",incommingDial),listener.io.on("ws-peer",this._peerDiscovered),listener.io.on("connect",()=>{listener.io.emit("ss-join",ma.toString())}),listener.io.once("connect",()=>{listener.emit("listening"),callback()})}),listener.close=(callback=>{callback=callback?once(callback):noop,listener.io.emit("ss-leave"),setImmediate(()=>{listener.emit("close"),callback()})}),listener.getAddrs=(callback=>{setImmediate(()=>callback(null,[this.maSelf]))}),this.listenersRefs[multiaddr.toString()]=listener,listener}filter(multiaddrs){return Array.isArray(multiaddrs)||(multiaddrs=[multiaddrs]),multiaddrs.filter(ma=>{return mafmt.WebRTCStar.matches(ma)})}_peerDiscovered(maStr){log("Peer Discovered:",maStr);const split=maStr.split("/ipfs/"),peerIdStr=split[split.length-1],peerId=PeerId.createFromB58String(peerIdStr),peerInfo=new PeerInfo(peerId);peerInfo.multiaddrs.add(multiaddr(maStr)),this.discovery.emit("peer",peerInfo)}}module.exports=WebRTCStar},function(module,exports,__webpack_require__){"use strict";const connect=__webpack_require__(752),mafmt=__webpack_require__(110),includes=__webpack_require__(263),Connection=__webpack_require__(29).Connection,maToUrl=__webpack_require__(625),debug=__webpack_require__(3),log=debug("libp2p:websockets:dialer"),createListener=__webpack_require__(624);class WebSockets{dial(ma,options,callback){"function"==typeof options&&(callback=options,options={}),callback=callback||function(){};const url=maToUrl(ma);log("dialing %s",url);const socket=connect(url,{binary:!0,onConnect:err=>callback(err)}),conn=new Connection(socket);return conn.getObservedAddrs=(callback=>callback(null,[ma])),conn.close=(callback=>socket.close(callback)),conn}createListener(options,handler){return"function"==typeof options&&(handler=options,options={}),createListener(options,handler)}filter(multiaddrs){return Array.isArray(multiaddrs)||(multiaddrs=[multiaddrs]),multiaddrs.filter(ma=>{return includes(ma.protoNames(),"ipfs")&&(ma=ma.decapsulate("ipfs")),mafmt.WebSockets.matches(ma)||mafmt.WebSocketsSecure.matches(ma)})}}module.exports=WebSockets},function(module,exports,__webpack_require__){"use strict";function noop(){}const Connection=__webpack_require__(29).Connection,includes=__webpack_require__(263),createServer=__webpack_require__(861)||noop;module.exports=((options,handler)=>{const listener=createServer(socket=>{socket.getObservedAddrs=(callback=>{return callback(null,[])}),handler(new Connection(socket))});let listeningMultiaddr;return listener._listen=listener.listen,listener.listen=((ma,callback)=>{callback=callback||noop,listeningMultiaddr=ma,includes(ma.protoNames(),"ipfs")&&(ma=ma.decapsulate("ipfs")),listener._listen(ma.toOptions(),callback)}),listener.getAddrs=(callback=>{callback(null,[listeningMultiaddr])}),listener})},function(module,exports,__webpack_require__){"use strict";function maToUrl(ma){const maStrSplit=ma.toString().split("/");let proto;try{proto=ma.protoNames().filter(proto=>{return"ws"===proto||"wss"===proto})[0]}catch(e){throw log(e),new Error("Not a valid websocket address",e)}let port;try{port=ma.stringTuples().filter(tuple=>{if(tuple[0]===ma.protos().filter(proto=>{return"tcp"===proto.name})[0].code)return!0})[0][1]}catch(e){log("No port, skipping")}return`${proto}://${maStrSplit[2]}${!port||80===port&&443===port?"":`:${port}`}`}const debug=__webpack_require__(3),log=debug("libp2p:websockets:dialer");module.exports=maToUrl},function(module,exports,__webpack_require__){"use strict";const EventEmitter=__webpack_require__(8).EventEmitter,assert=__webpack_require__(7),setImmediate=__webpack_require__(11),each=__webpack_require__(32),series=__webpack_require__(40),Ping=__webpack_require__(588),Swarm=__webpack_require__(604),PeerId=__webpack_require__(31),PeerInfo=__webpack_require__(51),PeerBook=__webpack_require__(292),mafmt=__webpack_require__(110),multiaddr=__webpack_require__(34);module.exports;class Node extends EventEmitter{constructor(_modules,_peerInfo,_peerBook,_options){if(super(),assert(_modules,"requires modules to equip libp2p with features"),assert(_peerInfo,"requires a PeerInfo instance"),this.modules=_modules,this.peerInfo=_peerInfo,this.peerBook=_peerBook||new PeerBook,this.isOnline=!1,this.swarm=new Swarm(this.peerInfo,this.peerBook),this.modules.connection.muxer){let muxers=this.modules.connection.muxer;muxers=Array.isArray(muxers)?muxers:[muxers],muxers.forEach(muxer=>this.swarm.connection.addStreamMuxer(muxer)),this.swarm.connection.reuse(),this.swarm.on("peer-mux-established",peerInfo=>{this.emit("peer:connect",peerInfo),this.peerBook.put(peerInfo)}),this.swarm.on("peer-mux-closed",peerInfo=>{this.emit("peer:disconnect",peerInfo)})}if(this.modules.connection.crypto){let cryptos=this.modules.connection.crypto;cryptos=Array.isArray(cryptos)?cryptos:[cryptos],cryptos.forEach(crypto=>{this.swarm.connection.crypto(crypto.tag,crypto.encrypt)})}if(this.modules.discovery){let discoveries=this.modules.discovery;discoveries=Array.isArray(discoveries)?discoveries:[discoveries],discoveries.forEach(discovery=>{discovery.on("peer",peerInfo=>this.emit("peer:discovery",peerInfo))})}Ping.mount(this.swarm),_modules.DHT&&(this._dht=new this.modules.DHT(this,20,_options.DHT&&_options.DHT.datastore)),this.peerRouting={findPeer:(id,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.findPeer(id,callback)}},this.contentRouting={findProviders:(key,timeout,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.findProviders(key,timeout,callback)},provide:(key,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.provide(key,callback)}},this.dht={put:(key,value,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.put(key,value,callback)},get:(key,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.get(key,callback)},getMany(key,nVals,callback){if(!this._dht)return callback(new Error("DHT is not available"));this._dht.getMany(key,nVals,callback)}}}start(callback){if(!this.modules.transport)return callback(new Error("no transports were present"));let ws,transports=this.modules.transport;transports=Array.isArray(transports)?transports:[transports];const maOld=[],maNew=[];this.peerInfo.multiaddrs.forEach(ma=>{mafmt.IPFS.matches(ma)||(maOld.push(ma),maNew.push(ma.encapsulate("/ipfs/"+this.peerInfo.id.toB58String())))}),this.peerInfo.multiaddrs.replace(maOld,maNew);const multiaddrs=this.peerInfo.multiaddrs.toArray();transports.forEach(transport=>{transport.filter(multiaddrs).length>0?this.swarm.transport.add(transport.tag||transport.constructor.name,transport):transport.constructor&&"WebSockets"===transport.constructor.name&&(ws=transport)}),series([cb=>this.swarm.listen(cb),cb=>{if(this.isOnline=!0,ws&&this.swarm.transport.add(ws.tag||ws.constructor.name,ws),this.modules.discovery)return each(this.modules.discovery,(d,cb)=>d.start(cb),cb);cb()},cb=>{if(this._dht)return this._dht.start(cb);cb()}],callback)}stop(callback){this.isOnline=!1,this.modules.discovery&&this.modules.discovery.forEach(discovery=>{setImmediate(()=>discovery.stop(()=>{}))}),series([cb=>{if(this._dht)return this._dht.stop(cb);cb()},cb=>this.swarm.close(cb)],callback)}isOn(){return this.isOnline}ping(peer,callback){assert(this.isOn(),"The libp2p node is not started yet"),this._getPeerInfo(peer,(err,peerInfo)=>{if(err)return callback(err);callback(null,new Ping(this.swarm,peerInfo))})}dial(peer,protocol,callback){assert(this.isOn(),"The libp2p node is not started yet"),"function"==typeof protocol&&(callback=protocol,protocol=void 0),this._getPeerInfo(peer,(err,peerInfo)=>{if(err)return callback(err);this.swarm.dial(peerInfo,protocol,(err,conn)=>{if(err)return callback(err);this.peerBook.put(peerInfo),callback(null,conn)})})}hangUp(peer,callback){assert(this.isOn(),"The libp2p node is not started yet"),this._getPeerInfo(peer,(err,peerInfo)=>{if(err)return callback(err);this.swarm.hangUp(peerInfo,callback)})}handle(protocol,handlerFunc,matchFunc){this.swarm.handle(protocol,handlerFunc,matchFunc)}unhandle(protocol){this.swarm.unhandle(protocol)}_getPeerInfo(peer,callback){let p;if(PeerInfo.isPeerInfo(peer))p=peer;else if(multiaddr.isMultiaddr(peer)){const peerIdB58Str=peer.getPeerId();try{p=this.peerBook.get(peerIdB58Str)}catch(err){p=new PeerInfo(PeerId.createFromB58String(peerIdB58Str))}p.multiaddrs.add(peer)}else{if(!PeerId.isPeerId(peer))return setImmediate(()=>callback(new Error("peer type not recognized")));{const peerIdB58Str=peer.toB58String();try{p=this.peerBook.get(peerIdB58Str)}catch(err){return this.peerRouting.findPeer(peer,callback)}}}setImmediate(()=>callback(null,p))}}module.exports=Node},function(module,exports,__webpack_require__){(function(global,module){function arrayFilter(array,predicate){for(var index=-1,length=array?array.length:0,resIndex=0,result=[];++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toFinite(value){if(!value)return 0===value?value:0;if((value=toNumber(value))===INFINITY||value===-INFINITY){return(value<0?-1:1)*MAX_INTEGER}return value===value?value:0}function toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,MAX_INTEGER=1.7976931348623157e308,NAN=NaN,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsOctal=/^0o[0-7]+$/i,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeParseInt=parseInt,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),nativeMax=Math.max,DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&"[object Promise]"!=getTag(Promise.resolve())||Set&&getTag(new Set)!=setTag||WeakMap&&"[object WeakMap]"!=getTag(new WeakMap))&&(getTag=function(value){var result=objectToString.call(value),Ctor=result==objectTag?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):void 0;if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return"[object Promise]";case setCtorString:return setTag;case weakMapCtorString:return"[object WeakMap]"}return result});var stringToPath=memoize(function(string){string=toString(string);var result=[];return reLeadingDot.test(string)&&result.push(""),string.replace(/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,function(match,number,quote,string){result.push(quote?string.replace(/\\(\\)?/g,"$1"):number||match)}),result}),find=function(findIndexFunc){return function(collection,predicate,fromIndex){var iterable=Object(collection);if(!isArrayLike(collection)){var iteratee=baseIteratee(predicate,3);collection=keys(collection),predicate=function(key){return iteratee(iterable[key],key,iterable)}}var index=findIndexFunc(collection,predicate,fromIndex);return index>-1?iterable[iteratee?collection[index]:index]:void 0}}(findIndex);memoize.Cache=MapCache;var isArray=Array.isArray,isTypedArray=nodeIsTypedArray?function(func){return function(value){return func(value)}}(nodeIsTypedArray):baseIsTypedArray;module.exports=find}).call(exports,__webpack_require__(4),__webpack_require__(23)(module))},function(module,exports,__webpack_require__){(function(global,module){function arrayMap(array,iteratee){for(var index=-1,length=array?array.length:0,result=Array(length);++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}function baseGet(object,path){path=isKey(path,object)?[path]:castPath(path);for(var index=0,length=path.length;null!=object&&indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,spreadableSymbol=Symbol?Symbol.isConcatSpreadable:void 0,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))} -}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function has(object,path){return null!=object&&hasPath(object,path,baseHas)} -var FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",symbolTag="[object Symbol]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,Map=getNative(root,"Map"),nativeCreate=getNative(Object,"create"),symbolProto=Symbol?Symbol.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var stringToPath=memoize(function(string){string=toString(string);var result=[];return reLeadingDot.test(string)&&result.push(""),string.replace(/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,function(match,number,quote,string){result.push(quote?string.replace(/\\(\\)?/g,"$1"):number||match)}),result});memoize.Cache=MapCache;var isArray=Array.isArray;module.exports=has}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){(function(global,module){function arraySome(array,predicate){for(var index=-1,length=array?array.length:0;++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}var LARGE_ARRAY_SIZE=200,HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&"[object Promise]"!=getTag(Promise.resolve())||Set&&getTag(new Set)!=setTag||WeakMap&&"[object WeakMap]"!=getTag(new WeakMap))&&(getTag=function(value){var result=objectToString.call(value),Ctor=result==objectTag?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):void 0;if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return"[object Promise]";case setCtorString:return setTag;case weakMapCtorString:return"[object WeakMap]"}return result});var isArray=Array.isArray,isTypedArray=nodeIsTypedArray?function(func){return function(value){return func(value)}}(nodeIsTypedArray):baseIsTypedArray;module.exports=isEqualWith}).call(exports,__webpack_require__(4),__webpack_require__(23)(module))},function(module,exports){function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}var funcTag="[object Function]",genTag="[object GeneratorFunction]",objectProto=Object.prototype,objectToString=objectProto.toString;module.exports=isFunction},function(module,exports){function noop(){}module.exports=noop},function(module,exports){function arrayMap(array,iteratee){for(var index=-1,length=array?array.length:0,result=Array(length);++index-1;)seen!==array&&splice.call(seen,fromIndex,1),splice.call(array,fromIndex,1);return array}function copyArray(source,array){var index=-1,length=source.length;for(array||(array=Array(length));++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index-1&&value%1==0&&value-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key) -;return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}function baseGet(object,path){path=isKey(path,object)?[path]:castPath(path);for(var index=0,length=path.length;null!=object&&indexother||valIsSymbol&&othIsDefined&&othIsReflexive&&!othIsNull&&!othIsSymbol||valIsNull&&othIsDefined&&othIsReflexive||!valIsDefined&&othIsReflexive||!valIsReflexive)return 1;if(!valIsNull&&!valIsSymbol&&!othIsSymbol&&value=ordersLength)return result;return result*("desc"==orders[index]?-1:1)}}return object.index-other.index}function equalArrays(array,other,equalFunc,customizer,bitmask,stack){var isPartial=bitmask&PARTIAL_COMPARE_FLAG,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,spreadableSymbol=Symbol?Symbol.isConcatSpreadable:void 0,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),nativeMax=Math.max,DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index1&&isIterateeCall(collection,iteratees[0],iteratees[1])?iteratees=[]:length>2&&isIterateeCall(iteratees[0],iteratees[1],iteratees[2])&&(iteratees=[iteratees[0]]),baseOrderBy(collection,baseFlatten(iteratees,1),[])});memoize.Cache=MapCache;var isArray=Array.isArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;module.exports=sortBy}).call(exports,__webpack_require__(4),__webpack_require__(23)(module))},function(module,exports,__webpack_require__){(function(global){function debounce(func,wait,options){function invokeFunc(time){var args=lastArgs,thisArg=lastThis;return lastArgs=lastThis=void 0,lastInvokeTime=time,result=func.apply(thisArg,args)}function leadingEdge(time){return lastInvokeTime=time,timerId=setTimeout(timerExpired,wait),leading?invokeFunc(time):result}function remainingWait(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime,result=wait-timeSinceLastCall;return maxing?nativeMin(result,maxWait-timeSinceLastInvoke):result}function shouldInvoke(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime;return void 0===lastCallTime||timeSinceLastCall>=wait||timeSinceLastCall<0||maxing&&timeSinceLastInvoke>=maxWait}function timerExpired(){var time=now();if(shouldInvoke(time))return trailingEdge(time);timerId=setTimeout(timerExpired,remainingWait(time))}function trailingEdge(time){return timerId=void 0,trailing&&lastArgs?invokeFunc(time):(lastArgs=lastThis=void 0,result)}function cancel(){void 0!==timerId&&clearTimeout(timerId),lastInvokeTime=0,lastArgs=lastCallTime=lastThis=timerId=void 0}function flush(){return void 0===timerId?result:trailingEdge(now())}function debounced(){var time=now(),isInvoking=shouldInvoke(time);if(lastArgs=arguments,lastThis=this,lastCallTime=time,isInvoking){if(void 0===timerId)return leadingEdge(lastCallTime);if(maxing)return timerId=setTimeout(timerExpired,wait),invokeFunc(lastCallTime)}return void 0===timerId&&(timerId=setTimeout(timerExpired,wait)),result}var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime=0,leading=!1,maxing=!1,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return wait=toNumber(wait)||0,isObject(options)&&(leading=!!options.leading,maxing="maxWait"in options,maxWait=maxing?nativeMax(toNumber(options.maxWait)||0,wait):maxWait,trailing="trailing"in options?!!options.trailing:trailing),debounced.cancel=cancel,debounced.flush=flush,debounced}function throttle(func,wait,options){var leading=!0,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return isObject(options)&&(leading="leading"in options?!!options.leading:leading,trailing="trailing"in options?!!options.trailing:trailing),debounce(func,wait,{leading:leading,maxWait:wait,trailing:trailing})}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}var FUNC_ERROR_TEXT="Expected a function",NAN=NaN,symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),objectProto=Object.prototype,objectToString=objectProto.toString,nativeMax=Math.max,nativeMin=Math.min,now=function(){return root.Date.now()};module.exports=throttle}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){(function(global,module){function arrayIncludes(array,value){return!!(array?array.length:0)&&baseIndexOf(array,value,0)>-1}function arrayIncludesWith(array,value,comparator){for(var index=-1,length=array?array.length:0;++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function noop(){}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var createSet=Set&&1/setToArray(new Set([,-0]))[1]==INFINITY?function(values){return new Set(values)}:noop,getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&"[object Promise]"!=getTag(Promise.resolve())||Set&&getTag(new Set)!=setTag||WeakMap&&"[object WeakMap]"!=getTag(new WeakMap))&&(getTag=function(value){var result=objectToString.call(value),Ctor=result==objectTag?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):void 0;if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return"[object Promise]";case setCtorString:return setTag;case weakMapCtorString:return"[object WeakMap]"}return result});var stringToPath=memoize(function(string){string=toString(string);var result=[];return reLeadingDot.test(string)&&result.push(""),string.replace(/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,function(match,number,quote,string){result.push(quote?string.replace(/\\(\\)?/g,"$1"):number||match)}),result});memoize.Cache=MapCache;var isArray=Array.isArray,isTypedArray=nodeIsTypedArray?function(func){return function(value){return func(value)}}(nodeIsTypedArray):baseIsTypedArray;module.exports=uniqBy}).call(exports,__webpack_require__(4),__webpack_require__(23)(module))},function(module,exports,__webpack_require__){(function(global){function arrayIncludes(array,value){return!!(array?array.length:0)&&baseIndexOf(array,value,0)>-1}function arrayIncludesWith(array,value,comparator){for(var index=-1,length=array?array.length:0;++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++index-1&&value%1==0&&value-1:!!length&&baseIndexOf(collection,value,fromIndex)>-1}var baseIndexOf=__webpack_require__(266),isArrayLike=__webpack_require__(65),isString=__webpack_require__(664),toInteger=__webpack_require__(669),values=__webpack_require__(671),nativeMax=Math.max;module.exports=includes},function(module,exports,__webpack_require__){var baseIsArguments=__webpack_require__(643),isObjectLike=__webpack_require__(80),objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,propertyIsEnumerable=objectProto.propertyIsEnumerable,isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty.call(value,"callee")&&!propertyIsEnumerable.call(value,"callee")};module.exports=isArguments},function(module,exports,__webpack_require__){(function(module){ -var root=__webpack_require__(268),stubFalse=__webpack_require__(667),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,Buffer=moduleExports?root.Buffer:void 0,nativeIsBuffer=Buffer?Buffer.isBuffer:void 0,isBuffer=nativeIsBuffer||stubFalse;module.exports=isBuffer}).call(exports,__webpack_require__(23)(module))},function(module,exports,__webpack_require__){function isFunction(value){if(!isObject(value))return!1;var tag=baseGetTag(value);return tag==funcTag||tag==genTag||tag==asyncTag||tag==proxyTag}var baseGetTag=__webpack_require__(79),isObject=__webpack_require__(150),asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";module.exports=isFunction},function(module,exports,__webpack_require__){function isString(value){return"string"==typeof value||!isArray(value)&&isObjectLike(value)&&baseGetTag(value)==stringTag}var baseGetTag=__webpack_require__(79),isArray=__webpack_require__(109),isObjectLike=__webpack_require__(80),stringTag="[object String]";module.exports=isString},function(module,exports,__webpack_require__){function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&baseGetTag(value)==symbolTag}var baseGetTag=__webpack_require__(79),isObjectLike=__webpack_require__(80),symbolTag="[object Symbol]";module.exports=isSymbol},function(module,exports,__webpack_require__){var baseIsTypedArray=__webpack_require__(645),baseUnary=__webpack_require__(649),nodeUtil=__webpack_require__(655),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;module.exports=isTypedArray},function(module,exports){function stubFalse(){return!1}module.exports=stubFalse},function(module,exports,__webpack_require__){function toFinite(value){if(!value)return 0===value?value:0;if((value=toNumber(value))===INFINITY||value===-INFINITY){return(value<0?-1:1)*MAX_INTEGER}return value===value?value:0}var toNumber=__webpack_require__(670),INFINITY=1/0,MAX_INTEGER=1.7976931348623157e308;module.exports=toFinite},function(module,exports,__webpack_require__){function toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0}var toFinite=__webpack_require__(668);module.exports=toInteger},function(module,exports,__webpack_require__){function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}var isObject=__webpack_require__(150),isSymbol=__webpack_require__(665),NAN=NaN,reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt;module.exports=toNumber},function(module,exports,__webpack_require__){function values(object){return null==object?[]:baseValues(object,keys(object))}var baseValues=__webpack_require__(650),keys=__webpack_require__(270);module.exports=values},function(module,exports,__webpack_require__){(function(Buffer){function has(obj,key){return Object.hasOwnProperty.call(obj,key)}function isDef(val){return void 0!==val&&""!==val}function has(range,name){return Object.hasOwnProperty.call(range,name)}function hasKey(range,name){return Object.hasOwnProperty.call(range,name)&&name}function id(e){return e}exports.compare=function(a,b){if(Buffer.isBuffer(a)){for(var l=Math.min(a.length,b.length),i=0;ib?1:0};var lowerBoundKey=exports.lowerBoundKey=function(range){return hasKey(range,"gt")||hasKey(range,"gte")||hasKey(range,"min")||(range.reverse?hasKey(range,"end"):hasKey(range,"start"))||void 0},lowerBound=exports.lowerBound=function(range,def){var k=lowerBoundKey(range);return k?range[k]:def},lowerBoundInclusive=exports.lowerBoundInclusive=function(range){return!has(range,"gt")},upperBoundInclusive=exports.upperBoundInclusive=function(range){return!has(range,"lt")},lowerBoundExclusive=exports.lowerBoundExclusive=function(range){return!lowerBoundInclusive(range)},upperBoundExclusive=exports.upperBoundExclusive=function(range){return!upperBoundInclusive(range)},upperBoundKey=exports.upperBoundKey=function(range){return hasKey(range,"lt")||hasKey(range,"lte")||hasKey(range,"max")||(range.reverse?hasKey(range,"start"):hasKey(range,"end"))||void 0},upperBound=exports.upperBound=function(range,def){var k=upperBoundKey(range);return k?range[k]:def};exports.start=function(range,def){return range.reverse?upperBound(range,def):lowerBound(range,def)},exports.end=function(range,def){return range.reverse?lowerBound(range,def):upperBound(range,def)},exports.startInclusive=function(range){return range.reverse?upperBoundInclusive(range):lowerBoundInclusive(range)},exports.endInclusive=function(range){return range.reverse?lowerBoundInclusive(range):upperBoundInclusive(range)},exports.toLtgt=function(range,_range,map,lower,upper){_range=_range||{},map=map||id;var defaults=arguments.length>3,lb=exports.lowerBoundKey(range),ub=exports.upperBoundKey(range);return lb?"gt"===lb?_range.gt=map(range.gt,!1):_range.gte=map(range[lb],!1):defaults&&(_range.gte=map(lower,!1)),ub?"lt"===ub?_range.lt=map(range.lt,!0):_range.lte=map(range[ub],!0):defaults&&(_range.lte=map(upper,!0)),null!=range.reverse&&(_range.reverse=!!range.reverse),has(_range,"max")&&delete _range.max,has(_range,"min")&&delete _range.min,has(_range,"start")&&delete _range.start,has(_range,"end")&&delete _range.end,_range},exports.contains=function(range,key,compare){compare=compare||exports.compare;var lb=lowerBound(range);if(isDef(lb)){var cmp=compare(key,lb);if(cmp<0||0===cmp&&lowerBoundExclusive(range))return!1}var ub=upperBound(range);if(isDef(ub)){var cmp=compare(key,ub);if(cmp>0||0===cmp&&upperBoundExclusive(range))return!1}return!0},exports.filter=function(range,compare){return function(key){return exports.contains(range,key,compare)}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(449)},function(module,exports,__webpack_require__){(function(Buffer){function gt(value){return ltgt.compare(value,this._end)>0}function gte(value){return ltgt.compare(value,this._end)>=0}function lt(value){return ltgt.compare(value,this._end)<0}function lte(value){return ltgt.compare(value,this._end)<=0}function MemIterator(db,options){AbstractIterator.call(this,db),this._limit=options.limit,this._limit===-1&&(this._limit=1/0);var tree=db._store[db._location];this.keyAsBuffer=options.keyAsBuffer!==!1,this.valueAsBuffer=options.valueAsBuffer!==!1,this._reverse=options.reverse,this._options=options,this._done=0,this._reverse?(this._incr="prev",this._start=ltgt.upperBound(options),this._end=ltgt.lowerBound(options),void 0===this._start?this._tree=tree.end:ltgt.upperBoundInclusive(options)?this._tree=tree.le(this._start):this._tree=tree.lt(this._start),this._end&&(ltgt.lowerBoundInclusive(options)?this._test=gte:this._test=gt)):(this._incr="next",this._start=ltgt.lowerBound(options),this._end=ltgt.upperBound(options),void 0===this._start?this._tree=tree.begin:ltgt.lowerBoundInclusive(options)?this._tree=tree.ge(this._start):this._tree=tree.gt(this._start),this._end&&(ltgt.upperBoundInclusive(options)?this._test=lte:this._test=lt))}function MemDOWN(location){if(!(this instanceof MemDOWN))return new MemDOWN(location);AbstractLevelDOWN.call(this,"string"==typeof location?location:""),this._location=this.location?"$"+this.location:"_tree",this._store=this.location?globalStore:this,this._store[this._location]=this._store[this._location]||createRBT(ltgt.compare)}var inherits=__webpack_require__(1),AbstractLevelDOWN=__webpack_require__(275).AbstractLevelDOWN,AbstractIterator=__webpack_require__(275).AbstractIterator,ltgt=__webpack_require__(676),createRBT=__webpack_require__(425),globalStore={},setImmediate=__webpack_require__(673);inherits(MemIterator,AbstractIterator),MemIterator.prototype._next=function(callback){var key,value;return this._done++>=this._limit?setImmediate(callback):this._tree.valid?(key=this._tree.key,value=this._tree.value,this._test(key)?(this.keyAsBuffer&&(key=new Buffer(key)),this.valueAsBuffer&&(value=new Buffer(value)),this._tree[this._incr](),void setImmediate(function(){callback(null,key,value)})):setImmediate(callback)):setImmediate(callback)},MemIterator.prototype._test=function(){return!0},MemDOWN.clearGlobalStore=function(strict){strict?Object.keys(globalStore).forEach(function(key){delete globalStore[key]}):globalStore={}},inherits(MemDOWN,AbstractLevelDOWN),MemDOWN.prototype._open=function(options,callback){var self=this;setImmediate(function(){callback(null,self)})},MemDOWN.prototype._put=function(key,value,options,callback){void 0!==value&&null!==value||(value="");var iter=this._store[this._location].find(key);iter.valid?this._store[this._location]=iter.update(value):this._store[this._location]=this._store[this._location].insert(key,value),setImmediate(callback)},MemDOWN.prototype._get=function(key,options,callback){var value=this._store[this._location].get(key);if(void 0===value)return setImmediate(function(){callback(new Error("NotFound"))});options.asBuffer===!1||this._isBuffer(value)||(value=new Buffer(String(value))),setImmediate(function(){callback(null,value)})},MemDOWN.prototype._del=function(key,options,callback){this._store[this._location]=this._store[this._location].remove(key),setImmediate(callback)},MemDOWN.prototype._batch=function(array,options,callback){for(var key,value,iter,i=-1,len=array.length,tree=this._store[this._location];++ib?1:0};var lowerBoundKey=exports.lowerBoundKey=function(range){return hasKey(range,"gt")||hasKey(range,"gte")||hasKey(range,"min")||(range.reverse?hasKey(range,"end"):hasKey(range,"start"))||void 0},lowerBound=exports.lowerBound=function(range){var k=lowerBoundKey(range);return k&&range[k]},lowerBoundInclusive=exports.lowerBoundInclusive=function(range){return!has(range,"gt")},upperBoundInclusive=exports.upperBoundInclusive=function(range){return!has(range,"lt")},lowerBoundExclusive=exports.lowerBoundExclusive=function(range){return!lowerBoundInclusive(range)},upperBoundExclusive=exports.upperBoundExclusive=function(range){return!upperBoundInclusive(range)},upperBoundKey=exports.upperBoundKey=function(range){return hasKey(range,"lt")||hasKey(range,"lte")||hasKey(range,"max")||(range.reverse?hasKey(range,"start"):hasKey(range,"end"))||void 0},upperBound=exports.upperBound=function(range){var k=upperBoundKey(range);return k&&range[k]};exports.toLtgt=function(range,_range,map,lower,upper){_range=_range||{},map=map||id;var defaults=arguments.length>3,lb=exports.lowerBoundKey(range),ub=exports.upperBoundKey(range);return lb?"gt"===lb?_range.gt=map(range.gt,!1):_range.gte=map(range[lb],!1):defaults&&(_range.gte=map(lower,!1)),ub?"lt"===ub?_range.lt=map(range.lt,!0):_range.lte=map(range[ub],!0):defaults&&(_range.lte=map(upper,!0)),null!=range.reverse&&(_range.reverse=!!range.reverse),has(_range,"max")&&delete _range.max,has(_range,"min")&&delete _range.min,has(_range,"start")&&delete _range.start,has(_range,"end")&&delete _range.end,_range},exports.contains=function(range,key,compare){compare=compare||exports.compare;var lb=lowerBound(range);if(isDef(lb)){var cmp=compare(key,lb);if(cmp<0||0===cmp&&lowerBoundExclusive(range))return!1}var ub=upperBound(range);if(isDef(ub)){var cmp=compare(key,ub);if(cmp>0||0===cmp&&upperBoundExclusive(range))return!1}return!0},exports.filter=function(range,compare){return function(key){return exports.contains(range,key,compare)}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){const SHA3=__webpack_require__(241),secp256k1=__webpack_require__(162),assert=__webpack_require__(7),rlp=__webpack_require__(52),BN=__webpack_require__(20),createHash=__webpack_require__(75);exports.MAX_INTEGER=new BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),exports.TWO_POW256=new BN("10000000000000000000000000000000000000000000000000000000000000000",16),exports.SHA3_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",exports.SHA3_NULL=new Buffer(exports.SHA3_NULL_S,"hex"),exports.SHA3_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",exports.SHA3_RLP_ARRAY=new Buffer(exports.SHA3_RLP_ARRAY_S,"hex"),exports.SHA3_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",exports.SHA3_RLP=new Buffer(exports.SHA3_RLP_S,"hex"),exports.BN=BN,exports.rlp=rlp,exports.secp256k1=secp256k1,exports.zeros=function(bytes){var buf=new Buffer(bytes);return buf.fill(0),buf},exports.setLengthLeft=exports.setLength=function(msg,length,right){var buf=exports.zeros(length);return msg=exports.toBuffer(msg),right?msg.length0&&"0"===first.toString();)a=a.slice(1),first=a[0];return a},exports.toBuffer=function(v){if(!Buffer.isBuffer(v))if(Array.isArray(v))v=new Buffer(v);else if("string"==typeof v)v=exports.isHexPrefixed(v)?new Buffer(exports.padToEven(exports.stripHexPrefix(v)),"hex"):new Buffer(v);else if("number"==typeof v)v=exports.intToBuffer(v);else if(null===v||void 0===v)v=new Buffer([]);else{if(!v.toArray)throw new Error("invalid type");v=new Buffer(v.toArray())}return v},exports.intToHex=function(i){assert(i%1==0,"number is not a integer"),assert(i>=0,"number must be positive");var hex=i.toString(16);return hex.length%2&&(hex="0"+hex),"0x"+hex},exports.intToBuffer=function(i){return new Buffer(exports.intToHex(i).slice(2),"hex")},exports.bufferToInt=function(buf){return parseInt(exports.bufferToHex(buf),16)},exports.bufferToHex=function(buf){return buf=exports.toBuffer(buf),0===buf.length?0:"0x"+buf.toString("hex")},exports.fromSigned=function(num){return new BN(num).fromTwos(256)},exports.toUnsigned=function(num){return new Buffer(num.toTwos(256).toArray())},exports.sha3=function(a,bytes){a=exports.toBuffer(a),bytes||(bytes=256);var h=new SHA3(bytes);return a&&h.update(a),new Buffer(h.digest("hex"),"hex")},exports.sha256=function(a){return a=exports.toBuffer(a),createHash("sha256").update(a).digest()},exports.ripemd160=function(a,padded){a=exports.toBuffer(a);var hash=createHash("rmd160").update(a).digest();return padded===!0?exports.setLength(hash,32):hash},exports.rlphash=function(a){return exports.sha3(rlp.encode(a))},exports.isValidPrivate=function(privateKey){return secp256k1.privateKeyVerify(privateKey)},exports.isValidPublic=function(publicKey,sanitize){return 64===publicKey.length?secp256k1.publicKeyVerify(Buffer.concat([new Buffer([4]),publicKey])):!!sanitize&&secp256k1.publicKeyVerify(publicKey)},exports.pubToAddress=exports.publicToAddress=function(pubKey,sanitize){return pubKey=exports.toBuffer(pubKey),sanitize&&64!==pubKey.length&&(pubKey=secp256k1.publicKeyConvert(pubKey,!1).slice(1)),assert(64===pubKey.length),exports.sha3(pubKey).slice(-20)};var privateToPublic=exports.privateToPublic=function(privateKey){return privateKey=exports.toBuffer(privateKey),secp256k1.publicKeyCreate(privateKey,!1).slice(1)};exports.importPublic=function(publicKey){return publicKey=exports.toBuffer(publicKey),64!==publicKey.length&&(publicKey=secp256k1.publicKeyConvert(publicKey,!1).slice(1)),publicKey},exports.ecsign=function(msgHash,privateKey){var sig=secp256k1.sign(msgHash,privateKey),ret={};return ret.r=sig.signature.slice(0,32),ret.s=sig.signature.slice(32,64),ret.v=sig.recovery+27,ret},exports.ecrecover=function(msgHash,v,r,s){var signature=Buffer.concat([exports.setLength(r,32),exports.setLength(s,32)],64),recovery=exports.bufferToInt(v)-27;if(0!==recovery&&1!==recovery)throw new Error("Invalid signature v value");var senderPubKey=secp256k1.recover(msgHash,signature,recovery);return secp256k1.publicKeyConvert(senderPubKey,!1).slice(1)},exports.toRpcSig=function(v,r,s){return exports.bufferToHex(Buffer.concat([r,s,exports.toBuffer(v-27)]))},exports.fromRpcSig=function(sig){sig=exports.toBuffer(sig);var v=sig[64];return v<27&&(v+=27),{v:v,r:sig.slice(0,32),s:sig.slice(32,64)}},exports.privateToAddress=function(privateKey){return exports.publicToAddress(privateToPublic(privateKey))},exports.isValidAddress=function(address){return/^0x[0-9a-fA-F]{40}$/i.test(address)},exports.toChecksumAddress=function(address){address=exports.stripHexPrefix(address).toLowerCase();for(var hash=exports.sha3(address).toString("hex"),ret="0x",i=0;i=8?address[i].toUpperCase():address[i];return ret},exports.isValidChecksumAddress=function(address){return exports.isValidAddress(address)&&exports.toChecksumAddress(address)===address},exports.generateAddress=function(from,nonce){return from=exports.toBuffer(from),nonce=new BN(nonce),nonce=nonce.isZero()?null:new Buffer(nonce.toArray()),exports.rlphash([from,nonce]).slice(-20)},exports.isPrecompiled=function(address){var a=exports.unpad(address);return 1===a.length&&a[0]>0&&a[0]<5},exports.isHexPrefixed=function(str){return"0x"===str.slice(0,2)},exports.stripHexPrefix=function(str){return"string"!=typeof str?str:exports.isHexPrefixed(str)?str.slice(2):str},exports.addHexPrefix=function(str){return"string"!=typeof str?str:exports.isHexPrefixed(str)?str:"0x"+str},exports.padToEven=function(a){return a.length%2&&(a="0"+a),a},exports.baToJSON=function(ba){if(Buffer.isBuffer(ba))return"0x"+ba.toString("hex");if(ba instanceof Array){for(var array=[],i=0;i=v.length,"The field "+field.name+" must not have more "+field.length+" bytes")):field.allowZero&&0===v.length||!field.length||assert(field.length===v.length,"The field "+field.name+" must have byte length of "+field.length),self.raw[i]=v}self._fields.push(field.name),Object.defineProperty(self,field.name,{enumerable:!0,configurable:!0,get:getter,set:setter}),field.default&&(self[field.name]=field.default),field.alias&&Object.defineProperty(self,field.alias,{enumerable:!1,configurable:!0,set:setter,get:getter})}),data)if("string"==typeof data&&(data=new Buffer(exports.stripHexPrefix(data),"hex")),Buffer.isBuffer(data)&&(data=rlp.decode(data)),Array.isArray(data)){if(data.length>self._fields.length)throw new Error("wrong number of fields in data");data.forEach(function(d,i){self[self._fields[i]]=exports.toBuffer(d)})}else{if("object"!=typeof data)throw new Error("invalid data");for(var prop in data)self._fields.indexOf(prop)!==-1&&(self[prop]=data[prop])}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports){function parse(str){if(str=String(str),!(str.length>100)){var match=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);if(match){var n=parseFloat(match[1]);switch((match[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*y;case"days":case"day":case"d":return n*d;case"hours":case"hour":case"hrs":case"hr":case"h":return n*h;case"minutes":case"minute":case"mins":case"min":case"m":return n*m;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function fmtShort(ms){return ms>=d?Math.round(ms/d)+"d":ms>=h?Math.round(ms/h)+"h":ms>=m?Math.round(ms/m)+"m":ms>=s?Math.round(ms/s)+"s":ms+"ms"}function fmtLong(ms){return plural(ms,d,"day")||plural(ms,h,"hour")||plural(ms,m,"minute")||plural(ms,s,"second")||ms+" ms"}function plural(ms,n,name){if(!(ms0)return parse(val);if("number"===type&&isNaN(val)===!1)return options.long?fmtLong(val):fmtShort(val);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(val))}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function stringToStringTuples(str){const tuples=[],parts=str.split("/").slice(1);if(1===parts.length&&""===parts[0])return[];for(let p=0;p=parts.length)throw ParseError("invalid address: "+str);tuples.push([part,parts[p]])}else tuples.push([part])}return tuples}function stringTuplesToString(tuples){const parts=[];return map(tuples,function(tup){const proto=protoFromTuple(tup);parts.push(proto.name),tup.length>1&&parts.push(tup[1])}),"/"+parts.join("/")}function stringTuplesToTuples(tuples){return map(tuples,function(tup){Array.isArray(tup)||(tup=[tup]);const proto=protoFromTuple(tup);return tup.length>1?[proto.code,convert.toBuffer(proto.code,tup[1])]:[proto.code]})}function tuplesToStringTuples(tuples){return map(tuples,function(tup){const proto=protoFromTuple(tup);return tup.length>1?[proto.code,convert.toString(proto.code,tup[1])]:[proto.code]})}function tuplesToBuffer(tuples){return fromBuffer(Buffer.concat(map(tuples,function(tup){const proto=protoFromTuple(tup);let buf=new Buffer(varint.encode(proto.code));return tup.length>1&&(buf=Buffer.concat([buf,tup[1]])),buf})))}function sizeForAddr(p,addr){if(p.size>0)return p.size/8;if(0===p.size)return 0;{const size=varint.decode(addr);return size+varint.decode.bytes}}function bufferToTuples(buf){const tuples=[];let i=0;for(;ibuf.length)throw ParseError("Invalid address buffer: "+buf.toString("hex"));tuples.push([code,addr])}else tuples.push([code]),i+=n}return tuples}function bufferToString(buf){return stringTuplesToString(tuplesToStringTuples(bufferToTuples(buf)))}function stringToBuffer(str){return str=cleanPath(str),tuplesToBuffer(stringTuplesToTuples(stringToStringTuples(str)))}function fromString(str){return stringToBuffer(str)}function fromBuffer(buf){const err=validateBuffer(buf);if(err)throw err;return new Buffer(buf)}function validateBuffer(buf){try{bufferToTuples(buf)}catch(err){return err}}function isValidBuffer(buf){return void 0===validateBuffer(buf)}function cleanPath(str){return"/"+filter(str.trim().split("/")).join("/")}function ParseError(str){return new Error("Error parsing address: "+str)}function protoFromTuple(tup){return protocols(tup[0])}const map=__webpack_require__(148),filter=__webpack_require__(627),convert=__webpack_require__(680),protocols=__webpack_require__(151),varint=__webpack_require__(16);module.exports={stringToStringTuples:stringToStringTuples,stringTuplesToString:stringTuplesToString,tuplesToStringTuples:tuplesToStringTuples,stringTuplesToTuples:stringTuplesToTuples,bufferToTuples:bufferToTuples,tuplesToBuffer:tuplesToBuffer,bufferToString:bufferToString,stringToBuffer:stringToBuffer,fromString:fromString,fromBuffer:fromBuffer,validateBuffer:validateBuffer,isValidBuffer:isValidBuffer,cleanPath:cleanPath,ParseError:ParseError,protoFromTuple:protoFromTuple,sizeForAddr:sizeForAddr}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function Convert(proto,a){return a instanceof Buffer?Convert.toString(proto,a):Convert.toBuffer(proto,a)}function port2buf(port){const buf=new Buffer(2);return buf.writeUInt16BE(port,0),buf}function buf2port(buf){return buf.readUInt16BE(0)}function str2buf(str){const buf=new Buffer(str),size=new Buffer(varint.encode(buf.length));return Buffer.concat([size,buf])}function buf2str(buf){const size=varint.decode(buf);if(buf=buf.slice(varint.decode.bytes),buf.length!==size)throw new Error("inconsistent lengths");return buf.toString()}function mh2buf(hash){const mh=new Buffer(bs58.decode(hash)),size=new Buffer(varint.encode(mh.length));return Buffer.concat([size,mh])}function buf2mh(buf){const size=varint.decode(buf),address=buf.slice(varint.decode.bytes);if(address.length!==size)throw new Error("inconsistent lengths");return bs58.encode(address)}const ip=__webpack_require__(457),protocols=__webpack_require__(151),bs58=__webpack_require__(24),varint=__webpack_require__(16);module.exports=Convert,Convert.toString=function(proto,buf){switch(proto=protocols(proto),proto.code){case 4:case 41:return ip.toString(buf);case 6:case 17:case 33:case 132:return buf2port(buf);case 53:case 54:case 55:return buf2str(buf);case 421:return buf2mh(buf);default:return buf.toString("hex")}},Convert.toBuffer=function(proto,str){switch(proto=protocols(proto),proto.code){case 4:case 41:return ip.toBuffer(str);case 6:case 17:case 33:case 132:return port2buf(parseInt(str,10));case 53:case 54:case 55:return str2buf(str);case 421:return mh2buf(str);default:return new Buffer(str,"hex")}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";class Base{constructor(name,code,implementation,alphabet){this.name=name,this.code=code,this.alphabet=alphabet,implementation&&alphabet&&(this.engine=implementation(alphabet))}encode(stringOrBuffer){return this.engine.encode(stringOrBuffer)}decode(stringOrBuffer){return this.engine.decode(stringOrBuffer)}isImplemented(){return this.engine}}module.exports=Base},function(module,exports,__webpack_require__){"use strict";(function(Buffer){module.exports=function(alphabet){return{encode(input){return"string"==typeof input?new Buffer(input).toString("hex"):input.toString("hex")},decode(input){for(let char of input)if(alphabet.indexOf(char)<0)throw new Error("invalid base16 character");return new Buffer(input,"hex")}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const Base=__webpack_require__(681),baseX=__webpack_require__(359),base16=__webpack_require__(682),constants=[["base1","1","","1"],["base2","0",baseX,"01"],["base8","7",baseX,"01234567"],["base10","9",baseX,"0123456789"],["base16","f",base16,"0123456789abcdef"],["base32hex","v",baseX,"0123456789abcdefghijklmnopqrstuv"],["base32","b",baseX,"abcdefghijklmnopqrstuvwxyz234567"],["base32z","h",baseX,"ybndrfg8ejkmcpqxot1uwisza345h769"],["base58flickr","Z",baseX,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base58btc","z",baseX,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base64","m",baseX,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64url","u",baseX,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"]],names=constants.reduce((prev,tupple)=>{return prev[tupple[0]]=new Base(tupple[0],tupple[1],tupple[2],tupple[3]),prev},{}),codes=constants.reduce((prev,tupple)=>{return prev[tupple[1]]=names[tupple[0]],prev},{});module.exports={names:names,codes:codes}},function(module,exports,__webpack_require__){"use strict";exports.names={sha1:17,"sha2-256":18,"sha2-512":19,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,"murmur3-128":34,"murmur3-32":35,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664},exports.codes={17:"sha1",18:"sha2-256",19:"sha2-512",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384", -29:"keccak-512",34:"murmur3-128",35:"murmur3-32",45569:"blake2b-8",45570:"blake2b-16",45571:"blake2b-24",45572:"blake2b-32",45573:"blake2b-40",45574:"blake2b-48",45575:"blake2b-56",45576:"blake2b-64",45577:"blake2b-72",45578:"blake2b-80",45579:"blake2b-88",45580:"blake2b-96",45581:"blake2b-104",45582:"blake2b-112",45583:"blake2b-120",45584:"blake2b-128",45585:"blake2b-136",45586:"blake2b-144",45587:"blake2b-152",45588:"blake2b-160",45589:"blake2b-168",45590:"blake2b-176",45591:"blake2b-184",45592:"blake2b-192",45593:"blake2b-200",45594:"blake2b-208",45595:"blake2b-216",45596:"blake2b-224",45597:"blake2b-232",45598:"blake2b-240",45599:"blake2b-248",45600:"blake2b-256",45601:"blake2b-264",45602:"blake2b-272",45603:"blake2b-280",45604:"blake2b-288",45605:"blake2b-296",45606:"blake2b-304",45607:"blake2b-312",45608:"blake2b-320",45609:"blake2b-328",45610:"blake2b-336",45611:"blake2b-344",45612:"blake2b-352",45613:"blake2b-360",45614:"blake2b-368",45615:"blake2b-376",45616:"blake2b-384",45617:"blake2b-392",45618:"blake2b-400",45619:"blake2b-408",45620:"blake2b-416",45621:"blake2b-424",45622:"blake2b-432",45623:"blake2b-440",45624:"blake2b-448",45625:"blake2b-456",45626:"blake2b-464",45627:"blake2b-472",45628:"blake2b-480",45629:"blake2b-488",45630:"blake2b-496",45631:"blake2b-504",45632:"blake2b-512",45633:"blake2s-8",45634:"blake2s-16",45635:"blake2s-24",45636:"blake2s-32",45637:"blake2s-40",45638:"blake2s-48",45639:"blake2s-56",45640:"blake2s-64",45641:"blake2s-72",45642:"blake2s-80",45643:"blake2s-88",45644:"blake2s-96",45645:"blake2s-104",45646:"blake2s-112",45647:"blake2s-120",45648:"blake2s-128",45649:"blake2s-136",45650:"blake2s-144",45651:"blake2s-152",45652:"blake2s-160",45653:"blake2s-168",45654:"blake2s-176",45655:"blake2s-184",45656:"blake2s-192",45657:"blake2s-200",45658:"blake2s-208",45659:"blake2s-216",45660:"blake2s-224",45661:"blake2s-232",45662:"blake2s-240",45663:"blake2s-248",45664:"blake2s-256"},exports.defaultLengths={17:20,18:32,19:64,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,45569:1,45570:2,45571:3,45572:4,45573:5,45574:6,45575:7,45576:8,45577:9,45578:10,45579:11,45580:12,45581:13,45582:14,45583:15,45584:16,45585:17,45586:18,45587:19,45588:20,45589:21,45590:22,45591:23,45592:24,45593:25,45594:26,45595:27,45596:28,45597:29,45598:30,45599:31,45600:32,45601:33,45602:34,45603:35,45604:36,45605:37,45606:38,45607:39,45608:40,45609:41,45610:42,45611:43,45612:44,45613:45,45614:46,45615:47,45616:48,45617:49,45618:50,45619:51,45620:52,45621:53,45622:54,45623:55,45624:56,45625:57,45626:58,45627:59,45628:60,45629:61,45630:62,45631:63,45632:64,45633:1,45634:2,45635:3,45636:4,45637:5,45638:6,45639:7,45640:8,45641:9,45642:10,45643:11,45644:12,45645:13,45646:14,45647:15,45648:16,45649:17,45650:18,45651:19,45652:20,45653:21,45654:22,45655:23,45656:24,45657:25,45658:26,45659:27,45660:28,45661:29,45662:30,45663:31,45664:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const blake=__webpack_require__(366),toCallback=__webpack_require__(280).toCallback,blake2b={init:blake.blake2bInit,update:blake.blake2bUpdate,digest:blake.blake2bFinal},blake2s={init:blake.blake2sInit,update:blake.blake2sUpdate,digest:blake.blake2sFinal},makeB2Hash=(size,hf)=>toCallback(buf=>{const ctx=hf.init(size,null);return hf.update(ctx,buf),new Buffer(hf.digest(ctx))});module.exports=(table=>{for(let i=0;i<64;i++)table[45569+i]=makeB2Hash(i+1,blake2b);for(let i=0;i<32;i++)table[45633+i]=makeB2Hash(i+1,blake2s)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function webCryptoHash(type){if(!webCrypto)throw new Error("Please use a browser with webcrypto support");return(data,callback)=>{const res=webCrypto.digest({name:type},data);if("function"!=typeof res.then)return res.onerror=(()=>{callback(`Error hashing data using ${type}`)}),void(res.oncomplete=(e=>{callback(null,e.target.result)}));nodeify(res.then(raw=>new Buffer(new Uint8Array(raw))),callback)}}function sha1(buf,callback){webCryptoHash("SHA-1")(buf,callback)}function sha2256(buf,callback){webCryptoHash("SHA-256")(buf,callback)}function sha2512(buf,callback){webCryptoHash("SHA-512")(buf,callback)}const nodeify=__webpack_require__(81),webCrypto=function(){return self.crypto?self.crypto.subtle||self.crypto.webkitSubtle:self.msCrypto?self.msCrypto.subtle:void 0}();module.exports={sha1:sha1,sha2256:sha2256,sha2512:sha2512}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const sha3=__webpack_require__(237),murmur3=__webpack_require__(702),utils=__webpack_require__(280),sha=__webpack_require__(686),toCallback=utils.toCallback,toBuf=utils.toBuf,fromString=utils.fromString,fromNumberTo32BitBuf=utils.fromNumberTo32BitBuf;module.exports={sha1:sha.sha1,sha2256:sha.sha2256,sha2512:sha.sha2512,sha3512:toCallback(toBuf(sha3.sha3_512)),sha3384:toCallback(toBuf(sha3.sha3_384)),sha3256:toCallback(toBuf(sha3.sha3_256)),sha3224:toCallback(toBuf(sha3.sha3_224)),shake128:toCallback(toBuf(sha3.shake_128,256)),shake256:toCallback(toBuf(sha3.shake_256,512)),keccak224:toCallback(toBuf(sha3.keccak_224)),keccak256:toCallback(toBuf(sha3.keccak_256)),keccak384:toCallback(toBuf(sha3.keccak_384)),keccak512:toCallback(toBuf(sha3.keccak_512)),murmur3128:toCallback(toBuf(fromString(murmur3.x64.hash128))),murmur332:toCallback(fromNumberTo32BitBuf(fromString(murmur3.x86.hash32))),addBlake:__webpack_require__(685)}},function(module,exports,__webpack_require__){"use strict";function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}module.exports=PassThrough;var Transform=__webpack_require__(282),util=__webpack_require__(6);util.inherits=__webpack_require__(1),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},function(module,exports,__webpack_require__){"use strict";function BufferList(){this.head=null,this.tail=null,this.length=0}var bufferShim=(__webpack_require__(0).Buffer,__webpack_require__(14));module.exports=BufferList,BufferList.prototype.push=function(v){var entry={data:v,next:null};this.length>0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};0===this.length&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(0!==this.length){var ret=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s){if(0===this.length)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s+p.data;return ret},BufferList.prototype.concat=function(n){if(0===this.length)return bufferShim.alloc(0);if(1===this.length)return this.head.data;for(var ret=bufferShim.allocUnsafe(n>>>0),p=this.head,i=0;p;)p.data.copy(ret,i),i+=p.data.length,p=p.next;return ret}},function(module,exports){function read(buf,offset){var b,res=0,offset=offset||0,shift=0,counter=offset,l=buf.length;do{if(counter>=l)return read.bytes=0,void(read.bytesRead=0);b=buf[counter++],res+=shift<28?(b&REST)<=MSB);return read.bytes=counter-offset,res}module.exports=read;var MSB=128,REST=127},function(module,exports){function encode(num,out,offset){out=out||[],offset=offset||0;for(var oldOffset=offset;num>=INT;)out[offset++]=255&num|MSB,num/=128;for(;num&MSBALL;)out[offset++]=255&num|MSB,num>>>=7;return out[offset]=0|num,encode.bytes=offset-oldOffset+1,out}module.exports=encode;var MSB=128,MSBALL=-128,INT=Math.pow(2,31)},function(module,exports,__webpack_require__){module.exports={encode:__webpack_require__(691),decode:__webpack_require__(690),encodingLength:__webpack_require__(693)}},function(module,exports){var N1=Math.pow(2,7),N2=Math.pow(2,14),N3=Math.pow(2,21),N4=Math.pow(2,28),N5=Math.pow(2,35),N6=Math.pow(2,42),N7=Math.pow(2,49),N8=Math.pow(2,56),N9=Math.pow(2,63);module.exports=function(value){return value{this.log("end"),this._read(),this.destroyed||(ended=!0,finished?this._finalize():this.halfOpen||this.end())}),this.once("finish",function onfinish(){if(!this.destroyed){if(!this._opened)return this.once("open",onfinish);this._lazy&&this.initiator&&this._open(),this._multiplex._send(this.channel<<3|(this.initiator?4:3),null),finished=!0,ended&&this._finalize()}})}destroy(err){this._destroy(err,!0)}_destroy(err,local){if(this.log("_destroy:"+(local?"local":"remote")),this.destroyed)return void this.log("already destroyed");this.destroyed=!0;const hasErrorListeners=EventEmitter.listenerCount(this,"error")>0;if(!err||local&&!hasErrorListeners||this.emit("error",err),this.emit("close"),local&&this._opened){this._lazy&&this.initiator&&this._open();const msg=err?new Buffer(err.message):null;try{this._multiplex._send(this.channel<<3|(this.initiator?6:5),msg)}catch(e){}}this._finalize()}_finalize(){this.finalized||(this.finalized=!0,this.emit("finalize"))}_write(data,enc,cb){return this.log("write: ",data.length),this._opened?this.destroyed?void cb():(this._lazy&&this.initiator&&this._open(),this._multiplex._send(this._dataHeader,data)?void cb():void this._multiplex._ondrain.push(cb)):void this.once("open",()=>{this._write(data,enc,cb)})}_read(){if(this._awaitDrain){const drained=this._awaitDrain;this._awaitDrain=0,this._multiplex._onchanneldrain(drained)}}_open(){let buf=null;Buffer.isBuffer(this.name)?buf=this.name:this.name!==this.channel.toString()&&(buf=new Buffer(this.name)),this._lazy=!1,this._multiplex._send(this.channel<<3|0,buf)}open(channel,initiator){this.log("open: "+channel),this.channel=channel,this.initiator=initiator,this._dataHeader=channel<<3|(initiator?2:1),this._opened=!0,!this._lazy&&this.initiator&&this._open(),this.emit("open")}}module.exports=Channel}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const stream=__webpack_require__(285),varint=__webpack_require__(692),duplexify=__webpack_require__(396),debug=__webpack_require__(3),Channel=__webpack_require__(694),SIGNAL_FLUSH=new Buffer([0]),empty=new Buffer(0);let pool=new Buffer(10240),used=0;class Multiplex extends stream.Duplex{constructor(opts,onchannel){super(),"function"==typeof opts&&(onchannel=opts,opts={}),opts||(opts={}),onchannel&&this.on("stream",onchannel),this.destroyed=!1,this.limit=opts.limit||0,null==opts.initiator&&(opts.initiator=!0),this.initiator=opts.initiator,this._corked=0,this._options=opts,this._binaryName=Boolean(opts.binaryName),this._local=[],this._remote=[],this._list=this._local,this._receiving=null,this._chunked=!1,this._state=0,this._type=0,this._channel=0,this._missing=0,this._message=null,this.log=debug("mplex:main:"+Math.floor(1e5*Math.random())),this.log("construction");let bufSize=100;this.limit&&(bufSize=varint.encodingLength(this.limit)),this._buf=new Buffer(bufSize),this._ptr=0,this._awaitChannelDrains=0,this._onwritedrain=null,this._ondrain=[],this._finished=!1,this.once("finish",this._clear),this._nextId=this.initiator?0:1}_nextStreamId(){let id=this._nextId;return this._nextId+=2,id}createStream(name,opts){if(this.destroyed)throw new Error("Multiplexer is destroyed");const id=this._nextStreamId();let channelName=this._name(name||id.toString());const options=Object.assign(this._options,opts);this.log("createStream: %s",id,channelName.toString(),options);const channel=new Channel(channelName,this,options);return this._addChannel(channel,id,this._local)}receiveStream(name,opts){if(this.destroyed)throw new Error("Multiplexer is destroyed");if(void 0===name||null===name)throw new Error("Name is needed when receiving a stream");const channelName=this._name(name);this.log("receiveStream: "+channelName.toString());const channel=new Channel(channelName,this,Object.assign(this._options,opts));if(this._receiving||(this._receiving={}),this._receiving[channel.name])throw new Error("You are already receiving this stream");return this._receiving[channel.name]=channel,channel}createSharedStream(name,opts){return this.log("createSharedStream"),duplexify(this.createStream(name,Object.assign(opts,{lazy:!0})),this.receiveStream(name,opts))}_name(name){return this._binaryName?Buffer.isBuffer(name)?name:new Buffer(name):name.toString()}_send(header,data){const len=data?data.length:0,oldUsed=used;let drained=!0;return this.log("_send",header,len),varint.encode(header,pool,used),used+=varint.encode.bytes,varint.encode(len,pool,used),used+=varint.encode.bytes,drained=this.push(pool.slice(oldUsed,used)),pool.length-used<100&&(pool=new Buffer(10240),used=0),data&&(drained=this.push(data)),drained}_addChannel(channel,id,list){return this.log("_addChannel",id),list[id]=channel,channel.on("finalize",()=>{this.log("_remove channel",id),list[id]=null}),channel.open(id,list===this._local),channel}_writeVarint(data,offset){for(offset;offset>3,this._list=1&this._type?this._local:this._remote;const chunked=this._list.length>this._channel&&this._list[this._channel]&&this._list[this._channel].chunked;this._chunked=!(1!==this._type&&2!==this._type)&&chunked}else if(this._missing=varint.decode(this._buf),this.limit&&this._missing>this.limit)return this._lengthError(data);return this._state++,this._ptr=0,offset+1}}return data.length}_lengthError(data){return this.destroy(new Error("Incoming message is too big")),data.length}_writeMessage(data,offset){const free=data.length-offset,missing=this._missing;if(!this._message){if(missing<=free)return this._missing=0,this._push(data.slice(offset,offset+missing)),offset+missing;if(this._chunked)return this._missing-=free,this._push(data.slice(offset,data.length)),data.length;this._message=new Buffer(missing)}return data.copy(this._message,this._ptr,offset,offset+missing),missing<=free?(this._missing=0,this._push(this._message),offset+missing):(this._missing-=free,this._ptr+=free,data.length)}_push(data){if(this.log("_push",data.length),this._missing||(this._ptr=0,this._state=0,this._message=null),0===this._type){if(this.log("open",this._channel),this.destroyed||this._finished)return;let name;name=this._binaryName?data:data.toString()||this._channel.toString(),this.log("open name",name);let channel;return void(this._receiving&&this._receiving[name]?(channel=this._receiving[name],delete this._receiving[name],this._addChannel(channel,this._channel,this._list)):(channel=new Channel(name,this,this._options),this.emit("stream",this._addChannel(channel,this._channel,this._list),channel.name)))}const stream=this._list[this._channel];if(stream)switch(this._type){case 5:case 6:const error=new Error(data.toString()||"Channel destroyed");return void stream._destroy(error,!1);case 3:case 4:return void stream.push(null);case 1:case 2:return void(stream.push(data)||(this._awaitChannelDrains++,stream._awaitDrain++))}}_onchanneldrain(drained){if(this._awaitChannelDrains-=drained,!this._awaitChannelDrains){const ondrain=this._onwritedrain;this._onwritedrain=null,ondrain&&ondrain()}}_write(data,enc,cb){if(this.log("_write",data.length),this._finished)return void cb();if(this._corked)return void this._onuncork(this._write.bind(this,data,enc,cb));if(data===SIGNAL_FLUSH)return void this._finish(cb);let offset=0;for(;offset{this._writableState.prefinished===!1&&(this._writableState.prefinished=!0),this.emit("prefinish"),this._onuncork(cb)})}cork(){1==++this._corked&&this.emit("cork")}uncork(){this._corked&&0==--this._corked&&this.emit("uncork")}end(data,enc,cb){return this.log("end"),"function"==typeof data&&(cb=data,data=void 0),"function"==typeof enc&&(cb=enc,enc=void 0),data&&this.write(data),this._writableState.ending||this.write(SIGNAL_FLUSH),stream.Writable.prototype.end.call(this,cb)}_onuncork(fn){if(this._corked)return void this.once("uncork",fn);fn()}_read(){for(;this._ondrain.length;)this._ondrain.shift()()}_clear(){if(this.log("_clear"),!this._finished){this._finished=!0;const list=this._local.concat(this._remote);this._local=[],this._remote=[],list.forEach(function(stream){stream&&stream._destroy(null,!1)}),this.push(null)}}finalize(){this._clear()}destroy(err){if(this.log("destroy"),this.destroyed)return void this.log("already destroyed");var list=this._local.concat(this._remote);this.destroyed=!0,err&&this.emit("error",err),this.emit("close"),list.forEach(function(stream){stream&&stream.emit("error",err||new Error("underlying socket has been closed"))}),this._clear()}}module.exports=Multiplex}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(process){function parse(version,loose){if(version instanceof SemVer)return version;if("string"!=typeof version)return null;if(version.length>MAX_LENGTH)return null;if(!(loose?re[LOOSE]:re[FULL]).test(version))return null;try{return new SemVer(version,loose)}catch(er){return null}}function valid(version,loose){var v=parse(version,loose);return v?v.version:null}function clean(version,loose){var s=parse(version.trim().replace(/^[=v]+/,""),loose);return s?s.version:null}function SemVer(version,loose){if(version instanceof SemVer){if(version.loose===loose)return version;version=version.version}else if("string"!=typeof version)throw new TypeError("Invalid Version: "+version);if(version.length>MAX_LENGTH)throw new TypeError("version is longer than "+MAX_LENGTH+" characters");if(!(this instanceof SemVer))return new SemVer(version,loose);debug("SemVer",version,loose),this.loose=loose;var m=version.trim().match(loose?re[LOOSE]:re[FULL]);if(!m)throw new TypeError("Invalid Version: "+version);if(this.raw=version,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>MAX_SAFE_INTEGER||this.major<0)throw new TypeError("Invalid major version");if(this.minor>MAX_SAFE_INTEGER||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>MAX_SAFE_INTEGER||this.patch<0)throw new TypeError("Invalid patch version");m[4]?this.prerelease=m[4].split(".").map(function(id){if(/^[0-9]+$/.test(id)){var num=+id;if(num>=0&&numb?1:0}function rcompareIdentifiers(a,b){return compareIdentifiers(b,a)}function major(a,loose){return new SemVer(a,loose).major}function minor(a,loose){return new SemVer(a,loose).minor}function patch(a,loose){return new SemVer(a,loose).patch}function compare(a,b,loose){return new SemVer(a,loose).compare(b)}function compareLoose(a,b){return compare(a,b,!0)}function rcompare(a,b,loose){return compare(b,a,loose)}function sort(list,loose){return list.sort(function(a,b){return exports.compare(a,b,loose)})}function rsort(list,loose){return list.sort(function(a,b){return exports.rcompare(a,b,loose)})}function gt(a,b,loose){return compare(a,b,loose)>0}function lt(a,b,loose){return compare(a,b,loose)<0}function eq(a,b,loose){return 0===compare(a,b,loose)}function neq(a,b,loose){return 0!==compare(a,b,loose)}function gte(a,b,loose){return compare(a,b,loose)>=0}function lte(a,b,loose){return compare(a,b,loose)<=0}function cmp(a,op,b,loose){var ret;switch(op){case"===":"object"==typeof a&&(a=a.version),"object"==typeof b&&(b=b.version),ret=a===b;break;case"!==":"object"==typeof a&&(a=a.version),"object"==typeof b&&(b=b.version),ret=a!==b;break;case"":case"=":case"==":ret=eq(a,b,loose);break;case"!=":ret=neq(a,b,loose);break;case">":ret=gt(a,b,loose);break;case">=":ret=gte(a,b,loose);break;case"<":ret=lt(a,b,loose);break;case"<=":ret=lte(a,b,loose);break;default:throw new TypeError("Invalid operator: "+op)}return ret}function Comparator(comp,loose){if(comp instanceof Comparator){if(comp.loose===loose)return comp;comp=comp.value}if(!(this instanceof Comparator))return new Comparator(comp,loose);debug("comparator",comp,loose),this.loose=loose,this.parse(comp),this.semver===ANY?this.value="":this.value=this.operator+this.semver.version,debug("comp",this)}function Range(range,loose){if(range instanceof Range&&range.loose===loose)return range;if(!(this instanceof Range))return new Range(range,loose);if(this.loose=loose,this.raw=range,this.set=range.split(/\s*\|\|\s*/).map(function(range){return this.parseRange(range.trim())},this).filter(function(c){return c.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+range);this.format()}function toComparators(range,loose){return new Range(range,loose).set.map(function(comp){return comp.map(function(c){return c.value}).join(" ").trim().split(" ")})}function parseComparator(comp,loose){return debug("comp",comp),comp=replaceCarets(comp,loose),debug("caret",comp),comp=replaceTildes(comp,loose),debug("tildes",comp),comp=replaceXRanges(comp,loose),debug("xrange",comp),comp=replaceStars(comp,loose),debug("stars",comp),comp}function isX(id){return!id||"x"===id.toLowerCase()||"*"===id}function replaceTildes(comp,loose){return comp.trim().split(/\s+/).map(function(comp){return replaceTilde(comp,loose)}).join(" ")}function replaceTilde(comp,loose){var r=loose?re[TILDELOOSE]:re[TILDE];return comp.replace(r,function(_,M,m,p,pr){debug("tilde",comp,_,M,m,p,pr);var ret;return isX(M)?ret="":isX(m)?ret=">="+M+".0.0 <"+(+M+1)+".0.0":isX(p)?ret=">="+M+"."+m+".0 <"+M+"."+(+m+1)+".0":pr?(debug("replaceTilde pr",pr),"-"!==pr.charAt(0)&&(pr="-"+pr),ret=">="+M+"."+m+"."+p+pr+" <"+M+"."+(+m+1)+".0"):ret=">="+M+"."+m+"."+p+" <"+M+"."+(+m+1)+".0",debug("tilde return",ret),ret})}function replaceCarets(comp,loose){return comp.trim().split(/\s+/).map(function(comp){return replaceCaret(comp,loose)}).join(" ")}function replaceCaret(comp,loose){debug("caret",comp,loose);var r=loose?re[CARETLOOSE]:re[CARET];return comp.replace(r,function(_,M,m,p,pr){debug("caret",comp,_,M,m,p,pr);var ret;return isX(M)?ret="":isX(m)?ret=">="+M+".0.0 <"+(+M+1)+".0.0":isX(p)?ret="0"===M?">="+M+"."+m+".0 <"+M+"."+(+m+1)+".0":">="+M+"."+m+".0 <"+(+M+1)+".0.0":pr?(debug("replaceCaret pr",pr),"-"!==pr.charAt(0)&&(pr="-"+pr),ret="0"===M?"0"===m?">="+M+"."+m+"."+p+pr+" <"+M+"."+m+"."+(+p+1):">="+M+"."+m+"."+p+pr+" <"+M+"."+(+m+1)+".0":">="+M+"."+m+"."+p+pr+" <"+(+M+1)+".0.0"):(debug("no pr"),ret="0"===M?"0"===m?">="+M+"."+m+"."+p+" <"+M+"."+m+"."+(+p+1):">="+M+"."+m+"."+p+" <"+M+"."+(+m+1)+".0":">="+M+"."+m+"."+p+" <"+(+M+1)+".0.0"),debug("caret return",ret),ret})}function replaceXRanges(comp,loose){return debug("replaceXRanges",comp,loose),comp.split(/\s+/).map(function(comp){return replaceXRange(comp,loose)}).join(" ")}function replaceXRange(comp,loose){comp=comp.trim();var r=loose?re[XRANGELOOSE]:re[XRANGE];return comp.replace(r,function(ret,gtlt,M,m,p,pr){debug("xRange",comp,ret,gtlt,M,m,p,pr);var xM=isX(M),xm=xM||isX(m),xp=xm||isX(p),anyX=xp;return"="===gtlt&&anyX&&(gtlt=""),xM?ret=">"===gtlt||"<"===gtlt?"<0.0.0":"*":gtlt&&anyX?(xm&&(m=0),xp&&(p=0),">"===gtlt?(gtlt=">=",xm?(M=+M+1,m=0,p=0):xp&&(m=+m+1,p=0)):"<="===gtlt&&(gtlt="<",xm?M=+M+1:m=+m+1),ret=gtlt+M+"."+m+"."+p):xm?ret=">="+M+".0.0 <"+(+M+1)+".0.0":xp&&(ret=">="+M+"."+m+".0 <"+M+"."+(+m+1)+".0"),debug("xRange return",ret),ret})}function replaceStars(comp,loose){return debug("replaceStars",comp,loose),comp.trim().replace(re[STAR],"")}function hyphenReplace($0,from,fM,fm,fp,fpr,fb,to,tM,tm,tp,tpr,tb){return from=isX(fM)?"":isX(fm)?">="+fM+".0.0":isX(fp)?">="+fM+"."+fm+".0":">="+from,to=isX(tM)?"":isX(tm)?"<"+(+tM+1)+".0.0":isX(tp)?"<"+tM+"."+(+tm+1)+".0":tpr?"<="+tM+"."+tm+"."+tp+"-"+tpr:"<="+to,(from+" "+to).trim()}function testSet(set,version){for(var i=0;i0){var allowed=set[i].semver;if(allowed.major===version.major&&allowed.minor===version.minor&&allowed.patch===version.patch)return!0}return!1}return!0}function satisfies(version,range,loose){try{range=new Range(range,loose)}catch(er){return!1}return range.test(version)}function maxSatisfying(versions,range,loose){return versions.filter(function(version){return satisfies(version,range,loose)}).sort(function(a,b){return rcompare(a,b,loose)})[0]||null}function minSatisfying(versions,range,loose){return versions.filter(function(version){return satisfies(version,range,loose)}).sort(function(a,b){return compare(a,b,loose)})[0]||null}function validRange(range,loose){try{return new Range(range,loose).range||"*"}catch(er){return null}}function ltr(version,range,loose){return outside(version,range,"<",loose)}function gtr(version,range,loose){return outside(version,range,">",loose)}function outside(version,range,hilo,loose){version=new SemVer(version,loose),range=new Range(range,loose);var gtfn,ltefn,ltfn,comp,ecomp;switch(hilo){case">":gtfn=gt,ltefn=lte,ltfn=lt,comp=">",ecomp=">=";break;case"<":gtfn=lt,ltefn=gte,ltfn=gt,comp="<",ecomp="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(satisfies(version,range,loose))return!1;for(var i=0;i=0.0.0")),high=high||comparator,low=low||comparator,gtfn(comparator.semver,high.semver,loose)?high=comparator:ltfn(comparator.semver,low.semver,loose)&&(low=comparator)}),high.operator===comp||high.operator===ecomp)return!1;if((!low.operator||low.operator===comp)&<efn(version,low.semver))return!1;if(low.operator===ecomp&<fn(version,low.semver))return!1}return!0}function prerelease(version,loose){var parsed=parse(version,loose);return parsed&&parsed.prerelease.length?parsed.prerelease:null}exports=module.exports=SemVer;var debug;debug="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var args=Array.prototype.slice.call(arguments,0);args.unshift("SEMVER"),console.log.apply(console,args)}:function(){},exports.SEMVER_SPEC_VERSION="2.0.0";var MAX_LENGTH=256,MAX_SAFE_INTEGER=Number.MAX_SAFE_INTEGER||9007199254740991,re=exports.re=[],src=exports.src=[],R=0,NUMERICIDENTIFIER=R++;src[NUMERICIDENTIFIER]="0|[1-9]\\d*";var NUMERICIDENTIFIERLOOSE=R++;src[NUMERICIDENTIFIERLOOSE]="[0-9]+";var NONNUMERICIDENTIFIER=R++;src[NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var MAINVERSION=R++;src[MAINVERSION]="("+src[NUMERICIDENTIFIER]+")\\.("+src[NUMERICIDENTIFIER]+")\\.("+src[NUMERICIDENTIFIER]+")";var MAINVERSIONLOOSE=R++;src[MAINVERSIONLOOSE]="("+src[NUMERICIDENTIFIERLOOSE]+")\\.("+src[NUMERICIDENTIFIERLOOSE]+")\\.("+src[NUMERICIDENTIFIERLOOSE]+")";var PRERELEASEIDENTIFIER=R++;src[PRERELEASEIDENTIFIER]="(?:"+src[NUMERICIDENTIFIER]+"|"+src[NONNUMERICIDENTIFIER]+")";var PRERELEASEIDENTIFIERLOOSE=R++;src[PRERELEASEIDENTIFIERLOOSE]="(?:"+src[NUMERICIDENTIFIERLOOSE]+"|"+src[NONNUMERICIDENTIFIER]+")";var PRERELEASE=R++;src[PRERELEASE]="(?:-("+src[PRERELEASEIDENTIFIER]+"(?:\\."+src[PRERELEASEIDENTIFIER]+")*))";var PRERELEASELOOSE=R++;src[PRERELEASELOOSE]="(?:-?("+src[PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+src[PRERELEASEIDENTIFIERLOOSE]+")*))";var BUILDIDENTIFIER=R++;src[BUILDIDENTIFIER]="[0-9A-Za-z-]+";var BUILD=R++;src[BUILD]="(?:\\+("+src[BUILDIDENTIFIER]+"(?:\\."+src[BUILDIDENTIFIER]+")*))";var FULL=R++,FULLPLAIN="v?"+src[MAINVERSION]+src[PRERELEASE]+"?"+src[BUILD]+"?";src[FULL]="^"+FULLPLAIN+"$";var LOOSEPLAIN="[v=\\s]*"+src[MAINVERSIONLOOSE]+src[PRERELEASELOOSE]+"?"+src[BUILD]+"?",LOOSE=R++;src[LOOSE]="^"+LOOSEPLAIN+"$";var GTLT=R++;src[GTLT]="((?:<|>)?=?)";var XRANGEIDENTIFIERLOOSE=R++;src[XRANGEIDENTIFIERLOOSE]=src[NUMERICIDENTIFIERLOOSE]+"|x|X|\\*";var XRANGEIDENTIFIER=R++;src[XRANGEIDENTIFIER]=src[NUMERICIDENTIFIER]+"|x|X|\\*";var XRANGEPLAIN=R++;src[XRANGEPLAIN]="[v=\\s]*("+src[XRANGEIDENTIFIER]+")(?:\\.("+src[XRANGEIDENTIFIER]+")(?:\\.("+src[XRANGEIDENTIFIER]+")(?:"+src[PRERELEASE]+")?"+src[BUILD]+"?)?)?";var XRANGEPLAINLOOSE=R++;src[XRANGEPLAINLOOSE]="[v=\\s]*("+src[XRANGEIDENTIFIERLOOSE]+")(?:\\.("+src[XRANGEIDENTIFIERLOOSE]+")(?:\\.("+src[XRANGEIDENTIFIERLOOSE]+")(?:"+src[PRERELEASELOOSE]+")?"+src[BUILD]+"?)?)?";var XRANGE=R++;src[XRANGE]="^"+src[GTLT]+"\\s*"+src[XRANGEPLAIN]+"$";var XRANGELOOSE=R++;src[XRANGELOOSE]="^"+src[GTLT]+"\\s*"+src[XRANGEPLAINLOOSE]+"$";var LONETILDE=R++;src[LONETILDE]="(?:~>?)";var TILDETRIM=R++;src[TILDETRIM]="(\\s*)"+src[LONETILDE]+"\\s+",re[TILDETRIM]=new RegExp(src[TILDETRIM],"g");var TILDE=R++;src[TILDE]="^"+src[LONETILDE]+src[XRANGEPLAIN]+"$";var TILDELOOSE=R++;src[TILDELOOSE]="^"+src[LONETILDE]+src[XRANGEPLAINLOOSE]+"$";var LONECARET=R++;src[LONECARET]="(?:\\^)";var CARETTRIM=R++;src[CARETTRIM]="(\\s*)"+src[LONECARET]+"\\s+",re[CARETTRIM]=new RegExp(src[CARETTRIM],"g");var CARET=R++;src[CARET]="^"+src[LONECARET]+src[XRANGEPLAIN]+"$";var CARETLOOSE=R++;src[CARETLOOSE]="^"+src[LONECARET]+src[XRANGEPLAINLOOSE]+"$";var COMPARATORLOOSE=R++;src[COMPARATORLOOSE]="^"+src[GTLT]+"\\s*("+LOOSEPLAIN+")$|^$";var COMPARATOR=R++;src[COMPARATOR]="^"+src[GTLT]+"\\s*("+FULLPLAIN+")$|^$";var COMPARATORTRIM=R++;src[COMPARATORTRIM]="(\\s*)"+src[GTLT]+"\\s*("+LOOSEPLAIN+"|"+src[XRANGEPLAIN]+")",re[COMPARATORTRIM]=new RegExp(src[COMPARATORTRIM],"g");var HYPHENRANGE=R++;src[HYPHENRANGE]="^\\s*("+src[XRANGEPLAIN]+")\\s+-\\s+("+src[XRANGEPLAIN]+")\\s*$";var HYPHENRANGELOOSE=R++;src[HYPHENRANGELOOSE]="^\\s*("+src[XRANGEPLAINLOOSE]+")\\s+-\\s+("+src[XRANGEPLAINLOOSE]+")\\s*$";var STAR=R++;src[STAR]="(<|>)?=?\\s*\\*";for(var i=0;i=0;)"number"==typeof this.prerelease[i]&&(this.prerelease[i]++,i=-2);i===-1&&this.prerelease.push(0)}identifier&&(this.prerelease[0]===identifier?isNaN(this.prerelease[1])&&(this.prerelease=[identifier,0]):this.prerelease=[identifier,0]);break;default:throw new Error("invalid increment argument: "+release)}return this.format(),this.raw=this.version,this},exports.inc=inc,exports.diff=diff,exports.compareIdentifiers=compareIdentifiers;var numeric=/^[0-9]+$/;exports.rcompareIdentifiers=rcompareIdentifiers,exports.major=major,exports.minor=minor,exports.patch=patch,exports.compare=compare,exports.compareLoose=compareLoose,exports.rcompare=rcompare,exports.sort=sort,exports.rsort=rsort,exports.gt=gt,exports.lt=lt,exports.eq=eq,exports.neq=neq,exports.gte=gte,exports.lte=lte,exports.cmp=cmp,exports.Comparator=Comparator;var ANY={};Comparator.prototype.parse=function(comp){var r=this.loose?re[COMPARATORLOOSE]:re[COMPARATOR],m=comp.match(r);if(!m)throw new TypeError("Invalid comparator: "+comp);this.operator=m[1],"="===this.operator&&(this.operator=""),m[2]?this.semver=new SemVer(m[2],this.loose):this.semver=ANY},Comparator.prototype.toString=function(){return this.value},Comparator.prototype.test=function(version){return debug("Comparator.test",version,this.loose),this.semver===ANY||("string"==typeof version&&(version=new SemVer(version,this.loose)),cmp(version,this.operator,this.semver,this.loose))},exports.Range=Range,Range.prototype.format=function(){return this.range=this.set.map(function(comps){return comps.join(" ").trim()}).join("||").trim(),this.range},Range.prototype.toString=function(){return this.range},Range.prototype.parseRange=function(range){var loose=this.loose;range=range.trim(),debug("range",range,loose);var hr=loose?re[HYPHENRANGELOOSE]:re[HYPHENRANGE];range=range.replace(hr,hyphenReplace),debug("hyphen replace",range),range=range.replace(re[COMPARATORTRIM],"$1$2$3"),debug("comparator trim",range,re[COMPARATORTRIM]),range=range.replace(re[TILDETRIM],"$1~"),range=range.replace(re[CARETTRIM],"$1^"),range=range.split(/\s+/).join(" ");var compRe=loose?re[COMPARATORLOOSE]:re[COMPARATOR],set=range.split(" ").map(function(comp){return parseComparator(comp,loose)}).join(" ").split(/\s+/);return this.loose&&(set=set.filter(function(comp){return!!comp.match(compRe)})),set=set.map(function(comp){return new Comparator(comp,loose)})},exports.toComparators=toComparators,Range.prototype.test=function(version){if(!version)return!1;"string"==typeof version&&(version=new SemVer(version,this.loose));for(var i=0;i{return varint.decode(msg),counter=varint.decode(msg,varint.decode.bytes),!0})}const varint=__webpack_require__(16),pull=__webpack_require__(5),pullLP=__webpack_require__(28),Connection=__webpack_require__(29).Connection,util=__webpack_require__(112),select=__webpack_require__(288),once=__webpack_require__(82),PROTOCOL_ID=__webpack_require__(286).PROTOCOL_ID;class Dialer{constructor(){this.conn=null,this.log=util.log.dialer()}handle(rawConn,callback){this.log("dialer handle conn"),callback=once(callback),pull(rawConn,select(PROTOCOL_ID,(err,conn)=>{if(err)return callback(err);this.log("handshake success"),this.conn=new Connection(conn,rawConn),callback()},this.log),rawConn)}select(protocol,callback){if(this.log("dialer select "+protocol),callback=once(callback),!this.conn)return callback(new Error("multistream handshake has not finalized yet"));const s=select(protocol,(err,conn)=>{if(err)return this.conn=new Connection(conn,this.conn),callback(err);callback(null,new Connection(conn,this.conn))},this.log);pull(this.conn,s,this.conn)}ls(callback){callback=once(callback);const lsStream=select("ls",(err,conn)=>{if(err)return callback(err);pull(conn,pullLP.decode(),collectLs(conn),pull.map(stringify),pull.collect((err,list)=>{if(err)return callback(err);callback(null,list.slice(1))}))},this.log);pull(this.conn,lsStream,this.conn)}}module.exports=Dialer},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(5),isFunction=__webpack_require__(633),assert=__webpack_require__(7),select=__webpack_require__(288),selectHandler=__webpack_require__(701),lsHandler=__webpack_require__(699),matchExact=__webpack_require__(287),util=__webpack_require__(112),Connection=__webpack_require__(29).Connection,PROTOCOL_ID=__webpack_require__(286).PROTOCOL_ID;class Listener{constructor(){this.handlers={ls:{handlerFunc:(protocol,conn)=>lsHandler(this,conn),matchFunc:matchExact}},this.log=util.log.listener()}handle(rawConn,callback){this.log("listener handle conn"),pull(rawConn,select(PROTOCOL_ID,(err,conn)=>{if(err)return callback(err);const shConn=new Connection(conn,rawConn);pull(shConn,selectHandler(shConn,this.handlers,this.log),shConn),callback()},this.log),rawConn)}addHandler(protocol,handlerFunc,matchFunc){this.log("adding handler: "+protocol),assert(isFunction(handlerFunc),"handler must be a function"),this.handlers[protocol]&&this.log("overwriting handler for "+protocol),matchFunc||(matchFunc=matchExact),this.handlers[protocol]={handlerFunc:handlerFunc,matchFunc:matchFunc}}}module.exports=Listener},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function lsHandler(self,conn){const protos=Object.keys(self.handlers).filter(key=>"ls"!==key),nProtos=protos.length,size=protos.reduce((size,proto)=>{const p=new Buffer(proto+"\n");return size+varint.encodingLength(p.length)},0),buf=Buffer.concat([new Buffer(varint.encode(nProtos)),new Buffer(varint.encode(size)),new Buffer("\n")]),encodedProtos=protos.map(proto=>{return new Buffer(proto+"\n")}),values=[buf].concat(encodedProtos);pull(pull.values(values),pullLP.encode(),conn)}const pull=__webpack_require__(5),pullLP=__webpack_require__(28),varint=__webpack_require__(16);module.exports=lsHandler}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function matchSemver(myProtocol,senderProtocol,callback){const mps=myProtocol.split("/"),sps=senderProtocol.split("/"),myName=mps[1],myVersion=mps[2],senderName=sps[1],senderVersion=sps[2];if(myName!==senderName)return callback(null,!1);callback(null,semver.satisfies(myVersion,"~"+senderVersion))}const semver=__webpack_require__(696);module.exports=matchSemver},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function selectHandler(rawConn,handlersMap,log){function next(){lp.decodeFromReader(shake,(err,data)=>{if(err)return cb(err);log("received:",data.toString());const protocol=data.toString().slice(0,-1);matcher(protocol,handlersMap,(err,result)=>{if(err)return cb(err);const key=result;if(key){log("send ack back of: "+protocol),writeEncoded(shake,data,cb);const conn=new Connection(shake.rest(),rawConn);handlersMap[key].handlerFunc(protocol,conn)}else log("not supported protocol: "+protocol),writeEncoded(shake,new Buffer("na\n")),next()})})}const cb=err=>{log.error(err)},stream=handshake({timeout:6e4},cb),shake=stream.handshake;return next(),stream}function matcher(protocol,handlers,callback){const supportedProtocols=Object.keys(handlers);let supportedProtocol=!1;some(supportedProtocols,(sp,cb)=>{handlers[sp].matchFunc(sp,protocol,(err,result)=>{if(err)return cb(err);result&&(supportedProtocol=sp),cb()})},err=>{if(err)return callback(err);callback(null,supportedProtocol)})}const handshake=__webpack_require__(67),lp=__webpack_require__(28),Connection=__webpack_require__(29).Connection,writeEncoded=__webpack_require__(112).writeEncoded,some=__webpack_require__(356);module.exports=selectHandler}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(703)},function(module,exports,__webpack_require__){!function(root,undefined){"use strict";function _x86Multiply(m,n){return(65535&m)*n+(((m>>>16)*n&65535)<<16)}function _x86Rotl(m,n){return m<>>32-n}function _x86Fmix(h){return h^=h>>>16,h=_x86Multiply(h,2246822507),h^=h>>>13,h=_x86Multiply(h,3266489909),h^=h>>>16}function _x64Add(m,n){m=[m[0]>>>16,65535&m[0],m[1]>>>16,65535&m[1]],n=[n[0]>>>16,65535&n[0],n[1]>>>16,65535&n[1]];var o=[0,0,0,0];return o[3]+=m[3]+n[3],o[2]+=o[3]>>>16,o[3]&=65535,o[2]+=m[2]+n[2],o[1]+=o[2]>>>16,o[2]&=65535,o[1]+=m[1]+n[1],o[0]+=o[1]>>>16,o[1]&=65535,o[0]+=m[0]+n[0],o[0]&=65535,[o[0]<<16|o[1],o[2]<<16|o[3]]}function _x64Multiply(m,n){m=[m[0]>>>16,65535&m[0],m[1]>>>16,65535&m[1]],n=[n[0]>>>16,65535&n[0],n[1]>>>16,65535&n[1]];var o=[0,0,0,0];return o[3]+=m[3]*n[3],o[2]+=o[3]>>>16,o[3]&=65535,o[2]+=m[2]*n[3],o[1]+=o[2]>>>16,o[2]&=65535,o[2]+=m[3]*n[2],o[1]+=o[2]>>>16,o[2]&=65535,o[1]+=m[1]*n[3],o[0]+=o[1]>>>16,o[1]&=65535,o[1]+=m[2]*n[2],o[0]+=o[1]>>>16,o[1]&=65535,o[1]+=m[3]*n[1],o[0]+=o[1]>>>16,o[1]&=65535,o[0]+=m[0]*n[3]+m[1]*n[2]+m[2]*n[1]+m[3]*n[0],o[0]&=65535,[o[0]<<16|o[1],o[2]<<16|o[3]]}function _x64Rotl(m,n){return n%=64,32===n?[m[1],m[0]]:n<32?[m[0]<>>32-n,m[1]<>>32-n]:(n-=32,[m[1]<>>32-n,m[0]<>>32-n])}function _x64LeftShift(m,n){return n%=64,0===n?m:n<32?[m[0]<>>32-n,m[1]<>>1]),h=_x64Multiply(h,[4283543511,3981806797]),h=_x64Xor(h,[0,h[0]>>>1]),h=_x64Multiply(h,[3301882366,444984403]),h=_x64Xor(h,[0,h[0]>>>1])}var library={version:"3.0.1",x86:{},x64:{}};library.x86.hash32=function(key,seed){key=key||"",seed=seed||0;for(var remainder=key.length%4,bytes=key.length-remainder,h1=seed,k1=0,c1=3432918353,c2=461845907,i=0;i>>0},library.x86.hash128=function(key,seed){key=key||"",seed=seed||0;for(var remainder=key.length%16,bytes=key.length-remainder,h1=seed,h2=seed,h3=seed,h4=seed,k1=0,k2=0,k3=0,k4=0,c1=597399067,c2=2869860233,c3=951274213,c4=2716044179,i=0;i>>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)},library.x64.hash128=function(key,seed){key=key||"",seed=seed||0;for(var remainder=key.length%16,bytes=key.length-remainder,h1=[0,seed],h2=[0,seed],k1=[0,0],k2=[0,0],c1=[2277735313,289559509],c2=[1291169091,658871167],i=0;i>>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)},void 0!==module&&module.exports&&(exports=module.exports=library),exports.murmurHash3=library}()},function(module,exports,__webpack_require__){"use strict";module.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(module,exports,__webpack_require__){"use strict";function err(strm,errorCode){return strm.msg=msg[errorCode],errorCode}function rank(f){return(f<<1)-(f>4?9:0)}function zero(buf){for(var len=buf.length;--len>=0;)buf[len]=0}function flush_pending(strm){var s=strm.state,len=s.pending;len>strm.avail_out&&(len=strm.avail_out),0!==len&&(utils.arraySet(strm.output,s.pending_buf,s.pending_out,len,strm.next_out),strm.next_out+=len,s.pending_out+=len,strm.total_out+=len,strm.avail_out-=len,s.pending-=len,0===s.pending&&(s.pending_out=0))}function flush_block_only(s,last){trees._tr_flush_block(s,s.block_start>=0?s.block_start:-1,s.strstart-s.block_start,last),s.block_start=s.strstart,flush_pending(s.strm)}function put_byte(s,b){s.pending_buf[s.pending++]=b}function putShortMSB(s,b){s.pending_buf[s.pending++]=b>>>8&255,s.pending_buf[s.pending++]=255&b}function read_buf(strm,buf,start,size){var len=strm.avail_in;return len>size&&(len=size),0===len?0:(strm.avail_in-=len,utils.arraySet(buf,strm.input,strm.next_in,len,start),1===strm.state.wrap?strm.adler=adler32(strm.adler,buf,len,start):2===strm.state.wrap&&(strm.adler=crc32(strm.adler,buf,len,start)),strm.next_in+=len,strm.total_in+=len,len)}function longest_match(s,cur_match){var match,len,chain_length=s.max_chain_length,scan=s.strstart,best_len=s.prev_length,nice_match=s.nice_match,limit=s.strstart>s.w_size-MIN_LOOKAHEAD?s.strstart-(s.w_size-MIN_LOOKAHEAD):0,_win=s.window,wmask=s.w_mask,prev=s.prev,strend=s.strstart+MAX_MATCH,scan_end1=_win[scan+best_len-1],scan_end=_win[scan+best_len];s.prev_length>=s.good_match&&(chain_length>>=2),nice_match>s.lookahead&&(nice_match=s.lookahead);do{if(match=cur_match,_win[match+best_len]===scan_end&&_win[match+best_len-1]===scan_end1&&_win[match]===_win[scan]&&_win[++match]===_win[scan+1]){scan+=2,match++;do{}while(_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&scanbest_len){if(s.match_start=cur_match,best_len=len,len>=nice_match)break;scan_end1=_win[scan+best_len-1],scan_end=_win[scan+best_len]}}}while((cur_match=prev[cur_match&wmask])>limit&&0!=--chain_length);return best_len<=s.lookahead?best_len:s.lookahead}function fill_window(s){var p,n,m,more,str,_w_size=s.w_size;do{if(more=s.window_size-s.lookahead-s.strstart,s.strstart>=_w_size+(_w_size-MIN_LOOKAHEAD)){utils.arraySet(s.window,s.window,_w_size,_w_size,0),s.match_start-=_w_size,s.strstart-=_w_size,s.block_start-=_w_size,n=s.hash_size,p=n;do{m=s.head[--p],s.head[p]=m>=_w_size?m-_w_size:0}while(--n);n=_w_size,p=n;do{m=s.prev[--p],s.prev[p]=m>=_w_size?m-_w_size:0}while(--n);more+=_w_size}if(0===s.strm.avail_in)break;if(n=read_buf(s.strm,s.window,s.strstart+s.lookahead,more),s.lookahead+=n,s.lookahead+s.insert>=MIN_MATCH)for(str=s.strstart-s.insert,s.ins_h=s.window[str],s.ins_h=(s.ins_h<s.pending_buf_size-5&&(max_block_size=s.pending_buf_size-5);;){if(s.lookahead<=1){if(fill_window(s),0===s.lookahead&&flush===Z_NO_FLUSH)return BS_NEED_MORE;if(0===s.lookahead)break}s.strstart+=s.lookahead,s.lookahead=0;var max_start=s.block_start+max_block_size;if((0===s.strstart||s.strstart>=max_start)&&(s.lookahead=s.strstart-max_start,s.strstart=max_start,flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE;if(s.strstart-s.block_start>=s.w_size-MIN_LOOKAHEAD&&(flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE}return s.insert=0,flush===Z_FINISH?(flush_block_only(s,!0),0===s.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):(s.strstart>s.block_start&&(flush_block_only(s,!1),s.strm.avail_out),BS_NEED_MORE)}function deflate_fast(s,flush){for(var hash_head,bflush;;){if(s.lookahead=MIN_MATCH&&(s.ins_h=(s.ins_h<=MIN_MATCH)if(bflush=trees._tr_tally(s,s.strstart-s.match_start,s.match_length-MIN_MATCH),s.lookahead-=s.match_length,s.match_length<=s.max_lazy_match&&s.lookahead>=MIN_MATCH){s.match_length--;do{s.strstart++,s.ins_h=(s.ins_h<=MIN_MATCH&&(s.ins_h=(s.ins_h<4096)&&(s.match_length=MIN_MATCH-1)),s.prev_length>=MIN_MATCH&&s.match_length<=s.prev_length){max_insert=s.strstart+s.lookahead-MIN_MATCH,bflush=trees._tr_tally(s,s.strstart-1-s.prev_match,s.prev_length-MIN_MATCH),s.lookahead-=s.prev_length-1,s.prev_length-=2;do{++s.strstart<=max_insert&&(s.ins_h=(s.ins_h<=MIN_MATCH&&s.strstart>0&&(scan=s.strstart-1,(prev=_win[scan])===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan])){strend=s.strstart+MAX_MATCH;do{}while(prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&scans.lookahead&&(s.match_length=s.lookahead)}if(s.match_length>=MIN_MATCH?(bflush=trees._tr_tally(s,1,s.match_length-MIN_MATCH),s.lookahead-=s.match_length,s.strstart+=s.match_length,s.match_length=0):(bflush=trees._tr_tally(s,0,s.window[s.strstart]),s.lookahead--,s.strstart++),bflush&&(flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE}return s.insert=0,flush===Z_FINISH?(flush_block_only(s,!0),0===s.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):s.last_lit&&(flush_block_only(s,!1),0===s.strm.avail_out)?BS_NEED_MORE:BS_BLOCK_DONE}function deflate_huff(s,flush){for(var bflush;;){if(0===s.lookahead&&(fill_window(s),0===s.lookahead)){if(flush===Z_NO_FLUSH)return BS_NEED_MORE;break}if(s.match_length=0,bflush=trees._tr_tally(s,0,s.window[s.strstart]),s.lookahead--,s.strstart++,bflush&&(flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE}return s.insert=0,flush===Z_FINISH?(flush_block_only(s,!0),0===s.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):s.last_lit&&(flush_block_only(s,!1),0===s.strm.avail_out)?BS_NEED_MORE:BS_BLOCK_DONE}function Config(good_length,max_lazy,nice_length,max_chain,func){this.good_length=good_length,this.max_lazy=max_lazy,this.nice_length=nice_length,this.max_chain=max_chain,this.func=func}function lm_init(s){s.window_size=2*s.w_size,zero(s.head),s.max_lazy_match=configuration_table[s.level].max_lazy,s.good_match=configuration_table[s.level].good_length,s.nice_match=configuration_table[s.level].nice_length,s.max_chain_length=configuration_table[s.level].max_chain,s.strstart=0,s.block_start=0,s.lookahead=0,s.insert=0,s.match_length=s.prev_length=MIN_MATCH-1,s.match_available=0,s.ins_h=0}function DeflateState(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Z_DEFLATED,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new utils.Buf16(2*HEAP_SIZE),this.dyn_dtree=new utils.Buf16(2*(2*D_CODES+1)),this.bl_tree=new utils.Buf16(2*(2*BL_CODES+1)),zero(this.dyn_ltree),zero(this.dyn_dtree),zero(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new utils.Buf16(MAX_BITS+1),this.heap=new utils.Buf16(2*L_CODES+1),zero(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new utils.Buf16(2*L_CODES+1),zero(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function deflateResetKeep(strm){var s;return strm&&strm.state?(strm.total_in=strm.total_out=0,strm.data_type=Z_UNKNOWN,s=strm.state,s.pending=0,s.pending_out=0,s.wrap<0&&(s.wrap=-s.wrap),s.status=s.wrap?INIT_STATE:BUSY_STATE,strm.adler=2===s.wrap?0:1,s.last_flush=Z_NO_FLUSH,trees._tr_init(s),Z_OK):err(strm,Z_STREAM_ERROR)}function deflateReset(strm){var ret=deflateResetKeep(strm);return ret===Z_OK&&lm_init(strm.state),ret}function deflateSetHeader(strm,head){return strm&&strm.state?2!==strm.state.wrap?Z_STREAM_ERROR:(strm.state.gzhead=head,Z_OK):Z_STREAM_ERROR}function deflateInit2(strm,level,method,windowBits,memLevel,strategy){if(!strm)return Z_STREAM_ERROR;var wrap=1;if(level===Z_DEFAULT_COMPRESSION&&(level=6),windowBits<0?(wrap=0,windowBits=-windowBits):windowBits>15&&(wrap=2,windowBits-=16),memLevel<1||memLevel>MAX_MEM_LEVEL||method!==Z_DEFLATED||windowBits<8||windowBits>15||level<0||level>9||strategy<0||strategy>Z_FIXED)return err(strm,Z_STREAM_ERROR);8===windowBits&&(windowBits=9);var s=new DeflateState;return strm.state=s,s.strm=strm,s.wrap=wrap,s.gzhead=null,s.w_bits=windowBits,s.w_size=1<Z_BLOCK||flush<0)return strm?err(strm,Z_STREAM_ERROR):Z_STREAM_ERROR;if(s=strm.state,!strm.output||!strm.input&&0!==strm.avail_in||s.status===FINISH_STATE&&flush!==Z_FINISH)return err(strm,0===strm.avail_out?Z_BUF_ERROR:Z_STREAM_ERROR);if(s.strm=strm,old_flush=s.last_flush,s.last_flush=flush,s.status===INIT_STATE)if(2===s.wrap)strm.adler=0,put_byte(s,31),put_byte(s,139),put_byte(s,8),s.gzhead?(put_byte(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(s.gzhead.extra?4:0)+(s.gzhead.name?8:0)+(s.gzhead.comment?16:0)),put_byte(s,255&s.gzhead.time),put_byte(s,s.gzhead.time>>8&255),put_byte(s,s.gzhead.time>>16&255),put_byte(s,s.gzhead.time>>24&255),put_byte(s,9===s.level?2:s.strategy>=Z_HUFFMAN_ONLY||s.level<2?4:0),put_byte(s,255&s.gzhead.os),s.gzhead.extra&&s.gzhead.extra.length&&(put_byte(s,255&s.gzhead.extra.length),put_byte(s,s.gzhead.extra.length>>8&255)),s.gzhead.hcrc&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending,0)),s.gzindex=0,s.status=EXTRA_STATE):(put_byte(s,0),put_byte(s,0),put_byte(s,0),put_byte(s,0),put_byte(s,0),put_byte(s,9===s.level?2:s.strategy>=Z_HUFFMAN_ONLY||s.level<2?4:0),put_byte(s,OS_CODE),s.status=BUSY_STATE);else{var header=Z_DEFLATED+(s.w_bits-8<<4)<<8,level_flags=-1;level_flags=s.strategy>=Z_HUFFMAN_ONLY||s.level<2?0:s.level<6?1:6===s.level?2:3,header|=level_flags<<6, -0!==s.strstart&&(header|=PRESET_DICT),header+=31-header%31,s.status=BUSY_STATE,putShortMSB(s,header),0!==s.strstart&&(putShortMSB(s,strm.adler>>>16),putShortMSB(s,65535&strm.adler)),strm.adler=1}if(s.status===EXTRA_STATE)if(s.gzhead.extra){for(beg=s.pending;s.gzindex<(65535&s.gzhead.extra.length)&&(s.pending!==s.pending_buf_size||(s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),flush_pending(strm),beg=s.pending,s.pending!==s.pending_buf_size));)put_byte(s,255&s.gzhead.extra[s.gzindex]),s.gzindex++;s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),s.gzindex===s.gzhead.extra.length&&(s.gzindex=0,s.status=NAME_STATE)}else s.status=NAME_STATE;if(s.status===NAME_STATE)if(s.gzhead.name){beg=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),flush_pending(strm),beg=s.pending,s.pending===s.pending_buf_size)){val=1;break}val=s.gzindexbeg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),0===val&&(s.gzindex=0,s.status=COMMENT_STATE)}else s.status=COMMENT_STATE;if(s.status===COMMENT_STATE)if(s.gzhead.comment){beg=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),flush_pending(strm),beg=s.pending,s.pending===s.pending_buf_size)){val=1;break}val=s.gzindexbeg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),0===val&&(s.status=HCRC_STATE)}else s.status=HCRC_STATE;if(s.status===HCRC_STATE&&(s.gzhead.hcrc?(s.pending+2>s.pending_buf_size&&flush_pending(strm),s.pending+2<=s.pending_buf_size&&(put_byte(s,255&strm.adler),put_byte(s,strm.adler>>8&255),strm.adler=0,s.status=BUSY_STATE)):s.status=BUSY_STATE),0!==s.pending){if(flush_pending(strm),0===strm.avail_out)return s.last_flush=-1,Z_OK}else if(0===strm.avail_in&&rank(flush)<=rank(old_flush)&&flush!==Z_FINISH)return err(strm,Z_BUF_ERROR);if(s.status===FINISH_STATE&&0!==strm.avail_in)return err(strm,Z_BUF_ERROR);if(0!==strm.avail_in||0!==s.lookahead||flush!==Z_NO_FLUSH&&s.status!==FINISH_STATE){var bstate=s.strategy===Z_HUFFMAN_ONLY?deflate_huff(s,flush):s.strategy===Z_RLE?deflate_rle(s,flush):configuration_table[s.level].func(s,flush);if(bstate!==BS_FINISH_STARTED&&bstate!==BS_FINISH_DONE||(s.status=FINISH_STATE),bstate===BS_NEED_MORE||bstate===BS_FINISH_STARTED)return 0===strm.avail_out&&(s.last_flush=-1),Z_OK;if(bstate===BS_BLOCK_DONE&&(flush===Z_PARTIAL_FLUSH?trees._tr_align(s):flush!==Z_BLOCK&&(trees._tr_stored_block(s,0,0,!1),flush===Z_FULL_FLUSH&&(zero(s.head),0===s.lookahead&&(s.strstart=0,s.block_start=0,s.insert=0))),flush_pending(strm),0===strm.avail_out))return s.last_flush=-1,Z_OK}return flush!==Z_FINISH?Z_OK:s.wrap<=0?Z_STREAM_END:(2===s.wrap?(put_byte(s,255&strm.adler),put_byte(s,strm.adler>>8&255),put_byte(s,strm.adler>>16&255),put_byte(s,strm.adler>>24&255),put_byte(s,255&strm.total_in),put_byte(s,strm.total_in>>8&255),put_byte(s,strm.total_in>>16&255),put_byte(s,strm.total_in>>24&255)):(putShortMSB(s,strm.adler>>>16),putShortMSB(s,65535&strm.adler)),flush_pending(strm),s.wrap>0&&(s.wrap=-s.wrap),0!==s.pending?Z_OK:Z_STREAM_END)}function deflateEnd(strm){var status;return strm&&strm.state?(status=strm.state.status)!==INIT_STATE&&status!==EXTRA_STATE&&status!==NAME_STATE&&status!==COMMENT_STATE&&status!==HCRC_STATE&&status!==BUSY_STATE&&status!==FINISH_STATE?err(strm,Z_STREAM_ERROR):(strm.state=null,status===BUSY_STATE?err(strm,Z_DATA_ERROR):Z_OK):Z_STREAM_ERROR}function deflateSetDictionary(strm,dictionary){var s,str,n,wrap,avail,next,input,tmpDict,dictLength=dictionary.length;if(!strm||!strm.state)return Z_STREAM_ERROR;if(s=strm.state,2===(wrap=s.wrap)||1===wrap&&s.status!==INIT_STATE||s.lookahead)return Z_STREAM_ERROR;for(1===wrap&&(strm.adler=adler32(strm.adler,dictionary,dictLength,0)),s.wrap=0,dictLength>=s.w_size&&(0===wrap&&(zero(s.head),s.strstart=0,s.block_start=0,s.insert=0),tmpDict=new utils.Buf8(s.w_size),utils.arraySet(tmpDict,dictionary,dictLength-s.w_size,s.w_size,0),dictionary=tmpDict,dictLength=s.w_size),avail=strm.avail_in,next=strm.next_in,input=strm.input,strm.avail_in=dictLength,strm.next_in=0,strm.input=dictionary,fill_window(s);s.lookahead>=MIN_MATCH;){str=s.strstart,n=s.lookahead-(MIN_MATCH-1);do{s.ins_h=(s.ins_h<>>24,hold>>>=op,bits-=op,0===(op=here>>>16&255))output[_out++]=65535&here;else{if(!(16&op)){if(0==(64&op)){here=lcode[(65535&here)+(hold&(1<>>=op,bits-=op),bits<15&&(hold+=input[_in++]<>>24,hold>>>=op,bits-=op,!(16&(op=here>>>16&255))){if(0==(64&op)){here=dcode[(65535&here)+(hold&(1<dmax){strm.msg="invalid distance too far back",state.mode=30;break top}if(hold>>>=op,bits-=op,op=_out-beg,dist>op){if((op=dist-op)>whave&&state.sane){strm.msg="invalid distance too far back",state.mode=30;break top}if(from=0,from_source=s_window,0===wnext){if(from+=wsize-op,op2;)output[_out++]=from_source[from++],output[_out++]=from_source[from++],output[_out++]=from_source[from++],len-=3;len&&(output[_out++]=from_source[from++],len>1&&(output[_out++]=from_source[from++]))}else{from=_out-dist;do{output[_out++]=output[from++],output[_out++]=output[from++],output[_out++]=output[from++],len-=3}while(len>2);len&&(output[_out++]=output[from++],len>1&&(output[_out++]=output[from++]))}break}}break}}while(_in>3,_in-=len,bits-=len<<3,hold&=(1<>>24&255)+(q>>>8&65280)+((65280&q)<<8)+((255&q)<<24)}function InflateState(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new utils.Buf16(320),this.work=new utils.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function inflateResetKeep(strm){var state;return strm&&strm.state?(state=strm.state,strm.total_in=strm.total_out=state.total=0,strm.msg="",state.wrap&&(strm.adler=1&state.wrap),state.mode=HEAD,state.last=0,state.havedict=0,state.dmax=32768,state.head=null,state.hold=0,state.bits=0,state.lencode=state.lendyn=new utils.Buf32(ENOUGH_LENS),state.distcode=state.distdyn=new utils.Buf32(ENOUGH_DISTS),state.sane=1,state.back=-1,Z_OK):Z_STREAM_ERROR}function inflateReset(strm){var state;return strm&&strm.state?(state=strm.state,state.wsize=0,state.whave=0,state.wnext=0,inflateResetKeep(strm)):Z_STREAM_ERROR}function inflateReset2(strm,windowBits){var wrap,state;return strm&&strm.state?(state=strm.state,windowBits<0?(wrap=0,windowBits=-windowBits):(wrap=1+(windowBits>>4),windowBits<48&&(windowBits&=15)),windowBits&&(windowBits<8||windowBits>15)?Z_STREAM_ERROR:(null!==state.window&&state.wbits!==windowBits&&(state.window=null),state.wrap=wrap,state.wbits=windowBits,inflateReset(strm))):Z_STREAM_ERROR}function inflateInit2(strm,windowBits){var ret,state;return strm?(state=new InflateState,strm.state=state,state.window=null,ret=inflateReset2(strm,windowBits),ret!==Z_OK&&(strm.state=null),ret):Z_STREAM_ERROR}function inflateInit(strm){return inflateInit2(strm,DEF_WBITS)}function fixedtables(state){if(virgin){var sym;for(lenfix=new utils.Buf32(512),distfix=new utils.Buf32(32),sym=0;sym<144;)state.lens[sym++]=8;for(;sym<256;)state.lens[sym++]=9;for(;sym<280;)state.lens[sym++]=7;for(;sym<288;)state.lens[sym++]=8;for(inflate_table(LENS,state.lens,0,288,lenfix,0,state.work,{bits:9}),sym=0;sym<32;)state.lens[sym++]=5;inflate_table(DISTS,state.lens,0,32,distfix,0,state.work,{bits:5}),virgin=!1}state.lencode=lenfix,state.lenbits=9,state.distcode=distfix,state.distbits=5}function updatewindow(strm,src,end,copy){var dist,state=strm.state;return null===state.window&&(state.wsize=1<=state.wsize?(utils.arraySet(state.window,src,end-state.wsize,state.wsize,0),state.wnext=0,state.whave=state.wsize):(dist=state.wsize-state.wnext,dist>copy&&(dist=copy),utils.arraySet(state.window,src,end-copy,dist,state.wnext),copy-=dist,copy?(utils.arraySet(state.window,src,end-copy,copy,0),state.wnext=copy,state.whave=state.wsize):(state.wnext+=dist,state.wnext===state.wsize&&(state.wnext=0),state.whave>>8&255,state.check=crc32(state.check,hbuf,2,0),hold=0,bits=0,state.mode=FLAGS;break}if(state.flags=0,state.head&&(state.head.done=!1),!(1&state.wrap)||(((255&hold)<<8)+(hold>>8))%31){strm.msg="incorrect header check",state.mode=BAD;break}if((15&hold)!==Z_DEFLATED){strm.msg="unknown compression method",state.mode=BAD;break}if(hold>>>=4,bits-=4,len=8+(15&hold),0===state.wbits)state.wbits=len;else if(len>state.wbits){strm.msg="invalid window size",state.mode=BAD;break}state.dmax=1<>8&1),512&state.flags&&(hbuf[0]=255&hold,hbuf[1]=hold>>>8&255,state.check=crc32(state.check,hbuf,2,0)),hold=0,bits=0,state.mode=TIME;case TIME:for(;bits<32;){if(0===have)break inf_leave;have--,hold+=input[next++]<>>8&255,hbuf[2]=hold>>>16&255,hbuf[3]=hold>>>24&255,state.check=crc32(state.check,hbuf,4,0)),hold=0,bits=0,state.mode=OS;case OS:for(;bits<16;){if(0===have)break inf_leave;have--,hold+=input[next++]<>8),512&state.flags&&(hbuf[0]=255&hold,hbuf[1]=hold>>>8&255,state.check=crc32(state.check,hbuf,2,0)),hold=0,bits=0,state.mode=EXLEN;case EXLEN:if(1024&state.flags){for(;bits<16;){if(0===have)break inf_leave;have--,hold+=input[next++]<>>8&255,state.check=crc32(state.check,hbuf,2,0)),hold=0,bits=0}else state.head&&(state.head.extra=null);state.mode=EXTRA;case EXTRA:if(1024&state.flags&&(copy=state.length,copy>have&&(copy=have),copy&&(state.head&&(len=state.head.extra_len-state.length,state.head.extra||(state.head.extra=new Array(state.head.extra_len)),utils.arraySet(state.head.extra,input,next,copy,len)),512&state.flags&&(state.check=crc32(state.check,input,copy,next)),have-=copy,next+=copy,state.length-=copy),state.length))break inf_leave;state.length=0,state.mode=NAME;case NAME:if(2048&state.flags){if(0===have)break inf_leave;copy=0;do{len=input[next+copy++],state.head&&len&&state.length<65536&&(state.head.name+=String.fromCharCode(len))}while(len&©>9&1,state.head.done=!0),strm.adler=state.check=0,state.mode=TYPE;break;case DICTID:for(;bits<32;){if(0===have)break inf_leave;have--,hold+=input[next++]<>>=7&bits,bits-=7&bits,state.mode=CHECK;break}for(;bits<3;){if(0===have)break inf_leave;have--,hold+=input[next++]<>>=1,bits-=1,3&hold){case 0:state.mode=STORED;break;case 1:if(fixedtables(state),state.mode=LEN_,flush===Z_TREES){hold>>>=2,bits-=2;break inf_leave}break;case 2:state.mode=TABLE;break;case 3:strm.msg="invalid block type",state.mode=BAD}hold>>>=2,bits-=2;break;case STORED:for(hold>>>=7&bits,bits-=7&bits;bits<32;){if(0===have)break inf_leave;have--,hold+=input[next++]<>>16^65535)){strm.msg="invalid stored block lengths",state.mode=BAD;break}if(state.length=65535&hold,hold=0,bits=0,state.mode=COPY_,flush===Z_TREES)break inf_leave;case COPY_:state.mode=COPY;case COPY:if(copy=state.length){if(copy>have&&(copy=have),copy>left&&(copy=left),0===copy)break inf_leave;utils.arraySet(output,input,next,copy,put),have-=copy,next+=copy,left-=copy,put+=copy,state.length-=copy;break}state.mode=TYPE;break;case TABLE:for(;bits<14;){if(0===have)break inf_leave;have--,hold+=input[next++]<>>=5,bits-=5,state.ndist=1+(31&hold),hold>>>=5,bits-=5,state.ncode=4+(15&hold),hold>>>=4,bits-=4,state.nlen>286||state.ndist>30){strm.msg="too many length or distance symbols",state.mode=BAD;break}state.have=0,state.mode=LENLENS;case LENLENS:for(;state.have>>=3,bits-=3}for(;state.have<19;)state.lens[order[state.have++]]=0;if(state.lencode=state.lendyn,state.lenbits=7,opts={bits:state.lenbits},ret=inflate_table(CODES,state.lens,0,19,state.lencode,0,state.work,opts),state.lenbits=opts.bits,ret){strm.msg="invalid code lengths set",state.mode=BAD;break}state.have=0,state.mode=CODELENS;case CODELENS:for(;state.have>>24,here_op=here>>>16&255,here_val=65535&here,!(here_bits<=bits);){if(0===have)break inf_leave;have--,hold+=input[next++]<>>=here_bits,bits-=here_bits,state.lens[state.have++]=here_val;else{if(16===here_val){for(n=here_bits+2;bits>>=here_bits,bits-=here_bits,0===state.have){strm.msg="invalid bit length repeat",state.mode=BAD;break}len=state.lens[state.have-1],copy=3+(3&hold),hold>>>=2,bits-=2}else if(17===here_val){for(n=here_bits+3;bits>>=here_bits,bits-=here_bits,len=0,copy=3+(7&hold),hold>>>=3,bits-=3}else{for(n=here_bits+7;bits>>=here_bits,bits-=here_bits,len=0,copy=11+(127&hold),hold>>>=7,bits-=7}if(state.have+copy>state.nlen+state.ndist){strm.msg="invalid bit length repeat",state.mode=BAD;break}for(;copy--;)state.lens[state.have++]=len}}if(state.mode===BAD)break;if(0===state.lens[256]){strm.msg="invalid code -- missing end-of-block",state.mode=BAD;break}if(state.lenbits=9,opts={bits:state.lenbits},ret=inflate_table(LENS,state.lens,0,state.nlen,state.lencode,0,state.work,opts),state.lenbits=opts.bits,ret){strm.msg="invalid literal/lengths set",state.mode=BAD;break}if(state.distbits=6,state.distcode=state.distdyn,opts={bits:state.distbits},ret=inflate_table(DISTS,state.lens,state.nlen,state.ndist,state.distcode,0,state.work,opts),state.distbits=opts.bits,ret){strm.msg="invalid distances set",state.mode=BAD;break}if(state.mode=LEN_,flush===Z_TREES)break inf_leave;case LEN_:state.mode=LEN;case LEN:if(have>=6&&left>=258){strm.next_out=put,strm.avail_out=left,strm.next_in=next,strm.avail_in=have,state.hold=hold,state.bits=bits,inflate_fast(strm,_out),put=strm.next_out,output=strm.output,left=strm.avail_out,next=strm.next_in,input=strm.input,have=strm.avail_in,hold=state.hold,bits=state.bits,state.mode===TYPE&&(state.back=-1);break}for(state.back=0;here=state.lencode[hold&(1<>>24,here_op=here>>>16&255,here_val=65535&here,!(here_bits<=bits);){if(0===have)break inf_leave;have--,hold+=input[next++]<>last_bits)],here_bits=here>>>24,here_op=here>>>16&255,here_val=65535&here,!(last_bits+here_bits<=bits);){if(0===have)break inf_leave;have--,hold+=input[next++]<>>=last_bits,bits-=last_bits,state.back+=last_bits}if(hold>>>=here_bits,bits-=here_bits,state.back+=here_bits,state.length=here_val,0===here_op){state.mode=LIT;break}if(32&here_op){state.back=-1,state.mode=TYPE;break}if(64&here_op){strm.msg="invalid literal/length code",state.mode=BAD;break}state.extra=15&here_op,state.mode=LENEXT;case LENEXT:if(state.extra){for(n=state.extra;bits>>=state.extra,bits-=state.extra,state.back+=state.extra}state.was=state.length,state.mode=DIST;case DIST:for(;here=state.distcode[hold&(1<>>24,here_op=here>>>16&255,here_val=65535&here,!(here_bits<=bits);){if(0===have)break inf_leave;have--,hold+=input[next++]<>last_bits)],here_bits=here>>>24,here_op=here>>>16&255,here_val=65535&here,!(last_bits+here_bits<=bits);){if(0===have)break inf_leave;have--,hold+=input[next++]<>>=last_bits,bits-=last_bits,state.back+=last_bits}if(hold>>>=here_bits,bits-=here_bits,state.back+=here_bits,64&here_op){strm.msg="invalid distance code",state.mode=BAD;break}state.offset=here_val,state.extra=15&here_op,state.mode=DISTEXT;case DISTEXT:if(state.extra){for(n=state.extra;bits>>=state.extra,bits-=state.extra,state.back+=state.extra}if(state.offset>state.dmax){strm.msg="invalid distance too far back",state.mode=BAD;break}state.mode=MATCH;case MATCH:if(0===left)break inf_leave;if(copy=_out-left,state.offset>copy){if((copy=state.offset-copy)>state.whave&&state.sane){strm.msg="invalid distance too far back",state.mode=BAD;break}copy>state.wnext?(copy-=state.wnext,from=state.wsize-copy):from=state.wnext-copy,copy>state.length&&(copy=state.length),from_source=state.window}else from_source=output,from=put-state.offset,copy=state.length;copy>left&&(copy=left),left-=copy,state.length-=copy;do{output[put++]=from_source[from++]}while(--copy);0===state.length&&(state.mode=LEN);break;case LIT:if(0===left)break inf_leave;output[put++]=state.length,left--,state.mode=LEN;break;case CHECK:if(state.wrap){for(;bits<32;){if(0===have)break inf_leave;have--,hold|=input[next++]<=1&&0===count[max];max--);if(root>max&&(root=max),0===max)return table[table_index++]=20971520,table[table_index++]=20971520,opts.bits=1,0;for(min=1;min0&&(0===type||1!==max))return-1;for(offs[1]=0,len=1;len<15;len++)offs[len+1]=offs[len]+count[len];for(sym=0;sym852||2===type&&used>592)return 1;for(;;){here_bits=len-drop,work[sym]end?(here_op=extra[extra_index+work[sym]],here_val=base[base_index+work[sym]]):(here_op=96,here_val=0),incr=1<>drop)+fill]=here_bits<<24|here_op<<16|here_val|0}while(0!==fill);for(incr=1<>=1;if(0!==incr?(huff&=incr-1,huff+=incr):huff=0,sym++,0==--count[len]){if(len===max)break;len=lens[lens_index+work[sym]]}if(len>root&&(huff&mask)!==low){for(0===drop&&(drop=root),next+=min,curr=len-drop,left=1<852||2===type&&used>592)return 1;low=huff&mask,table[low]=root<<24|curr<<16|next-table_index|0}}return 0!==huff&&(table[next+huff]=len-drop<<24|64<<16|0),opts.bits=root,0}},function(module,exports,__webpack_require__){"use strict";module.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(module,exports,__webpack_require__){"use strict";function zero(buf){for(var len=buf.length;--len>=0;)buf[len]=0}function StaticTreeDesc(static_tree,extra_bits,extra_base,elems,max_length){this.static_tree=static_tree,this.extra_bits=extra_bits,this.extra_base=extra_base,this.elems=elems,this.max_length=max_length,this.has_stree=static_tree&&static_tree.length}function TreeDesc(dyn_tree,stat_desc){this.dyn_tree=dyn_tree,this.max_code=0,this.stat_desc=stat_desc}function d_code(dist){return dist<256?_dist_code[dist]:_dist_code[256+(dist>>>7)]}function put_short(s,w){s.pending_buf[s.pending++]=255&w,s.pending_buf[s.pending++]=w>>>8&255}function send_bits(s,value,length){s.bi_valid>Buf_size-length?(s.bi_buf|=value<>Buf_size-s.bi_valid,s.bi_valid+=length-Buf_size):(s.bi_buf|=value<>>=1,res<<=1}while(--len>0);return res>>>1}function bi_flush(s){16===s.bi_valid?(put_short(s,s.bi_buf),s.bi_buf=0,s.bi_valid=0):s.bi_valid>=8&&(s.pending_buf[s.pending++]=255&s.bi_buf,s.bi_buf>>=8,s.bi_valid-=8)}function gen_bitlen(s,desc){var h,n,m,bits,xbits,f,tree=desc.dyn_tree,max_code=desc.max_code,stree=desc.stat_desc.static_tree,has_stree=desc.stat_desc.has_stree,extra=desc.stat_desc.extra_bits,base=desc.stat_desc.extra_base,max_length=desc.stat_desc.max_length,overflow=0;for(bits=0;bits<=MAX_BITS;bits++)s.bl_count[bits]=0 -;for(tree[2*s.heap[s.heap_max]+1]=0,h=s.heap_max+1;hmax_length&&(bits=max_length,overflow++),tree[2*n+1]=bits,n>max_code||(s.bl_count[bits]++,xbits=0,n>=base&&(xbits=extra[n-base]),f=tree[2*n],s.opt_len+=f*(bits+xbits),has_stree&&(s.static_len+=f*(stree[2*n+1]+xbits)));if(0!==overflow){do{for(bits=max_length-1;0===s.bl_count[bits];)bits--;s.bl_count[bits]--,s.bl_count[bits+1]+=2,s.bl_count[max_length]--,overflow-=2}while(overflow>0);for(bits=max_length;0!==bits;bits--)for(n=s.bl_count[bits];0!==n;)(m=s.heap[--h])>max_code||(tree[2*m+1]!==bits&&(s.opt_len+=(bits-tree[2*m+1])*tree[2*m],tree[2*m+1]=bits),n--)}}function gen_codes(tree,max_code,bl_count){var bits,n,next_code=new Array(MAX_BITS+1),code=0;for(bits=1;bits<=MAX_BITS;bits++)next_code[bits]=code=code+bl_count[bits-1]<<1;for(n=0;n<=max_code;n++){var len=tree[2*n+1];0!==len&&(tree[2*n]=bi_reverse(next_code[len]++,len))}}function tr_static_init(){var n,bits,length,code,dist,bl_count=new Array(MAX_BITS+1);for(length=0,code=0;code>=7;code8?put_short(s,s.bi_buf):s.bi_valid>0&&(s.pending_buf[s.pending++]=s.bi_buf),s.bi_buf=0,s.bi_valid=0}function copy_block(s,buf,len,header){bi_windup(s),header&&(put_short(s,len),put_short(s,~len)),utils.arraySet(s.pending_buf,s.window,buf,len,s.pending),s.pending+=len}function smaller(tree,n,m,depth){var _n2=2*n,_m2=2*m;return tree[_n2]>1;n>=1;n--)pqdownheap(s,tree,n);node=elems;do{n=s.heap[1],s.heap[1]=s.heap[s.heap_len--],pqdownheap(s,tree,1),m=s.heap[1],s.heap[--s.heap_max]=n,s.heap[--s.heap_max]=m,tree[2*node]=tree[2*n]+tree[2*m],s.depth[node]=(s.depth[n]>=s.depth[m]?s.depth[n]:s.depth[m])+1,tree[2*n+1]=tree[2*m+1]=node,s.heap[1]=node++,pqdownheap(s,tree,1)}while(s.heap_len>=2);s.heap[--s.heap_max]=s.heap[1],gen_bitlen(s,desc),gen_codes(tree,max_code,s.bl_count)}function scan_tree(s,tree,max_code){var n,curlen,prevlen=-1,nextlen=tree[1],count=0,max_count=7,min_count=4;for(0===nextlen&&(max_count=138,min_count=3),tree[2*(max_code+1)+1]=65535,n=0;n<=max_code;n++)curlen=nextlen,nextlen=tree[2*(n+1)+1],++count=3&&0===s.bl_tree[2*bl_order[max_blindex]+1];max_blindex--);return s.opt_len+=3*(max_blindex+1)+5+5+4,max_blindex}function send_all_trees(s,lcodes,dcodes,blcodes){var rank;for(send_bits(s,lcodes-257,5),send_bits(s,dcodes-1,5),send_bits(s,blcodes-4,4),rank=0;rank>>=1)if(1&black_mask&&0!==s.dyn_ltree[2*n])return Z_BINARY;if(0!==s.dyn_ltree[18]||0!==s.dyn_ltree[20]||0!==s.dyn_ltree[26])return Z_TEXT;for(n=32;n0?(s.strm.data_type===Z_UNKNOWN&&(s.strm.data_type=detect_data_type(s)),build_tree(s,s.l_desc),build_tree(s,s.d_desc),max_blindex=build_bl_tree(s),opt_lenb=s.opt_len+3+7>>>3,(static_lenb=s.static_len+3+7>>>3)<=opt_lenb&&(opt_lenb=static_lenb)):opt_lenb=static_lenb=stored_len+5,stored_len+4<=opt_lenb&&buf!==-1?_tr_stored_block(s,buf,stored_len,last):s.strategy===Z_FIXED||static_lenb===opt_lenb?(send_bits(s,(STATIC_TREES<<1)+(last?1:0),3),compress_block(s,static_ltree,static_dtree)):(send_bits(s,(DYN_TREES<<1)+(last?1:0),3),send_all_trees(s,s.l_desc.max_code+1,s.d_desc.max_code+1,max_blindex+1),compress_block(s,s.dyn_ltree,s.dyn_dtree)),init_block(s),last&&bi_windup(s)}function _tr_tally(s,dist,lc){return s.pending_buf[s.d_buf+2*s.last_lit]=dist>>>8&255,s.pending_buf[s.d_buf+2*s.last_lit+1]=255&dist,s.pending_buf[s.l_buf+s.last_lit]=255&lc,s.last_lit++,0===dist?s.dyn_ltree[2*lc]++:(s.matches++,dist--,s.dyn_ltree[2*(_length_code[lc]+LITERALS+1)]++,s.dyn_dtree[2*d_code(dist)]++),s.last_lit===s.lit_bufsize-1}var utils=__webpack_require__(114),Z_FIXED=4,Z_BINARY=0,Z_TEXT=1,Z_UNKNOWN=2,STORED_BLOCK=0,STATIC_TREES=1,DYN_TREES=2,LENGTH_CODES=29,LITERALS=256,L_CODES=LITERALS+1+LENGTH_CODES,D_CODES=30,BL_CODES=19,HEAP_SIZE=2*L_CODES+1,MAX_BITS=15,Buf_size=16,MAX_BL_BITS=7,END_BLOCK=256,REP_3_6=16,REPZ_3_10=17,REPZ_11_138=18,extra_lbits=[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],extra_dbits=[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],extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],static_ltree=new Array(2*(L_CODES+2));zero(static_ltree);var static_dtree=new Array(2*D_CODES);zero(static_dtree);var _dist_code=new Array(512);zero(_dist_code);var _length_code=new Array(256);zero(_length_code);var base_length=new Array(LENGTH_CODES);zero(base_length);var base_dist=new Array(D_CODES);zero(base_dist);var static_l_desc,static_d_desc,static_bl_desc,static_init_done=!1;exports._tr_init=_tr_init,exports._tr_stored_block=_tr_stored_block,exports._tr_flush_block=_tr_flush_block,exports._tr_tally=_tr_tally,exports._tr_align=_tr_align},function(module,exports,__webpack_require__){"use strict";function ZStream(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}module.exports=ZStream},function(module,exports,__webpack_require__){(function(global){var rvalidchars=/^[\],:{}\s]*$/;module.exports=function(data){return"string"==typeof data&&data?(data=data.replace(/^\s+/,"").replace(/\s+$/,""),global.JSON&&JSON.parse?JSON.parse(data):rvalidchars.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))?new Function("return "+data)():void 0):null}}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){"use strict";const ensureMultiaddr=__webpack_require__(293).ensureMultiaddr,uniqBy=__webpack_require__(639);class MultiaddrSet{constructor(multiaddrs){this._multiaddrs=multiaddrs||[],this._observedMultiaddrs=[]}add(ma){ma=ensureMultiaddr(ma),this.has(ma)||this._multiaddrs.push(ma)}addSafe(ma){ma=ensureMultiaddr(ma),this._observedMultiaddrs.some((m,i)=>{if(m.equals(ma))return this.add(ma),this._observedMultiaddrs.splice(i,1),!0})||this._observedMultiaddrs.push(ma)}toArray(){return this._multiaddrs.slice()}get size(){return this._multiaddrs.length}forEach(fn){return this._multiaddrs.forEach(fn)}has(ma){return ma=ensureMultiaddr(ma),this._multiaddrs.some(m=>m.equals(ma))}delete(ma){ma=ensureMultiaddr(ma),this._multiaddrs.some((m,i)=>{if(m.equals(ma))return this._multiaddrs.splice(i,1),!0})}replace(existing,fresh){Array.isArray(existing)||(existing=[existing]),Array.isArray(fresh)||(fresh=[fresh]),existing.forEach(m=>this.delete(m)),fresh.forEach(m=>this.add(m))}clear(){this._multiaddrs=[]}distinct(){return uniqBy(this._multiaddrs,ma=>{return[ma.toOptions().port,ma.toOptions().transport].join()})}}module.exports=MultiaddrSet},function(module,exports,__webpack_require__){(function(process){function Promise(fn){function next(skipTimeout){waiting.length?(running=!0,waiting.shift()(skipTimeout||!1)):running=!1}function then(cb,eb){return new Promise(function(resolver){function done(skipTimeout){function timeoutDone(){var val;try{val=callback(value)}catch(ex){return resolver.reject(ex),next()}resolver.fulfill(val),next(!0)}var callback=isFulfilled?cb:eb;"function"==typeof callback?skipTimeout?timeoutDone():nextTick(timeoutDone):isFulfilled?(resolver.fulfill(value),next(skipTimeout)):(resolver.reject(value),next(skipTimeout))}waiting.push(done),isResolved&&!running&&next()})}if(!(this instanceof Promise))return"function"==typeof fn?new Promise(fn):defer();var value,isResolved=!1,isFulfilled=!1,waiting=[],running=!1;this.then=then,function(){function fulfill(val){isResolved||(isPromise(val)?val.then(fulfill,reject):(isResolved=isFulfilled=!0,value=val,next()))}function reject(err){isResolved||(isResolved=!0,isFulfilled=!1,value=err,next())}for(var resolver={fulfill:fulfill,reject:reject},i=0;i"!==tokens[0])throw new Error("Unexpected token in map type: "+tokens[0]);tokens.shift(),field.name=tokens.shift();break;case"repeated":case"required":case"optional":var t=tokens.shift();field.required="required"===t,field.repeated="repeated"===t,field.type=tokens.shift(),field.name=tokens.shift();break;case"[":field.options=onfieldoptions(tokens);break;case";":if(null===field.name)throw new Error("Missing field name");if(null===field.type)throw new Error("Missing type in message field: "+field.name);if(field.tag===-1)throw new Error("Missing tag number in message field: "+field.name);return tokens.shift(),field;default:throw new Error("Unexpected token in message field: "+tokens[0])}throw new Error("No ; found for message field")},onmessagebody=function(tokens){for(var body={enums:[],messages:[],fields:[],extends:[],extensions:null};tokens.length;)switch(tokens[0]){case"map":case"repeated":case"optional":case"required":body.fields.push(onfield(tokens));break;case"enum":body.enums.push(onenum(tokens));break;case"message":body.messages.push(onmessage(tokens));break;case"extensions":body.extensions=onextensions(tokens);break;case"oneof":tokens.shift();var name=tokens.shift();if("{"!==tokens[0])throw new Error("Unexpected token in oneof: "+tokens[0]);for(tokens.shift();"}"!==tokens[0];){tokens.unshift("optional");var field=onfield(tokens);field.oneof=name,body.fields.push(field)}tokens.shift();break;case"extend":body.extends.push(onextend(tokens));break;case";":tokens.shift();break;case"reserved":case"option":for(tokens.shift();";"!==tokens[0];)tokens.shift();break;default:tokens.unshift("optional"),body.fields.push(onfield(tokens))}return body},onextend=function(tokens){return{name:tokens[1],message:onmessage(tokens)}},onextensions=function(tokens){tokens.shift();var from=Number(tokens.shift());if(isNaN(from))throw new Error("Invalid from in extensions definition");if("to"!==tokens.shift())throw new Error("Expected keyword 'to' in extensions definition");var to=tokens.shift();if("max"===to&&(to=536870911),to=Number(to),isNaN(to))throw new Error("Invalid to in extensions definition");if(";"!==tokens.shift())throw new Error("Missing ; in extensions definition");return{from:from,to:to}},onmessage=function(tokens){tokens.shift();var lvl=1,body=[],msg={name:tokens.shift(),enums:[],extends:[],messages:[],fields:[]};if("{"!==tokens[0])throw new Error("Expected { but found "+tokens[0]);for(tokens.shift();tokens.length;){if("{"===tokens[0]?lvl++:"}"===tokens[0]&&lvl--,!lvl)return tokens.shift(),body=onmessagebody(body),msg.enums=body.enums,msg.messages=body.messages,msg.fields=body.fields,msg.extends=body.extends,msg.extensions=body.extensions,msg;body.push(tokens.shift())}if(lvl)throw new Error("No closing tag for message")},onpackagename=function(tokens){tokens.shift();var name=tokens.shift();if(";"!==tokens[0])throw new Error("Expected ; but found "+tokens[0]);return tokens.shift(),name},onsyntaxversion=function(tokens){if(tokens.shift(),"="!==tokens[0])throw new Error("Expected = but found "+tokens[0]);tokens.shift();var version=tokens.shift();switch(version){case'"proto2"':version=2;break;case'"proto3"':version=3;break;default:throw new Error("Expected protobuf syntax version but found "+version)}if(";"!==tokens[0])throw new Error("Expected ; but found "+tokens[0]);return tokens.shift(),version},onenumvalue=function(tokens){if(tokens.length<4)throw new Error("Invalid enum value: "+tokens.slice(0,3).join(" "));if("="!==tokens[1])throw new Error("Expected = but found "+tokens[1]);if(";"!==tokens[3]&&"["!==tokens[3])throw new Error("Expected ; or [ but found "+tokens[1]);var name=tokens.shift();tokens.shift();var val={value:null,options:{}};return val.value=Number(tokens.shift()),"["===tokens[0]&&(val.options=onfieldoptions(tokens)),tokens.shift(),{name:name,val:val}},onenum=function(tokens){tokens.shift();var options={},e={name:tokens.shift(),values:{},options:{}};if("{"!==tokens[0])throw new Error("Expected { but found "+tokens[0]);for(tokens.shift();tokens.length;){if("}"===tokens[0])return tokens.shift(),";"===tokens[0]&&tokens.shift(),e;if("option"!==tokens[0]){var val=onenumvalue(tokens);e.values[val.name]=val.val}else options=onoption(tokens),e.options[options.name]=options.value}throw new Error("No closing tag for enum")},onoption=function(tokens){for(var name=null,value=null;tokens.length;){if(";"===tokens[0])return tokens.shift(),{name:name,value:value};switch(tokens[0]){case"option":tokens.shift();var hasBracket="("===tokens[0];if(hasBracket&&tokens.shift(),name=tokens.shift(),hasBracket){if(")"!==tokens[0])throw new Error("Expected ) but found "+tokens[0]);tokens.shift()}"."===tokens[0][0]&&(name+=tokens.shift());break;case"=":if(tokens.shift(),null===name)throw new Error("Expected key for option with value: "+tokens[0]);if(value=function(value){return"true"===value||"false"!==value&&value.replace(/^"+|"+$/gm,"")}(tokens.shift()),"optimize_for"===name&&!/^(SPEED|CODE_SIZE|LITE_RUNTIME)$/.test(value))throw new Error("Unexpected value for option optimize_for: "+value);"{"===value&&(value=onoptionMap(tokens));break;default:throw new Error("Unexpected token in option: "+tokens[0])}}},onoptionMap=function(tokens){for(var map={};tokens.length;){if("}"===tokens[0])return tokens.shift(),map;var hasBracket="("===tokens[0];hasBracket&&tokens.shift();var key=tokens.shift();if(hasBracket){if(")"!==tokens[0])throw new Error("Expected ) but found "+tokens[0]);tokens.shift()}var value=null;switch(tokens[0]){case":":if(void 0!==map[key])throw new Error("Duplicate option map key "+key);tokens.shift(),value=function(value){return"true"===value||"false"!==value&&value.replace(/^"+|"+$/gm,"")}(tokens.shift()),"{"===value&&(value=onoptionMap(tokens)),map[key]=value;break;case"{":if(tokens.shift(),value=onoptionMap(tokens),void 0===map[key]&&(map[key]=[]),!Array.isArray(map[key]))throw new Error("Duplicate option map key "+key);map[key].push(value);break;default:throw new Error("Unexpected token in option map: "+tokens[0])}}throw new Error("No closing tag for option map")},onimport=function(tokens){tokens.shift();var file=tokens.shift().replace(/^"+|"+$/gm,"");if(";"!==tokens[0])throw new Error("Unexpected token: "+tokens[0]+'. Expected ";"');return tokens.shift(),file},onservice=function(tokens){tokens.shift();var service={name:tokens.shift(),methods:[],options:{}};if("{"!==tokens[0])throw new Error("Expected { but found "+tokens[0]);for(tokens.shift();tokens.length;){if("}"===tokens[0])return tokens.shift(),";"===tokens[0]&&tokens.shift(),service;switch(tokens[0]){case"option":var opt=onoption(tokens);if(void 0!==service.options[opt.name])throw new Error("Duplicate option "+opt.name);service.options[opt.name]=opt.value;break;case"rpc":service.methods.push(onrpc(tokens));break;default:throw new Error("Unexpected token in service: "+tokens[0])}}throw new Error("No closing tag for service")},onrpc=function(tokens){tokens.shift();var rpc={name:tokens.shift(),input_type:null,output_type:null,client_streaming:!1,server_streaming:!1,options:{}};if("("!==tokens[0])throw new Error("Expected ( but found "+tokens[0]);if(tokens.shift(),"stream"===tokens[0]&&(tokens.shift(),rpc.client_streaming=!0),rpc.input_type=tokens.shift(),")"!==tokens[0])throw new Error("Expected ) but found "+tokens[0]);if(tokens.shift(),"returns"!==tokens[0])throw new Error("Expected returns but found "+tokens[0]);if(tokens.shift(),"("!==tokens[0])throw new Error("Expected ( but found "+tokens[0]);if(tokens.shift(),"stream"===tokens[0]&&(tokens.shift(),rpc.server_streaming=!0),rpc.output_type=tokens.shift(),")"!==tokens[0])throw new Error("Expected ) but found "+tokens[0]);if(tokens.shift(),";"===tokens[0])return tokens.shift(),rpc;if("{"!==tokens[0])throw new Error("Expected { but found "+tokens[0]);for(tokens.shift();tokens.length;){if("}"===tokens[0])return tokens.shift(),";"===tokens[0]&&tokens.shift(),rpc;if("option"!==tokens[0])throw new Error("Unexpected token in rpc options: "+tokens[0]);var opt=onoption(tokens);if(void 0!==rpc.options[opt.name])throw new Error("Duplicate option "+opt.name);rpc.options[opt.name]=opt.value}throw new Error("No closing tag for rpc")},parse=function(buf){for(var tokens=tokenize(buf.toString()),i=0;imsg.extensions.to)throw new Error(msg.name+" does not declare "+field.tag+" as an extension number");msg.fields.push(field)})})}),schema.messages.forEach(function(msg){msg.fields.forEach(function(field){function enumNameIsFieldType(en){return en.name===field.type}function enumNameIsNestedEnumName(en){return en.name===nestedEnumName}var fieldSplit,messageName,nestedEnumName,message;if(field.options&&"true"===field.options.packed&&PACKABLE_TYPES.indexOf(field.type)===-1){if(field.type.indexOf(".")===-1){if(msg.enums&&msg.enums.some(enumNameIsFieldType))return}else{if(fieldSplit=field.type.split("."),fieldSplit.length>2)throw new Error("what is this?");if(messageName=fieldSplit[0],nestedEnumName=fieldSplit[1],schema.messages.some(function(msg){if(msg.name===messageName)return message=msg,msg}),message&&message.enums&&message.enums.some(enumNameIsNestedEnumName))return}throw new Error("Fields of type "+field.type+' cannot be declared [packed=true]. Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire types) can be declared "packed". See https://developers.google.com/protocol-buffers/docs/encoding#optional')}})}),schema};module.exports=parse},function(module,exports){var onfield=function(f,result){var prefix=f.repeated?"repeated":f.required?"required":"optional";"map"===f.type&&(prefix="map<"+f.map.from+","+f.map.to+">"),f.oneof&&(prefix="");var opts=Object.keys(f.options||{}).map(function(key){return key+" = "+f.options[key]}).join(",");return opts&&(opts=" ["+opts+"]"),result.push((prefix?prefix+" ":"")+("map"===f.map?"":f.type+" ")+f.name+" = "+f.tag+opts+";"),result},onmessage=function(m,result){result.push("message "+m.name+" {"),m.enums||(m.enums=[]),m.enums.forEach(function(e){result.push(onenum(e,[]))}),m.messages||(m.messages=[]),m.messages.forEach(function(m){result.push(onmessage(m,[]))});var oneofs={};return m.fields||(m.fields=[]),m.fields.forEach(function(f){f.oneof?(oneofs[f.oneof]||(oneofs[f.oneof]=[]),oneofs[f.oneof].push(onfield(f,[]))):result.push(onfield(f,[]))}),Object.keys(oneofs).forEach(function(n){oneofs[n].unshift("oneof "+n+" {"),oneofs[n].push("}"),result.push(oneofs[n])}),result.push("}",""),result},onenum=function(e,result){result.push("enum "+e.name+" {"),e.options||(e.options={});var options=onoption(e.options,[]);return options.length>1&&result.push(options.slice(0,-1)),Object.keys(e.values).map(function(v){var val=onenumvalue(e.values[v]);result.push([v+" = "+val+";"])}),result.push("}",""),result},onenumvalue=function(v,result){var opts=Object.keys(v.options||{}).map(function(key){return key+" = "+v.options[key]}).join(",");return opts&&(opts=" ["+opts+"]"),v.value+opts},onoption=function(o,result){var keys=Object.keys(o);return keys.forEach(function(option){var v=o[option];~option.indexOf(".")&&(option="("+option+")");var type=typeof v;"object"===type?(v=onoptionMap(v,[]),v.length&&result.push("option "+option+" = {",v,"};")):("string"===type&&"optimize_for"!==option&&(v='"'+v+'"'),result.push("option "+option+" = "+v+";"))}),keys.length>0&&result.push(""),result},onoptionMap=function(o,result){return Object.keys(o).forEach(function(k){var v=o[k],type=typeof v;"object"===type?Array.isArray(v)?v.forEach(function(v){v=onoptionMap(v,[]),v.length&&result.push(k+" {",v,"}")}):(v=onoptionMap(v,[]),v.length&&result.push(k+" {",v,"}")):("string"===type&&(v='"'+v+'"'),result.push(k+": "+v))}),result},onservices=function(s,result){return result.push("service "+s.name+" {"),s.options||(s.options={}),onoption(s.options,result),s.methods||(s.methods=[]),s.methods.forEach(function(m){result.push(onrpc(m,[]))}),result.push("}",""),result},onrpc=function(rpc,result){var def="rpc "+rpc.name+"(";rpc.client_streaming&&(def+="stream "),def+=rpc.input_type+") returns (",rpc.server_streaming&&(def+="stream "),def+=rpc.output_type+")",rpc.options||(rpc.options={});var options=onoption(rpc.options,[]);return options.length>1?result.push(def+" {",options.slice(0,-1),"}"):result.push(def+";"),result},indent=function(lvl){return function(line){return Array.isArray(line)?line.map(indent(lvl+" ")).join("\n"):lvl+line}};module.exports=function(schema){var result=[];return result.push('syntax = "proto'+schema.syntax+'";',""),schema.package&&result.push("package "+schema.package+";",""),schema.options||(schema.options={}),onoption(schema.options,result),schema.enums||(schema.enums=[]),schema.enums.forEach(function(e){onenum(e,result)}),schema.messages||(schema.messages=[]),schema.messages.forEach(function(m){onmessage(m,result)}),schema.services&&schema.services.forEach(function(s){onservices(s,result)}),result.map(indent("")).join("\n")}},function(module,exports){module.exports=function(sch){var noComments=function(line){var i=line.indexOf("//");return i>-1?line.slice(0,i):line},trim=function(line){return line.trim()};return sch.replace(/([;,{}\(\)=\:\[\]<>]|\/\*|\*\/)/g," $1 ").split(/\n/).map(trim).filter(Boolean).map(noComments).map(trim).filter(Boolean).join("\n").split(/\s+|\n+/gm).filter(function(){var inside=!1;return function(token){return"/*"===token?(inside=!0,!1):"*/"===token?(inside=!1,!1):!inside}}())}},function(module,exports,__webpack_require__){(function(Buffer){var encodings=__webpack_require__(720),varint=__webpack_require__(16),genobj=__webpack_require__(427),genfun=__webpack_require__(426),flatten=function(values){if(!values)return null;var result={};return Object.keys(values).forEach(function(k){result[k]=values[k].value}),result},skip=function(type,buffer,offset){switch(type){case 0:return varint.decode(buffer,offset),offset+varint.decode.bytes;case 1:return offset+8;case 2:var len=varint.decode(buffer,offset);return offset+varint.decode.bytes+len;case 3:case 4:throw new Error("Groups are not supported");case 5:return offset+4}throw new Error("Unknown wire type: "+type)},defined=function(val){return null!==val&&void 0!==val&&("number"!=typeof val||!isNaN(val))},isString=function(def){try{return!!def&&"string"==typeof JSON.parse(def)}catch(err){return!1}},defaultValue=function(f,def){if(f.map)return"{}";if(f.repeated)return"[]";switch(f.type){case"string":return isString(def)?def:'""';case"bool":return"true"===def?"true":"false";case"float":case"double":case"sfixed32":case"fixed32":case"varint":case"enum":case"uint64":case"uint32":case"int64":case"int32":case"sint64":case"sint32":return""+Number(def||0);default:return"null"}};module.exports=function(schema,extraEncodings){var messages={},enums={},cache={},visit=function(schema,prefix){schema.enums&&schema.enums.forEach(function(e){e.id=prefix+(prefix?".":"")+e.name,enums[e.id]=e,visit(e,e.id)}),schema.messages&&schema.messages.forEach(function(m){m.id=prefix+(prefix?".":"")+m.name,messages[m.id]=m,m.fields.forEach(function(f){if(f.map){var name="Map_"+f.map.from+"_"+f.map.to,map={name:name,enums:[],messages:[],fields:[{name:"key",type:f.map.from,tag:1,repeated:!1,required:!0},{name:"value",type:f.map.to,tag:2,repeated:!1,required:!1}],extensions:null,id:prefix+(prefix?".":"")+name};messages[map.id]||(messages[map.id]=map,schema.messages.push(map)),f.type=name,f.repeated=!0}}),visit(m,m.id)})};visit(schema,"");var compileEnum=function(e){var conditions=Object.keys(e.values).map(function(k){return"val !== "+parseInt(e.values[k].value,10)}).join(" && ");conditions||(conditions="true");var encode=genfun()("function encode (val, buf, offset) {")('if (%s) throw new Error("Invalid enum value: "+val)',conditions)("varint.encode(val, buf, offset)")("encode.bytes = varint.encode.bytes")("return buf")("}").toFunction({varint:varint}),decode=genfun()("function decode (buf, offset) {")("var val = varint.decode(buf, offset)")('if (%s) throw new Error("Invalid enum value: "+val)',conditions)("decode.bytes = varint.decode.bytes")("return val")("}").toFunction({varint:varint});return encodings.make(0,encode,decode,varint.encodingLength) -},compileMessage=function(m,exports){m.messages.forEach(function(nested){exports[nested.name]=resolve(nested.name,m.id)}),m.enums.forEach(function(val){exports[val.name]=flatten(val.values)}),exports.type=2,exports.message=!0,exports.name=m.name;var oneofs={};m.fields.forEach(function(f){f.oneof&&(oneofs[f.oneof]||(oneofs[f.oneof]=[]),oneofs[f.oneof].push(f.name))});var enc=m.fields.map(function(f){return resolve(f.type,m.id)}),forEach=function(fn){for(var i=0;i 1) throw new Error(%s)",oneofs[name].map(function(prop){return"+defined("+genobj("obj",prop)+")"}).join(" + "),msg)}),forEach(function(e,f,val,i){var packed=f.repeated&&f.options&&f.options.packed&&"false"!==f.options.packed,hl=varint.encodingLength(f.tag<<3|e.type);f.required?encodingLength("if (!defined(%s)) throw new Error(%s)",val,JSON.stringify(f.name+" is required")):encodingLength("if (defined(%s)) {",val),f.map&&(encodingLength()("var tmp = Object.keys(%s)",val)("for (var i = 0; i < tmp.length; i++) {")("tmp[i] = {key: tmp[i], value: %s[tmp[i]]}",val)("}"),val="tmp"),packed?(encodingLength()("var packedLen = 0")("for (var i = 0; i < %s.length; i++) {",val)("if (!defined(%s)) continue",val+"[i]")("var len = enc[%d].encodingLength(%s)",i,val+"[i]")("packedLen += len"),e.message&&encodingLength("packedLen += varint.encodingLength(len)"),encodingLength("}")("if (packedLen) {")("length += %d + packedLen + varint.encodingLength(packedLen)",hl)("}")):(f.repeated&&(encodingLength("for (var i = 0; i < %s.length; i++) {",val),val+="[i]",encodingLength("if (!defined(%s)) continue",val)),encodingLength("var len = enc[%d].encodingLength(%s)",i,val),e.message&&encodingLength("length += varint.encodingLength(len)"),encodingLength("length += %d + len",hl),f.repeated&&encodingLength("}")),f.required||encodingLength("}")}),encodingLength()("return length")("}"),encodingLength=encodingLength.toFunction({defined:defined,varint:varint,enc:enc});var encode=genfun()("function encode (obj, buf, offset) {")("if (!offset) offset = 0")("if (!buf) buf = new Buffer(encodingLength(obj))")("var oldOffset = offset");Object.keys(oneofs).forEach(function(name){var msg=JSON.stringify("only one of the properties defined in oneof "+name+" can be set");encode("if ((%s) > 1) throw new Error(%s)",oneofs[name].map(function(prop){return"+defined("+genobj("obj",prop)+")"}).join(" + "),msg)}),forEach(function(e,f,val,i){f.required?encode("if (!defined(%s)) throw new Error(%s)",val,JSON.stringify(f.name+" is required")):encode("if (defined(%s)) {",val);var j,packed=f.repeated&&f.options&&f.options.packed&&"false"!==f.options.packed,p=varint.encode(f.tag<<3|2),h=varint.encode(f.tag<<3|e.type);if(f.map&&(encode()("var tmp = Object.keys(%s)",val)("for (var i = 0; i < tmp.length; i++) {")("tmp[i] = {key: tmp[i], value: %s[tmp[i]]}",val)("}"),val="tmp"),packed){for(encode()("var packedLen = 0")("for (var i = 0; i < %s.length; i++) {",val)("if (!defined(%s)) continue",val+"[i]")("packedLen += enc[%d].encodingLength(%s)",i,val+"[i]")("}"),encode("if (packedLen) {"),j=0;j> 3")("switch (tag) {"),forEach(function(e,f,val,i){var packed=f.repeated&&f.options&&f.options.packed&&"false"!==f.options.packed;decode("case %d:",f.tag),f.oneof&&m.fields.forEach(function(otherField){otherField.oneof===f.oneof&&f.name!==otherField.name&&decode("delete %s",genobj("obj",otherField.name))}),packed&&decode()("var packedEnd = varint.decode(buf, offset)")("offset += varint.decode.bytes")("packedEnd += offset")("while (offset < packedEnd) {"),e.message?(decode("var len = varint.decode(buf, offset)"),decode("offset += varint.decode.bytes"),f.map?(decode("var tmp = enc[%d].decode(buf, offset, offset + len)",i),decode("%s[tmp.key] = tmp.value",val)):f.repeated?decode("%s.push(enc[%d].decode(buf, offset, offset + len))",val,i):decode("%s = enc[%d].decode(buf, offset, offset + len)",val,i)):f.repeated?decode("%s.push(enc[%d].decode(buf, offset))",val,i):decode("%s = enc[%d].decode(buf, offset)",val,i),decode("offset += enc[%d].decode.bytes",i),packed&&decode("}"),f.required&&decode("found%d = true",i),decode("break")}),decode()("default:")("offset = skip(prefix & 7, buf, offset)")("}")("}")("}"),decode=decode.toFunction({varint:varint,skip:skip,enc:enc}),encode.bytes=decode.bytes=0,exports.buffer=!0,exports.encode=encode,exports.decode=decode,exports.encodingLength=encodingLength,exports},resolve=function(name,from,compile){if(extraEncodings&&extraEncodings[name])return extraEncodings[name];if(encodings[name])return encodings[name];var m=(from?from+"."+name:name).split(".").map(function(part,i,list){return list.slice(0,i).concat(name).join(".")}).reverse().reduce(function(result,id){return result||messages[id]||enums[id]},null);if(compile===!1)return m;if(!m)throw new Error("Could not resolve "+name);return m.values?compileEnum(m):cache[m.id]||compileMessage(m,cache[m.id]={})};return(schema.enums||[]).concat((schema.messages||[]).map(function(message){return resolve(message.id)}))}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){var varint=__webpack_require__(16),svarint=__webpack_require__(780),encoder=function(type,encode,decode,encodingLength){return encode.bytes=decode.bytes=0,{type:type,encode:encode,decode:decode,encodingLength:encodingLength}};exports.make=encoder,exports.bytes=function(tag){var bufferLength=function(val){return Buffer.isBuffer(val)?val.length:Buffer.byteLength(val)},encodingLength=function(val){var len=bufferLength(val);return varint.encodingLength(len)+len},encode=function(val,buffer,offset){var oldOffset=offset,len=bufferLength(val);return varint.encode(len,buffer,offset),offset+=varint.encode.bytes,Buffer.isBuffer(val)?val.copy(buffer,offset):buffer.write(val,offset,len),offset+=len,encode.bytes=offset-oldOffset,buffer},decode=function(buffer,offset){var oldOffset=offset,len=varint.decode(buffer,offset);offset+=varint.decode.bytes;var val=buffer.slice(offset,offset+len);return offset+=val.length,decode.bytes=offset-oldOffset,val};return encoder(2,encode,decode,encodingLength)}(),exports.string=function(){var encodingLength=function(val){var len=Buffer.byteLength(val);return varint.encodingLength(len)+len},encode=function(val,buffer,offset){var oldOffset=offset,len=Buffer.byteLength(val);return varint.encode(len,buffer,offset,"utf-8"),offset+=varint.encode.bytes,buffer.write(val,offset,len),offset+=len,encode.bytes=offset-oldOffset,buffer},decode=function(buffer,offset){var oldOffset=offset,len=varint.decode(buffer,offset);offset+=varint.decode.bytes;var val=buffer.toString("utf-8",offset,offset+len);return offset+=len,decode.bytes=offset-oldOffset,val};return encoder(2,encode,decode,encodingLength)}(),exports.bool=function(){var encodingLength=function(val){return 1},encode=function(val,buffer,offset){return buffer[offset]=val?1:0,encode.bytes=1,buffer},decode=function(buffer,offset){var bool=buffer[offset]>0;return decode.bytes=1,bool};return encoder(0,encode,decode,encodingLength)}(),exports.int32=function(){var decode=function(buffer,offset){var val=varint.decode(buffer,offset);return decode.bytes=varint.decode.bytes,val>2147483647?val-4294967296:val},encodingLength=function(val){return varint.encodingLength(val<0?val+4294967296:val)};return encoder(0,varint.encode,decode,encodingLength)}(),exports.int64=function(){var decode=function(buffer,offset){var val=varint.decode(buffer,offset);if(val>=Math.pow(2,63)){for(var limit=9;255===buffer[offset+limit-1];)limit--;limit=limit||9;var subset=new Buffer(limit);buffer.copy(subset,0,offset,offset+limit),subset[limit-1]=127&subset[limit-1],val=-1*varint.decode(subset,0),decode.bytes=10}else decode.bytes=varint.decode.bytes;return val},encode=function(val,buffer,offset){if(val<0){var last=offset+9;for(varint.encode(val*-1,buffer,offset),offset+=varint.encode.bytes-1,buffer[offset]=128|buffer[offset];offset-1};return{enumerable:op("enumerable"),configurable:op("configurable"),writable:op("writable"),value:value}};return function(obj,key,value,options){var k;if(options=makeOptions(value,options),"object"==typeof key){for(k in key)Object.hasOwnProperty.call(key,k)&&(options.value=key[k],setProperty(obj,k,options));return obj}return setProperty(obj,key,options)}})},function(module,exports,__webpack_require__){"use strict";var through=__webpack_require__(116),Buffer=__webpack_require__(13).Buffer;module.exports=function(size,opts){opts||(opts={}),"object"==typeof size&&(opts=size,size=opts.size),size=size||512;var zeroPadding;zeroPadding=!opts.nopad&&(void 0===opts.zeroPadding||opts.zeroPadding);var buffered=[],bufferedBytes=0,emittedChunk=!1;return through(function(data){for("number"==typeof data&&(data=Buffer([data])),bufferedBytes+=data.length,buffered.push(data);bufferedBytes>=size;){var b=Buffer.concat(buffered);bufferedBytes-=size,this.queue(b.slice(0,size)),buffered=[b.slice(size,b.length)],emittedChunk=!0}},function(end){if(opts.emitEmpty&&!emittedChunk||bufferedBytes){if(zeroPadding){var zeroes=Buffer.alloc(size-bufferedBytes);zeroes.fill(0),buffered.push(zeroes)}buffered&&(this.queue(Buffer.concat(buffered)),buffered=null)}this.queue(null)})}},function(module,exports){module.exports=function(onError){onError=onError||function(){};var errd;return function(read){return function(abort,cb){read(abort,function(end,data){if(errd)return cb(!0);if(end&&end!==!0){var _end=onError(end);return _end===!1?cb(end):_end&&_end!==!0?(errd=!0,cb(null,_end)):cb(!0)}cb(end,data)})}}}},function(module,exports){module.exports=function(){function delayed(_read){return stream?stream(_read):(read=_read,function(_abort,_cb){reader?reader(_abort,_cb):(abort=_abort,cb=_cb)})}var read,reader,cb,abort,stream;return delayed.resolve=function(_stream){if(stream)throw new Error("already resolved");if(!(stream=_stream))throw new Error("resolve *must* be passed a transform stream");read&&(reader=stream(read),cb&&reader(abort,cb))},delayed}},function(module,exports,__webpack_require__){"use strict";function decode(opts){let reader=new Reader,p=pushable(err=>{reader.abort(err)});return read=>{function next(){decodeFromReader(reader,opts,(err,msg)=>{if(err)return p.end(err);p.push(msg),next()})}return reader(read),next(),p}}function decodeFromReader(reader,opts,cb){"function"==typeof opts&&(cb=opts,opts={}),opts=Object.assign({fixed:!1,bytes:4},opts||{}),opts.fixed?readFixedMessage(reader,opts.bytes,opts.maxLength,cb):readVarintMessage(reader,opts.maxLength,cb)}function readFixedMessage(reader,byteLength,maxLength,cb){"function"==typeof maxLength&&(cb=maxLength,maxLength=MAX_LENGTH),reader.read(byteLength,(err,bytes)=>{if(err)return cb(err);const msgSize=bytes.readInt32BE(0);if(msgSize>maxLength)return cb("size longer than max permitted length of "+maxLength+"!");readMessage(reader,msgSize,cb)})}function readVarintMessage(reader,maxLength,cb){function readByte(){reader.read(1,(err,byte)=>{if(err)return cb(err);if(rawMsgSize.push(byte),byte&&!isEndByte(byte[0]))return void readByte();const msgSize=varint.decode(Buffer.concat(rawMsgSize));if(msgSize>maxLength)return cb("size longer than max permitted length of "+maxLength+"!");readMessage(reader,msgSize,(err,msg)=>{if(err)return cb(err);rawMsgSize=[],cb(null,msg)})})}"function"==typeof maxLength&&(cb=maxLength,maxLength=MAX_LENGTH);let rawMsgSize=[];0===rawMsgSize.length&&readByte()}function readMessage(reader,size,cb){reader.read(size,(err,msg)=>{if(err)return cb(err);cb(null,msg)})}const varint=__webpack_require__(16),Reader=__webpack_require__(298),Buffer=__webpack_require__(13).Buffer,pushable=__webpack_require__(36);exports.decode=decode,exports.decodeFromReader=decodeFromReader;const isEndByte=byte=>!(128&byte),MAX_LENGTH=4194304},function(module,exports,__webpack_require__){"use strict";function encode(opts){opts=Object.assign({fixed:!1,bytes:4},opts||{});const varint=__webpack_require__(16);let pool=opts.fixed?null:createPool(),used=0,ended=!1;return read=>(end,cb)=>{if(end&&(ended=end),ended)return cb(ended);read(null,(end,data)=>{if(end&&(ended=end),ended)return cb(ended);if(!Buffer.isBuffer(data))return ended=new Error("data must be a buffer"),cb(ended);let encodedLength;opts.fixed?(encodedLength=Buffer.alloc(opts.bytes),encodedLength.writeInt32BE(data.length,0)):(varint.encode(data.length,pool,used),used+=varint.encode.bytes,encodedLength=pool.slice(used-varint.encode.bytes,used),pool.length-used<100&&(pool=createPool(),used=0)),cb(null,Buffer.concat([encodedLength,data]))})}}function createPool(){return Buffer.alloc(poolSize)}const Buffer=__webpack_require__(13).Buffer;module.exports=encode;const poolSize=10240},function(module,exports){module.exports=function(ary){function create(stream){return{ready:!1,reading:!1,ended:!1,read:stream,data:null}}function check(){if(cb){clean();var l=inputs.length,_cb=cb;if(0===l&&(abort||capped))return cb=null,void _cb(abort||!0);for(var j=0;jinputs.length)throw new Error("this should never happen");if(!(current.reading||current.ended||current.ready)){current.reading=!0;var sync=!0;current.read(abort,function next(end,data){current.data=data,current.ready=!0,current.reading=!1,end===!0||abort?current.ended=!0:end&&(abort=current.ended=end),abort&&!end&¤t.read(abort,next),sync||check()}),sync=!1}}(inputs[l]);check()}function read(_abort,_cb){abort=abort||_abort,cb=_cb,next()}var abort,cb,capped=!!ary,inputs=(ary||[]).map(create),i=0;return read.add=function(stream){if(!stream)return capped=!0,next();inputs.push(create(stream)),next()},read.cap=function(err){read.add(null)},read}},function(module,exports){module.exports=function(fn){var active=!1,called=0;return function(){if(called=!0,!active){for(active=!0;called;)called=!1,fn();active=!1}}}},function(module,exports,__webpack_require__){(function(Buffer){module.exports=function(){var buffers=[],length=0;return{length:length,data:this,add:function(data){if(!Buffer.isBuffer(data))throw new Error("data must be a buffer, was: "+JSON.stringify(data));return this.length=length+=data.length,buffers.push(data),this},has:function(n){return null==n?length>0:length>=n},get:function(n){var _length;if(null==n||n===length){length=0;var _buffers=buffers;return buffers=[],1==_buffers.length?_buffers[0]:Buffer.concat(_buffers)}if(buffers.length>1&&n<=(_length=buffers[0].length)){var buf=buffers[0].slice(0,n);return n===_length?buffers.shift():buffers[0]=buffers[0].slice(n,_length),length-=n,buf}if(nmax?cb(!0):void cb(null,i++)}}},function(module,exports,__webpack_require__){"use strict";module.exports=function(){return function(abort,cb){cb(!0)}}},function(module,exports,__webpack_require__){"use strict";module.exports=function(err){return function(abort,cb){cb(err)}}},function(module,exports,__webpack_require__){"use strict";module.exports={keys:__webpack_require__(742),once:__webpack_require__(300),values:__webpack_require__(160),count:__webpack_require__(737),infinite:__webpack_require__(741),empty:__webpack_require__(738),error:__webpack_require__(739)}},function(module,exports,__webpack_require__){"use strict";module.exports=function(generate){return generate=generate||Math.random,function(end,cb){return end?cb&&cb(end):cb(null,generate())}}},function(module,exports,__webpack_require__){"use strict";var values=__webpack_require__(160);module.exports=function(object){return values(Object.keys(object))}},function(module,exports,__webpack_require__){"use strict";function id(e){return e}var prop=__webpack_require__(85);module.exports=function(map){if(!map)return id;map=prop(map);var abortCb,aborted,busy=!1;return function(read){return function next(abort,cb){if(aborted)return cb(aborted);abort?(aborted=abort,busy?read(abort,function(){busy?abortCb=cb:cb(abort)}):read(abort,cb)):read(null,function(end,data){end?cb(end):aborted?cb(aborted):(busy=!0,map(data,function(err,data){busy=!1,aborted?(cb(aborted),abortCb(aborted)):err?next(err,cb):cb(null,data)}))})}}}},function(module,exports,__webpack_require__){"use strict";var tester=__webpack_require__(303),filter=__webpack_require__(161);module.exports=function(test){return test=tester(test),filter(function(data){return!test(data)})}},function(module,exports,__webpack_require__){"use strict";var values=__webpack_require__(160),once=__webpack_require__(300);module.exports=function(){return function(read){var _read;return function(abort,cb){function nextChunk(){_read(null,function(err,data){err===!0?nextStream():err?read(!0,function(abortErr){cb(err)}):cb(null,data)})}function nextStream(){_read=null,read(null,function(end,stream){if(end)return cb(end);Array.isArray(stream)||stream&&"object"==typeof stream?stream=values(stream):"function"!=typeof stream&&(stream=once(stream)),_read=stream,nextChunk()})}abort?_read?_read(abort,function(err){read(err||abort,cb)}):read(abort,cb):_read?nextChunk():nextStream()}}}},function(module,exports,__webpack_require__){"use strict";module.exports={map:__webpack_require__(747),asyncMap:__webpack_require__(743),filter:__webpack_require__(161),filterNot:__webpack_require__(744),through:__webpack_require__(750),take:__webpack_require__(749),unique:__webpack_require__(301),nonUnique:__webpack_require__(748),flatten:__webpack_require__(745)}},function(module,exports,__webpack_require__){"use strict";function id(e){return e}var prop=__webpack_require__(85);module.exports=function(mapper){return mapper?(mapper=prop(mapper),function(read){return function(abort,cb){read(abort,function(end,data){try{data=end?null:mapper(data)}catch(err){return read(err,function(){return cb(err)})}cb(end,data)})}}):id}},function(module,exports,__webpack_require__){"use strict";var unique=__webpack_require__(301);module.exports=function(field){return unique(field,!0)}},function(module,exports,__webpack_require__){"use strict";module.exports=function(test,opts){opts=opts||{};var last=opts.last||!1,ended=!1;if("number"==typeof test){last=!0;var n=test;test=function(){return--n}}return function(read){function terminate(cb){read(!0,function(err){last=!1,cb(err||!0)})}return function(end,cb){ended?last?terminate(cb):cb(ended):(ended=end)?read(ended,cb):read(null,function(end,data){(ended=ended||end)?cb(ended):test(data)?cb(null,data):(ended=!0,last?cb(null,data):terminate(cb))})}}}},function(module,exports,__webpack_require__){"use strict";module.exports=function(op,onEnd){function once(abort){!a&&onEnd&&(a=!0,onEnd(abort===!0?null:abort))}var a=!1;return function(read){return function(end,cb){return end&&once(end),read(end,function(end,data){end?once(end):op&&op(data),cb(end,data)})}}}},function(module,exports){module.exports=function(fn){var active=!1,called=0;return function(){if(called=!0,!active){for(active=!0;called;)called=!1,fn();active=!1}}}},function(module,exports,__webpack_require__){"use strict";function isFunction(f){return"function"==typeof f}var WebSocket=__webpack_require__(757),duplex=__webpack_require__(753),wsurl=__webpack_require__(758);module.exports=function(addr,opts){isFunction(opts)&&(opts={onConnect:opts});var location="undefined"==typeof window?{}:window.location,url=wsurl(addr,location),socket=new WebSocket(url),stream=duplex(socket,opts);return stream.remoteAddress=url,stream.close=function(cb){isFunction(cb)&&socket.addEventListener("close",cb),socket.close()},socket.addEventListener("open",function(e){opts&&isFunction(opts.onConnect)&&opts.onConnect(null,stream)}),stream},module.exports.connect=module.exports},function(module,exports,__webpack_require__){function duplex(ws,opts){var req=ws.upgradeReq||{};return opts&&opts.binaryType?ws.binaryType=opts.binaryType:opts&&opts.binary&&(ws.binaryType="arraybuffer"),{source:source(ws,opts&&opts.onConnect),sink:sink(ws,opts),headers:req.headers,url:req.url,upgrade:req.upgrade,method:req.method}}var source=__webpack_require__(756),sink=__webpack_require__(755);module.exports=duplex},function(module,exports){module.exports=function(socket,callback){function cleanup(){"function"==typeof remove&&(remove.call(socket,"open",handleOpen),remove.call(socket,"error",handleErr))}function handleOpen(evt){cleanup(),callback()}function handleErr(evt){cleanup(),callback(evt)}var remove=socket&&(socket.removeEventListener||socket.removeListener);return socket.readyState>=2?callback(!0):1===socket.readyState?callback():(socket.addEventListener("open",handleOpen),void socket.addEventListener("error",handleErr))}},function(module,exports,__webpack_require__){(function(setImmediate,process){var ready=__webpack_require__(754),nextTick=void 0!==setImmediate?setImmediate:process.nextTick;module.exports=function(socket,opts){return function(read){function next(end,data){if(end)return void(closeOnEnd&&socket.readyState<=1&&(onClose&&socket.addEventListener("close",function(ev){if(ev.wasClean||1006===ev.code)onClose();else{var err=new Error("ws error");err.event=ev,onClose(err)}}),socket.close()));ready(socket,function(end){if(end)return read(end,function(){});socket.send(data),nextTick(function(){read(null,next)})})}opts=opts||{};var closeOnEnd=opts.closeOnEnd!==!1,onClose="function"==typeof opts?opts:opts.onClose;read(null,next)}}}).call(exports,__webpack_require__(22).setImmediate,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(Buffer){module.exports=function(socket,cb){function read(abort,cb){if(receiver=null,ended)return cb(ended);abort?(receiver=cb,socket.close()):buffer.length>0?cb(null,buffer.shift()):receiver=cb}var receiver,ended,buffer=[],started=!1;return socket.addEventListener("message",function(evt){var data=evt.data;if(data instanceof ArrayBuffer&&(data=new Buffer(data)),receiver)return receiver(null,data);buffer.push(data)}),socket.addEventListener("close",function(evt){ended||receiver&&receiver(ended=!0)}),socket.addEventListener("error",function(evt){ended||(ended=evt,started||(started=!0,cb&&cb(evt)),receiver&&receiver(ended))}),socket.addEventListener("open",function(evt){started||ended||(started=!0)}),read}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){module.exports="undefined"==typeof WebSocket?__webpack_require__(863):WebSocket},function(module,exports,__webpack_require__){var rurl=__webpack_require__(767),map={http:"ws",https:"wss"};module.exports=function(url,location){return rurl(url,location,map,"ws")}},function(module,exports,__webpack_require__){var once=__webpack_require__(82),eos=__webpack_require__(415),fs=__webpack_require__(864),noop=function(){},isFn=function(fn){return"function"==typeof fn},isFS=function(stream){return!!fs&&((stream instanceof(fs.ReadStream||noop)||stream instanceof(fs.WriteStream||noop))&&isFn(stream.close))},isRequest=function(stream){return stream.setHeader&&isFn(stream.abort)},destroyer=function(stream,reading,writing,callback){callback=once(callback);var closed=!1;stream.on("close",function(){closed=!0}),eos(stream,{readable:reading,writable:writing},function(err){if(err)return callback(err);closed=!0,callback()});var destroyed=!1;return function(err){if(!closed&&!destroyed)return destroyed=!0,isFS(stream)?stream.close():isRequest(stream)?stream.abort():isFn(stream.destroy)?stream.destroy():void callback(err||new Error("stream was destroyed"))}},call=function(fn){fn()},pipe=function(from,to){return from.pipe(to)},pump=function(){var streams=Array.prototype.slice.call(arguments),callback=isFn(streams[streams.length-1]||noop)&&streams.pop()||noop;if(Array.isArray(streams[0])&&(streams=streams[0]),streams.length<2)throw new Error("pump requires two streams per minimum");var error,destroys=streams.map(function(stream,i){var reading=i0,function(err){error||(error=err),err&&destroys.forEach(call),reading||(destroys.forEach(call),callback(error))})});return streams.reduce(pipe)};module.exports=pump},function(module,exports,__webpack_require__){(function(module,global){var __WEBPACK_AMD_DEFINE_RESULT__;!function(root){function error(type){throw new RangeError(errors[type])}function map(array,fn){for(var length=array.length,result=[];length--;)result[length]=fn(array[length]);return result}function mapDomain(string,fn){var parts=string.split("@"),result="";return parts.length>1&&(result=parts[0]+"@",string=parts[1]),string=string.replace(regexSeparators,"."),result+map(string.split("."),fn).join(".")}function ucs2decode(string){for(var value,extra,output=[],counter=0,length=string.length;counter=55296&&value<=56319&&counter65535&&(value-=65536,output+=stringFromCharCode(value>>>10&1023|55296),value=56320|1023&value),output+=stringFromCharCode(value)}).join("")}function basicToDigit(codePoint){return codePoint-48<10?codePoint-22:codePoint-65<26?codePoint-65:codePoint-97<26?codePoint-97:base}function digitToBasic(digit,flag){return digit+22+75*(digit<26)-((0!=flag)<<5)}function adapt(delta,numPoints,firstTime){var k=0;for(delta=firstTime?floor(delta/damp):delta>>1,delta+=floor(delta/numPoints);delta>baseMinusTMin*tMax>>1;k+=base)delta=floor(delta/baseMinusTMin);return floor(k+(baseMinusTMin+1)*delta/(delta+skew))}function decode(input){var out,basic,j,index,oldi,w,k,digit,t,baseMinusT,output=[],inputLength=input.length,i=0,n=initialN,bias=initialBias;for(basic=input.lastIndexOf(delimiter),basic<0&&(basic=0),j=0;j=128&&error("not-basic"),output.push(input.charCodeAt(j));for(index=basic>0?basic+1:0;index=inputLength&&error("invalid-input"),digit=basicToDigit(input.charCodeAt(index++)),(digit>=base||digit>floor((maxInt-i)/w))&&error("overflow"),i+=digit*w,t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias,!(digitfloor(maxInt/baseMinusT)&&error("overflow"),w*=baseMinusT;out=output.length+1,bias=adapt(i-oldi,out,0==oldi),floor(i/out)>maxInt-n&&error("overflow"),n+=floor(i/out),i%=out,output.splice(i++,0,n)}return ucs2encode(output)}function encode(input){var n,delta,handledCPCount,basicLength,bias,j,m,q,k,t,currentValue,inputLength,handledCPCountPlusOne,baseMinusT,qMinusT,output=[];for(input=ucs2decode(input),inputLength=input.length,n=initialN,delta=0,bias=initialBias,j=0;j=n&¤tValuefloor((maxInt-delta)/handledCPCountPlusOne)&&error("overflow"),delta+=(m-n)*handledCPCountPlusOne,n=m,j=0;jmaxInt&&error("overflow"),currentValue==n){for(q=delta,k=base;t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias,!(q= 0x80 (not a basic code point)","invalid-input":"Invalid input"},baseMinusTMin=base-tMin,floor=Math.floor,stringFromCharCode=String.fromCharCode;punycode={version:"1.4.1",ucs2:{decode:ucs2decode,encode:ucs2encode},decode:decode,encode:encode,toASCII:toASCII,toUnicode:toUnicode},void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(){return punycode}.call(exports,__webpack_require__,exports,module))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)}()}).call(exports,__webpack_require__(23)(module),__webpack_require__(4))},function(module,exports,__webpack_require__){"use strict";function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}module.exports=function(qs,sep,eq,options){sep=sep||"&",eq=eq||"=";var obj={};if("string"!=typeof qs||0===qs.length)return obj;qs=qs.split(sep);var maxKeys=1e3;options&&"number"==typeof options.maxKeys&&(maxKeys=options.maxKeys);var len=qs.length;maxKeys>0&&len>maxKeys&&(len=maxKeys);for(var i=0;i=0?(kstr=x.substr(0,idx),vstr=x.substr(idx+1)):(kstr=x,vstr=""),k=decodeURIComponent(kstr),v=decodeURIComponent(vstr),hasOwnProperty(obj,k)?isArray(obj[k])?obj[k].push(v):obj[k]=[obj[k],v]:obj[k]=v}return obj};var isArray=Array.isArray||function(xs){return"[object Array]"===Object.prototype.toString.call(xs)}},function(module,exports,__webpack_require__){"use strict";function map(xs,f){if(xs.map)return xs.map(f);for(var res=[],i=0;i65536)throw new Error("requested too many random bytes");var rawBytes=new global.Uint8Array(size);size>0&&crypto.getRandomValues(rawBytes);var bytes=new Buffer(rawBytes.buffer);return"function"==typeof cb?process.nextTick(function(){cb(null,bytes)}):bytes}var crypto=global.crypto||global.msCrypto;crypto&&crypto.getRandomValues?module.exports=randomBytes:module.exports=oldBrowser}).call(exports,__webpack_require__(4),__webpack_require__(0).Buffer,__webpack_require__(2))},function(module,exports,__webpack_require__){function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}module.exports=PassThrough;var Transform=__webpack_require__(306),util=__webpack_require__(6);util.inherits=__webpack_require__(1),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},function(module,exports){module.exports=Array.isArray||function(arr){return"[object Array]"==Object.prototype.toString.call(arr)}},function(module,exports,__webpack_require__){var URL=__webpack_require__(167);module.exports=function(url,location,protocolMap,defaultProtocol){protocolMap=protocolMap||{};var proto,url=URL.parse(url,!1,!0);return url.protocol?proto=url.protocol:(proto=location.protocol?location.protocol.replace(/:$/,""):"http",proto=(protocolMap[proto]||defaultProtocol||proto)+":"),url.host&&":"===url.host[0]&&(url.host=null),url.hostname?URL.format({protocol:proto,slashes:!0,hostname:url.hostname,port:url.port,pathname:url.pathname,search:url.search}):(url.host=location.host,url.port?URL.format({protocol:proto,slashes:!0,host:location.hostname+":"+url.port,port:url.port,pathname:url.pathname,search:url.search}):url.pathname?URL.format({protocol:proto,slashes:!0,host:url.host,pathname:url.pathname,search:url.search}):(url.pathname=location.pathname,url.search?URL.format({protocol:proto,slashes:!0,host:url.host,pathname:url.pathname,search:url.search}):(url.search=location.search,url.format(url))))}},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(310)(__webpack_require__(774))},function(module,exports,__webpack_require__){"use strict";(function(Buffer){var toString=Object.prototype.toString;exports.isArray=function(value,message){if(!Array.isArray(value))throw TypeError(message)},exports.isBoolean=function(value,message){if("[object Boolean]"!==toString.call(value))throw TypeError(message)},exports.isBuffer=function(value,message){if(!Buffer.isBuffer(value))throw TypeError(message)},exports.isFunction=function(value,message){if("[object Function]"!==toString.call(value))throw TypeError(message)},exports.isNumber=function(value,message){if("[object Number]"!==toString.call(value))throw TypeError(message)},exports.isObject=function(value,message){if("[object Object]"!==toString.call(value))throw TypeError(message)},exports.isBufferLength=function(buffer,length,message){if(buffer.length!==length)throw RangeError(message)},exports.isBufferLength2=function(buffer,length1,length2,message){if(buffer.length!==length1&&buffer.length!==length2)throw RangeError(message)},exports.isLengthGTZero=function(value,message){if(0===value.length)throw RangeError(message)},exports.isNumberInInterval=function(number,x,y,message){if(number<=x||number>=y)throw RangeError(message)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){var bip66=__webpack_require__(363),EC_PRIVKEY_EXPORT_DER_COMPRESSED=new Buffer([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),EC_PRIVKEY_EXPORT_DER_UNCOMPRESSED=new Buffer([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),ZERO_BUFFER_32=new Buffer([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);exports.privateKeyExport=function(privateKey,publicKey,compressed){var result=new Buffer(compressed?EC_PRIVKEY_EXPORT_DER_COMPRESSED:EC_PRIVKEY_EXPORT_DER_UNCOMPRESSED);return privateKey.copy(result,compressed?8:9),publicKey.copy(result,compressed?181:214),result},exports.privateKeyImport=function(privateKey){var length=privateKey.length,index=0;if(!(length2||length1?privateKey[index+lenb-2]<<8:0);if(index+=lenb,!(length32||length1&&0===r[posR]&&!(128&r[posR+1]);--lenR,++posR);for(var s=Buffer.concat([new Buffer([0]),sigObj.s]),lenS=33,posS=0;lenS>1&&0===s[posS]&&!(128&s[posS+1]);--lenS,++posS);return bip66.encode(r.slice(posR),s.slice(posS))},exports.signatureImport=function(sig){var r=new Buffer(ZERO_BUFFER_32),s=new Buffer(ZERO_BUFFER_32);try{var sigObj=bip66.decode(sig);if(33===sigObj.r.length&&0===sigObj.r[0]&&(sigObj.r=sigObj.r.slice(1)),sigObj.r.length>32)throw new Error("R length is too long");if(33===sigObj.s.length&&0===sigObj.s[0]&&(sigObj.s=sigObj.s.slice(1)),sigObj.s.length>32)throw new Error("S length is too long")}catch(err){return}return sigObj.r.copy(r,32-sigObj.r.length),sigObj.s.copy(s,32-sigObj.s.length),{r:r,s:s}},exports.signatureImportLax=function(sig){var r=new Buffer(ZERO_BUFFER_32),s=new Buffer(ZERO_BUFFER_32),length=sig.length,index=0;if(48===sig[index++]){var lenbyte=sig[index++];if(!(128&lenbyte&&(index+=lenbyte-128)>length)&&2===sig[index++]){var rlen=sig[index++];if(128&rlen){if(lenbyte=rlen-128,index+lenbyte>length)return;for(;lenbyte>0&&0===sig[index];index+=1,lenbyte-=1);for(rlen=0;lenbyte>0;index+=1,lenbyte-=1)rlen=(rlen<<8)+sig[index]}if(!(rlen>length-index)){var rindex=index;if(index+=rlen,2===sig[index++]){var slen=sig[index++];if(128&slen){if(lenbyte=slen-128,index+lenbyte>length)return;for(;lenbyte>0&&0===sig[index];index+=1,lenbyte-=1);for(slen=0;lenbyte>0;index+=1,lenbyte-=1)slen=(slen<<8)+sig[index]}if(!(slen>length-index)){var sindex=index;for(index+=slen;rlen>0&&0===sig[rindex];rlen-=1,rindex+=1);if(!(rlen>32)){var rvalue=sig.slice(rindex,rindex+rlen);for(rvalue.copy(r,32-rvalue.length);slen>0&&0===sig[sindex];slen-=1,sindex+=1);if(!(slen>32)){var svalue=sig.slice(sindex,sindex+slen);return svalue.copy(s,32-svalue.length),{r:r,s:s}}}}}}}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function loadCompressedPublicKey(first,xBuffer){var x=new BN(xBuffer);if(x.cmp(ecparams.p)>=0)return null;x=x.toRed(ecparams.red);var y=x.redSqr().redIMul(x).redIAdd(ecparams.b).redSqrt();return 3===first!==y.isOdd()&&(y=y.redNeg()),ec.keyPair({pub:{x:x,y:y}})}function loadUncompressedPublicKey(first,xBuffer,yBuffer){var x=new BN(xBuffer),y=new BN(yBuffer);if(x.cmp(ecparams.p)>=0||y.cmp(ecparams.p)>=0)return null;if(x=x.toRed(ecparams.red),y=y.toRed(ecparams.red),(6===first||7===first)&&y.isOdd()!==(7===first))return null;var x3=x.redSqr().redIMul(x);return y.redSqr().redISub(x3.redIAdd(ecparams.b)).isZero()?ec.keyPair({pub:{x:x,y:y}}):null}function loadPublicKey(publicKey){var first=publicKey[0];switch(first){case 2:case 3:return 33!==publicKey.length?null:loadCompressedPublicKey(first,publicKey.slice(1,33));case 4:case 6:case 7:return 65!==publicKey.length?null:loadUncompressedPublicKey(first,publicKey.slice(1,33),publicKey.slice(33,65));default:return null}}var createHash=__webpack_require__(75),BN=__webpack_require__(20),EC=__webpack_require__(27).ec,messages=__webpack_require__(140),ec=new EC("secp256k1"),ecparams=ec.curve;exports.privateKeyVerify=function(privateKey){var bn=new BN(privateKey);return bn.cmp(ecparams.n)<0&&!bn.isZero()},exports.privateKeyExport=function(privateKey,compressed){var d=new BN(privateKey);if(d.cmp(ecparams.n)>=0||d.isZero())throw new Error(messages.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return new Buffer(ec.keyFromPrivate(privateKey).getPublic(compressed,!0))},exports.privateKeyTweakAdd=function(privateKey,tweak){var bn=new BN(tweak);if(bn.cmp(ecparams.n)>=0)throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(bn.iadd(new BN(privateKey)),bn.cmp(ecparams.n)>=0&&bn.isub(ecparams.n),bn.isZero())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return bn.toArrayLike(Buffer,"be",32)},exports.privateKeyTweakMul=function(privateKey,tweak){var bn=new BN(tweak);if(bn.cmp(ecparams.n)>=0||bn.isZero())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);return bn.imul(new BN(privateKey)),bn.cmp(ecparams.n)&&(bn=bn.umod(ecparams.n)),bn.toArrayLike(Buffer,"be",32)},exports.publicKeyCreate=function(privateKey,compressed){var d=new BN(privateKey);if(d.cmp(ecparams.n)>=0||d.isZero())throw new Error(messages.EC_PUBLIC_KEY_CREATE_FAIL);return new Buffer(ec.keyFromPrivate(privateKey).getPublic(compressed,!0))},exports.publicKeyConvert=function(publicKey,compressed){var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);return new Buffer(pair.getPublic(compressed,!0))},exports.publicKeyVerify=function(publicKey){return null!==loadPublicKey(publicKey)},exports.publicKeyTweakAdd=function(publicKey,tweak,compressed){var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);if(tweak=new BN(tweak),tweak.cmp(ecparams.n)>=0)throw new Error(messages.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return new Buffer(ecparams.g.mul(tweak).add(pair.pub).encode(!0,compressed))},exports.publicKeyTweakMul=function(publicKey,tweak,compressed){var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);if(tweak=new BN(tweak),tweak.cmp(ecparams.n)>=0||tweak.isZero())throw new Error(messages.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return new Buffer(pair.pub.mul(tweak).encode(!0,compressed))},exports.publicKeyCombine=function(publicKeys,compressed){for(var pairs=new Array(publicKeys.length),i=0;i=0||s.cmp(ecparams.n)>=0)throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);var result=new Buffer(signature);return 1===s.cmp(ec.nh)&&ecparams.n.sub(s).toArrayLike(Buffer,"be",32).copy(result,32),result},exports.signatureExport=function(signature){var r=signature.slice(0,32),s=signature.slice(32,64);if(new BN(r).cmp(ecparams.n)>=0||new BN(s).cmp(ecparams.n)>=0)throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);return{r:r,s:s}},exports.signatureImport=function(sigObj){var r=new BN(sigObj.r);r.cmp(ecparams.n)>=0&&(r=new BN(0));var s=new BN(sigObj.s);return s.cmp(ecparams.n)>=0&&(s=new BN(0)),Buffer.concat([r.toArrayLike(Buffer,"be",32),s.toArrayLike(Buffer,"be",32)])},exports.sign=function(message,privateKey,noncefn,data){if("function"==typeof noncefn){var getNonce=noncefn;noncefn=function(counter){var nonce=getNonce(message,privateKey,null,data,counter);if(!Buffer.isBuffer(nonce)||32!==nonce.length)throw new Error(messages.ECDSA_SIGN_FAIL);return new BN(nonce)}}var d=new BN(privateKey);if(d.cmp(ecparams.n)>=0||d.isZero())throw new Error(messages.ECDSA_SIGN_FAIL);var result=ec.sign(message,privateKey,{canonical:!0,k:noncefn,pers:data});return{signature:Buffer.concat([result.r.toArrayLike(Buffer,"be",32),result.s.toArrayLike(Buffer,"be",32)]),recovery:result.recoveryParam}},exports.verify=function(message,signature,publicKey){var sigObj={r:signature.slice(0,32),s:signature.slice(32,64)},sigr=new BN(sigObj.r),sigs=new BN(sigObj.s);if(sigr.cmp(ecparams.n)>=0||sigs.cmp(ecparams.n)>=0)throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);if(1===sigs.cmp(ec.nh)||sigr.isZero()||sigs.isZero())return!1;var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);return ec.verify(message,sigObj,{x:pair.pub.x,y:pair.pub.y})},exports.recover=function(message,signature,recovery,compressed){var sigObj={r:signature.slice(0,32),s:signature.slice(32,64)},sigr=new BN(sigObj.r),sigs=new BN(sigObj.s);if(sigr.cmp(ecparams.n)>=0||sigs.cmp(ecparams.n)>=0)throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);try{if(sigr.isZero()||sigs.isZero())throw new Error;return new Buffer(ec.recoverPubKey(message,sigObj,recovery).encode(!0,compressed))}catch(err){throw new Error(messages.ECDSA_RECOVER_FAIL)}},exports.ecdh=function(publicKey,privateKey){var shared=exports.ecdhUnsafe(publicKey,privateKey,!0);return createHash("sha256").update(shared).digest()},exports.ecdhUnsafe=function(publicKey,privateKey,compressed){var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);var scalar=new BN(privateKey);if(scalar.cmp(ecparams.n)>=0||scalar.isZero())throw new Error(messages.ECDH_FAIL);return new Buffer(pair.pub.mul(scalar).encode(!0,compressed))}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.umulTo10x10=function(num1,num2,out){var lo,mid,hi,a=num1.words,b=num2.words,o=out.words,c=0,a0=0|a[0],al0=8191&a0,ah0=a0>>>13,a1=0|a[1],al1=8191&a1,ah1=a1>>>13,a2=0|a[2],al2=8191&a2,ah2=a2>>>13,a3=0|a[3],al3=8191&a3,ah3=a3>>>13,a4=0|a[4],al4=8191&a4,ah4=a4>>>13,a5=0|a[5],al5=8191&a5,ah5=a5>>>13,a6=0|a[6],al6=8191&a6,ah6=a6>>>13,a7=0|a[7],al7=8191&a7,ah7=a7>>>13,a8=0|a[8],al8=8191&a8,ah8=a8>>>13,a9=0|a[9],al9=8191&a9,ah9=a9>>>13,b0=0|b[0],bl0=8191&b0,bh0=b0>>>13,b1=0|b[1],bl1=8191&b1,bh1=b1>>>13,b2=0|b[2],bl2=8191&b2,bh2=b2>>>13,b3=0|b[3],bl3=8191&b3,bh3=b3>>>13,b4=0|b[4],bl4=8191&b4,bh4=b4>>>13,b5=0|b[5],bl5=8191&b5,bh5=b5>>>13,b6=0|b[6],bl6=8191&b6,bh6=b6>>>13,b7=0|b[7],bl7=8191&b7,bh7=b7>>>13,b8=0|b[8],bl8=8191&b8,bh8=b8>>>13,b9=0|b[9],bl9=8191&b9,bh9=b9>>>13;out.length=19,lo=Math.imul(al0,bl0),mid=Math.imul(al0,bh0),mid+=Math.imul(ah0,bl0),hi=Math.imul(ah0,bh0);var w0=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w0>>>26),w0&=67108863,lo=Math.imul(al1,bl0),mid=Math.imul(al1,bh0),mid+=Math.imul(ah1,bl0),hi=Math.imul(ah1,bh0),lo+=Math.imul(al0,bl1),mid+=Math.imul(al0,bh1),mid+=Math.imul(ah0,bl1),hi+=Math.imul(ah0,bh1);var w1=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w1>>>26),w1&=67108863,lo=Math.imul(al2,bl0),mid=Math.imul(al2,bh0),mid+=Math.imul(ah2,bl0),hi=Math.imul(ah2,bh0),lo+=Math.imul(al1,bl1),mid+=Math.imul(al1,bh1),mid+=Math.imul(ah1,bl1),hi+=Math.imul(ah1,bh1),lo+=Math.imul(al0,bl2),mid+=Math.imul(al0,bh2),mid+=Math.imul(ah0,bl2),hi+=Math.imul(ah0,bh2);var w2=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w2>>>26),w2&=67108863,lo=Math.imul(al3,bl0),mid=Math.imul(al3,bh0),mid+=Math.imul(ah3,bl0),hi=Math.imul(ah3,bh0),lo+=Math.imul(al2,bl1),mid+=Math.imul(al2,bh1),mid+=Math.imul(ah2,bl1),hi+=Math.imul(ah2,bh1),lo+=Math.imul(al1,bl2),mid+=Math.imul(al1,bh2),mid+=Math.imul(ah1,bl2),hi+=Math.imul(ah1,bh2),lo+=Math.imul(al0,bl3),mid+=Math.imul(al0,bh3),mid+=Math.imul(ah0,bl3),hi+=Math.imul(ah0,bh3);var w3=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w3>>>26),w3&=67108863,lo=Math.imul(al4,bl0),mid=Math.imul(al4,bh0),mid+=Math.imul(ah4,bl0),hi=Math.imul(ah4,bh0),lo+=Math.imul(al3,bl1),mid+=Math.imul(al3,bh1),mid+=Math.imul(ah3,bl1),hi+=Math.imul(ah3,bh1),lo+=Math.imul(al2,bl2),mid+=Math.imul(al2,bh2),mid+=Math.imul(ah2,bl2),hi+=Math.imul(ah2,bh2),lo+=Math.imul(al1,bl3),mid+=Math.imul(al1,bh3),mid+=Math.imul(ah1,bl3),hi+=Math.imul(ah1,bh3),lo+=Math.imul(al0,bl4),mid+=Math.imul(al0,bh4),mid+=Math.imul(ah0,bl4),hi+=Math.imul(ah0,bh4);var w4=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w4>>>26),w4&=67108863,lo=Math.imul(al5,bl0),mid=Math.imul(al5,bh0),mid+=Math.imul(ah5,bl0),hi=Math.imul(ah5,bh0),lo+=Math.imul(al4,bl1),mid+=Math.imul(al4,bh1),mid+=Math.imul(ah4,bl1),hi+=Math.imul(ah4,bh1),lo+=Math.imul(al3,bl2),mid+=Math.imul(al3,bh2),mid+=Math.imul(ah3,bl2),hi+=Math.imul(ah3,bh2),lo+=Math.imul(al2,bl3),mid+=Math.imul(al2,bh3),mid+=Math.imul(ah2,bl3),hi+=Math.imul(ah2,bh3),lo+=Math.imul(al1,bl4),mid+=Math.imul(al1,bh4),mid+=Math.imul(ah1,bl4),hi+=Math.imul(ah1,bh4),lo+=Math.imul(al0,bl5),mid+=Math.imul(al0,bh5),mid+=Math.imul(ah0,bl5),hi+=Math.imul(ah0,bh5);var w5=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w5>>>26),w5&=67108863,lo=Math.imul(al6,bl0),mid=Math.imul(al6,bh0),mid+=Math.imul(ah6,bl0),hi=Math.imul(ah6,bh0),lo+=Math.imul(al5,bl1),mid+=Math.imul(al5,bh1),mid+=Math.imul(ah5,bl1),hi+=Math.imul(ah5,bh1),lo+=Math.imul(al4,bl2),mid+=Math.imul(al4,bh2),mid+=Math.imul(ah4,bl2),hi+=Math.imul(ah4,bh2),lo+=Math.imul(al3,bl3),mid+=Math.imul(al3,bh3),mid+=Math.imul(ah3,bl3),hi+=Math.imul(ah3,bh3),lo+=Math.imul(al2,bl4),mid+=Math.imul(al2,bh4),mid+=Math.imul(ah2,bl4),hi+=Math.imul(ah2,bh4),lo+=Math.imul(al1,bl5),mid+=Math.imul(al1,bh5),mid+=Math.imul(ah1,bl5),hi+=Math.imul(ah1,bh5),lo+=Math.imul(al0,bl6),mid+=Math.imul(al0,bh6),mid+=Math.imul(ah0,bl6),hi+=Math.imul(ah0,bh6);var w6=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w6>>>26),w6&=67108863,lo=Math.imul(al7,bl0),mid=Math.imul(al7,bh0),mid+=Math.imul(ah7,bl0),hi=Math.imul(ah7,bh0),lo+=Math.imul(al6,bl1),mid+=Math.imul(al6,bh1),mid+=Math.imul(ah6,bl1),hi+=Math.imul(ah6,bh1),lo+=Math.imul(al5,bl2),mid+=Math.imul(al5,bh2),mid+=Math.imul(ah5,bl2),hi+=Math.imul(ah5,bh2),lo+=Math.imul(al4,bl3),mid+=Math.imul(al4,bh3),mid+=Math.imul(ah4,bl3),hi+=Math.imul(ah4,bh3),lo+=Math.imul(al3,bl4),mid+=Math.imul(al3,bh4),mid+=Math.imul(ah3,bl4),hi+=Math.imul(ah3,bh4),lo+=Math.imul(al2,bl5),mid+=Math.imul(al2,bh5),mid+=Math.imul(ah2,bl5),hi+=Math.imul(ah2,bh5),lo+=Math.imul(al1,bl6),mid+=Math.imul(al1,bh6),mid+=Math.imul(ah1,bl6),hi+=Math.imul(ah1,bh6),lo+=Math.imul(al0,bl7),mid+=Math.imul(al0,bh7),mid+=Math.imul(ah0,bl7),hi+=Math.imul(ah0,bh7);var w7=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w7>>>26),w7&=67108863,lo=Math.imul(al8,bl0),mid=Math.imul(al8,bh0),mid+=Math.imul(ah8,bl0),hi=Math.imul(ah8,bh0),lo+=Math.imul(al7,bl1),mid+=Math.imul(al7,bh1),mid+=Math.imul(ah7,bl1),hi+=Math.imul(ah7,bh1),lo+=Math.imul(al6,bl2),mid+=Math.imul(al6,bh2),mid+=Math.imul(ah6,bl2),hi+=Math.imul(ah6,bh2),lo+=Math.imul(al5,bl3),mid+=Math.imul(al5,bh3),mid+=Math.imul(ah5,bl3),hi+=Math.imul(ah5,bh3),lo+=Math.imul(al4,bl4),mid+=Math.imul(al4,bh4),mid+=Math.imul(ah4,bl4),hi+=Math.imul(ah4,bh4),lo+=Math.imul(al3,bl5),mid+=Math.imul(al3,bh5),mid+=Math.imul(ah3,bl5),hi+=Math.imul(ah3,bh5),lo+=Math.imul(al2,bl6),mid+=Math.imul(al2,bh6),mid+=Math.imul(ah2,bl6),hi+=Math.imul(ah2,bh6),lo+=Math.imul(al1,bl7),mid+=Math.imul(al1,bh7),mid+=Math.imul(ah1,bl7),hi+=Math.imul(ah1,bh7),lo+=Math.imul(al0,bl8),mid+=Math.imul(al0,bh8),mid+=Math.imul(ah0,bl8),hi+=Math.imul(ah0,bh8);var w8=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w8>>>26),w8&=67108863,lo=Math.imul(al9,bl0),mid=Math.imul(al9,bh0),mid+=Math.imul(ah9,bl0),hi=Math.imul(ah9,bh0),lo+=Math.imul(al8,bl1),mid+=Math.imul(al8,bh1),mid+=Math.imul(ah8,bl1),hi+=Math.imul(ah8,bh1),lo+=Math.imul(al7,bl2),mid+=Math.imul(al7,bh2),mid+=Math.imul(ah7,bl2),hi+=Math.imul(ah7,bh2),lo+=Math.imul(al6,bl3),mid+=Math.imul(al6,bh3),mid+=Math.imul(ah6,bl3),hi+=Math.imul(ah6,bh3),lo+=Math.imul(al5,bl4),mid+=Math.imul(al5,bh4),mid+=Math.imul(ah5,bl4),hi+=Math.imul(ah5,bh4),lo+=Math.imul(al4,bl5),mid+=Math.imul(al4,bh5),mid+=Math.imul(ah4,bl5),hi+=Math.imul(ah4,bh5),lo+=Math.imul(al3,bl6),mid+=Math.imul(al3,bh6),mid+=Math.imul(ah3,bl6),hi+=Math.imul(ah3,bh6),lo+=Math.imul(al2,bl7),mid+=Math.imul(al2,bh7),mid+=Math.imul(ah2,bl7),hi+=Math.imul(ah2,bh7),lo+=Math.imul(al1,bl8),mid+=Math.imul(al1,bh8),mid+=Math.imul(ah1,bl8),hi+=Math.imul(ah1,bh8),lo+=Math.imul(al0,bl9),mid+=Math.imul(al0,bh9),mid+=Math.imul(ah0,bl9),hi+=Math.imul(ah0,bh9);var w9=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w9>>>26),w9&=67108863,lo=Math.imul(al9,bl1),mid=Math.imul(al9,bh1),mid+=Math.imul(ah9,bl1),hi=Math.imul(ah9,bh1),lo+=Math.imul(al8,bl2),mid+=Math.imul(al8,bh2),mid+=Math.imul(ah8,bl2),hi+=Math.imul(ah8,bh2),lo+=Math.imul(al7,bl3),mid+=Math.imul(al7,bh3),mid+=Math.imul(ah7,bl3),hi+=Math.imul(ah7,bh3),lo+=Math.imul(al6,bl4),mid+=Math.imul(al6,bh4),mid+=Math.imul(ah6,bl4),hi+=Math.imul(ah6,bh4),lo+=Math.imul(al5,bl5),mid+=Math.imul(al5,bh5),mid+=Math.imul(ah5,bl5),hi+=Math.imul(ah5,bh5),lo+=Math.imul(al4,bl6),mid+=Math.imul(al4,bh6),mid+=Math.imul(ah4,bl6),hi+=Math.imul(ah4,bh6),lo+=Math.imul(al3,bl7),mid+=Math.imul(al3,bh7),mid+=Math.imul(ah3,bl7),hi+=Math.imul(ah3,bh7),lo+=Math.imul(al2,bl8),mid+=Math.imul(al2,bh8),mid+=Math.imul(ah2,bl8),hi+=Math.imul(ah2,bh8),lo+=Math.imul(al1,bl9),mid+=Math.imul(al1,bh9),mid+=Math.imul(ah1,bl9),hi+=Math.imul(ah1,bh9);var w10=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w10>>>26),w10&=67108863,lo=Math.imul(al9,bl2),mid=Math.imul(al9,bh2),mid+=Math.imul(ah9,bl2),hi=Math.imul(ah9,bh2),lo+=Math.imul(al8,bl3),mid+=Math.imul(al8,bh3),mid+=Math.imul(ah8,bl3),hi+=Math.imul(ah8,bh3),lo+=Math.imul(al7,bl4),mid+=Math.imul(al7,bh4),mid+=Math.imul(ah7,bl4),hi+=Math.imul(ah7,bh4),lo+=Math.imul(al6,bl5),mid+=Math.imul(al6,bh5),mid+=Math.imul(ah6,bl5),hi+=Math.imul(ah6,bh5),lo+=Math.imul(al5,bl6),mid+=Math.imul(al5,bh6),mid+=Math.imul(ah5,bl6),hi+=Math.imul(ah5,bh6),lo+=Math.imul(al4,bl7),mid+=Math.imul(al4,bh7),mid+=Math.imul(ah4,bl7),hi+=Math.imul(ah4,bh7),lo+=Math.imul(al3,bl8),mid+=Math.imul(al3,bh8),mid+=Math.imul(ah3,bl8),hi+=Math.imul(ah3,bh8),lo+=Math.imul(al2,bl9),mid+=Math.imul(al2,bh9),mid+=Math.imul(ah2,bl9),hi+=Math.imul(ah2,bh9);var w11=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w11>>>26),w11&=67108863,lo=Math.imul(al9,bl3),mid=Math.imul(al9,bh3),mid+=Math.imul(ah9,bl3),hi=Math.imul(ah9,bh3),lo+=Math.imul(al8,bl4),mid+=Math.imul(al8,bh4),mid+=Math.imul(ah8,bl4),hi+=Math.imul(ah8,bh4),lo+=Math.imul(al7,bl5),mid+=Math.imul(al7,bh5),mid+=Math.imul(ah7,bl5),hi+=Math.imul(ah7,bh5),lo+=Math.imul(al6,bl6),mid+=Math.imul(al6,bh6),mid+=Math.imul(ah6,bl6),hi+=Math.imul(ah6,bh6),lo+=Math.imul(al5,bl7),mid+=Math.imul(al5,bh7),mid+=Math.imul(ah5,bl7),hi+=Math.imul(ah5,bh7),lo+=Math.imul(al4,bl8),mid+=Math.imul(al4,bh8),mid+=Math.imul(ah4,bl8),hi+=Math.imul(ah4,bh8),lo+=Math.imul(al3,bl9),mid+=Math.imul(al3,bh9),mid+=Math.imul(ah3,bl9),hi+=Math.imul(ah3,bh9);var w12=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w12>>>26),w12&=67108863,lo=Math.imul(al9,bl4),mid=Math.imul(al9,bh4),mid+=Math.imul(ah9,bl4),hi=Math.imul(ah9,bh4),lo+=Math.imul(al8,bl5),mid+=Math.imul(al8,bh5),mid+=Math.imul(ah8,bl5),hi+=Math.imul(ah8,bh5),lo+=Math.imul(al7,bl6),mid+=Math.imul(al7,bh6),mid+=Math.imul(ah7,bl6),hi+=Math.imul(ah7,bh6),lo+=Math.imul(al6,bl7),mid+=Math.imul(al6,bh7),mid+=Math.imul(ah6,bl7),hi+=Math.imul(ah6,bh7),lo+=Math.imul(al5,bl8),mid+=Math.imul(al5,bh8),mid+=Math.imul(ah5,bl8),hi+=Math.imul(ah5,bh8),lo+=Math.imul(al4,bl9),mid+=Math.imul(al4,bh9),mid+=Math.imul(ah4,bl9),hi+=Math.imul(ah4,bh9);var w13=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w13>>>26),w13&=67108863,lo=Math.imul(al9,bl5),mid=Math.imul(al9,bh5),mid+=Math.imul(ah9,bl5),hi=Math.imul(ah9,bh5),lo+=Math.imul(al8,bl6),mid+=Math.imul(al8,bh6),mid+=Math.imul(ah8,bl6),hi+=Math.imul(ah8,bh6),lo+=Math.imul(al7,bl7),mid+=Math.imul(al7,bh7),mid+=Math.imul(ah7,bl7),hi+=Math.imul(ah7,bh7),lo+=Math.imul(al6,bl8),mid+=Math.imul(al6,bh8),mid+=Math.imul(ah6,bl8),hi+=Math.imul(ah6,bh8),lo+=Math.imul(al5,bl9),mid+=Math.imul(al5,bh9),mid+=Math.imul(ah5,bl9),hi+=Math.imul(ah5,bh9);var w14=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w14>>>26),w14&=67108863,lo=Math.imul(al9,bl6),mid=Math.imul(al9,bh6),mid+=Math.imul(ah9,bl6),hi=Math.imul(ah9,bh6),lo+=Math.imul(al8,bl7),mid+=Math.imul(al8,bh7),mid+=Math.imul(ah8,bl7),hi+=Math.imul(ah8,bh7),lo+=Math.imul(al7,bl8),mid+=Math.imul(al7,bh8),mid+=Math.imul(ah7,bl8),hi+=Math.imul(ah7,bh8),lo+=Math.imul(al6,bl9),mid+=Math.imul(al6,bh9),mid+=Math.imul(ah6,bl9),hi+=Math.imul(ah6,bh9);var w15=c+lo+((8191&mid)<<13) -;c=hi+(mid>>>13)+(w15>>>26),w15&=67108863,lo=Math.imul(al9,bl7),mid=Math.imul(al9,bh7),mid+=Math.imul(ah9,bl7),hi=Math.imul(ah9,bh7),lo+=Math.imul(al8,bl8),mid+=Math.imul(al8,bh8),mid+=Math.imul(ah8,bl8),hi+=Math.imul(ah8,bh8),lo+=Math.imul(al7,bl9),mid+=Math.imul(al7,bh9),mid+=Math.imul(ah7,bl9),hi+=Math.imul(ah7,bh9);var w16=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w16>>>26),w16&=67108863,lo=Math.imul(al9,bl8),mid=Math.imul(al9,bh8),mid+=Math.imul(ah9,bl8),hi=Math.imul(ah9,bh8),lo+=Math.imul(al8,bl9),mid+=Math.imul(al8,bh9),mid+=Math.imul(ah8,bl9),hi+=Math.imul(ah8,bh9);var w17=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w17>>>26),w17&=67108863,lo=Math.imul(al9,bl9),mid=Math.imul(al9,bh9),mid+=Math.imul(ah9,bl9),hi=Math.imul(ah9,bh9);var w18=c+lo+((8191&mid)<<13);return c=hi+(mid>>>13)+(w18>>>26),w18&=67108863,o[0]=w0,o[1]=w1,o[2]=w2,o[3]=w3,o[4]=w4,o[5]=w5,o[6]=w6,o[7]=w7,o[8]=w8,o[9]=w9,o[10]=w10,o[11]=w11,o[12]=w12,o[13]=w13,o[14]=w14,o[15]=w15,o[16]=w16,o[17]=w17,o[18]=w18,0!==c&&(o[19]=c,out.length++),out}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function ECPointG(){this.x=BN.fromBuffer(new Buffer("79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","hex")),this.y=BN.fromBuffer(new Buffer("483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8","hex")),this.inf=!1,this._precompute()}var BN=__webpack_require__(118),ECPoint=__webpack_require__(312),ECJPoint=__webpack_require__(311);ECPointG.prototype._precompute=function(){for(var ecpoint=new ECPoint(this.x,this.y),points=new Array(1+Math.ceil(64.25)),acc=points[0]=ecpoint,i=1;i=j;k--)nafW=(nafW<<1)+naf[k];repr.push(nafW)}for(var a=new ECJPoint(null,null,null),b=new ECJPoint(null,null,null),i=I;i>0;i--){for(var jj=0;jj=0;i--){for(var k=0;i>=0&&(tmp[0]=0|naf[0][i],tmp[1]=0|naf[1][i],0===tmp[0]&&0===tmp[1]);++k,--i);if(i>=0&&(k+=1),acc=acc.dblp(k),i<0)break;for(var jj=0;jj<2;jj++){var p,z=tmp[jj];0!==z&&(z>0?p=wnd[jj][z>>1]:z<0&&(p=wnd[jj][-z>>1].neg()),acc=void 0===p.z?acc.mixedAdd(p):acc.add(p))}}return acc},module.exports=new ECPointG}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){var createHash=__webpack_require__(75),HmacDRBG=__webpack_require__(395),messages=__webpack_require__(140),BN=__webpack_require__(118),ECPoint=__webpack_require__(312),g=__webpack_require__(773);exports.privateKeyVerify=function(privateKey){var bn=BN.fromBuffer(privateKey);return!(bn.isOverflow()||bn.isZero())},exports.privateKeyExport=function(privateKey,compressed){var d=BN.fromBuffer(privateKey);if(d.isOverflow()||d.isZero())throw new Error(messages.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return g.mul(d).toPublicKey(compressed)},exports.privateKeyTweakAdd=function(privateKey,tweak){var bn=BN.fromBuffer(tweak);if(bn.isOverflow())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(bn.iadd(BN.fromBuffer(privateKey)),bn.isOverflow()&&bn.isub(BN.n),bn.isZero())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return bn.toBuffer()},exports.privateKeyTweakMul=function(privateKey,tweak){var bn=BN.fromBuffer(tweak);if(bn.isOverflow()||bn.isZero())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);var d=BN.fromBuffer(privateKey);return bn.umul(d).ureduce().toBuffer()},exports.publicKeyCreate=function(privateKey,compressed){var d=BN.fromBuffer(privateKey);if(d.isOverflow()||d.isZero())throw new Error(messages.EC_PUBLIC_KEY_CREATE_FAIL);return g.mul(d).toPublicKey(compressed)},exports.publicKeyConvert=function(publicKey,compressed){var point=ECPoint.fromPublicKey(publicKey);if(null===point)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);return point.toPublicKey(compressed)},exports.publicKeyVerify=function(publicKey){return null!==ECPoint.fromPublicKey(publicKey)},exports.publicKeyTweakAdd=function(publicKey,tweak,compressed){var point=ECPoint.fromPublicKey(publicKey);if(null===point)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);if(tweak=BN.fromBuffer(tweak),tweak.isOverflow())throw new Error(messages.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return g.mul(tweak).add(point).toPublicKey(compressed)},exports.publicKeyTweakMul=function(publicKey,tweak,compressed){var point=ECPoint.fromPublicKey(publicKey);if(null===point)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);if(tweak=BN.fromBuffer(tweak),tweak.isOverflow()||tweak.isZero())throw new Error(messages.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return point.mul(tweak).toPublicKey(compressed)},exports.publicKeyCombine=function(publicKeys,compressed){for(var points=new Array(publicKeys.length),i=0;i=0)&&0===sigr.iadd(BN.psn).redMul(z2).ucmp(point.x)},exports.recover=function(message,signature,recovery,compressed){var sigr=BN.fromBuffer(signature.slice(0,32)),sigs=BN.fromBuffer(signature.slice(32,64));if(sigr.isOverflow()||sigs.isOverflow())throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);do{if(sigr.isZero()||sigs.isZero())break;var kpx=sigr;if(recovery>>1){if(kpx.ucmp(BN.psn)>=0)break;kpx=sigr.add(BN.n)}var kpPublicKey=Buffer.concat([new Buffer([2+(1&recovery)]),kpx.toBuffer()]),kp=ECPoint.fromPublicKey(kpPublicKey);if(null===kp)break;var rInv=sigr.uinvm(),s1=BN.n.sub(BN.fromBuffer(message)).umul(rInv).ureduce(),s2=sigs.umul(rInv).ureduce();return ECPoint.fromECJPoint(g.mulAdd(s1,kp,s2)).toPublicKey(compressed)}while(!1);throw new Error(messages.ECDSA_RECOVER_FAIL)},exports.ecdh=function(publicKey,privateKey){var shared=exports.ecdhUnsafe(publicKey,privateKey,!0);return createHash("sha256").update(shared).digest()},exports.ecdhUnsafe=function(publicKey,privateKey,compressed){var point=ECPoint.fromPublicKey(publicKey);if(null===point)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);var scalar=BN.fromBuffer(privateKey);if(scalar.isOverflow()||scalar.isZero())throw new Error(messages.ECDH_FAIL);return point.mul(scalar).toPublicKey(compressed)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(global,process){!function(global,undefined){"use strict";function setImmediate(callback){"function"!=typeof callback&&(callback=new Function(""+callback));for(var args=new Array(arguments.length-1),i=0;i>>27}function rotl30(num){return num<<30|num>>>2}function ft(s,b,c,d){return 0===s?b&c|~b&d:2===s?b&c|b&d|c&d:b^c^d}var inherits=__webpack_require__(1),Hash=__webpack_require__(69),K=[1518500249,1859775393,-1894007588,-899497514],W=new Array(80);inherits(Sha,Hash),Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha.prototype._update=function(M){for(var W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<80;++i)W[i]=W[i-3]^W[i-8]^W[i-14]^W[i-16];for(var j=0;j<80;++j){var s=~~(j/20),t=rotl5(a)+ft(s,b,c,d)+e+W[j]+K[s]|0;e=d,d=c,c=rotl30(b),b=a,a=t}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0},Sha.prototype._hash=function(){var H=new Buffer(20);return H.writeInt32BE(0|this._a,0),H.writeInt32BE(0|this._b,4),H.writeInt32BE(0|this._c,8),H.writeInt32BE(0|this._d,12),H.writeInt32BE(0|this._e,16),H},module.exports=Sha}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Sha1(){this.init(),this._w=W,Hash.call(this,64,56)}function rotl1(num){return num<<1|num>>>31}function rotl5(num){return num<<5|num>>>27}function rotl30(num){return num<<30|num>>>2}function ft(s,b,c,d){return 0===s?b&c|~b&d:2===s?b&c|b&d|c&d:b^c^d}var inherits=__webpack_require__(1),Hash=__webpack_require__(69),K=[1518500249,1859775393,-1894007588,-899497514],W=new Array(80);inherits(Sha1,Hash),Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha1.prototype._update=function(M){for(var W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<80;++i)W[i]=rotl1(W[i-3]^W[i-8]^W[i-14]^W[i-16]);for(var j=0;j<80;++j){var s=~~(j/20),t=rotl5(a)+ft(s,b,c,d)+e+W[j]+K[s]|0;e=d,d=c,c=rotl30(b),b=a,a=t}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0},Sha1.prototype._hash=function(){var H=new Buffer(20);return H.writeInt32BE(0|this._a,0),H.writeInt32BE(0|this._b,4),H.writeInt32BE(0|this._c,8),H.writeInt32BE(0|this._d,12),H.writeInt32BE(0|this._e,16),H},module.exports=Sha1}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Sha224(){this.init(),this._w=W,Hash.call(this,64,56)}var inherits=__webpack_require__(1),Sha256=__webpack_require__(314),Hash=__webpack_require__(69),W=new Array(64);inherits(Sha224,Sha256),Sha224.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},Sha224.prototype._hash=function(){var H=new Buffer(28);return H.writeInt32BE(this._a,0),H.writeInt32BE(this._b,4),H.writeInt32BE(this._c,8),H.writeInt32BE(this._d,12),H.writeInt32BE(this._e,16),H.writeInt32BE(this._f,20),H.writeInt32BE(this._g,24),H},module.exports=Sha224}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Sha384(){this.init(),this._w=W,Hash.call(this,128,112)}var inherits=__webpack_require__(1),SHA512=__webpack_require__(315),Hash=__webpack_require__(69),W=new Array(160);inherits(Sha384,SHA512),Sha384.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},Sha384.prototype._hash=function(){function writeInt64BE(h,l,offset){H.writeInt32BE(h,offset),H.writeInt32BE(l,offset+4)}var H=new Buffer(48);return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),H},module.exports=Sha384}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){var varint=__webpack_require__(16);exports.encode=function encode(v,b,o){v=v>=0?2*v:v*-2-1;var r=varint.encode(v,b,o);return encode.bytes=varint.encode.bytes,r},exports.decode=function decode(b,o){var v=varint.decode(b,o);return decode.bytes=varint.decode.bytes,1&v?(v+1)/-2:v/2},exports.encodingLength=function(v){return varint.encodingLength(v>=0?2*v:v*-2-1)}},function(module,exports,__webpack_require__){(function(Buffer){function Peer(opts){var self=this;if(!(self instanceof Peer))return new Peer(opts);if(self._id=randombytes(4).toString("hex").slice(0,7),self._debug("new peer %o",opts),opts=Object.assign({allowHalfOpen:!1},opts),stream.Duplex.call(self,opts),self.channelName=opts.initiator?opts.channelName||randombytes(20).toString("hex"):null,self._isChromium="undefined"!=typeof window&&!!window.webkitRTCPeerConnection,self.initiator=opts.initiator||!1,self.channelConfig=opts.channelConfig||Peer.channelConfig,self.config=opts.config||Peer.config,self.constraints=self._transformConstraints(opts.constraints||Peer.constraints),self.offerConstraints=self._transformConstraints(opts.offerConstraints||{}),self.answerConstraints=self._transformConstraints(opts.answerConstraints||{}),self.reconnectTimer=opts.reconnectTimer||!1,self.sdpTransform=opts.sdpTransform||function(sdp){return sdp},self.stream=opts.stream||!1,self.trickle=void 0===opts.trickle||opts.trickle,self.destroyed=!1,self.connected=!1,self.remoteAddress=void 0,self.remoteFamily=void 0,self.remotePort=void 0,self.localAddress=void 0,self.localPort=void 0,self._wrtc=opts.wrtc&&"object"==typeof opts.wrtc?opts.wrtc:getBrowserRTC(),!self._wrtc)throw"undefined"==typeof window?new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"):new Error("No WebRTC support: Not a supported browser");if(self._pcReady=!1,self._channelReady=!1,self._iceComplete=!1,self._channel=null,self._pendingCandidates=[],self._previousStreams=[],self._chunk=null,self._cb=null,self._interval=null,self._reconnectTimeout=null,self._pc=new self._wrtc.RTCPeerConnection(self.config,self.constraints),self._isWrtc=Array.isArray(self._pc.RTCIceConnectionStates),self._isReactNativeWebrtc="number"==typeof self._pc._peerConnectionId,self._pc.oniceconnectionstatechange=function(){self._onIceStateChange()},self._pc.onicegatheringstatechange=function(){self._onIceStateChange()},self._pc.onsignalingstatechange=function(){self._onSignalingStateChange()},self._pc.onicecandidate=function(event){self._onIceCandidate(event)},self.initiator){var createdOffer=!1;self._pc.onnegotiationneeded=function(){createdOffer||self._createOffer(),createdOffer=!0},self._setupData({channel:self._pc.createDataChannel(self.channelName,self.channelConfig)})}else self._pc.ondatachannel=function(event){self._setupData(event)};"addTrack"in self._pc?(self.stream&&self.stream.getTracks().forEach(function(track){self._pc.addTrack(track,self.stream)}),self._pc.ontrack=function(event){self._onTrack(event)}):(self.stream&&self._pc.addStream(self.stream),self._pc.onaddstream=function(event){self._onAddStream(event)}),self.initiator&&self._isWrtc&&self._pc.onnegotiationneeded(),self._onFinishBound=function(){self._onFinish()},self.once("finish",self._onFinishBound)}function noop(){}module.exports=Peer;var debug=__webpack_require__(3)("simple-peer"),getBrowserRTC=__webpack_require__(428),inherits=__webpack_require__(1),randombytes=__webpack_require__(764),stream=__webpack_require__(784);inherits(Peer,stream.Duplex),Peer.WEBRTC_SUPPORT=!!getBrowserRTC(),Peer.config={iceServers:[{urls:"stun:stun.l.google.com:19302"},{urls:"stun:global.stun.twilio.com:3478?transport=udp"}]},Peer.constraints={},Peer.channelConfig={},Object.defineProperty(Peer.prototype,"bufferSize",{get:function(){var self=this;return self._channel&&self._channel.bufferedAmount||0}}),Peer.prototype.address=function(){var self=this;return{port:self.localPort,family:"IPv4",address:self.localAddress}},Peer.prototype.signal=function(data){var self=this;if(self.destroyed)throw new Error("cannot signal after peer is destroyed");if("string"==typeof data)try{data=JSON.parse(data)}catch(err){data={}}self._debug("signal()"),data.candidate&&(self._pc.remoteDescription?self._addIceCandidate(data.candidate):self._pendingCandidates.push(data.candidate)),data.sdp&&self._pc.setRemoteDescription(new self._wrtc.RTCSessionDescription(data),function(){self.destroyed||(self._pendingCandidates.forEach(function(candidate){self._addIceCandidate(candidate)}),self._pendingCandidates=[],"offer"===self._pc.remoteDescription.type&&self._createAnswer())},function(err){self._destroy(err)}),data.sdp||data.candidate||self._destroy(new Error("signal() called with invalid signal data"))},Peer.prototype._addIceCandidate=function(candidate){var self=this;try{self._pc.addIceCandidate(new self._wrtc.RTCIceCandidate(candidate),noop,function(err){self._destroy(err)})}catch(err){self._destroy(new Error("error adding candidate: "+err.message))}},Peer.prototype.send=function(chunk){var self=this;self._isWrtc&&Buffer.isBuffer(chunk)&&(chunk=new Uint8Array(chunk)),self._channel.send(chunk)},Peer.prototype.destroy=function(onclose){this._destroy(null,onclose)},Peer.prototype._destroy=function(err,onclose){var self=this;if(!self.destroyed){if(onclose&&self.once("close",onclose),self._debug("destroy (error: %s)",err&&(err.message||err)),self.readable=self.writable=!1,self._readableState.ended||self.push(null),self._writableState.finished||self.end(),self.destroyed=!0,self.connected=!1,self._pcReady=!1,self._channelReady=!1,self._previousStreams=null,clearInterval(self._interval),clearTimeout(self._reconnectTimeout),self._interval=null,self._reconnectTimeout=null,self._chunk=null,self._cb=null,self._onFinishBound&&self.removeListener("finish",self._onFinishBound),self._onFinishBound=null,self._pc){try{self._pc.close()}catch(err){}self._pc.oniceconnectionstatechange=null,self._pc.onicegatheringstatechange=null,self._pc.onsignalingstatechange=null,self._pc.onicecandidate=null,"addTrack"in self._pc?self._pc.ontrack=null:self._pc.onaddstream=null,self._pc.onnegotiationneeded=null,self._pc.ondatachannel=null}if(self._channel){try{self._channel.close()}catch(err){}self._channel.onmessage=null,self._channel.onopen=null,self._channel.onclose=null,self._channel.onerror=null}self._pc=null,self._channel=null,err&&self.emit("error",err),self.emit("close")}},Peer.prototype._setupData=function(event){var self=this;if(!event.channel)return self._destroy(new Error("Data channel event is missing `channel` property"));self._channel=event.channel,self._channel.binaryType="arraybuffer","number"==typeof self._channel.bufferedAmountLowThreshold&&(self._channel.bufferedAmountLowThreshold=65536),self.channelName=self._channel.label,self._channel.onmessage=function(event){self._onChannelMessage(event)},self._channel.onbufferedamountlow=function(){self._onChannelBufferedAmountLow()},self._channel.onopen=function(){self._onChannelOpen()},self._channel.onclose=function(){self._onChannelClose()},self._channel.onerror=function(err){self._destroy(err)}},Peer.prototype._read=function(){},Peer.prototype._write=function(chunk,encoding,cb){var self=this;if(self.destroyed)return cb(new Error("cannot write after peer is destroyed"));if(self.connected){try{self.send(chunk)}catch(err){return self._destroy(err)}self._channel.bufferedAmount>65536?(self._debug("start backpressure: bufferedAmount %d",self._channel.bufferedAmount),self._cb=cb):cb(null)}else self._debug("write before connect"),self._chunk=chunk,self._cb=cb},Peer.prototype._onFinish=function(){function destroySoon(){setTimeout(function(){self._destroy()},1e3)}var self=this;self.destroyed||(self.connected?destroySoon():self.once("connect",destroySoon))},Peer.prototype._createOffer=function(){var self=this;self.destroyed||self._pc.createOffer(function(offer){function onSuccess(){self.destroyed||(self.trickle||self._iceComplete?sendOffer():self.once("_iceComplete",sendOffer))}function onError(err){self._destroy(err)}function sendOffer(){var signal=self._pc.localDescription||offer;self._debug("signal"),self.emit("signal",{type:signal.type,sdp:signal.sdp})}self.destroyed||(offer.sdp=self.sdpTransform(offer.sdp),self._pc.setLocalDescription(offer,onSuccess,onError))},function(err){self._destroy(err)},self.offerConstraints)},Peer.prototype._createAnswer=function(){var self=this;self.destroyed||self._pc.createAnswer(function(answer){function onSuccess(){self.destroyed||(self.trickle||self._iceComplete?sendAnswer():self.once("_iceComplete",sendAnswer))}function onError(err){self._destroy(err)}function sendAnswer(){var signal=self._pc.localDescription||answer;self._debug("signal"),self.emit("signal",{type:signal.type,sdp:signal.sdp})}self.destroyed||(answer.sdp=self.sdpTransform(answer.sdp),self._pc.setLocalDescription(answer,onSuccess,onError))},function(err){self._destroy(err)},self.answerConstraints)},Peer.prototype._onIceStateChange=function(){var self=this;if(!self.destroyed){var iceConnectionState=self._pc.iceConnectionState,iceGatheringState=self._pc.iceGatheringState;self._debug("iceStateChange (connection: %s) (gathering: %s)",iceConnectionState,iceGatheringState),self.emit("iceStateChange",iceConnectionState,iceGatheringState),"connected"!==iceConnectionState&&"completed"!==iceConnectionState||(clearTimeout(self._reconnectTimeout),self._pcReady=!0,self._maybeReady()),"disconnected"===iceConnectionState&&(self.reconnectTimer?(clearTimeout(self._reconnectTimeout),self._reconnectTimeout=setTimeout(function(){self._destroy()},self.reconnectTimer)):self._destroy()),"failed"===iceConnectionState&&self._destroy(new Error("Ice connection failed.")),"closed"===iceConnectionState&&self._destroy()}},Peer.prototype.getStats=function(cb){var self=this;0===self._pc.getStats.length?self._pc.getStats().then(function(res){var reports=[];res.forEach(function(report){reports.push(report)}),cb(null,reports)},function(err){cb(err)}):self._isReactNativeWebrtc?self._pc.getStats(null,function(res){var reports=[];res.forEach(function(report){reports.push(report)}),cb(null,reports)},function(err){cb(err)}):self._pc.getStats.length>0?self._pc.getStats(function(res){var reports=[];res.result().forEach(function(result){var report={};result.names().forEach(function(name){report[name]=result.stat(name)}),report.id=result.id,report.type=result.type,report.timestamp=result.timestamp,reports.push(report)}),cb(null,reports)},function(err){cb(err)}):cb(null,[])},Peer.prototype._maybeReady=function(){var self=this;self._debug("maybeReady pc %s channel %s",self._pcReady,self._channelReady),!self.connected&&!self._connecting&&self._pcReady&&self._channelReady&&(self._connecting=!0,self.getStats(function(err,items){function setSelectedCandidatePair(selectedCandidatePair){var local=localCandidates[selectedCandidatePair.localCandidateId];local&&local.ip?(self.localAddress=local.ip,self.localPort=Number(local.port)):local&&local.ipAddress?(self.localAddress=local.ipAddress,self.localPort=Number(local.portNumber)):"string"==typeof selectedCandidatePair.googLocalAddress&&(local=selectedCandidatePair.googLocalAddress.split(":"),self.localAddress=local[0],self.localPort=Number(local[1]));var remote=remoteCandidates[selectedCandidatePair.remoteCandidateId];remote&&remote.ip?(self.remoteAddress=remote.ip,self.remotePort=Number(remote.port)):remote&&remote.ipAddress?(self.remoteAddress=remote.ipAddress,self.remotePort=Number(remote.portNumber)):"string"==typeof selectedCandidatePair.googRemoteAddress&&(remote=selectedCandidatePair.googRemoteAddress.split(":"),self.remoteAddress=remote[0],self.remotePort=Number(remote[1])),self.remoteFamily="IPv4",self._debug("connect local: %s:%s remote: %s:%s",self.localAddress,self.localPort,self.remoteAddress,self.remotePort)}if(!self.destroyed){err&&(items=[]),self._connecting=!1,self.connected=!0;var remoteCandidates={},localCandidates={},candidatePairs={};if(items.forEach(function(item){"remotecandidate"!==item.type&&"remote-candidate"!==item.type||(remoteCandidates[item.id]=item),"localcandidate"!==item.type&&"local-candidate"!==item.type||(localCandidates[item.id]=item),"candidatepair"!==item.type&&"candidate-pair"!==item.type||(candidatePairs[item.id]=item)}),items.forEach(function(item){"transport"===item.type&&setSelectedCandidatePair(candidatePairs[item.selectedCandidatePairId]),("googCandidatePair"===item.type&&"true"===item.googActiveConnection||("candidatepair"===item.type||"candidate-pair"===item.type)&&item.selected)&&setSelectedCandidatePair(item)}),self._chunk){try{self.send(self._chunk)}catch(err){return self._destroy(err)}self._chunk=null,self._debug('sent chunk from "write before connect"');var cb=self._cb;self._cb=null,cb(null)}"number"!=typeof self._channel.bufferedAmountLowThreshold&&(self._interval=setInterval(function(){self._onInterval()},150),self._interval.unref&&self._interval.unref()),self._debug("connect"),self.emit("connect")}}))},Peer.prototype._onInterval=function(){!this._cb||!this._channel||this._channel.bufferedAmount>65536||this._onChannelBufferedAmountLow()},Peer.prototype._onSignalingStateChange=function(){var self=this;self.destroyed||(self._debug("signalingStateChange %s",self._pc.signalingState),self.emit("signalingStateChange",self._pc.signalingState))},Peer.prototype._onIceCandidate=function(event){var self=this;self.destroyed||(event.candidate&&self.trickle?self.emit("signal",{candidate:{candidate:event.candidate.candidate,sdpMLineIndex:event.candidate.sdpMLineIndex,sdpMid:event.candidate.sdpMid}}):event.candidate||(self._iceComplete=!0,self.emit("_iceComplete")))},Peer.prototype._onChannelMessage=function(event){var self=this;if(!self.destroyed){var data=event.data;data instanceof ArrayBuffer&&(data=Buffer.from(data)),self.push(data)}},Peer.prototype._onChannelBufferedAmountLow=function(){var self=this;if(!self.destroyed&&self._cb){self._debug("ending backpressure: bufferedAmount %d",self._channel.bufferedAmount);var cb=self._cb;self._cb=null,cb(null)}},Peer.prototype._onChannelOpen=function(){var self=this;self.connected||self.destroyed||(self._debug("on channel open"),self._channelReady=!0,self._maybeReady())},Peer.prototype._onChannelClose=function(){var self=this;self.destroyed||(self._debug("on channel close"),self._destroy())},Peer.prototype._onAddStream=function(event){var self=this;self.destroyed||(self._debug("on add stream"),self.emit("stream",event.stream))},Peer.prototype._onTrack=function(event){var self=this;if(!self.destroyed){self._debug("on track");var id=event.streams[0].id;self._previousStreams.indexOf(id)===-1&&(self._previousStreams.push(id),self.emit("stream",event.streams[0]))}},Peer.prototype._debug=function(){var self=this,args=[].slice.call(arguments);args[0]="["+self._id+"] "+args[0],debug.apply(null,args)},Peer.prototype._transformConstraints=function(constraints){var self=this;if(0===Object.keys(constraints).length)return constraints;if((constraints.mandatory||constraints.optional)&&!self._isChromium){var newConstraints=Object.assign({},constraints.optional,constraints.mandatory);return void 0!==newConstraints.OfferToReceiveVideo&&(newConstraints.offerToReceiveVideo=newConstraints.OfferToReceiveVideo,delete newConstraints.OfferToReceiveVideo), -void 0!==newConstraints.OfferToReceiveAudio&&(newConstraints.offerToReceiveAudio=newConstraints.OfferToReceiveAudio,delete newConstraints.OfferToReceiveAudio),newConstraints}return constraints.mandatory||constraints.optional||!self._isChromium?constraints:(void 0!==constraints.offerToReceiveVideo&&(constraints.OfferToReceiveVideo=constraints.offerToReceiveVideo,delete constraints.offerToReceiveVideo),void 0!==constraints.offerToReceiveAudio&&(constraints.OfferToReceiveAudio=constraints.offerToReceiveAudio,delete constraints.offerToReceiveAudio),{mandatory:constraints})}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}module.exports=PassThrough;var Transform=__webpack_require__(317),util=__webpack_require__(6);util.inherits=__webpack_require__(1),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},function(module,exports,__webpack_require__){"use strict";function BufferList(){this.head=null,this.tail=null,this.length=0}var bufferShim=(__webpack_require__(0).Buffer,__webpack_require__(14));module.exports=BufferList,BufferList.prototype.push=function(v){var entry={data:v,next:null};this.length>0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};0===this.length&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(0!==this.length){var ret=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s){if(0===this.length)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s+p.data;return ret},BufferList.prototype.concat=function(n){if(0===this.length)return bufferShim.alloc(0);if(1===this.length)return this.head.data;for(var ret=bufferShim.allocUnsafe(n>>>0),p=this.head,i=0;p;)p.data.copy(ret,i),i+=p.data.length,p=p.next;return ret}},function(module,exports,__webpack_require__){exports=module.exports=__webpack_require__(316),exports.Stream=exports,exports.Readable=exports,exports.Writable=__webpack_require__(318),exports.Duplex=__webpack_require__(70),exports.Transform=__webpack_require__(317),exports.PassThrough=__webpack_require__(782)},function(module,exports,__webpack_require__){"use strict";function popCountReduce(count,byte){return count+popCount(byte)}function popCount(_v){let v=_v;return v-=v>>1&1431655765,16843009*((v=(858993459&v)+(v>>2&858993459))+(v>>4)&252645135)>>24}function sortInternal(a,b){return a[0]-b[0]}function valueOnly(elem){return elem[1]}module.exports=class SparseArray{constructor(){this._bitArrays=[],this._data=[],this._length=0,this._changedLength=!1,this._changedData=!1}set(index,value){let pos=this._internalPositionFor(index,!1);if(void 0===value)pos!==-1&&(this._unsetInternalPos(pos),this._unsetBit(index),this._changedLength=!0,this._changedData=!0);else{let needsSort=!1;pos===-1?(pos=this._data.length,this._setBit(index),this._changedData=!0):needsSort=!0,this._setInternalPos(pos,index,value,needsSort),this._changedLength=!0}}unset(index){this.set(index,void 0)}get(index){this._sortData();const pos=this._internalPositionFor(index,!0);if(pos!==-1)return this._data[pos][1]}push(value){return this.set(this.length,value),this.length}get length(){if(this._sortData(),this._changedLength){const last=this._data[this._data.length-1];this._length=last?last[0]+1:0,this._changedLength=!1}return this._length}forEach(iterator){let i=0;for(;i=this._bitArrays.length)return-1;const byte=this._bitArrays[bytePos],bitPos=index-7*bytePos;return(byte&1<0?this._bitArrays.slice(0,bytePos).reduce(popCountReduce,0)+popCount(byte&~(4294967295<=index)data.push(elem);else if(data[0][0]<=index)data.unshift(elem);else{const randomIndex=Math.round(data.length/2);this._data=data.slice(0,randomIndex).concat(elem).concat(data.slice(randomIndex))}else this._data.push(elem);this._changedData=!0,this._changedLength=!0}}_unsetInternalPos(pos){this._data.splice(pos,1)}_sortData(){this._changedData&&this._data.sort(sortInternal)}bitField(){const bytes=[];let newByte,pendingBitsForResultingByte=8,pendingBitsForNewByte=0,resultingByte=0;const pending=this._bitArrays.slice();for(;pending.length||pendingBitsForNewByte;){0===pendingBitsForNewByte&&(newByte=pending.shift(),pendingBitsForNewByte=7);const usingBits=Math.min(pendingBitsForNewByte,pendingBitsForResultingByte),mask=~(255<>>=usingBits,pendingBitsForNewByte-=usingBits,pendingBitsForResultingByte-=usingBits,pendingBitsForResultingByte&&(pendingBitsForNewByte||pending.length)||(bytes.push(resultingByte),resultingByte=0,pendingBitsForResultingByte=8)}for(var i=bytes.length-1;i>0;i--){const value=bytes[i];if(0!==value)break;bytes.pop()}return bytes}compactArray(){return this._sortData(),this._data.map(valueOnly)}}},function(module,exports,__webpack_require__){"use strict";(function(process){function Connection(socket,options){EventEmitter.call(this);var state={};this._spdyState=state,this.httpAllowHalfOpen=!0,state.timeout=new transport.utils.Timeout(this),state.protocol=transport.protocol[options.protocol],state.version=null,state.constants=state.protocol.constants,state.pair=null,state.isServer=options.isServer,state.priorityRoot=new transport.Priority({defaultWeight:state.constants.DEFAULT_WEIGHT,maxCount:transport.protocol.base.constants.MAX_PRIORITY_STREAMS}),state.maxStreams=options.maxStreams||state.constants.MAX_CONCURRENT_STREAMS,state.autoSpdy31="h2"!==options.protocol.name&&options.autoSpdy31,state.acceptPush=void 0===options.acceptPush?!state.isServer:options.acceptPush,options.maxChunk===!1?state.maxChunk=1/0:void 0===options.maxChunk?state.maxChunk=transport.protocol.base.constants.DEFAULT_MAX_CHUNK:state.maxChunk=options.maxChunk;var windowSize=options.windowSize||1<<20;state.window=new transport.Window({id:0,isServer:state.isServer,recv:{size:state.constants.DEFAULT_WINDOW,max:state.constants.MAX_INITIAL_WINDOW_SIZE},send:{size:state.constants.DEFAULT_WINDOW,max:state.constants.MAX_INITIAL_WINDOW_SIZE}}),state.window.recv.setMax(windowSize),state.streamWindow=new transport.Window({id:-1,isServer:state.isServer,recv:{size:windowSize,max:state.constants.MAX_INITIAL_WINDOW_SIZE},send:{size:state.constants.DEFAULT_WINDOW,max:state.constants.MAX_INITIAL_WINDOW_SIZE}}),state.pool=state.protocol.compressionPool.create(options.headerCompression),state.counters={push:0,stream:0},state.stream={map:{},count:0,nextId:state.isServer?2:1,lastId:{both:0,received:0}},state.ping={nextId:state.isServer?2:1,map:{}},state.goaway=!1,state.debug=state.isServer?debug.server:debug.client,state.xForward=null,state.parser=state.protocol.parser.create({isServer:state.isServer,window:state.window}),state.framer=state.protocol.framer.create({window:state.window,timeout:state.timeout}),"spdy"===state.protocol.name&&state.framer.enablePush(state.isServer),state.isServer||state.parser.skipPreface(),this.socket=socket,this._init()}var util=__webpack_require__(10),transport=__webpack_require__(21),Buffer=__webpack_require__(13).Buffer,debug={server:__webpack_require__(3)("spdy:connection:server"),client:__webpack_require__(3)("spdy:connection:client")},EventEmitter=__webpack_require__(8).EventEmitter,Stream=transport.Stream;util.inherits(Connection,EventEmitter),exports.Connection=Connection,Connection.create=function(socket,options){return new Connection(socket,options)},Connection.prototype._init=function(){function _onWindowOverflow(){self._onWindowOverflow()}var self=this,state=this._spdyState,pool=state.pool;state.window.recv.on("drain",function(){self._onSessionWindowDrain()}),state.parser.on("data",function(frame){self._handleFrame(frame)}),state.parser.once("version",function(version){self._onVersion(version)}),state.parser.on("error",function(err){self._onParserError(err)}),state.framer.on("error",function(err){self.emit("error",err)}),this.socket.pipe(state.parser),state.framer.pipe(this.socket),this.socket.on("error",function(e){self.emit("error",e)}),this.socket.once("close",function(){var err=new Error("socket hang up");err.code="ECONNRESET",self.destroyStreams(err),self.emit("close",err),state.pair&&pool.put(state.pair),state.framer.resume()}),this.once("close",function(){self.setTimeout(0)}),state.window.recv.on("overflow",_onWindowOverflow),state.window.send.on("overflow",_onWindowOverflow),this.socket.allowHalfOpen=!1},Connection.prototype._onVersion=function(version){var state=this._spdyState,prev=state.version,parser=state.parser,framer=state.framer,pool=state.pool;state.version=version,state.debug("id=0 version=%d",version),prev||(state.pair=pool.get(version),parser.setCompression(state.pair),framer.setCompression(state.pair)),framer.setVersion(version),state.isServer||(framer.prefaceFrame(),null!==state.xForward&&framer.xForwardedFor({host:state.xForward})),framer.settingsFrame({max_header_list_size:state.constants.DEFAULT_MAX_HEADER_LIST_SIZE,max_concurrent_streams:state.maxStreams,enable_push:state.acceptPush?1:0,initial_window_size:state.window.recv.max}),(state.version>=3.1||state.isServer&&state.autoSpdy31)&&this._onSessionWindowDrain(),this.emit("version",version)},Connection.prototype._onParserError=function(err){var state=this._spdyState;state.parser.kill(),err instanceof transport.protocol.base.utils.ProtocolError&&this._goaway({lastId:state.stream.lastId.both,code:err.code,extra:err.message,send:!0}),this.emit("error",err)},Connection.prototype._handleFrame=function(frame){var state=this._spdyState;state.debug("id=0 frame",frame),state.timeout.reset(),this.emit("frame",frame);var stream;if("WINDOW_UPDATE"===frame.type&&0===frame.id)return state.version<3.1&&state.autoSpdy31&&(state.debug("id=0 switch version to 3.1"),state.version=3.1,this.emit("version",3.1)),void state.window.send.update(frame.delta);if(state.isServer&&"PUSH_PROMISE"===frame.type)return state.debug("id=0 server PUSH_PROMISE"),void this._goaway({lastId:state.stream.lastId.both,code:"PROTOCOL_ERROR",send:!0});if(!stream&&void 0!==frame.id&&!(stream=state.stream.map[frame.id])&&"HEADERS"!==frame.type&&"PRIORITY"!==frame.type&&"RST"!==frame.type){if(this._isGoaway(frame.id))return;return state.debug("id=0 stream=%d not found",frame.id),void state.framer.rstFrame({id:frame.id,code:"INVALID_STREAM"})}if(!stream&&"HEADERS"===frame.type)return void this._handleHeaders(frame);stream?stream._handleFrame(frame):"SETTINGS"===frame.type?this._handleSettings(frame.settings):"ACK_SETTINGS"===frame.type||("PING"===frame.type?this._handlePing(frame):"GOAWAY"===frame.type?this._handleGoaway(frame):"X_FORWARDED_FOR"===frame.type?null===state.xForward&&(state.xForward=frame.host):"PRIORITY"===frame.type||state.debug("id=0 unknown frame type: %s",frame.type))},Connection.prototype._onWindowOverflow=function(){var state=this._spdyState;state.debug("id=0 window overflow"),this._goaway({lastId:state.stream.lastId.both,code:"FLOW_CONTROL_ERROR",send:!0})},Connection.prototype._isGoaway=function(id){var state=this._spdyState;return state.goaway!==!1&&state.goawaythis.maxCount&&(debug("hit maximum remove id=%d",this.list[0].id),this.list.shift().remove()),null!==node.parent&&this.list.push(node),node},PriorityTree.prototype.get=function(id){return this.map[id]},PriorityTree.prototype.addDefault=function(id){return debug("creating default node"),this.add({id:id,parent:0,weight:this.defaultWeight})},PriorityTree.prototype._removeNode=function(node){delete this.map[node.id],this.count--}},function(module,exports){exports.DEFAULT_METHOD="GET",exports.DEFAULT_HOST="localhost",exports.MAX_PRIORITY_STREAMS=100,exports.DEFAULT_MAX_CHUNK=8192},function(module,exports,__webpack_require__){"use strict";(function(process){function Framer(options){Scheduler.call(this),this.version=null,this.compress=null,this.window=options.window,this.timeout=options.timeout,this.pushEnabled=null}var util=__webpack_require__(10),transport=__webpack_require__(21),base=__webpack_require__(163),Scheduler=base.Scheduler;util.inherits(Framer,Scheduler),module.exports=Framer,Framer.prototype.setVersion=function(version){this.version=version,this.emit("version")},Framer.prototype.setCompression=function(pair){this.compress=new transport.utils.LockStream(pair.compress)},Framer.prototype.enablePush=function(enable){this.pushEnabled=enable,this.emit("_pushEnabled")},Framer.prototype._checkPush=function(callback){if(null===this.pushEnabled)return void this.once("_pushEnabled",function(){this._checkPush(callback)});var err=null;this.pushEnabled||(err=new Error("PUSH_PROMISE disabled by other side")),process.nextTick(function(){return callback(err)})},Framer.prototype._resetTimeout=function(){this.timeout&&this.timeout.reset()}}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";(function(process){function Parser(options){Transform.call(this,{readableObjectMode:!0}),this.buffer=new OffsetBuffer,this.partial=!1,this.waiting=0,this.window=options.window,this.version=null,this.decompress=null,this.dead=!1}var transport=__webpack_require__(21),util=__webpack_require__(10),utils=__webpack_require__(163).utils,OffsetBuffer=__webpack_require__(113),Transform=__webpack_require__(164).Transform;module.exports=Parser,util.inherits(Parser,Transform),Parser.prototype.error=utils.error,Parser.prototype.kill=function(){this.dead=!0},Parser.prototype._transform=function(data,encoding,cb){this.dead||this.buffer.push(data),this._consume(cb)},Parser.prototype._consume=function(cb){function next(err,frame){if(err)return cb(err);if(Array.isArray(frame))for(var i=0;i=this.list.length||0!==insertCompare(this.list[index],item)?this.list.splice(index,0,item):item=this.list[index],item.push(data),this.count+=chunks.length,this._read()},Scheduler.prototype._read=function(){if(0!==this.count&&!this.pendingTick){this.pendingTick=!0;var self=this;process.nextTick(function(){self.pendingTick=!1,self.tick()})}},Scheduler.prototype.tick=function(){return!!this.tickSync()&&this.tickAsync()},Scheduler.prototype.tickSync=function(){var sync=this.sync,res=!0;this.sync=[];for(var i=0;i0;index++){index%=list.length,startPriority-list[index].priority>this.window&&(index=0),debug("tick async index=%d start=%d",index,startPriority);var current=list[index],item=current.shift();current.isEmpty()&&(list.splice(index,1),0===index&&list.length>0&&(startPriority=list[0].priority),index--),debug("tick async pending=%d",this.count,item.chunks);for(var i=0;ithis.maxFrameSize)return callback(this.error(constants.error.FRAME_SIZE_ERROR,"Frame length OOB"));header.control=header.type!==constants.frameType.DATA,this.state="frame-body",this.pendingHeader=header,this.waiting=header.length,this.partial=!header.control,this.partial&&(this.partial=0==(header.flags&constants.flags.PADDED)),callback(null,null)},Parser.prototype.onFrameBody=function(header,buffer,callback){var frameType=constants.frameType;header.type===frameType.DATA?this.onDataFrame(header,buffer,callback):header.type===frameType.HEADERS?this.onHeadersFrame(header,buffer,callback):header.type===frameType.CONTINUATION?this.onContinuationFrame(header,buffer,callback):header.type===frameType.WINDOW_UPDATE?this.onWindowUpdateFrame(header,buffer,callback):header.type===frameType.RST_STREAM?this.onRSTFrame(header,buffer,callback):header.type===frameType.SETTINGS?this.onSettingsFrame(header,buffer,callback):header.type===frameType.PUSH_PROMISE?this.onPushPromiseFrame(header,buffer,callback):header.type===frameType.PING?this.onPingFrame(header,buffer,callback):header.type===frameType.GOAWAY?this.onGoawayFrame(header,buffer,callback):header.type===frameType.PRIORITY?this.onPriorityFrame(header,buffer,callback):header.type===frameType.X_FORWARDED_FOR?this.onXForwardedFrame(header,buffer,callback):this.onUnknownFrame(header,buffer,callback)},Parser.prototype.onUnknownFrame=function(header,buffer,callback){if(null!==this._lastHeaderBlock)return void callback(this.error(constants.error.PROTOCOL_ERROR,"Received unknown frame in the middle of a header block"));callback(null,{type:"unknown: "+header.type})},Parser.prototype.unpadData=function(header,body,callback){if(0==(header.flags&constants.flags.PADDED))return callback(null,body);if(!body.has(1))return callback(this.error(constants.error.FRAME_SIZE_ERROR,"Not enough space for padding"));var pad=body.readUInt8();if(!body.has(pad))return callback(this.error(constants.error.PROTOCOL_ERROR,"Invalid padding size"));var contents=body.clone(body.size-pad);body.skip(body.size),callback(null,contents)},Parser.prototype.onDataFrame=function(header,body,callback){var isEndStream=0!=(header.flags&constants.flags.END_STREAM);if(0===header.id)return callback(this.error(constants.error.PROTOCOL_ERROR,"Received DATA frame with stream=0"));this.window&&this.window.recv.update(-body.size),this.unpadData(header,body,function(err,data){if(err)return callback(err);callback(null,{type:"DATA",id:header.id,fin:isEndStream,data:data.take(data.size)})})},Parser.prototype.initHeaderBlock=function(header,frame,block,callback){if(this._lastHeaderBlock)return callback(this.error(constants.error.PROTOCOL_ERROR,"Duplicate Stream ID"));this._lastHeaderBlock={id:header.id,frame:frame,queue:[],size:0},this.queueHeaderBlock(header,block,callback)},Parser.prototype.queueHeaderBlock=function(header,block,callback){var self=this,item=this._lastHeaderBlock;if(!this._lastHeaderBlock||item.id!==header.id)return callback(this.error(constants.error.PROTOCOL_ERROR,"No matching stream for continuation"));for(var fin=0!=(header.flags&constants.flags.END_HEADERS),chunks=block.toChunks(),i=0;i=self.maxHeaderListSize?callback(this.error(constants.error.PROTOCOL_ERROR,"Compressed header list is too large")):fin?(this._lastHeaderBlock=null,void this.decompress.write(item.queue,function(err,chunks){if(err)return callback(self.error(constants.error.COMPRESSION_ERROR,err.message));for(var headers={},size=0,i=0;i=self.maxHeaderListSize)return callback(self.error(constants.error.PROTOCOL_ERROR,"Header list is too large"));if(/[A-Z]/.test(header.name))return callback(self.error(constants.error.PROTOCOL_ERROR,"Header name must be lowercase"));utils.addHeaderLine(header.name,header.value,headers)}item.frame.headers=headers,item.frame.path=headers[":path"],callback(null,item.frame)})):callback(null,null)},Parser.prototype.onHeadersFrame=function(header,body,callback){var self=this;if(0===header.id)return callback(this.error(constants.error.PROTOCOL_ERROR,"Invalid stream id for HEADERS"));this.unpadData(header,body,function(err,data){if(err)return callback(err);var isPriority=0!=(header.flags&constants.flags.PRIORITY);if(!data.has(isPriority?5:0))return callback(self.error(constants.error.FRAME_SIZE_ERROR,"Not enough data for HEADERS"));var exclusive=!1,dependency=0,weight=constants.DEFAULT_WEIGHT;if(isPriority&&(dependency=data.readUInt32BE(),exclusive=0!=(2147483648&dependency),dependency&=2147483647,weight=data.readUInt8()+1),dependency===header.id)return callback(self.error(constants.error.PROTOCOL_ERROR,"Stream can't dependend on itself"));var streamInfo={type:"HEADERS",id:header.id,priority:{parent:dependency,exclusive:exclusive,weight:weight},fin:0!=(header.flags&constants.flags.END_STREAM),writable:!0,headers:null,path:null};self.initHeaderBlock(header,streamInfo,data,callback)})},Parser.prototype.onContinuationFrame=function(header,body,callback){this.queueHeaderBlock(header,body,callback)},Parser.prototype.onRSTFrame=function(header,body,callback){return 4!==body.size?callback(this.error(constants.error.FRAME_SIZE_ERROR,"RST_STREAM length not 4")):0===header.id?callback(this.error(constants.error.PROTOCOL_ERROR,"Invalid stream id for RST_STREAM")):void callback(null,{type:"RST",id:header.id,code:constants.errorByCode[body.readUInt32BE()]})},Parser.prototype._validateSettings=function(settings){return void 0!==settings.enable_push&&0!==settings.enable_push&&1!==settings.enable_push?this.error(constants.error.PROTOCOL_ERROR,"SETTINGS_ENABLE_PUSH must be 0 or 1"):void 0!==settings.initial_window_size&&(settings.initial_window_size>constants.MAX_INITIAL_WINDOW_SIZE||settings.initial_window_size<0)?this.error(constants.error.FLOW_CONTROL_ERROR,"SETTINGS_INITIAL_WINDOW_SIZE is OOB"):void 0!==settings.max_frame_size&&(settings.max_frame_size>constants.ABSOLUTE_MAX_FRAME_SIZE||settings.max_frame_size=3)&&("connection"!==lkey&&"keep-alive"!==lkey&&"proxy-connection"!==lkey&&"transfer-encoding"!==lkey)},this).map(function(key){var klen=Buffer.byteLength(key),value=stringify(loweredHeaders[key]),vlen=Buffer.byteLength(value);return len+=2*size+klen+vlen,[klen,key,vlen,value]}),block=new WriteBuffer;block.reserve(len),2===this.version?block.writeUInt16BE(pairs.length):block.writeUInt32BE(pairs.length),pairs.forEach(function(pair){2===this.version?block.writeUInt16BE(pair[0]):block.writeUInt32BE(pair[0]),block.write(pair[1]),2===this.version?block.writeUInt16BE(pair[2]):block.writeUInt32BE(pair[2]),block.write(pair[3])},this),assert(null!==this.compress,"Framer version not initialized"),this.compress.write(block.render(),callback)},Framer.prototype._frame=function(frame,body,callback){if(!this.version)return void this.on("version",function(){this._frame(frame,body,callback)});debug("id=%d type=%s",frame.id,frame.type);var buffer=new WriteBuffer;buffer.writeUInt16BE(32768|this.version),buffer.writeUInt16BE(constants.frameType[frame.type]),buffer.writeUInt8(frame.flags);var len=buffer.skip(3);body(buffer);var frameSize=buffer.size-constants.FRAME_HEADER_SIZE;len.writeUInt24BE(frameSize);var chunks=buffer.render(),toWrite={stream:frame.id,priority:!1,chunks:chunks,callback:callback};return this._resetTimeout(),this.schedule(toWrite),chunks},Framer.prototype._synFrame=function(frame,callback){function preprocess(headers){var method=frame.method||base.constants.DEFAULT_METHOD,version=frame.version||"HTTP/1.1",scheme=frame.scheme||"https",host=frame.host||frame.headers&&frame.headers.host||base.constants.DEFAULT_HOST;2===self.version?(headers.method=method,headers.version=version,headers.url=frame.path,headers.scheme=scheme,headers.host=host,frame.status&&(headers.status=frame.status)):(headers[":method"]=method,headers[":version"]=version,headers[":path"]=frame.path,headers[":scheme"]=scheme,headers[":host"]=host,frame.status&&(headers[":status"]=frame.status))}var self=this;if(!frame.path)throw new Error("`path` is required frame argument");this.headersToDict(frame.headers,preprocess,function(err,chunks){if(err)return callback?callback(err):self.emit("error",err);self._frame({type:"SYN_STREAM",id:frame.id,flags:frame.fin?constants.flags.FLAG_FIN:0},function(buf){buf.reserve(10),buf.writeUInt32BE(2147483647&frame.id),buf.writeUInt32BE(2147483647&frame.associated);var weight=frame.priority&&frame.priority.weight||constants.DEFAULT_WEIGHT,priority=utils.weightToPriority(weight);buf.writeUInt8(priority<<5),buf.writeUInt8(0);for(var i=0;i>5:utils.weightToPriority(constants.DEFAULT_WEIGHT),fin=0!=(flags&constants.flags.FLAG_FIN),unidir=0!=(flags&constants.flags.FLAG_UNIDIRECTIONAL),path=headers[":path"],isPush=stream&&0!==associated,weight=utils.priorityToWeight(priority),priorityInfo={weight:weight,exclusive:!1,parent:0};return isPush?stream&&!headers[":status"]?callback(new Error("Missing `:status` header")):void callback(null,[{type:"PUSH_PROMISE",id:associated,fin:!1,promisedId:id,headers:self._filterHeader(headers,":status"),path:path},{type:"HEADERS",id:id,fin:fin,priority:priorityInfo,writable:!0,path:void 0,headers:{":status":headers[":status"]}}]):void callback(null,{type:"HEADERS",id:id,priority:priorityInfo,fin:fin,writable:!unidir,headers:headers,path:path})})},Parser.prototype.onHeaderFrames=function(body,callback){var offset=2===this.version?6:4;if(!body.has(offset))return callback(new Error("HEADERS OOB"));var streamId=2147483647&body.readUInt32BE();2===this.version&&body.skip(2),this.parseKVs(body,function(err,headers){if(err)return callback(err);callback(null,{type:"HEADERS",priority:{parent:0,exclusive:!1,weight:constants.DEFAULT_WEIGHT},id:streamId,fin:!1,writable:!0,path:void 0,headers:headers})})},Parser.prototype.parseKVs=function(buffer,callback){var self=this;this.decompress.write(buffer.toChunks(),function(err,chunks){function readString(){if(!buffer.has(size))return null;var len=2===self.version?buffer.readUInt16BE():buffer.readUInt32BE();return buffer.has(len)?buffer.take(len).toString():null}if(err)return callback(err);for(var buffer=new OffsetBuffer,i=0;i0;){var key=readString(),value=readString();if(null===key||null===value)return callback(new Error("Headers OOB"));if(self.version<3){var isInternal=/^(method|version|url|host|scheme|status)$/.test(key);"url"===key&&(key="path"),isInternal&&(key=":"+key)}if(":status"===key&&(value=value.split(/ /g,2)[0]),count--,":host"===key&&(key=":authority"),":version"!==key){value=value.split(/\0/g);for(var j=0;j>24&255;if(id&=16777215,!(2&flags)){settings[idMap[id]]=body.readUInt32BE()}}callback(null,{type:"SETTINGS",settings:settings})},Parser.prototype.onPingFrame=function(body,callback){if(!body.has(4))return callback(new Error("PING OOB"));var isServer=this.isServer,opaque=body.clone(body.size).take(body.size),id=body.readUInt32BE();callback(null,{type:"PING",opaque:opaque,ack:isServer?id%2==0:id%2==1})},Parser.prototype.onGoawayFrame=function(body,callback){if(!body.has(8))return callback(new Error("GOAWAY OOB"));callback(null,{type:"GOAWAY",lastId:2147483647&body.readUInt32BE(),code:constants.goawayByCode[body.readUInt32BE()]})},Parser.prototype.onWindowUpdateFrame=function(body,callback){if(!body.has(8))return callback(new Error("WINDOW_UPDATE OOB"));callback(null,{type:"WINDOW_UPDATE",id:2147483647&body.readUInt32BE(),delta:body.readInt32BE()})},Parser.prototype.onXForwardedFrame=function(body,callback){if(!body.has(4))return callback(new Error("X_FORWARDED OOB"));var len=body.readUInt32BE();if(!body.has(len))return callback(new Error("X_FORWARDED host length OOB"));callback(null,{type:"X_FORWARDED_FOR",host:body.take(len).toString()})}},function(module,exports,__webpack_require__){"use strict";function createDeflate(version,compression){var deflate=zlib.createDeflate({dictionary:transport.protocol.spdy.dictionary[version],flush:zlib.Z_SYNC_FLUSH,windowBits:11,level:compression?zlib.Z_DEFAULT_COMPRESSION:zlib.Z_NO_COMPRESSION});return deflate._flush=zlib.Z_SYNC_FLUSH,deflate}function createInflate(version){var inflate=zlib.createInflate({dictionary:transport.protocol.spdy.dictionary[version],flush:zlib.Z_SYNC_FLUSH});return inflate._flush=zlib.Z_SYNC_FLUSH,inflate}function Pool(compression){this.compression=compression,this.pool={2:[],3:[],3.1:[]}}var zlibpool=exports,zlib=__webpack_require__(380),transport=__webpack_require__(21);zlibpool.create=function(compression){return new Pool(compression)},Pool.prototype.get=function(version){if(this.pool[version].length>0)return this.pool[version].pop();var id=version;return{version:version,compress:createDeflate(id,this.compression),decompress:createInflate(id)}},Pool.prototype.put=function(pair){this.pool[pair.version].push(pair)}},function(module,exports,__webpack_require__){"use strict";(function(process){function Stream(connection,options){function _onWindowOverflow(){self._onWindowOverflow()}Duplex.call(this);var connectionState=connection._spdyState,state={};this._spdyState=state,this.id=options.id,this.method=options.method,this.path=options.path,this.host=options.host,this.headers=options.headers||{},this.connection=connection,this.parent=options.parent||null,state.socket=null,state.protocol=connectionState.protocol,state.constants=state.protocol.constants,state.priority=null,state.version=this.connection.getVersion(),state.isServer=this.connection.isServer(),state.debug=state.isServer?debug.server:debug.client,state.framer=connectionState.framer,state.parser=connectionState.parser,state.request=options.request,state.needResponse=options.request,state.window=connectionState.streamWindow.clone(options.id),state.sessionWindow=connectionState.window,state.maxChunk=connectionState.maxChunk,state.sent=!state.request,state.readable=options.readable!==!1,state.writable=options.writable!==!1,state.aborted=!1,state.corked=0,state.corkQueue=[],state.timeout=new transport.utils.Timeout(this),this.on("finish",this._onFinish),this.on("end",this._onEnd);var self=this;state.window.recv.on("overflow",_onWindowOverflow),state.window.send.on("overflow",_onWindowOverflow),this._initPriority(options.priority),state.readable||this.push(null),state.writable||(this._writableState.ended=!0,this._writableState.finished=!0)}function checkAborted(stream,state,callback){return!!state.aborted&&(state.debug("id=%d abort write",stream.id),process.nextTick(function(){callback(new Error("Stream write aborted"))}),!0)}function _send(stream,state,data,callback){checkAborted(stream,state,callback)||(state.debug("id=%d presend=%d",stream.id,data.length),state.timeout.reset(),state.window.send.update(-data.length,function(){checkAborted(stream,state,callback)||(state.debug("id=%d send=%d",stream.id,data.length),state.timeout.reset(),state.framer.dataFrame({id:stream.id,priority:state.priority.getPriority(),fin:!1,data:data},function(err){state.debug("id=%d postsend=%d",stream.id,data.length),callback(err)}))}))}var transport=__webpack_require__(21),assert=__webpack_require__(7),util=__webpack_require__(10),debug={client:__webpack_require__(3)("spdy:stream:client"),server:__webpack_require__(3)("spdy:stream:server")},Buffer=__webpack_require__(13).Buffer,Duplex=__webpack_require__(164).Duplex;util.inherits(Stream,Duplex),exports.Stream=Stream,Stream.prototype._init=function(socket){this.socket=socket},Stream.prototype._initPriority=function(priority){var state=this._spdyState,connectionState=this.connection._spdyState,root=connectionState.priorityRoot;if(!priority)return void(state.priority=root.addDefault(this.id));state.priority=root.add({id:this.id,parent:priority.parent,weight:priority.weight,exclusive:priority.exclusive})},Stream.prototype._handleFrame=function(frame){var state=this._spdyState;if(state.aborted)return void state.debug("id=%d ignoring frame=%s after abort",this.id,frame.type);state.timeout.reset(),"DATA"===frame.type?this._handleData(frame):"HEADERS"===frame.type?this._handleHeaders(frame):"RST"===frame.type?this._handleRST(frame):"WINDOW_UPDATE"===frame.type?this._handleWindowUpdate(frame):"PRIORITY"===frame.type?this._handlePriority(frame):"PUSH_PROMISE"===frame.type&&this._handlePushPromise(frame),frame.fin&&(state.debug("id=%d end",this.id),this.push(null))},Stream.prototype._write=function(data,enc,callback){var state=this._spdyState;if(state.sent||this.send(),0!==state.corked){var self=this;return void state.corkQueue.push(function(){self._write(data,enc,callback)})}this._splitStart(data,_send,callback)},Stream.prototype._splitStart=function(data,onChunk,callback){return this._split(data,0,onChunk,callback)},Stream.prototype._split=function(data,offset,onChunk,callback){if(offset===data.length)return process.nextTick(callback);var state=this._spdyState,local=state.window.send,session=state.sessionWindow.send,availSession=Math.max(0,session.getCurrent());0===availSession&&(availSession=session.getMax());var availLocal=Math.max(0,local.getCurrent());0===availLocal&&(availLocal=local.getMax());var avail=Math.min(availSession,availLocal);avail=Math.min(avail,state.maxChunk);var self=this;if(0===avail)return void state.window.send.update(0,function(){self._split(data,offset,onChunk,callback)});var limit=avail,size=Math.min(data.length-offset,limit);onChunk(this,state,data.slice(offset,offset+size),function(err){if(err)return callback(err);self._split(data,offset+size,onChunk,callback)})},Stream.prototype._read=function(){var state=this._spdyState;if(state.window.recv.isDraining()){var delta=state.window.recv.getDelta();state.debug("id=%d window emptying, update by %d",this.id,delta),state.window.recv.update(delta),state.framer.windowUpdateFrame({id:this.id,delta:delta})}},Stream.prototype._handleData=function(frame){var state=this._spdyState;if(!state.readable||this._readableState.ended)return void state.framer.rstFrame({id:this.id,code:"STREAM_CLOSED"});state.debug("id=%d recv=%d",this.id,frame.data.length),state.window.recv.update(-frame.data.length),this.push(frame.data)},Stream.prototype._handleRST=function(frame){"CANCEL"!==frame.code&&this.emit("error",new Error("Got RST: "+frame.code)),this.abort()},Stream.prototype._handleWindowUpdate=function(frame){this._spdyState.window.send.update(frame.delta)},Stream.prototype._onWindowOverflow=function(){var state=this._spdyState;state.debug("id=%d window overflow",this.id),state.framer.rstFrame({id:this.id,code:"FLOW_CONTROL_ERROR"}),this.aborted=!0,this.emit("error",new Error("HTTP2 window overflow"))},Stream.prototype._handlePriority=function(frame){var state=this._spdyState;state.priority.remove(),state.priority=null,this._initPriority(frame.priority),this.emit("priority",frame.priority)},Stream.prototype._handleHeaders=function(frame){var state=this._spdyState;return!state.readable||this._readableState.ended?void state.framer.rstFrame({id:this.id,code:"STREAM_CLOSED"}):state.needResponse?this._handleResponse(frame):void this.emit("headers",frame.headers)},Stream.prototype._handleResponse=function(frame){var state=this._spdyState;if(void 0===frame.headers[":status"])return void state.framer.rstFrame({id:this.id,code:"PROTOCOL_ERROR"});state.needResponse=!1,this.emit("response",0|frame.headers[":status"],frame.headers)},Stream.prototype._onFinish=function(){var state=this._spdyState;if(state.sent){if(0!==state.corked){var self=this;return void state.corkQueue.push(function(){self._onFinish()})}state.framer.dataFrame({id:this.id,priority:state.priority.getPriority(),fin:!0,data:new Buffer(0)})}else this.send();this._maybeClose()},Stream.prototype._onEnd=function(){this._maybeClose()},Stream.prototype._checkEnded=function(callback){var state=this._spdyState,ended=!1;if(state.aborted&&(ended=!0),state.writable&&!this._writableState.finished||(ended=!0),!ended)return!0;if(!callback)return!1;var err=new Error("Ended stream can't send frames");return process.nextTick(function(){callback(err)}),!1},Stream.prototype._maybeClose=function(){var state=this._spdyState;state.aborted||state.readable&&!this._readableState.ended||!this._writableState.finished||(state.timeout.set(0),this.emit("close"))},Stream.prototype._handlePushPromise=function(frame){var push=this.connection._createStream({id:frame.promisedId,parent:this,push:!0,request:!0,method:frame.headers[":method"],path:frame.headers[":path"],host:frame.headers[":authority"],priority:frame.priority,headers:frame.headers,writable:!1});this.connection._isGoaway(push.id)||this.emit("pushPromise",push)||push.abort()},Stream.prototype._hardCork=function(){var state=this._spdyState;this.cork(),state.corked++},Stream.prototype._hardUncork=function(){var state=this._spdyState;if(this.uncork(),0===--state.corked){var queue=state.corkQueue;state.corkQueue=[];for(var i=0;i>1,cmp=compare(item,list[pos]);if(0===cmp){start=pos,end=pos;break}cmp<0?end=pos:start=pos+1}return start}function binaryInsert(list,item,compare){var index=binaryLookup(list,item,compare);list.splice(index,0,item)}function binarySearch(list,item,compare){var index=binaryLookup(list,item,compare);return index>=list.length?-1:0===compare(item,list[index])?index:-1}function Timeout(object){this.delay=0,this.timer=null,this.object=object}var util=__webpack_require__(10),isNode=__webpack_require__(97);Object.assign=process.versions.modules>=46||!isNode?Object.assign:util._extend,exports.QueueItem=QueueItem,util.inherits(Queue,QueueItem),exports.Queue=Queue,Queue.prototype.insertTail=function(item){item.prev=this.prev,item.next=this,item.prev.next=item,item.next.prev=item},Queue.prototype.remove=function(item){var next=item.next,prev=item.prev;item.next=item,item.prev=item,next.prev=prev,prev.next=next},Queue.prototype.head=function(){return this.next},Queue.prototype.tail=function(){return this.prev},Queue.prototype.isEmpty=function(){return this.next===this},Queue.prototype.isRoot=function(item){return this===item},exports.LockStream=LockStream,LockStream.prototype.write=function(chunks,callback){function done(err,chunks){self.stream.removeListener("error",done),self.locked=!1,self.queue.length>0&&self.queue.shift()(),callback(err,chunks)}function onData(chunk){output.push(chunk)}function next(err){if(self.stream.removeListener("data",onData),err)return done(err);done(null,output)}var self=this;if(this.locked)return void this.queue.push(function(){return self.write(chunks,callback)});this.locked=!0,this.stream.on("error",done);var output=[];this.stream.on("data",onData);for(var i=0;i0?this.stream.write(chunks[i],next):process.nextTick(next),this.stream.execute&&this.stream.execute(function(err){if(err)return done(err)})},exports.binaryLookup=binaryLookup,exports.binaryInsert=binaryInsert,exports.binarySearch=binarySearch,exports.Timeout=Timeout,Timeout.prototype.set=function(delay,callback){this.delay=delay,this.reset(),callback&&(0===this.delay?this.object.removeListener("timeout",callback):this.object.once("timeout",callback))},Timeout.prototype.reset=function(){if(null!==this.timer&&(clearTimeout(this.timer),this.timer=null),0!==this.delay){var self=this;this.timer=setTimeout(function(){self.timer=null,self.object.emit("timeout")},this.delay)}}}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";(function(process){function Side(window,name,options){EventEmitter.call(this),this.name=name,this.window=window,this.current=options.size,this.max=options.size,this.limit=options.max,this.lowWaterMark=void 0===options.lowWaterMark?this.max/2:options.lowWaterMark,this._refilling=!1,this._refillQueue=[]}function Window(options){this.id=options.id,this.isServer=options.isServer,this.debug=this.isServer?debug.server:debug.client,this.recv=new Side(this,"recv",options.recv),this.send=new Side(this,"send",options.send)}var util=__webpack_require__(10),EventEmitter=__webpack_require__(8).EventEmitter,debug={server:__webpack_require__(3)("spdy:window:server"),client:__webpack_require__(3)("spdy:window:client")};util.inherits(Side,EventEmitter),Side.prototype.setMax=function(max){this.window.debug("id=%d side=%s setMax=%d",this.window.id,this.name,max),this.max=max,this.lowWaterMark=this.max/2},Side.prototype.updateMax=function(max){var delta=max-this.max;this.window.debug("id=%d side=%s updateMax=%d delta=%d",this.window.id,this.name,max,delta),this.max=max,this.lowWaterMark=max/2,this.update(delta)},Side.prototype.setLowWaterMark=function(lwm){this.lowWaterMark=lwm},Side.prototype.update=function(size,callback){return size<=0&&callback&&this.isEmpty()?(this.window.debug("id=%d side=%s wait for refill=%d [%d/%d]",this.window.id,this.name,-size,this.current,this.max),void this._refillQueue.push({size:size,callback:callback})):(this.current+=size,this.current>this.limit?void this.emit("overflow"):(this.window.debug("id=%d side=%s update by=%d [%d/%d]",this.window.id,this.name,size,this.current,this.max),size<0&&this.isDraining()&&(this.window.debug("id=%d side=%s drained",this.window.id,this.name),this.emit("drain")),size>0&&this.current>0&&this.current<=size&&(this.window.debug("id=%d side=%s full",this.window.id,this.name),this.emit("full")),this._processRefillQueue(),void(callback&&process.nextTick(callback))))},Side.prototype.getCurrent=function(){return this.current},Side.prototype.getMax=function(){return this.max},Side.prototype.getDelta=function(){return this.max-this.current},Side.prototype.isDraining=function(){return this.current<=this.lowWaterMark},Side.prototype.isEmpty=function(){return this.current<=0},Side.prototype._processRefillQueue=function(){if(!this._refilling){for(this._refilling=!0;this._refillQueue.length>0;){var item=this._refillQueue[0];if(this.isEmpty())break;this.window.debug("id=%d side=%s refilled for size=%d",this.window.id,this.name,-item.size),this._refillQueue.shift(),this.update(item.size,item.callback)}this._refilling=!1}},module.exports=Window,Window.prototype.clone=function(id){return new Window({id:id,isServer:this.isServer,recv:{size:this.recv.max,max:this.recv.limit,lowWaterMark:this.recv.lowWaterMark},send:{size:this.send.max,max:this.send.limit,lowWaterMark:this.send.lowWaterMark}})}}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}module.exports=PassThrough;var Transform=__webpack_require__(323),util=__webpack_require__(6);util.inherits=__webpack_require__(1),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},function(module,exports,__webpack_require__){"use strict";function BufferList(){this.head=null,this.tail=null,this.length=0}var bufferShim=(__webpack_require__(0).Buffer,__webpack_require__(14));module.exports=BufferList,BufferList.prototype.push=function(v){var entry={data:v,next:null};this.length>0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};0===this.length&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(0!==this.length){var ret=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null, -this.length=0},BufferList.prototype.join=function(s){if(0===this.length)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s+p.data;return ret},BufferList.prototype.concat=function(n){if(0===this.length)return bufferShim.alloc(0);if(1===this.length)return this.head.data;for(var ret=bufferShim.allocUnsafe(n>>>0),p=this.head,i=0;p;)p.data.copy(ret,i),i+=p.data.length,p=p.next;return ret}},function(module,exports,__webpack_require__){!function(){function exec(arr,comp){"function"!=typeof comp&&(comp=function(a,b){return String(a).localeCompare(b)});var len=arr.length;if(len<=1)return arr;for(var buffer=new Array(len),chk=1;chklen&&(r=len),e>len&&(e=len),li=l,ri=r;;)if(li0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};0===this.length&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(0!==this.length){var ret=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s){if(0===this.length)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s+p.data;return ret},BufferList.prototype.concat=function(n){if(0===this.length)return bufferShim.alloc(0);if(1===this.length)return this.head.data;for(var ret=bufferShim.allocUnsafe(n>>>0),p=this.head,i=0;p;)p.data.copy(ret,i),i+=p.data.length,p=p.next;return ret}},function(module,exports,__webpack_require__){module.exports=__webpack_require__(166).PassThrough},function(module,exports,__webpack_require__){module.exports=__webpack_require__(166).Transform},function(module,exports,__webpack_require__){module.exports=__webpack_require__(165)},function(module,exports){function shift(stream){var rs=stream._readableState;return rs?rs.objectMode?stream.read():stream.read(getStateLength(rs)):null}function getStateLength(state){return state.buffer.length?state.buffer.head?state.buffer.head.data.length:state.buffer[0].length:state.length}module.exports=shift},function(module,exports,__webpack_require__){var isHexPrefixed=__webpack_require__(235);module.exports=function(str){return"string"!=typeof str?str:isHexPrefixed(str)?str.slice(2):str}},function(module,exports,__webpack_require__){"use strict";function TimeCache(options){if(!(this instanceof TimeCache))return new TimeCache(options);options=options||{};const validity=options.validity||30,entries=new Map,sweep=throttle(()=>{entries.forEach((entry,key)=>{const v=entry.validity||validity;getTimeElapsed(entry.timestamp)>v&&entries.delete(key)})},200);this.put=((key,value,validity)=>{this.has(key)||entries.set(key,{value:value,timestamp:new Date,validity:validity}),sweep()}),this.get=(key=>{if(entries.has(key))return entries.get(key).value;throw new Error("key does not exist")}),this.has=(key=>{return entries.has(key)})}function getTimeElapsed(prevTime){const currentTime=new Date,a=currentTime.getTime()-prevTime.getTime();return Math.floor(a/1e3)}const throttle=__webpack_require__(638);module.exports=TimeCache},function(module,exports){function toArray(list,index){var array=[];index=index||0;for(var i=index||0;i>24&255,x[i+1]=h>>16&255,x[i+2]=h>>8&255,x[i+3]=255&h,x[i+4]=l>>24&255,x[i+5]=l>>16&255,x[i+6]=l>>8&255,x[i+7]=255&l}function vn(x,xi,y,yi,n){var i,d=0;for(i=0;i>>8)-1}function crypto_verify_16(x,xi,y,yi){return vn(x,xi,y,yi,16)}function crypto_verify_32(x,xi,y,yi){return vn(x,xi,y,yi,32)}function core_salsa20(o,p,k,c){for(var u,j0=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,j1=255&k[0]|(255&k[1])<<8|(255&k[2])<<16|(255&k[3])<<24,j2=255&k[4]|(255&k[5])<<8|(255&k[6])<<16|(255&k[7])<<24,j3=255&k[8]|(255&k[9])<<8|(255&k[10])<<16|(255&k[11])<<24,j4=255&k[12]|(255&k[13])<<8|(255&k[14])<<16|(255&k[15])<<24,j5=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,j6=255&p[0]|(255&p[1])<<8|(255&p[2])<<16|(255&p[3])<<24,j7=255&p[4]|(255&p[5])<<8|(255&p[6])<<16|(255&p[7])<<24,j8=255&p[8]|(255&p[9])<<8|(255&p[10])<<16|(255&p[11])<<24,j9=255&p[12]|(255&p[13])<<8|(255&p[14])<<16|(255&p[15])<<24,j10=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,j11=255&k[16]|(255&k[17])<<8|(255&k[18])<<16|(255&k[19])<<24,j12=255&k[20]|(255&k[21])<<8|(255&k[22])<<16|(255&k[23])<<24,j13=255&k[24]|(255&k[25])<<8|(255&k[26])<<16|(255&k[27])<<24,j14=255&k[28]|(255&k[29])<<8|(255&k[30])<<16|(255&k[31])<<24,j15=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,x0=j0,x1=j1,x2=j2,x3=j3,x4=j4,x5=j5,x6=j6,x7=j7,x8=j8,x9=j9,x10=j10,x11=j11,x12=j12,x13=j13,x14=j14,x15=j15,i=0;i<20;i+=2)u=x0+x12|0,x4^=u<<7|u>>>25,u=x4+x0|0,x8^=u<<9|u>>>23,u=x8+x4|0,x12^=u<<13|u>>>19,u=x12+x8|0,x0^=u<<18|u>>>14,u=x5+x1|0,x9^=u<<7|u>>>25,u=x9+x5|0,x13^=u<<9|u>>>23,u=x13+x9|0,x1^=u<<13|u>>>19,u=x1+x13|0,x5^=u<<18|u>>>14,u=x10+x6|0,x14^=u<<7|u>>>25,u=x14+x10|0,x2^=u<<9|u>>>23,u=x2+x14|0,x6^=u<<13|u>>>19,u=x6+x2|0,x10^=u<<18|u>>>14,u=x15+x11|0,x3^=u<<7|u>>>25,u=x3+x15|0,x7^=u<<9|u>>>23,u=x7+x3|0,x11^=u<<13|u>>>19,u=x11+x7|0,x15^=u<<18|u>>>14,u=x0+x3|0,x1^=u<<7|u>>>25,u=x1+x0|0,x2^=u<<9|u>>>23,u=x2+x1|0,x3^=u<<13|u>>>19,u=x3+x2|0,x0^=u<<18|u>>>14,u=x5+x4|0,x6^=u<<7|u>>>25,u=x6+x5|0,x7^=u<<9|u>>>23,u=x7+x6|0,x4^=u<<13|u>>>19,u=x4+x7|0,x5^=u<<18|u>>>14,u=x10+x9|0,x11^=u<<7|u>>>25,u=x11+x10|0,x8^=u<<9|u>>>23,u=x8+x11|0,x9^=u<<13|u>>>19,u=x9+x8|0,x10^=u<<18|u>>>14,u=x15+x14|0,x12^=u<<7|u>>>25,u=x12+x15|0,x13^=u<<9|u>>>23,u=x13+x12|0,x14^=u<<13|u>>>19,u=x14+x13|0,x15^=u<<18|u>>>14;x0=x0+j0|0,x1=x1+j1|0,x2=x2+j2|0,x3=x3+j3|0,x4=x4+j4|0,x5=x5+j5|0,x6=x6+j6|0,x7=x7+j7|0,x8=x8+j8|0,x9=x9+j9|0,x10=x10+j10|0,x11=x11+j11|0,x12=x12+j12|0,x13=x13+j13|0,x14=x14+j14|0,x15=x15+j15|0,o[0]=x0>>>0&255,o[1]=x0>>>8&255,o[2]=x0>>>16&255,o[3]=x0>>>24&255,o[4]=x1>>>0&255,o[5]=x1>>>8&255,o[6]=x1>>>16&255,o[7]=x1>>>24&255,o[8]=x2>>>0&255,o[9]=x2>>>8&255,o[10]=x2>>>16&255,o[11]=x2>>>24&255,o[12]=x3>>>0&255,o[13]=x3>>>8&255,o[14]=x3>>>16&255,o[15]=x3>>>24&255,o[16]=x4>>>0&255,o[17]=x4>>>8&255,o[18]=x4>>>16&255,o[19]=x4>>>24&255,o[20]=x5>>>0&255,o[21]=x5>>>8&255,o[22]=x5>>>16&255,o[23]=x5>>>24&255,o[24]=x6>>>0&255,o[25]=x6>>>8&255,o[26]=x6>>>16&255,o[27]=x6>>>24&255,o[28]=x7>>>0&255,o[29]=x7>>>8&255,o[30]=x7>>>16&255,o[31]=x7>>>24&255,o[32]=x8>>>0&255,o[33]=x8>>>8&255,o[34]=x8>>>16&255,o[35]=x8>>>24&255,o[36]=x9>>>0&255,o[37]=x9>>>8&255,o[38]=x9>>>16&255,o[39]=x9>>>24&255,o[40]=x10>>>0&255,o[41]=x10>>>8&255,o[42]=x10>>>16&255,o[43]=x10>>>24&255,o[44]=x11>>>0&255,o[45]=x11>>>8&255,o[46]=x11>>>16&255,o[47]=x11>>>24&255,o[48]=x12>>>0&255,o[49]=x12>>>8&255,o[50]=x12>>>16&255,o[51]=x12>>>24&255,o[52]=x13>>>0&255,o[53]=x13>>>8&255,o[54]=x13>>>16&255,o[55]=x13>>>24&255,o[56]=x14>>>0&255,o[57]=x14>>>8&255,o[58]=x14>>>16&255,o[59]=x14>>>24&255,o[60]=x15>>>0&255,o[61]=x15>>>8&255,o[62]=x15>>>16&255,o[63]=x15>>>24&255}function core_hsalsa20(o,p,k,c){for(var u,j0=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,j1=255&k[0]|(255&k[1])<<8|(255&k[2])<<16|(255&k[3])<<24,j2=255&k[4]|(255&k[5])<<8|(255&k[6])<<16|(255&k[7])<<24,j3=255&k[8]|(255&k[9])<<8|(255&k[10])<<16|(255&k[11])<<24,j4=255&k[12]|(255&k[13])<<8|(255&k[14])<<16|(255&k[15])<<24,j5=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,j6=255&p[0]|(255&p[1])<<8|(255&p[2])<<16|(255&p[3])<<24,j7=255&p[4]|(255&p[5])<<8|(255&p[6])<<16|(255&p[7])<<24,j8=255&p[8]|(255&p[9])<<8|(255&p[10])<<16|(255&p[11])<<24,j9=255&p[12]|(255&p[13])<<8|(255&p[14])<<16|(255&p[15])<<24,j10=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,j11=255&k[16]|(255&k[17])<<8|(255&k[18])<<16|(255&k[19])<<24,j12=255&k[20]|(255&k[21])<<8|(255&k[22])<<16|(255&k[23])<<24,j13=255&k[24]|(255&k[25])<<8|(255&k[26])<<16|(255&k[27])<<24,j14=255&k[28]|(255&k[29])<<8|(255&k[30])<<16|(255&k[31])<<24,j15=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,x0=j0,x1=j1,x2=j2,x3=j3,x4=j4,x5=j5,x6=j6,x7=j7,x8=j8,x9=j9,x10=j10,x11=j11,x12=j12,x13=j13,x14=j14,x15=j15,i=0;i<20;i+=2)u=x0+x12|0,x4^=u<<7|u>>>25,u=x4+x0|0,x8^=u<<9|u>>>23,u=x8+x4|0,x12^=u<<13|u>>>19,u=x12+x8|0,x0^=u<<18|u>>>14,u=x5+x1|0,x9^=u<<7|u>>>25,u=x9+x5|0,x13^=u<<9|u>>>23,u=x13+x9|0,x1^=u<<13|u>>>19,u=x1+x13|0,x5^=u<<18|u>>>14,u=x10+x6|0,x14^=u<<7|u>>>25,u=x14+x10|0,x2^=u<<9|u>>>23,u=x2+x14|0,x6^=u<<13|u>>>19,u=x6+x2|0,x10^=u<<18|u>>>14,u=x15+x11|0,x3^=u<<7|u>>>25,u=x3+x15|0,x7^=u<<9|u>>>23,u=x7+x3|0,x11^=u<<13|u>>>19,u=x11+x7|0,x15^=u<<18|u>>>14,u=x0+x3|0,x1^=u<<7|u>>>25,u=x1+x0|0,x2^=u<<9|u>>>23,u=x2+x1|0,x3^=u<<13|u>>>19,u=x3+x2|0,x0^=u<<18|u>>>14,u=x5+x4|0,x6^=u<<7|u>>>25,u=x6+x5|0,x7^=u<<9|u>>>23,u=x7+x6|0,x4^=u<<13|u>>>19,u=x4+x7|0,x5^=u<<18|u>>>14,u=x10+x9|0,x11^=u<<7|u>>>25,u=x11+x10|0,x8^=u<<9|u>>>23,u=x8+x11|0,x9^=u<<13|u>>>19,u=x9+x8|0,x10^=u<<18|u>>>14,u=x15+x14|0,x12^=u<<7|u>>>25,u=x12+x15|0,x13^=u<<9|u>>>23,u=x13+x12|0,x14^=u<<13|u>>>19,u=x14+x13|0,x15^=u<<18|u>>>14;o[0]=x0>>>0&255,o[1]=x0>>>8&255,o[2]=x0>>>16&255,o[3]=x0>>>24&255,o[4]=x5>>>0&255,o[5]=x5>>>8&255,o[6]=x5>>>16&255,o[7]=x5>>>24&255,o[8]=x10>>>0&255,o[9]=x10>>>8&255,o[10]=x10>>>16&255,o[11]=x10>>>24&255,o[12]=x15>>>0&255,o[13]=x15>>>8&255,o[14]=x15>>>16&255,o[15]=x15>>>24&255,o[16]=x6>>>0&255,o[17]=x6>>>8&255,o[18]=x6>>>16&255,o[19]=x6>>>24&255,o[20]=x7>>>0&255,o[21]=x7>>>8&255,o[22]=x7>>>16&255,o[23]=x7>>>24&255,o[24]=x8>>>0&255,o[25]=x8>>>8&255,o[26]=x8>>>16&255,o[27]=x8>>>24&255,o[28]=x9>>>0&255,o[29]=x9>>>8&255,o[30]=x9>>>16&255,o[31]=x9>>>24&255}function crypto_core_salsa20(out,inp,k,c){core_salsa20(out,inp,k,c)}function crypto_core_hsalsa20(out,inp,k,c){core_hsalsa20(out,inp,k,c)}function crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k){var u,i,z=new Uint8Array(16),x=new Uint8Array(64);for(i=0;i<16;i++)z[i]=0;for(i=0;i<8;i++)z[i]=n[i];for(;b>=64;){for(crypto_core_salsa20(x,z,k,sigma),i=0;i<64;i++)c[cpos+i]=m[mpos+i]^x[i];for(u=1,i=8;i<16;i++)u=u+(255&z[i])|0,z[i]=255&u,u>>>=8;b-=64,cpos+=64,mpos+=64}if(b>0)for(crypto_core_salsa20(x,z,k,sigma),i=0;i=64;){for(crypto_core_salsa20(x,z,k,sigma),i=0;i<64;i++)c[cpos+i]=x[i];for(u=1,i=8;i<16;i++)u=u+(255&z[i])|0,z[i]=255&u,u>>>=8;b-=64,cpos+=64}if(b>0)for(crypto_core_salsa20(x,z,k,sigma),i=0;i>16&1),m[i-1]&=65535;m[15]=t[15]-32767-(m[14]>>16&1),b=m[15]>>16&1,m[14]&=65535,sel25519(t,m,1-b)}for(i=0;i<16;i++)o[2*i]=255&t[i],o[2*i+1]=t[i]>>8}function neq25519(a,b){var c=new Uint8Array(32),d=new Uint8Array(32);return pack25519(c,a),pack25519(d,b),crypto_verify_32(c,0,d,0)}function par25519(a){var d=new Uint8Array(32);return pack25519(d,a),1&d[0]}function unpack25519(o,n){var i;for(i=0;i<16;i++)o[i]=n[2*i]+(n[2*i+1]<<8);o[15]&=32767}function A(o,a,b){for(var i=0;i<16;i++)o[i]=a[i]+b[i]}function Z(o,a,b){for(var i=0;i<16;i++)o[i]=a[i]-b[i]}function M(o,a,b){var v,c,t0=0,t1=0,t2=0,t3=0,t4=0,t5=0,t6=0,t7=0,t8=0,t9=0,t10=0,t11=0,t12=0,t13=0,t14=0,t15=0,t16=0,t17=0,t18=0,t19=0,t20=0,t21=0,t22=0,t23=0,t24=0,t25=0,t26=0,t27=0,t28=0,t29=0,t30=0,b0=b[0],b1=b[1],b2=b[2],b3=b[3],b4=b[4],b5=b[5],b6=b[6],b7=b[7],b8=b[8],b9=b[9],b10=b[10],b11=b[11],b12=b[12],b13=b[13],b14=b[14],b15=b[15];v=a[0],t0+=v*b0,t1+=v*b1,t2+=v*b2,t3+=v*b3,t4+=v*b4,t5+=v*b5,t6+=v*b6,t7+=v*b7,t8+=v*b8,t9+=v*b9,t10+=v*b10,t11+=v*b11,t12+=v*b12,t13+=v*b13,t14+=v*b14,t15+=v*b15,v=a[1],t1+=v*b0,t2+=v*b1,t3+=v*b2,t4+=v*b3,t5+=v*b4,t6+=v*b5,t7+=v*b6,t8+=v*b7,t9+=v*b8,t10+=v*b9,t11+=v*b10,t12+=v*b11,t13+=v*b12,t14+=v*b13,t15+=v*b14,t16+=v*b15,v=a[2],t2+=v*b0,t3+=v*b1,t4+=v*b2,t5+=v*b3,t6+=v*b4,t7+=v*b5,t8+=v*b6,t9+=v*b7,t10+=v*b8,t11+=v*b9,t12+=v*b10,t13+=v*b11,t14+=v*b12,t15+=v*b13,t16+=v*b14,t17+=v*b15,v=a[3],t3+=v*b0,t4+=v*b1,t5+=v*b2,t6+=v*b3,t7+=v*b4,t8+=v*b5,t9+=v*b6,t10+=v*b7,t11+=v*b8,t12+=v*b9,t13+=v*b10,t14+=v*b11,t15+=v*b12,t16+=v*b13,t17+=v*b14,t18+=v*b15,v=a[4],t4+=v*b0,t5+=v*b1,t6+=v*b2,t7+=v*b3,t8+=v*b4,t9+=v*b5,t10+=v*b6,t11+=v*b7,t12+=v*b8,t13+=v*b9,t14+=v*b10,t15+=v*b11,t16+=v*b12,t17+=v*b13,t18+=v*b14,t19+=v*b15,v=a[5],t5+=v*b0,t6+=v*b1,t7+=v*b2,t8+=v*b3,t9+=v*b4,t10+=v*b5,t11+=v*b6,t12+=v*b7,t13+=v*b8,t14+=v*b9,t15+=v*b10,t16+=v*b11,t17+=v*b12,t18+=v*b13,t19+=v*b14,t20+=v*b15,v=a[6],t6+=v*b0,t7+=v*b1,t8+=v*b2,t9+=v*b3,t10+=v*b4,t11+=v*b5,t12+=v*b6,t13+=v*b7,t14+=v*b8,t15+=v*b9,t16+=v*b10,t17+=v*b11,t18+=v*b12,t19+=v*b13,t20+=v*b14,t21+=v*b15,v=a[7],t7+=v*b0,t8+=v*b1,t9+=v*b2,t10+=v*b3,t11+=v*b4,t12+=v*b5,t13+=v*b6,t14+=v*b7,t15+=v*b8,t16+=v*b9,t17+=v*b10,t18+=v*b11,t19+=v*b12,t20+=v*b13,t21+=v*b14,t22+=v*b15,v=a[8],t8+=v*b0,t9+=v*b1,t10+=v*b2,t11+=v*b3,t12+=v*b4,t13+=v*b5,t14+=v*b6,t15+=v*b7,t16+=v*b8,t17+=v*b9,t18+=v*b10,t19+=v*b11,t20+=v*b12,t21+=v*b13,t22+=v*b14,t23+=v*b15,v=a[9],t9+=v*b0,t10+=v*b1,t11+=v*b2,t12+=v*b3,t13+=v*b4,t14+=v*b5,t15+=v*b6,t16+=v*b7,t17+=v*b8,t18+=v*b9,t19+=v*b10,t20+=v*b11,t21+=v*b12,t22+=v*b13,t23+=v*b14,t24+=v*b15,v=a[10],t10+=v*b0,t11+=v*b1,t12+=v*b2,t13+=v*b3,t14+=v*b4,t15+=v*b5,t16+=v*b6,t17+=v*b7,t18+=v*b8,t19+=v*b9,t20+=v*b10,t21+=v*b11,t22+=v*b12,t23+=v*b13,t24+=v*b14,t25+=v*b15,v=a[11],t11+=v*b0,t12+=v*b1,t13+=v*b2,t14+=v*b3,t15+=v*b4,t16+=v*b5,t17+=v*b6,t18+=v*b7,t19+=v*b8,t20+=v*b9,t21+=v*b10,t22+=v*b11;t23+=v*b12,t24+=v*b13,t25+=v*b14,t26+=v*b15,v=a[12],t12+=v*b0,t13+=v*b1,t14+=v*b2,t15+=v*b3,t16+=v*b4,t17+=v*b5,t18+=v*b6,t19+=v*b7,t20+=v*b8,t21+=v*b9,t22+=v*b10,t23+=v*b11,t24+=v*b12,t25+=v*b13,t26+=v*b14,t27+=v*b15,v=a[13],t13+=v*b0,t14+=v*b1,t15+=v*b2,t16+=v*b3,t17+=v*b4,t18+=v*b5,t19+=v*b6,t20+=v*b7,t21+=v*b8,t22+=v*b9,t23+=v*b10,t24+=v*b11,t25+=v*b12,t26+=v*b13,t27+=v*b14,t28+=v*b15,v=a[14],t14+=v*b0,t15+=v*b1,t16+=v*b2,t17+=v*b3,t18+=v*b4,t19+=v*b5,t20+=v*b6,t21+=v*b7,t22+=v*b8,t23+=v*b9,t24+=v*b10,t25+=v*b11,t26+=v*b12,t27+=v*b13,t28+=v*b14,t29+=v*b15,v=a[15],t15+=v*b0,t16+=v*b1,t17+=v*b2,t18+=v*b3,t19+=v*b4,t20+=v*b5,t21+=v*b6,t22+=v*b7,t23+=v*b8,t24+=v*b9,t25+=v*b10,t26+=v*b11,t27+=v*b12,t28+=v*b13,t29+=v*b14,t30+=v*b15,t0+=38*t16,t1+=38*t17,t2+=38*t18,t3+=38*t19,t4+=38*t20,t5+=38*t21,t6+=38*t22,t7+=38*t23,t8+=38*t24,t9+=38*t25,t10+=38*t26,t11+=38*t27,t12+=38*t28,t13+=38*t29,t14+=38*t30,c=1,v=t0+c+65535,c=Math.floor(v/65536),t0=v-65536*c,v=t1+c+65535,c=Math.floor(v/65536),t1=v-65536*c,v=t2+c+65535,c=Math.floor(v/65536),t2=v-65536*c,v=t3+c+65535,c=Math.floor(v/65536),t3=v-65536*c,v=t4+c+65535,c=Math.floor(v/65536),t4=v-65536*c,v=t5+c+65535,c=Math.floor(v/65536),t5=v-65536*c,v=t6+c+65535,c=Math.floor(v/65536),t6=v-65536*c,v=t7+c+65535,c=Math.floor(v/65536),t7=v-65536*c,v=t8+c+65535,c=Math.floor(v/65536),t8=v-65536*c,v=t9+c+65535,c=Math.floor(v/65536),t9=v-65536*c,v=t10+c+65535,c=Math.floor(v/65536),t10=v-65536*c,v=t11+c+65535,c=Math.floor(v/65536),t11=v-65536*c,v=t12+c+65535,c=Math.floor(v/65536),t12=v-65536*c,v=t13+c+65535,c=Math.floor(v/65536),t13=v-65536*c,v=t14+c+65535,c=Math.floor(v/65536),t14=v-65536*c,v=t15+c+65535,c=Math.floor(v/65536),t15=v-65536*c,t0+=c-1+37*(c-1),c=1,v=t0+c+65535,c=Math.floor(v/65536),t0=v-65536*c,v=t1+c+65535,c=Math.floor(v/65536),t1=v-65536*c,v=t2+c+65535,c=Math.floor(v/65536),t2=v-65536*c,v=t3+c+65535,c=Math.floor(v/65536),t3=v-65536*c,v=t4+c+65535,c=Math.floor(v/65536),t4=v-65536*c,v=t5+c+65535,c=Math.floor(v/65536),t5=v-65536*c,v=t6+c+65535,c=Math.floor(v/65536),t6=v-65536*c,v=t7+c+65535,c=Math.floor(v/65536),t7=v-65536*c,v=t8+c+65535,c=Math.floor(v/65536),t8=v-65536*c,v=t9+c+65535,c=Math.floor(v/65536),t9=v-65536*c,v=t10+c+65535,c=Math.floor(v/65536),t10=v-65536*c,v=t11+c+65535,c=Math.floor(v/65536),t11=v-65536*c,v=t12+c+65535,c=Math.floor(v/65536),t12=v-65536*c,v=t13+c+65535,c=Math.floor(v/65536),t13=v-65536*c,v=t14+c+65535,c=Math.floor(v/65536),t14=v-65536*c,v=t15+c+65535,c=Math.floor(v/65536),t15=v-65536*c,t0+=c-1+37*(c-1),o[0]=t0,o[1]=t1,o[2]=t2,o[3]=t3,o[4]=t4,o[5]=t5,o[6]=t6,o[7]=t7,o[8]=t8,o[9]=t9,o[10]=t10,o[11]=t11,o[12]=t12;o[13]=t13,o[14]=t14,o[15]=t15}function S(o,a){M(o,a,a)}function inv25519(o,i){var a,c=gf();for(a=0;a<16;a++)c[a]=i[a];for(a=253;a>=0;a--)S(c,c),2!==a&&4!==a&&M(c,c,i);for(a=0;a<16;a++)o[a]=c[a]}function pow2523(o,i){var a,c=gf();for(a=0;a<16;a++)c[a]=i[a];for(a=250;a>=0;a--)S(c,c),1!==a&&M(c,c,i);for(a=0;a<16;a++)o[a]=c[a]}function crypto_scalarmult(q,n,p){var r,i,z=new Uint8Array(32),x=new Float64Array(80),a=gf(),b=gf(),c=gf(),d=gf(),e=gf(),f=gf();for(i=0;i<31;i++)z[i]=n[i];for(z[31]=127&n[31]|64,z[0]&=248,unpack25519(x,p),i=0;i<16;i++)b[i]=x[i],d[i]=a[i]=c[i]=0;for(a[0]=d[0]=1,i=254;i>=0;--i)r=z[i>>>3]>>>(7&i)&1,sel25519(a,b,r),sel25519(c,d,r),A(e,a,c),Z(a,a,c),A(c,b,d),Z(b,b,d),S(d,e),S(f,a),M(a,c,a),M(c,b,e),A(e,a,c),Z(a,a,c),S(b,a),Z(c,d,f),M(a,c,_121665),A(a,a,d),M(c,c,a),M(a,d,f),M(d,b,x),S(b,e),sel25519(a,b,r),sel25519(c,d,r);for(i=0;i<16;i++)x[i+16]=a[i],x[i+32]=c[i],x[i+48]=b[i],x[i+64]=d[i];var x32=x.subarray(32),x16=x.subarray(16);return inv25519(x32,x32),M(x16,x16,x32),pack25519(q,x16),0}function crypto_scalarmult_base(q,n){return crypto_scalarmult(q,n,_9)}function crypto_box_keypair(y,x){return randombytes(x,32),crypto_scalarmult_base(y,x)}function crypto_box_beforenm(k,y,x){var s=new Uint8Array(32);return crypto_scalarmult(s,x,y),crypto_core_hsalsa20(k,_0,s,sigma)}function crypto_box(c,m,d,n,y,x){var k=new Uint8Array(32);return crypto_box_beforenm(k,y,x),crypto_box_afternm(c,m,d,n,k)}function crypto_box_open(m,c,d,n,y,x){var k=new Uint8Array(32);return crypto_box_beforenm(k,y,x),crypto_box_open_afternm(m,c,d,n,k)}function crypto_hashblocks_hl(hh,hl,m,n){for(var bh0,bh1,bh2,bh3,bh4,bh5,bh6,bh7,bl0,bl1,bl2,bl3,bl4,bl5,bl6,bl7,th,tl,i,j,h,l,a,b,c,d,wh=new Int32Array(16),wl=new Int32Array(16),ah0=hh[0],ah1=hh[1],ah2=hh[2],ah3=hh[3],ah4=hh[4],ah5=hh[5],ah6=hh[6],ah7=hh[7],al0=hl[0],al1=hl[1],al2=hl[2],al3=hl[3],al4=hl[4],al5=hl[5],al6=hl[6],al7=hl[7],pos=0;n>=128;){for(i=0;i<16;i++)j=8*i+pos,wh[i]=m[j+0]<<24|m[j+1]<<16|m[j+2]<<8|m[j+3],wl[i]=m[j+4]<<24|m[j+5]<<16|m[j+6]<<8|m[j+7];for(i=0;i<80;i++)if(bh0=ah0,bh1=ah1,bh2=ah2,bh3=ah3,bh4=ah4,bh5=ah5,bh6=ah6,bh7=ah7,bl0=al0,bl1=al1,bl2=al2,bl3=al3,bl4=al4,bl5=al5,bl6=al6,bl7=al7,h=ah7,l=al7,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=(ah4>>>14|al4<<18)^(ah4>>>18|al4<<14)^(al4>>>9|ah4<<23),l=(al4>>>14|ah4<<18)^(al4>>>18|ah4<<14)^(ah4>>>9|al4<<23),a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,h=ah4&ah5^~ah4&ah6,l=al4&al5^~al4&al6,a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,h=K[2*i],l=K[2*i+1],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,h=wh[i%16],l=wl[i%16],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,th=65535&c|d<<16,tl=65535&a|b<<16,h=th,l=tl,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=(ah0>>>28|al0<<4)^(al0>>>2|ah0<<30)^(al0>>>7|ah0<<25),l=(al0>>>28|ah0<<4)^(ah0>>>2|al0<<30)^(ah0>>>7|al0<<25),a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,h=ah0&ah1^ah0&ah2^ah1&ah2,l=al0&al1^al0&al2^al1&al2,a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,bh7=65535&c|d<<16,bl7=65535&a|b<<16,h=bh3,l=bl3,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=th,l=tl,a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,bh3=65535&c|d<<16,bl3=65535&a|b<<16,ah1=bh0,ah2=bh1,ah3=bh2,ah4=bh3,ah5=bh4,ah6=bh5,ah7=bh6,ah0=bh7,al1=bl0,al2=bl1,al3=bl2,al4=bl3,al5=bl4,al6=bl5,al7=bl6,al0=bl7,i%16==15)for(j=0;j<16;j++)h=wh[j],l=wl[j],a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=wh[(j+9)%16],l=wl[(j+9)%16],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,th=wh[(j+1)%16],tl=wl[(j+1)%16],h=(th>>>1|tl<<31)^(th>>>8|tl<<24)^th>>>7,l=(tl>>>1|th<<31)^(tl>>>8|th<<24)^(tl>>>7|th<<25),a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,th=wh[(j+14)%16],tl=wl[(j+14)%16],h=(th>>>19|tl<<13)^(tl>>>29|th<<3)^th>>>6,l=(tl>>>19|th<<13)^(th>>>29|tl<<3)^(tl>>>6|th<<26),a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,wh[j]=65535&c|d<<16,wl[j]=65535&a|b<<16;h=ah0,l=al0,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[0],l=hl[0],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[0]=ah0=65535&c|d<<16,hl[0]=al0=65535&a|b<<16,h=ah1,l=al1,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[1],l=hl[1],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[1]=ah1=65535&c|d<<16,hl[1]=al1=65535&a|b<<16,h=ah2,l=al2,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[2],l=hl[2],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[2]=ah2=65535&c|d<<16,hl[2]=al2=65535&a|b<<16,h=ah3,l=al3,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[3],l=hl[3],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[3]=ah3=65535&c|d<<16,hl[3]=al3=65535&a|b<<16,h=ah4,l=al4,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[4],l=hl[4],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[4]=ah4=65535&c|d<<16,hl[4]=al4=65535&a|b<<16,h=ah5,l=al5,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[5],l=hl[5],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[5]=ah5=65535&c|d<<16,hl[5]=al5=65535&a|b<<16,h=ah6,l=al6,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[6],l=hl[6],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[6]=ah6=65535&c|d<<16,hl[6]=al6=65535&a|b<<16,h=ah7,l=al7,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[7],l=hl[7],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[7]=ah7=65535&c|d<<16,hl[7]=al7=65535&a|b<<16,pos+=128,n-=128}return n}function crypto_hash(out,m,n){var i,hh=new Int32Array(8),hl=new Int32Array(8),x=new Uint8Array(256),b=n;for(hh[0]=1779033703,hh[1]=3144134277,hh[2]=1013904242,hh[3]=2773480762,hh[4]=1359893119,hh[5]=2600822924,hh[6]=528734635,hh[7]=1541459225,hl[0]=4089235720,hl[1]=2227873595,hl[2]=4271175723,hl[3]=1595750129,hl[4]=2917565137,hl[5]=725511199,hl[6]=4215389547,hl[7]=327033209,crypto_hashblocks_hl(hh,hl,m,n),n%=128,i=0;i=0;--i)b=s[i/8|0]>>(7&i)&1,cswap(p,q,b),add(q,p),add(p,p),cswap(p,q,b)}function scalarbase(p,s){var q=[gf(),gf(),gf(),gf()];set25519(q[0],X),set25519(q[1],Y),set25519(q[2],gf1),M(q[3],X,Y),scalarmult(p,q,s)}function crypto_sign_keypair(pk,sk,seeded){var i,d=new Uint8Array(64),p=[gf(),gf(),gf(),gf()];for(seeded||randombytes(sk,32),crypto_hash(d,sk,32),d[0]&=248,d[31]&=127,d[31]|=64,scalarbase(p,d),pack(pk,p),i=0;i<32;i++)sk[i+32]=pk[i];return 0}function modL(r,x){var carry,i,j,k;for(i=63;i>=32;--i){for(carry=0,j=i-32,k=i-12;j>8,x[j]-=256*carry;x[j]+=carry,x[i]=0}for(carry=0,j=0;j<32;j++)x[j]+=carry-(x[31]>>4)*L[j],carry=x[j]>>8,x[j]&=255;for(j=0;j<32;j++)x[j]-=carry*L[j];for(i=0;i<32;i++)x[i+1]+=x[i]>>8,r[i]=255&x[i]}function reduce(r){var i,x=new Float64Array(64);for(i=0;i<64;i++)x[i]=r[i];for(i=0;i<64;i++)r[i]=0;modL(r,x)}function crypto_sign(sm,m,n,sk){var i,j,d=new Uint8Array(64),h=new Uint8Array(64),r=new Uint8Array(64),x=new Float64Array(64),p=[gf(),gf(),gf(),gf()];crypto_hash(d,sk,32),d[0]&=248,d[31]&=127,d[31]|=64;var smlen=n+64;for(i=0;i>7&&Z(r[0],gf0,r[0]),M(r[3],r[0],r[1]),0)}function crypto_sign_open(m,sm,n,pk){var i,t=new Uint8Array(32),h=new Uint8Array(64),p=[gf(),gf(),gf(),gf()],q=[gf(),gf(),gf(),gf()];if(-1,n<64)return-1;if(unpackneg(q,pk))return-1;for(i=0;i>>13|t1<<3),t2=255&key[4]|(255&key[5])<<8,this.r[2]=7939&(t1>>>10|t2<<6),t3=255&key[6]|(255&key[7])<<8,this.r[3]=8191&(t2>>>7|t3<<9),t4=255&key[8]|(255&key[9])<<8,this.r[4]=255&(t3>>>4|t4<<12),this.r[5]=t4>>>1&8190,t5=255&key[10]|(255&key[11])<<8,this.r[6]=8191&(t4>>>14|t5<<2),t6=255&key[12]|(255&key[13])<<8,this.r[7]=8065&(t5>>>11|t6<<5),t7=255&key[14]|(255&key[15])<<8,this.r[8]=8191&(t6>>>8|t7<<8),this.r[9]=t7>>>5&127,this.pad[0]=255&key[16]|(255&key[17])<<8,this.pad[1]=255&key[18]|(255&key[19])<<8,this.pad[2]=255&key[20]|(255&key[21])<<8,this.pad[3]=255&key[22]|(255&key[23])<<8,this.pad[4]=255&key[24]|(255&key[25])<<8,this.pad[5]=255&key[26]|(255&key[27])<<8,this.pad[6]=255&key[28]|(255&key[29])<<8,this.pad[7]=255&key[30]|(255&key[31])<<8};poly1305.prototype.blocks=function(m,mpos,bytes){for(var t0,t1,t2,t3,t4,t5,t6,t7,c,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,hibit=this.fin?0:2048,h0=this.h[0],h1=this.h[1],h2=this.h[2],h3=this.h[3],h4=this.h[4],h5=this.h[5],h6=this.h[6],h7=this.h[7],h8=this.h[8],h9=this.h[9],r0=this.r[0],r1=this.r[1],r2=this.r[2],r3=this.r[3],r4=this.r[4],r5=this.r[5],r6=this.r[6],r7=this.r[7],r8=this.r[8],r9=this.r[9];bytes>=16;)t0=255&m[mpos+0]|(255&m[mpos+1])<<8,h0+=8191&t0,t1=255&m[mpos+2]|(255&m[mpos+3])<<8,h1+=8191&(t0>>>13|t1<<3),t2=255&m[mpos+4]|(255&m[mpos+5])<<8,h2+=8191&(t1>>>10|t2<<6),t3=255&m[mpos+6]|(255&m[mpos+7])<<8,h3+=8191&(t2>>>7|t3<<9),t4=255&m[mpos+8]|(255&m[mpos+9])<<8,h4+=8191&(t3>>>4|t4<<12),h5+=t4>>>1&8191,t5=255&m[mpos+10]|(255&m[mpos+11])<<8,h6+=8191&(t4>>>14|t5<<2),t6=255&m[mpos+12]|(255&m[mpos+13])<<8,h7+=8191&(t5>>>11|t6<<5),t7=255&m[mpos+14]|(255&m[mpos+15])<<8,h8+=8191&(t6>>>8|t7<<8),h9+=t7>>>5|hibit,c=0,d0=c,d0+=h0*r0,d0+=h1*(5*r9),d0+=h2*(5*r8),d0+=h3*(5*r7),d0+=h4*(5*r6),c=d0>>>13,d0&=8191,d0+=h5*(5*r5),d0+=h6*(5*r4),d0+=h7*(5*r3),d0+=h8*(5*r2),d0+=h9*(5*r1),c+=d0>>>13,d0&=8191,d1=c,d1+=h0*r1,d1+=h1*r0,d1+=h2*(5*r9),d1+=h3*(5*r8),d1+=h4*(5*r7),c=d1>>>13,d1&=8191,d1+=h5*(5*r6),d1+=h6*(5*r5),d1+=h7*(5*r4),d1+=h8*(5*r3),d1+=h9*(5*r2),c+=d1>>>13,d1&=8191,d2=c,d2+=h0*r2,d2+=h1*r1,d2+=h2*r0,d2+=h3*(5*r9),d2+=h4*(5*r8),c=d2>>>13,d2&=8191,d2+=h5*(5*r7),d2+=h6*(5*r6),d2+=h7*(5*r5),d2+=h8*(5*r4),d2+=h9*(5*r3),c+=d2>>>13,d2&=8191,d3=c,d3+=h0*r3,d3+=h1*r2,d3+=h2*r1,d3+=h3*r0,d3+=h4*(5*r9),c=d3>>>13,d3&=8191,d3+=h5*(5*r8),d3+=h6*(5*r7),d3+=h7*(5*r6),d3+=h8*(5*r5),d3+=h9*(5*r4),c+=d3>>>13,d3&=8191,d4=c,d4+=h0*r4,d4+=h1*r3,d4+=h2*r2,d4+=h3*r1,d4+=h4*r0,c=d4>>>13,d4&=8191,d4+=h5*(5*r9),d4+=h6*(5*r8),d4+=h7*(5*r7),d4+=h8*(5*r6),d4+=h9*(5*r5),c+=d4>>>13,d4&=8191,d5=c,d5+=h0*r5,d5+=h1*r4,d5+=h2*r3,d5+=h3*r2,d5+=h4*r1,c=d5>>>13,d5&=8191,d5+=h5*r0,d5+=h6*(5*r9),d5+=h7*(5*r8),d5+=h8*(5*r7),d5+=h9*(5*r6),c+=d5>>>13,d5&=8191,d6=c,d6+=h0*r6,d6+=h1*r5,d6+=h2*r4,d6+=h3*r3,d6+=h4*r2,c=d6>>>13,d6&=8191,d6+=h5*r1,d6+=h6*r0,d6+=h7*(5*r9),d6+=h8*(5*r8),d6+=h9*(5*r7),c+=d6>>>13,d6&=8191,d7=c,d7+=h0*r7,d7+=h1*r6,d7+=h2*r5,d7+=h3*r4,d7+=h4*r3,c=d7>>>13,d7&=8191,d7+=h5*r2,d7+=h6*r1,d7+=h7*r0,d7+=h8*(5*r9),d7+=h9*(5*r8),c+=d7>>>13,d7&=8191,d8=c,d8+=h0*r8,d8+=h1*r7,d8+=h2*r6,d8+=h3*r5,d8+=h4*r4,c=d8>>>13,d8&=8191,d8+=h5*r3,d8+=h6*r2,d8+=h7*r1,d8+=h8*r0,d8+=h9*(5*r9),c+=d8>>>13,d8&=8191,d9=c,d9+=h0*r9,d9+=h1*r8,d9+=h2*r7,d9+=h3*r6,d9+=h4*r5,c=d9>>>13,d9&=8191,d9+=h5*r4,d9+=h6*r3,d9+=h7*r2,d9+=h8*r1,d9+=h9*r0,c+=d9>>>13,d9&=8191,c=(c<<2)+c|0,c=c+d0|0,d0=8191&c,c>>>=13,d1+=c,h0=d0,h1=d1,h2=d2,h3=d3,h4=d4,h5=d5,h6=d6,h7=d7,h8=d8,h9=d9,mpos+=16,bytes-=16;this.h[0]=h0,this.h[1]=h1,this.h[2]=h2,this.h[3]=h3,this.h[4]=h4,this.h[5]=h5,this.h[6]=h6,this.h[7]=h7,this.h[8]=h8,this.h[9]=h9},poly1305.prototype.finish=function(mac,macpos){var c,mask,f,i,g=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(c=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=c,c=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*c,c=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=c,c=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=c,g[0]=this.h[0]+5,c=g[0]>>>13,g[0]&=8191,i=1;i<10;i++)g[i]=this.h[i]+c,c=g[i]>>>13,g[i]&=8191;for(g[9]-=8192,mask=(1^c)-1,i=0;i<10;i++)g[i]&=mask;for(mask=~mask,i=0;i<10;i++)this.h[i]=this.h[i]&mask|g[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),f=this.h[0]+this.pad[0],this.h[0]=65535&f,i=1;i<8;i++)f=(this.h[i]+this.pad[i]|0)+(f>>>16)|0,this.h[i]=65535&f;mac[macpos+0]=this.h[0]>>>0&255,mac[macpos+1]=this.h[0]>>>8&255,mac[macpos+2]=this.h[1]>>>0&255,mac[macpos+3]=this.h[1]>>>8&255,mac[macpos+4]=this.h[2]>>>0&255,mac[macpos+5]=this.h[2]>>>8&255,mac[macpos+6]=this.h[3]>>>0&255,mac[macpos+7]=this.h[3]>>>8&255,mac[macpos+8]=this.h[4]>>>0&255,mac[macpos+9]=this.h[4]>>>8&255,mac[macpos+10]=this.h[5]>>>0&255,mac[macpos+11]=this.h[5]>>>8&255,mac[macpos+12]=this.h[6]>>>0&255,mac[macpos+13]=this.h[6]>>>8&255,mac[macpos+14]=this.h[7]>>>0&255,mac[macpos+15]=this.h[7]>>>8&255},poly1305.prototype.update=function(m,mpos,bytes){var i,want;if(this.leftover){for(want=16-this.leftover,want>bytes&&(want=bytes),i=0;i=16&&(want=bytes-bytes%16,this.blocks(m,mpos,want),mpos+=want,bytes-=want),bytes){for(i=0;i=0},nacl.sign.keyPair=function(){var pk=new Uint8Array(32),sk=new Uint8Array(64);return crypto_sign_keypair(pk,sk),{publicKey:pk,secretKey:sk}},nacl.sign.keyPair.fromSecretKey=function(secretKey){if(checkArrayTypes(),64!==secretKey.length)throw new Error("bad secret key size");for(var pk=new Uint8Array(32),i=0;i>>((3&i)<<3)&255;return rnds}}module.exports=rng}).call(exports,__webpack_require__(4))},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const varint=__webpack_require__(16);module.exports=(buf=>{if(!Buffer.isBuffer(buf))throw new Error("arg needs to be a buffer");let result=[];for(;buf.length>0;){const num=varint.decode(buf);result.push(num),buf=buf.slice(varint.decode.bytes)}return result})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports){function read(buf,offset){var b,res=0,offset=offset||0,shift=0,counter=offset,l=buf.length;do{if(counter>=l)throw read.bytes=0,new RangeError("Could not decode varint");b=buf[counter++],res+=shift<28?(b&REST)<=MSB);return read.bytes=counter-offset,res}module.exports=read;var MSB=128,REST=127},function(module,exports){function encode(num,out,offset){out=out||[],offset=offset||0;for(var oldOffset=offset;num>=INT;)out[offset++]=255&num|MSB,num/=128;for(;num&MSBALL;)out[offset++]=255&num|MSB,num>>>=7;return out[offset]=0|num,encode.bytes=offset-oldOffset+1,out}module.exports=encode;var MSB=128,MSBALL=-128,INT=Math.pow(2,31)},function(module,exports){var N1=Math.pow(2,7),N2=Math.pow(2,14),N3=Math.pow(2,21),N4=Math.pow(2,28),N5=Math.pow(2,35),N6=Math.pow(2,42),N7=Math.pow(2,49),N8=Math.pow(2,56),N9=Math.pow(2,63);module.exports=function(value){return value=26||"moz"===prefix&&version>=33),AudioContext=self.AudioContext||self.webkitAudioContext,videoEl=self.document&&document.createElement("video"),supportVp8=videoEl&&videoEl.canPlayType&&"probably"===videoEl.canPlayType('video/webm; codecs="vp8", vorbis'),getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.msGetUserMedia||navigator.mozGetUserMedia;module.exports={prefix:prefix,browserVersion:version,support:!!PC&&!!getUserMedia,supportRTCPeerConnection:!!PC,supportVp8:supportVp8,supportGetUserMedia:!!getUserMedia,supportDataChannel:!!(PC&&PC.prototype&&PC.prototype.createDataChannel),supportWebAudio:!(!AudioContext||!AudioContext.prototype.createMediaStreamSource),supportMediaStream:!(!MediaStream||!MediaStream.prototype.removeTrack),supportScreenSharing:!!screenSharing,AudioContext:AudioContext,PeerConnection:PC,SessionDescription:SessionDescription,IceCandidate:IceCandidate,MediaStream:MediaStream,getUserMedia:getUserMedia}},function(module,exports,__webpack_require__){"use strict";const waterfall=__webpack_require__(9),series=__webpack_require__(40),extend=__webpack_require__(200);module.exports=(self=>{self.log("booting");const options=self._options,doInit=options.init,doStart=options.start,config=options.config,setConfig=config&&"object"==typeof config,repoOpen=!self._repo.closed,customInitOptions="object"==typeof options.init?options.init:{},initOptions=Object.assign({bits:2048},customInitOptions),maybeOpenRepo=cb=>{if(repoOpen)return cb(null,!0);series([cb=>self._repo.open(cb),cb=>self.preStart(cb),cb=>{self.state.initialized(),cb(null,!0)}],(err,res)=>{if(err)return err.message.match(/not found/)||err.message.match(/ENOENT/)||err.message.match(/No value/)?cb(null,!1):cb(err);cb(null,res)})},done=err=>{if(err)return self.emit("error",err);self.emit("ready"),self.log("boot:done",err)},tasks=[];maybeOpenRepo((err,hasRepo)=>{if(err)return done(err);if(doInit&&!hasRepo&&(tasks.push(cb=>self.init(initOptions,cb)),hasRepo=!0),setConfig&&(hasRepo?tasks.push(cb=>{waterfall([cb=>self.config.get(cb),(config,cb)=>{extend(config,options.config),self.config.replace(config,cb)}],cb)}):console.log('WARNING, trying to set config on uninitialized repo, maybe forgot to set "init: true"')),doStart){if(!hasRepo)return console.log('WARNING, trying to start ipfs node on uninitialized repo, maybe forgot to set "init: true"'),done(new Error("Uninitalized repo"));tasks.push(cb=>self.start(cb))}series(tasks,done)})})},function(module,exports,__webpack_require__){"use strict";function formatWantlist(list){return Array.from(list).map(e=>e[1])}const OFFLINE_ERROR=__webpack_require__(169).OFFLINE_ERROR;module.exports=function(self){return{wantlist:()=>{if(!self.isOnline())throw OFFLINE_ERROR;return formatWantlist(self._bitswap.getWantlist())},stat:()=>{if(!self.isOnline())throw OFFLINE_ERROR;const stats=self._bitswap.stat();return stats.wantlist=formatWantlist(stats.wantlist),stats.peers=stats.peers.map(id=>id.toB58String()),stats},unwant:key=>{if(!self.isOnline())throw OFFLINE_ERROR}}}},function(module,exports,__webpack_require__){"use strict";function cleanCid(cid){return CID.isCID(cid)?cid:new CID(cid)}const Block=__webpack_require__(60),multihash=__webpack_require__(17),multihashing=__webpack_require__(30),CID=__webpack_require__(12),waterfall=__webpack_require__(9);module.exports=function(self){return{get:(cid,callback)=>{cid=cleanCid(cid),self._blockService.get(cid,callback)},put:(block,options,callback)=>{if("function"==typeof options&&(callback=options,options={}),Array.isArray(block))return callback(new Error("Array is not supported"));waterfall([cb=>{if(Block.isBlock(block))return cb(null,block);if(options.cid&&CID.isCID(options.cid))return cb(null,new Block(block,options.cid));const mhtype=options.mhtype||"sha2-256",format=options.format||"dag-pb",cidVersion=options.version||0;multihashing(block,mhtype,(err,multihash)=>{if(err)return cb(err);cb(null,new Block(block,new CID(cidVersion,format,multihash)))})},(block,cb)=>self._blockService.put(block,err=>{if(err)return cb(err);cb(null,block)})],callback)},rm:(cid,callback)=>{cid=cleanCid(cid),self._blockService.delete(cid,callback)},stat:(cid,callback)=>{cid=cleanCid(cid),self._blockService.get(cid,(err,block)=>{if(err)return callback(err);callback(null,{key:multihash.toB58String(cid.multihash),size:block.data.length})})}}}},function(module,exports,__webpack_require__){"use strict";const isNode=__webpack_require__(97),defaultNodes=isNode?__webpack_require__(240).Bootstrap:__webpack_require__(239).Bootstrap;module.exports=function(self){return{list:callback=>{self._repo.config.get((err,config)=>{if(err)return callback(err);callback(null,{Peers:config.Bootstrap})})},add:(multiaddr,args,callback)=>{"function"==typeof args&&(callback=args,args={default:!1}),self._repo.config.get((err,config)=>{if(err)return callback(err);args.default?config.Bootstrap=defaultNodes:multiaddr&&config.Bootstrap.push(multiaddr),self._repo.config.set(config,err=>{if(err)return callback(err);callback(null,{Peers:args.default?defaultNodes:[multiaddr]})})})},rm:(multiaddr,args,callback)=>{"function"==typeof args&&(callback=args,args={all:!1}),self._repo.config.get((err,config)=>{if(err)return callback(err);args.all?config.Bootstrap=[]:config.Bootstrap=config.Bootstrap.filter(mh=>mh!==multiaddr),self._repo.config.set(config,err=>{if(err)return callback(err);const res=[];!args.all&&multiaddr&&res.push(multiaddr),callback(null,{Peers:res})})})}}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const promisify=__webpack_require__(25),_get=__webpack_require__(262),_has=__webpack_require__(631),_set=__webpack_require__(636);module.exports=function(self){return{get:promisify((key,callback)=>{return"function"==typeof key&&(callback=key,key=void 0),key?"string"!=typeof key?callback(new Error("Invalid key type")):void self._repo.config.get((err,config)=>{if(err)return callback(err);if(_has(config,key)){const value=_get(config,key,void 0);callback(null,value)}else callback(new Error("Key does not exist in config"))}):self._repo.config.get(callback)}),set:promisify((key,value,callback)=>{return key&&"string"==typeof key?void 0===value||Buffer.isBuffer(value)?callback(new Error("Invalid value type")):void self._repo.config.get((err,config)=>{if(err)return callback(err);_set(config,key,value),self.config.replace(config,callback)}):callback(new Error("Invalid key type"))}),replace:promisify((config,callback)=>{self._repo.config.set(config,callback)})}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(25),CID=__webpack_require__(12),pull=__webpack_require__(5);module.exports=function(self){return{put:promisify((dagNode,options,callback)=>{self._ipldResolver.put(dagNode,options,callback)}),get:promisify((cid,path,options,callback)=>{if("function"==typeof path&&(callback=path,path=void 0),"function"==typeof options&&(callback=options,options={}),options=options||{},"string"==typeof cid){const split=cid.split("/");cid=new CID(split[0]),split.shift(),path=split.length>0?split.join("/"):"/"}self._ipldResolver.get(cid,path,options,callback)}),tree:promisify((cid,path,options,callback)=>{if("object"==typeof path&&(callback=options,options=path,path=void 0),"function"==typeof path&&(callback=path,path=void 0),"function"==typeof options&&(callback=options,options={}),options=options||{},"string"==typeof cid){const split=cid.split("/");cid=new CID(split[0]),split.shift(),path=split.length>0?split.join("/"):void 0}pull(self._ipldResolver.treeStream(cid,path,options),pull.collect(callback))})}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const promisify=__webpack_require__(25),every=__webpack_require__(347),PeerId=__webpack_require__(31),CID=__webpack_require__(12),each=__webpack_require__(32);module.exports=(self=>{return{get:promisify((key,options,callback)=>{if(!Buffer.isBuffer(key))return callback(new Error("Not valid key"));"function"==typeof options&&(callback=options,options={}),self._libp2pNode.dht.get(key,options.timeout,callback)}),put:promisify((key,value,callback)=>{if(!Buffer.isBuffer(key))return callback(new Error("Not valid key"));self._libp2pNode.dht.put(key,value,callback)}), -findprovs:promisify((key,callback)=>{"string"==typeof key&&(key=new CID(key)),self._libp2pNode.contentRouting.findProviders(key,callback)}),findpeer:promisify((peer,callback)=>{"string"==typeof peer&&(peer=PeerId.createFromB58String(peer)),self._libp2pNode.peerRouting.findPeer(peer,(err,info)=>{if(err)return callback(err);callback(null,[{Responses:[{ID:info.id.toB58String(),Addresses:info.multiaddrs.toArray().map(a=>a.toString())}]}])})}),provide:promisify((keys,options,callback)=>{Array.isArray(keys)||(keys=[keys]),"function"==typeof options&&(callback=options,options={}),every(keys,(key,cb)=>{self._repo.blockstore.has(key,cb)},(err,has)=>{if(err)return callback(err);options.recursive||each(keys,(cid,cb)=>{self._libp2pNode.contentRouting.provide(cid,cb)},callback)})}),query:promisify((peerId,callback)=>{"string"==typeof peerId&&(peerId=PeerId.createFromB58String(peerId)),self._libp2pNode._dht.getClosestPeers(peerId.toBytes(),(err,peerIds)=>{if(err)return callback(err);callback(null,peerIds.map(id=>{return{ID:id.toB58String()}}))})})}})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function prepareFile(self,file,callback){const bs58mh=multihashes.toB58String(file.multihash);waterfall([cb=>self.object.get(file.multihash,cb),(node,cb)=>{cb(null,{path:file.path||bs58mh,hash:bs58mh,size:node.size})}],callback)}function normalizeContent(content){return Array.isArray(content)||(content=[content]),content.map(data=>{return Buffer.isBuffer(data)&&(data={path:"",content:pull.values([data])}),isStream.isReadable(data)&&(data={path:"",content:toPull.source(data)}),data&&data.content&&"function"!=typeof data.content&&(Buffer.isBuffer(data.content)&&(data.content=pull.values([data.content])),isStream.isReadable(data.content)&&(data.content=toPull.source(data.content))),data})}function noop(){}const unixfsEngine=__webpack_require__(497),importer=unixfsEngine.importer,exporter=unixfsEngine.exporter,UnixFS=__webpack_require__(42),promisify=__webpack_require__(25),multihashes=__webpack_require__(17),pull=__webpack_require__(5),sort=__webpack_require__(730),pushable=__webpack_require__(36),toStream=__webpack_require__(158),toPull=__webpack_require__(120),CID=__webpack_require__(12),waterfall=__webpack_require__(9),isStream=__webpack_require__(543),Duplex=__webpack_require__(308).Duplex;module.exports=function(self){const createAddPullStream=options=>{const opts=Object.assign({},{shardSplitThreshold:self._options.EXPERIMENTAL.sharding?1e3:1/0},options);return pull(pull.map(normalizeContent),pull.flatten(),importer(self._ipldResolver,opts),pull.asyncMap(prepareFile.bind(null,self)))};return{createAddStream:(options,callback)=>{"function"==typeof options&&(callback=options,options=void 0);const addPullStream=createAddPullStream(options),p=pushable(),s=pull(p,addPullStream),retStream=new AddStreamDuplex(s,p);retStream.once("finish",()=>p.end()),callback(null,retStream)},createAddPullStream:createAddPullStream,add:promisify((data,options,callback)=>{if("function"==typeof options?(callback=options,options=void 0):callback&&"function"==typeof callback||(callback=noop),"object"!=typeof data&&!Buffer.isBuffer(data)&&!isStream(data))return callback(new Error("Invalid arguments, data must be an object, Buffer or readable stream"));pull(pull.values(normalizeContent(data)),importer(self._ipldResolver,options),pull.asyncMap(prepareFile.bind(null,self)),sort((a,b)=>{return a.pathb.path?-1:0}),pull.collect(callback))}),cat:promisify((hash,callback)=>{if("function"==typeof hash)return callback(new Error("You must supply a multihash"));self._ipldResolver.get(new CID(hash),(err,result)=>{if(err)return callback(err);const node=result.value;if("directory"===UnixFS.unmarshal(node.data).type)return callback(new Error("This dag node is a directory"));pull(exporter(hash,self._ipldResolver),pull.collect((err,files)=>{if(err)return callback(err);callback(null,toStream.source(files[0].content))}))})}),get:promisify((hash,callback)=>{callback(null,toStream.source(pull(exporter(hash,self._ipldResolver),pull.map(file=>{return file.content&&(file.content=toStream.source(file.content),file.content.pause()),file}))))}),getPull:promisify((hash,callback)=>{callback(null,exporter(hash,self._ipldResolver))})}};class AddStreamDuplex extends Duplex{constructor(pullStream,push,options){super(Object.assign({objectMode:!0},options)),this._pullStream=pullStream,this._pushable=push,this._waitingPullFlush=[]}_read(){this._pullStream(null,(end,data)=>{for(;this._waitingPullFlush.length;){const cb=this._waitingPullFlush.shift();cb()}end?end instanceof Error&&this.emit("error",end):this.push(data)})}_write(chunk,encoding,callback){this._waitingPullFlush.push(callback),this._pushable.push(chunk)}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(setImmediate){const promisify=__webpack_require__(25);module.exports=function(self){return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),setImmediate(()=>callback(null,{id:self._peerInfo.id.toB58String(),publicKey:self._peerInfo.id.pubKey.bytes.toString("base64"),addresses:self._peerInfo.multiaddrs.toArray().map(ma=>ma.toString()).filter(ma=>ma.indexOf("ipfs")>=0).sort(),agentVersion:"js-ipfs",protocolVersion:"9000"}))})}}).call(exports,__webpack_require__(22).setImmediate)},function(module,exports,__webpack_require__){"use strict";exports.preStart=__webpack_require__(845),exports.start=__webpack_require__(848),exports.stop=__webpack_require__(849),exports.isOnline=__webpack_require__(841),exports.version=__webpack_require__(851),exports.id=__webpack_require__(838),exports.repo=__webpack_require__(847),exports.init=__webpack_require__(840),exports.bootstrap=__webpack_require__(833),exports.config=__webpack_require__(834),exports.block=__webpack_require__(832),exports.object=__webpack_require__(843),exports.dag=__webpack_require__(835),exports.libp2p=__webpack_require__(842),exports.swarm=__webpack_require__(850),exports.ping=__webpack_require__(844),exports.files=__webpack_require__(837),exports.bitswap=__webpack_require__(831),exports.pubsub=__webpack_require__(846),exports.dht=__webpack_require__(836)},function(module,exports,__webpack_require__){"use strict";(function(process){const peerId=__webpack_require__(31),waterfall=__webpack_require__(9),parallel=__webpack_require__(46),isNode=__webpack_require__(97),promisify=__webpack_require__(25),addDefaultAssets=__webpack_require__(870);module.exports=function(self){return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={});const done=(err,res)=>{if(err)return self.emit("error",err),callback(err);self.state.initialized(),self.emit("init"),callback(null,res)};if("uninitalized"!==self.state.state())return done(new Error("Not able to init from state: "+self.state.state()));self.state.init(),self.log("init"),opts.emptyRepo=opts.emptyRepo||!1,opts.bits=Number(opts.bits)||2048,opts.log=opts.log||function(){};const config=__webpack_require__(isNode?240:239);waterfall([cb=>self._repo.exists(cb),(exists,cb)=>{if(self.log("repo exists?",exists),exists===!0)return cb(new Error("repo already exists"));opts.log(`generating ${opts.bits}-bit RSA keypair...`,!1),self.log("generating peer id: %s bits",opts.bits),peerId.create({bits:opts.bits},cb)},(keys,cb)=>{self.log("identity generated"),config.Identity={PeerID:keys.toB58String(),PrivKey:keys.privKey.bytes.toString("base64")},opts.log("done"),opts.log("peer identity: "+config.Identity.PeerID);const isWin=/^win/.test(process.platform),isLinux=/^linux/.test(process.platform);if((!process.env.IPFS_WRTC_LINUX_WINDOWS||self._options.EXPERIMENTAL.wrtcLinuxWindows)&&(isWin||isLinux)){console.log("WARNING: Your platform does not have native WebRTC support, it won' use any WebRTC transport");const newAddrs=config.Addresses.Swarm.filter(addr=>{return addr.indexOf("libp2p-webrtc-star")<0});config.Addresses.Swarm=newAddrs}self._repo.init(config,cb)},(_,cb)=>self._repo.open(cb),cb=>{if(self.log("repo opened"),opts.emptyRepo)return cb(null,!0);const tasks=[cb=>self.object.new("unixfs-dir",cb)];"function"==typeof addDefaultAssets&&tasks.push(cb=>addDefaultAssets(self,opts.log,cb)),parallel(tasks,err=>{err?cb(err):cb(null,!0)})}],done)})}}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";module.exports=function(self){return()=>{return Boolean(self._bitswap&&self._libp2pNode)}}},function(module,exports,__webpack_require__){"use strict";const Node=__webpack_require__(584),promisify=__webpack_require__(25),get=__webpack_require__(262);module.exports=function(self){return{start:promisify(callback=>{function gotConfig(err,config){if(err)return callback(err);const options={mdns:get(config,"Discovery.MDNS.Enabled"),webRTCStar:get(config,"Discovery.webRTCStar.Enabled"),bootstrap:get(config,"Bootstrap"),dht:self._options.EXPERIMENTAL.dht};self._libp2pNode=new Node(self._peerInfo,self._peerInfoBook,options),self._libp2pNode.on("peer:discovery",peerInfo=>{self.isOnline()&&(self._peerInfoBook.put(peerInfo),self._libp2pNode.dial(peerInfo,()=>{}))}),self._libp2pNode.on("peer:connect",peerInfo=>{self._peerInfoBook.put(peerInfo)}),self._libp2pNode.start(err=>{if(err)return callback(err);self._libp2pNode.peerInfo.multiaddrs.forEach(ma=>{console.log("Swarm listening on",ma.toString())}),callback()})}self.config.get(gotConfig)}),stop:promisify(callback=>{self._libp2pNode.stop(callback)})}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function normalizeMultihash(multihash,enc){if("string"==typeof multihash)return"base58"!==enc&&enc?new Buffer(multihash,enc):multihash;if(Buffer.isBuffer(multihash))return multihash;throw new Error("unsupported multihash")}function parseBuffer(buf,encoding,callback){switch(encoding){case"json":return parseJSONBuffer(buf,callback);case"protobuf":return parseProtoBuffer(buf,callback);default:callback(new Error(`unkown encoding: ${encoding}`))}}function parseJSONBuffer(buf,callback){let data,links;try{const parsed=JSON.parse(buf.toString());links=(parsed.Links||[]).map(link=>{return new DAGLink(link.Name||link.name,link.Size||link.size,mh.fromB58String(link.Hash||link.hash||link.multihash))}),data=new Buffer(parsed.Data)}catch(err){return callback(new Error("failed to parse JSON: "+err))}DAGNode.create(data,links,callback)}function parseProtoBuffer(buf,callback){dagPB.util.deserialize(buf,callback)}const waterfall=__webpack_require__(9),promisify=__webpack_require__(25),dagPB=__webpack_require__(62),DAGNode=dagPB.DAGNode,DAGLink=dagPB.DAGLink,CID=__webpack_require__(12),mh=__webpack_require__(17),Unixfs=__webpack_require__(42),assert=__webpack_require__(7);module.exports=function(self){function editAndSave(edit){return(multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={}),waterfall([cb=>{self.object.get(multihash,options,cb)},(node,cb)=>{edit(node,(err,node)=>{if(err)return cb(err);self._ipldResolver.put(node,{cid:new CID(node.multihash)},err=>{cb(err,node)})})}],callback)}}return{new:promisify((template,callback)=>{"function"==typeof template&&(callback=template,template=void 0);let data;template?(assert("unixfs-dir"===template,"unkown template"),data=new Unixfs("directory").marshal()):data=new Buffer(0),DAGNode.create(data,(err,node)=>{if(err)return callback(err);self._ipldResolver.put(node,{cid:new CID(node.multihash)},err=>{if(err)return callback(err);callback(null,node)})})}),put:promisify((obj,options,callback)=>{function next(){self._ipldResolver.put(node,{cid:new CID(node.multihash)},err=>{if(err)return callback(err);self.object.get(node.multihash,callback)})}"function"==typeof options&&(callback=options,options={});const encoding=options.enc;let node;if(Buffer.isBuffer(obj))encoding?parseBuffer(obj,encoding,(err,_node)=>{if(err)return callback(err);node=_node,next()}):DAGNode.create(obj,(err,_node)=>{if(err)return callback(err);node=_node,next()});else if(obj.multihash)node=obj,next();else{if("object"!=typeof obj)return callback(new Error("obj not recognized"));DAGNode.create(obj.Data,obj.Links,(err,_node)=>{if(err)return callback(err);node=_node,next()})}}),get:promisify((multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={});let mh;try{mh=normalizeMultihash(multihash,options.enc)}catch(err){return callback(err)}const cid=new CID(mh);self._ipldResolver.get(cid,(err,result)=>{if(err)return callback(err);callback(null,result.value)})}),data:promisify((multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={}),self.object.get(multihash,options,(err,node)=>{if(err)return callback(err);callback(null,node.data)})}),links:promisify((multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={}),self.object.get(multihash,options,(err,node)=>{if(err)return callback(err);callback(null,node.links)})}),stat:promisify((multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={}),self.object.get(multihash,options,(err,node)=>{if(err)return callback(err);dagPB.util.serialize(node,(err,serialized)=>{if(err)return callback(err);const blockSize=serialized.length,linkLength=node.links.reduce((a,l)=>a+l.size,0);callback(null,{Hash:node.toJSON().multihash,NumLinks:node.links.length,BlockSize:blockSize,LinksSize:blockSize-node.data.length,DataSize:node.data.length,CumulativeSize:blockSize+linkLength})})})}),patch:promisify({addLink(multihash,link,options,callback){editAndSave((node,cb)=>{DAGNode.addLink(node,link,cb)})(multihash,options,callback)},rmLink(multihash,linkRef,options,callback){editAndSave((node,cb)=>{linkRef.constructor&&"DAGLink"===linkRef.constructor.name&&(linkRef=linkRef._name),DAGNode.rmLink(node,linkRef,cb)})(multihash,options,callback)},appendData(multihash,data,options,callback){editAndSave((node,cb)=>{const newData=Buffer.concat([node.data,data]);DAGNode.create(newData,node.links,cb)})(multihash,options,callback)},setData(multihash,data,options,callback){editAndSave((node,cb)=>{DAGNode.create(data,node.links,cb)})(multihash,options,callback)}})}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(25);module.exports=function(self){return promisify(callback=>{callback(new Error("Not implemented"))})}},function(module,exports,__webpack_require__){"use strict";const peerId=__webpack_require__(31),PeerInfo=__webpack_require__(51),multiaddr=__webpack_require__(34),waterfall=__webpack_require__(9),mafmt=__webpack_require__(110);module.exports=function(self){return callback=>{self.log("pre-start"),waterfall([cb=>self._repo.config.get(cb),(config,cb)=>{const privKey=config.Identity.PrivKey;peerId.createFromPrivKey(privKey,(err,id)=>cb(err,config,id))},(config,id,cb)=>{self._peerInfo=new PeerInfo(id),config.Addresses.Swarm.forEach(addr=>{let ma=multiaddr(addr);mafmt.IPFS.matches(ma)||(ma=ma.encapsulate("/ipfs/"+self._peerInfo.id.toB58String())),self._peerInfo.multiaddrs.add(ma)}),cb()}],callback)}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const promisify=__webpack_require__(25),setImmediate=__webpack_require__(11),OFFLINE_ERROR=__webpack_require__(169).OFFLINE_ERROR;module.exports=function(self){function subscribe(topic,options,handler,callback){const ps=self._pubsub;0===ps.listenerCount(topic)&&ps.subscribe(topic),ps.on(topic,handler),setImmediate(()=>callback())}return{subscribe:(topic,options,handler,callback)=>{if(!self.isOnline())throw OFFLINE_ERROR;if("function"==typeof options&&(callback=handler,handler=options,options={}),!callback)return new Promise((resolve,reject)=>{subscribe(topic,options,handler,err=>{if(err)return reject(err);resolve()})});subscribe(topic,options,handler,callback)},unsubscribe:(topic,handler)=>{const ps=self._pubsub;ps.removeListener(topic,handler),0===ps.listenerCount(topic)&&ps.unsubscribe(topic)},publish:promisify((topic,data,callback)=>{return self.isOnline()?Buffer.isBuffer(data)?(self._pubsub.publish(topic,data),void setImmediate(()=>callback())):setImmediate(()=>callback(new Error("data must be a Buffer"))):setImmediate(()=>callback(OFFLINE_ERROR))}),ls:promisify(callback=>{if(!self.isOnline())return setImmediate(()=>callback(OFFLINE_ERROR));const subscriptions=Array.from(self._pubsub.subscriptions);setImmediate(()=>callback(null,subscriptions))}),peers:promisify((topic,callback)=>{if(!self.isOnline())return setImmediate(()=>callback(OFFLINE_ERROR));const peers=Array.from(self._pubsub.peers.values()).filter(peer=>peer.topics.has(topic)).map(peer=>peer.info.id.toB58String());setImmediate(()=>callback(null,peers))}),setMaxListeners(n){return self._pubsub.setMaxListeners(n)}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";module.exports=function(self){return{init:(bits,empty,callback)=>{},version:callback=>{self._repo.version.get(callback)},gc:function(){},path:()=>self._repo.path}}},function(module,exports,__webpack_require__){"use strict";const series=__webpack_require__(40),Bitswap=__webpack_require__(463),FloodSub=__webpack_require__(576),setImmediate=__webpack_require__(11),promisify=__webpack_require__(25);module.exports=(self=>{return promisify(callback=>{callback=callback||function(){};const done=err=>{if(err)return setImmediate(()=>self.emit("error",err)),callback(err);self.state.started(),setImmediate(()=>self.emit("start")),callback()};if("stopped"!==self.state.state())return done(new Error("Not able to start from state: "+self.state.state()));self.log("starting"),self.state.start(),series([cb=>{self._repo.closed?self._repo.open(cb):cb()},cb=>self.preStart(cb),cb=>self.libp2p.start(cb)],err=>{if(err)return done(err);self._bitswap=new Bitswap(self._libp2pNode,self._repo.blockstore,self._peerInfoBook),self._bitswap.start(),self._blockService.goOnline(self._bitswap),self._options.EXPERIMENTAL.pubsub?(self._pubsub=new FloodSub(self._libp2pNode),self._pubsub.start(done)):done()})})})},function(module,exports,__webpack_require__){"use strict";const series=__webpack_require__(40);module.exports=(self=>{return callback=>{callback=callback||function(){},self.log("stop");const done=err=>{if(err)return self.emit("error",err),callback(err);self.state.stopped(),self.emit("stop"),callback()};if("running"!==self.state.state())return done(new Error("Not able to stop from state: "+self.state.state()));self.state.stop(),self._blockService.goOffline(),self._bitswap.stop(),series([cb=>{self._options.EXPERIMENTAL.pubsub?self._pubsub.stop(cb):cb()},cb=>self.libp2p.stop(cb),cb=>self._repo.close(cb)],done)}})},function(module,exports,__webpack_require__){"use strict";const multiaddr=__webpack_require__(34),promisify=__webpack_require__(25),flatMap=__webpack_require__(629),values=__webpack_require__(149),OFFLINE_ERROR=__webpack_require__(169).OFFLINE_ERROR;module.exports=function(self){return{peers:promisify((opts,callback)=>{if("function"==typeof opts&&(callback=opts,opts={}),!self.isOnline())return callback(OFFLINE_ERROR);const verbose=opts.v||opts.verbose,peers=self._peerInfoBook.getAll();callback(null,flatMap(Object.keys(peers),id=>{return peers[id].multiaddrs.toArray().map(addr=>{const res={addr:addr,peer:peers[id]};return verbose&&(res.latency="unknown"),res})}))}),addrs:promisify(callback=>{if(!self.isOnline())return callback(OFFLINE_ERROR);callback(null,values(self._peerInfoBook.getAll()).filter(peer=>peer.isConnected()))}),localAddrs:promisify(callback=>{if(!self.isOnline())return callback(OFFLINE_ERROR);callback(null,self._libp2pNode.peerInfo.multiaddrs.toArray())}),connect:promisify((maddr,callback)=>{if(!self.isOnline())return callback(OFFLINE_ERROR);"string"==typeof maddr&&(maddr=multiaddr(maddr)),self._libp2pNode.dial(maddr,callback)}),disconnect:promisify((maddr,callback)=>{if(!self.isOnline())return callback(OFFLINE_ERROR);"string"==typeof maddr&&(maddr=multiaddr(maddr)),self._libp2pNode.hangUp(maddr,callback)}),filters:promisify(callback=>callback(new Error("Not implemented")))}}},function(module,exports,__webpack_require__){"use strict";const pkg=__webpack_require__(546),promisify=__webpack_require__(25);module.exports=function(self){return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),callback(null,{version:pkg.version,repo:"",commit:""})})}},function(module,exports,__webpack_require__){"use strict";const IPFSRepo=__webpack_require__(221);module.exports=(dir=>{return new IPFSRepo(dir||"ipfs")})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const BlockService=__webpack_require__(220),IPLDResolver=__webpack_require__(537),PeerId=__webpack_require__(31),PeerInfo=__webpack_require__(51),multiaddr=__webpack_require__(34),multihash=__webpack_require__(17),PeerBook=__webpack_require__(292),CID=__webpack_require__(12),debug=__webpack_require__(3),extend=__webpack_require__(200),EventEmitter=__webpack_require__(8),defaultRepo=__webpack_require__(852),boot=__webpack_require__(830),components=__webpack_require__(839);class IPFS extends EventEmitter{constructor(options){super(),this._options={init:!0,start:!0,EXPERIMENTAL:{}},options=options||{},extend(this._options,options),options.init===!1&&(this._options.init=!1),options.start!==!1&&(this._options.start=!0),"string"==typeof options.repo||void 0===options.repo?this._repo=defaultRepo(options.repo):this._repo=options.repo,this.log=debug("jsipfs"),this.log.err=debug("jsipfs:err"),this.on("error",err=>this.log(err)),this.types={Buffer:Buffer,PeerId:PeerId,PeerInfo:PeerInfo,multiaddr:multiaddr,multihash:multihash,CID:CID},this._peerInfoBook=new PeerBook,this._peerInfo=void 0,this._libp2pNode=void 0,this._bitswap=void 0,this._blockService=new BlockService(this._repo),this._ipldResolver=new IPLDResolver(this._blockService),this._pubsub=void 0,this.init=components.init(this),this.preStart=components.preStart(this),this.start=components.start(this),this.stop=components.stop(this),this.isOnline=components.isOnline(this),this.version=components.version(this),this.id=components.id(this),this.repo=components.repo(this),this.bootstrap=components.bootstrap(this),this.config=components.config(this),this.block=components.block(this),this.object=components.object(this),this.dag=components.dag(this),this.libp2p=components.libp2p(this),this.swarm=components.swarm(this),this.files=components.files(this),this.bitswap=components.bitswap(this),this.ping=components.ping(this),this.pubsub=components.pubsub(this),this.dht=components.dht(this),this._options.EXPERIMENTAL.pubsub&&this.log("EXPERIMENTAL pubsub is enabled"),this._options.EXPERIMENTAL.sharding&&this.log("EXPERIMENTAL sharding is enabled"),this._options.EXPERIMENTAL.dht&&this.log("EXPERIMENTAL Kademlia DHT is enabled"),this.state=__webpack_require__(854)(this),boot(this)}}exports=module.exports=IPFS,exports.createNode=(options=>{return new IPFS(options)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),log=debug("jsipfs:state");log.error=debug("jsipfs:state:error");const fsm=__webpack_require__(423);module.exports=(self=>{const s=fsm("uninitalized",{uninitalized:{init:"initializing",initialized:"stopped"},initializing:{initialized:"stopped"},stopped:{start:"starting"},starting:{started:"running"},running:{stop:"stopping"},stopping:{stopped:"stopped"}});return s.on("error",err=>log.error(err)),s.on("done",()=>log("-> "+s._state)),s.init=(()=>{s("init")}),s.initialized=(()=>{s("initialized")}),s.stop=(()=>{s("stop")}),s.stopped=(()=>{s("stopped")}),s.start=(()=>{s("start")}),s.started=(()=>{s("started")}),s.state=(()=>s._state),s})},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports,__webpack_require__){module.exports=__webpack_require__(332)}]); +}`},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(4),Connection=__webpack_require__(28).Connection,handshake=__webpack_require__(503),State=__webpack_require__(507);module.exports={tag:"/secio/1.0.0",encrypt(local,key,insecure,callback){if(!local)throw new Error("no local id provided");if(!key)throw new Error("no local private key provided");if(!insecure)throw new Error("no insecure stream provided");callback||(callback=(err=>{err&&console.error(err)}));const state=new State(local,key,3e5,callback);return pull(insecure,handshake(state),insecure),new Connection(state.secure,insecure)}}},function(module,exports,__webpack_require__){"use strict";const handshake=__webpack_require__(55),deferred=__webpack_require__(95);class State{constructor(id,key,timeout,cb){"function"==typeof timeout&&(cb=timeout,timeout=void 0),this.setup(),this.id.local=id,this.key.local=key,this.timeout=timeout||6e4,cb=cb||(()=>{}),this.secure=deferred.duplex(),this.stream=handshake({timeout:this.timeout},cb),this.shake=this.stream.handshake,delete this.stream.handshake}setup(){this.id={local:null,remote:null},this.key={local:null,remote:null},this.shake=null,this.cleanSecrets()}cleanSecrets(){this.shared={},this.ephemeralKey={local:null,remote:null},this.proposal={in:null,out:null},this.proposalEncoded={in:null,out:null},this.protocols={local:null,remote:null},this.exchange={in:null,out:null}}}module.exports=State},function(module,exports,__webpack_require__){"use strict";const identify=__webpack_require__(491),multistream=__webpack_require__(136),waterfall=__webpack_require__(7),debug=__webpack_require__(3),log=debug("libp2p:swarm:connection"),setImmediate=__webpack_require__(10),protocolMuxer=__webpack_require__(88),plaintext=__webpack_require__(226);module.exports=function(swarm){return{addUpgrade(){},addStreamMuxer(muxer){swarm.muxers[muxer.multicodec]=muxer,swarm.handle(muxer.multicodec,(protocol,conn)=>{const muxedConn=muxer.listener(conn);return muxedConn.on("stream",conn=>{protocolMuxer(swarm.protocols,conn)}),swarm.identify&&(conn.getPeerInfo=(cb=>{const conn=muxedConn.newStream(),ms=new multistream.Dialer;waterfall([cb=>ms.handle(conn,cb),cb=>ms.select(identify.multicodec,cb),(conn,cb)=>identify.dialer(conn,cb),(peerInfo,observedAddrs,cb)=>{observedAddrs.forEach(oa=>{swarm._peerInfo.multiaddrs.addSafe(oa)}),cb(null,peerInfo)}],cb)}),conn.getPeerInfo((err,peerInfo)=>{if(err)return log("Identify not successful");const b58Str=peerInfo.id.toB58String();swarm.muxedConns[b58Str]={muxer:muxedConn},peerInfo.multiaddrs.size>0?peerInfo.connect(peerInfo.multiaddrs.toArray()[0]):peerInfo.connect(`/ipfs/${b58Str}`),peerInfo=swarm._peerBook.put(peerInfo),muxedConn.on("close",()=>{delete swarm.muxedConns[b58Str],peerInfo.disconnect(),peerInfo=swarm._peerBook.put(peerInfo),setImmediate(()=>swarm.emit("peer-mux-closed",peerInfo))}),setImmediate(()=>swarm.emit("peer-mux-established",peerInfo))})),conn})},reuse(){swarm.identify=!0,swarm.handle(identify.multicodec,(protocol,conn)=>{identify.listener(conn,swarm._peerInfo)})},crypto(tag,encrypt){tag||encrypt||(tag=plaintext.tag,encrypt=plaintext.encrypt),swarm.unhandle(swarm.crypto.tag),swarm.handle(tag,(protocol,conn)=>{const id=swarm._peerInfo.id,secure=encrypt(id,id.privKey,conn);protocolMuxer(swarm.protocols,secure)}),swarm.crypto={tag:tag,encrypt:encrypt}}}}},function(module,exports,__webpack_require__){"use strict";function dial(swarm){return(peer,protocol,callback)=>{function gotWarmedUpConn(conn){conn.setPeerInfo(pi),attemptMuxerUpgrade(conn,(err,muxer)=>{if(!protocol)return err&&(swarm.conns[b58Id]=conn),callback();err?protocolHandshake(conn,protocol,callback):gotMuxer(muxer)})}function gotMuxer(muxer){swarm.identify,openConnInMuxedConn(muxer,conn=>{protocolHandshake(conn,protocol,callback)})}function attemptMuxerUpgrade(conn,cb){function nextMuxer(key){log("selecting %s",key),ms.select(key,(err,conn)=>{if(err)return void(0===muxers.length?cb(new Error("could not upgrade to stream muxing")):nextMuxer(muxers.shift()));const muxedConn=swarm.muxers[key].dialer(conn);swarm.muxedConns[b58Id]={},swarm.muxedConns[b58Id].muxer=muxedConn,muxedConn.once("close",()=>{const b58Str=pi.id.toB58String();delete swarm.muxedConns[b58Str],pi.disconnect(),swarm._peerBook.get(b58Str).disconnect(),setImmediate(()=>swarm.emit("peer-mux-closed",pi))}),muxedConn.on("stream",conn=>{protocolMuxer(swarm.protocols,conn)}),setImmediate(()=>swarm.emit("peer-mux-established",pi)),cb(null,muxedConn)})}const muxers=Object.keys(swarm.muxers);if(0===muxers.length)return cb(new Error("no muxers available"));const ms=new multistream.Dialer;ms.handle(conn,err=>{if(err)return callback(new Error("multistream not supported"));nextMuxer(muxers.shift())})}function openConnInMuxedConn(muxer,cb){cb(muxer.newStream())}function protocolHandshake(conn,protocol,cb){const ms=new multistream.Dialer;ms.handle(conn,err=>{if(err)return callback(err);ms.select(protocol,(err,conn)=>{if(err)return callback(err);proxyConn.setInnerConn(conn),callback(null,proxyConn)})})}"function"==typeof protocol&&(callback=protocol,protocol=null),callback=callback||function(){};const pi=getPeerInfo(peer,swarm._peerBook),proxyConn=new Connection,b58Id=pi.id.toB58String();if(log("dialing %s",b58Id),swarm.muxedConns[b58Id]){if(!protocol)return callback();gotMuxer(swarm.muxedConns[b58Id].muxer)}else if(swarm.conns[b58Id]){const conn=swarm.conns[b58Id];swarm.conns[b58Id]=void 0,gotWarmedUpConn(conn)}else!function(pi,cb){function nextTransport(key){swarm.transport.dial(key,pi,(err,conn)=>{if(err)return 0===tKeys.length?cb(new Error("Could not dial in any of the transports")):nextTransport(tKeys.shift());!function(){const ms=new multistream.Dialer;ms.handle(conn,err=>{if(err)return cb(err);const id=swarm._peerInfo.id;log("selecting crypto: %s",swarm.crypto.tag),ms.select(swarm.crypto.tag,(err,conn)=>{if(err)return cb(err);cb(null,swarm.crypto.encrypt(id,id.privKey,conn))})})}()})}const tKeys=swarm.availableTransports(pi);if(0===tKeys.length)return cb(new Error("No available transport to dial to"));nextTransport(tKeys.shift())}(pi,(err,conn)=>{if(err)return callback(err);gotWarmedUpConn(conn)});return proxyConn}}const multistream=__webpack_require__(136),Connection=__webpack_require__(28).Connection,setImmediate=__webpack_require__(10),getPeerInfo=__webpack_require__(225),debug=__webpack_require__(3),log=debug("libp2p:swarm:dial"),protocolMuxer=__webpack_require__(88);module.exports=dial},function(module,exports,__webpack_require__){"use strict";function Swarm(peerInfo,peerBook){if(!(this instanceof Swarm))return new Swarm(peerInfo);assert(peerInfo,"You must provide a `peerInfo`"),assert(peerBook,"You must provide a `peerBook`"),this._peerInfo=peerInfo,this._peerBook=peerBook,this.transports={},this.conns={},this.muxedConns={},this.protocols={},this.muxers={},this.identify=!1,this.crypto=plaintext,this.transport=transport(this),this.connection=connection(this),this.availableTransports=(pi=>{const myAddrs=pi.multiaddrs.toArray();return Object.keys(this.transports).filter(ts=>this.transports[ts].filter(myAddrs).length>0)}),this.dial=dial(this),this.listen=(callback=>{each(this.availableTransports(peerInfo),(ts,cb)=>{this.transport.listen(ts,{},null,cb)},callback)}),this.handle=((protocol,handlerFunc,matchFunc)=>{this.protocols[protocol]={handlerFunc:handlerFunc,matchFunc:matchFunc}}),this.handle(this.crypto.tag,(protocol,conn)=>{const peerId=this._peerInfo.id,wrapped=this.crypto.encrypt(peerId,peerId.privKey,conn);return protocolMuxer(this.protocols,wrapped)}),this.unhandle=(protocol=>{this.protocols[protocol]&&delete this.protocols[protocol]}),this.hangUp=((peer,callback)=>{const peerInfo=getPeerInfo(peer,this.peerBook),key=peerInfo.id.toB58String();if(this.muxedConns[key]){const muxer=this.muxedConns[key].muxer;muxer.once("close",()=>{delete this.muxedConns[key],callback()}),muxer.end()}else callback()}),this.close=(callback=>{series([cb=>each(this.muxedConns,(conn,cb)=>{conn.muxer.end(err=>{if(err&&"Fatal error: OK"!==err.message)return cb(err);cb()})},cb),cb=>{each(this.transports,(transport,cb)=>{each(transport.listeners,(listener,cb)=>{listener.close(cb)},cb)},cb)}],callback)})}const util=__webpack_require__(32),EE=__webpack_require__(11).EventEmitter,each=__webpack_require__(19),series=__webpack_require__(33),transport=__webpack_require__(513),connection=__webpack_require__(508),getPeerInfo=__webpack_require__(225),dial=__webpack_require__(509),protocolMuxer=__webpack_require__(88),plaintext=__webpack_require__(226),assert=__webpack_require__(9);module.exports=Swarm,util.inherits(Swarm,EE)},function(module,exports,__webpack_require__){"use strict";const map=__webpack_require__(73),debug=__webpack_require__(3),log=debug("libp2p:swarm:dialer"),DialQueue=__webpack_require__(512);class LimitDialer{constructor(perPeerLimit,dialTimeout){log("create: %s peer limit, %s dial timeout",perPeerLimit,dialTimeout),this.perPeerLimit=perPeerLimit,this.dialTimeout=dialTimeout,this.queues=new Map}dialMany(peer,transport,addrs,callback){log("dialMany:start");const token={cancel:!1};map(addrs,(m,cb)=>{this.dialSingle(peer,transport,m,token,cb)},(err,results)=>{if(err)return callback(err);const success=results.filter(res=>res.conn);if(success.length>0)return log("dialMany:success"),callback(null,success[0]);log("dialMany:error");const error=new Error("Failed to dial any provided address");return error.errors=results.filter(res=>res.error).map(res=>res.error),callback(error)})}dialSingle(peer,transport,addr,token,callback){const ps=peer.toB58String();log("dialSingle: %s:%s",ps,addr.toString());let q;this.queues.has(ps)?q=this.queues.get(ps):(q=new DialQueue(this.perPeerLimit,this.dialTimeout),this.queues.set(ps,q)),q.push(transport,addr,token,callback)}}module.exports=LimitDialer},function(module,exports,__webpack_require__){"use strict";const Connection=__webpack_require__(28).Connection,pull=__webpack_require__(4),timeout=__webpack_require__(300),queue=__webpack_require__(106),debug=__webpack_require__(3),log=debug("libp2p:swarm:dialer:queue");class DialQueue{constructor(limit,dialTimeout){this.dialTimeout=dialTimeout,this.queue=queue((task,cb)=>{this._doWork(task.transport,task.addr,task.token,cb)},limit)}_doWork(transport,addr,token,callback){log("work"),this._dialWithTimeout(transport,addr,(err,conn)=>{return err?(log("work:error"),callback(null,{error:err})):token.cancel?(log("work:cancel"),pull(pull.empty(),conn),callback(null,{cancel:!0})):(token.cancel=!0,log("work:success"),(new Connection).setInnerConn(conn),void callback(null,{multiaddr:addr,conn:conn}))})}_dialWithTimeout(transport,addr,callback){timeout(cb=>{const conn=transport.dial(addr,err=>{if(err)return cb(err);cb(null,conn)})},this.dialTimeout)(callback)}push(transport,addr,token,callback){this.queue.push({transport:transport,addr:addr,token:token},callback)}}module.exports=DialQueue},function(module,exports,__webpack_require__){"use strict";function dialables(tp,multiaddrs){return tp.filter(multiaddrs)}function noop(){}const parallel=__webpack_require__(39),once=__webpack_require__(67),debug=__webpack_require__(3),log=debug("libp2p:swarm:transport"),protocolMuxer=__webpack_require__(88),LimitDialer=__webpack_require__(511);module.exports=function(swarm){const dialer=new LimitDialer(8,1e4);return{add(key,transport,options,callback){if("function"==typeof options&&(callback=options,options={}),callback=callback||noop,log("adding %s",key),swarm.transports[key])throw new Error("There is already a transport with this key");swarm.transports[key]=transport,swarm.transports[key].listeners||(swarm.transports[key].listeners=[]),callback()},dial(key,pi,callback){const t=swarm.transports[key];let multiaddrs=pi.multiaddrs.toArray();Array.isArray(multiaddrs)||(multiaddrs=[multiaddrs]),log("dialing %s",key,multiaddrs.map(m=>m.toString())),multiaddrs=dialables(t,multiaddrs),dialer.dialMany(pi.id,t,multiaddrs,(err,success)=>{if(err)return callback(err);pi.connect(success.multiaddr),swarm._peerBook.put(pi),callback(null,success.conn)})},listen(key,options,handler,callback){handler||(handler=protocolMuxer.bind(null,swarm.protocols));const multiaddrs=dialables(swarm.transports[key],swarm._peerInfo.multiaddrs.distinct()),transport=swarm.transports[key];transport.listeners||(transport.listeners=[]);let freshMultiaddrs=[];parallel(multiaddrs.map(ma=>{return cb=>{const done=once(cb),listener=transport.createListener(handler);listener.once("error",done),listener.listen(ma,err=>{if(err)return done(err);listener.removeListener("error",done),listener.getAddrs((err,addrs)=>{if(err)return done(err);freshMultiaddrs=freshMultiaddrs.concat(addrs),transport.listeners.push(listener),done()})})}}),err=>{if(err)return callback(err);swarm._peerInfo.multiaddrs.replace(multiaddrs,freshMultiaddrs),callback()})},close(key,callback){const transport=swarm.transports[key];if(!transport)return callback(new Error(`Trying to close non existing transport: ${key}`));parallel(transport.listeners.map(listener=>{return cb=>{listener.close(cb)}}),callback)}}}},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),log=debug("libp2p:webrtc-star"),multiaddr=__webpack_require__(24),mafmt=__webpack_require__(89),io=__webpack_require__(659),EE=__webpack_require__(11).EventEmitter,SimplePeer=__webpack_require__(658),PeerId=__webpack_require__(22),PeerInfo=__webpack_require__(35),Connection=__webpack_require__(28).Connection,toPull=__webpack_require__(146),once=__webpack_require__(67),setImmediate=__webpack_require__(10),webrtcSupport=__webpack_require__(683),utils=__webpack_require__(515),cleanUrlSIO=utils.cleanUrlSIO,noop=once(()=>{}),sioOptions={transports:["websocket"],"force new connection":!0};class WebRTCStar{constructor(options){options=options||{},this.maSelf=void 0,this.sioOptions={transports:["websocket"],"force new connection":!0},options.wrtc&&(this.wrtc=options.wrtc),this.discovery=new EE,this.discovery.start=(callback=>{setImmediate(callback)}),this.discovery.stop=(callback=>{setImmediate(callback)}),this.listenersRefs={},this._peerDiscovered=this._peerDiscovered.bind(this)}dial(ma,options,callback){"function"==typeof options&&(callback=options,options={}),callback=callback?once(callback):noop;const intentId=(~~(1e9*Math.random())).toString(36)+Date.now(),sioClient=this.listenersRefs[Object.keys(this.listenersRefs)[0]].io,spOptions={initiator:!0,trickle:!1};this.wrtc&&(spOptions.wrtc=this.wrtc);const channel=new SimplePeer(spOptions),conn=new Connection(toPull.duplex(channel));let connected=!1;return channel.on("signal",signal=>{sioClient.emit("ss-handshake",{intentId:intentId,srcMultiaddr:this.maSelf.toString(),dstMultiaddr:ma.toString(),signal:signal})}),channel.once("timeout",()=>callback(new Error("timeout"))),channel.once("error",err=>{connected||callback(err)}),sioClient.on("ws-handshake",offer=>{if(offer.intentId===intentId&&offer.err)return callback(new Error(offer.err));offer.intentId===intentId&&offer.answer&&(channel.once("connect",()=>{connected=!0,conn.destroy=channel.destroy.bind(channel),channel.once("close",()=>conn.destroy()),conn.getObservedAddrs=(callback=>callback(null,[ma])),callback(null,conn)}),channel.signal(offer.signal))}),conn}createListener(options,handler){"function"==typeof options&&(handler=options,options={});const listener=new EE;return listener.listen=((ma,callback)=>{function incommingDial(offer){if(!offer.answer&&!offer.err){const spOptions={trickle:!1};self.wrtc&&(spOptions.wrtc=self.wrtc);const channel=new SimplePeer(spOptions),conn=new Connection(toPull.duplex(channel));channel.once("connect",()=>{conn.getObservedAddrs=(callback=>{return callback(null,[offer.srcMultiaddr])}),listener.emit("connection",conn),handler(conn)}),channel.once("signal",signal=>{offer.signal=signal,offer.answer=!0,listener.io.emit("ss-handshake",offer)}),channel.signal(offer.signal)}}if(callback=callback?once(callback):noop,!webrtcSupport.support&&!this.wrtc)return setImmediate(()=>callback(new Error("no WebRTC support")));this.maSelf=ma;const sioUrl=cleanUrlSIO(ma);log("Dialing to Signalling Server on: "+sioUrl),listener.io=io.connect(sioUrl,sioOptions),listener.io.once("connect_error",callback),listener.io.once("error",err=>{listener.emit("error",err),listener.emit("close")}),listener.io.on("ws-handshake",incommingDial),listener.io.on("ws-peer",this._peerDiscovered),listener.io.on("connect",()=>{listener.io.emit("ss-join",ma.toString())}),listener.io.once("connect",()=>{listener.emit("listening"),callback()});const self=this}),listener.close=(callback=>{callback=callback?once(callback):noop,listener.io.emit("ss-leave"),setImmediate(()=>{listener.emit("close"),callback()})}),listener.getAddrs=(callback=>{setImmediate(()=>callback(null,[this.maSelf]))}),this.listenersRefs[multiaddr.toString()]=listener,listener}filter(multiaddrs){return Array.isArray(multiaddrs)||(multiaddrs=[multiaddrs]),multiaddrs.filter(ma=>mafmt.WebRTCStar.matches(ma))}_peerDiscovered(maStr){log("Peer Discovered:",maStr);const split=maStr.split("/ipfs/"),peerIdStr=split[split.length-1],peerId=PeerId.createFromB58String(peerIdStr),peerInfo=new PeerInfo(peerId);peerInfo.multiaddrs.add(multiaddr(maStr)),this.discovery.emit("peer",peerInfo)}}module.exports=WebRTCStar},function(module,exports,__webpack_require__){"use strict";function cleanUrlSIO(ma){const maStrSplit=ma.toString().split("/");if(multiaddr.isName(ma)){const wsProto=ma.protos()[2].name;if("ws"===wsProto)return"http://"+maStrSplit[3];if("wss"===wsProto)return"https://"+maStrSplit[3];throw new Error("invalid multiaddr"+ma.toString())}return"http://"+maStrSplit[3]+":"+maStrSplit[5]}const multiaddr=__webpack_require__(24);exports=module.exports,exports.cleanUrlSIO=cleanUrlSIO},function(module,exports,__webpack_require__){"use strict";const connect=__webpack_require__(624),mafmt=__webpack_require__(89),includes=__webpack_require__(229),Connection=__webpack_require__(28).Connection,maToUrl=__webpack_require__(518),debug=__webpack_require__(3),log=debug("libp2p:websockets:dialer"),createListener=__webpack_require__(517);class WebSockets{dial(ma,options,callback){"function"==typeof options&&(callback=options,options={}),callback=callback||function(){};const url=maToUrl(ma);log("dialing %s",url);const socket=connect(url,{binary:!0,onConnect:err=>callback(err)}),conn=new Connection(socket);return conn.getObservedAddrs=(callback=>callback(null,[ma])),conn.close=(callback=>socket.close(callback)),conn}createListener(options,handler){return"function"==typeof options&&(handler=options,options={}),createListener(options,handler)}filter(multiaddrs){return Array.isArray(multiaddrs)||(multiaddrs=[multiaddrs]),multiaddrs.filter(ma=>{return includes(ma.protoNames(),"ipfs")&&(ma=ma.decapsulate("ipfs")),mafmt.WebSockets.matches(ma)||mafmt.WebSocketsSecure.matches(ma)})}}module.exports=WebSockets},function(module,exports,__webpack_require__){"use strict";function noop(){}const Connection=__webpack_require__(28).Connection,includes=__webpack_require__(229),createServer=__webpack_require__(714)||noop;module.exports=((options,handler)=>{const listener=createServer(socket=>{socket.getObservedAddrs=(callback=>{return callback(null,[])}),handler(new Connection(socket))});let listeningMultiaddr;return listener._listen=listener.listen,listener.listen=((ma,callback)=>{callback=callback||noop,listeningMultiaddr=ma,includes(ma.protoNames(),"ipfs")&&(ma=ma.decapsulate("ipfs")),listener._listen(ma.toOptions(),callback)}),listener.getAddrs=(callback=>{callback(null,[listeningMultiaddr])}),listener})},function(module,exports,__webpack_require__){"use strict";function maToUrl(ma){const maStrSplit=ma.toString().split("/");let proto;try{proto=ma.protoNames().filter(proto=>{return"ws"===proto||"wss"===proto})[0]}catch(e){throw log(e),new Error("Not a valid websocket address",e)}let port;try{port=ma.stringTuples().filter(tuple=>{if(tuple[0]===ma.protos().filter(proto=>{return"tcp"===proto.name})[0].code)return!0})[0][1]}catch(e){log("No port, skipping")}return`${proto}://${maStrSplit[2]}${!port||80===port&&443===port?"":`:${port}`}`}const debug=__webpack_require__(3),log=debug("libp2p:websockets:dialer");module.exports=maToUrl},function(module,exports,__webpack_require__){"use strict";const EventEmitter=__webpack_require__(11).EventEmitter,assert=__webpack_require__(9),setImmediate=__webpack_require__(10),each=__webpack_require__(19),series=__webpack_require__(33),Ping=__webpack_require__(496),Swarm=__webpack_require__(510),PeerId=__webpack_require__(22),PeerInfo=__webpack_require__(35),PeerBook=__webpack_require__(245),mafmt=__webpack_require__(89),multiaddr=__webpack_require__(24);module.exports;class Node extends EventEmitter{constructor(_modules,_peerInfo,_peerBook,_options){if(super(),assert(_modules,"requires modules to equip libp2p with features"),assert(_peerInfo,"requires a PeerInfo instance"),this.modules=_modules,this.peerInfo=_peerInfo,this.peerBook=_peerBook||new PeerBook,_options=_options||{},this._isStarted=!1,this.swarm=new Swarm(this.peerInfo,this.peerBook),this.modules.connection&&this.modules.connection.muxer){let muxers=this.modules.connection.muxer;muxers=Array.isArray(muxers)?muxers:[muxers],muxers.forEach(muxer=>this.swarm.connection.addStreamMuxer(muxer)),this.swarm.connection.reuse(),this.swarm.on("peer-mux-established",peerInfo=>{this.emit("peer:connect",peerInfo),this.peerBook.put(peerInfo)}),this.swarm.on("peer-mux-closed",peerInfo=>{this.emit("peer:disconnect",peerInfo)})}if(this.modules.connection&&this.modules.connection.crypto){let cryptos=this.modules.connection.crypto;cryptos=Array.isArray(cryptos)?cryptos:[cryptos],cryptos.forEach(crypto=>{this.swarm.connection.crypto(crypto.tag,crypto.encrypt)})}if(this.modules.discovery){let discoveries=this.modules.discovery;discoveries=Array.isArray(discoveries)?discoveries:[discoveries],discoveries.forEach(discovery=>{discovery.on("peer",peerInfo=>this.emit("peer:discovery",peerInfo))})}Ping.mount(this.swarm),_modules.DHT&&(this._dht=new this.modules.DHT(this.swarm,{kBucketSize:20,datastoer:_options.DHT&&_options.DHT.datastore})),this.peerRouting={findPeer:(id,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.findPeer(id,callback)}},this.contentRouting={findProviders:(key,timeout,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.findProviders(key,timeout,callback)},provide:(key,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.provide(key,callback)}},this.dht={put:(key,value,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.put(key,value,callback)},get:(key,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.get(key,callback)},getMany(key,nVals,callback){if(!this._dht)return callback(new Error("DHT is not available"));this._dht.getMany(key,nVals,callback)}}}start(callback){if(!this.modules.transport)return callback(new Error("no transports were present"));let ws,transports=this.modules.transport;transports=Array.isArray(transports)?transports:[transports];const maOld=[],maNew=[];this.peerInfo.multiaddrs.forEach(ma=>{mafmt.IPFS.matches(ma)||(maOld.push(ma),maNew.push(ma.encapsulate("/ipfs/"+this.peerInfo.id.toB58String())))}),this.peerInfo.multiaddrs.replace(maOld,maNew);const multiaddrs=this.peerInfo.multiaddrs.toArray();transports.forEach(transport=>{transport.filter(multiaddrs).length>0?this.swarm.transport.add(transport.tag||transport.constructor.name,transport):transport.constructor&&"WebSockets"===transport.constructor.name&&(ws=transport)}),series([cb=>this.swarm.listen(cb),cb=>{if(ws&&this.swarm.transport.add(ws.tag||ws.constructor.name,ws),this.modules.discovery)return each(this.modules.discovery,(d,cb)=>d.start(cb),cb);cb()},cb=>{if(this._isStarted=!0,this._dht)return this._dht.start(cb);cb()},cb=>{this.emit("start"),cb()}],callback)}stop(callback){this._isStarted=!1,this.modules.discovery&&this.modules.discovery.forEach(discovery=>{setImmediate(()=>discovery.stop(()=>{}))}),series([cb=>{if(this._dht)return this._dht.stop(cb);cb()},cb=>this.swarm.close(cb),cb=>{this.emit("stop"),cb()}],callback)}isStarted(){return this._isStarted}ping(peer,callback){assert(this.isStarted(),"The libp2p node is not started yet"),this._getPeerInfo(peer,(err,peerInfo)=>{if(err)return callback(err);callback(null,new Ping(this.swarm,peerInfo))})}dial(peer,protocol,callback){assert(this.isStarted(),"The libp2p node is not started yet"),"function"==typeof protocol&&(callback=protocol,protocol=void 0),this._getPeerInfo(peer,(err,peerInfo)=>{if(err)return callback(err);this.swarm.dial(peerInfo,protocol,(err,conn)=>{if(err)return callback(err);this.peerBook.put(peerInfo),callback(null,conn)})})}hangUp(peer,callback){assert(this.isStarted(),"The libp2p node is not started yet"),this._getPeerInfo(peer,(err,peerInfo)=>{if(err)return callback(err);this.swarm.hangUp(peerInfo,callback)})}handle(protocol,handlerFunc,matchFunc){this.swarm.handle(protocol,handlerFunc,matchFunc)}unhandle(protocol){this.swarm.unhandle(protocol)}_getPeerInfo(peer,callback){let p;if(PeerInfo.isPeerInfo(peer))p=peer;else if(multiaddr.isMultiaddr(peer)){const peerIdB58Str=peer.getPeerId();try{p=this.peerBook.get(peerIdB58Str)}catch(err){p=new PeerInfo(PeerId.createFromB58String(peerIdB58Str))}p.multiaddrs.add(peer)}else{if(!PeerId.isPeerId(peer))return setImmediate(()=>callback(new Error("peer type not recognized")));{const peerIdB58Str=peer.toB58String();try{p=this.peerBook.get(peerIdB58Str)}catch(err){return this.peerRouting.findPeer(peer,callback)}}}setImmediate(()=>callback(null,p))}}module.exports=Node},function(module,exports,__webpack_require__){(function(global,module){function arrayFilter(array,predicate){for(var index=-1,length=array?array.length:0,resIndex=0,result=[];++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toFinite(value){if(!value)return 0===value?value:0;if((value=toNumber(value))===INFINITY||value===-INFINITY){return(value<0?-1:1)*MAX_INTEGER}return value===value?value:0}function toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value +;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,MAX_INTEGER=1.7976931348623157e308,NAN=NaN,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsOctal=/^0o[0-7]+$/i,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeParseInt=parseInt,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),nativeMax=Math.max,DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&"[object Promise]"!=getTag(Promise.resolve())||Set&&getTag(new Set)!=setTag||WeakMap&&"[object WeakMap]"!=getTag(new WeakMap))&&(getTag=function(value){var result=objectToString.call(value),Ctor=result==objectTag?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):void 0;if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return"[object Promise]";case setCtorString:return setTag;case weakMapCtorString:return"[object WeakMap]"}return result});var stringToPath=memoize(function(string){string=toString(string);var result=[];return reLeadingDot.test(string)&&result.push(""),string.replace(/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,function(match,number,quote,string){result.push(quote?string.replace(/\\(\\)?/g,"$1"):number||match)}),result}),find=function(findIndexFunc){return function(collection,predicate,fromIndex){var iterable=Object(collection);if(!isArrayLike(collection)){var iteratee=baseIteratee(predicate,3);collection=keys(collection),predicate=function(key){return iteratee(iterable[key],key,iterable)}}var index=findIndexFunc(collection,predicate,fromIndex);return index>-1?iterable[iteratee?collection[index]:index]:void 0}}(findIndex);memoize.Cache=MapCache;var isArray=Array.isArray,isTypedArray=nodeIsTypedArray?function(func){return function(value){return func(value)}}(nodeIsTypedArray):baseIsTypedArray;module.exports=find}).call(exports,__webpack_require__(2),__webpack_require__(18)(module))},function(module,exports,__webpack_require__){(function(global,module){function arrayMap(array,iteratee){for(var index=-1,length=array?array.length:0,result=Array(length);++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}function baseGet(object,path){path=isKey(path,object)?[path]:castPath(path);for(var index=0,length=path.length;null!=object&&indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,spreadableSymbol=Symbol?Symbol.isConcatSpreadable:void 0,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function has(object,path){return null!=object&&hasPath(object,path,baseHas)}var FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",symbolTag="[object Symbol]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,Map=getNative(root,"Map"),nativeCreate=getNative(Object,"create"),symbolProto=Symbol?Symbol.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var stringToPath=memoize(function(string){string=toString(string);var result=[];return reLeadingDot.test(string)&&result.push(""),string.replace(/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,function(match,number,quote,string){result.push(quote?string.replace(/\\(\\)?/g,"$1"):number||match)}),result});memoize.Cache=MapCache;var isArray=Array.isArray;module.exports=has}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(global,module){function arraySome(array,predicate){for(var index=-1,length=array?array.length:0;++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}var LARGE_ARRAY_SIZE=200,HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&"[object Promise]"!=getTag(Promise.resolve())||Set&&getTag(new Set)!=setTag||WeakMap&&"[object WeakMap]"!=getTag(new WeakMap))&&(getTag=function(value){var result=objectToString.call(value),Ctor=result==objectTag?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):void 0;if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return"[object Promise]";case setCtorString:return setTag;case weakMapCtorString:return"[object WeakMap]"}return result});var isArray=Array.isArray,isTypedArray=nodeIsTypedArray?function(func){return function(value){return func(value)}}(nodeIsTypedArray):baseIsTypedArray;module.exports=isEqualWith}).call(exports,__webpack_require__(2),__webpack_require__(18)(module))},function(module,exports){function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}var funcTag="[object Function]",genTag="[object GeneratorFunction]",objectProto=Object.prototype,objectToString=objectProto.toString;module.exports=isFunction},function(module,exports){function arrayMap(array,iteratee){for(var index=-1,length=array?array.length:0,result=Array(length);++index-1;)seen!==array&&splice.call(seen,fromIndex,1),splice.call(array,fromIndex,1);return array}function copyArray(source,array){var index=-1,length=source.length;for(array||(array=Array(length));++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index-1&&value%1==0&&value-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}function baseGet(object,path){path=isKey(path,object)?[path]:castPath(path);for(var index=0,length=path.length;null!=object&&indexother||valIsSymbol&&othIsDefined&&othIsReflexive&&!othIsNull&&!othIsSymbol||valIsNull&&othIsDefined&&othIsReflexive||!valIsDefined&&othIsReflexive||!valIsReflexive)return 1;if(!valIsNull&&!valIsSymbol&&!othIsSymbol&&value=ordersLength)return result;return result*("desc"==orders[index]?-1:1)}}return object.index-other.index}function equalArrays(array,other,equalFunc,customizer,bitmask,stack){var isPartial=bitmask&PARTIAL_COMPARE_FLAG,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,spreadableSymbol=Symbol?Symbol.isConcatSpreadable:void 0,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),nativeMax=Math.max,DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index1&&isIterateeCall(collection,iteratees[0],iteratees[1])?iteratees=[]:length>2&&isIterateeCall(iteratees[0],iteratees[1],iteratees[2])&&(iteratees=[iteratees[0]]),baseOrderBy(collection,baseFlatten(iteratees,1),[])});memoize.Cache=MapCache;var isArray=Array.isArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;module.exports=sortBy}).call(exports,__webpack_require__(2),__webpack_require__(18)(module))},function(module,exports,__webpack_require__){(function(global){function debounce(func,wait,options){function invokeFunc(time){var args=lastArgs,thisArg=lastThis;return lastArgs=lastThis=void 0,lastInvokeTime=time,result=func.apply(thisArg,args)}function leadingEdge(time){return lastInvokeTime=time,timerId=setTimeout(timerExpired,wait),leading?invokeFunc(time):result}function remainingWait(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime,result=wait-timeSinceLastCall;return maxing?nativeMin(result,maxWait-timeSinceLastInvoke):result}function shouldInvoke(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime;return void 0===lastCallTime||timeSinceLastCall>=wait||timeSinceLastCall<0||maxing&&timeSinceLastInvoke>=maxWait}function timerExpired(){var time=now();if(shouldInvoke(time))return trailingEdge(time);timerId=setTimeout(timerExpired,remainingWait(time))}function trailingEdge(time){return timerId=void 0,trailing&&lastArgs?invokeFunc(time):(lastArgs=lastThis=void 0,result)}function cancel(){void 0!==timerId&&clearTimeout(timerId),lastInvokeTime=0,lastArgs=lastCallTime=lastThis=timerId=void 0}function flush(){return void 0===timerId?result:trailingEdge(now())}function debounced(){var time=now(),isInvoking=shouldInvoke(time);if(lastArgs=arguments,lastThis=this,lastCallTime=time,isInvoking){if(void 0===timerId)return leadingEdge(lastCallTime);if(maxing)return timerId=setTimeout(timerExpired,wait),invokeFunc(lastCallTime)}return void 0===timerId&&(timerId=setTimeout(timerExpired,wait)),result}var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime=0,leading=!1,maxing=!1,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return wait=toNumber(wait)||0,isObject(options)&&(leading=!!options.leading,maxing="maxWait"in options,maxWait=maxing?nativeMax(toNumber(options.maxWait)||0,wait):maxWait,trailing="trailing"in options?!!options.trailing:trailing),debounced.cancel=cancel,debounced.flush=flush,debounced}function throttle(func,wait,options){var leading=!0,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return isObject(options)&&(leading="leading"in options?!!options.leading:leading,trailing="trailing"in options?!!options.trailing:trailing),debounce(func,wait,{leading:leading,maxWait:wait,trailing:trailing})}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}var FUNC_ERROR_TEXT="Expected a function",NAN=NaN,symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),objectProto=Object.prototype,objectToString=objectProto.toString,nativeMax=Math.max,nativeMin=Math.min,now=function(){return root.Date.now()};module.exports=throttle}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(global,module){function arrayIncludes(array,value){return!!(array?array.length:0)&&baseIndexOf(array,value,0)>-1}function arrayIncludesWith(array,value,comparator){for(var index=-1,length=array?array.length:0;++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function noop(){}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var createSet=Set&&1/setToArray(new Set([,-0]))[1]==INFINITY?function(values){return new Set(values)}:noop,getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&"[object Promise]"!=getTag(Promise.resolve())||Set&&getTag(new Set)!=setTag||WeakMap&&"[object WeakMap]"!=getTag(new WeakMap))&&(getTag=function(value){var result=objectToString.call(value),Ctor=result==objectTag?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):void 0;if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return"[object Promise]";case setCtorString:return setTag;case weakMapCtorString:return"[object WeakMap]"}return result});var stringToPath=memoize(function(string){string=toString(string);var result=[];return reLeadingDot.test(string)&&result.push(""),string.replace(/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,function(match,number,quote,string){result.push(quote?string.replace(/\\(\\)?/g,"$1"):number||match)}),result});memoize.Cache=MapCache;var isArray=Array.isArray,isTypedArray=nodeIsTypedArray?function(func){return function(value){return func(value)}}(nodeIsTypedArray):baseIsTypedArray;module.exports=uniqBy}).call(exports,__webpack_require__(2),__webpack_require__(18)(module))},function(module,exports,__webpack_require__){(function(global){function arrayIncludes(array,value){return!!(array?array.length:0)&&baseIndexOf(array,value,0)>-1}function arrayIncludesWith(array,value,comparator){for(var index=-1,length=array?array.length:0;++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++index-1&&value%1==0&&valueb?1:0};var lowerBoundKey=exports.lowerBoundKey=function(range){return hasKey(range,"gt")||hasKey(range,"gte")||hasKey(range,"min")||(range.reverse?hasKey(range,"end"):hasKey(range,"start"))||void 0},lowerBound=exports.lowerBound=function(range,def){var k=lowerBoundKey(range);return k?range[k]:def},lowerBoundInclusive=exports.lowerBoundInclusive=function(range){return!has(range,"gt")},upperBoundInclusive=exports.upperBoundInclusive=function(range){return!has(range,"lt")},lowerBoundExclusive=exports.lowerBoundExclusive=function(range){return!lowerBoundInclusive(range)},upperBoundExclusive=exports.upperBoundExclusive=function(range){return!upperBoundInclusive(range)},upperBoundKey=exports.upperBoundKey=function(range){return hasKey(range,"lt")||hasKey(range,"lte")||hasKey(range,"max")||(range.reverse?hasKey(range,"start"):hasKey(range,"end"))||void 0},upperBound=exports.upperBound=function(range,def){var k=upperBoundKey(range);return k?range[k]:def};exports.start=function(range,def){return range.reverse?upperBound(range,def):lowerBound(range,def)},exports.end=function(range,def){return range.reverse?lowerBound(range,def):upperBound(range,def)},exports.startInclusive=function(range){return range.reverse?upperBoundInclusive(range):lowerBoundInclusive(range)},exports.endInclusive=function(range){return range.reverse?lowerBoundInclusive(range):upperBoundInclusive(range)},exports.toLtgt=function(range,_range,map,lower,upper){_range=_range||{},map=map||id;var defaults=arguments.length>3,lb=exports.lowerBoundKey(range),ub=exports.upperBoundKey(range);return lb?"gt"===lb?_range.gt=map(range.gt,!1):_range.gte=map(range[lb],!1):defaults&&(_range.gte=map(lower,!1)),ub?"lt"===ub?_range.lt=map(range.lt,!0):_range.lte=map(range[ub],!0):defaults&&(_range.lte=map(upper,!0)),null!=range.reverse&&(_range.reverse=!!range.reverse),has(_range,"max")&&delete _range.max,has(_range,"min")&&delete _range.min,has(_range,"start")&&delete _range.start,has(_range,"end")&&delete _range.end,_range},exports.contains=function(range,key,compare){compare=compare||exports.compare;var lb=lowerBound(range);if(isDef(lb)){var cmp=compare(key,lb);if(cmp<0||0===cmp&&lowerBoundExclusive(range))return!1}var ub=upperBound(range);if(isDef(ub)){var cmp=compare(key,ub);if(cmp>0||0===cmp&&upperBoundExclusive(range))return!1}return!0},exports.filter=function(range,compare){return function(key){return exports.contains(range,key,compare)}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function TrieNode(type,key,value){if(Array.isArray(type))this.parseNode(type);else if(this.type=type,"branch"===type){var values=key;this.raw=Array.apply(null,Array(17)),values&&values.forEach(function(keyVal){this.set.apply(this,keyVal)})}else this.raw=Array(2),this.setValue(value),this.setKey(key)}function addHexPrefix(key,terminator){return key.length%2?key.unshift(1):(key.unshift(0),key.unshift(0)),terminator&&(key[0]+=2),key}function removeHexPrefix(val){return val=val[0]%2?val.slice(1):val.slice(2)}function isTerminator(key){return key[0]>1}function stringToNibbles(key){for(var bkey=new Buffer(key),nibbles=[],i=0;i>4,++q,nibbles[q]=bkey[i]%16}return nibbles}function nibblesToBuffer(arr){for(var buf=new Buffer(arr.length/2),i=0;i100)){var match=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);if(match){var n=parseFloat(match[1]);switch((match[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*y;case"days":case"day":case"d":return n*d;case"hours":case"hour":case"hrs":case"hr":case"h":return n*h;case"minutes":case"minute":case"mins":case"min":case"m":return n*m;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function fmtShort(ms){return ms>=d?Math.round(ms/d)+"d":ms>=h?Math.round(ms/h)+"h":ms>=m?Math.round(ms/m)+"m":ms>=s?Math.round(ms/s)+"s":ms+"ms"}function fmtLong(ms){return plural(ms,d,"day")||plural(ms,h,"hour")||plural(ms,m,"minute")||plural(ms,s,"second")||ms+" ms"}function plural(ms,n,name){if(!(ms0)return parse(val);if("number"===type&&isNaN(val)===!1)return options.long?fmtLong(val):fmtShort(val);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(val))}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function stringToStringTuples(str){const tuples=[],parts=str.split("/").slice(1);if(1===parts.length&&""===parts[0])return[];for(let p=0;p=parts.length)throw ParseError("invalid address: "+str);tuples.push([part,parts[p]])}else tuples.push([part])}return tuples}function stringTuplesToString(tuples){const parts=[];return map(tuples,function(tup){const proto=protoFromTuple(tup);parts.push(proto.name),tup.length>1&&parts.push(tup[1])}),"/"+parts.join("/")}function stringTuplesToTuples(tuples){return map(tuples,function(tup){Array.isArray(tup)||(tup=[tup]);const proto=protoFromTuple(tup);return tup.length>1?[proto.code,convert.toBuffer(proto.code,tup[1])]:[proto.code]})}function tuplesToStringTuples(tuples){return map(tuples,function(tup){const proto=protoFromTuple(tup);return tup.length>1?[proto.code,convert.toString(proto.code,tup[1])]:[proto.code]})}function tuplesToBuffer(tuples){return fromBuffer(Buffer.concat(map(tuples,function(tup){const proto=protoFromTuple(tup);let buf=new Buffer(varint.encode(proto.code));return tup.length>1&&(buf=Buffer.concat([buf,tup[1]])),buf})))}function sizeForAddr(p,addr){if(p.size>0)return p.size/8;if(0===p.size)return 0;{const size=varint.decode(addr);return size+varint.decode.bytes}}function bufferToTuples(buf){const tuples=[];let i=0;for(;ibuf.length)throw ParseError("Invalid address buffer: "+buf.toString("hex"));tuples.push([code,addr])}else tuples.push([code]),i+=n}return tuples}function bufferToString(buf){return stringTuplesToString(tuplesToStringTuples(bufferToTuples(buf)))}function stringToBuffer(str){return str=cleanPath(str),tuplesToBuffer(stringTuplesToTuples(stringToStringTuples(str)))}function fromString(str){return stringToBuffer(str)}function fromBuffer(buf){const err=validateBuffer(buf);if(err)throw err;return new Buffer(buf)}function validateBuffer(buf){try{bufferToTuples(buf)}catch(err){return err}}function isValidBuffer(buf){return void 0===validateBuffer(buf)}function cleanPath(str){return"/"+filter(str.trim().split("/")).join("/")}function ParseError(str){return new Error("Error parsing address: "+str)}function protoFromTuple(tup){return protocols(tup[0])}const map=__webpack_require__(128),filter=__webpack_require__(520),convert=__webpack_require__(563),protocols=__webpack_require__(133),varint=__webpack_require__(15);module.exports={stringToStringTuples:stringToStringTuples,stringTuplesToString:stringTuplesToString,tuplesToStringTuples:tuplesToStringTuples,stringTuplesToTuples:stringTuplesToTuples,bufferToTuples:bufferToTuples,tuplesToBuffer:tuplesToBuffer,bufferToString:bufferToString,stringToBuffer:stringToBuffer,fromString:fromString,fromBuffer:fromBuffer,validateBuffer:validateBuffer,isValidBuffer:isValidBuffer,cleanPath:cleanPath,ParseError:ParseError,protoFromTuple:protoFromTuple,sizeForAddr:sizeForAddr}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function Convert(proto,a){return a instanceof Buffer?Convert.toString(proto,a):Convert.toBuffer(proto,a)}function port2buf(port){const buf=new Buffer(2);return buf.writeUInt16BE(port,0),buf}function buf2port(buf){return buf.readUInt16BE(0)}function str2buf(str){const buf=new Buffer(str),size=new Buffer(varint.encode(buf.length));return Buffer.concat([size,buf])}function buf2str(buf){const size=varint.decode(buf);if(buf=buf.slice(varint.decode.bytes),buf.length!==size)throw new Error("inconsistent lengths");return buf.toString()}function mh2buf(hash){const mh=new Buffer(bs58.decode(hash)),size=new Buffer(varint.encode(mh.length));return Buffer.concat([size,mh])}function buf2mh(buf){const size=varint.decode(buf),address=buf.slice(varint.decode.bytes);if(address.length!==size)throw new Error("inconsistent lengths");return bs58.encode(address)}const ip=__webpack_require__(387),protocols=__webpack_require__(133),bs58=__webpack_require__(79),varint=__webpack_require__(15);module.exports=Convert,Convert.toString=function(proto,buf){switch(proto=protocols(proto),proto.code){case 4:case 41:return ip.toString(buf);case 6:case 17:case 33:case 132:return buf2port(buf);case 53:case 54:case 55:return buf2str(buf);case 421:return buf2mh(buf);default:return buf.toString("hex")}},Convert.toBuffer=function(proto,str){switch(proto=protocols(proto),proto.code){case 4:case 41:return ip.toBuffer(str);case 6:case 17:case 33:case 132:return port2buf(parseInt(str,10));case 53:case 54:case 55:return str2buf(str);case 421:return mh2buf(str);default:return new Buffer(str,"hex")}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";class Base{constructor(name,code,implementation,alphabet){this.name=name,this.code=code,this.alphabet=alphabet,implementation&&alphabet&&(this.engine=implementation(alphabet))}encode(stringOrBuffer){return this.engine.encode(stringOrBuffer)}decode(stringOrBuffer){return this.engine.decode(stringOrBuffer)}isImplemented(){return this.engine}}module.exports=Base},function(module,exports,__webpack_require__){"use strict";(function(Buffer){module.exports=function(alphabet){return{encode(input){return"string"==typeof input?new Buffer(input).toString("hex"):input.toString("hex")},decode(input){for(let char of input)if(alphabet.indexOf(char)<0)throw new Error("invalid base16 character");return new Buffer(input,"hex")}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const Base=__webpack_require__(564),baseX=__webpack_require__(302),base16=__webpack_require__(565),constants=[["base1","1","","1"],["base2","0",baseX,"01"],["base8","7",baseX,"01234567"],["base10","9",baseX,"0123456789"],["base16","f",base16,"0123456789abcdef"],["base32hex","v",baseX,"0123456789abcdefghijklmnopqrstuv"],["base32","b",baseX,"abcdefghijklmnopqrstuvwxyz234567"],["base32z","h",baseX,"ybndrfg8ejkmcpqxot1uwisza345h769"],["base58flickr","Z",baseX,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base58btc","z",baseX,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base64","m",baseX,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64url","u",baseX,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"]],names=constants.reduce((prev,tupple)=>{return prev[tupple[0]]=new Base(tupple[0],tupple[1],tupple[2],tupple[3]),prev},{}),codes=constants.reduce((prev,tupple)=>{return prev[tupple[1]]=names[tupple[0]],prev},{});module.exports={names:names,codes:codes}},function(module,exports,__webpack_require__){"use strict";exports.names={sha1:17,"sha2-256":18,"sha2-512":19,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,"murmur3-128":34,"murmur3-32":35,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664},exports.codes={17:"sha1",18:"sha2-256",19:"sha2-512",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384",29:"keccak-512",34:"murmur3-128",35:"murmur3-32",45569:"blake2b-8",45570:"blake2b-16",45571:"blake2b-24",45572:"blake2b-32",45573:"blake2b-40",45574:"blake2b-48",45575:"blake2b-56",45576:"blake2b-64",45577:"blake2b-72",45578:"blake2b-80",45579:"blake2b-88",45580:"blake2b-96",45581:"blake2b-104",45582:"blake2b-112",45583:"blake2b-120",45584:"blake2b-128",45585:"blake2b-136",45586:"blake2b-144",45587:"blake2b-152",45588:"blake2b-160",45589:"blake2b-168",45590:"blake2b-176",45591:"blake2b-184",45592:"blake2b-192",45593:"blake2b-200",45594:"blake2b-208",45595:"blake2b-216",45596:"blake2b-224",45597:"blake2b-232",45598:"blake2b-240",45599:"blake2b-248",45600:"blake2b-256",45601:"blake2b-264",45602:"blake2b-272",45603:"blake2b-280",45604:"blake2b-288",45605:"blake2b-296",45606:"blake2b-304",45607:"blake2b-312",45608:"blake2b-320",45609:"blake2b-328",45610:"blake2b-336",45611:"blake2b-344",45612:"blake2b-352",45613:"blake2b-360",45614:"blake2b-368",45615:"blake2b-376",45616:"blake2b-384",45617:"blake2b-392",45618:"blake2b-400",45619:"blake2b-408",45620:"blake2b-416",45621:"blake2b-424",45622:"blake2b-432",45623:"blake2b-440",45624:"blake2b-448",45625:"blake2b-456",45626:"blake2b-464",45627:"blake2b-472",45628:"blake2b-480",45629:"blake2b-488",45630:"blake2b-496",45631:"blake2b-504",45632:"blake2b-512",45633:"blake2s-8",45634:"blake2s-16",45635:"blake2s-24",45636:"blake2s-32",45637:"blake2s-40",45638:"blake2s-48",45639:"blake2s-56",45640:"blake2s-64",45641:"blake2s-72",45642:"blake2s-80",45643:"blake2s-88",45644:"blake2s-96",45645:"blake2s-104",45646:"blake2s-112",45647:"blake2s-120",45648:"blake2s-128",45649:"blake2s-136",45650:"blake2s-144",45651:"blake2s-152",45652:"blake2s-160",45653:"blake2s-168",45654:"blake2s-176",45655:"blake2s-184",45656:"blake2s-192",45657:"blake2s-200",45658:"blake2s-208",45659:"blake2s-216",45660:"blake2s-224",45661:"blake2s-232",45662:"blake2s-240",45663:"blake2s-248",45664:"blake2s-256"},exports.defaultLengths={17:20,18:32,19:64,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,45569:1,45570:2,45571:3,45572:4,45573:5,45574:6,45575:7,45576:8,45577:9,45578:10,45579:11,45580:12,45581:13,45582:14,45583:15,45584:16,45585:17,45586:18,45587:19,45588:20,45589:21,45590:22,45591:23,45592:24,45593:25,45594:26,45595:27,45596:28,45597:29,45598:30,45599:31,45600:32,45601:33,45602:34,45603:35,45604:36,45605:37,45606:38,45607:39,45608:40,45609:41,45610:42,45611:43,45612:44,45613:45,45614:46,45615:47,45616:48,45617:49,45618:50,45619:51,45620:52,45621:53,45622:54,45623:55,45624:56,45625:57,45626:58,45627:59,45628:60,45629:61,45630:62,45631:63,45632:64,45633:1,45634:2,45635:3,45636:4,45637:5,45638:6,45639:7,45640:8,45641:9,45642:10,45643:11,45644:12,45645:13,45646:14,45647:15,45648:16,45649:17,45650:18,45651:19,45652:20,45653:21,45654:22,45655:23,45656:24,45657:25,45658:26,45659:27,45660:28,45661:29,45662:30,45663:31,45664:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const blake=__webpack_require__(309),toCallback=__webpack_require__(239).toCallback,blake2b={init:blake.blake2bInit,update:blake.blake2bUpdate,digest:blake.blake2bFinal},blake2s={init:blake.blake2sInit,update:blake.blake2sUpdate,digest:blake.blake2sFinal},makeB2Hash=(size,hf)=>toCallback(buf=>{const ctx=hf.init(size,null);return hf.update(ctx,buf),new Buffer(hf.digest(ctx))});module.exports=(table=>{for(let i=0;i<64;i++)table[45569+i]=makeB2Hash(i+1,blake2b);for(let i=0;i<32;i++)table[45633+i]=makeB2Hash(i+1,blake2s)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function webCryptoHash(type){if(!webCrypto)throw new Error("Please use a browser with webcrypto support");return(data,callback)=>{const res=webCrypto.digest({name:type},data);if("function"!=typeof res.then)return res.onerror=(()=>{callback(`Error hashing data using ${type}`)}),void(res.oncomplete=(e=>{callback(null,e.target.result)}));nodeify(res.then(raw=>new Buffer(new Uint8Array(raw))),callback)}}function sha1(buf,callback){webCryptoHash("SHA-1")(buf,callback)}function sha2256(buf,callback){webCryptoHash("SHA-256")(buf,callback)}function sha2512(buf,callback){webCryptoHash("SHA-512")(buf,callback)}const nodeify=__webpack_require__(92),webCrypto=function(){return self.crypto?self.crypto.subtle||self.crypto.webkitSubtle:self.msCrypto?self.msCrypto.subtle:void 0}();module.exports={sha1:sha1,sha2256:sha2256,sha2512:sha2512}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const sha3=__webpack_require__(451),murmur3=__webpack_require__(582),utils=__webpack_require__(239),sha=__webpack_require__(569),toCallback=utils.toCallback,toBuf=utils.toBuf,fromString=utils.fromString,fromNumberTo32BitBuf=utils.fromNumberTo32BitBuf;module.exports={sha1:sha.sha1,sha2256:sha.sha2256,sha2512:sha.sha2512,sha3512:toCallback(toBuf(sha3.sha3_512)),sha3384:toCallback(toBuf(sha3.sha3_384)),sha3256:toCallback(toBuf(sha3.sha3_256)),sha3224:toCallback(toBuf(sha3.sha3_224)),shake128:toCallback(toBuf(sha3.shake_128,256)),shake256:toCallback(toBuf(sha3.shake_256,512)),keccak224:toCallback(toBuf(sha3.keccak_224)),keccak256:toCallback(toBuf(sha3.keccak_256)),keccak384:toCallback(toBuf(sha3.keccak_384)),keccak512:toCallback(toBuf(sha3.keccak_512)),murmur3128:toCallback(toBuf(fromString(murmur3.x64.hash128))),murmur332:toCallback(fromNumberTo32BitBuf(fromString(murmur3.x86.hash32))),addBlake:__webpack_require__(568)}},function(module,exports){function read(buf,offset){var b,res=0,offset=offset||0,shift=0,counter=offset,l=buf.length;do{if(counter>=l)return read.bytes=0,void(read.bytesRead=0);b=buf[counter++],res+=shift<28?(b&REST)<=MSB);return read.bytes=counter-offset,res}module.exports=read;var MSB=128,REST=127},function(module,exports){function encode(num,out,offset){out=out||[],offset=offset||0;for(var oldOffset=offset;num>=INT;)out[offset++]=255&num|MSB,num/=128;for(;num&MSBALL;)out[offset++]=255&num|MSB,num>>>=7;return out[offset]=0|num,encode.bytes=offset-oldOffset+1,out}module.exports=encode;var MSB=128,MSBALL=-128,INT=Math.pow(2,31)},function(module,exports,__webpack_require__){module.exports={encode:__webpack_require__(572),decode:__webpack_require__(571),encodingLength:__webpack_require__(574)}},function(module,exports){var N1=Math.pow(2,7),N2=Math.pow(2,14),N3=Math.pow(2,21),N4=Math.pow(2,28),N5=Math.pow(2,35),N6=Math.pow(2,42),N7=Math.pow(2,49),N8=Math.pow(2,56),N9=Math.pow(2,63);module.exports=function(value){return value{this.log("end"),this._read(),this.destroyed||(ended=!0,finished?this._finalize():this.halfOpen||this.end())}),this.once("finish",function onfinish(){if(!this.destroyed){if(!this._opened)return this.once("open",onfinish);this._lazy&&this.initiator&&this._open(),this._multiplex._send(this.channel<<3|(this.initiator?4:3),null),finished=!0,ended&&this._finalize()}})}destroy(err){this._destroy(err,!0)}_destroy(err,local){if(this.log("_destroy:"+(local?"local":"remote")),this.destroyed)return void this.log("already destroyed");this.destroyed=!0;const hasErrorListeners=EventEmitter.listenerCount(this,"error")>0;if(!err||local&&!hasErrorListeners||this.emit("error",err),this.emit("close"),local&&this._opened){this._lazy&&this.initiator&&this._open();const msg=err?new Buffer(err.message):null;try{this._multiplex._send(this.channel<<3|(this.initiator?6:5),msg)}catch(e){}}this._finalize()}_finalize(){this.finalized||(this.finalized=!0,this.emit("finalize"))}_write(data,enc,cb){return this.log("write: ",data.length),this._opened?this.destroyed?void cb():(this._lazy&&this.initiator&&this._open(),this._multiplex._send(this._dataHeader,data)?void cb():void this._multiplex._ondrain.push(cb)):void this.once("open",()=>{this._write(data,enc,cb)})}_read(){if(this._awaitDrain){const drained=this._awaitDrain;this._awaitDrain=0,this._multiplex._onchanneldrain(drained)}}_open(){let buf=null;Buffer.isBuffer(this.name)?buf=this.name:this.name!==this.channel.toString()&&(buf=new Buffer(this.name)),this._lazy=!1,this._multiplex._send(this.channel<<3|0,buf)}open(channel,initiator){this.log("open: "+channel),this.channel=channel,this.initiator=initiator,this._dataHeader=channel<<3|(initiator?2:1),this._opened=!0,!this._lazy&&this.initiator&&this._open(),this.emit("open")}}module.exports=Channel}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const stream=__webpack_require__(36),varint=__webpack_require__(573),duplexify=__webpack_require__(337),debug=__webpack_require__(3),Channel=__webpack_require__(575),SIGNAL_FLUSH=new Buffer([0]),empty=new Buffer(0);let pool=new Buffer(10240),used=0;class Multiplex extends stream.Duplex{constructor(opts,onchannel){super(),"function"==typeof opts&&(onchannel=opts,opts={}),opts||(opts={}),onchannel&&this.on("stream",onchannel),this.destroyed=!1,this.limit=opts.limit||0,null==opts.initiator&&(opts.initiator=!0),this.initiator=opts.initiator,this._corked=0,this._options=opts,this._binaryName=Boolean(opts.binaryName),this._local=[],this._remote=[],this._list=this._local,this._receiving=null,this._chunked=!1,this._state=0,this._type=0,this._channel=0,this._missing=0,this._message=null,this.log=debug("mplex:main:"+Math.floor(1e5*Math.random())),this.log("construction");let bufSize=100;this.limit&&(bufSize=varint.encodingLength(this.limit)),this._buf=new Buffer(bufSize),this._ptr=0,this._awaitChannelDrains=0,this._onwritedrain=null,this._ondrain=[],this._finished=!1,this.once("finish",this._clear),this._nextId=this.initiator?0:1}_nextStreamId(){let id=this._nextId;return this._nextId+=2,id}createStream(name,opts){if(this.destroyed)throw new Error("Multiplexer is destroyed");const id=this._nextStreamId();let channelName=this._name(name||id.toString());const options=Object.assign(this._options,opts);this.log("createStream: %s",id,channelName.toString(),options);const channel=new Channel(channelName,this,options);return this._addChannel(channel,id,this._local)}receiveStream(name,opts){if(this.destroyed)throw new Error("Multiplexer is destroyed");if(void 0===name||null===name)throw new Error("Name is needed when receiving a stream");const channelName=this._name(name);this.log("receiveStream: "+channelName.toString());const channel=new Channel(channelName,this,Object.assign(this._options,opts));if(this._receiving||(this._receiving={}),this._receiving[channel.name])throw new Error("You are already receiving this stream");return this._receiving[channel.name]=channel,channel}createSharedStream(name,opts){return this.log("createSharedStream"),duplexify(this.createStream(name,Object.assign(opts,{lazy:!0})),this.receiveStream(name,opts))}_name(name){return this._binaryName?Buffer.isBuffer(name)?name:new Buffer(name):name.toString()}_send(header,data){const len=data?data.length:0,oldUsed=used;let drained=!0;return this.log("_send",header,len),varint.encode(header,pool,used),used+=varint.encode.bytes,varint.encode(len,pool,used),used+=varint.encode.bytes,drained=this.push(pool.slice(oldUsed,used)),pool.length-used<100&&(pool=new Buffer(10240),used=0),data&&(drained=this.push(data)),drained}_addChannel(channel,id,list){return this.log("_addChannel",id),list[id]=channel,channel.on("finalize",()=>{this.log("_remove channel",id),list[id]=null}),channel.open(id,list===this._local),channel}_writeVarint(data,offset){for(offset;offset>3,this._list=1&this._type?this._local:this._remote;const chunked=this._list.length>this._channel&&this._list[this._channel]&&this._list[this._channel].chunked;this._chunked=!(1!==this._type&&2!==this._type)&&chunked}else if(this._missing=varint.decode(this._buf),this.limit&&this._missing>this.limit)return this._lengthError(data);return this._state++,this._ptr=0,offset+1}}return data.length}_lengthError(data){return this.destroy(new Error("Incoming message is too big")),data.length}_writeMessage(data,offset){const free=data.length-offset,missing=this._missing;if(!this._message){if(missing<=free)return this._missing=0,this._push(data.slice(offset,offset+missing)),offset+missing;if(this._chunked)return this._missing-=free,this._push(data.slice(offset,data.length)),data.length;this._message=new Buffer(missing)}return data.copy(this._message,this._ptr,offset,offset+missing),missing<=free?(this._missing=0,this._push(this._message),offset+missing):(this._missing-=free,this._ptr+=free,data.length)}_push(data){if(this.log("_push",data.length),this._missing||(this._ptr=0,this._state=0,this._message=null),0===this._type){if(this.log("open",this._channel),this.destroyed||this._finished)return;let name;name=this._binaryName?data:data.toString()||this._channel.toString(),this.log("open name",name);let channel;return void(this._receiving&&this._receiving[name]?(channel=this._receiving[name],delete this._receiving[name],this._addChannel(channel,this._channel,this._list)):(channel=new Channel(name,this,this._options),this.emit("stream",this._addChannel(channel,this._channel,this._list),channel.name)))}const stream=this._list[this._channel];if(stream)switch(this._type){case 5:case 6:const error=new Error(data.toString()||"Channel destroyed");return void stream._destroy(error,!1);case 3:case 4:return void stream.push(null);case 1:case 2:return void(stream.push(data)||(this._awaitChannelDrains++,stream._awaitDrain++))}}_onchanneldrain(drained){if(this._awaitChannelDrains-=drained,!this._awaitChannelDrains){const ondrain=this._onwritedrain;this._onwritedrain=null,ondrain&&ondrain()}}_write(data,enc,cb){if(this.log("_write",data.length),this._finished)return void cb();if(this._corked)return void this._onuncork(this._write.bind(this,data,enc,cb));if(data===SIGNAL_FLUSH)return void this._finish(cb);let offset=0;for(;offset{this._writableState.prefinished===!1&&(this._writableState.prefinished=!0),this.emit("prefinish"),this._onuncork(cb)})}cork(){1==++this._corked&&this.emit("cork")}uncork(){this._corked&&0==--this._corked&&this.emit("uncork")}end(data,enc,cb){return this.log("end"),"function"==typeof data&&(cb=data,data=void 0),"function"==typeof enc&&(cb=enc,enc=void 0),data&&this.write(data),this._writableState.ending||this.write(SIGNAL_FLUSH),stream.Writable.prototype.end.call(this,cb)}_onuncork(fn){if(this._corked)return void this.once("uncork",fn);fn()}_read(){for(;this._ondrain.length;)this._ondrain.shift()()}_clear(){if(this.log("_clear"),!this._finished){this._finished=!0;const list=this._local.concat(this._remote);this._local=[],this._remote=[],list.forEach(function(stream){stream&&stream._destroy(null,!1)}),this.push(null)}}finalize(){this._clear()}destroy(err){if(this.log("destroy"),this.destroyed)return void this.log("already destroyed");var list=this._local.concat(this._remote);this.destroyed=!0,err&&this.emit("error",err),this.emit("close"),list.forEach(function(stream){stream&&stream.emit("error",err||new Error("underlying socket has been closed"))}),this._clear()}}module.exports=Multiplex}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function stringify(buf){return buf.toString().slice(0,-1)}function collectLs(conn){let counter=0;return pull.take(msg=>{return varint.decode(msg),counter=varint.decode(msg,varint.decode.bytes),!0})}const varint=__webpack_require__(15),pull=__webpack_require__(4),pullLP=__webpack_require__(23),Connection=__webpack_require__(28).Connection,util=__webpack_require__(91),select=__webpack_require__(242),once=__webpack_require__(67),PROTOCOL_ID=__webpack_require__(240).PROTOCOL_ID;class Dialer{constructor(){this.conn=null,this.log=util.log.dialer()}handle(rawConn,callback){this.log("dialer handle conn"),callback=once(callback),pull(rawConn,select(PROTOCOL_ID,(err,conn)=>{if(err)return callback(err);this.log("handshake success"),this.conn=new Connection(conn,rawConn),callback()},this.log),rawConn)}select(protocol,callback){if(this.log("dialer select "+protocol),callback=once(callback),!this.conn)return callback(new Error("multistream handshake has not finalized yet"));const s=select(protocol,(err,conn)=>{if(err)return this.conn=new Connection(conn,this.conn),callback(err);callback(null,new Connection(conn,this.conn))},this.log);pull(this.conn,s,this.conn)}ls(callback){callback=once(callback);const lsStream=select("ls",(err,conn)=>{if(err)return callback(err);pull(conn,pullLP.decode(),collectLs(conn),pull.map(stringify),pull.collect((err,list)=>{if(err)return callback(err);callback(null,list.slice(1))}))},this.log);pull(this.conn,lsStream,this.conn)}}module.exports=Dialer},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(4),isFunction=__webpack_require__(526),assert=__webpack_require__(9),select=__webpack_require__(242),selectHandler=__webpack_require__(581),lsHandler=__webpack_require__(579),matchExact=__webpack_require__(241),util=__webpack_require__(91),Connection=__webpack_require__(28).Connection,PROTOCOL_ID=__webpack_require__(240).PROTOCOL_ID;class Listener{constructor(){this.handlers={ls:{handlerFunc:(protocol,conn)=>lsHandler(this,conn),matchFunc:matchExact}},this.log=util.log.listener()}handle(rawConn,callback){this.log("listener handle conn"),pull(rawConn,select(PROTOCOL_ID,(err,conn)=>{if(err)return callback(err);const shConn=new Connection(conn,rawConn);pull(shConn,selectHandler(shConn,this.handlers,this.log),shConn),callback()},this.log),rawConn)}addHandler(protocol,handlerFunc,matchFunc){this.log("adding handler: "+protocol),assert(isFunction(handlerFunc),"handler must be a function"),this.handlers[protocol]&&this.log("overwriting handler for "+protocol),matchFunc||(matchFunc=matchExact),this.handlers[protocol]={handlerFunc:handlerFunc,matchFunc:matchFunc}}}module.exports=Listener},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function lsHandler(self,conn){const protos=Object.keys(self.handlers).filter(key=>"ls"!==key),nProtos=protos.length,size=protos.reduce((size,proto)=>{const p=new Buffer(proto+"\n");return size+varint.encodingLength(p.length)},0),buf=Buffer.concat([new Buffer(varint.encode(nProtos)),new Buffer(varint.encode(size)),new Buffer("\n")]),encodedProtos=protos.map(proto=>{return new Buffer(proto+"\n")}),values=[buf].concat(encodedProtos);pull(pull.values(values),pullLP.encode(),conn)} +const pull=__webpack_require__(4),pullLP=__webpack_require__(23),varint=__webpack_require__(15);module.exports=lsHandler}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function matchSemver(myProtocol,senderProtocol,callback){const mps=myProtocol.split("/"),sps=senderProtocol.split("/"),myName=mps[1],myVersion=mps[2],senderName=sps[1],senderVersion=sps[2];if(myName!==senderName)return callback(null,!1);callback(null,semver.satisfies(myVersion,"~"+senderVersion))}const semver=__webpack_require__(651);module.exports=matchSemver},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function selectHandler(rawConn,handlersMap,log){function next(){lp.decodeFromReader(shake,(err,data)=>{if(err)return cb(err);log("received:",data.toString());const protocol=data.toString().slice(0,-1);matcher(protocol,handlersMap,(err,result)=>{if(err)return cb(err);const key=result;if(key){log("send ack back of: "+protocol),writeEncoded(shake,data,cb);const conn=new Connection(shake.rest(),rawConn);handlersMap[key].handlerFunc(protocol,conn)}else log("not supported protocol: "+protocol),writeEncoded(shake,new Buffer("na\n")),next()})})}const cb=err=>{log.error(err)},stream=handshake({timeout:6e4},cb),shake=stream.handshake;return next(),stream}function matcher(protocol,handlers,callback){const supportedProtocols=Object.keys(handlers);let supportedProtocol=!1;some(supportedProtocols,(sp,cb)=>{handlers[sp].matchFunc(sp,protocol,(err,result)=>{if(err)return cb(err);result&&(supportedProtocol=sp),cb()})},err=>{if(err)return callback(err);callback(null,supportedProtocol)})}const handshake=__webpack_require__(55),lp=__webpack_require__(23),Connection=__webpack_require__(28).Connection,writeEncoded=__webpack_require__(91).writeEncoded,some=__webpack_require__(299);module.exports=selectHandler}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(583)},function(module,exports,__webpack_require__){!function(root,undefined){"use strict";function _x86Multiply(m,n){return(65535&m)*n+(((m>>>16)*n&65535)<<16)}function _x86Rotl(m,n){return m<>>32-n}function _x86Fmix(h){return h^=h>>>16,h=_x86Multiply(h,2246822507),h^=h>>>13,h=_x86Multiply(h,3266489909),h^=h>>>16}function _x64Add(m,n){m=[m[0]>>>16,65535&m[0],m[1]>>>16,65535&m[1]],n=[n[0]>>>16,65535&n[0],n[1]>>>16,65535&n[1]];var o=[0,0,0,0];return o[3]+=m[3]+n[3],o[2]+=o[3]>>>16,o[3]&=65535,o[2]+=m[2]+n[2],o[1]+=o[2]>>>16,o[2]&=65535,o[1]+=m[1]+n[1],o[0]+=o[1]>>>16,o[1]&=65535,o[0]+=m[0]+n[0],o[0]&=65535,[o[0]<<16|o[1],o[2]<<16|o[3]]}function _x64Multiply(m,n){m=[m[0]>>>16,65535&m[0],m[1]>>>16,65535&m[1]],n=[n[0]>>>16,65535&n[0],n[1]>>>16,65535&n[1]];var o=[0,0,0,0];return o[3]+=m[3]*n[3],o[2]+=o[3]>>>16,o[3]&=65535,o[2]+=m[2]*n[3],o[1]+=o[2]>>>16,o[2]&=65535,o[2]+=m[3]*n[2],o[1]+=o[2]>>>16,o[2]&=65535,o[1]+=m[1]*n[3],o[0]+=o[1]>>>16,o[1]&=65535,o[1]+=m[2]*n[2],o[0]+=o[1]>>>16,o[1]&=65535,o[1]+=m[3]*n[1],o[0]+=o[1]>>>16,o[1]&=65535,o[0]+=m[0]*n[3]+m[1]*n[2]+m[2]*n[1]+m[3]*n[0],o[0]&=65535,[o[0]<<16|o[1],o[2]<<16|o[3]]}function _x64Rotl(m,n){return n%=64,32===n?[m[1],m[0]]:n<32?[m[0]<>>32-n,m[1]<>>32-n]:(n-=32,[m[1]<>>32-n,m[0]<>>32-n])}function _x64LeftShift(m,n){return n%=64,0===n?m:n<32?[m[0]<>>32-n,m[1]<>>1]),h=_x64Multiply(h,[4283543511,3981806797]),h=_x64Xor(h,[0,h[0]>>>1]),h=_x64Multiply(h,[3301882366,444984403]),h=_x64Xor(h,[0,h[0]>>>1])}var library={version:"3.0.1",x86:{},x64:{}};library.x86.hash32=function(key,seed){key=key||"",seed=seed||0;for(var remainder=key.length%4,bytes=key.length-remainder,h1=seed,k1=0,c1=3432918353,c2=461845907,i=0;i>>0},library.x86.hash128=function(key,seed){key=key||"",seed=seed||0;for(var remainder=key.length%16,bytes=key.length-remainder,h1=seed,h2=seed,h3=seed,h4=seed,k1=0,k2=0,k3=0,k4=0,c1=597399067,c2=2869860233,c3=951274213,c4=2716044179,i=0;i>>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)},library.x64.hash128=function(key,seed){key=key||"",seed=seed||0;for(var remainder=key.length%16,bytes=key.length-remainder,h1=[0,seed],h2=[0,seed],k1=[0,0],k2=[0,0],c1=[2277735313,289559509],c2=[1291169091,658871167],i=0;i>>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)},void 0!==module&&module.exports&&(exports=module.exports=library),exports.murmurHash3=library}()},function(module,exports,__webpack_require__){(function(global){var rvalidchars=/^[\],:{}\s]*$/;module.exports=function(data){return"string"==typeof data&&data?(data=data.replace(/^\s+/,"").replace(/\s+$/,""),global.JSON&&JSON.parse?JSON.parse(data):rvalidchars.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))?new Function("return "+data)():void 0):null}}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";const ensureMultiaddr=__webpack_require__(246).ensureMultiaddr,uniqBy=__webpack_require__(531);class MultiaddrSet{constructor(multiaddrs){this._multiaddrs=multiaddrs||[],this._observedMultiaddrs=[]}add(ma){ma=ensureMultiaddr(ma),this.has(ma)||this._multiaddrs.push(ma)}addSafe(ma){ma=ensureMultiaddr(ma),this._observedMultiaddrs.some((m,i)=>{if(m.equals(ma))return this.add(ma),this._observedMultiaddrs.splice(i,1),!0})||this._observedMultiaddrs.push(ma)}toArray(){return this._multiaddrs.slice()}get size(){return this._multiaddrs.length}forEach(fn){return this._multiaddrs.forEach(fn)}has(ma){return ma=ensureMultiaddr(ma),this._multiaddrs.some(m=>m.equals(ma))}delete(ma){ma=ensureMultiaddr(ma),this._multiaddrs.some((m,i)=>{if(m.equals(ma))return this._multiaddrs.splice(i,1),!0})}replace(existing,fresh){Array.isArray(existing)||(existing=[existing]),Array.isArray(fresh)||(fresh=[fresh]),existing.forEach(m=>this.delete(m)),fresh.forEach(m=>this.add(m))}clear(){this._multiaddrs=[]}distinct(){return uniqBy(this._multiaddrs,ma=>{return[ma.toOptions().port,ma.toOptions().transport].join()})}}module.exports=MultiaddrSet},function(module,exports,__webpack_require__){(function(process){function Promise(fn){function next(skipTimeout){waiting.length?(running=!0,waiting.shift()(skipTimeout||!1)):running=!1}function then(cb,eb){return new Promise(function(resolver){function done(skipTimeout){function timeoutDone(){var val;try{val=callback(value)}catch(ex){return resolver.reject(ex),next()}resolver.fulfill(val),next(!0)}var callback=isFulfilled?cb:eb;"function"==typeof callback?skipTimeout?timeoutDone():nextTick(timeoutDone):isFulfilled?(resolver.fulfill(value),next(skipTimeout)):(resolver.reject(value),next(skipTimeout))}waiting.push(done),isResolved&&!running&&next()})}if(!(this instanceof Promise))return"function"==typeof fn?new Promise(fn):defer();var value,isResolved=!1,isFulfilled=!1,waiting=[],running=!1;this.then=then,function(){function fulfill(val){isResolved||(isPromise(val)?val.then(fulfill,reject):(isResolved=isFulfilled=!0,value=val,next()))}function reject(err){isResolved||(isResolved=!0,isFulfilled=!1,value=err,next())}for(var resolver={fulfill:fulfill,reject:reject},i=0;i"!==tokens[0])throw new Error("Unexpected token in map type: "+tokens[0]);tokens.shift(),field.name=tokens.shift();break;case"repeated":case"required":case"optional":var t=tokens.shift();field.required="required"===t,field.repeated="repeated"===t,field.type=tokens.shift(),field.name=tokens.shift();break;case"[":field.options=onfieldoptions(tokens);break;case";":if(null===field.name)throw new Error("Missing field name");if(null===field.type)throw new Error("Missing type in message field: "+field.name);if(field.tag===-1)throw new Error("Missing tag number in message field: "+field.name);return tokens.shift(),field;default:throw new Error("Unexpected token in message field: "+tokens[0])}throw new Error("No ; found for message field")},onmessagebody=function(tokens){for(var body={enums:[],messages:[],fields:[],extends:[],extensions:null};tokens.length;)switch(tokens[0]){case"map":case"repeated":case"optional":case"required":body.fields.push(onfield(tokens));break;case"enum":body.enums.push(onenum(tokens));break;case"message":body.messages.push(onmessage(tokens));break;case"extensions":body.extensions=onextensions(tokens);break;case"oneof":tokens.shift();var name=tokens.shift();if("{"!==tokens[0])throw new Error("Unexpected token in oneof: "+tokens[0]);for(tokens.shift();"}"!==tokens[0];){tokens.unshift("optional");var field=onfield(tokens);field.oneof=name,body.fields.push(field)}tokens.shift();break;case"extend":body.extends.push(onextend(tokens));break;case";":tokens.shift();break;case"reserved":case"option":for(tokens.shift();";"!==tokens[0];)tokens.shift();break;default:tokens.unshift("optional"),body.fields.push(onfield(tokens))}return body},onextend=function(tokens){return{name:tokens[1],message:onmessage(tokens)}},onextensions=function(tokens){tokens.shift();var from=Number(tokens.shift());if(isNaN(from))throw new Error("Invalid from in extensions definition");if("to"!==tokens.shift())throw new Error("Expected keyword 'to' in extensions definition");var to=tokens.shift();if("max"===to&&(to=536870911),to=Number(to),isNaN(to))throw new Error("Invalid to in extensions definition");if(";"!==tokens.shift())throw new Error("Missing ; in extensions definition");return{from:from,to:to}},onmessage=function(tokens){tokens.shift();var lvl=1,body=[],msg={name:tokens.shift(),enums:[],extends:[],messages:[],fields:[]};if("{"!==tokens[0])throw new Error("Expected { but found "+tokens[0]);for(tokens.shift();tokens.length;){if("{"===tokens[0]?lvl++:"}"===tokens[0]&&lvl--,!lvl)return tokens.shift(),body=onmessagebody(body),msg.enums=body.enums,msg.messages=body.messages,msg.fields=body.fields,msg.extends=body.extends,msg.extensions=body.extensions,msg;body.push(tokens.shift())}if(lvl)throw new Error("No closing tag for message")},onpackagename=function(tokens){tokens.shift();var name=tokens.shift();if(";"!==tokens[0])throw new Error("Expected ; but found "+tokens[0]);return tokens.shift(),name},onsyntaxversion=function(tokens){if(tokens.shift(),"="!==tokens[0])throw new Error("Expected = but found "+tokens[0]);tokens.shift();var version=tokens.shift();switch(version){case'"proto2"':version=2;break;case'"proto3"':version=3;break;default:throw new Error("Expected protobuf syntax version but found "+version)}if(";"!==tokens[0])throw new Error("Expected ; but found "+tokens[0]);return tokens.shift(),version},onenumvalue=function(tokens){if(tokens.length<4)throw new Error("Invalid enum value: "+tokens.slice(0,3).join(" "));if("="!==tokens[1])throw new Error("Expected = but found "+tokens[1]);if(";"!==tokens[3]&&"["!==tokens[3])throw new Error("Expected ; or [ but found "+tokens[1]);var name=tokens.shift();tokens.shift();var val={value:null,options:{}};return val.value=Number(tokens.shift()),"["===tokens[0]&&(val.options=onfieldoptions(tokens)),tokens.shift(),{name:name,val:val}},onenum=function(tokens){tokens.shift();var options={},e={name:tokens.shift(),values:{},options:{}};if("{"!==tokens[0])throw new Error("Expected { but found "+tokens[0]);for(tokens.shift();tokens.length;){if("}"===tokens[0])return tokens.shift(),";"===tokens[0]&&tokens.shift(),e;if("option"!==tokens[0]){var val=onenumvalue(tokens);e.values[val.name]=val.val}else options=onoption(tokens),e.options[options.name]=options.value}throw new Error("No closing tag for enum")},onoption=function(tokens){for(var name=null,value=null;tokens.length;){if(";"===tokens[0])return tokens.shift(),{name:name,value:value};switch(tokens[0]){case"option":tokens.shift();var hasBracket="("===tokens[0];if(hasBracket&&tokens.shift(),name=tokens.shift(),hasBracket){if(")"!==tokens[0])throw new Error("Expected ) but found "+tokens[0]);tokens.shift()}"."===tokens[0][0]&&(name+=tokens.shift());break;case"=":if(tokens.shift(),null===name)throw new Error("Expected key for option with value: "+tokens[0]);if(value=function(value){return"true"===value||"false"!==value&&value.replace(/^"+|"+$/gm,"")}(tokens.shift()),"optimize_for"===name&&!/^(SPEED|CODE_SIZE|LITE_RUNTIME)$/.test(value))throw new Error("Unexpected value for option optimize_for: "+value);"{"===value&&(value=onoptionMap(tokens));break;default:throw new Error("Unexpected token in option: "+tokens[0])}}},onoptionMap=function(tokens){for(var map={};tokens.length;){if("}"===tokens[0])return tokens.shift(),map;var hasBracket="("===tokens[0];hasBracket&&tokens.shift();var key=tokens.shift();if(hasBracket){if(")"!==tokens[0])throw new Error("Expected ) but found "+tokens[0]);tokens.shift()}var value=null;switch(tokens[0]){case":":if(void 0!==map[key])throw new Error("Duplicate option map key "+key);tokens.shift(),value=function(value){return"true"===value||"false"!==value&&value.replace(/^"+|"+$/gm,"")}(tokens.shift()),"{"===value&&(value=onoptionMap(tokens)),map[key]=value;break;case"{":if(tokens.shift(),value=onoptionMap(tokens),void 0===map[key]&&(map[key]=[]),!Array.isArray(map[key]))throw new Error("Duplicate option map key "+key);map[key].push(value);break;default:throw new Error("Unexpected token in option map: "+tokens[0])}}throw new Error("No closing tag for option map")},onimport=function(tokens){tokens.shift();var file=tokens.shift().replace(/^"+|"+$/gm,"");if(";"!==tokens[0])throw new Error("Unexpected token: "+tokens[0]+'. Expected ";"');return tokens.shift(),file},onservice=function(tokens){tokens.shift();var service={name:tokens.shift(),methods:[],options:{}};if("{"!==tokens[0])throw new Error("Expected { but found "+tokens[0]);for(tokens.shift();tokens.length;){if("}"===tokens[0])return tokens.shift(),";"===tokens[0]&&tokens.shift(),service;switch(tokens[0]){case"option":var opt=onoption(tokens);if(void 0!==service.options[opt.name])throw new Error("Duplicate option "+opt.name);service.options[opt.name]=opt.value;break;case"rpc":service.methods.push(onrpc(tokens));break;default:throw new Error("Unexpected token in service: "+tokens[0])}}throw new Error("No closing tag for service")},onrpc=function(tokens){tokens.shift();var rpc={name:tokens.shift(),input_type:null,output_type:null,client_streaming:!1,server_streaming:!1,options:{}};if("("!==tokens[0])throw new Error("Expected ( but found "+tokens[0]);if(tokens.shift(),"stream"===tokens[0]&&(tokens.shift(),rpc.client_streaming=!0),rpc.input_type=tokens.shift(),")"!==tokens[0])throw new Error("Expected ) but found "+tokens[0]);if(tokens.shift(),"returns"!==tokens[0])throw new Error("Expected returns but found "+tokens[0]);if(tokens.shift(),"("!==tokens[0])throw new Error("Expected ( but found "+tokens[0]);if(tokens.shift(),"stream"===tokens[0]&&(tokens.shift(),rpc.server_streaming=!0),rpc.output_type=tokens.shift(),")"!==tokens[0])throw new Error("Expected ) but found "+tokens[0]);if(tokens.shift(),";"===tokens[0])return tokens.shift(),rpc;if("{"!==tokens[0])throw new Error("Expected { but found "+tokens[0]);for(tokens.shift();tokens.length;){if("}"===tokens[0])return tokens.shift(),";"===tokens[0]&&tokens.shift(),rpc;if("option"!==tokens[0])throw new Error("Unexpected token in rpc options: "+tokens[0]);var opt=onoption(tokens);if(void 0!==rpc.options[opt.name])throw new Error("Duplicate option "+opt.name);rpc.options[opt.name]=opt.value}throw new Error("No closing tag for rpc")},parse=function(buf){for(var tokens=tokenize(buf.toString()),i=0;imsg.extensions.to)throw new Error(msg.name+" does not declare "+field.tag+" as an extension number");msg.fields.push(field)})})}),schema.messages.forEach(function(msg){msg.fields.forEach(function(field){function enumNameIsFieldType(en){return en.name===field.type}function enumNameIsNestedEnumName(en){return en.name===nestedEnumName}var fieldSplit,messageName,nestedEnumName,message;if(field.options&&"true"===field.options.packed&&PACKABLE_TYPES.indexOf(field.type)===-1){if(field.type.indexOf(".")===-1){if(msg.enums&&msg.enums.some(enumNameIsFieldType))return}else{if(fieldSplit=field.type.split("."),fieldSplit.length>2)throw new Error("what is this?");if(messageName=fieldSplit[0],nestedEnumName=fieldSplit[1],schema.messages.some(function(msg){if(msg.name===messageName)return message=msg,msg}),message&&message.enums&&message.enums.some(enumNameIsNestedEnumName))return}throw new Error("Fields of type "+field.type+' cannot be declared [packed=true]. Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire types) can be declared "packed". See https://developers.google.com/protocol-buffers/docs/encoding#optional')}})}),schema};module.exports=parse},function(module,exports){var onfield=function(f,result){var prefix=f.repeated?"repeated":f.required?"required":"optional";"map"===f.type&&(prefix="map<"+f.map.from+","+f.map.to+">"),f.oneof&&(prefix="");var opts=Object.keys(f.options||{}).map(function(key){return key+" = "+f.options[key]}).join(",");return opts&&(opts=" ["+opts+"]"),result.push((prefix?prefix+" ":"")+("map"===f.map?"":f.type+" ")+f.name+" = "+f.tag+opts+";"),result},onmessage=function(m,result){result.push("message "+m.name+" {"),m.enums||(m.enums=[]),m.enums.forEach(function(e){result.push(onenum(e,[]))}),m.messages||(m.messages=[]),m.messages.forEach(function(m){result.push(onmessage(m,[]))});var oneofs={};return m.fields||(m.fields=[]),m.fields.forEach(function(f){f.oneof?(oneofs[f.oneof]||(oneofs[f.oneof]=[]),oneofs[f.oneof].push(onfield(f,[]))):result.push(onfield(f,[]))}),Object.keys(oneofs).forEach(function(n){oneofs[n].unshift("oneof "+n+" {"),oneofs[n].push("}"),result.push(oneofs[n])}),result.push("}",""),result},onenum=function(e,result){result.push("enum "+e.name+" {"),e.options||(e.options={});var options=onoption(e.options,[]);return options.length>1&&result.push(options.slice(0,-1)),Object.keys(e.values).map(function(v){var val=onenumvalue(e.values[v]);result.push([v+" = "+val+";"])}),result.push("}",""),result},onenumvalue=function(v,result){var opts=Object.keys(v.options||{}).map(function(key){return key+" = "+v.options[key]}).join(",");return opts&&(opts=" ["+opts+"]"),v.value+opts},onoption=function(o,result){var keys=Object.keys(o);return keys.forEach(function(option){var v=o[option];~option.indexOf(".")&&(option="("+option+")");var type=typeof v;"object"===type?(v=onoptionMap(v,[]),v.length&&result.push("option "+option+" = {",v,"};")):("string"===type&&"optimize_for"!==option&&(v='"'+v+'"'),result.push("option "+option+" = "+v+";"))}),keys.length>0&&result.push(""),result},onoptionMap=function(o,result){return Object.keys(o).forEach(function(k){var v=o[k],type=typeof v;"object"===type?Array.isArray(v)?v.forEach(function(v){v=onoptionMap(v,[]),v.length&&result.push(k+" {",v,"}")}):(v=onoptionMap(v,[]),v.length&&result.push(k+" {",v,"}")):("string"===type&&(v='"'+v+'"'),result.push(k+": "+v))}),result},onservices=function(s,result){return result.push("service "+s.name+" {"),s.options||(s.options={}),onoption(s.options,result),s.methods||(s.methods=[]),s.methods.forEach(function(m){result.push(onrpc(m,[]))}),result.push("}",""),result},onrpc=function(rpc,result){var def="rpc "+rpc.name+"(";rpc.client_streaming&&(def+="stream "),def+=rpc.input_type+") returns (",rpc.server_streaming&&(def+="stream "),def+=rpc.output_type+")",rpc.options||(rpc.options={});var options=onoption(rpc.options,[]);return options.length>1?result.push(def+" {",options.slice(0,-1),"}"):result.push(def+";"),result},indent=function(lvl){return function(line){return Array.isArray(line)?line.map(indent(lvl+" ")).join("\n"):lvl+line}};module.exports=function(schema){var result=[];return result.push('syntax = "proto'+schema.syntax+'";',""),schema.package&&result.push("package "+schema.package+";",""),schema.options||(schema.options={}),onoption(schema.options,result),schema.enums||(schema.enums=[]),schema.enums.forEach(function(e){onenum(e,result)}),schema.messages||(schema.messages=[]),schema.messages.forEach(function(m){onmessage(m,result)}),schema.services&&schema.services.forEach(function(s){onservices(s,result)}),result.map(indent("")).join("\n")}},function(module,exports){module.exports=function(sch){var noComments=function(line){var i=line.indexOf("//");return i>-1?line.slice(0,i):line},trim=function(line){return line.trim()};return sch.replace(/([;,{}\(\)=\:\[\]<>]|\/\*|\*\/)/g," $1 ").split(/\n/).map(trim).filter(Boolean).map(noComments).map(trim).filter(Boolean).join("\n").split(/\s+|\n+/gm).filter(function(){var inside=!1;return function(token){return"/*"===token?(inside=!0,!1):"*/"===token?(inside=!1,!1):!inside}}())}},function(module,exports,__webpack_require__){(function(Buffer){var encodings=__webpack_require__(592),varint=__webpack_require__(15),genobj=__webpack_require__(372),genfun=__webpack_require__(371),flatten=function(values){if(!values)return null;var result={};return Object.keys(values).forEach(function(k){result[k]=values[k].value}),result},skip=function(type,buffer,offset){switch(type){case 0:return varint.decode(buffer,offset),offset+varint.decode.bytes;case 1:return offset+8;case 2:var len=varint.decode(buffer,offset);return offset+varint.decode.bytes+len;case 3:case 4:throw new Error("Groups are not supported");case 5:return offset+4}throw new Error("Unknown wire type: "+type)},defined=function(val){return null!==val&&void 0!==val&&("number"!=typeof val||!isNaN(val))},isString=function(def){try{return!!def&&"string"==typeof JSON.parse(def)}catch(err){return!1}},defaultValue=function(f,def){if(f.map)return"{}";if(f.repeated)return"[]";switch(f.type){case"string":return isString(def)?def:'""';case"bool":return"true"===def?"true":"false";case"float":case"double":case"sfixed32":case"fixed32":case"varint":case"enum":case"uint64":case"uint32":case"int64":case"int32":case"sint64":case"sint32":return""+Number(def||0);default:return"null"}};module.exports=function(schema,extraEncodings){var messages={},enums={},cache={},visit=function(schema,prefix){schema.enums&&schema.enums.forEach(function(e){e.id=prefix+(prefix?".":"")+e.name,enums[e.id]=e,visit(e,e.id)}),schema.messages&&schema.messages.forEach(function(m){m.id=prefix+(prefix?".":"")+m.name,messages[m.id]=m,m.fields.forEach(function(f){if(f.map){var name="Map_"+f.map.from+"_"+f.map.to,map={name:name,enums:[],messages:[],fields:[{name:"key",type:f.map.from,tag:1,repeated:!1,required:!0},{name:"value",type:f.map.to,tag:2,repeated:!1,required:!1}],extensions:null,id:prefix+(prefix?".":"")+name};messages[map.id]||(messages[map.id]=map,schema.messages.push(map)),f.type=name,f.repeated=!0}}),visit(m,m.id)})};visit(schema,"");var compileEnum=function(e){var conditions=Object.keys(e.values).map(function(k){return"val !== "+parseInt(e.values[k].value,10)}).join(" && ");conditions||(conditions="true");var encode=genfun()("function encode (val, buf, offset) {")('if (%s) throw new Error("Invalid enum value: "+val)',conditions)("varint.encode(val, buf, offset)")("encode.bytes = varint.encode.bytes")("return buf")("}").toFunction({varint:varint}),decode=genfun()("function decode (buf, offset) {")("var val = varint.decode(buf, offset)")('if (%s) throw new Error("Invalid enum value: "+val)',conditions)("decode.bytes = varint.decode.bytes")("return val")("}").toFunction({varint:varint});return encodings.make(0,encode,decode,varint.encodingLength)},compileMessage=function(m,exports){m.messages.forEach(function(nested){exports[nested.name]=resolve(nested.name,m.id)}),m.enums.forEach(function(val){exports[val.name]=flatten(val.values)}), +exports.type=2,exports.message=!0,exports.name=m.name;var oneofs={};m.fields.forEach(function(f){f.oneof&&(oneofs[f.oneof]||(oneofs[f.oneof]=[]),oneofs[f.oneof].push(f.name))});var enc=m.fields.map(function(f){return resolve(f.type,m.id)}),forEach=function(fn){for(var i=0;i 1) throw new Error(%s)",oneofs[name].map(function(prop){return"+defined("+genobj("obj",prop)+")"}).join(" + "),msg)}),forEach(function(e,f,val,i){var packed=f.repeated&&f.options&&f.options.packed&&"false"!==f.options.packed,hl=varint.encodingLength(f.tag<<3|e.type);f.required?encodingLength("if (!defined(%s)) throw new Error(%s)",val,JSON.stringify(f.name+" is required")):encodingLength("if (defined(%s)) {",val),f.map&&(encodingLength()("var tmp = Object.keys(%s)",val)("for (var i = 0; i < tmp.length; i++) {")("tmp[i] = {key: tmp[i], value: %s[tmp[i]]}",val)("}"),val="tmp"),packed?(encodingLength()("var packedLen = 0")("for (var i = 0; i < %s.length; i++) {",val)("if (!defined(%s)) continue",val+"[i]")("var len = enc[%d].encodingLength(%s)",i,val+"[i]")("packedLen += len"),e.message&&encodingLength("packedLen += varint.encodingLength(len)"),encodingLength("}")("if (packedLen) {")("length += %d + packedLen + varint.encodingLength(packedLen)",hl)("}")):(f.repeated&&(encodingLength("for (var i = 0; i < %s.length; i++) {",val),val+="[i]",encodingLength("if (!defined(%s)) continue",val)),encodingLength("var len = enc[%d].encodingLength(%s)",i,val),e.message&&encodingLength("length += varint.encodingLength(len)"),encodingLength("length += %d + len",hl),f.repeated&&encodingLength("}")),f.required||encodingLength("}")}),encodingLength()("return length")("}"),encodingLength=encodingLength.toFunction({defined:defined,varint:varint,enc:enc});var encode=genfun()("function encode (obj, buf, offset) {")("if (!offset) offset = 0")("if (!buf) buf = new Buffer(encodingLength(obj))")("var oldOffset = offset");Object.keys(oneofs).forEach(function(name){var msg=JSON.stringify("only one of the properties defined in oneof "+name+" can be set");encode("if ((%s) > 1) throw new Error(%s)",oneofs[name].map(function(prop){return"+defined("+genobj("obj",prop)+")"}).join(" + "),msg)}),forEach(function(e,f,val,i){f.required?encode("if (!defined(%s)) throw new Error(%s)",val,JSON.stringify(f.name+" is required")):encode("if (defined(%s)) {",val);var j,packed=f.repeated&&f.options&&f.options.packed&&"false"!==f.options.packed,p=varint.encode(f.tag<<3|2),h=varint.encode(f.tag<<3|e.type);if(f.map&&(encode()("var tmp = Object.keys(%s)",val)("for (var i = 0; i < tmp.length; i++) {")("tmp[i] = {key: tmp[i], value: %s[tmp[i]]}",val)("}"),val="tmp"),packed){for(encode()("var packedLen = 0")("for (var i = 0; i < %s.length; i++) {",val)("if (!defined(%s)) continue",val+"[i]")("packedLen += enc[%d].encodingLength(%s)",i,val+"[i]")("}"),encode("if (packedLen) {"),j=0;j> 3")("switch (tag) {"),forEach(function(e,f,val,i){var packed=f.repeated&&f.options&&f.options.packed&&"false"!==f.options.packed;decode("case %d:",f.tag),f.oneof&&m.fields.forEach(function(otherField){otherField.oneof===f.oneof&&f.name!==otherField.name&&decode("delete %s",genobj("obj",otherField.name))}),packed&&decode()("var packedEnd = varint.decode(buf, offset)")("offset += varint.decode.bytes")("packedEnd += offset")("while (offset < packedEnd) {"),e.message?(decode("var len = varint.decode(buf, offset)"),decode("offset += varint.decode.bytes"),f.map?(decode("var tmp = enc[%d].decode(buf, offset, offset + len)",i),decode("%s[tmp.key] = tmp.value",val)):f.repeated?decode("%s.push(enc[%d].decode(buf, offset, offset + len))",val,i):decode("%s = enc[%d].decode(buf, offset, offset + len)",val,i)):f.repeated?decode("%s.push(enc[%d].decode(buf, offset))",val,i):decode("%s = enc[%d].decode(buf, offset)",val,i),decode("offset += enc[%d].decode.bytes",i),packed&&decode("}"),f.required&&decode("found%d = true",i),decode("break")}),decode()("default:")("offset = skip(prefix & 7, buf, offset)")("}")("}")("}"),decode=decode.toFunction({varint:varint,skip:skip,enc:enc}),encode.bytes=decode.bytes=0,exports.buffer=!0,exports.encode=encode,exports.decode=decode,exports.encodingLength=encodingLength,exports},resolve=function(name,from,compile){if(extraEncodings&&extraEncodings[name])return extraEncodings[name];if(encodings[name])return encodings[name];var m=(from?from+"."+name:name).split(".").map(function(part,i,list){return list.slice(0,i).concat(name).join(".")}).reverse().reduce(function(result,id){return result||messages[id]||enums[id]},null);if(compile===!1)return m;if(!m)throw new Error("Could not resolve "+name);return m.values?compileEnum(m):cache[m.id]||compileMessage(m,cache[m.id]={})};return(schema.enums||[]).concat((schema.messages||[]).map(function(message){return resolve(message.id)}))}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){var varint=__webpack_require__(15),svarint=__webpack_require__(657),encoder=function(type,encode,decode,encodingLength){return encode.bytes=decode.bytes=0,{type:type,encode:encode,decode:decode,encodingLength:encodingLength}};exports.make=encoder,exports.bytes=function(tag){var bufferLength=function(val){return Buffer.isBuffer(val)?val.length:Buffer.byteLength(val)},encodingLength=function(val){var len=bufferLength(val);return varint.encodingLength(len)+len},encode=function(val,buffer,offset){var oldOffset=offset,len=bufferLength(val);return varint.encode(len,buffer,offset),offset+=varint.encode.bytes,Buffer.isBuffer(val)?val.copy(buffer,offset):buffer.write(val,offset,len),offset+=len,encode.bytes=offset-oldOffset,buffer},decode=function(buffer,offset){var oldOffset=offset,len=varint.decode(buffer,offset);offset+=varint.decode.bytes;var val=buffer.slice(offset,offset+len);return offset+=val.length,decode.bytes=offset-oldOffset,val};return encoder(2,encode,decode,encodingLength)}(),exports.string=function(){var encodingLength=function(val){var len=Buffer.byteLength(val);return varint.encodingLength(len)+len},encode=function(val,buffer,offset){var oldOffset=offset,len=Buffer.byteLength(val);return varint.encode(len,buffer,offset,"utf-8"),offset+=varint.encode.bytes,buffer.write(val,offset,len),offset+=len,encode.bytes=offset-oldOffset,buffer},decode=function(buffer,offset){var oldOffset=offset,len=varint.decode(buffer,offset);offset+=varint.decode.bytes;var val=buffer.toString("utf-8",offset,offset+len);return offset+=len,decode.bytes=offset-oldOffset,val};return encoder(2,encode,decode,encodingLength)}(),exports.bool=function(){var encodingLength=function(val){return 1},encode=function(val,buffer,offset){return buffer[offset]=val?1:0,encode.bytes=1,buffer},decode=function(buffer,offset){var bool=buffer[offset]>0;return decode.bytes=1,bool};return encoder(0,encode,decode,encodingLength)}(),exports.int32=function(){var decode=function(buffer,offset){var val=varint.decode(buffer,offset);return decode.bytes=varint.decode.bytes,val>2147483647?val-4294967296:val},encodingLength=function(val){return varint.encodingLength(val<0?val+4294967296:val)};return encoder(0,varint.encode,decode,encodingLength)}(),exports.int64=function(){var decode=function(buffer,offset){var val=varint.decode(buffer,offset);if(val>=Math.pow(2,63)){for(var limit=9;255===buffer[offset+limit-1];)limit--;limit=limit||9;var subset=new Buffer(limit);buffer.copy(subset,0,offset,offset+limit),subset[limit-1]=127&subset[limit-1],val=-1*varint.decode(subset,0),decode.bytes=10}else decode.bytes=varint.decode.bytes;return val},encode=function(val,buffer,offset){if(val<0){var last=offset+9;for(varint.encode(val*-1,buffer,offset),offset+=varint.encode.bytes-1,buffer[offset]=128|buffer[offset];offset-1};return{enumerable:op("enumerable"),configurable:op("configurable"),writable:op("writable"),value:value}};return function(obj,key,value,options){var k;if(options=makeOptions(value,options),"object"==typeof key){for(k in key)Object.hasOwnProperty.call(key,k)&&(options.value=key[k],setProperty(obj,k,options));return obj}return setProperty(obj,key,options)}})},function(module,exports,__webpack_require__){"use strict";var through=__webpack_require__(98),Buffer=__webpack_require__(6).Buffer;module.exports=function(size,opts){opts||(opts={}),"object"==typeof size&&(opts=size,size=opts.size),size=size||512;var zeroPadding;zeroPadding=!opts.nopad&&(void 0===opts.zeroPadding||opts.zeroPadding);var buffered=[],bufferedBytes=0,emittedChunk=!1;return through(function(data){for("number"==typeof data&&(data=Buffer([data])),bufferedBytes+=data.length,buffered.push(data);bufferedBytes>=size;){var b=Buffer.concat(buffered);bufferedBytes-=size,this.queue(b.slice(0,size)),buffered=[b.slice(size,b.length)],emittedChunk=!0}},function(end){if(opts.emitEmpty&&!emittedChunk||bufferedBytes){if(zeroPadding){var zeroes=Buffer.alloc(size-bufferedBytes);zeroes.fill(0),buffered.push(zeroes)}buffered&&(this.queue(Buffer.concat(buffered)),buffered=null)}this.queue(null)})}},function(module,exports){module.exports=function(onError){onError=onError||function(){};var errd;return function(read){return function(abort,cb){read(abort,function(end,data){if(errd)return cb(!0);if(end&&end!==!0){var _end=onError(end);return _end===!1?cb(end):_end&&_end!==!0?(errd=!0,cb(null,_end)):cb(!0)}cb(end,data)})}}}},function(module,exports){module.exports=function(){function delayed(_read){return stream?stream(_read):(read=_read,function(_abort,_cb){reader?reader(_abort,_cb):(abort=_abort,cb=_cb)})}var read,reader,cb,abort,stream;return delayed.resolve=function(_stream){if(stream)throw new Error("already resolved");if(!(stream=_stream))throw new Error("resolve *must* be passed a transform stream");read&&(reader=stream(read),cb&&reader(abort,cb))},delayed}},function(module,exports,__webpack_require__){"use strict";function decode(opts){let reader=new Reader,p=pushable(err=>{reader.abort(err)});return read=>{function next(){decodeFromReader(reader,opts,(err,msg)=>{if(err)return p.end(err);p.push(msg),next()})}return reader(read),next(),p}}function decodeFromReader(reader,opts,cb){"function"==typeof opts&&(cb=opts,opts={}),opts=Object.assign({fixed:!1,bytes:4},opts||{}),opts.fixed?readFixedMessage(reader,opts.bytes,opts.maxLength,cb):readVarintMessage(reader,opts.maxLength,cb)}function readFixedMessage(reader,byteLength,maxLength,cb){"function"==typeof maxLength&&(cb=maxLength,maxLength=MAX_LENGTH),reader.read(byteLength,(err,bytes)=>{if(err)return cb(err);const msgSize=bytes.readInt32BE(0);if(msgSize>maxLength)return cb("size longer than max permitted length of "+maxLength+"!");readMessage(reader,msgSize,cb)})}function readVarintMessage(reader,maxLength,cb){function readByte(){reader.read(1,(err,byte)=>{if(err)return cb(err);if(rawMsgSize.push(byte),byte&&!isEndByte(byte[0]))return void readByte();const msgSize=varint.decode(Buffer.concat(rawMsgSize));if(msgSize>maxLength)return cb("size longer than max permitted length of "+maxLength+"!");readMessage(reader,msgSize,(err,msg)=>{if(err)return cb(err);rawMsgSize=[],cb(null,msg)})})}"function"==typeof maxLength&&(cb=maxLength,maxLength=MAX_LENGTH);let rawMsgSize=[];0===rawMsgSize.length&&readByte()}function readMessage(reader,size,cb){reader.read(size,(err,msg)=>{if(err)return cb(err);cb(null,msg)})}const varint=__webpack_require__(15),Reader=__webpack_require__(250),Buffer=__webpack_require__(6).Buffer,pushable=__webpack_require__(30);exports.decode=decode,exports.decodeFromReader=decodeFromReader;const isEndByte=byte=>!(128&byte),MAX_LENGTH=4194304},function(module,exports,__webpack_require__){"use strict";function encode(opts){opts=Object.assign({fixed:!1,bytes:4},opts||{});const varint=__webpack_require__(15);let pool=opts.fixed?null:createPool(),used=0,ended=!1;return read=>(end,cb)=>{if(end&&(ended=end),ended)return cb(ended);read(null,(end,data)=>{if(end&&(ended=end),ended)return cb(ended);if(!Buffer.isBuffer(data))return ended=new Error("data must be a buffer"),cb(ended);let encodedLength;opts.fixed?(encodedLength=Buffer.alloc(opts.bytes),encodedLength.writeInt32BE(data.length,0)):(varint.encode(data.length,pool,used),used+=varint.encode.bytes,encodedLength=pool.slice(used-varint.encode.bytes,used),pool.length-used<100&&(pool=createPool(),used=0)),cb(null,Buffer.concat([encodedLength,data]))})}}function createPool(){return Buffer.alloc(poolSize)}const Buffer=__webpack_require__(6).Buffer;module.exports=encode;const poolSize=10240},function(module,exports){module.exports=function(ary){function create(stream){return{ready:!1,reading:!1,ended:!1,read:stream,data:null}}function check(){if(cb){clean();var l=inputs.length,_cb=cb;if(0===l&&(abort||capped))return cb=null,void _cb(abort||!0);for(var j=0;jinputs.length)throw new Error("this should never happen");if(!(current.reading||current.ended||current.ready)){current.reading=!0;var sync=!0;current.read(abort,function next(end,data){current.data=data,current.ready=!0,current.reading=!1,end===!0||abort?current.ended=!0:end&&(abort=current.ended=end),abort&&!end&¤t.read(abort,next),sync||check()}),sync=!1}}(inputs[l]);check()}function read(_abort,_cb){abort=abort||_abort,cb=_cb,next()}var abort,cb,capped=!!ary,inputs=(ary||[]).map(create),i=0;return read.add=function(stream){if(!stream)return capped=!0,next();inputs.push(create(stream)),next()},read.cap=function(err){read.add(null)},read}},function(module,exports){module.exports=function(fn){var active=!1,called=0;return function(){if(called=!0,!active){for(active=!0;called;)called=!1,fn();active=!1}}}},function(module,exports,__webpack_require__){(function(Buffer){module.exports=function(){var buffers=[],length=0;return{length:length,data:this,add:function(data){if(!Buffer.isBuffer(data))throw new Error("data must be a buffer, was: "+JSON.stringify(data));return this.length=length+=data.length,buffers.push(data),this},has:function(n){return null==n?length>0:length>=n},get:function(n){var _length;if(null==n||n===length){length=0;var _buffers=buffers;return buffers=[],1==_buffers.length?_buffers[0]:Buffer.concat(_buffers)}if(buffers.length>1&&n<=(_length=buffers[0].length)){var buf=buffers[0].slice(0,n);return n===_length?buffers.shift():buffers[0]=buffers[0].slice(n,_length),length-=n,buf}if(nmax?cb(!0):void cb(null,i++)}}},function(module,exports,__webpack_require__){"use strict";module.exports=function(){return function(abort,cb){cb(!0)}}},function(module,exports,__webpack_require__){"use strict";module.exports=function(err){return function(abort,cb){cb(err)}}},function(module,exports,__webpack_require__){"use strict";module.exports={keys:__webpack_require__(614),once:__webpack_require__(253),values:__webpack_require__(141),count:__webpack_require__(609),infinite:__webpack_require__(613),empty:__webpack_require__(610),error:__webpack_require__(611)}},function(module,exports,__webpack_require__){"use strict";module.exports=function(generate){return generate=generate||Math.random,function(end,cb){return end?cb&&cb(end):cb(null,generate())}}},function(module,exports,__webpack_require__){"use strict";var values=__webpack_require__(141);module.exports=function(object){return values(Object.keys(object))}},function(module,exports,__webpack_require__){"use strict";function id(e){return e}var prop=__webpack_require__(69);module.exports=function(map){if(!map)return id;map=prop(map);var abortCb,aborted,busy=!1;return function(read){return function next(abort,cb){if(aborted)return cb(aborted);abort?(aborted=abort,busy?read(abort,function(){busy?abortCb=cb:cb(abort)}):read(abort,cb)):read(null,function(end,data){end?cb(end):aborted?cb(aborted):(busy=!0,map(data,function(err,data){busy=!1,aborted?(cb(aborted),abortCb(aborted)):err?next(err,cb):cb(null,data)}))})}}}},function(module,exports,__webpack_require__){"use strict";var tester=__webpack_require__(256),filter=__webpack_require__(142);module.exports=function(test){return test=tester(test),filter(function(data){return!test(data)})}},function(module,exports,__webpack_require__){"use strict";var values=__webpack_require__(141),once=__webpack_require__(253);module.exports=function(){return function(read){var _read;return function(abort,cb){function nextChunk(){_read(null,function(err,data){err===!0?nextStream():err?read(!0,function(abortErr){cb(err)}):cb(null,data)})}function nextStream(){_read=null,read(null,function(end,stream){if(end)return cb(end);Array.isArray(stream)||stream&&"object"==typeof stream?stream=values(stream):"function"!=typeof stream&&(stream=once(stream)),_read=stream,nextChunk()})}abort?_read?_read(abort,function(err){read(err||abort,cb)}):read(abort,cb):_read?nextChunk():nextStream()}}}},function(module,exports,__webpack_require__){"use strict";module.exports={map:__webpack_require__(619),asyncMap:__webpack_require__(615),filter:__webpack_require__(142),filterNot:__webpack_require__(616),through:__webpack_require__(622),take:__webpack_require__(621),unique:__webpack_require__(254),nonUnique:__webpack_require__(620),flatten:__webpack_require__(617)}},function(module,exports,__webpack_require__){"use strict";function id(e){return e}var prop=__webpack_require__(69);module.exports=function(mapper){return mapper?(mapper=prop(mapper),function(read){return function(abort,cb){read(abort,function(end,data){try{data=end?null:mapper(data)}catch(err){return read(err,function(){return cb(err)})}cb(end,data)})}}):id}},function(module,exports,__webpack_require__){"use strict";var unique=__webpack_require__(254);module.exports=function(field){return unique(field,!0)}},function(module,exports,__webpack_require__){"use strict";module.exports=function(test,opts){opts=opts||{};var last=opts.last||!1,ended=!1;if("number"==typeof test){last=!0;var n=test;test=function(){return--n}}return function(read){function terminate(cb){read(!0,function(err){last=!1,cb(err||!0)})}return function(end,cb){ended?last?terminate(cb):cb(ended):(ended=end)?read(ended,cb):read(null,function(end,data){(ended=ended||end)?cb(ended):test(data)?cb(null,data):(ended=!0,last?cb(null,data):terminate(cb))})}}}},function(module,exports,__webpack_require__){"use strict";module.exports=function(op,onEnd){function once(abort){!a&&onEnd&&(a=!0,onEnd(abort===!0?null:abort))}var a=!1;return function(read){return function(end,cb){return end&&once(end),read(end,function(end,data){end?once(end):op&&op(data),cb(end,data)})}}}},function(module,exports){module.exports=function(fn){var active=!1,called=0;return function(){if(called=!0,!active){for(active=!0;called;)called=!1,fn();active=!1}}}},function(module,exports,__webpack_require__){"use strict";function isFunction(f){return"function"==typeof f}var WebSocket=__webpack_require__(629),duplex=__webpack_require__(625),wsurl=__webpack_require__(630);module.exports=function(addr,opts){isFunction(opts)&&(opts={onConnect:opts});var location="undefined"==typeof window?{}:window.location,url=wsurl(addr,location),socket=new WebSocket(url),stream=duplex(socket,opts);return stream.remoteAddress=url,stream.close=function(cb){isFunction(cb)&&socket.addEventListener("close",cb),socket.close()},socket.addEventListener("open",function(e){opts&&isFunction(opts.onConnect)&&opts.onConnect(null,stream)}),stream},module.exports.connect=module.exports},function(module,exports,__webpack_require__){function duplex(ws,opts){var req=ws.upgradeReq||{};return opts&&opts.binaryType?ws.binaryType=opts.binaryType:opts&&opts.binary&&(ws.binaryType="arraybuffer"),{source:source(ws,opts&&opts.onConnect),sink:sink(ws,opts),headers:req.headers,url:req.url,upgrade:req.upgrade,method:req.method}}var source=__webpack_require__(628),sink=__webpack_require__(627);module.exports=duplex},function(module,exports){module.exports=function(socket,callback){function cleanup(){"function"==typeof remove&&(remove.call(socket,"open",handleOpen),remove.call(socket,"error",handleErr))}function handleOpen(evt){cleanup(),callback()}function handleErr(evt){cleanup(),callback(evt)}var remove=socket&&(socket.removeEventListener||socket.removeListener);return socket.readyState>=2?callback(!0):1===socket.readyState?callback():(socket.addEventListener("open",handleOpen),void socket.addEventListener("error",handleErr))}},function(module,exports,__webpack_require__){(function(setImmediate,process){var ready=__webpack_require__(626),nextTick=void 0!==setImmediate?setImmediate:process.nextTick;module.exports=function(socket,opts){return function(read){function next(end,data){if(end)return void(closeOnEnd&&socket.readyState<=1&&(onClose&&socket.addEventListener("close",function(ev){if(ev.wasClean||1006===ev.code)onClose();else{var err=new Error("ws error");err.event=ev,onClose(err)}}),socket.close()));ready(socket,function(end){if(end)return read(end,function(){});socket.send(data),nextTick(function(){read(null,next)})})}opts=opts||{};var closeOnEnd=opts.closeOnEnd!==!1,onClose="function"==typeof opts?opts:opts.onClose;read(null,next)}}}).call(exports,__webpack_require__(37).setImmediate,__webpack_require__(5))},function(module,exports,__webpack_require__){(function(Buffer){module.exports=function(socket,cb){function read(abort,cb){if(receiver=null,ended)return cb(ended);abort?(receiver=cb,socket.close()):buffer.length>0?cb(null,buffer.shift()):receiver=cb}var receiver,ended,buffer=[],started=!1;return socket.addEventListener("message",function(evt){var data=evt.data;if(data instanceof ArrayBuffer&&(data=new Buffer(data)),receiver)return receiver(null,data);buffer.push(data)}),socket.addEventListener("close",function(evt){ended||receiver&&receiver(ended=!0)}),socket.addEventListener("error",function(evt){ended||(ended=evt,started||(started=!0,cb&&cb(evt)),receiver&&receiver(ended))}),socket.addEventListener("open",function(evt){started||ended||(started=!0)}),read}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){module.exports="undefined"==typeof WebSocket?__webpack_require__(715):WebSocket},function(module,exports,__webpack_require__){var rurl=__webpack_require__(643),map={http:"ws",https:"wss"};module.exports=function(url,location){return rurl(url,location,map,"ws")}},function(module,exports,__webpack_require__){var once=__webpack_require__(67),eos=__webpack_require__(353),fs=__webpack_require__(716),noop=function(){},isFn=function(fn){return"function"==typeof fn},isFS=function(stream){return!!fs&&((stream instanceof(fs.ReadStream||noop)||stream instanceof(fs.WriteStream||noop))&&isFn(stream.close))},isRequest=function(stream){return stream.setHeader&&isFn(stream.abort)},destroyer=function(stream,reading,writing,callback){callback=once(callback);var closed=!1;stream.on("close",function(){closed=!0}),eos(stream,{readable:reading,writable:writing},function(err){if(err)return callback(err);closed=!0,callback()});var destroyed=!1;return function(err){if(!closed&&!destroyed)return destroyed=!0,isFS(stream)?stream.close():isRequest(stream)?stream.abort():isFn(stream.destroy)?stream.destroy():void callback(err||new Error("stream was destroyed"))}},call=function(fn){fn()},pipe=function(from,to){return from.pipe(to)},pump=function(){var streams=Array.prototype.slice.call(arguments),callback=isFn(streams[streams.length-1]||noop)&&streams.pop()||noop;if(Array.isArray(streams[0])&&(streams=streams[0]),streams.length<2)throw new Error("pump requires two streams per minimum");var error,destroys=streams.map(function(stream,i){var reading=i0,function(err){error||(error=err),err&&destroys.forEach(call),reading||(destroys.forEach(call),callback(error))})});return streams.reduce(pipe)};module.exports=pump},function(module,exports,__webpack_require__){(function(module,global){var __WEBPACK_AMD_DEFINE_RESULT__;!function(root){function error(type){throw new RangeError(errors[type])}function map(array,fn){for(var length=array.length,result=[];length--;)result[length]=fn(array[length]);return result}function mapDomain(string,fn){var parts=string.split("@"),result="";return parts.length>1&&(result=parts[0]+"@",string=parts[1]),string=string.replace(regexSeparators,"."),result+map(string.split("."),fn).join(".")}function ucs2decode(string){for(var value,extra,output=[],counter=0,length=string.length;counter=55296&&value<=56319&&counter65535&&(value-=65536, +output+=stringFromCharCode(value>>>10&1023|55296),value=56320|1023&value),output+=stringFromCharCode(value)}).join("")}function basicToDigit(codePoint){return codePoint-48<10?codePoint-22:codePoint-65<26?codePoint-65:codePoint-97<26?codePoint-97:base}function digitToBasic(digit,flag){return digit+22+75*(digit<26)-((0!=flag)<<5)}function adapt(delta,numPoints,firstTime){var k=0;for(delta=firstTime?floor(delta/damp):delta>>1,delta+=floor(delta/numPoints);delta>baseMinusTMin*tMax>>1;k+=base)delta=floor(delta/baseMinusTMin);return floor(k+(baseMinusTMin+1)*delta/(delta+skew))}function decode(input){var out,basic,j,index,oldi,w,k,digit,t,baseMinusT,output=[],inputLength=input.length,i=0,n=initialN,bias=initialBias;for(basic=input.lastIndexOf(delimiter),basic<0&&(basic=0),j=0;j=128&&error("not-basic"),output.push(input.charCodeAt(j));for(index=basic>0?basic+1:0;index=inputLength&&error("invalid-input"),digit=basicToDigit(input.charCodeAt(index++)),(digit>=base||digit>floor((maxInt-i)/w))&&error("overflow"),i+=digit*w,t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias,!(digitfloor(maxInt/baseMinusT)&&error("overflow"),w*=baseMinusT;out=output.length+1,bias=adapt(i-oldi,out,0==oldi),floor(i/out)>maxInt-n&&error("overflow"),n+=floor(i/out),i%=out,output.splice(i++,0,n)}return ucs2encode(output)}function encode(input){var n,delta,handledCPCount,basicLength,bias,j,m,q,k,t,currentValue,inputLength,handledCPCountPlusOne,baseMinusT,qMinusT,output=[];for(input=ucs2decode(input),inputLength=input.length,n=initialN,delta=0,bias=initialBias,j=0;j=n&¤tValuefloor((maxInt-delta)/handledCPCountPlusOne)&&error("overflow"),delta+=(m-n)*handledCPCountPlusOne,n=m,j=0;jmaxInt&&error("overflow"),currentValue==n){for(q=delta,k=base;t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias,!(q= 0x80 (not a basic code point)","invalid-input":"Invalid input"},baseMinusTMin=base-tMin,floor=Math.floor,stringFromCharCode=String.fromCharCode;punycode={version:"1.4.1",ucs2:{decode:ucs2decode,encode:ucs2encode},decode:decode,encode:encode,toASCII:toASCII,toUnicode:toUnicode},void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(){return punycode}.call(exports,__webpack_require__,exports,module))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)}()}).call(exports,__webpack_require__(18)(module),__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}module.exports=function(qs,sep,eq,options){sep=sep||"&",eq=eq||"=";var obj={};if("string"!=typeof qs||0===qs.length)return obj;qs=qs.split(sep);var maxKeys=1e3;options&&"number"==typeof options.maxKeys&&(maxKeys=options.maxKeys);var len=qs.length;maxKeys>0&&len>maxKeys&&(len=maxKeys);for(var i=0;i=0?(kstr=x.substr(0,idx),vstr=x.substr(idx+1)):(kstr=x,vstr=""),k=decodeURIComponent(kstr),v=decodeURIComponent(vstr),hasOwnProperty(obj,k)?isArray(obj[k])?obj[k].push(v):obj[k]=[obj[k],v]:obj[k]=v}return obj};var isArray=Array.isArray||function(xs){return"[object Array]"===Object.prototype.toString.call(xs)}},function(module,exports,__webpack_require__){"use strict";function map(xs,f){if(xs.map)return xs.map(f);for(var res=[],i=0;i65536)throw new Error("requested too many random bytes");var rawBytes=new global.Uint8Array(size);size>0&&crypto.getRandomValues(rawBytes);var bytes=Buffer.from(rawBytes.buffer);return"function"==typeof cb?process.nextTick(function(){cb(null,bytes)}):bytes}var Buffer=__webpack_require__(6).Buffer,crypto=global.crypto||global.msCrypto;crypto&&crypto.getRandomValues?module.exports=randomBytes:module.exports=oldBrowser}).call(exports,__webpack_require__(2),__webpack_require__(5))},function(module,exports,__webpack_require__){module.exports=__webpack_require__(44)},function(module,exports,__webpack_require__){"use strict";function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}module.exports=PassThrough;var Transform=__webpack_require__(259),util=__webpack_require__(26);util.inherits=__webpack_require__(1),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function copyBuffer(src,target,offset){src.copy(target,offset)}var Buffer=__webpack_require__(6).Buffer;module.exports=function(){function BufferList(){_classCallCheck(this,BufferList),this.head=null,this.tail=null,this.length=0}return BufferList.prototype.push=function(v){var entry={data:v,next:null};this.length>0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};0===this.length&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(0!==this.length){var ret=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s){if(0===this.length)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s+p.data;return ret},BufferList.prototype.concat=function(n){if(0===this.length)return Buffer.alloc(0);if(1===this.length)return this.head.data;for(var ret=Buffer.allocUnsafe(n>>>0),p=this.head,i=0;p;)copyBuffer(p.data,ret,i),i+=p.data.length,p=p.next;return ret},BufferList}()},function(module,exports,__webpack_require__){module.exports=__webpack_require__(36).PassThrough},function(module,exports,__webpack_require__){module.exports=__webpack_require__(36).Transform},function(module,exports,__webpack_require__){module.exports=__webpack_require__(143)},function(module,exports,__webpack_require__){var URL=__webpack_require__(147);module.exports=function(url,location,protocolMap,defaultProtocol){protocolMap=protocolMap||{};var proto,url=URL.parse(url,!1,!0);return url.protocol?proto=url.protocol:(proto=location.protocol?location.protocol.replace(/:$/,""):"http",proto=(protocolMap[proto]||defaultProtocol||proto)+":"),url.host&&":"===url.host[0]&&(url.host=null),url.hostname?URL.format({protocol:proto,slashes:!0,hostname:url.hostname,port:url.port,pathname:url.pathname,search:url.search}):(url.host=location.host,url.port?URL.format({protocol:proto,slashes:!0,host:location.hostname+":"+url.port,port:url.port,pathname:url.pathname,search:url.search}):url.pathname?URL.format({protocol:proto,slashes:!0,host:url.host,pathname:url.pathname,search:url.search}):(url.pathname=location.pathname,url.search?URL.format({protocol:proto,slashes:!0,host:url.host,pathname:url.pathname,search:url.search}):(url.search=location.search,url.format(url))))}},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(263)(__webpack_require__(650))},function(module,exports,__webpack_require__){"use strict";(function(Buffer){var toString=Object.prototype.toString;exports.isArray=function(value,message){if(!Array.isArray(value))throw TypeError(message)},exports.isBoolean=function(value,message){if("[object Boolean]"!==toString.call(value))throw TypeError(message)},exports.isBuffer=function(value,message){if(!Buffer.isBuffer(value))throw TypeError(message)},exports.isFunction=function(value,message){if("[object Function]"!==toString.call(value))throw TypeError(message)},exports.isNumber=function(value,message){if("[object Number]"!==toString.call(value))throw TypeError(message)},exports.isObject=function(value,message){if("[object Object]"!==toString.call(value))throw TypeError(message)},exports.isBufferLength=function(buffer,length,message){if(buffer.length!==length)throw RangeError(message)},exports.isBufferLength2=function(buffer,length1,length2,message){if(buffer.length!==length1&&buffer.length!==length2)throw RangeError(message)},exports.isLengthGTZero=function(value,message){if(0===value.length)throw RangeError(message)},exports.isNumberInInterval=function(number,x,y,message){if(number<=x||number>=y)throw RangeError(message)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";var Buffer=__webpack_require__(6).Buffer,bip66=__webpack_require__(306),EC_PRIVKEY_EXPORT_DER_COMPRESSED=Buffer.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),EC_PRIVKEY_EXPORT_DER_UNCOMPRESSED=Buffer.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),ZERO_BUFFER_32=Buffer.from([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);exports.privateKeyExport=function(privateKey,publicKey,compressed){var result=Buffer.from(compressed?EC_PRIVKEY_EXPORT_DER_COMPRESSED:EC_PRIVKEY_EXPORT_DER_UNCOMPRESSED);return privateKey.copy(result,compressed?8:9),publicKey.copy(result,compressed?181:214),result},exports.privateKeyImport=function(privateKey){var length=privateKey.length,index=0;if(!(length2||length1?privateKey[index+lenb-2]<<8:0);if(index+=lenb,!(length32||length1&&0===r[posR]&&!(128&r[posR+1]);--lenR,++posR);for(var s=Buffer.concat([Buffer.from([0]),sigObj.s]),lenS=33,posS=0;lenS>1&&0===s[posS]&&!(128&s[posS+1]);--lenS,++posS);return bip66.encode(r.slice(posR),s.slice(posS))},exports.signatureImport=function(sig){var r=Buffer.from(ZERO_BUFFER_32),s=Buffer.from(ZERO_BUFFER_32);try{var sigObj=bip66.decode(sig);if(33===sigObj.r.length&&0===sigObj.r[0]&&(sigObj.r=sigObj.r.slice(1)),sigObj.r.length>32)throw new Error("R length is too long");if(33===sigObj.s.length&&0===sigObj.s[0]&&(sigObj.s=sigObj.s.slice(1)),sigObj.s.length>32)throw new Error("S length is too long")}catch(err){return}return sigObj.r.copy(r,32-sigObj.r.length),sigObj.s.copy(s,32-sigObj.s.length),{r:r,s:s}},exports.signatureImportLax=function(sig){var r=Buffer.from(ZERO_BUFFER_32),s=Buffer.from(ZERO_BUFFER_32),length=sig.length,index=0;if(48===sig[index++]){var lenbyte=sig[index++];if(!(128&lenbyte&&(index+=lenbyte-128)>length)&&2===sig[index++]){var rlen=sig[index++];if(128&rlen){if(lenbyte=rlen-128,index+lenbyte>length)return;for(;lenbyte>0&&0===sig[index];index+=1,lenbyte-=1);for(rlen=0;lenbyte>0;index+=1,lenbyte-=1)rlen=(rlen<<8)+sig[index]}if(!(rlen>length-index)){var rindex=index;if(index+=rlen,2===sig[index++]){var slen=sig[index++];if(128&slen){if(lenbyte=slen-128,index+lenbyte>length)return;for(;lenbyte>0&&0===sig[index];index+=1,lenbyte-=1);for(slen=0;lenbyte>0;index+=1,lenbyte-=1)slen=(slen<<8)+sig[index]}if(!(slen>length-index)){var sindex=index;for(index+=slen;rlen>0&&0===sig[rindex];rlen-=1,rindex+=1);if(!(rlen>32)){var rvalue=sig.slice(rindex,rindex+rlen);for(rvalue.copy(r,32-rvalue.length);slen>0&&0===sig[sindex];slen-=1,sindex+=1);if(!(slen>32)){var svalue=sig.slice(sindex,sindex+slen);return svalue.copy(s,32-svalue.length),{r:r,s:s}}}}}}}}}},function(module,exports,__webpack_require__){"use strict";function loadCompressedPublicKey(first,xBuffer){var x=new BN(xBuffer);if(x.cmp(ecparams.p)>=0)return null;x=x.toRed(ecparams.red);var y=x.redSqr().redIMul(x).redIAdd(ecparams.b).redSqrt();return 3===first!==y.isOdd()&&(y=y.redNeg()),ec.keyPair({pub:{x:x,y:y}})}function loadUncompressedPublicKey(first,xBuffer,yBuffer){var x=new BN(xBuffer),y=new BN(yBuffer);if(x.cmp(ecparams.p)>=0||y.cmp(ecparams.p)>=0)return null;if(x=x.toRed(ecparams.red),y=y.toRed(ecparams.red),(6===first||7===first)&&y.isOdd()!==(7===first))return null;var x3=x.redSqr().redIMul(x);return y.redSqr().redISub(x3.redIAdd(ecparams.b)).isZero()?ec.keyPair({pub:{x:x,y:y}}):null}function loadPublicKey(publicKey){var first=publicKey[0];switch(first){case 2:case 3:return 33!==publicKey.length?null:loadCompressedPublicKey(first,publicKey.slice(1,33));case 4:case 6:case 7:return 65!==publicKey.length?null:loadUncompressedPublicKey(first,publicKey.slice(1,33),publicKey.slice(33,65));default:return null}}var Buffer=__webpack_require__(6).Buffer,createHash=__webpack_require__(59),BN=__webpack_require__(14),EC=__webpack_require__(20).ec,messages=__webpack_require__(121),ec=new EC("secp256k1"),ecparams=ec.curve;exports.privateKeyVerify=function(privateKey){var bn=new BN(privateKey);return bn.cmp(ecparams.n)<0&&!bn.isZero()},exports.privateKeyExport=function(privateKey,compressed){var d=new BN(privateKey);if(d.cmp(ecparams.n)>=0||d.isZero())throw new Error(messages.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return Buffer.from(ec.keyFromPrivate(privateKey).getPublic(compressed,!0))},exports.privateKeyTweakAdd=function(privateKey,tweak){var bn=new BN(tweak);if(bn.cmp(ecparams.n)>=0)throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(bn.iadd(new BN(privateKey)),bn.cmp(ecparams.n)>=0&&bn.isub(ecparams.n),bn.isZero())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return bn.toArrayLike(Buffer,"be",32)},exports.privateKeyTweakMul=function(privateKey,tweak){var bn=new BN(tweak);if(bn.cmp(ecparams.n)>=0||bn.isZero())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);return bn.imul(new BN(privateKey)),bn.cmp(ecparams.n)&&(bn=bn.umod(ecparams.n)),bn.toArrayLike(Buffer,"be",32)},exports.publicKeyCreate=function(privateKey,compressed){var d=new BN(privateKey);if(d.cmp(ecparams.n)>=0||d.isZero())throw new Error(messages.EC_PUBLIC_KEY_CREATE_FAIL);return Buffer.from(ec.keyFromPrivate(privateKey).getPublic(compressed,!0))},exports.publicKeyConvert=function(publicKey,compressed){var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);return Buffer.from(pair.getPublic(compressed,!0))},exports.publicKeyVerify=function(publicKey){return null!==loadPublicKey(publicKey)},exports.publicKeyTweakAdd=function(publicKey,tweak,compressed){var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);if(tweak=new BN(tweak),tweak.cmp(ecparams.n)>=0)throw new Error(messages.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return Buffer.from(ecparams.g.mul(tweak).add(pair.pub).encode(!0,compressed))},exports.publicKeyTweakMul=function(publicKey,tweak,compressed){var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);if(tweak=new BN(tweak),tweak.cmp(ecparams.n)>=0||tweak.isZero())throw new Error(messages.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return Buffer.from(pair.pub.mul(tweak).encode(!0,compressed))},exports.publicKeyCombine=function(publicKeys,compressed){for(var pairs=new Array(publicKeys.length),i=0;i=0||s.cmp(ecparams.n)>=0)throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);var result=Buffer.from(signature);return 1===s.cmp(ec.nh)&&ecparams.n.sub(s).toArrayLike(Buffer,"be",32).copy(result,32),result},exports.signatureExport=function(signature){var r=signature.slice(0,32),s=signature.slice(32,64);if(new BN(r).cmp(ecparams.n)>=0||new BN(s).cmp(ecparams.n)>=0)throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);return{r:r,s:s}},exports.signatureImport=function(sigObj){var r=new BN(sigObj.r);r.cmp(ecparams.n)>=0&&(r=new BN(0));var s=new BN(sigObj.s);return s.cmp(ecparams.n)>=0&&(s=new BN(0)),Buffer.concat([r.toArrayLike(Buffer,"be",32),s.toArrayLike(Buffer,"be",32)])},exports.sign=function(message,privateKey,noncefn,data){if("function"==typeof noncefn){var getNonce=noncefn;noncefn=function(counter){var nonce=getNonce(message,privateKey,null,data,counter);if(!Buffer.isBuffer(nonce)||32!==nonce.length)throw new Error(messages.ECDSA_SIGN_FAIL);return new BN(nonce)}}var d=new BN(privateKey);if(d.cmp(ecparams.n)>=0||d.isZero())throw new Error(messages.ECDSA_SIGN_FAIL);var result=ec.sign(message,privateKey,{canonical:!0,k:noncefn,pers:data});return{signature:Buffer.concat([result.r.toArrayLike(Buffer,"be",32),result.s.toArrayLike(Buffer,"be",32)]),recovery:result.recoveryParam}},exports.verify=function(message,signature,publicKey){var sigObj={r:signature.slice(0,32),s:signature.slice(32,64)},sigr=new BN(sigObj.r),sigs=new BN(sigObj.s);if(sigr.cmp(ecparams.n)>=0||sigs.cmp(ecparams.n)>=0)throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);if(1===sigs.cmp(ec.nh)||sigr.isZero()||sigs.isZero())return!1;var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);return ec.verify(message,sigObj,{x:pair.pub.x,y:pair.pub.y})},exports.recover=function(message,signature,recovery,compressed){var sigObj={r:signature.slice(0,32),s:signature.slice(32,64)},sigr=new BN(sigObj.r),sigs=new BN(sigObj.s);if(sigr.cmp(ecparams.n)>=0||sigs.cmp(ecparams.n)>=0)throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);try{if(sigr.isZero()||sigs.isZero())throw new Error;var point=ec.recoverPubKey(message,sigObj,recovery);return Buffer.from(point.encode(!0,compressed))}catch(err){throw new Error(messages.ECDSA_RECOVER_FAIL)}},exports.ecdh=function(publicKey,privateKey){var shared=exports.ecdhUnsafe(publicKey,privateKey,!0);return createHash("sha256").update(shared).digest()},exports.ecdhUnsafe=function(publicKey,privateKey,compressed){var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);var scalar=new BN(privateKey);if(scalar.cmp(ecparams.n)>=0||scalar.isZero())throw new Error(messages.ECDH_FAIL);return Buffer.from(pair.pub.mul(scalar).encode(!0,compressed))}},function(module,exports,__webpack_require__){"use strict";exports.umulTo10x10=function(num1,num2,out){var lo,mid,hi,a=num1.words,b=num2.words,o=out.words,c=0,a0=0|a[0],al0=8191&a0,ah0=a0>>>13,a1=0|a[1],al1=8191&a1,ah1=a1>>>13,a2=0|a[2],al2=8191&a2,ah2=a2>>>13,a3=0|a[3],al3=8191&a3,ah3=a3>>>13,a4=0|a[4],al4=8191&a4,ah4=a4>>>13,a5=0|a[5],al5=8191&a5,ah5=a5>>>13,a6=0|a[6],al6=8191&a6,ah6=a6>>>13,a7=0|a[7],al7=8191&a7,ah7=a7>>>13,a8=0|a[8],al8=8191&a8,ah8=a8>>>13,a9=0|a[9],al9=8191&a9,ah9=a9>>>13,b0=0|b[0],bl0=8191&b0,bh0=b0>>>13,b1=0|b[1],bl1=8191&b1,bh1=b1>>>13,b2=0|b[2],bl2=8191&b2,bh2=b2>>>13,b3=0|b[3],bl3=8191&b3,bh3=b3>>>13,b4=0|b[4],bl4=8191&b4,bh4=b4>>>13,b5=0|b[5],bl5=8191&b5,bh5=b5>>>13,b6=0|b[6],bl6=8191&b6,bh6=b6>>>13,b7=0|b[7],bl7=8191&b7,bh7=b7>>>13,b8=0|b[8],bl8=8191&b8,bh8=b8>>>13,b9=0|b[9],bl9=8191&b9,bh9=b9>>>13;out.length=19,lo=Math.imul(al0,bl0),mid=Math.imul(al0,bh0),mid+=Math.imul(ah0,bl0),hi=Math.imul(ah0,bh0);var w0=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w0>>>26),w0&=67108863,lo=Math.imul(al1,bl0),mid=Math.imul(al1,bh0),mid+=Math.imul(ah1,bl0),hi=Math.imul(ah1,bh0),lo+=Math.imul(al0,bl1),mid+=Math.imul(al0,bh1),mid+=Math.imul(ah0,bl1),hi+=Math.imul(ah0,bh1);var w1=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w1>>>26),w1&=67108863,lo=Math.imul(al2,bl0),mid=Math.imul(al2,bh0),mid+=Math.imul(ah2,bl0),hi=Math.imul(ah2,bh0),lo+=Math.imul(al1,bl1),mid+=Math.imul(al1,bh1),mid+=Math.imul(ah1,bl1),hi+=Math.imul(ah1,bh1),lo+=Math.imul(al0,bl2),mid+=Math.imul(al0,bh2),mid+=Math.imul(ah0,bl2),hi+=Math.imul(ah0,bh2);var w2=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w2>>>26),w2&=67108863,lo=Math.imul(al3,bl0),mid=Math.imul(al3,bh0),mid+=Math.imul(ah3,bl0),hi=Math.imul(ah3,bh0),lo+=Math.imul(al2,bl1),mid+=Math.imul(al2,bh1),mid+=Math.imul(ah2,bl1),hi+=Math.imul(ah2,bh1),lo+=Math.imul(al1,bl2),mid+=Math.imul(al1,bh2),mid+=Math.imul(ah1,bl2),hi+=Math.imul(ah1,bh2),lo+=Math.imul(al0,bl3),mid+=Math.imul(al0,bh3),mid+=Math.imul(ah0,bl3),hi+=Math.imul(ah0,bh3);var w3=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w3>>>26),w3&=67108863,lo=Math.imul(al4,bl0),mid=Math.imul(al4,bh0),mid+=Math.imul(ah4,bl0),hi=Math.imul(ah4,bh0),lo+=Math.imul(al3,bl1),mid+=Math.imul(al3,bh1),mid+=Math.imul(ah3,bl1),hi+=Math.imul(ah3,bh1),lo+=Math.imul(al2,bl2),mid+=Math.imul(al2,bh2),mid+=Math.imul(ah2,bl2),hi+=Math.imul(ah2,bh2),lo+=Math.imul(al1,bl3),mid+=Math.imul(al1,bh3),mid+=Math.imul(ah1,bl3),hi+=Math.imul(ah1,bh3),lo+=Math.imul(al0,bl4),mid+=Math.imul(al0,bh4),mid+=Math.imul(ah0,bl4),hi+=Math.imul(ah0,bh4);var w4=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w4>>>26),w4&=67108863,lo=Math.imul(al5,bl0),mid=Math.imul(al5,bh0),mid+=Math.imul(ah5,bl0),hi=Math.imul(ah5,bh0),lo+=Math.imul(al4,bl1),mid+=Math.imul(al4,bh1),mid+=Math.imul(ah4,bl1),hi+=Math.imul(ah4,bh1),lo+=Math.imul(al3,bl2),mid+=Math.imul(al3,bh2),mid+=Math.imul(ah3,bl2),hi+=Math.imul(ah3,bh2),lo+=Math.imul(al2,bl3),mid+=Math.imul(al2,bh3),mid+=Math.imul(ah2,bl3),hi+=Math.imul(ah2,bh3),lo+=Math.imul(al1,bl4),mid+=Math.imul(al1,bh4),mid+=Math.imul(ah1,bl4),hi+=Math.imul(ah1,bh4),lo+=Math.imul(al0,bl5),mid+=Math.imul(al0,bh5),mid+=Math.imul(ah0,bl5),hi+=Math.imul(ah0,bh5);var w5=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w5>>>26),w5&=67108863,lo=Math.imul(al6,bl0),mid=Math.imul(al6,bh0),mid+=Math.imul(ah6,bl0),hi=Math.imul(ah6,bh0),lo+=Math.imul(al5,bl1),mid+=Math.imul(al5,bh1),mid+=Math.imul(ah5,bl1),hi+=Math.imul(ah5,bh1),lo+=Math.imul(al4,bl2),mid+=Math.imul(al4,bh2),mid+=Math.imul(ah4,bl2),hi+=Math.imul(ah4,bh2),lo+=Math.imul(al3,bl3),mid+=Math.imul(al3,bh3),mid+=Math.imul(ah3,bl3),hi+=Math.imul(ah3,bh3),lo+=Math.imul(al2,bl4),mid+=Math.imul(al2,bh4),mid+=Math.imul(ah2,bl4),hi+=Math.imul(ah2,bh4),lo+=Math.imul(al1,bl5),mid+=Math.imul(al1,bh5),mid+=Math.imul(ah1,bl5),hi+=Math.imul(ah1,bh5),lo+=Math.imul(al0,bl6),mid+=Math.imul(al0,bh6),mid+=Math.imul(ah0,bl6),hi+=Math.imul(ah0,bh6);var w6=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w6>>>26),w6&=67108863,lo=Math.imul(al7,bl0),mid=Math.imul(al7,bh0),mid+=Math.imul(ah7,bl0),hi=Math.imul(ah7,bh0),lo+=Math.imul(al6,bl1),mid+=Math.imul(al6,bh1),mid+=Math.imul(ah6,bl1),hi+=Math.imul(ah6,bh1),lo+=Math.imul(al5,bl2),mid+=Math.imul(al5,bh2),mid+=Math.imul(ah5,bl2),hi+=Math.imul(ah5,bh2),lo+=Math.imul(al4,bl3),mid+=Math.imul(al4,bh3),mid+=Math.imul(ah4,bl3),hi+=Math.imul(ah4,bh3),lo+=Math.imul(al3,bl4),mid+=Math.imul(al3,bh4),mid+=Math.imul(ah3,bl4),hi+=Math.imul(ah3,bh4),lo+=Math.imul(al2,bl5),mid+=Math.imul(al2,bh5),mid+=Math.imul(ah2,bl5),hi+=Math.imul(ah2,bh5),lo+=Math.imul(al1,bl6),mid+=Math.imul(al1,bh6),mid+=Math.imul(ah1,bl6),hi+=Math.imul(ah1,bh6),lo+=Math.imul(al0,bl7),mid+=Math.imul(al0,bh7),mid+=Math.imul(ah0,bl7),hi+=Math.imul(ah0,bh7);var w7=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w7>>>26),w7&=67108863,lo=Math.imul(al8,bl0),mid=Math.imul(al8,bh0),mid+=Math.imul(ah8,bl0),hi=Math.imul(ah8,bh0),lo+=Math.imul(al7,bl1),mid+=Math.imul(al7,bh1),mid+=Math.imul(ah7,bl1),hi+=Math.imul(ah7,bh1),lo+=Math.imul(al6,bl2),mid+=Math.imul(al6,bh2),mid+=Math.imul(ah6,bl2),hi+=Math.imul(ah6,bh2),lo+=Math.imul(al5,bl3),mid+=Math.imul(al5,bh3),mid+=Math.imul(ah5,bl3),hi+=Math.imul(ah5,bh3),lo+=Math.imul(al4,bl4),mid+=Math.imul(al4,bh4),mid+=Math.imul(ah4,bl4),hi+=Math.imul(ah4,bh4),lo+=Math.imul(al3,bl5),mid+=Math.imul(al3,bh5),mid+=Math.imul(ah3,bl5),hi+=Math.imul(ah3,bh5),lo+=Math.imul(al2,bl6),mid+=Math.imul(al2,bh6),mid+=Math.imul(ah2,bl6),hi+=Math.imul(ah2,bh6),lo+=Math.imul(al1,bl7),mid+=Math.imul(al1,bh7),mid+=Math.imul(ah1,bl7),hi+=Math.imul(ah1,bh7),lo+=Math.imul(al0,bl8),mid+=Math.imul(al0,bh8),mid+=Math.imul(ah0,bl8),hi+=Math.imul(ah0,bh8);var w8=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w8>>>26),w8&=67108863,lo=Math.imul(al9,bl0),mid=Math.imul(al9,bh0),mid+=Math.imul(ah9,bl0),hi=Math.imul(ah9,bh0),lo+=Math.imul(al8,bl1),mid+=Math.imul(al8,bh1),mid+=Math.imul(ah8,bl1),hi+=Math.imul(ah8,bh1),lo+=Math.imul(al7,bl2),mid+=Math.imul(al7,bh2),mid+=Math.imul(ah7,bl2),hi+=Math.imul(ah7,bh2),lo+=Math.imul(al6,bl3),mid+=Math.imul(al6,bh3),mid+=Math.imul(ah6,bl3),hi+=Math.imul(ah6,bh3),lo+=Math.imul(al5,bl4),mid+=Math.imul(al5,bh4),mid+=Math.imul(ah5,bl4),hi+=Math.imul(ah5,bh4),lo+=Math.imul(al4,bl5),mid+=Math.imul(al4,bh5),mid+=Math.imul(ah4,bl5),hi+=Math.imul(ah4,bh5),lo+=Math.imul(al3,bl6),mid+=Math.imul(al3,bh6),mid+=Math.imul(ah3,bl6),hi+=Math.imul(ah3,bh6),lo+=Math.imul(al2,bl7),mid+=Math.imul(al2,bh7),mid+=Math.imul(ah2,bl7),hi+=Math.imul(ah2,bh7),lo+=Math.imul(al1,bl8),mid+=Math.imul(al1,bh8),mid+=Math.imul(ah1,bl8),hi+=Math.imul(ah1,bh8),lo+=Math.imul(al0,bl9),mid+=Math.imul(al0,bh9),mid+=Math.imul(ah0,bl9),hi+=Math.imul(ah0,bh9);var w9=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w9>>>26),w9&=67108863,lo=Math.imul(al9,bl1),mid=Math.imul(al9,bh1),mid+=Math.imul(ah9,bl1),hi=Math.imul(ah9,bh1),lo+=Math.imul(al8,bl2),mid+=Math.imul(al8,bh2),mid+=Math.imul(ah8,bl2),hi+=Math.imul(ah8,bh2),lo+=Math.imul(al7,bl3),mid+=Math.imul(al7,bh3),mid+=Math.imul(ah7,bl3),hi+=Math.imul(ah7,bh3),lo+=Math.imul(al6,bl4),mid+=Math.imul(al6,bh4),mid+=Math.imul(ah6,bl4),hi+=Math.imul(ah6,bh4),lo+=Math.imul(al5,bl5),mid+=Math.imul(al5,bh5),mid+=Math.imul(ah5,bl5),hi+=Math.imul(ah5,bh5),lo+=Math.imul(al4,bl6),mid+=Math.imul(al4,bh6),mid+=Math.imul(ah4,bl6),hi+=Math.imul(ah4,bh6),lo+=Math.imul(al3,bl7),mid+=Math.imul(al3,bh7),mid+=Math.imul(ah3,bl7),hi+=Math.imul(ah3,bh7),lo+=Math.imul(al2,bl8),mid+=Math.imul(al2,bh8),mid+=Math.imul(ah2,bl8),hi+=Math.imul(ah2,bh8),lo+=Math.imul(al1,bl9),mid+=Math.imul(al1,bh9),mid+=Math.imul(ah1,bl9),hi+=Math.imul(ah1,bh9);var w10=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w10>>>26),w10&=67108863,lo=Math.imul(al9,bl2),mid=Math.imul(al9,bh2),mid+=Math.imul(ah9,bl2),hi=Math.imul(ah9,bh2),lo+=Math.imul(al8,bl3),mid+=Math.imul(al8,bh3),mid+=Math.imul(ah8,bl3),hi+=Math.imul(ah8,bh3),lo+=Math.imul(al7,bl4),mid+=Math.imul(al7,bh4),mid+=Math.imul(ah7,bl4),hi+=Math.imul(ah7,bh4),lo+=Math.imul(al6,bl5),mid+=Math.imul(al6,bh5),mid+=Math.imul(ah6,bl5),hi+=Math.imul(ah6,bh5),lo+=Math.imul(al5,bl6),mid+=Math.imul(al5,bh6),mid+=Math.imul(ah5,bl6),hi+=Math.imul(ah5,bh6),lo+=Math.imul(al4,bl7),mid+=Math.imul(al4,bh7),mid+=Math.imul(ah4,bl7),hi+=Math.imul(ah4,bh7),lo+=Math.imul(al3,bl8),mid+=Math.imul(al3,bh8),mid+=Math.imul(ah3,bl8),hi+=Math.imul(ah3,bh8),lo+=Math.imul(al2,bl9),mid+=Math.imul(al2,bh9),mid+=Math.imul(ah2,bl9),hi+=Math.imul(ah2,bh9);var w11=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w11>>>26),w11&=67108863,lo=Math.imul(al9,bl3),mid=Math.imul(al9,bh3),mid+=Math.imul(ah9,bl3),hi=Math.imul(ah9,bh3),lo+=Math.imul(al8,bl4),mid+=Math.imul(al8,bh4),mid+=Math.imul(ah8,bl4),hi+=Math.imul(ah8,bh4),lo+=Math.imul(al7,bl5),mid+=Math.imul(al7,bh5),mid+=Math.imul(ah7,bl5),hi+=Math.imul(ah7,bh5),lo+=Math.imul(al6,bl6),mid+=Math.imul(al6,bh6),mid+=Math.imul(ah6,bl6),hi+=Math.imul(ah6,bh6),lo+=Math.imul(al5,bl7),mid+=Math.imul(al5,bh7),mid+=Math.imul(ah5,bl7),hi+=Math.imul(ah5,bh7),lo+=Math.imul(al4,bl8),mid+=Math.imul(al4,bh8),mid+=Math.imul(ah4,bl8),hi+=Math.imul(ah4,bh8),lo+=Math.imul(al3,bl9),mid+=Math.imul(al3,bh9),mid+=Math.imul(ah3,bl9),hi+=Math.imul(ah3,bh9);var w12=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w12>>>26),w12&=67108863,lo=Math.imul(al9,bl4),mid=Math.imul(al9,bh4),mid+=Math.imul(ah9,bl4),hi=Math.imul(ah9,bh4),lo+=Math.imul(al8,bl5),mid+=Math.imul(al8,bh5),mid+=Math.imul(ah8,bl5),hi+=Math.imul(ah8,bh5),lo+=Math.imul(al7,bl6), +mid+=Math.imul(al7,bh6),mid+=Math.imul(ah7,bl6),hi+=Math.imul(ah7,bh6),lo+=Math.imul(al6,bl7),mid+=Math.imul(al6,bh7),mid+=Math.imul(ah6,bl7),hi+=Math.imul(ah6,bh7),lo+=Math.imul(al5,bl8),mid+=Math.imul(al5,bh8),mid+=Math.imul(ah5,bl8),hi+=Math.imul(ah5,bh8),lo+=Math.imul(al4,bl9),mid+=Math.imul(al4,bh9),mid+=Math.imul(ah4,bl9),hi+=Math.imul(ah4,bh9);var w13=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w13>>>26),w13&=67108863,lo=Math.imul(al9,bl5),mid=Math.imul(al9,bh5),mid+=Math.imul(ah9,bl5),hi=Math.imul(ah9,bh5),lo+=Math.imul(al8,bl6),mid+=Math.imul(al8,bh6),mid+=Math.imul(ah8,bl6),hi+=Math.imul(ah8,bh6),lo+=Math.imul(al7,bl7),mid+=Math.imul(al7,bh7),mid+=Math.imul(ah7,bl7),hi+=Math.imul(ah7,bh7),lo+=Math.imul(al6,bl8),mid+=Math.imul(al6,bh8),mid+=Math.imul(ah6,bl8),hi+=Math.imul(ah6,bh8),lo+=Math.imul(al5,bl9),mid+=Math.imul(al5,bh9),mid+=Math.imul(ah5,bl9),hi+=Math.imul(ah5,bh9);var w14=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w14>>>26),w14&=67108863,lo=Math.imul(al9,bl6),mid=Math.imul(al9,bh6),mid+=Math.imul(ah9,bl6),hi=Math.imul(ah9,bh6),lo+=Math.imul(al8,bl7),mid+=Math.imul(al8,bh7),mid+=Math.imul(ah8,bl7),hi+=Math.imul(ah8,bh7),lo+=Math.imul(al7,bl8),mid+=Math.imul(al7,bh8),mid+=Math.imul(ah7,bl8),hi+=Math.imul(ah7,bh8),lo+=Math.imul(al6,bl9),mid+=Math.imul(al6,bh9),mid+=Math.imul(ah6,bl9),hi+=Math.imul(ah6,bh9);var w15=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w15>>>26),w15&=67108863,lo=Math.imul(al9,bl7),mid=Math.imul(al9,bh7),mid+=Math.imul(ah9,bl7),hi=Math.imul(ah9,bh7),lo+=Math.imul(al8,bl8),mid+=Math.imul(al8,bh8),mid+=Math.imul(ah8,bl8),hi+=Math.imul(ah8,bh8),lo+=Math.imul(al7,bl9),mid+=Math.imul(al7,bh9),mid+=Math.imul(ah7,bl9),hi+=Math.imul(ah7,bh9);var w16=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w16>>>26),w16&=67108863,lo=Math.imul(al9,bl8),mid=Math.imul(al9,bh8),mid+=Math.imul(ah9,bl8),hi=Math.imul(ah9,bh8),lo+=Math.imul(al8,bl9),mid+=Math.imul(al8,bh9),mid+=Math.imul(ah8,bl9),hi+=Math.imul(ah8,bh9);var w17=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w17>>>26),w17&=67108863,lo=Math.imul(al9,bl9),mid=Math.imul(al9,bh9),mid+=Math.imul(ah9,bl9),hi=Math.imul(ah9,bh9);var w18=c+lo+((8191&mid)<<13);return c=hi+(mid>>>13)+(w18>>>26),w18&=67108863,o[0]=w0,o[1]=w1,o[2]=w2,o[3]=w3,o[4]=w4,o[5]=w5,o[6]=w6,o[7]=w7,o[8]=w8,o[9]=w9,o[10]=w10,o[11]=w11,o[12]=w12,o[13]=w13,o[14]=w14,o[15]=w15,o[16]=w16,o[17]=w17,o[18]=w18,0!==c&&(o[19]=c,out.length++),out}},function(module,exports,__webpack_require__){"use strict";function ECPointG(){this.x=BN.fromBuffer(Buffer.from("79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","hex")),this.y=BN.fromBuffer(Buffer.from("483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8","hex")),this.inf=!1,this._precompute()}var Buffer=__webpack_require__(6).Buffer,BN=__webpack_require__(100),ECPoint=__webpack_require__(265),ECJPoint=__webpack_require__(264);ECPointG.prototype._precompute=function(){for(var ecpoint=new ECPoint(this.x,this.y),points=new Array(1+Math.ceil(64.25)),acc=points[0]=ecpoint,i=1;i=j;k--)nafW=(nafW<<1)+naf[k];repr.push(nafW)}for(var a=new ECJPoint(null,null,null),b=new ECJPoint(null,null,null),i=I;i>0;i--){for(var jj=0;jj=0;i--){for(var k=0;i>=0&&(tmp[0]=0|naf[0][i],tmp[1]=0|naf[1][i],0===tmp[0]&&0===tmp[1]);++k,--i);if(i>=0&&(k+=1),acc=acc.dblp(k),i<0)break;for(var jj=0;jj<2;jj++){var p,z=tmp[jj];0!==z&&(z>0?p=wnd[jj][z>>1]:z<0&&(p=wnd[jj][-z>>1].neg()),acc=void 0===p.z?acc.mixedAdd(p):acc.add(p))}}return acc},module.exports=new ECPointG},function(module,exports,__webpack_require__){"use strict";var Buffer=__webpack_require__(6).Buffer,createHash=__webpack_require__(59),HmacDRBG=__webpack_require__(336),messages=__webpack_require__(121),BN=__webpack_require__(100),ECPoint=__webpack_require__(265),g=__webpack_require__(649);exports.privateKeyVerify=function(privateKey){var bn=BN.fromBuffer(privateKey);return!(bn.isOverflow()||bn.isZero())},exports.privateKeyExport=function(privateKey,compressed){var d=BN.fromBuffer(privateKey);if(d.isOverflow()||d.isZero())throw new Error(messages.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return g.mul(d).toPublicKey(compressed)},exports.privateKeyTweakAdd=function(privateKey,tweak){var bn=BN.fromBuffer(tweak);if(bn.isOverflow())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(bn.iadd(BN.fromBuffer(privateKey)),bn.isOverflow()&&bn.isub(BN.n),bn.isZero())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return bn.toBuffer()},exports.privateKeyTweakMul=function(privateKey,tweak){var bn=BN.fromBuffer(tweak);if(bn.isOverflow()||bn.isZero())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);var d=BN.fromBuffer(privateKey);return bn.umul(d).ureduce().toBuffer()},exports.publicKeyCreate=function(privateKey,compressed){var d=BN.fromBuffer(privateKey);if(d.isOverflow()||d.isZero())throw new Error(messages.EC_PUBLIC_KEY_CREATE_FAIL);return g.mul(d).toPublicKey(compressed)},exports.publicKeyConvert=function(publicKey,compressed){var point=ECPoint.fromPublicKey(publicKey);if(null===point)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);return point.toPublicKey(compressed)},exports.publicKeyVerify=function(publicKey){return null!==ECPoint.fromPublicKey(publicKey)},exports.publicKeyTweakAdd=function(publicKey,tweak,compressed){var point=ECPoint.fromPublicKey(publicKey);if(null===point)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);if(tweak=BN.fromBuffer(tweak),tweak.isOverflow())throw new Error(messages.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return g.mul(tweak).add(point).toPublicKey(compressed)},exports.publicKeyTweakMul=function(publicKey,tweak,compressed){var point=ECPoint.fromPublicKey(publicKey);if(null===point)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);if(tweak=BN.fromBuffer(tweak),tweak.isOverflow()||tweak.isZero())throw new Error(messages.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return point.mul(tweak).toPublicKey(compressed)},exports.publicKeyCombine=function(publicKeys,compressed){for(var points=new Array(publicKeys.length),i=0;i=0)&&0===sigr.iadd(BN.psn).redMul(z2).ucmp(point.x)},exports.recover=function(message,signature,recovery,compressed){var sigr=BN.fromBuffer(signature.slice(0,32)),sigs=BN.fromBuffer(signature.slice(32,64));if(sigr.isOverflow()||sigs.isOverflow())throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);do{if(sigr.isZero()||sigs.isZero())break;var kpx=sigr;if(recovery>>1){if(kpx.ucmp(BN.psn)>=0)break;kpx=sigr.add(BN.n)}var kpPublicKey=Buffer.concat([Buffer.from([2+(1&recovery)]),kpx.toBuffer()]),kp=ECPoint.fromPublicKey(kpPublicKey);if(null===kp)break;var rInv=sigr.uinvm(),s1=BN.n.sub(BN.fromBuffer(message)).umul(rInv).ureduce(),s2=sigs.umul(rInv).ureduce();return ECPoint.fromECJPoint(g.mulAdd(s1,kp,s2)).toPublicKey(compressed)}while(!1);throw new Error(messages.ECDSA_RECOVER_FAIL)},exports.ecdh=function(publicKey,privateKey){var shared=exports.ecdhUnsafe(publicKey,privateKey,!0);return createHash("sha256").update(shared).digest()},exports.ecdhUnsafe=function(publicKey,privateKey,compressed){var point=ECPoint.fromPublicKey(publicKey);if(null===point)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);var scalar=BN.fromBuffer(privateKey);if(scalar.isOverflow()||scalar.isZero())throw new Error(messages.ECDH_FAIL);return point.mul(scalar).toPublicKey(compressed)}},function(module,exports,__webpack_require__){(function(process){function parse(version,loose){if(version instanceof SemVer)return version;if("string"!=typeof version)return null;if(version.length>MAX_LENGTH)return null;if(!(loose?re[LOOSE]:re[FULL]).test(version))return null;try{return new SemVer(version,loose)}catch(er){return null}}function valid(version,loose){var v=parse(version,loose);return v?v.version:null}function clean(version,loose){var s=parse(version.trim().replace(/^[=v]+/,""),loose);return s?s.version:null}function SemVer(version,loose){if(version instanceof SemVer){if(version.loose===loose)return version;version=version.version}else if("string"!=typeof version)throw new TypeError("Invalid Version: "+version);if(version.length>MAX_LENGTH)throw new TypeError("version is longer than "+MAX_LENGTH+" characters");if(!(this instanceof SemVer))return new SemVer(version,loose);debug("SemVer",version,loose),this.loose=loose;var m=version.trim().match(loose?re[LOOSE]:re[FULL]);if(!m)throw new TypeError("Invalid Version: "+version);if(this.raw=version,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>MAX_SAFE_INTEGER||this.major<0)throw new TypeError("Invalid major version");if(this.minor>MAX_SAFE_INTEGER||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>MAX_SAFE_INTEGER||this.patch<0)throw new TypeError("Invalid patch version");m[4]?this.prerelease=m[4].split(".").map(function(id){if(/^[0-9]+$/.test(id)){var num=+id;if(num>=0&&numb?1:0}function rcompareIdentifiers(a,b){return compareIdentifiers(b,a)}function major(a,loose){return new SemVer(a,loose).major}function minor(a,loose){return new SemVer(a,loose).minor}function patch(a,loose){return new SemVer(a,loose).patch}function compare(a,b,loose){return new SemVer(a,loose).compare(new SemVer(b,loose))}function compareLoose(a,b){return compare(a,b,!0)}function rcompare(a,b,loose){return compare(b,a,loose)}function sort(list,loose){return list.sort(function(a,b){return exports.compare(a,b,loose)})}function rsort(list,loose){return list.sort(function(a,b){return exports.rcompare(a,b,loose)})}function gt(a,b,loose){return compare(a,b,loose)>0}function lt(a,b,loose){return compare(a,b,loose)<0}function eq(a,b,loose){return 0===compare(a,b,loose)}function neq(a,b,loose){return 0!==compare(a,b,loose)}function gte(a,b,loose){return compare(a,b,loose)>=0}function lte(a,b,loose){return compare(a,b,loose)<=0}function cmp(a,op,b,loose){var ret;switch(op){case"===":"object"==typeof a&&(a=a.version),"object"==typeof b&&(b=b.version),ret=a===b;break;case"!==":"object"==typeof a&&(a=a.version),"object"==typeof b&&(b=b.version),ret=a!==b;break;case"":case"=":case"==":ret=eq(a,b,loose);break;case"!=":ret=neq(a,b,loose);break;case">":ret=gt(a,b,loose);break;case">=":ret=gte(a,b,loose);break;case"<":ret=lt(a,b,loose);break;case"<=":ret=lte(a,b,loose);break;default:throw new TypeError("Invalid operator: "+op)}return ret}function Comparator(comp,loose){if(comp instanceof Comparator){if(comp.loose===loose)return comp;comp=comp.value}if(!(this instanceof Comparator))return new Comparator(comp,loose);debug("comparator",comp,loose),this.loose=loose,this.parse(comp),this.semver===ANY?this.value="":this.value=this.operator+this.semver.version,debug("comp",this)}function Range(range,loose){if(range instanceof Range)return range.loose===loose?range:new Range(range.raw,loose);if(range instanceof Comparator)return new Range(range.value,loose);if(!(this instanceof Range))return new Range(range,loose);if(this.loose=loose,this.raw=range,this.set=range.split(/\s*\|\|\s*/).map(function(range){return this.parseRange(range.trim())},this).filter(function(c){return c.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+range);this.format()}function toComparators(range,loose){return new Range(range,loose).set.map(function(comp){return comp.map(function(c){return c.value}).join(" ").trim().split(" ")})}function parseComparator(comp,loose){return debug("comp",comp),comp=replaceCarets(comp,loose),debug("caret",comp),comp=replaceTildes(comp,loose),debug("tildes",comp),comp=replaceXRanges(comp,loose),debug("xrange",comp),comp=replaceStars(comp,loose),debug("stars",comp),comp}function isX(id){return!id||"x"===id.toLowerCase()||"*"===id}function replaceTildes(comp,loose){return comp.trim().split(/\s+/).map(function(comp){return replaceTilde(comp,loose)}).join(" ")}function replaceTilde(comp,loose){var r=loose?re[TILDELOOSE]:re[TILDE];return comp.replace(r,function(_,M,m,p,pr){debug("tilde",comp,_,M,m,p,pr);var ret;return isX(M)?ret="":isX(m)?ret=">="+M+".0.0 <"+(+M+1)+".0.0":isX(p)?ret=">="+M+"."+m+".0 <"+M+"."+(+m+1)+".0":pr?(debug("replaceTilde pr",pr),"-"!==pr.charAt(0)&&(pr="-"+pr),ret=">="+M+"."+m+"."+p+pr+" <"+M+"."+(+m+1)+".0"):ret=">="+M+"."+m+"."+p+" <"+M+"."+(+m+1)+".0",debug("tilde return",ret),ret})}function replaceCarets(comp,loose){return comp.trim().split(/\s+/).map(function(comp){return replaceCaret(comp,loose)}).join(" ")}function replaceCaret(comp,loose){debug("caret",comp,loose);var r=loose?re[CARETLOOSE]:re[CARET];return comp.replace(r,function(_,M,m,p,pr){debug("caret",comp,_,M,m,p,pr);var ret;return isX(M)?ret="":isX(m)?ret=">="+M+".0.0 <"+(+M+1)+".0.0":isX(p)?ret="0"===M?">="+M+"."+m+".0 <"+M+"."+(+m+1)+".0":">="+M+"."+m+".0 <"+(+M+1)+".0.0":pr?(debug("replaceCaret pr",pr),"-"!==pr.charAt(0)&&(pr="-"+pr),ret="0"===M?"0"===m?">="+M+"."+m+"."+p+pr+" <"+M+"."+m+"."+(+p+1):">="+M+"."+m+"."+p+pr+" <"+M+"."+(+m+1)+".0":">="+M+"."+m+"."+p+pr+" <"+(+M+1)+".0.0"):(debug("no pr"),ret="0"===M?"0"===m?">="+M+"."+m+"."+p+" <"+M+"."+m+"."+(+p+1):">="+M+"."+m+"."+p+" <"+M+"."+(+m+1)+".0":">="+M+"."+m+"."+p+" <"+(+M+1)+".0.0"),debug("caret return",ret),ret})}function replaceXRanges(comp,loose){return debug("replaceXRanges",comp,loose),comp.split(/\s+/).map(function(comp){return replaceXRange(comp,loose)}).join(" ")}function replaceXRange(comp,loose){comp=comp.trim();var r=loose?re[XRANGELOOSE]:re[XRANGE];return comp.replace(r,function(ret,gtlt,M,m,p,pr){debug("xRange",comp,ret,gtlt,M,m,p,pr);var xM=isX(M),xm=xM||isX(m),xp=xm||isX(p),anyX=xp;return"="===gtlt&&anyX&&(gtlt=""),xM?ret=">"===gtlt||"<"===gtlt?"<0.0.0":"*":gtlt&&anyX?(xm&&(m=0),xp&&(p=0),">"===gtlt?(gtlt=">=",xm?(M=+M+1,m=0,p=0):xp&&(m=+m+1,p=0)):"<="===gtlt&&(gtlt="<",xm?M=+M+1:m=+m+1),ret=gtlt+M+"."+m+"."+p):xm?ret=">="+M+".0.0 <"+(+M+1)+".0.0":xp&&(ret=">="+M+"."+m+".0 <"+M+"."+(+m+1)+".0"),debug("xRange return",ret),ret})}function replaceStars(comp,loose){return debug("replaceStars",comp,loose),comp.trim().replace(re[STAR],"")}function hyphenReplace($0,from,fM,fm,fp,fpr,fb,to,tM,tm,tp,tpr,tb){return from=isX(fM)?"":isX(fm)?">="+fM+".0.0":isX(fp)?">="+fM+"."+fm+".0":">="+from,to=isX(tM)?"":isX(tm)?"<"+(+tM+1)+".0.0":isX(tp)?"<"+tM+"."+(+tm+1)+".0":tpr?"<="+tM+"."+tm+"."+tp+"-"+tpr:"<="+to,(from+" "+to).trim()}function testSet(set,version){for(var i=0;i0){var allowed=set[i].semver;if(allowed.major===version.major&&allowed.minor===version.minor&&allowed.patch===version.patch)return!0}return!1}return!0}function satisfies(version,range,loose){try{range=new Range(range,loose)}catch(er){return!1}return range.test(version)}function maxSatisfying(versions,range,loose){var max=null,maxSV=null;try{var rangeObj=new Range(range,loose)}catch(er){return null}return versions.forEach(function(v){rangeObj.test(v)&&(max&&maxSV.compare(v)!==-1||(max=v,maxSV=new SemVer(max,loose)))}),max}function minSatisfying(versions,range,loose){var min=null,minSV=null;try{var rangeObj=new Range(range,loose)}catch(er){return null}return versions.forEach(function(v){rangeObj.test(v)&&(min&&1!==minSV.compare(v)||(min=v,minSV=new SemVer(min,loose)))}),min}function validRange(range,loose){try{return new Range(range,loose).range||"*"}catch(er){return null}}function ltr(version,range,loose){return outside(version,range,"<",loose)}function gtr(version,range,loose){return outside(version,range,">",loose)}function outside(version,range,hilo,loose){version=new SemVer(version,loose),range=new Range(range,loose);var gtfn,ltefn,ltfn,comp,ecomp;switch(hilo){case">":gtfn=gt,ltefn=lte,ltfn=lt,comp=">",ecomp=">=";break;case"<":gtfn=lt,ltefn=gte,ltfn=gt,comp="<",ecomp="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(satisfies(version,range,loose))return!1;for(var i=0;i=0.0.0")),high=high||comparator,low=low||comparator,gtfn(comparator.semver,high.semver,loose)?high=comparator:ltfn(comparator.semver,low.semver,loose)&&(low=comparator)}),high.operator===comp||high.operator===ecomp)return!1;if((!low.operator||low.operator===comp)&<efn(version,low.semver))return!1;if(low.operator===ecomp&<fn(version,low.semver))return!1}return!0}function prerelease(version,loose){var parsed=parse(version,loose);return parsed&&parsed.prerelease.length?parsed.prerelease:null}function intersects(r1,r2,loose){return r1=new Range(r1,loose),r2=new Range(r2,loose),r1.intersects(r2)}exports=module.exports=SemVer;var debug;debug="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var args=Array.prototype.slice.call(arguments,0);args.unshift("SEMVER"),console.log.apply(console,args)}:function(){},exports.SEMVER_SPEC_VERSION="2.0.0";var MAX_LENGTH=256,MAX_SAFE_INTEGER=Number.MAX_SAFE_INTEGER||9007199254740991,re=exports.re=[],src=exports.src=[],R=0,NUMERICIDENTIFIER=R++;src[NUMERICIDENTIFIER]="0|[1-9]\\d*";var NUMERICIDENTIFIERLOOSE=R++;src[NUMERICIDENTIFIERLOOSE]="[0-9]+";var NONNUMERICIDENTIFIER=R++;src[NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var MAINVERSION=R++;src[MAINVERSION]="("+src[NUMERICIDENTIFIER]+")\\.("+src[NUMERICIDENTIFIER]+")\\.("+src[NUMERICIDENTIFIER]+")";var MAINVERSIONLOOSE=R++;src[MAINVERSIONLOOSE]="("+src[NUMERICIDENTIFIERLOOSE]+")\\.("+src[NUMERICIDENTIFIERLOOSE]+")\\.("+src[NUMERICIDENTIFIERLOOSE]+")";var PRERELEASEIDENTIFIER=R++;src[PRERELEASEIDENTIFIER]="(?:"+src[NUMERICIDENTIFIER]+"|"+src[NONNUMERICIDENTIFIER]+")";var PRERELEASEIDENTIFIERLOOSE=R++;src[PRERELEASEIDENTIFIERLOOSE]="(?:"+src[NUMERICIDENTIFIERLOOSE]+"|"+src[NONNUMERICIDENTIFIER]+")";var PRERELEASE=R++;src[PRERELEASE]="(?:-("+src[PRERELEASEIDENTIFIER]+"(?:\\."+src[PRERELEASEIDENTIFIER]+")*))";var PRERELEASELOOSE=R++;src[PRERELEASELOOSE]="(?:-?("+src[PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+src[PRERELEASEIDENTIFIERLOOSE]+")*))";var BUILDIDENTIFIER=R++;src[BUILDIDENTIFIER]="[0-9A-Za-z-]+";var BUILD=R++;src[BUILD]="(?:\\+("+src[BUILDIDENTIFIER]+"(?:\\."+src[BUILDIDENTIFIER]+")*))";var FULL=R++,FULLPLAIN="v?"+src[MAINVERSION]+src[PRERELEASE]+"?"+src[BUILD]+"?";src[FULL]="^"+FULLPLAIN+"$";var LOOSEPLAIN="[v=\\s]*"+src[MAINVERSIONLOOSE]+src[PRERELEASELOOSE]+"?"+src[BUILD]+"?",LOOSE=R++;src[LOOSE]="^"+LOOSEPLAIN+"$";var GTLT=R++;src[GTLT]="((?:<|>)?=?)";var XRANGEIDENTIFIERLOOSE=R++;src[XRANGEIDENTIFIERLOOSE]=src[NUMERICIDENTIFIERLOOSE]+"|x|X|\\*";var XRANGEIDENTIFIER=R++;src[XRANGEIDENTIFIER]=src[NUMERICIDENTIFIER]+"|x|X|\\*";var XRANGEPLAIN=R++;src[XRANGEPLAIN]="[v=\\s]*("+src[XRANGEIDENTIFIER]+")(?:\\.("+src[XRANGEIDENTIFIER]+")(?:\\.("+src[XRANGEIDENTIFIER]+")(?:"+src[PRERELEASE]+")?"+src[BUILD]+"?)?)?";var XRANGEPLAINLOOSE=R++;src[XRANGEPLAINLOOSE]="[v=\\s]*("+src[XRANGEIDENTIFIERLOOSE]+")(?:\\.("+src[XRANGEIDENTIFIERLOOSE]+")(?:\\.("+src[XRANGEIDENTIFIERLOOSE]+")(?:"+src[PRERELEASELOOSE]+")?"+src[BUILD]+"?)?)?";var XRANGE=R++;src[XRANGE]="^"+src[GTLT]+"\\s*"+src[XRANGEPLAIN]+"$";var XRANGELOOSE=R++;src[XRANGELOOSE]="^"+src[GTLT]+"\\s*"+src[XRANGEPLAINLOOSE]+"$";var LONETILDE=R++;src[LONETILDE]="(?:~>?)";var TILDETRIM=R++;src[TILDETRIM]="(\\s*)"+src[LONETILDE]+"\\s+",re[TILDETRIM]=new RegExp(src[TILDETRIM],"g");var TILDE=R++;src[TILDE]="^"+src[LONETILDE]+src[XRANGEPLAIN]+"$";var TILDELOOSE=R++;src[TILDELOOSE]="^"+src[LONETILDE]+src[XRANGEPLAINLOOSE]+"$";var LONECARET=R++;src[LONECARET]="(?:\\^)";var CARETTRIM=R++;src[CARETTRIM]="(\\s*)"+src[LONECARET]+"\\s+",re[CARETTRIM]=new RegExp(src[CARETTRIM],"g");var CARET=R++;src[CARET]="^"+src[LONECARET]+src[XRANGEPLAIN]+"$";var CARETLOOSE=R++;src[CARETLOOSE]="^"+src[LONECARET]+src[XRANGEPLAINLOOSE]+"$";var COMPARATORLOOSE=R++;src[COMPARATORLOOSE]="^"+src[GTLT]+"\\s*("+LOOSEPLAIN+")$|^$";var COMPARATOR=R++;src[COMPARATOR]="^"+src[GTLT]+"\\s*("+FULLPLAIN+")$|^$";var COMPARATORTRIM=R++;src[COMPARATORTRIM]="(\\s*)"+src[GTLT]+"\\s*("+LOOSEPLAIN+"|"+src[XRANGEPLAIN]+")",re[COMPARATORTRIM]=new RegExp(src[COMPARATORTRIM],"g");var HYPHENRANGE=R++;src[HYPHENRANGE]="^\\s*("+src[XRANGEPLAIN]+")\\s+-\\s+("+src[XRANGEPLAIN]+")\\s*$";var HYPHENRANGELOOSE=R++;src[HYPHENRANGELOOSE]="^\\s*("+src[XRANGEPLAINLOOSE]+")\\s+-\\s+("+src[XRANGEPLAINLOOSE]+")\\s*$";var STAR=R++;src[STAR]="(<|>)?=?\\s*\\*";for(var i=0;i=0;)"number"==typeof this.prerelease[i]&&(this.prerelease[i]++,i=-2);i===-1&&this.prerelease.push(0)}identifier&&(this.prerelease[0]===identifier?isNaN(this.prerelease[1])&&(this.prerelease=[identifier,0]):this.prerelease=[identifier,0]);break;default:throw new Error("invalid increment argument: "+release)}return this.format(),this.raw=this.version,this},exports.inc=inc,exports.diff=diff,exports.compareIdentifiers=compareIdentifiers;var numeric=/^[0-9]+$/;exports.rcompareIdentifiers=rcompareIdentifiers,exports.major=major,exports.minor=minor,exports.patch=patch,exports.compare=compare,exports.compareLoose=compareLoose,exports.rcompare=rcompare,exports.sort=sort,exports.rsort=rsort,exports.gt=gt,exports.lt=lt,exports.eq=eq,exports.neq=neq,exports.gte=gte,exports.lte=lte,exports.cmp=cmp,exports.Comparator=Comparator;var ANY={};Comparator.prototype.parse=function(comp){var r=this.loose?re[COMPARATORLOOSE]:re[COMPARATOR],m=comp.match(r);if(!m)throw new TypeError("Invalid comparator: "+comp);this.operator=m[1],"="===this.operator&&(this.operator=""),m[2]?this.semver=new SemVer(m[2],this.loose):this.semver=ANY},Comparator.prototype.toString=function(){return this.value},Comparator.prototype.test=function(version){return debug("Comparator.test",version,this.loose),this.semver===ANY||("string"==typeof version&&(version=new SemVer(version,this.loose)),cmp(version,this.operator,this.semver,this.loose))},Comparator.prototype.intersects=function(comp,loose){if(!(comp instanceof Comparator))throw new TypeError("a Comparator is required");var rangeTmp;if(""===this.operator)return rangeTmp=new Range(comp.value,loose),satisfies(this.value,rangeTmp,loose);if(""===comp.operator)return rangeTmp=new Range(this.value,loose),satisfies(comp.semver,rangeTmp,loose);var sameDirectionIncreasing=!(">="!==this.operator&&">"!==this.operator||">="!==comp.operator&&">"!==comp.operator),sameDirectionDecreasing=!("<="!==this.operator&&"<"!==this.operator||"<="!==comp.operator&&"<"!==comp.operator),sameSemVer=this.semver.version===comp.semver.version,differentDirectionsInclusive=!(">="!==this.operator&&"<="!==this.operator||">="!==comp.operator&&"<="!==comp.operator),oppositeDirectionsLessThan=cmp(this.semver,"<",comp.semver,loose)&&(">="===this.operator||">"===this.operator)&&("<="===comp.operator||"<"===comp.operator),oppositeDirectionsGreaterThan=cmp(this.semver,">",comp.semver,loose)&&("<="===this.operator||"<"===this.operator)&&(">="===comp.operator||">"===comp.operator);return sameDirectionIncreasing||sameDirectionDecreasing||sameSemVer&&differentDirectionsInclusive||oppositeDirectionsLessThan||oppositeDirectionsGreaterThan},exports.Range=Range,Range.prototype.format=function(){return this.range=this.set.map(function(comps){return comps.join(" ").trim()}).join("||").trim(),this.range},Range.prototype.toString=function(){return this.range},Range.prototype.parseRange=function(range){var loose=this.loose;range=range.trim(),debug("range",range,loose);var hr=loose?re[HYPHENRANGELOOSE]:re[HYPHENRANGE];range=range.replace(hr,hyphenReplace),debug("hyphen replace",range),range=range.replace(re[COMPARATORTRIM],"$1$2$3"),debug("comparator trim",range,re[COMPARATORTRIM]),range=range.replace(re[TILDETRIM],"$1~"),range=range.replace(re[CARETTRIM],"$1^"),range=range.split(/\s+/).join(" ");var compRe=loose?re[COMPARATORLOOSE]:re[COMPARATOR],set=range.split(" ").map(function(comp){return parseComparator(comp,loose)}).join(" ").split(/\s+/);return this.loose&&(set=set.filter(function(comp){return!!comp.match(compRe)})),set=set.map(function(comp){return new Comparator(comp,loose)})},Range.prototype.intersects=function(range,loose){if(!(range instanceof Range))throw new TypeError("a Range is required");return this.set.some(function(thisComparators){return thisComparators.every(function(thisComparator){return range.set.some(function(rangeComparators){return rangeComparators.every(function(rangeComparator){return thisComparator.intersects(rangeComparator,loose)})})})})},exports.toComparators=toComparators,Range.prototype.test=function(version){if(!version)return!1;"string"==typeof version&&(version=new SemVer(version,this.loose));for(var i=0;i>>27}function rotl30(num){return num<<30|num>>>2}function ft(s,b,c,d){return 0===s?b&c|~b&d:2===s?b&c|b&d|c&d:b^c^d}var inherits=__webpack_require__(1),Hash=__webpack_require__(56),K=[1518500249,1859775393,-1894007588,-899497514],W=new Array(80);inherits(Sha,Hash),Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha.prototype._update=function(M){for(var W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<80;++i)W[i]=W[i-3]^W[i-8]^W[i-14]^W[i-16];for(var j=0;j<80;++j){var s=~~(j/20),t=rotl5(a)+ft(s,b,c,d)+e+W[j]+K[s]|0;e=d,d=c,c=rotl30(b),b=a,a=t}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0},Sha.prototype._hash=function(){var H=new Buffer(20);return H.writeInt32BE(0|this._a,0),H.writeInt32BE(0|this._b,4),H.writeInt32BE(0|this._c,8),H.writeInt32BE(0|this._d,12),H.writeInt32BE(0|this._e,16),H},module.exports=Sha}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Sha1(){this.init(),this._w=W,Hash.call(this,64,56)}function rotl1(num){return num<<1|num>>>31}function rotl5(num){return num<<5|num>>>27}function rotl30(num){return num<<30|num>>>2}function ft(s,b,c,d){return 0===s?b&c|~b&d:2===s?b&c|b&d|c&d:b^c^d}var inherits=__webpack_require__(1),Hash=__webpack_require__(56),K=[1518500249,1859775393,-1894007588,-899497514],W=new Array(80);inherits(Sha1,Hash),Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha1.prototype._update=function(M){for(var W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<80;++i)W[i]=rotl1(W[i-3]^W[i-8]^W[i-14]^W[i-16]);for(var j=0;j<80;++j){var s=~~(j/20),t=rotl5(a)+ft(s,b,c,d)+e+W[j]+K[s]|0;e=d,d=c,c=rotl30(b),b=a,a=t}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0},Sha1.prototype._hash=function(){var H=new Buffer(20);return H.writeInt32BE(0|this._a,0),H.writeInt32BE(0|this._b,4),H.writeInt32BE(0|this._c,8),H.writeInt32BE(0|this._d,12),H.writeInt32BE(0|this._e,16),H},module.exports=Sha1}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Sha224(){this.init(),this._w=W,Hash.call(this,64,56)}var inherits=__webpack_require__(1),Sha256=__webpack_require__(267),Hash=__webpack_require__(56),W=new Array(64);inherits(Sha224,Sha256),Sha224.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},Sha224.prototype._hash=function(){var H=new Buffer(28);return H.writeInt32BE(this._a,0),H.writeInt32BE(this._b,4),H.writeInt32BE(this._c,8),H.writeInt32BE(this._d,12),H.writeInt32BE(this._e,16),H.writeInt32BE(this._f,20),H.writeInt32BE(this._g,24),H},module.exports=Sha224}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Sha384(){this.init(),this._w=W,Hash.call(this,128,112)}var inherits=__webpack_require__(1),SHA512=__webpack_require__(268),Hash=__webpack_require__(56),W=new Array(160);inherits(Sha384,SHA512),Sha384.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},Sha384.prototype._hash=function(){function writeInt64BE(h,l,offset){H.writeInt32BE(h,offset),H.writeInt32BE(l,offset+4)}var H=new Buffer(48);return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),H},module.exports=Sha384}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){var varint=__webpack_require__(15);exports.encode=function encode(v,b,o){v=v>=0?2*v:v*-2-1;var r=varint.encode(v,b,o);return encode.bytes=varint.encode.bytes,r},exports.decode=function decode(b,o){var v=varint.decode(b,o);return decode.bytes=varint.decode.bytes,1&v?(v+1)/-2:v/2},exports.encodingLength=function(v){return varint.encodingLength(v>=0?2*v:v*-2-1)}},function(module,exports,__webpack_require__){(function(Buffer){function Peer(opts){var self=this;if(!(self instanceof Peer))return new Peer(opts);if(self._id=randombytes(4).toString("hex").slice(0,7),self._debug("new peer %o",opts),opts=Object.assign({allowHalfOpen:!1},opts),stream.Duplex.call(self,opts),self.channelName=opts.initiator?opts.channelName||randombytes(20).toString("hex"):null,self._isChromium="undefined"!=typeof window&&!!window.webkitRTCPeerConnection,self.initiator=opts.initiator||!1,self.channelConfig=opts.channelConfig||Peer.channelConfig,self.config=opts.config||Peer.config,self.constraints=self._transformConstraints(opts.constraints||Peer.constraints),self.offerConstraints=self._transformConstraints(opts.offerConstraints||{}),self.answerConstraints=self._transformConstraints(opts.answerConstraints||{}),self.reconnectTimer=opts.reconnectTimer||!1,self.sdpTransform=opts.sdpTransform||function(sdp){return sdp},self.stream=opts.stream||!1,self.trickle=void 0===opts.trickle||opts.trickle,self._earlyMessage=null,self.destroyed=!1,self.connected=!1,self.remoteAddress=void 0,self.remoteFamily=void 0,self.remotePort=void 0,self.localAddress=void 0,self.localPort=void 0,self._wrtc=opts.wrtc&&"object"==typeof opts.wrtc?opts.wrtc:getBrowserRTC(),!self._wrtc)throw"undefined"==typeof window?new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"):new Error("No WebRTC support: Not a supported browser");if(self._pcReady=!1,self._channelReady=!1,self._iceComplete=!1,self._channel=null,self._pendingCandidates=[],self._previousStreams=[],self._chunk=null,self._cb=null,self._interval=null,self._reconnectTimeout=null,self._pc=new self._wrtc.RTCPeerConnection(self.config,self.constraints),self._isWrtc=Array.isArray(self._pc.RTCIceConnectionStates),self._isReactNativeWebrtc="number"==typeof self._pc._peerConnectionId,self._pc.oniceconnectionstatechange=function(){self._onIceStateChange()},self._pc.onicegatheringstatechange=function(){self._onIceStateChange()},self._pc.onsignalingstatechange=function(){self._onSignalingStateChange()},self._pc.onicecandidate=function(event){self._onIceCandidate(event)},self.initiator){var createdOffer=!1;self._pc.onnegotiationneeded=function(){createdOffer||self._createOffer(),createdOffer=!0},self._setupData({channel:self._pc.createDataChannel(self.channelName,self.channelConfig)})}else self._pc.ondatachannel=function(event){self._setupData(event)};"addTrack"in self._pc?(self.stream&&self.stream.getTracks().forEach(function(track){self._pc.addTrack(track,self.stream)}),self._pc.ontrack=function(event){self._onTrack(event)}):(self.stream&&self._pc.addStream(self.stream),self._pc.onaddstream=function(event){self._onAddStream(event)}),self.initiator&&self._isWrtc&&self._pc.onnegotiationneeded(),self._onFinishBound=function(){self._onFinish()},self.once("finish",self._onFinishBound)}function noop(){}module.exports=Peer;var debug=__webpack_require__(3)("simple-peer"),getBrowserRTC=__webpack_require__(373),inherits=__webpack_require__(1),randombytes=__webpack_require__(636),stream=__webpack_require__(36);inherits(Peer,stream.Duplex),Peer.WEBRTC_SUPPORT=!!getBrowserRTC(),Peer.config={iceServers:[{urls:"stun:stun.l.google.com:19302"},{urls:"stun:global.stun.twilio.com:3478?transport=udp"}]},Peer.constraints={},Peer.channelConfig={},Object.defineProperty(Peer.prototype,"bufferSize",{get:function(){var self=this;return self._channel&&self._channel.bufferedAmount||0}}),Peer.prototype.address=function(){var self=this;return{port:self.localPort,family:"IPv4",address:self.localAddress}},Peer.prototype.signal=function(data){var self=this;if(self.destroyed)throw new Error("cannot signal after peer is destroyed");if("string"==typeof data)try{data=JSON.parse(data)}catch(err){data={}}self._debug("signal()"),data.candidate&&(self._pc.remoteDescription?self._addIceCandidate(data.candidate):self._pendingCandidates.push(data.candidate)),data.sdp&&self._pc.setRemoteDescription(new self._wrtc.RTCSessionDescription(data),function(){self.destroyed||(self._pendingCandidates.forEach(function(candidate){self._addIceCandidate(candidate)}),self._pendingCandidates=[],"offer"===self._pc.remoteDescription.type&&self._createAnswer())},function(err){self._destroy(err)}),data.sdp||data.candidate||self._destroy(new Error("signal() called with invalid signal data"))},Peer.prototype._addIceCandidate=function(candidate){var self=this;try{self._pc.addIceCandidate(new self._wrtc.RTCIceCandidate(candidate),noop,function(err){self._destroy(err)})}catch(err){self._destroy(new Error("error adding candidate: "+err.message))}},Peer.prototype.send=function(chunk){var self=this;self._isWrtc&&Buffer.isBuffer(chunk)&&(chunk=new Uint8Array(chunk)),self._channel.send(chunk)},Peer.prototype.destroy=function(onclose){this._destroy(null,onclose)},Peer.prototype._destroy=function(err,onclose){var self=this;if(!self.destroyed){if(onclose&&self.once("close",onclose),self._debug("destroy (error: %s)",err&&(err.message||err)),self.readable=self.writable=!1,self._readableState.ended||self.push(null),self._writableState.finished||self.end(),self.destroyed=!0,self.connected=!1,self._pcReady=!1,self._channelReady=!1,self._previousStreams=null,self._earlyMessage=null,clearInterval(self._interval),clearTimeout(self._reconnectTimeout),self._interval=null,self._reconnectTimeout=null,self._chunk=null,self._cb=null,self._onFinishBound&&self.removeListener("finish",self._onFinishBound),self._onFinishBound=null,self._pc){try{self._pc.close()}catch(err){}self._pc.oniceconnectionstatechange=null,self._pc.onicegatheringstatechange=null,self._pc.onsignalingstatechange=null,self._pc.onicecandidate=null,"addTrack"in self._pc?self._pc.ontrack=null:self._pc.onaddstream=null,self._pc.onnegotiationneeded=null,self._pc.ondatachannel=null}if(self._channel){try{self._channel.close()}catch(err){}self._channel.onmessage=null,self._channel.onopen=null,self._channel.onclose=null,self._channel.onerror=null}self._pc=null,self._channel=null,err&&self.emit("error",err),self.emit("close")}},Peer.prototype._setupData=function(event){var self=this;if(!event.channel)return self._destroy(new Error("Data channel event is missing `channel` property"));self._channel=event.channel,self._channel.binaryType="arraybuffer","number"==typeof self._channel.bufferedAmountLowThreshold&&(self._channel.bufferedAmountLowThreshold=65536),self.channelName=self._channel.label,self._channel.onmessage=function(event){self._channelReady?self._onChannelMessage(event):(self._earlyMessage=event,self._onChannelOpen())},self._channel.onbufferedamountlow=function(){self._onChannelBufferedAmountLow()},self._channel.onopen=function(){self._channelReady||self._onChannelOpen()},self._channel.onclose=function(){self._onChannelClose()},self._channel.onerror=function(err){self._destroy(err)}},Peer.prototype._read=function(){},Peer.prototype._write=function(chunk,encoding,cb){var self=this;if(self.destroyed)return cb(new Error("cannot write after peer is destroyed"));if(self.connected){try{self.send(chunk)}catch(err){return self._destroy(err)}self._channel.bufferedAmount>65536?(self._debug("start backpressure: bufferedAmount %d",self._channel.bufferedAmount),self._cb=cb):cb(null)}else self._debug("write before connect"),self._chunk=chunk,self._cb=cb},Peer.prototype._onFinish=function(){function destroySoon(){setTimeout(function(){self._destroy()},1e3)}var self=this;self.destroyed||(self.connected?destroySoon():self.once("connect",destroySoon))},Peer.prototype._createOffer=function(){var self=this;self.destroyed||self._pc.createOffer(function(offer){function onSuccess(){self.destroyed||(self.trickle||self._iceComplete?sendOffer():self.once("_iceComplete",sendOffer))}function onError(err){self._destroy(err)}function sendOffer(){var signal=self._pc.localDescription||offer;self._debug("signal"),self.emit("signal",{type:signal.type,sdp:signal.sdp})}self.destroyed||(offer.sdp=self.sdpTransform(offer.sdp),self._pc.setLocalDescription(offer,onSuccess,onError))},function(err){self._destroy(err)},self.offerConstraints)},Peer.prototype._createAnswer=function(){var self=this;self.destroyed||self._pc.createAnswer(function(answer){function onSuccess(){self.destroyed||(self.trickle||self._iceComplete?sendAnswer():self.once("_iceComplete",sendAnswer))}function onError(err){self._destroy(err)}function sendAnswer(){var signal=self._pc.localDescription||answer;self._debug("signal"),self.emit("signal",{type:signal.type,sdp:signal.sdp})}self.destroyed||(answer.sdp=self.sdpTransform(answer.sdp),self._pc.setLocalDescription(answer,onSuccess,onError))},function(err){self._destroy(err)},self.answerConstraints)},Peer.prototype._onIceStateChange=function(){var self=this;if(!self.destroyed){var iceConnectionState=self._pc.iceConnectionState,iceGatheringState=self._pc.iceGatheringState;self._debug("iceStateChange (connection: %s) (gathering: %s)",iceConnectionState,iceGatheringState),self.emit("iceStateChange",iceConnectionState,iceGatheringState),"connected"!==iceConnectionState&&"completed"!==iceConnectionState||(clearTimeout(self._reconnectTimeout),self._pcReady=!0,self._maybeReady()),"disconnected"===iceConnectionState&&(self.reconnectTimer?(clearTimeout(self._reconnectTimeout),self._reconnectTimeout=setTimeout(function(){self._destroy()},self.reconnectTimer)):self._destroy()),"failed"===iceConnectionState&&self._destroy(new Error("Ice connection failed.")),"closed"===iceConnectionState&&self._destroy()}},Peer.prototype.getStats=function(cb){var self=this;0===self._pc.getStats.length?self._pc.getStats().then(function(res){var reports=[];res.forEach(function(report){reports.push(report)}),cb(null,reports)},function(err){cb(err)}):self._isReactNativeWebrtc?self._pc.getStats(null,function(res){var reports=[];res.forEach(function(report){reports.push(report)}),cb(null,reports)},function(err){cb(err)}):self._pc.getStats.length>0?self._pc.getStats(function(res){var reports=[];res.result().forEach(function(result){var report={};result.names().forEach(function(name){report[name]=result.stat(name)}),report.id=result.id,report.type=result.type,report.timestamp=result.timestamp,reports.push(report)}),cb(null,reports)},function(err){cb(err)}):cb(null,[])},Peer.prototype._maybeReady=function(){var self=this;self._debug("maybeReady pc %s channel %s",self._pcReady,self._channelReady),!self.connected&&!self._connecting&&self._pcReady&&self._channelReady&&(self._connecting=!0,self.getStats(function(err,items){function setSelectedCandidatePair(selectedCandidatePair){var local=localCandidates[selectedCandidatePair.localCandidateId];local&&local.ip?(self.localAddress=local.ip,self.localPort=Number(local.port)):local&&local.ipAddress?(self.localAddress=local.ipAddress,self.localPort=Number(local.portNumber)):"string"==typeof selectedCandidatePair.googLocalAddress&&(local=selectedCandidatePair.googLocalAddress.split(":"),self.localAddress=local[0],self.localPort=Number(local[1]));var remote=remoteCandidates[selectedCandidatePair.remoteCandidateId];remote&&remote.ip?(self.remoteAddress=remote.ip,self.remotePort=Number(remote.port)):remote&&remote.ipAddress?(self.remoteAddress=remote.ipAddress,self.remotePort=Number(remote.portNumber)):"string"==typeof selectedCandidatePair.googRemoteAddress&&(remote=selectedCandidatePair.googRemoteAddress.split(":"),self.remoteAddress=remote[0],self.remotePort=Number(remote[1])),self.remoteFamily="IPv4",self._debug("connect local: %s:%s remote: %s:%s",self.localAddress,self.localPort,self.remoteAddress,self.remotePort)}if(!self.destroyed){err&&(items=[]),self._connecting=!1,self.connected=!0;var remoteCandidates={},localCandidates={},candidatePairs={};if(items.forEach(function(item){"remotecandidate"!==item.type&&"remote-candidate"!==item.type||(remoteCandidates[item.id]=item),"localcandidate"!==item.type&&"local-candidate"!==item.type||(localCandidates[item.id]=item),"candidatepair"!==item.type&&"candidate-pair"!==item.type||(candidatePairs[item.id]=item)}),items.forEach(function(item){"transport"===item.type&&setSelectedCandidatePair(candidatePairs[item.selectedCandidatePairId]),("googCandidatePair"===item.type&&"true"===item.googActiveConnection||("candidatepair"===item.type||"candidate-pair"===item.type)&&item.selected)&&setSelectedCandidatePair(item)}),self._chunk){try{self.send(self._chunk)}catch(err){return self._destroy(err)}self._chunk=null,self._debug('sent chunk from "write before connect"');var cb=self._cb;self._cb=null,cb(null)}"number"!=typeof self._channel.bufferedAmountLowThreshold&&(self._interval=setInterval(function(){self._onInterval()},150),self._interval.unref&&self._interval.unref()),self._debug("connect"),self.emit("connect"),self._earlyMessage&&(self._onChannelMessage(self._earlyMessage),self._earlyMessage=null)}}))},Peer.prototype._onInterval=function(){!this._cb||!this._channel||this._channel.bufferedAmount>65536||this._onChannelBufferedAmountLow()},Peer.prototype._onSignalingStateChange=function(){var self=this;self.destroyed||(self._debug("signalingStateChange %s",self._pc.signalingState),self.emit("signalingStateChange",self._pc.signalingState))},Peer.prototype._onIceCandidate=function(event){var self=this;self.destroyed||(event.candidate&&self.trickle?self.emit("signal",{candidate:{candidate:event.candidate.candidate,sdpMLineIndex:event.candidate.sdpMLineIndex,sdpMid:event.candidate.sdpMid}}):event.candidate||(self._iceComplete=!0,self.emit("_iceComplete")))},Peer.prototype._onChannelMessage=function(event){var self=this;if(!self.destroyed){var data=event.data;data instanceof ArrayBuffer&&(data=Buffer.from(data)),self.push(data)}},Peer.prototype._onChannelBufferedAmountLow=function(){var self=this;if(!self.destroyed&&self._cb){self._debug("ending backpressure: bufferedAmount %d",self._channel.bufferedAmount);var cb=self._cb;self._cb=null,cb(null)}},Peer.prototype._onChannelOpen=function(){var self=this;self.connected||self.destroyed||(self._debug("on channel open"),self._channelReady=!0,self._maybeReady())},Peer.prototype._onChannelClose=function(){var self=this;self.destroyed||(self._debug("on channel close"),self._destroy())},Peer.prototype._onAddStream=function(event){var self=this;self.destroyed||(self._debug("on add stream"),self.emit("stream",event.stream))},Peer.prototype._onTrack=function(event){var self=this;if(!self.destroyed){self._debug("on track");var id=event.streams[0].id;self._previousStreams.indexOf(id)===-1&&(self._previousStreams.push(id),self.emit("stream",event.streams[0]))}},Peer.prototype._debug=function(){var self=this,args=[].slice.call(arguments);args[0]="["+self._id+"] "+args[0],debug.apply(null,args)},Peer.prototype._transformConstraints=function(constraints){var self=this;if(0===Object.keys(constraints).length)return constraints;if((constraints.mandatory||constraints.optional)&&!self._isChromium){var newConstraints=Object.assign({},constraints.optional,constraints.mandatory);return void 0!==newConstraints.OfferToReceiveVideo&&(newConstraints.offerToReceiveVideo=newConstraints.OfferToReceiveVideo,delete newConstraints.OfferToReceiveVideo),void 0!==newConstraints.OfferToReceiveAudio&&(newConstraints.offerToReceiveAudio=newConstraints.OfferToReceiveAudio,delete newConstraints.OfferToReceiveAudio),newConstraints}return constraints.mandatory||constraints.optional||!self._isChromium?constraints:(void 0!==constraints.offerToReceiveVideo&&(constraints.OfferToReceiveVideo=constraints.offerToReceiveVideo,delete constraints.offerToReceiveVideo),void 0!==constraints.offerToReceiveAudio&&(constraints.OfferToReceiveAudio=constraints.offerToReceiveAudio,delete constraints.offerToReceiveAudio),{mandatory:constraints})}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function lookup(uri,opts){"object"==typeof uri&&(opts=uri,uri=void 0),opts=opts||{};var io,parsed=url(uri),source=parsed.source,id=parsed.id,path=parsed.path,sameNamespace=cache[id]&&path in cache[id].nsps,newConnection=opts.forceNew||opts["force new connection"]||!1===opts.multiplex||sameNamespace;return newConnection?(debug("ignoring socket cache for %s",source),io=Manager(source,opts)):(cache[id]||(debug("new io instance for %s",source),cache[id]=Manager(source,opts)),io=cache[id]),parsed.query&&!opts.query&&(opts.query=parsed.query),io.socket(parsed.path,opts)}var url=__webpack_require__(660),parser=__webpack_require__(145),Manager=__webpack_require__(269),debug=__webpack_require__(3)("socket.io-client");module.exports=exports=lookup;var cache=exports.managers={};exports.protocol=parser.protocol,exports.connect=lookup,exports.Manager=__webpack_require__(269),exports.Socket=__webpack_require__(271)},function(module,exports,__webpack_require__){(function(global){function url(uri,loc){var obj=uri;loc=loc||global.location,null==uri&&(uri=loc.protocol+"//"+loc.host),"string"==typeof uri&&("/"===uri.charAt(0)&&(uri="/"===uri.charAt(1)?loc.protocol+uri:loc.host+uri),/^(https?|wss?):\/\//.test(uri)||(debug("protocol-less url %s",uri),uri=void 0!==loc?loc.protocol+"//"+uri:"https://"+uri),debug("parse %s",uri),obj=parseuri(uri)),obj.port||(/^(http|ws)$/.test(obj.protocol)?obj.port="80":/^(http|ws)s$/.test(obj.protocol)&&(obj.port="443")),obj.path=obj.path||"/";var ipv6=obj.host.indexOf(":")!==-1,host=ipv6?"["+obj.host+"]":obj.host;return obj.id=obj.protocol+"://"+host+":"+obj.port,obj.href=obj.protocol+"://"+host+(loc&&loc.port===obj.port?"":":"+obj.port),obj}var parseuri=__webpack_require__(244),debug=__webpack_require__(3)("socket.io-client:url");module.exports=url}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(global){function _deconstructPacket(data,buffers){if(!data)return data;if(isBuf(data)){var placeholder={_placeholder:!0,num:buffers.length};return buffers.push(data),placeholder}if(isArray(data)){for(var newData=new Array(data.length),i=0;i>1&1431655765,16843009*((v=(858993459&v)+(v>>2&858993459))+(v>>4)&252645135)>>24}function sortInternal(a,b){return a[0]-b[0]}function valueOnly(elem){return elem[1]}module.exports=class SparseArray{constructor(){this._bitArrays=[],this._data=[],this._length=0,this._changedLength=!1,this._changedData=!1}set(index,value){let pos=this._internalPositionFor(index,!1);if(void 0===value)pos!==-1&&(this._unsetInternalPos(pos),this._unsetBit(index),this._changedLength=!0,this._changedData=!0);else{let needsSort=!1;pos===-1?(pos=this._data.length,this._setBit(index),this._changedData=!0):needsSort=!0,this._setInternalPos(pos,index,value,needsSort),this._changedLength=!0}}unset(index){this.set(index,void 0)}get(index){this._sortData();const pos=this._internalPositionFor(index,!0);if(pos!==-1)return this._data[pos][1]}push(value){return this.set(this.length,value),this.length}get length(){if(this._sortData(),this._changedLength){const last=this._data[this._data.length-1];this._length=last?last[0]+1:0,this._changedLength=!1}return this._length}forEach(iterator){let i=0;for(;i=this._bitArrays.length)return-1;const byte=this._bitArrays[bytePos],bitPos=index-7*bytePos;return(byte&1<0?this._bitArrays.slice(0,bytePos).reduce(popCountReduce,0)+popCount(byte&~(4294967295<=index)data.push(elem);else if(data[0][0]<=index)data.unshift(elem);else{const randomIndex=Math.round(data.length/2);this._data=data.slice(0,randomIndex).concat(elem).concat(data.slice(randomIndex))}else this._data.push(elem);this._changedData=!0,this._changedLength=!0}}_unsetInternalPos(pos){this._data.splice(pos,1)}_sortData(){this._changedData&&this._data.sort(sortInternal)}bitField(){const bytes=[];let newByte,pendingBitsForResultingByte=8,pendingBitsForNewByte=0,resultingByte=0;const pending=this._bitArrays.slice();for(;pending.length||pendingBitsForNewByte;){0===pendingBitsForNewByte&&(newByte=pending.shift(),pendingBitsForNewByte=7);const usingBits=Math.min(pendingBitsForNewByte,pendingBitsForResultingByte),mask=~(255<>>=usingBits,pendingBitsForNewByte-=usingBits,pendingBitsForResultingByte-=usingBits,pendingBitsForResultingByte&&(pendingBitsForNewByte||pending.length)||(bytes.push(resultingByte),resultingByte=0,pendingBitsForResultingByte=8)}for(var i=bytes.length-1;i>0;i--){const value=bytes[i];if(0!==value)break;bytes.pop()}return bytes}compactArray(){return this._sortData(),this._data.map(valueOnly)}}},function(module,exports,__webpack_require__){!function(){function exec(arr,comp){"function"!=typeof comp&&(comp=function(a,b){return String(a).localeCompare(b)});var len=arr.length;if(len<=1)return arr;for(var buffer=new Array(len),chk=1;chklen&&(r=len),e>len&&(e=len),li=l,ri=r;;)if(li{entries.forEach((entry,key)=>{const v=entry.validity||validity;getTimeElapsed(entry.timestamp)>v&&entries.delete(key)})},200);this.put=((key,value,validity)=>{this.has(key)||entries.set(key,{value:value,timestamp:new Date,validity:validity}),sweep()}),this.get=(key=>{if(entries.has(key))return entries.get(key).value;throw new Error("key does not exist")}),this.has=(key=>{return entries.has(key)})}function getTimeElapsed(prevTime){const currentTime=new Date,a=currentTime.getTime()-prevTime.getTime();return Math.floor(a/1e3)}const throttle=__webpack_require__(530);module.exports=TimeCache},function(module,exports){function toArray(list,index){var array=[];index=index||0;for(var i=index||0;i>24&255,x[i+1]=h>>16&255,x[i+2]=h>>8&255,x[i+3]=255&h,x[i+4]=l>>24&255,x[i+5]=l>>16&255,x[i+6]=l>>8&255,x[i+7]=255&l}function vn(x,xi,y,yi,n){var i,d=0;for(i=0;i>>8)-1}function crypto_verify_16(x,xi,y,yi){return vn(x,xi,y,yi,16)}function crypto_verify_32(x,xi,y,yi){return vn(x,xi,y,yi,32)}function core_salsa20(o,p,k,c){for(var u,j0=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,j1=255&k[0]|(255&k[1])<<8|(255&k[2])<<16|(255&k[3])<<24,j2=255&k[4]|(255&k[5])<<8|(255&k[6])<<16|(255&k[7])<<24,j3=255&k[8]|(255&k[9])<<8|(255&k[10])<<16|(255&k[11])<<24,j4=255&k[12]|(255&k[13])<<8|(255&k[14])<<16|(255&k[15])<<24,j5=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,j6=255&p[0]|(255&p[1])<<8|(255&p[2])<<16|(255&p[3])<<24,j7=255&p[4]|(255&p[5])<<8|(255&p[6])<<16|(255&p[7])<<24,j8=255&p[8]|(255&p[9])<<8|(255&p[10])<<16|(255&p[11])<<24,j9=255&p[12]|(255&p[13])<<8|(255&p[14])<<16|(255&p[15])<<24,j10=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,j11=255&k[16]|(255&k[17])<<8|(255&k[18])<<16|(255&k[19])<<24,j12=255&k[20]|(255&k[21])<<8|(255&k[22])<<16|(255&k[23])<<24,j13=255&k[24]|(255&k[25])<<8|(255&k[26])<<16|(255&k[27])<<24,j14=255&k[28]|(255&k[29])<<8|(255&k[30])<<16|(255&k[31])<<24,j15=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,x0=j0,x1=j1,x2=j2,x3=j3,x4=j4,x5=j5,x6=j6,x7=j7,x8=j8,x9=j9,x10=j10,x11=j11,x12=j12,x13=j13,x14=j14,x15=j15,i=0;i<20;i+=2)u=x0+x12|0,x4^=u<<7|u>>>25,u=x4+x0|0,x8^=u<<9|u>>>23,u=x8+x4|0,x12^=u<<13|u>>>19,u=x12+x8|0,x0^=u<<18|u>>>14,u=x5+x1|0,x9^=u<<7|u>>>25,u=x9+x5|0,x13^=u<<9|u>>>23,u=x13+x9|0,x1^=u<<13|u>>>19,u=x1+x13|0,x5^=u<<18|u>>>14,u=x10+x6|0,x14^=u<<7|u>>>25,u=x14+x10|0,x2^=u<<9|u>>>23,u=x2+x14|0,x6^=u<<13|u>>>19,u=x6+x2|0,x10^=u<<18|u>>>14,u=x15+x11|0,x3^=u<<7|u>>>25,u=x3+x15|0,x7^=u<<9|u>>>23,u=x7+x3|0,x11^=u<<13|u>>>19,u=x11+x7|0,x15^=u<<18|u>>>14,u=x0+x3|0,x1^=u<<7|u>>>25,u=x1+x0|0,x2^=u<<9|u>>>23,u=x2+x1|0,x3^=u<<13|u>>>19,u=x3+x2|0,x0^=u<<18|u>>>14,u=x5+x4|0,x6^=u<<7|u>>>25,u=x6+x5|0,x7^=u<<9|u>>>23,u=x7+x6|0,x4^=u<<13|u>>>19,u=x4+x7|0,x5^=u<<18|u>>>14,u=x10+x9|0,x11^=u<<7|u>>>25,u=x11+x10|0,x8^=u<<9|u>>>23,u=x8+x11|0,x9^=u<<13|u>>>19,u=x9+x8|0,x10^=u<<18|u>>>14,u=x15+x14|0,x12^=u<<7|u>>>25,u=x12+x15|0,x13^=u<<9|u>>>23,u=x13+x12|0,x14^=u<<13|u>>>19,u=x14+x13|0,x15^=u<<18|u>>>14;x0=x0+j0|0,x1=x1+j1|0,x2=x2+j2|0,x3=x3+j3|0,x4=x4+j4|0,x5=x5+j5|0,x6=x6+j6|0,x7=x7+j7|0,x8=x8+j8|0,x9=x9+j9|0,x10=x10+j10|0,x11=x11+j11|0,x12=x12+j12|0,x13=x13+j13|0,x14=x14+j14|0,x15=x15+j15|0,o[0]=x0>>>0&255,o[1]=x0>>>8&255,o[2]=x0>>>16&255,o[3]=x0>>>24&255,o[4]=x1>>>0&255,o[5]=x1>>>8&255,o[6]=x1>>>16&255,o[7]=x1>>>24&255,o[8]=x2>>>0&255,o[9]=x2>>>8&255,o[10]=x2>>>16&255,o[11]=x2>>>24&255,o[12]=x3>>>0&255,o[13]=x3>>>8&255,o[14]=x3>>>16&255,o[15]=x3>>>24&255,o[16]=x4>>>0&255,o[17]=x4>>>8&255,o[18]=x4>>>16&255,o[19]=x4>>>24&255,o[20]=x5>>>0&255,o[21]=x5>>>8&255,o[22]=x5>>>16&255,o[23]=x5>>>24&255,o[24]=x6>>>0&255,o[25]=x6>>>8&255,o[26]=x6>>>16&255,o[27]=x6>>>24&255,o[28]=x7>>>0&255,o[29]=x7>>>8&255,o[30]=x7>>>16&255,o[31]=x7>>>24&255,o[32]=x8>>>0&255,o[33]=x8>>>8&255,o[34]=x8>>>16&255,o[35]=x8>>>24&255,o[36]=x9>>>0&255,o[37]=x9>>>8&255,o[38]=x9>>>16&255,o[39]=x9>>>24&255,o[40]=x10>>>0&255,o[41]=x10>>>8&255,o[42]=x10>>>16&255,o[43]=x10>>>24&255,o[44]=x11>>>0&255,o[45]=x11>>>8&255,o[46]=x11>>>16&255,o[47]=x11>>>24&255,o[48]=x12>>>0&255,o[49]=x12>>>8&255,o[50]=x12>>>16&255,o[51]=x12>>>24&255,o[52]=x13>>>0&255,o[53]=x13>>>8&255,o[54]=x13>>>16&255,o[55]=x13>>>24&255,o[56]=x14>>>0&255,o[57]=x14>>>8&255,o[58]=x14>>>16&255,o[59]=x14>>>24&255,o[60]=x15>>>0&255,o[61]=x15>>>8&255,o[62]=x15>>>16&255,o[63]=x15>>>24&255}function core_hsalsa20(o,p,k,c){for(var u,j0=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,j1=255&k[0]|(255&k[1])<<8|(255&k[2])<<16|(255&k[3])<<24,j2=255&k[4]|(255&k[5])<<8|(255&k[6])<<16|(255&k[7])<<24,j3=255&k[8]|(255&k[9])<<8|(255&k[10])<<16|(255&k[11])<<24,j4=255&k[12]|(255&k[13])<<8|(255&k[14])<<16|(255&k[15])<<24,j5=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,j6=255&p[0]|(255&p[1])<<8|(255&p[2])<<16|(255&p[3])<<24,j7=255&p[4]|(255&p[5])<<8|(255&p[6])<<16|(255&p[7])<<24,j8=255&p[8]|(255&p[9])<<8|(255&p[10])<<16|(255&p[11])<<24,j9=255&p[12]|(255&p[13])<<8|(255&p[14])<<16|(255&p[15])<<24,j10=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,j11=255&k[16]|(255&k[17])<<8|(255&k[18])<<16|(255&k[19])<<24,j12=255&k[20]|(255&k[21])<<8|(255&k[22])<<16|(255&k[23])<<24,j13=255&k[24]|(255&k[25])<<8|(255&k[26])<<16|(255&k[27])<<24,j14=255&k[28]|(255&k[29])<<8|(255&k[30])<<16|(255&k[31])<<24,j15=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,x0=j0,x1=j1,x2=j2,x3=j3,x4=j4,x5=j5,x6=j6,x7=j7,x8=j8,x9=j9,x10=j10,x11=j11,x12=j12,x13=j13,x14=j14,x15=j15,i=0;i<20;i+=2)u=x0+x12|0,x4^=u<<7|u>>>25,u=x4+x0|0,x8^=u<<9|u>>>23,u=x8+x4|0,x12^=u<<13|u>>>19,u=x12+x8|0,x0^=u<<18|u>>>14,u=x5+x1|0,x9^=u<<7|u>>>25,u=x9+x5|0,x13^=u<<9|u>>>23,u=x13+x9|0,x1^=u<<13|u>>>19,u=x1+x13|0,x5^=u<<18|u>>>14,u=x10+x6|0,x14^=u<<7|u>>>25,u=x14+x10|0,x2^=u<<9|u>>>23,u=x2+x14|0,x6^=u<<13|u>>>19,u=x6+x2|0,x10^=u<<18|u>>>14,u=x15+x11|0,x3^=u<<7|u>>>25,u=x3+x15|0,x7^=u<<9|u>>>23,u=x7+x3|0,x11^=u<<13|u>>>19,u=x11+x7|0,x15^=u<<18|u>>>14,u=x0+x3|0,x1^=u<<7|u>>>25,u=x1+x0|0,x2^=u<<9|u>>>23,u=x2+x1|0,x3^=u<<13|u>>>19,u=x3+x2|0,x0^=u<<18|u>>>14,u=x5+x4|0,x6^=u<<7|u>>>25,u=x6+x5|0,x7^=u<<9|u>>>23,u=x7+x6|0,x4^=u<<13|u>>>19,u=x4+x7|0,x5^=u<<18|u>>>14,u=x10+x9|0,x11^=u<<7|u>>>25,u=x11+x10|0,x8^=u<<9|u>>>23,u=x8+x11|0,x9^=u<<13|u>>>19,u=x9+x8|0,x10^=u<<18|u>>>14,u=x15+x14|0,x12^=u<<7|u>>>25,u=x12+x15|0,x13^=u<<9|u>>>23,u=x13+x12|0,x14^=u<<13|u>>>19,u=x14+x13|0,x15^=u<<18|u>>>14;o[0]=x0>>>0&255,o[1]=x0>>>8&255,o[2]=x0>>>16&255,o[3]=x0>>>24&255,o[4]=x5>>>0&255,o[5]=x5>>>8&255,o[6]=x5>>>16&255,o[7]=x5>>>24&255,o[8]=x10>>>0&255,o[9]=x10>>>8&255,o[10]=x10>>>16&255,o[11]=x10>>>24&255,o[12]=x15>>>0&255,o[13]=x15>>>8&255,o[14]=x15>>>16&255,o[15]=x15>>>24&255,o[16]=x6>>>0&255,o[17]=x6>>>8&255,o[18]=x6>>>16&255,o[19]=x6>>>24&255,o[20]=x7>>>0&255,o[21]=x7>>>8&255,o[22]=x7>>>16&255,o[23]=x7>>>24&255,o[24]=x8>>>0&255,o[25]=x8>>>8&255,o[26]=x8>>>16&255,o[27]=x8>>>24&255,o[28]=x9>>>0&255,o[29]=x9>>>8&255,o[30]=x9>>>16&255,o[31]=x9>>>24&255}function crypto_core_salsa20(out,inp,k,c){core_salsa20(out,inp,k,c)}function crypto_core_hsalsa20(out,inp,k,c){core_hsalsa20(out,inp,k,c)}function crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k){var u,i,z=new Uint8Array(16),x=new Uint8Array(64);for(i=0;i<16;i++)z[i]=0;for(i=0;i<8;i++)z[i]=n[i];for(;b>=64;){for(crypto_core_salsa20(x,z,k,sigma),i=0;i<64;i++)c[cpos+i]=m[mpos+i]^x[i];for(u=1,i=8;i<16;i++)u=u+(255&z[i])|0,z[i]=255&u,u>>>=8;b-=64,cpos+=64,mpos+=64}if(b>0)for(crypto_core_salsa20(x,z,k,sigma),i=0;i=64;){for(crypto_core_salsa20(x,z,k,sigma),i=0;i<64;i++)c[cpos+i]=x[i];for(u=1,i=8;i<16;i++)u=u+(255&z[i])|0,z[i]=255&u,u>>>=8;b-=64,cpos+=64}if(b>0)for(crypto_core_salsa20(x,z,k,sigma),i=0;i>16&1),m[i-1]&=65535;m[15]=t[15]-32767-(m[14]>>16&1),b=m[15]>>16&1,m[14]&=65535,sel25519(t,m,1-b)}for(i=0;i<16;i++)o[2*i]=255&t[i],o[2*i+1]=t[i]>>8}function neq25519(a,b){var c=new Uint8Array(32),d=new Uint8Array(32);return pack25519(c,a),pack25519(d,b),crypto_verify_32(c,0,d,0)}function par25519(a){var d=new Uint8Array(32);return pack25519(d,a),1&d[0]}function unpack25519(o,n){var i;for(i=0;i<16;i++)o[i]=n[2*i]+(n[2*i+1]<<8);o[15]&=32767}function A(o,a,b){for(var i=0;i<16;i++)o[i]=a[i]+b[i]}function Z(o,a,b){for(var i=0;i<16;i++)o[i]=a[i]-b[i]}function M(o,a,b){var v,c,t0=0,t1=0,t2=0,t3=0,t4=0,t5=0,t6=0,t7=0,t8=0,t9=0,t10=0,t11=0,t12=0,t13=0,t14=0,t15=0,t16=0,t17=0,t18=0,t19=0,t20=0,t21=0,t22=0,t23=0,t24=0,t25=0,t26=0,t27=0,t28=0,t29=0,t30=0,b0=b[0],b1=b[1],b2=b[2],b3=b[3],b4=b[4],b5=b[5],b6=b[6],b7=b[7],b8=b[8],b9=b[9],b10=b[10],b11=b[11],b12=b[12],b13=b[13],b14=b[14],b15=b[15];v=a[0],t0+=v*b0,t1+=v*b1,t2+=v*b2,t3+=v*b3,t4+=v*b4,t5+=v*b5,t6+=v*b6,t7+=v*b7,t8+=v*b8,t9+=v*b9,t10+=v*b10,t11+=v*b11,t12+=v*b12,t13+=v*b13,t14+=v*b14,t15+=v*b15,v=a[1],t1+=v*b0,t2+=v*b1,t3+=v*b2,t4+=v*b3,t5+=v*b4,t6+=v*b5,t7+=v*b6,t8+=v*b7,t9+=v*b8,t10+=v*b9,t11+=v*b10,t12+=v*b11,t13+=v*b12,t14+=v*b13,t15+=v*b14,t16+=v*b15,v=a[2],t2+=v*b0,t3+=v*b1,t4+=v*b2,t5+=v*b3,t6+=v*b4,t7+=v*b5,t8+=v*b6,t9+=v*b7,t10+=v*b8,t11+=v*b9,t12+=v*b10,t13+=v*b11,t14+=v*b12,t15+=v*b13,t16+=v*b14,t17+=v*b15,v=a[3],t3+=v*b0,t4+=v*b1,t5+=v*b2,t6+=v*b3,t7+=v*b4,t8+=v*b5,t9+=v*b6,t10+=v*b7,t11+=v*b8,t12+=v*b9,t13+=v*b10,t14+=v*b11,t15+=v*b12,t16+=v*b13,t17+=v*b14,t18+=v*b15,v=a[4],t4+=v*b0,t5+=v*b1,t6+=v*b2,t7+=v*b3,t8+=v*b4,t9+=v*b5,t10+=v*b6,t11+=v*b7,t12+=v*b8,t13+=v*b9,t14+=v*b10,t15+=v*b11,t16+=v*b12,t17+=v*b13,t18+=v*b14,t19+=v*b15,v=a[5],t5+=v*b0,t6+=v*b1,t7+=v*b2,t8+=v*b3,t9+=v*b4,t10+=v*b5,t11+=v*b6,t12+=v*b7,t13+=v*b8,t14+=v*b9,t15+=v*b10,t16+=v*b11,t17+=v*b12,t18+=v*b13,t19+=v*b14,t20+=v*b15,v=a[6],t6+=v*b0,t7+=v*b1,t8+=v*b2,t9+=v*b3,t10+=v*b4,t11+=v*b5,t12+=v*b6,t13+=v*b7,t14+=v*b8,t15+=v*b9,t16+=v*b10,t17+=v*b11,t18+=v*b12,t19+=v*b13,t20+=v*b14,t21+=v*b15,v=a[7],t7+=v*b0,t8+=v*b1,t9+=v*b2,t10+=v*b3,t11+=v*b4,t12+=v*b5,t13+=v*b6,t14+=v*b7,t15+=v*b8,t16+=v*b9,t17+=v*b10,t18+=v*b11,t19+=v*b12,t20+=v*b13,t21+=v*b14,t22+=v*b15,v=a[8],t8+=v*b0,t9+=v*b1,t10+=v*b2,t11+=v*b3,t12+=v*b4,t13+=v*b5,t14+=v*b6,t15+=v*b7,t16+=v*b8,t17+=v*b9,t18+=v*b10,t19+=v*b11,t20+=v*b12,t21+=v*b13,t22+=v*b14,t23+=v*b15,v=a[9],t9+=v*b0,t10+=v*b1,t11+=v*b2,t12+=v*b3,t13+=v*b4,t14+=v*b5,t15+=v*b6,t16+=v*b7,t17+=v*b8,t18+=v*b9,t19+=v*b10,t20+=v*b11,t21+=v*b12,t22+=v*b13,t23+=v*b14,t24+=v*b15,v=a[10],t10+=v*b0,t11+=v*b1,t12+=v*b2,t13+=v*b3,t14+=v*b4,t15+=v*b5,t16+=v*b6,t17+=v*b7,t18+=v*b8,t19+=v*b9,t20+=v*b10,t21+=v*b11,t22+=v*b12,t23+=v*b13,t24+=v*b14,t25+=v*b15,v=a[11],t11+=v*b0,t12+=v*b1,t13+=v*b2,t14+=v*b3,t15+=v*b4,t16+=v*b5,t17+=v*b6,t18+=v*b7,t19+=v*b8,t20+=v*b9,t21+=v*b10,t22+=v*b11;t23+=v*b12,t24+=v*b13,t25+=v*b14,t26+=v*b15,v=a[12],t12+=v*b0,t13+=v*b1,t14+=v*b2,t15+=v*b3,t16+=v*b4,t17+=v*b5,t18+=v*b6,t19+=v*b7,t20+=v*b8,t21+=v*b9,t22+=v*b10,t23+=v*b11,t24+=v*b12,t25+=v*b13,t26+=v*b14,t27+=v*b15,v=a[13],t13+=v*b0,t14+=v*b1,t15+=v*b2,t16+=v*b3,t17+=v*b4,t18+=v*b5,t19+=v*b6,t20+=v*b7,t21+=v*b8,t22+=v*b9,t23+=v*b10,t24+=v*b11,t25+=v*b12,t26+=v*b13,t27+=v*b14,t28+=v*b15,v=a[14],t14+=v*b0,t15+=v*b1,t16+=v*b2,t17+=v*b3,t18+=v*b4,t19+=v*b5,t20+=v*b6,t21+=v*b7,t22+=v*b8,t23+=v*b9,t24+=v*b10,t25+=v*b11,t26+=v*b12,t27+=v*b13,t28+=v*b14,t29+=v*b15,v=a[15],t15+=v*b0,t16+=v*b1,t17+=v*b2,t18+=v*b3,t19+=v*b4,t20+=v*b5,t21+=v*b6,t22+=v*b7,t23+=v*b8,t24+=v*b9,t25+=v*b10,t26+=v*b11,t27+=v*b12,t28+=v*b13,t29+=v*b14,t30+=v*b15,t0+=38*t16,t1+=38*t17,t2+=38*t18,t3+=38*t19,t4+=38*t20,t5+=38*t21,t6+=38*t22,t7+=38*t23,t8+=38*t24,t9+=38*t25,t10+=38*t26,t11+=38*t27,t12+=38*t28,t13+=38*t29,t14+=38*t30,c=1,v=t0+c+65535,c=Math.floor(v/65536),t0=v-65536*c,v=t1+c+65535,c=Math.floor(v/65536),t1=v-65536*c,v=t2+c+65535,c=Math.floor(v/65536),t2=v-65536*c,v=t3+c+65535,c=Math.floor(v/65536),t3=v-65536*c,v=t4+c+65535,c=Math.floor(v/65536),t4=v-65536*c,v=t5+c+65535,c=Math.floor(v/65536),t5=v-65536*c,v=t6+c+65535,c=Math.floor(v/65536),t6=v-65536*c,v=t7+c+65535,c=Math.floor(v/65536),t7=v-65536*c,v=t8+c+65535,c=Math.floor(v/65536),t8=v-65536*c,v=t9+c+65535,c=Math.floor(v/65536),t9=v-65536*c,v=t10+c+65535,c=Math.floor(v/65536),t10=v-65536*c,v=t11+c+65535,c=Math.floor(v/65536),t11=v-65536*c,v=t12+c+65535,c=Math.floor(v/65536),t12=v-65536*c,v=t13+c+65535,c=Math.floor(v/65536),t13=v-65536*c,v=t14+c+65535,c=Math.floor(v/65536),t14=v-65536*c,v=t15+c+65535,c=Math.floor(v/65536),t15=v-65536*c,t0+=c-1+37*(c-1),c=1,v=t0+c+65535,c=Math.floor(v/65536),t0=v-65536*c,v=t1+c+65535,c=Math.floor(v/65536),t1=v-65536*c,v=t2+c+65535,c=Math.floor(v/65536),t2=v-65536*c,v=t3+c+65535,c=Math.floor(v/65536),t3=v-65536*c,v=t4+c+65535,c=Math.floor(v/65536),t4=v-65536*c,v=t5+c+65535,c=Math.floor(v/65536),t5=v-65536*c,v=t6+c+65535,c=Math.floor(v/65536),t6=v-65536*c,v=t7+c+65535,c=Math.floor(v/65536),t7=v-65536*c,v=t8+c+65535,c=Math.floor(v/65536),t8=v-65536*c,v=t9+c+65535,c=Math.floor(v/65536),t9=v-65536*c,v=t10+c+65535,c=Math.floor(v/65536),t10=v-65536*c,v=t11+c+65535,c=Math.floor(v/65536),t11=v-65536*c,v=t12+c+65535,c=Math.floor(v/65536),t12=v-65536*c,v=t13+c+65535,c=Math.floor(v/65536),t13=v-65536*c,v=t14+c+65535,c=Math.floor(v/65536),t14=v-65536*c,v=t15+c+65535,c=Math.floor(v/65536),t15=v-65536*c,t0+=c-1+37*(c-1),o[0]=t0,o[1]=t1,o[2]=t2,o[3]=t3,o[4]=t4,o[5]=t5,o[6]=t6,o[7]=t7,o[8]=t8,o[9]=t9,o[10]=t10,o[11]=t11,o[12]=t12;o[13]=t13,o[14]=t14,o[15]=t15}function S(o,a){M(o,a,a)}function inv25519(o,i){var a,c=gf();for(a=0;a<16;a++)c[a]=i[a];for(a=253;a>=0;a--)S(c,c),2!==a&&4!==a&&M(c,c,i);for(a=0;a<16;a++)o[a]=c[a]}function pow2523(o,i){var a,c=gf();for(a=0;a<16;a++)c[a]=i[a];for(a=250;a>=0;a--)S(c,c),1!==a&&M(c,c,i);for(a=0;a<16;a++)o[a]=c[a]}function crypto_scalarmult(q,n,p){var r,i,z=new Uint8Array(32),x=new Float64Array(80),a=gf(),b=gf(),c=gf(),d=gf(),e=gf(),f=gf();for(i=0;i<31;i++)z[i]=n[i];for(z[31]=127&n[31]|64,z[0]&=248,unpack25519(x,p),i=0;i<16;i++)b[i]=x[i],d[i]=a[i]=c[i]=0;for(a[0]=d[0]=1,i=254;i>=0;--i)r=z[i>>>3]>>>(7&i)&1,sel25519(a,b,r),sel25519(c,d,r),A(e,a,c),Z(a,a,c),A(c,b,d),Z(b,b,d),S(d,e),S(f,a),M(a,c,a),M(c,b,e),A(e,a,c),Z(a,a,c),S(b,a),Z(c,d,f),M(a,c,_121665),A(a,a,d),M(c,c,a),M(a,d,f),M(d,b,x),S(b,e),sel25519(a,b,r),sel25519(c,d,r);for(i=0;i<16;i++)x[i+16]=a[i],x[i+32]=c[i],x[i+48]=b[i],x[i+64]=d[i];var x32=x.subarray(32),x16=x.subarray(16);return inv25519(x32,x32),M(x16,x16,x32),pack25519(q,x16),0}function crypto_scalarmult_base(q,n){return crypto_scalarmult(q,n,_9)}function crypto_box_keypair(y,x){return randombytes(x,32),crypto_scalarmult_base(y,x)}function crypto_box_beforenm(k,y,x){var s=new Uint8Array(32);return crypto_scalarmult(s,x,y),crypto_core_hsalsa20(k,_0,s,sigma)}function crypto_box(c,m,d,n,y,x){var k=new Uint8Array(32);return crypto_box_beforenm(k,y,x),crypto_box_afternm(c,m,d,n,k)}function crypto_box_open(m,c,d,n,y,x){var k=new Uint8Array(32);return crypto_box_beforenm(k,y,x),crypto_box_open_afternm(m,c,d,n,k)}function crypto_hashblocks_hl(hh,hl,m,n){for(var bh0,bh1,bh2,bh3,bh4,bh5,bh6,bh7,bl0,bl1,bl2,bl3,bl4,bl5,bl6,bl7,th,tl,i,j,h,l,a,b,c,d,wh=new Int32Array(16),wl=new Int32Array(16),ah0=hh[0],ah1=hh[1],ah2=hh[2],ah3=hh[3],ah4=hh[4],ah5=hh[5],ah6=hh[6],ah7=hh[7],al0=hl[0],al1=hl[1],al2=hl[2],al3=hl[3],al4=hl[4],al5=hl[5],al6=hl[6],al7=hl[7],pos=0;n>=128;){for(i=0;i<16;i++)j=8*i+pos,wh[i]=m[j+0]<<24|m[j+1]<<16|m[j+2]<<8|m[j+3],wl[i]=m[j+4]<<24|m[j+5]<<16|m[j+6]<<8|m[j+7];for(i=0;i<80;i++)if(bh0=ah0,bh1=ah1,bh2=ah2,bh3=ah3,bh4=ah4,bh5=ah5,bh6=ah6,bh7=ah7,bl0=al0,bl1=al1,bl2=al2,bl3=al3,bl4=al4,bl5=al5,bl6=al6,bl7=al7,h=ah7,l=al7,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=(ah4>>>14|al4<<18)^(ah4>>>18|al4<<14)^(al4>>>9|ah4<<23),l=(al4>>>14|ah4<<18)^(al4>>>18|ah4<<14)^(ah4>>>9|al4<<23),a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,h=ah4&ah5^~ah4&ah6,l=al4&al5^~al4&al6,a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,h=K[2*i],l=K[2*i+1],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,h=wh[i%16],l=wl[i%16],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,th=65535&c|d<<16,tl=65535&a|b<<16,h=th,l=tl,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=(ah0>>>28|al0<<4)^(al0>>>2|ah0<<30)^(al0>>>7|ah0<<25),l=(al0>>>28|ah0<<4)^(ah0>>>2|al0<<30)^(ah0>>>7|al0<<25),a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,h=ah0&ah1^ah0&ah2^ah1&ah2,l=al0&al1^al0&al2^al1&al2,a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,bh7=65535&c|d<<16,bl7=65535&a|b<<16,h=bh3,l=bl3,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=th,l=tl,a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,bh3=65535&c|d<<16,bl3=65535&a|b<<16,ah1=bh0,ah2=bh1,ah3=bh2,ah4=bh3,ah5=bh4,ah6=bh5,ah7=bh6,ah0=bh7,al1=bl0,al2=bl1,al3=bl2,al4=bl3,al5=bl4,al6=bl5,al7=bl6,al0=bl7,i%16==15)for(j=0;j<16;j++)h=wh[j],l=wl[j],a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=wh[(j+9)%16],l=wl[(j+9)%16],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,th=wh[(j+1)%16],tl=wl[(j+1)%16],h=(th>>>1|tl<<31)^(th>>>8|tl<<24)^th>>>7,l=(tl>>>1|th<<31)^(tl>>>8|th<<24)^(tl>>>7|th<<25),a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,th=wh[(j+14)%16],tl=wl[(j+14)%16],h=(th>>>19|tl<<13)^(tl>>>29|th<<3)^th>>>6,l=(tl>>>19|th<<13)^(th>>>29|tl<<3)^(tl>>>6|th<<26),a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,wh[j]=65535&c|d<<16,wl[j]=65535&a|b<<16;h=ah0,l=al0,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[0],l=hl[0],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[0]=ah0=65535&c|d<<16,hl[0]=al0=65535&a|b<<16,h=ah1,l=al1,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[1],l=hl[1],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[1]=ah1=65535&c|d<<16,hl[1]=al1=65535&a|b<<16,h=ah2,l=al2,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[2],l=hl[2],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[2]=ah2=65535&c|d<<16,hl[2]=al2=65535&a|b<<16,h=ah3,l=al3,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[3],l=hl[3],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[3]=ah3=65535&c|d<<16,hl[3]=al3=65535&a|b<<16,h=ah4,l=al4,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[4],l=hl[4],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[4]=ah4=65535&c|d<<16,hl[4]=al4=65535&a|b<<16,h=ah5,l=al5,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[5],l=hl[5],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[5]=ah5=65535&c|d<<16,hl[5]=al5=65535&a|b<<16,h=ah6,l=al6,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[6],l=hl[6],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[6]=ah6=65535&c|d<<16,hl[6]=al6=65535&a|b<<16,h=ah7,l=al7,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[7],l=hl[7],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[7]=ah7=65535&c|d<<16,hl[7]=al7=65535&a|b<<16,pos+=128,n-=128}return n}function crypto_hash(out,m,n){var i,hh=new Int32Array(8),hl=new Int32Array(8),x=new Uint8Array(256),b=n;for(hh[0]=1779033703,hh[1]=3144134277,hh[2]=1013904242,hh[3]=2773480762,hh[4]=1359893119,hh[5]=2600822924,hh[6]=528734635,hh[7]=1541459225,hl[0]=4089235720,hl[1]=2227873595,hl[2]=4271175723,hl[3]=1595750129,hl[4]=2917565137,hl[5]=725511199,hl[6]=4215389547,hl[7]=327033209,crypto_hashblocks_hl(hh,hl,m,n),n%=128,i=0;i=0;--i)b=s[i/8|0]>>(7&i)&1,cswap(p,q,b),add(q,p),add(p,p),cswap(p,q,b)}function scalarbase(p,s){var q=[gf(),gf(),gf(),gf()];set25519(q[0],X),set25519(q[1],Y),set25519(q[2],gf1),M(q[3],X,Y),scalarmult(p,q,s)}function crypto_sign_keypair(pk,sk,seeded){var i,d=new Uint8Array(64),p=[gf(),gf(),gf(),gf()];for(seeded||randombytes(sk,32),crypto_hash(d,sk,32),d[0]&=248,d[31]&=127,d[31]|=64,scalarbase(p,d),pack(pk,p),i=0;i<32;i++)sk[i+32]=pk[i];return 0}function modL(r,x){var carry,i,j,k;for(i=63;i>=32;--i){for(carry=0,j=i-32,k=i-12;j>8,x[j]-=256*carry;x[j]+=carry,x[i]=0}for(carry=0,j=0;j<32;j++)x[j]+=carry-(x[31]>>4)*L[j],carry=x[j]>>8,x[j]&=255;for(j=0;j<32;j++)x[j]-=carry*L[j];for(i=0;i<32;i++)x[i+1]+=x[i]>>8,r[i]=255&x[i]}function reduce(r){var i,x=new Float64Array(64);for(i=0;i<64;i++)x[i]=r[i];for(i=0;i<64;i++)r[i]=0;modL(r,x)}function crypto_sign(sm,m,n,sk){var i,j,d=new Uint8Array(64),h=new Uint8Array(64),r=new Uint8Array(64),x=new Float64Array(64),p=[gf(),gf(),gf(),gf()];crypto_hash(d,sk,32),d[0]&=248,d[31]&=127,d[31]|=64;var smlen=n+64;for(i=0;i>7&&Z(r[0],gf0,r[0]),M(r[3],r[0],r[1]),0)}function crypto_sign_open(m,sm,n,pk){var i,t=new Uint8Array(32),h=new Uint8Array(64),p=[gf(),gf(),gf(),gf()],q=[gf(),gf(),gf(),gf()];if(-1,n<64)return-1;if(unpackneg(q,pk))return-1;for(i=0;i>>13|t1<<3),t2=255&key[4]|(255&key[5])<<8,this.r[2]=7939&(t1>>>10|t2<<6),t3=255&key[6]|(255&key[7])<<8,this.r[3]=8191&(t2>>>7|t3<<9),t4=255&key[8]|(255&key[9])<<8,this.r[4]=255&(t3>>>4|t4<<12),this.r[5]=t4>>>1&8190,t5=255&key[10]|(255&key[11])<<8,this.r[6]=8191&(t4>>>14|t5<<2),t6=255&key[12]|(255&key[13])<<8,this.r[7]=8065&(t5>>>11|t6<<5),t7=255&key[14]|(255&key[15])<<8,this.r[8]=8191&(t6>>>8|t7<<8),this.r[9]=t7>>>5&127,this.pad[0]=255&key[16]|(255&key[17])<<8, +this.pad[1]=255&key[18]|(255&key[19])<<8,this.pad[2]=255&key[20]|(255&key[21])<<8,this.pad[3]=255&key[22]|(255&key[23])<<8,this.pad[4]=255&key[24]|(255&key[25])<<8,this.pad[5]=255&key[26]|(255&key[27])<<8,this.pad[6]=255&key[28]|(255&key[29])<<8,this.pad[7]=255&key[30]|(255&key[31])<<8};poly1305.prototype.blocks=function(m,mpos,bytes){for(var t0,t1,t2,t3,t4,t5,t6,t7,c,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,hibit=this.fin?0:2048,h0=this.h[0],h1=this.h[1],h2=this.h[2],h3=this.h[3],h4=this.h[4],h5=this.h[5],h6=this.h[6],h7=this.h[7],h8=this.h[8],h9=this.h[9],r0=this.r[0],r1=this.r[1],r2=this.r[2],r3=this.r[3],r4=this.r[4],r5=this.r[5],r6=this.r[6],r7=this.r[7],r8=this.r[8],r9=this.r[9];bytes>=16;)t0=255&m[mpos+0]|(255&m[mpos+1])<<8,h0+=8191&t0,t1=255&m[mpos+2]|(255&m[mpos+3])<<8,h1+=8191&(t0>>>13|t1<<3),t2=255&m[mpos+4]|(255&m[mpos+5])<<8,h2+=8191&(t1>>>10|t2<<6),t3=255&m[mpos+6]|(255&m[mpos+7])<<8,h3+=8191&(t2>>>7|t3<<9),t4=255&m[mpos+8]|(255&m[mpos+9])<<8,h4+=8191&(t3>>>4|t4<<12),h5+=t4>>>1&8191,t5=255&m[mpos+10]|(255&m[mpos+11])<<8,h6+=8191&(t4>>>14|t5<<2),t6=255&m[mpos+12]|(255&m[mpos+13])<<8,h7+=8191&(t5>>>11|t6<<5),t7=255&m[mpos+14]|(255&m[mpos+15])<<8,h8+=8191&(t6>>>8|t7<<8),h9+=t7>>>5|hibit,c=0,d0=c,d0+=h0*r0,d0+=h1*(5*r9),d0+=h2*(5*r8),d0+=h3*(5*r7),d0+=h4*(5*r6),c=d0>>>13,d0&=8191,d0+=h5*(5*r5),d0+=h6*(5*r4),d0+=h7*(5*r3),d0+=h8*(5*r2),d0+=h9*(5*r1),c+=d0>>>13,d0&=8191,d1=c,d1+=h0*r1,d1+=h1*r0,d1+=h2*(5*r9),d1+=h3*(5*r8),d1+=h4*(5*r7),c=d1>>>13,d1&=8191,d1+=h5*(5*r6),d1+=h6*(5*r5),d1+=h7*(5*r4),d1+=h8*(5*r3),d1+=h9*(5*r2),c+=d1>>>13,d1&=8191,d2=c,d2+=h0*r2,d2+=h1*r1,d2+=h2*r0,d2+=h3*(5*r9),d2+=h4*(5*r8),c=d2>>>13,d2&=8191,d2+=h5*(5*r7),d2+=h6*(5*r6),d2+=h7*(5*r5),d2+=h8*(5*r4),d2+=h9*(5*r3),c+=d2>>>13,d2&=8191,d3=c,d3+=h0*r3,d3+=h1*r2,d3+=h2*r1,d3+=h3*r0,d3+=h4*(5*r9),c=d3>>>13,d3&=8191,d3+=h5*(5*r8),d3+=h6*(5*r7),d3+=h7*(5*r6),d3+=h8*(5*r5),d3+=h9*(5*r4),c+=d3>>>13,d3&=8191,d4=c,d4+=h0*r4,d4+=h1*r3,d4+=h2*r2,d4+=h3*r1,d4+=h4*r0,c=d4>>>13,d4&=8191,d4+=h5*(5*r9),d4+=h6*(5*r8),d4+=h7*(5*r7),d4+=h8*(5*r6),d4+=h9*(5*r5),c+=d4>>>13,d4&=8191,d5=c,d5+=h0*r5,d5+=h1*r4,d5+=h2*r3,d5+=h3*r2,d5+=h4*r1,c=d5>>>13,d5&=8191,d5+=h5*r0,d5+=h6*(5*r9),d5+=h7*(5*r8),d5+=h8*(5*r7),d5+=h9*(5*r6),c+=d5>>>13,d5&=8191,d6=c,d6+=h0*r6,d6+=h1*r5,d6+=h2*r4,d6+=h3*r3,d6+=h4*r2,c=d6>>>13,d6&=8191,d6+=h5*r1,d6+=h6*r0,d6+=h7*(5*r9),d6+=h8*(5*r8),d6+=h9*(5*r7),c+=d6>>>13,d6&=8191,d7=c,d7+=h0*r7,d7+=h1*r6,d7+=h2*r5,d7+=h3*r4,d7+=h4*r3,c=d7>>>13,d7&=8191,d7+=h5*r2,d7+=h6*r1,d7+=h7*r0,d7+=h8*(5*r9),d7+=h9*(5*r8),c+=d7>>>13,d7&=8191,d8=c,d8+=h0*r8,d8+=h1*r7,d8+=h2*r6,d8+=h3*r5,d8+=h4*r4,c=d8>>>13,d8&=8191,d8+=h5*r3,d8+=h6*r2,d8+=h7*r1,d8+=h8*r0,d8+=h9*(5*r9),c+=d8>>>13,d8&=8191,d9=c,d9+=h0*r9,d9+=h1*r8,d9+=h2*r7,d9+=h3*r6,d9+=h4*r5,c=d9>>>13,d9&=8191,d9+=h5*r4,d9+=h6*r3,d9+=h7*r2,d9+=h8*r1,d9+=h9*r0,c+=d9>>>13,d9&=8191,c=(c<<2)+c|0,c=c+d0|0,d0=8191&c,c>>>=13,d1+=c,h0=d0,h1=d1,h2=d2,h3=d3,h4=d4,h5=d5,h6=d6,h7=d7,h8=d8,h9=d9,mpos+=16,bytes-=16;this.h[0]=h0,this.h[1]=h1,this.h[2]=h2,this.h[3]=h3,this.h[4]=h4,this.h[5]=h5,this.h[6]=h6,this.h[7]=h7,this.h[8]=h8,this.h[9]=h9},poly1305.prototype.finish=function(mac,macpos){var c,mask,f,i,g=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(c=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=c,c=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*c,c=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=c,c=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=c,g[0]=this.h[0]+5,c=g[0]>>>13,g[0]&=8191,i=1;i<10;i++)g[i]=this.h[i]+c,c=g[i]>>>13,g[i]&=8191;for(g[9]-=8192,mask=(1^c)-1,i=0;i<10;i++)g[i]&=mask;for(mask=~mask,i=0;i<10;i++)this.h[i]=this.h[i]&mask|g[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),f=this.h[0]+this.pad[0],this.h[0]=65535&f,i=1;i<8;i++)f=(this.h[i]+this.pad[i]|0)+(f>>>16)|0,this.h[i]=65535&f;mac[macpos+0]=this.h[0]>>>0&255,mac[macpos+1]=this.h[0]>>>8&255,mac[macpos+2]=this.h[1]>>>0&255,mac[macpos+3]=this.h[1]>>>8&255,mac[macpos+4]=this.h[2]>>>0&255,mac[macpos+5]=this.h[2]>>>8&255,mac[macpos+6]=this.h[3]>>>0&255,mac[macpos+7]=this.h[3]>>>8&255,mac[macpos+8]=this.h[4]>>>0&255,mac[macpos+9]=this.h[4]>>>8&255,mac[macpos+10]=this.h[5]>>>0&255,mac[macpos+11]=this.h[5]>>>8&255,mac[macpos+12]=this.h[6]>>>0&255,mac[macpos+13]=this.h[6]>>>8&255,mac[macpos+14]=this.h[7]>>>0&255,mac[macpos+15]=this.h[7]>>>8&255},poly1305.prototype.update=function(m,mpos,bytes){var i,want;if(this.leftover){for(want=16-this.leftover,want>bytes&&(want=bytes),i=0;i=16&&(want=bytes-bytes%16,this.blocks(m,mpos,want),mpos+=want,bytes-=want),bytes){for(i=0;i=0},nacl.sign.keyPair=function(){var pk=new Uint8Array(32),sk=new Uint8Array(64);return crypto_sign_keypair(pk,sk),{publicKey:pk,secretKey:sk}},nacl.sign.keyPair.fromSecretKey=function(secretKey){if(checkArrayTypes(),64!==secretKey.length)throw new Error("bad secret key size");for(var pk=new Uint8Array(32),i=0;i>>((3&i)<<3)&255;return rnds}}module.exports=rng}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const varint=__webpack_require__(15);module.exports=(buf=>{if(!Buffer.isBuffer(buf))throw new Error("arg needs to be a buffer");let result=[];for(;buf.length>0;){const num=varint.decode(buf);result.push(num),buf=buf.slice(varint.decode.bytes)}return result})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports){function read(buf,offset){var b,res=0,offset=offset||0,shift=0,counter=offset,l=buf.length;do{if(counter>=l)throw read.bytes=0,new RangeError("Could not decode varint");b=buf[counter++],res+=shift<28?(b&REST)<=MSB);return read.bytes=counter-offset,res}module.exports=read;var MSB=128,REST=127},function(module,exports){function encode(num,out,offset){out=out||[],offset=offset||0;for(var oldOffset=offset;num>=INT;)out[offset++]=255&num|MSB,num/=128;for(;num&MSBALL;)out[offset++]=255&num|MSB,num>>>=7;return out[offset]=0|num,encode.bytes=offset-oldOffset+1,out}module.exports=encode;var MSB=128,MSBALL=-128,INT=Math.pow(2,31)},function(module,exports){var N1=Math.pow(2,7),N2=Math.pow(2,14),N3=Math.pow(2,21),N4=Math.pow(2,28),N5=Math.pow(2,35),N6=Math.pow(2,42),N7=Math.pow(2,49),N8=Math.pow(2,56),N9=Math.pow(2,63);module.exports=function(value){return value2&&(prv=!0,info.shift());var jwk={ext:!0};switch(info[0][0]){case"1.2.840.113549.1.1.1":var rsaComp=["n","e","d","p","q","dp","dq","qi"],rsaKey=b2der(info[1]);prv&&rsaKey.shift();for(var i=0;i2&&(prv=!0,rsaKey.unshift(new Uint8Array([0]))),info[0][0]="1.2.840.113549.1.1.1",key=rsaKey;break;default:throw new TypeError("Unsupported key type")}return info.push(new Uint8Array(der2b(key)).buffer),prv?info.unshift(new Uint8Array([0])):info[1]={tag:3,value:info[1]},new Uint8Array(der2b(info)).buffer}function b2der(buf,ctx){if(buf instanceof ArrayBuffer&&(buf=new Uint8Array(buf)),ctx||(ctx={pos:0,end:buf.length}),ctx.end-ctx.pos<2||ctx.end>buf.length)throw new RangeError("Malformed DER");var tag=buf[ctx.pos++],len=buf[ctx.pos++];if(len>=128){if(len&=127,ctx.end-ctx.pos=128){var xlen=len,len=4;for(buf.splice(pos,0,xlen>>24&255,xlen>>16&255,xlen>>8&255,255&xlen);len>1&&!(xlen>>24);)xlen<<=8,len--;len<4&&buf.splice(pos,4-len),len|=128}return buf.splice(pos-2,2,tag,len),buf}function CryptoKey(key,alg,ext,use){Object.defineProperties(this,{_key:{value:key},type:{value:key.type,enumerable:!0},extractable:{value:void 0===ext?key.extractable:ext,enumerable:!0},algorithm:{value:void 0===alg?key.algorithm:alg,enumerable:!0},usages:{value:void 0===use?key.usages:use,enumerable:!0}})}function isPubKeyUse(u){return"verify"===u||"encrypt"===u||"wrapKey"===u}function isPrvKeyUse(u){return"sign"===u||"decrypt"===u||"unwrapKey"===u}if("function"!=typeof Promise)throw"Promise support required";var _crypto=global.crypto||global.msCrypto;if(_crypto){var _subtle=_crypto.subtle||_crypto.webkitSubtle;if(_subtle){var _Crypto=global.Crypto||_crypto.constructor||Object,_SubtleCrypto=global.SubtleCrypto||_subtle.constructor||Object,isEdge=(global.CryptoKey||global.Key||Object,global.navigator.userAgent.indexOf("Edge/")>-1),isIE=!!global.msCrypto&&!isEdge,isWebkit=!!_crypto.webkitSubtle;if(isIE||isWebkit){var oid2str={KoZIhvcNAQEB:"1.2.840.113549.1.1.1"},str2oid={"1.2.840.113549.1.1.1":"KoZIhvcNAQEB"};if(["generateKey","importKey","unwrapKey"].forEach(function(m){var _fn=_subtle[m];_subtle[m]=function(a,b,c){var ka,kx,ku,args=[].slice.call(arguments);switch(m){case"generateKey":ka=alg(a),kx=b,ku=c;break;case"importKey":ka=alg(c),kx=args[3],ku=args[4],"jwk"===a&&(b=b2jwk(b),b.alg||(b.alg=jwkAlg(ka)),b.key_ops||(b.key_ops="oct"!==b.kty?"d"in b?ku.filter(isPrvKeyUse):ku.filter(isPubKeyUse):ku.slice()),args[1]=jwk2b(b));break;case"unwrapKey":ka=args[4],kx=args[5],ku=args[6],args[2]=c._key}if("generateKey"===m&&"HMAC"===ka.name&&ka.hash)return ka.length=ka.length||{"SHA-1":512,"SHA-256":512,"SHA-384":1024,"SHA-512":1024}[ka.hash.name],_subtle.importKey("raw",_crypto.getRandomValues(new Uint8Array(ka.length+7>>3)),ka,kx,ku);if(isWebkit&&"generateKey"===m&&"RSASSA-PKCS1-v1_5"===ka.name&&(!ka.modulusLength||ka.modulusLength>=2048))return a=alg(a),a.name="RSAES-PKCS1-v1_5",delete a.hash,_subtle.generateKey(a,!0,["encrypt","decrypt"]).then(function(k){return Promise.all([_subtle.exportKey("jwk",k.publicKey),_subtle.exportKey("jwk",k.privateKey)])}).then(function(keys){return keys[0].alg=keys[1].alg=jwkAlg(ka),keys[0].key_ops=ku.filter(isPubKeyUse),keys[1].key_ops=ku.filter(isPrvKeyUse),Promise.all([_subtle.importKey("jwk",keys[0],ka,!0,keys[0].key_ops),_subtle.importKey("jwk",keys[1],ka,kx,keys[1].key_ops)])}).then(function(keys){return{publicKey:keys[0],privateKey:keys[1]}});if((isWebkit||isIE&&"SHA-1"===(ka.hash||{}).name)&&"importKey"===m&&"jwk"===a&&"HMAC"===ka.name&&"oct"===b.kty)return _subtle.importKey("raw",s2b(a2s(b.k)),c,args[3],args[4]);if(isWebkit&&"importKey"===m&&("spki"===a||"pkcs8"===a))return _subtle.importKey("jwk",pkcs2jwk(b),c,args[3],args[4]);if(isIE&&"unwrapKey"===m)return _subtle.decrypt(args[3],c,b).then(function(k){return _subtle.importKey(a,k,args[4],args[5],args[6])});var op;try{op=_fn.apply(_subtle,args)}catch(e){return Promise.reject(e)}return isIE&&(op=new Promise(function(res,rej){op.onabort=op.onerror=function(e){rej(e)},op.oncomplete=function(r){res(r.target.result)}})),op=op.then(function(k){return"HMAC"===ka.name&&(ka.length||(ka.length=8*k.algorithm.length)),0==ka.name.search("RSA")&&(ka.modulusLength||(ka.modulusLength=(k.publicKey||k).algorithm.modulusLength),ka.publicExponent||(ka.publicExponent=(k.publicKey||k).algorithm.publicExponent)),k=k.publicKey&&k.privateKey?{publicKey:new CryptoKey(k.publicKey,ka,kx,ku.filter(isPubKeyUse)),privateKey:new CryptoKey(k.privateKey,ka,kx,ku.filter(isPrvKeyUse))}:new CryptoKey(k,ka,kx,ku)})}}),["exportKey","wrapKey"].forEach(function(m){var _fn=_subtle[m];_subtle[m]=function(a,b,c){var args=[].slice.call(arguments);switch(m){case"exportKey":args[1]=b._key;break;case"wrapKey":args[1]=b._key,args[2]=c._key}if((isWebkit||isIE&&"SHA-1"===(b.algorithm.hash||{}).name)&&"exportKey"===m&&"jwk"===a&&"HMAC"===b.algorithm.name&&(args[0]="raw"),!isWebkit||"exportKey"!==m||"spki"!==a&&"pkcs8"!==a||(args[0]="jwk"),isIE&&"wrapKey"===m)return _subtle.exportKey(a,b).then(function(k){return"jwk"===a&&(k=s2b(unescape(encodeURIComponent(JSON.stringify(b2jwk(k)))))),_subtle.encrypt(args[3],c,k)});var op;try{op=_fn.apply(_subtle,args)}catch(e){return Promise.reject(e)}return isIE&&(op=new Promise(function(res,rej){op.onabort=op.onerror=function(e){rej(e)},op.oncomplete=function(r){res(r.target.result)}})),"exportKey"===m&&"jwk"===a&&(op=op.then(function(k){return(isWebkit||isIE&&"SHA-1"===(b.algorithm.hash||{}).name)&&"HMAC"===b.algorithm.name?{kty:"oct",alg:jwkAlg(b.algorithm),key_ops:b.usages.slice(),ext:!0,k:s2a(b2s(k))}:(k=b2jwk(k),k.alg||(k.alg=jwkAlg(b.algorithm)),k.key_ops||(k.key_ops="public"===b.type?b.usages.filter(isPubKeyUse):"private"===b.type?b.usages.filter(isPrvKeyUse):b.usages.slice()),k)})),!isWebkit||"exportKey"!==m||"spki"!==a&&"pkcs8"!==a||(op=op.then(function(k){return k=jwk2pkcs(b2jwk(k))})),op}}),["encrypt","decrypt","sign","verify"].forEach(function(m){var _fn=_subtle[m];_subtle[m]=function(a,b,c,d){if(isIE&&(!c.byteLength||d&&!d.byteLength))throw new Error("Empy input is not allowed");var args=[].slice.call(arguments),ka=alg(a);if(isIE&&"decrypt"===m&&"AES-GCM"===ka.name){var tl=a.tagLength>>3;args[2]=(c.buffer||c).slice(0,c.byteLength-tl),a.tag=(c.buffer||c).slice(c.byteLength-tl)}args[1]=b._key;var op;try{op=_fn.apply(_subtle,args)}catch(e){return Promise.reject(e)}return isIE&&(op=new Promise(function(res,rej){op.onabort=op.onerror=function(e){rej(e)},op.oncomplete=function(r){var r=r.target.result;if("encrypt"===m&&r instanceof AesGcmEncryptResult){var c=r.ciphertext,t=r.tag;r=new Uint8Array(c.byteLength+t.byteLength),r.set(new Uint8Array(c),0),r.set(new Uint8Array(t),c.byteLength),r=r.buffer}res(r)}})),op}}),isIE){var _digest=_subtle.digest;_subtle.digest=function(a,b){if(!b.byteLength)throw new Error("Empy input is not allowed");var op;try{op=_digest.call(_subtle,a,b)}catch(e){return Promise.reject(e)}return op=new Promise(function(res,rej){op.onabort=op.onerror=function(e){rej(e)},op.oncomplete=function(r){res(r.target.result)}})},global.crypto=Object.create(_crypto,{getRandomValues:{value:function(a){return _crypto.getRandomValues(a)}},subtle:{value:_subtle}}),global.CryptoKey=CryptoKey}isWebkit&&(_crypto.subtle=_subtle,global.Crypto=_Crypto,global.SubtleCrypto=_SubtleCrypto,global.CryptoKey=CryptoKey)}}}}},function(module,exports){var prefix,version;self.mozRTCPeerConnection||navigator.mozGetUserMedia?(prefix="moz",version=parseInt(navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1],10)):(self.webkitRTCPeerConnection||navigator.webkitGetUserMedia)&&(prefix="webkit", +version=navigator.userAgent.match(/Chrom(e|ium)/)&&parseInt(navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)[2],10));var PC=self.RTCPeerConnection||self.mozRTCPeerConnection||self.webkitRTCPeerConnection,IceCandidate=self.mozRTCIceCandidate||self.RTCIceCandidate,SessionDescription=self.mozRTCSessionDescription||self.RTCSessionDescription,MediaStream=self.webkitMediaStream||self.MediaStream,screenSharing="https:"===self.location.protocol&&("webkit"===prefix&&version>=26||"moz"===prefix&&version>=33),AudioContext=self.AudioContext||self.webkitAudioContext,videoEl=self.document&&document.createElement("video"),supportVp8=videoEl&&videoEl.canPlayType&&"probably"===videoEl.canPlayType('video/webm; codecs="vp8", vorbis'),getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.msGetUserMedia||navigator.mozGetUserMedia;module.exports={prefix:prefix,browserVersion:version,support:!!PC&&!!getUserMedia,supportRTCPeerConnection:!!PC,supportVp8:supportVp8,supportGetUserMedia:!!getUserMedia,supportDataChannel:!!(PC&&PC.prototype&&PC.prototype.createDataChannel),supportWebAudio:!(!AudioContext||!AudioContext.prototype.createMediaStreamSource),supportMediaStream:!(!MediaStream||!MediaStream.prototype.removeTrack),supportScreenSharing:!!screenSharing,AudioContext:AudioContext,PeerConnection:PC,SessionDescription:SessionDescription,IceCandidate:IceCandidate,MediaStream:MediaStream,getUserMedia:getUserMedia}},function(module,exports,__webpack_require__){"use strict";const waterfall=__webpack_require__(7),series=__webpack_require__(33),extend=__webpack_require__(175);module.exports=(self=>{self.log("booting");const options=self._options,doInit=options.init,doStart=options.start,config=options.config,setConfig=config&&"object"==typeof config,repoOpen=!self._repo.closed,customInitOptions="object"==typeof options.init?options.init:{},initOptions=Object.assign({bits:2048},customInitOptions),maybeOpenRepo=cb=>{if(repoOpen)return cb(null,!0);series([cb=>self._repo.open(cb),cb=>self.preStart(cb),cb=>{self.state.initialized(),cb(null,!0)}],(err,res)=>{if(err)return err.message.match(/not found/)||err.message.match(/ENOENT/)||err.message.match(/No value/)?cb(null,!1):cb(err);cb(null,res)})},done=err=>{if(err)return self.emit("error",err);self.emit("ready"),self.log("boot:done",err)},tasks=[];maybeOpenRepo((err,hasRepo)=>{if(err)return done(err);if(doInit&&!hasRepo&&(tasks.push(cb=>self.init(initOptions,cb)),hasRepo=!0),setConfig&&(hasRepo?tasks.push(cb=>{waterfall([cb=>self.config.get(cb),(config,cb)=>{extend(config,options.config),self.config.replace(config,cb)}],cb)}):console.log('WARNING, trying to set config on uninitialized repo, maybe forgot to set "init: true"')),doStart){if(!hasRepo)return console.log('WARNING, trying to start ipfs node on uninitialized repo, maybe forgot to set "init: true"'),done(new Error("Uninitalized repo"));tasks.push(cb=>self.start(cb))}series(tasks,done)})})},function(module,exports,__webpack_require__){"use strict";function formatWantlist(list){return Array.from(list).map(e=>e[1])}const OFFLINE_ERROR=__webpack_require__(148).OFFLINE_ERROR;module.exports=function(self){return{wantlist:()=>{if(!self.isOnline())throw OFFLINE_ERROR;return formatWantlist(self._bitswap.getWantlist())},stat:()=>{if(!self.isOnline())throw OFFLINE_ERROR;const stats=self._bitswap.stat();return stats.wantlist=formatWantlist(stats.wantlist),stats.peers=stats.peers.map(id=>id.toB58String()),stats},unwant:key=>{if(!self.isOnline())throw OFFLINE_ERROR}}}},function(module,exports,__webpack_require__){"use strict";function cleanCid(cid){return CID.isCID(cid)?cid:new CID(cid)}const Block=__webpack_require__(61),multihash=__webpack_require__(12),multihashing=__webpack_require__(21),CID=__webpack_require__(8),waterfall=__webpack_require__(7);module.exports=function(self){return{get:(cid,callback)=>{cid=cleanCid(cid),self._blockService.get(cid,callback)},put:(block,options,callback)=>{if("function"==typeof options&&(callback=options,options={}),Array.isArray(block))return callback(new Error("Array is not supported"));waterfall([cb=>{if(Block.isBlock(block))return cb(null,block);if(options.cid&&CID.isCID(options.cid))return cb(null,new Block(block,options.cid));const mhtype=options.mhtype||"sha2-256",format=options.format||"dag-pb",cidVersion=options.version||0;multihashing(block,mhtype,(err,multihash)=>{if(err)return cb(err);cb(null,new Block(block,new CID(cidVersion,format,multihash)))})},(block,cb)=>self._blockService.put(block,err=>{if(err)return cb(err);cb(null,block)})],callback)},rm:(cid,callback)=>{cid=cleanCid(cid),self._blockService.delete(cid,callback)},stat:(cid,callback)=>{cid=cleanCid(cid),self._blockService.get(cid,(err,block)=>{if(err)return callback(err);callback(null,{key:multihash.toB58String(cid.multihash),size:block.data.length})})}}}},function(module,exports,__webpack_require__){"use strict";const defaultNodes=__webpack_require__(207).Bootstrap;module.exports=function(self){return{list:callback=>{self._repo.config.get((err,config)=>{if(err)return callback(err);callback(null,{Peers:config.Bootstrap})})},add:(multiaddr,args,callback)=>{"function"==typeof args&&(callback=args,args={default:!1}),self._repo.config.get((err,config)=>{if(err)return callback(err);args.default?config.Bootstrap=defaultNodes:multiaddr&&config.Bootstrap.indexOf(multiaddr)===-1&&config.Bootstrap.push(multiaddr),self._repo.config.set(config,err=>{if(err)return callback(err);callback(null,{Peers:args.default?defaultNodes:[multiaddr]})})})},rm:(multiaddr,args,callback)=>{"function"==typeof args&&(callback=args,args={all:!1}),self._repo.config.get((err,config)=>{if(err)return callback(err);args.all?config.Bootstrap=[]:config.Bootstrap=config.Bootstrap.filter(mh=>mh!==multiaddr),self._repo.config.set(config,err=>{if(err)return callback(err);const res=[];!args.all&&multiaddr&&res.push(multiaddr),callback(null,{Peers:res})})})}}}},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(17);module.exports=function(self){return{get:promisify((key,callback)=>{return"function"==typeof key&&(callback=key,key=void 0),self._repo.config.get(key,callback)}),set:promisify((key,value,callback)=>{self._repo.config.set(key,value,callback)}),replace:promisify((config,callback)=>{self._repo.config.set(config,callback)})}}},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(17),CID=__webpack_require__(8),pull=__webpack_require__(4);module.exports=function(self){return{put:promisify((dagNode,options,callback)=>{self._ipldResolver.put(dagNode,options,callback)}),get:promisify((cid,path,options,callback)=>{if("function"==typeof path&&(callback=path,path=void 0),"function"==typeof options&&(callback=options,options={}),options=options||{},"string"==typeof cid){const split=cid.split("/");cid=new CID(split[0]),split.shift(),path=split.length>0?split.join("/"):"/"}self._ipldResolver.get(cid,path,options,callback)}),tree:promisify((cid,path,options,callback)=>{if("object"==typeof path&&(callback=options,options=path,path=void 0),"function"==typeof path&&(callback=path,path=void 0),"function"==typeof options&&(callback=options,options={}),options=options||{},"string"==typeof cid){const split=cid.split("/");cid=new CID(split[0]),split.shift(),path=split.length>0?split.join("/"):void 0}pull(self._ipldResolver.treeStream(cid,path,options),pull.collect(callback))})}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const promisify=__webpack_require__(17),every=__webpack_require__(290),PeerId=__webpack_require__(22),CID=__webpack_require__(8),each=__webpack_require__(19);module.exports=(self=>{return{get:promisify((key,options,callback)=>{if(!Buffer.isBuffer(key))return callback(new Error("Not valid key"));"function"==typeof options&&(callback=options,options={}),self._libp2pNode.dht.get(key,options.timeout,callback)}),put:promisify((key,value,callback)=>{if(!Buffer.isBuffer(key))return callback(new Error("Not valid key"));self._libp2pNode.dht.put(key,value,callback)}),findprovs:promisify((key,callback)=>{"string"==typeof key&&(key=new CID(key)),self._libp2pNode.contentRouting.findProviders(key,callback)}),findpeer:promisify((peer,callback)=>{"string"==typeof peer&&(peer=PeerId.createFromB58String(peer)),self._libp2pNode.peerRouting.findPeer(peer,(err,info)=>{if(err)return callback(err);callback(null,[{Responses:[{ID:info.id.toB58String(),Addresses:info.multiaddrs.toArray().map(a=>a.toString())}]}])})}),provide:promisify((keys,options,callback)=>{Array.isArray(keys)||(keys=[keys]),"function"==typeof options&&(callback=options,options={}),every(keys,(key,cb)=>{self._repo.blocks.has(key,cb)},(err,has)=>{if(err)return callback(err);options.recursive||each(keys,(cid,cb)=>{self._libp2pNode.contentRouting.provide(cid,cb)},callback)})}),query:promisify((peerId,callback)=>{"string"==typeof peerId&&(peerId=PeerId.createFromB58String(peerId)),self._libp2pNode._dht.getClosestPeers(peerId.toBytes(),(err,peerIds)=>{if(err)return callback(err);callback(null,peerIds.map(id=>{return{ID:id.toB58String()}}))})})}})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function prepareFile(self,file,callback){const bs58mh=multihashes.toB58String(file.multihash);waterfall([cb=>self.object.get(file.multihash,cb),(node,cb)=>{cb(null,{path:file.path||bs58mh,hash:bs58mh,size:node.size})}],callback)}function normalizeContent(content){return Array.isArray(content)||(content=[content]),content.map(data=>{return Buffer.isBuffer(data)&&(data={path:"",content:pull.values([data])}),isStream.readable(data)&&(data={path:"",content:toPull.source(data)}),data&&data.content&&"function"!=typeof data.content&&(Buffer.isBuffer(data.content)&&(data.content=pull.values([data.content])),isStream.readable(data.content)&&(data.content=toPull.source(data.content))),data})}function noop(){}const unixfsEngine=__webpack_require__(431),importer=unixfsEngine.importer,exporter=unixfsEngine.exporter,promisify=__webpack_require__(17),multihashes=__webpack_require__(12),pull=__webpack_require__(4),sort=__webpack_require__(602),pushable=__webpack_require__(30),toStream=__webpack_require__(251),toPull=__webpack_require__(146),waterfall=__webpack_require__(7),isStream=__webpack_require__(450),Duplex=__webpack_require__(36).Duplex;module.exports=function(self){const createAddPullStream=options=>{const opts=Object.assign({},{shardSplitThreshold:self._options.EXPERIMENTAL.sharding?1e3:1/0},options);return pull(pull.map(normalizeContent),pull.flatten(),importer(self._ipldResolver,opts),pull.asyncMap(prepareFile.bind(null,self)))};return{createAddStream:(options,callback)=>{"function"==typeof options&&(callback=options,options=void 0);const addPullStream=createAddPullStream(options),p=pushable(),s=pull(p,addPullStream),retStream=new AddStreamDuplex(s,p);retStream.once("finish",()=>p.end()),callback(null,retStream)},createAddPullStream:createAddPullStream,add:promisify((data,options,callback)=>{if("function"==typeof options?(callback=options,options=void 0):callback&&"function"==typeof callback||(callback=noop),"object"!=typeof data&&!Buffer.isBuffer(data)&&!isStream(data))return callback(new Error("Invalid arguments, data must be an object, Buffer or readable stream"));pull(pull.values(normalizeContent(data)),importer(self._ipldResolver,options),pull.asyncMap(prepareFile.bind(null,self)),sort((a,b)=>{return a.pathb.path?-1:0}),pull.collect(callback))}),cat:promisify((ipfsPath,callback)=>{if("function"==typeof ipfsPath)return callback(new Error("You must supply a ipfsPath"));pull(exporter(ipfsPath,self._ipldResolver),pull.collect((err,files)=>{if(err)return callback(err);callback(null,toStream.source(files[files.length-1].content))}))}),get:promisify((ipfsPath,callback)=>{callback(null,toStream.source(pull(exporter(ipfsPath,self._ipldResolver),pull.map(file=>{return file.content&&(file.content=toStream.source(file.content),file.content.pause()),file}))))}),getPull:promisify((ipfsPath,callback)=>{callback(null,exporter(ipfsPath,self._ipldResolver))})}};class AddStreamDuplex extends Duplex{constructor(pullStream,push,options){super(Object.assign({objectMode:!0},options)),this._pullStream=pullStream,this._pushable=push,this._waitingPullFlush=[]}_read(){this._pullStream(null,(end,data)=>{for(;this._waitingPullFlush.length;){const cb=this._waitingPullFlush.shift();cb()}end?end instanceof Error&&this.emit("error",end):this.push(data)})}_write(chunk,encoding,callback){this._waitingPullFlush.push(callback),this._pushable.push(chunk)}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(17),setImmediate=__webpack_require__(10);module.exports=function(self){return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),setImmediate(()=>callback(null,{id:self._peerInfo.id.toB58String(),publicKey:self._peerInfo.id.pubKey.bytes.toString("base64"),addresses:self._peerInfo.multiaddrs.toArray().map(ma=>ma.toString()).filter(ma=>ma.indexOf("ipfs")>=0).sort(),agentVersion:"js-ipfs",protocolVersion:"9000"}))})}},function(module,exports,__webpack_require__){"use strict";exports.preStart=__webpack_require__(699),exports.start=__webpack_require__(702),exports.stop=__webpack_require__(703),exports.isOnline=__webpack_require__(695),exports.version=__webpack_require__(705),exports.id=__webpack_require__(692),exports.repo=__webpack_require__(701),exports.init=__webpack_require__(694),exports.bootstrap=__webpack_require__(687),exports.config=__webpack_require__(688),exports.block=__webpack_require__(686),exports.object=__webpack_require__(697),exports.dag=__webpack_require__(689),exports.libp2p=__webpack_require__(696),exports.swarm=__webpack_require__(704),exports.ping=__webpack_require__(698),exports.files=__webpack_require__(691),exports.bitswap=__webpack_require__(685),exports.pubsub=__webpack_require__(700),exports.dht=__webpack_require__(690)},function(module,exports,__webpack_require__){"use strict";const peerId=__webpack_require__(22),waterfall=__webpack_require__(7),parallel=__webpack_require__(39),promisify=__webpack_require__(17),config=__webpack_require__(207),addDefaultAssets=__webpack_require__(719);module.exports=function(self){return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={});const done=(err,res)=>{if(err)return self.emit("error",err),callback(err);self.state.initialized(),self.emit("init"),callback(null,res)};if("uninitalized"!==self.state.state())return done(new Error("Not able to init from state: "+self.state.state()));self.state.init(),self.log("init"),opts.emptyRepo=opts.emptyRepo||!1,opts.bits=Number(opts.bits)||2048,opts.log=opts.log||function(){},waterfall([cb=>self._repo.exists(cb),(exists,cb)=>{if(self.log("repo exists?",exists),exists===!0)return cb(new Error("repo already exists"));opts.log(`generating ${opts.bits}-bit RSA keypair...`,!1),self.log("generating peer id: %s bits",opts.bits),peerId.create({bits:opts.bits},cb)},(keys,cb)=>{self.log("identity generated"),config.Identity={PeerID:keys.toB58String(),PrivKey:keys.privKey.bytes.toString("base64")},opts.log("done"),opts.log("peer identity: "+config.Identity.PeerID),self._repo.init(config,cb)},(_,cb)=>self._repo.open(cb),cb=>{if(self.log("repo opened"),opts.emptyRepo)return cb(null,!0);const tasks=[cb=>self.object.new("unixfs-dir",cb)];"function"==typeof addDefaultAssets&&tasks.push(cb=>addDefaultAssets(self,opts.log,cb)),parallel(tasks,err=>{err?cb(err):cb(null,!0)})}],done)})}},function(module,exports,__webpack_require__){"use strict";module.exports=function(self){return()=>{return Boolean(self._bitswap&&self._libp2pNode&&self._libp2pNode.isStarted())}}},function(module,exports,__webpack_require__){"use strict";const Node=__webpack_require__(707),promisify=__webpack_require__(17),get=__webpack_require__(228);module.exports=function(self){return{start:promisify(callback=>{function gotConfig(err,config){if(err)return callback(err);const options={mdns:get(config,"Discovery.MDNS.Enabled"),webRTCStar:get(config,"Discovery.webRTCStar.Enabled"),bootstrap:get(config,"Bootstrap"),dht:get(self._options,"EXPERIMENTAL.dht"),modules:self._libp2pModules};self._libp2pNode=new Node(self._peerInfo,self._peerInfoBook,options),self._libp2pNode.on("peer:discovery",peerInfo=>{const dial=()=>{self._peerInfoBook.put(peerInfo),self._libp2pNode.dial(peerInfo,()=>{})};self.isOnline()?dial():self._libp2pNode.once("start",dial)}),self._libp2pNode.on("peer:connect",peerInfo=>{self._peerInfoBook.put(peerInfo)}),self._libp2pNode.start(err=>{if(err)return callback(err);self._libp2pNode.peerInfo.multiaddrs.forEach(ma=>{console.log("Swarm listening on",ma.toString())}),callback()})}self.config.get(gotConfig)}),stop:promisify(callback=>{self._libp2pNode.stop(callback)})}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function normalizeMultihash(multihash,enc){if("string"==typeof multihash)return"base58"!==enc&&enc?new Buffer(multihash,enc):multihash;if(Buffer.isBuffer(multihash))return multihash;throw new Error("unsupported multihash")}function parseBuffer(buf,encoding,callback){switch(encoding){case"json":return parseJSONBuffer(buf,callback);case"protobuf":return parseProtoBuffer(buf,callback);default:callback(new Error(`unkown encoding: ${encoding}`))}}function parseJSONBuffer(buf,callback){let data,links;try{const parsed=JSON.parse(buf.toString());links=(parsed.Links||[]).map(link=>{return new DAGLink(link.Name||link.name,link.Size||link.size,mh.fromB58String(link.Hash||link.hash||link.multihash))}),data=new Buffer(parsed.Data)}catch(err){return callback(new Error("failed to parse JSON: "+err))}DAGNode.create(data,links,callback)}function parseProtoBuffer(buf,callback){dagPB.util.deserialize(buf,callback)}const waterfall=__webpack_require__(7),promisify=__webpack_require__(17),dagPB=__webpack_require__(52),DAGNode=dagPB.DAGNode,DAGLink=dagPB.DAGLink,CID=__webpack_require__(8),mh=__webpack_require__(12),Unixfs=__webpack_require__(41),assert=__webpack_require__(9);module.exports=function(self){function editAndSave(edit){return(multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={}),waterfall([cb=>{self.object.get(multihash,options,cb)},(node,cb)=>{edit(node,(err,node)=>{if(err)return cb(err);self._ipldResolver.put(node,{cid:new CID(node.multihash)},err=>{cb(err,node)})})}],callback)}}return{new:promisify((template,callback)=>{"function"==typeof template&&(callback=template,template=void 0);let data;template?(assert("unixfs-dir"===template,"unkown template"),data=new Unixfs("directory").marshal()):data=new Buffer(0),DAGNode.create(data,(err,node)=>{if(err)return callback(err);self._ipldResolver.put(node,{cid:new CID(node.multihash)},err=>{if(err)return callback(err);callback(null,node)})})}),put:promisify((obj,options,callback)=>{function next(){self._ipldResolver.put(node,{cid:new CID(node.multihash)},err=>{if(err)return callback(err);self.object.get(node.multihash,callback)})}"function"==typeof options&&(callback=options,options={});const encoding=options.enc;let node;if(Buffer.isBuffer(obj))encoding?parseBuffer(obj,encoding,(err,_node)=>{if(err)return callback(err);node=_node,next()}):DAGNode.create(obj,(err,_node)=>{if(err)return callback(err);node=_node,next()});else if(obj.multihash)node=obj,next();else{if("object"!=typeof obj)return callback(new Error("obj not recognized"));DAGNode.create(obj.Data,obj.Links,(err,_node)=>{if(err)return callback(err);node=_node,next()})}}),get:promisify((multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={});let mh;try{mh=normalizeMultihash(multihash,options.enc)}catch(err){return callback(err)}const cid=new CID(mh);self._ipldResolver.get(cid,(err,result)=>{if(err)return callback(err);callback(null,result.value)})}),data:promisify((multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={}),self.object.get(multihash,options,(err,node)=>{if(err)return callback(err);callback(null,node.data)})}),links:promisify((multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={}),self.object.get(multihash,options,(err,node)=>{if(err)return callback(err);callback(null,node.links)})}),stat:promisify((multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={}),self.object.get(multihash,options,(err,node)=>{if(err)return callback(err);dagPB.util.serialize(node,(err,serialized)=>{if(err)return callback(err);const blockSize=serialized.length,linkLength=node.links.reduce((a,l)=>a+l.size,0);callback(null,{Hash:node.toJSON().multihash,NumLinks:node.links.length,BlockSize:blockSize,LinksSize:blockSize-node.data.length,DataSize:node.data.length,CumulativeSize:blockSize+linkLength})})})}),patch:promisify({addLink(multihash,link,options,callback){editAndSave((node,cb)=>{DAGNode.addLink(node,link,cb)})(multihash,options,callback)},rmLink(multihash,linkRef,options,callback){editAndSave((node,cb)=>{linkRef.constructor&&"DAGLink"===linkRef.constructor.name&&(linkRef=linkRef._name),DAGNode.rmLink(node,linkRef,cb)})(multihash,options,callback)},appendData(multihash,data,options,callback){editAndSave((node,cb)=>{const newData=Buffer.concat([node.data,data]);DAGNode.create(newData,node.links,cb)})(multihash,options,callback)},setData(multihash,data,options,callback){editAndSave((node,cb)=>{DAGNode.create(data,node.links,cb)})(multihash,options,callback)}})}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(17);module.exports=function(self){return promisify(callback=>{callback(new Error("Not implemented"))})}},function(module,exports,__webpack_require__){"use strict";const peerId=__webpack_require__(22),PeerInfo=__webpack_require__(35),multiaddr=__webpack_require__(24),waterfall=__webpack_require__(7),mafmt=__webpack_require__(89);module.exports=function(self){return callback=>{self.log("pre-start"),waterfall([cb=>self._repo.config.get(cb),(config,cb)=>{const privKey=config.Identity.PrivKey;peerId.createFromPrivKey(privKey,(err,id)=>cb(err,config,id))},(config,id,cb)=>{self._peerInfo=new PeerInfo(id),config.Addresses.Swarm.forEach(addr=>{let ma=multiaddr(addr);mafmt.IPFS.matches(ma)||(ma=ma.encapsulate("/ipfs/"+self._peerInfo.id.toB58String())),self._peerInfo.multiaddrs.add(ma)}),cb()}],callback)}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const promisify=__webpack_require__(17),setImmediate=__webpack_require__(10),OFFLINE_ERROR=__webpack_require__(148).OFFLINE_ERROR;module.exports=function(self){function subscribe(topic,options,handler,callback){const ps=self._pubsub;0===ps.listenerCount(topic)&&ps.subscribe(topic),ps.on(topic,handler),setImmediate(()=>callback())}return{subscribe:(topic,options,handler,callback)=>{if(!self.isOnline())throw OFFLINE_ERROR;if("function"==typeof options&&(callback=handler,handler=options,options={}),!callback)return new Promise((resolve,reject)=>{subscribe(topic,options,handler,err=>{if(err)return reject(err);resolve()})});subscribe(topic,options,handler,callback)},unsubscribe:(topic,handler)=>{const ps=self._pubsub;ps.removeListener(topic,handler),0===ps.listenerCount(topic)&&ps.unsubscribe(topic)},publish:promisify((topic,data,callback)=>{return self.isOnline()?Buffer.isBuffer(data)?(self._pubsub.publish(topic,data),void setImmediate(()=>callback())):setImmediate(()=>callback(new Error("data must be a Buffer"))):setImmediate(()=>callback(OFFLINE_ERROR))}),ls:promisify(callback=>{if(!self.isOnline())return setImmediate(()=>callback(OFFLINE_ERROR));const subscriptions=Array.from(self._pubsub.subscriptions);setImmediate(()=>callback(null,subscriptions))}),peers:promisify((topic,callback)=>{if(!self.isOnline())return setImmediate(()=>callback(OFFLINE_ERROR));const peers=Array.from(self._pubsub.peers.values()).filter(peer=>peer.topics.has(topic)).map(peer=>peer.info.id.toB58String());setImmediate(()=>callback(null,peers))}),setMaxListeners(n){return self._pubsub.setMaxListeners(n)}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";module.exports=function(self){return{init:(bits,empty,callback)=>{},version:callback=>{self._repo.version.get(callback)},gc:function(){},path:()=>self._repo.path}}},function(module,exports,__webpack_require__){"use strict";const series=__webpack_require__(33),Bitswap=__webpack_require__(393),FloodSub=__webpack_require__(485),setImmediate=__webpack_require__(10),promisify=__webpack_require__(17);module.exports=(self=>{return promisify(callback=>{callback=callback||function(){};const done=err=>{if(err)return setImmediate(()=>self.emit("error",err)),callback(err);self.state.started(),setImmediate(()=>self.emit("start")),callback()};if("stopped"!==self.state.state())return done(new Error("Not able to start from state: "+self.state.state()));self.log("starting"),self.state.start(),series([cb=>{self._repo.closed?self._repo.open(cb):cb()},cb=>self.preStart(cb),cb=>self.libp2p.start(cb)],err=>{if(err)return done(err);self._bitswap=new Bitswap(self._libp2pNode,self._repo.blocks,self._peerInfoBook),self._bitswap.start(),self._blockService.setExchange(self._bitswap),self._options.EXPERIMENTAL.pubsub?(self._pubsub=new FloodSub(self._libp2pNode),self._pubsub.start(done)):done()})})})},function(module,exports,__webpack_require__){"use strict";const series=__webpack_require__(33);module.exports=(self=>{return callback=>{if(callback=callback||function(){},self.log("stop"),"stopped"===self.state.state())return callback();const done=err=>{if(err)return self.emit("error",err),callback(err);self.state.stopped(),self.emit("stop"),callback()};if("running"!==self.state.state())return done(new Error("Not able to stop from state: "+self.state.state()));self.state.stop(),self._blockService.unsetExchange(),self._bitswap.stop(),series([cb=>{self._options.EXPERIMENTAL.pubsub?self._pubsub.stop(cb):cb()},cb=>self.libp2p.stop(cb),cb=>self._repo.close(cb)],done)}})},function(module,exports,__webpack_require__){"use strict";const multiaddr=__webpack_require__(24),promisify=__webpack_require__(17),flatMap=__webpack_require__(522),values=__webpack_require__(129),OFFLINE_ERROR=__webpack_require__(148).OFFLINE_ERROR;module.exports=function(self){return{peers:promisify((opts,callback)=>{if("function"==typeof opts&&(callback=opts,opts={}),!self.isOnline())return callback(OFFLINE_ERROR);const verbose=opts.v||opts.verbose;callback(null,flatMap(values(self._peerInfoBook.getAll()).filter(peer=>peer.isConnected()),peer=>{return peer.multiaddrs.toArray().map(addr=>{const res={addr:addr,peer:peer};return verbose&&(res.latency="unknown"),res})}))}),addrs:promisify(callback=>{if(!self.isOnline())return callback(OFFLINE_ERROR);callback(null,values(self._peerInfoBook.getAll()))}),localAddrs:promisify(callback=>{if(!self.isOnline())return callback(OFFLINE_ERROR);callback(null,self._libp2pNode.peerInfo.multiaddrs.toArray())}),connect:promisify((maddr,callback)=>{if(!self.isOnline())return callback(OFFLINE_ERROR);"string"==typeof maddr&&(maddr=multiaddr(maddr)),self._libp2pNode.dial(maddr,callback)}),disconnect:promisify((maddr,callback)=>{if(!self.isOnline())return callback(OFFLINE_ERROR);"string"==typeof maddr&&(maddr=multiaddr(maddr)),self._libp2pNode.hangUp(maddr,callback)}),filters:promisify(callback=>callback(new Error("Not implemented")))}}},function(module,exports,__webpack_require__){"use strict";const pkg=__webpack_require__(454),promisify=__webpack_require__(17);module.exports=function(self){return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),callback(null,{version:pkg.version,repo:"",commit:""})})}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const BlockService=__webpack_require__(192),IPLDResolver=__webpack_require__(447),PeerId=__webpack_require__(22),PeerInfo=__webpack_require__(35),multiaddr=__webpack_require__(24),multihash=__webpack_require__(12),PeerBook=__webpack_require__(245),CID=__webpack_require__(8),debug=__webpack_require__(3),extend=__webpack_require__(175),EventEmitter=__webpack_require__(11),boot=__webpack_require__(684),components=__webpack_require__(693),defaultRepo=__webpack_require__(708);class IPFS extends EventEmitter{constructor(options){super(),this._options={init:!0,start:!0,EXPERIMENTAL:{}},options=options||{},this._libp2pModules=options.libp2p&&options.libp2p.modules,extend(this._options,options),options.init===!1&&(this._options.init=!1),options.start!==!1&&(this._options.start=!0),"string"==typeof options.repo||void 0===options.repo?this._repo=defaultRepo(options.repo):this._repo=options.repo,this.log=debug("jsipfs"),this.log.err=debug("jsipfs:err"),this.on("error",err=>this.log(err)),this.types={Buffer:Buffer,PeerId:PeerId,PeerInfo:PeerInfo,multiaddr:multiaddr,multihash:multihash,CID:CID},this._peerInfoBook=new PeerBook,this._peerInfo=void 0,this._libp2pNode=void 0,this._bitswap=void 0,this._blockService=new BlockService(this._repo),this._ipldResolver=new IPLDResolver(this._blockService),this._pubsub=void 0,this.init=components.init(this),this.preStart=components.preStart(this),this.start=components.start(this),this.stop=components.stop(this),this.isOnline=components.isOnline(this),this.version=components.version(this),this.id=components.id(this),this.repo=components.repo(this),this.bootstrap=components.bootstrap(this),this.config=components.config(this),this.block=components.block(this),this.object=components.object(this),this.dag=components.dag(this),this.libp2p=components.libp2p(this),this.swarm=components.swarm(this),this.files=components.files(this),this.bitswap=components.bitswap(this),this.ping=components.ping(this),this.pubsub=components.pubsub(this),this.dht=components.dht(this),this._options.EXPERIMENTAL.pubsub&&this.log("EXPERIMENTAL pubsub is enabled"),this._options.EXPERIMENTAL.sharding&&this.log("EXPERIMENTAL sharding is enabled"),this._options.EXPERIMENTAL.dht&&this.log("EXPERIMENTAL Kademlia DHT is enabled"),this.state=__webpack_require__(709)(this),boot(this)}}exports=module.exports=IPFS,exports.createNode=(options=>{return new IPFS(options)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const WS=__webpack_require__(516),WebRTCStar=__webpack_require__(514),Multiplex=__webpack_require__(493),SECIO=__webpack_require__(506),Railing=__webpack_require__(499),libp2p=__webpack_require__(519);class Node extends libp2p{constructor(peerInfo,peerBook,options){options=options||{};const wstar=new WebRTCStar,modules={transport:[new WS,wstar],connection:{muxer:[Multiplex],crypto:[SECIO]},discovery:[wstar.discovery]};if(options.bootstrap){const r=new Railing(options.bootstrap);modules.discovery.push(r)}super(modules,peerInfo,peerBook,options)}}module.exports=Node},function(module,exports,__webpack_require__){"use strict";const IPFSRepo=__webpack_require__(193);module.exports=(dir=>{return new IPFSRepo(dir||"ipfs")})},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),log=debug("jsipfs:state");log.error=debug("jsipfs:state:error");const fsm=__webpack_require__(369);module.exports=(self=>{const s=fsm("uninitalized",{uninitalized:{init:"initializing",initialized:"stopped"},initializing:{initialized:"stopped"},stopped:{start:"starting"},starting:{started:"running"},running:{stop:"stopping"},stopping:{stopped:"stopped"}});return s.on("error",err=>log.error(err)),s.on("done",()=>log("-> "+s._state)),s.init=(()=>{s("init")}),s.initialized=(()=>{s("initialized")}),s.stop=(()=>{s("stop")}),s.stopped=(()=>{s("stopped")}),s.start=(()=>{s("start")}),s.started=(()=>{s("started")}),s.state=(()=>s._state),s}) +},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports,__webpack_require__){module.exports=__webpack_require__(276)}]); \ No newline at end of file diff --git a/app/extensions/ipfs/js/main.js b/app/extensions/ipfs/js/main.js index c10ae8efb67..22fd0ecfa26 100644 --- a/app/extensions/ipfs/js/main.js +++ b/app/extensions/ipfs/js/main.js @@ -1,11 +1,18 @@ // const ipc = window.chrome.ipcRenderer -chrome.protocol.registerStringProtocol('ipfs', (request, callback) => { +chrome.protocol.registerStringProtocol('ipfs', handler) +chrome.protocol.registerStringProtocol('dweb', handler) + +function handler (request, callback) { + // test to check if handling the protocol works + callback('hi there!' + test()) // eslint-disable-line + /* - const node = new IPFS() + const node = new Ipfs() node.on('ready', () => { - callback('hi there!' + test() + IPFS) // eslint-disable-line + callback('hi there!' + test() + Ipfs) // eslint-disable-line }) */ - callback('hi there!' + test() + IPFS) // eslint-disable-line -}) + // test loading Ipfs into the background process scope + // callback('hi there!' + test() + Ipfs.toString()) // eslint-disable-line +} diff --git a/app/extensions/ipfs/js/some-other.js b/app/extensions/ipfs/js/some-other.js index e6b08f63b2f..6ed6d90f24b 100644 --- a/app/extensions/ipfs/js/some-other.js +++ b/app/extensions/ipfs/js/some-other.js @@ -1 +1,3 @@ -function test () { return 'yeeah' } +function test () { + return 'yeeah' +} diff --git a/app/extensions/ipfs/manifest.json b/app/extensions/ipfs/manifest.json index 30e00c5669a..8bd83f0ca66 100644 --- a/app/extensions/ipfs/manifest.json +++ b/app/extensions/ipfs/manifest.json @@ -13,7 +13,6 @@ "background": { "scripts": [ "js/some-other.js", - "js/ipfs.min.js", "js/main.js" ], "persistent": true diff --git a/package.json b/package.json index db36cd2dc08..ab393d72c18 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,8 @@ "watch-all": "npm run watch & npm run watch-test", "watch-test": "cross-env NODE_ENV=test webpack --watch", "webpack": "webpack", - "win-renpm": "powershell ./tools/windows/re-npm.ps1" + "win-renpm": "powershell ./tools/windows/re-npm.ps1", + "ipfs": "wget https://unpkg.com/ipfs/dist/index.min.js -O app/extensions/ipfs/js/ipfs.min.js" }, "repository": "brave/browser-laptop", "author": { From 08b4f38288fa0dabda1a602528d75bfdbce50903 Mon Sep 17 00:00:00 2001 From: David Dias Date: Tue, 22 Aug 2017 18:41:25 +0100 Subject: [PATCH 03/11] it loads an IPFS node! --- app/extensions/brave/index-dev.html | 2 +- app/extensions/ipfs/js/main.js | 22 ++++++++++++++++++---- app/extensions/ipfs/manifest.json | 4 +++- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/app/extensions/brave/index-dev.html b/app/extensions/brave/index-dev.html index e7ae6ae3cee..55385630392 100644 --- a/app/extensions/brave/index-dev.html +++ b/app/extensions/brave/index-dev.html @@ -7,7 +7,7 @@ - + Brave diff --git a/app/extensions/ipfs/js/main.js b/app/extensions/ipfs/js/main.js index 22fd0ecfa26..2952d2f4682 100644 --- a/app/extensions/ipfs/js/main.js +++ b/app/extensions/ipfs/js/main.js @@ -1,3 +1,5 @@ +/* global Ipfs */ + // const ipc = window.chrome.ipcRenderer chrome.protocol.registerStringProtocol('ipfs', handler) @@ -5,14 +7,26 @@ chrome.protocol.registerStringProtocol('dweb', handler) function handler (request, callback) { // test to check if handling the protocol works - callback('hi there!' + test()) // eslint-disable-line + // callback('hi there!' + test()) // eslint-disable-line - /* const node = new Ipfs() + node.on('ready', () => { - callback('hi there!' + test() + Ipfs) // eslint-disable-line + node.files.cat('QmSmuETUoXzh4Qo5upHxJWZJK8AEpXXZdTqs34ttE3qMYn', (err, stream) => { + if (err) { + return callback('failed to get the hash') + } + let buf = '' + stream.on('data', (data) => { + buf += data.toString() + }) + stream.on('end', () => { + callback(buf) + }) + }) + // callback('I am online!') // eslint-disable-line }) - */ + // test loading Ipfs into the background process scope // callback('hi there!' + test() + Ipfs.toString()) // eslint-disable-line } diff --git a/app/extensions/ipfs/manifest.json b/app/extensions/ipfs/manifest.json index 8bd83f0ca66..3b388875d41 100644 --- a/app/extensions/ipfs/manifest.json +++ b/app/extensions/ipfs/manifest.json @@ -13,8 +13,10 @@ "background": { "scripts": [ "js/some-other.js", + "js/ipfs.min.js", "js/main.js" ], "persistent": true - } + }, + "content_security_policy": "script-src 'self' 'unsafe-eval'" } From 4d2b5ccdc92bc35950ce62076d13c5c06f08333b Mon Sep 17 00:00:00 2001 From: David Dias Date: Mon, 28 Aug 2017 07:15:51 +0200 Subject: [PATCH 04/11] rm useIPFS from internationalization messages (not used anywhere) --- app/extensions/brave/locales/bn-BD/preferences.properties | 1 - app/extensions/brave/locales/bn-IN/preferences.properties | 1 - app/extensions/brave/locales/cs/preferences.properties | 1 - app/extensions/brave/locales/de-DE/preferences.properties | 1 - app/extensions/brave/locales/en-US/preferences.properties | 1 - app/extensions/brave/locales/es/preferences.properties | 1 - app/extensions/brave/locales/eu/preferences.properties | 1 - app/extensions/brave/locales/fr-FR/preferences.properties | 1 - app/extensions/brave/locales/hi-IN/preferences.properties | 1 - app/extensions/brave/locales/id-ID/preferences.properties | 1 - app/extensions/brave/locales/it-IT/preferences.properties | 1 - app/extensions/brave/locales/ja-JP/preferences.properties | 1 - app/extensions/brave/locales/ko-KR/preferences.properties | 1 - app/extensions/brave/locales/ms-MY/preferences.properties | 1 - app/extensions/brave/locales/nl-NL/preferences.properties | 1 - app/extensions/brave/locales/pl-PL/preferences.properties | 1 - app/extensions/brave/locales/pt-BR/preferences.properties | 1 - app/extensions/brave/locales/ru/preferences.properties | 1 - app/extensions/brave/locales/sl/preferences.properties | 1 - app/extensions/brave/locales/ta/preferences.properties | 1 - app/extensions/brave/locales/te/preferences.properties | 1 - app/extensions/brave/locales/tr-TR/preferences.properties | 1 - app/extensions/brave/locales/uk/preferences.properties | 1 - app/extensions/brave/locales/zh-CN/preferences.properties | 1 - 24 files changed, 24 deletions(-) diff --git a/app/extensions/brave/locales/bn-BD/preferences.properties b/app/extensions/brave/locales/bn-BD/preferences.properties index 3a04a77be01..d2555ef62c0 100644 --- a/app/extensions/brave/locales/bn-BD/preferences.properties +++ b/app/extensions/brave/locales/bn-BD/preferences.properties @@ -384,4 +384,3 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short -useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/bn-IN/preferences.properties b/app/extensions/brave/locales/bn-IN/preferences.properties index dad5e7bdcb9..e51a0afcccd 100644 --- a/app/extensions/brave/locales/bn-IN/preferences.properties +++ b/app/extensions/brave/locales/bn-IN/preferences.properties @@ -384,4 +384,3 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short -useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/cs/preferences.properties b/app/extensions/brave/locales/cs/preferences.properties index 268570bf9db..d7850d2cc18 100644 --- a/app/extensions/brave/locales/cs/preferences.properties +++ b/app/extensions/brave/locales/cs/preferences.properties @@ -384,4 +384,3 @@ tabPreviewTiming=Time to wait before previewing a tab long=Dlouhý normal=Normal short=Krátký -useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/de-DE/preferences.properties b/app/extensions/brave/locales/de-DE/preferences.properties index 1184b1a7891..204861c0100 100644 --- a/app/extensions/brave/locales/de-DE/preferences.properties +++ b/app/extensions/brave/locales/de-DE/preferences.properties @@ -384,4 +384,3 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short -useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/en-US/preferences.properties b/app/extensions/brave/locales/en-US/preferences.properties index b88cb44a5a8..f75d5fc05b7 100644 --- a/app/extensions/brave/locales/en-US/preferences.properties +++ b/app/extensions/brave/locales/en-US/preferences.properties @@ -384,4 +384,3 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short -useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/es/preferences.properties b/app/extensions/brave/locales/es/preferences.properties index 98158386022..fca0ab16870 100644 --- a/app/extensions/brave/locales/es/preferences.properties +++ b/app/extensions/brave/locales/es/preferences.properties @@ -384,4 +384,3 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short -useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/eu/preferences.properties b/app/extensions/brave/locales/eu/preferences.properties index 67e5d034793..92e272c4b47 100644 --- a/app/extensions/brave/locales/eu/preferences.properties +++ b/app/extensions/brave/locales/eu/preferences.properties @@ -384,4 +384,3 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short -useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/fr-FR/preferences.properties b/app/extensions/brave/locales/fr-FR/preferences.properties index fc02d655dba..8e8b33519b2 100644 --- a/app/extensions/brave/locales/fr-FR/preferences.properties +++ b/app/extensions/brave/locales/fr-FR/preferences.properties @@ -384,4 +384,3 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short -useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/hi-IN/preferences.properties b/app/extensions/brave/locales/hi-IN/preferences.properties index fc856aee491..d483d829c62 100644 --- a/app/extensions/brave/locales/hi-IN/preferences.properties +++ b/app/extensions/brave/locales/hi-IN/preferences.properties @@ -384,4 +384,3 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short -useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/id-ID/preferences.properties b/app/extensions/brave/locales/id-ID/preferences.properties index 34eeaf51f93..19dc6c03e70 100644 --- a/app/extensions/brave/locales/id-ID/preferences.properties +++ b/app/extensions/brave/locales/id-ID/preferences.properties @@ -384,4 +384,3 @@ tabPreviewTiming=Waktunya menunggu sebelum meninjau tab baru long=Panjang normal=Normal short=Pendek -useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/it-IT/preferences.properties b/app/extensions/brave/locales/it-IT/preferences.properties index 4c9be169c23..e34969492fb 100644 --- a/app/extensions/brave/locales/it-IT/preferences.properties +++ b/app/extensions/brave/locales/it-IT/preferences.properties @@ -384,4 +384,3 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short -useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/ja-JP/preferences.properties b/app/extensions/brave/locales/ja-JP/preferences.properties index 1cc62bd0e61..0bd5a40101c 100644 --- a/app/extensions/brave/locales/ja-JP/preferences.properties +++ b/app/extensions/brave/locales/ja-JP/preferences.properties @@ -384,4 +384,3 @@ tabPreviewTiming=Time to wait before previewing a tab long=長い normal=Normal short=短い -useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/ko-KR/preferences.properties b/app/extensions/brave/locales/ko-KR/preferences.properties index a5e6c7200b2..14406b59ad7 100644 --- a/app/extensions/brave/locales/ko-KR/preferences.properties +++ b/app/extensions/brave/locales/ko-KR/preferences.properties @@ -384,4 +384,3 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short -useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/ms-MY/preferences.properties b/app/extensions/brave/locales/ms-MY/preferences.properties index dcc7974a585..6081b1a195d 100644 --- a/app/extensions/brave/locales/ms-MY/preferences.properties +++ b/app/extensions/brave/locales/ms-MY/preferences.properties @@ -384,4 +384,3 @@ tabPreviewTiming=Tempoh menunggu sebelum previu tab long=Panjang normal=Normal short=Pendek -useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/nl-NL/preferences.properties b/app/extensions/brave/locales/nl-NL/preferences.properties index ffedf56ca93..e5ff8ec123a 100644 --- a/app/extensions/brave/locales/nl-NL/preferences.properties +++ b/app/extensions/brave/locales/nl-NL/preferences.properties @@ -384,4 +384,3 @@ tabPreviewTiming=Time to wait before previewing a tab long=Lang normal=Normal short=Kort -useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/pl-PL/preferences.properties b/app/extensions/brave/locales/pl-PL/preferences.properties index 677a195c56f..b76f5ba2ff4 100644 --- a/app/extensions/brave/locales/pl-PL/preferences.properties +++ b/app/extensions/brave/locales/pl-PL/preferences.properties @@ -384,4 +384,3 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short -useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/pt-BR/preferences.properties b/app/extensions/brave/locales/pt-BR/preferences.properties index a505600df0d..b5fad2a85e9 100644 --- a/app/extensions/brave/locales/pt-BR/preferences.properties +++ b/app/extensions/brave/locales/pt-BR/preferences.properties @@ -384,4 +384,3 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short -useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/ru/preferences.properties b/app/extensions/brave/locales/ru/preferences.properties index 1449b708faa..dc53bf6ce1b 100644 --- a/app/extensions/brave/locales/ru/preferences.properties +++ b/app/extensions/brave/locales/ru/preferences.properties @@ -384,4 +384,3 @@ tabPreviewTiming=Время ожидания перед просмотром в long=Длинное normal=Normal short=Короткое -useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/sl/preferences.properties b/app/extensions/brave/locales/sl/preferences.properties index 9f161937011..891f11db0f5 100644 --- a/app/extensions/brave/locales/sl/preferences.properties +++ b/app/extensions/brave/locales/sl/preferences.properties @@ -384,4 +384,3 @@ tabPreviewTiming=Time to wait before previewing a tab long=Dolga normal=Normal short=Kratka -useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/ta/preferences.properties b/app/extensions/brave/locales/ta/preferences.properties index 1f2a931a21a..0c96e9ea1aa 100644 --- a/app/extensions/brave/locales/ta/preferences.properties +++ b/app/extensions/brave/locales/ta/preferences.properties @@ -384,4 +384,3 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short -useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/te/preferences.properties b/app/extensions/brave/locales/te/preferences.properties index 3cd754db4f4..dd9b7842482 100644 --- a/app/extensions/brave/locales/te/preferences.properties +++ b/app/extensions/brave/locales/te/preferences.properties @@ -384,4 +384,3 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short -useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/tr-TR/preferences.properties b/app/extensions/brave/locales/tr-TR/preferences.properties index 1f7fc7ce63b..22a0a127618 100644 --- a/app/extensions/brave/locales/tr-TR/preferences.properties +++ b/app/extensions/brave/locales/tr-TR/preferences.properties @@ -384,4 +384,3 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short -useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/uk/preferences.properties b/app/extensions/brave/locales/uk/preferences.properties index 523619d2476..5189fc1f210 100644 --- a/app/extensions/brave/locales/uk/preferences.properties +++ b/app/extensions/brave/locales/uk/preferences.properties @@ -384,4 +384,3 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short -useIPFS=Enable IPFS (requires browser restart) diff --git a/app/extensions/brave/locales/zh-CN/preferences.properties b/app/extensions/brave/locales/zh-CN/preferences.properties index 6cff44d41bf..ba91eff9ec9 100644 --- a/app/extensions/brave/locales/zh-CN/preferences.properties +++ b/app/extensions/brave/locales/zh-CN/preferences.properties @@ -384,4 +384,3 @@ tabPreviewTiming=Time to wait before previewing a tab long=Long normal=Normal short=Short -useIPFS=Enable IPFS (requires browser restart) From 4ca81cf9b1bb5c2af29c2317758948121b14a9eb Mon Sep 17 00:00:00 2001 From: David Dias Date: Mon, 28 Aug 2017 07:19:40 +0200 Subject: [PATCH 05/11] add new ipfs 0.25.2 --- app/extensions/ipfs/js/ipfs.min.js | 110 ++++++++++++++--------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/app/extensions/ipfs/js/ipfs.min.js b/app/extensions/ipfs/js/ipfs.min.js index 8ed63d7c9b5..99d84380ee8 100644 --- a/app/extensions/ipfs/js/ipfs.min.js +++ b/app/extensions/ipfs/js/ipfs.min.js @@ -1,12 +1,12 @@ -var Ipfs=function(modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}var installedModules={};return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.i=function(value){return value},__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module.default}:function(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=720)}([function(module,exports,__webpack_require__){"use strict";(function(global){function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(that,length){if(kMaxLength()=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|length}function SlowBuffer(length){return+length!=length&&(length=0),Buffer.alloc(+length)}function byteLength(string,encoding){if(Buffer.isBuffer(string))return string.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(string)||string instanceof ArrayBuffer))return string.byteLength;"string"!=typeof string&&(string=""+string);var len=string.length;if(0===len)return 0;for(var loweredCase=!1;;)switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":case void 0:return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*len;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase)return utf8ToBytes(string).length;encoding=(""+encoding).toLowerCase(),loweredCase=!0}}function slowToString(encoding,start,end){var loweredCase=!1;if((void 0===start||start<0)&&(start=0),start>this.length)return"";if((void 0===end||end>this.length)&&(end=this.length),end<=0)return"";if(end>>>=0,start>>>=0,end<=start)return"";for(encoding||(encoding="utf8");;)switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase(),loweredCase=!0}}function swap(b,n,m){var i=b[n];b[n]=b[m],b[m]=i}function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){if(0===buffer.length)return-1;if("string"==typeof byteOffset?(encoding=byteOffset,byteOffset=0):byteOffset>2147483647?byteOffset=2147483647:byteOffset<-2147483648&&(byteOffset=-2147483648),byteOffset=+byteOffset,isNaN(byteOffset)&&(byteOffset=dir?0:buffer.length-1),byteOffset<0&&(byteOffset=buffer.length+byteOffset),byteOffset>=buffer.length){if(dir)return-1;byteOffset=buffer.length-1}else if(byteOffset<0){if(!dir)return-1;byteOffset=0}if("string"==typeof val&&(val=Buffer.from(val,encoding)),Buffer.isBuffer(val))return 0===val.length?-1:arrayIndexOf(buffer,val,byteOffset,encoding,dir);if("number"==typeof val)return val&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?dir?Uint8Array.prototype.indexOf.call(buffer,val,byteOffset):Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset):arrayIndexOf(buffer,[val],byteOffset,encoding,dir);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){function read(buf,i){return 1===indexSize?buf[i]:buf.readUInt16BE(i*indexSize)}var indexSize=1,arrLength=arr.length,valLength=val.length;if(void 0!==encoding&&("ucs2"===(encoding=String(encoding).toLowerCase())||"ucs-2"===encoding||"utf16le"===encoding||"utf-16le"===encoding)){if(arr.length<2||val.length<2)return-1;indexSize=2,arrLength/=2,valLength/=2,byteOffset/=2}var i;if(dir){var foundIndex=-1;for(i=byteOffset;iarrLength&&(byteOffset=arrLength-valLength),i=byteOffset;i>=0;i--){for(var found=!0,j=0;jremaining&&(length=remaining):length=remaining;var strLen=string.length;if(strLen%2!=0)throw new TypeError("Invalid hex string");length>strLen/2&&(length=strLen/2);for(var i=0;i239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end){var secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:firstByte<128&&(codePoint=firstByte);break;case 2:secondByte=buf[i+1],128==(192&secondByte)&&(tempCodePoint=(31&firstByte)<<6|63&secondByte)>127&&(codePoint=tempCodePoint);break;case 3:secondByte=buf[i+1],thirdByte=buf[i+2],128==(192&secondByte)&&128==(192&thirdByte)&&(tempCodePoint=(15&firstByte)<<12|(63&secondByte)<<6|63&thirdByte)>2047&&(tempCodePoint<55296||tempCodePoint>57343)&&(codePoint=tempCodePoint);break;case 4:secondByte=buf[i+1],thirdByte=buf[i+2],fourthByte=buf[i+3],128==(192&secondByte)&&128==(192&thirdByte)&&128==(192&fourthByte)&&(tempCodePoint=(15&firstByte)<<18|(63&secondByte)<<12|(63&thirdByte)<<6|63&fourthByte)>65535&&tempCodePoint<1114112&&(codePoint=tempCodePoint)}}null===codePoint?(codePoint=65533,bytesPerSequence=1):codePoint>65535&&(codePoint-=65536,res.push(codePoint>>>10&1023|55296),codePoint=56320|1023&codePoint),res.push(codePoint),i+=bytesPerSequence}return decodeCodePointsArray(res)}function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,codePoints);for(var res="",i=0;ilen)&&(end=len);for(var out="",i=start;ilength)throw new RangeError("Trying to access beyond buffer length")}function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||valuebuf.length)throw new RangeError("Index out of range")}function objectWriteUInt16(buf,value,offset,littleEndian){value<0&&(value=65535+value+1);for(var i=0,j=Math.min(buf.length-offset,2);i>>8*(littleEndian?i:1-i)}function objectWriteUInt32(buf,value,offset,littleEndian){value<0&&(value=4294967295+value+1);for(var i=0,j=Math.min(buf.length-offset,4);i>>8*(littleEndian?i:3-i)&255}function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,value,offset,4,3.4028234663852886e38,-3.4028234663852886e38),ieee754.write(buf,value,offset,littleEndian,23,4),offset+4}function writeDouble(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,value,offset,8,1.7976931348623157e308,-1.7976931348623157e308),ieee754.write(buf,value,offset,littleEndian,52,8),offset+8}function base64clean(str){if(str=stringtrim(str).replace(INVALID_BASE64_RE,""),str.length<2)return"";for(;str.length%4!=0;)str+="=";return str}function stringtrim(str){return str.trim?str.trim():str.replace(/^\s+|\s+$/g,"")}function toHex(n){return n<16?"0"+n.toString(16):n.toString(16)}function utf8ToBytes(string,units){units=units||1/0;for(var codePoint,length=string.length,leadSurrogate=null,bytes=[],i=0;i55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){(units-=3)>-1&&bytes.push(239,191,189);continue}if(i+1===length){(units-=3)>-1&&bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){(units-=3)>-1&&bytes.push(239,191,189),leadSurrogate=codePoint;continue}codePoint=65536+(leadSurrogate-55296<<10|codePoint-56320)}else leadSurrogate&&(units-=3)>-1&&bytes.push(239,191,189);if(leadSurrogate=null,codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,63&codePoint|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,63&codePoint|128)}else{if(!(codePoint<1114112))throw new Error("Invalid code point");if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,63&codePoint|128)}}return bytes}function asciiToBytes(str){for(var byteArray=[],i=0;i>8,lo=c%256,byteArray.push(lo),byteArray.push(hi);return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i=dst.length||i>=src.length);++i)dst[i+offset]=src[i];return i}function isnan(val){return val!==val}var base64=__webpack_require__(305),ieee754=__webpack_require__(190),isArray=__webpack_require__(205);exports.Buffer=Buffer,exports.SlowBuffer=SlowBuffer,exports.INSPECT_MAX_BYTES=50,Buffer.TYPED_ARRAY_SUPPORT=void 0!==global.TYPED_ARRAY_SUPPORT?global.TYPED_ARRAY_SUPPORT:function(){try{var arr=new Uint8Array(1);return arr.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===arr.foo()&&"function"==typeof arr.subarray&&0===arr.subarray(1,1).byteLength}catch(e){return!1}}(),exports.kMaxLength=kMaxLength(),Buffer.poolSize=8192,Buffer._augment=function(arr){return arr.__proto__=Buffer.prototype,arr},Buffer.from=function(value,encodingOrOffset,length){return from(null,value,encodingOrOffset,length)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0})),Buffer.alloc=function(size,fill,encoding){return alloc(null,size,fill,encoding)},Buffer.allocUnsafe=function(size){return allocUnsafe(null,size)},Buffer.allocUnsafeSlow=function(size){return allocUnsafe(null,size)},Buffer.isBuffer=function(b){return!(null==b||!b._isBuffer)},Buffer.compare=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var x=a.length,y=b.length,i=0,len=Math.min(x,y);i0&&(str=this.toString("hex",0,max).match(/.{2}/g).join(" "),this.length>max&&(str+=" ... ")),""},Buffer.prototype.compare=function(target,start,end,thisStart,thisEnd){if(!Buffer.isBuffer(target))throw new TypeError("Argument must be a Buffer");if(void 0===start&&(start=0),void 0===end&&(end=target?target.length:0),void 0===thisStart&&(thisStart=0),void 0===thisEnd&&(thisEnd=this.length),start<0||end>target.length||thisStart<0||thisEnd>this.length)throw new RangeError("out of range index");if(thisStart>=thisEnd&&start>=end)return 0;if(thisStart>=thisEnd)return-1;if(start>=end)return 1;if(start>>>=0,end>>>=0,thisStart>>>=0,thisEnd>>>=0,this===target)return 0;for(var x=thisEnd-thisStart,y=end-start,len=Math.min(x,y),thisCopy=this.slice(thisStart,thisEnd),targetCopy=target.slice(start,end),i=0;iremaining)&&(length=remaining),string.length>0&&(length<0||offset<0)||offset>this.length)throw new RangeError("Attempt to write outside buffer bounds");encoding||(encoding="utf8");for(var loweredCase=!1;;)switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase(),loweredCase=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;Buffer.prototype.slice=function(start,end){var len=this.length;start=~~start,end=void 0===end?len:~~end,start<0?(start+=len)<0&&(start=0):start>len&&(start=len),end<0?(end+=len)<0&&(end=0):end>len&&(end=len),end0&&(mul*=256);)val+=this[offset+--byteLength]*mul;return val},Buffer.prototype.readUInt8=function(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),this[offset]},Buffer.prototype.readUInt16LE=function(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]|this[offset+1]<<8},Buffer.prototype.readUInt16BE=function(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]<<8|this[offset+1]},Buffer.prototype.readUInt32LE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+16777216*this[offset+3]},Buffer.prototype.readUInt32BE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),16777216*this[offset]+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])},Buffer.prototype.readIntLE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset],mul=1,i=0;++i=mul&&(val-=Math.pow(2,8*byteLength)),val},Buffer.prototype.readIntBE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var i=byteLength,mul=1,val=this[offset+--i];i>0&&(mul*=256);)val+=this[offset+--i]*mul;return mul*=128,val>=mul&&(val-=Math.pow(2,8*byteLength)),val},Buffer.prototype.readInt8=function(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),128&this[offset]?(255-this[offset]+1)*-1:this[offset]},Buffer.prototype.readInt16LE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt16BE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt32LE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24},Buffer.prototype.readInt32BE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]},Buffer.prototype.readFloatLE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!0,23,4)},Buffer.prototype.readFloatBE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!1,23,4)},Buffer.prototype.readDoubleLE=function(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!0,52,8)},Buffer.prototype.readDoubleBE=function(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!1,52,8)},Buffer.prototype.writeUIntLE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,byteLength|=0,!noAssert){checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength)-1,0)}var mul=1,i=0;for(this[offset]=255&value;++i=0&&(mul*=256);)this[offset+i]=value/mul&255;return offset+byteLength},Buffer.prototype.writeUInt8=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),this[offset]=255&value,offset+1},Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset+3]=value>>>24,this[offset+2]=value>>>16,this[offset+1]=value>>>8,this[offset]=255&value):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeIntLE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0,mul=1,sub=0;for(this[offset]=255&value;++i>0)-sub&255;return offset+byteLength},Buffer.prototype.writeIntBE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1,mul=1,sub=0;for(this[offset+i]=255&value;--i>=0&&(mul*=256);)value<0&&0===sub&&0!==this[offset+i+1]&&(sub=1),this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength},Buffer.prototype.writeInt8=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),value<0&&(value=255+value+1),this[offset]=255&value,offset+1},Buffer.prototype.writeInt16LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeInt16BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeInt32LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8,this[offset+2]=value>>>16,this[offset+3]=value>>>24):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeInt32BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),value<0&&(value=4294967295+value+1),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeFloatLE=function(value,offset,noAssert){return writeFloat(this,value,offset,!0,noAssert)},Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,!1,noAssert)},Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,!0,noAssert)},Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,!1,noAssert)},Buffer.prototype.copy=function(target,targetStart,start,end){if(start||(start=0),end||0===end||(end=this.length),targetStart>=target.length&&(targetStart=target.length),targetStart||(targetStart=0),end>0&&end=this.length)throw new RangeError("sourceStart out of bounds");if(end<0)throw new RangeError("sourceEnd out of bounds");end>this.length&&(end=this.length),target.length-targetStart=0;--i)target[i+targetStart]=this[i+start];else if(len<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,end=void 0===end?this.length:end>>>0,val||(val=0);var i;if("number"==typeof val)for(i=start;i=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(args){var useColors=this.useColors;if(args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff),useColors){var c="color: "+this.color;args.splice(1,0,c,"color: inherit");var index=0,lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){"%%"!==match&&(index++,"%c"===match&&(lastC=index))}),args.splice(lastC,0,c)}}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{null==namespaces?exports.storage.removeItem("debug"):exports.storage.debug=namespaces}catch(e){}}function load(){var r;try{r=exports.storage.debug}catch(e){}return!r&&void 0!==process&&"env"in process&&(r=process.env.DEBUG),r}exports=module.exports=__webpack_require__(332),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],exports.formatters.j=function(v){try{return JSON.stringify(v)}catch(err){return"[UnexpectedJSONParseError]: "+err.message}},exports.enable(load())}).call(exports,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";var sources=__webpack_require__(612),sinks=__webpack_require__(606),throughs=__webpack_require__(618);exports=module.exports=__webpack_require__(252),exports.pull=exports;for(var k in sources)exports[k]=sources[k];for(var k in throughs)exports[k]=throughs[k];for(var k in sinks)exports[k]=sinks[k]},function(module,exports){function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(fun){if(cachedSetTimeout===setTimeout)return setTimeout(fun,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(fun,0);try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}function runClearTimeout(marker){if(cachedClearTimeout===clearTimeout)return clearTimeout(marker);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(marker);try{return cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var timeout=runTimeout(cleanUpNextTick);draining=!0;for(var len=queue.length;len;){for(currentQueue=queue,queue=[];++queueIndex1)for(var i=1;i=0;i--)if(ka[i]!==kb[i])return!1;for(i=ka.length-1;i>=0;i--)if(key=ka[i],!_deepEqual(a[key],b[key],strict,actualVisitedObjects))return!1;return!0}function notDeepStrictEqual(actual,expected,message){_deepEqual(actual,expected,!0)&&fail(actual,expected,message,"notDeepStrictEqual",notDeepStrictEqual)}function expectedException(actual,expected){if(!actual||!expected)return!1;if("[object RegExp]"==Object.prototype.toString.call(expected))return expected.test(actual);try{if(actual instanceof expected)return!0}catch(e){}return!Error.isPrototypeOf(expected)&&expected.call({},actual)===!0}function _tryBlock(block){var error;try{block()}catch(e){error=e}return error}function _throws(shouldThrow,block,expected,message){var actual;if("function"!=typeof block)throw new TypeError('"block" argument must be a function');"string"==typeof expected&&(message=expected,expected=null),actual=_tryBlock(block),message=(expected&&expected.name?" ("+expected.name+").":".")+(message?" "+message:"."),shouldThrow&&!actual&&fail(actual,expected,"Missing expected exception"+message);var userProvidedMessage="string"==typeof message,isUnwantedException=!shouldThrow&&util.isError(actual),isUnexpectedException=!shouldThrow&&actual&&!expected;if((isUnwantedException&&userProvidedMessage&&expectedException(actual,expected)||isUnexpectedException)&&fail(actual,expected,"Got unwanted exception"+message),shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual)throw actual}var util=__webpack_require__(32),hasOwn=Object.prototype.hasOwnProperty,pSlice=Array.prototype.slice,functionsHaveNames=function(){return"foo"===function(){}.name}(),assert=module.exports=ok,regex=/\s*function\s+([^\(\s]*)\s*/;assert.AssertionError=function(options){this.name="AssertionError",this.actual=options.actual,this.expected=options.expected,this.operator=options.operator,options.message?(this.message=options.message,this.generatedMessage=!1):(this.message=getMessage(this),this.generatedMessage=!0);var stackStartFunction=options.stackStartFunction||fail;if(Error.captureStackTrace)Error.captureStackTrace(this,stackStartFunction);else{var err=new Error;if(err.stack){var out=err.stack,fn_name=getName(stackStartFunction),idx=out.indexOf("\n"+fn_name);if(idx>=0){var next_line=out.indexOf("\n",idx+1);out=out.substring(next_line+1)}this.stack=out}}},util.inherits(assert.AssertionError,Error),assert.fail=fail,assert.ok=ok,assert.equal=function(actual,expected,message){actual!=expected&&fail(actual,expected,message,"==",assert.equal)},assert.notEqual=function(actual,expected,message){actual==expected&&fail(actual,expected,message,"!=",assert.notEqual)},assert.deepEqual=function(actual,expected,message){_deepEqual(actual,expected,!1)||fail(actual,expected,message,"deepEqual",assert.deepEqual)},assert.deepStrictEqual=function(actual,expected,message){_deepEqual(actual,expected,!0)||fail(actual,expected,message,"deepStrictEqual",assert.deepStrictEqual)},assert.notDeepEqual=function(actual,expected,message){_deepEqual(actual,expected,!1)&&fail(actual,expected,message,"notDeepEqual",assert.notDeepEqual)},assert.notDeepStrictEqual=notDeepStrictEqual,assert.strictEqual=function(actual,expected,message){actual!==expected&&fail(actual,expected,message,"===",assert.strictEqual)},assert.notStrictEqual=function(actual,expected,message){actual===expected&&fail(actual,expected,message,"!==",assert.notStrictEqual)},assert.throws=function(block,error,message){_throws(!0,block,error,message)},assert.doesNotThrow=function(block,error,message){_throws(!1,block,error,message)},assert.ifError=function(err){if(err)throw err};var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)hasOwn.call(obj,key)&&keys.push(key);return keys}}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _setImmediate=__webpack_require__(105),_setImmediate2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_setImmediate);exports.default=_setImmediate2.default,module.exports=exports.default},function(module,exports){function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(arg){return"function"==typeof arg}function isNumber(arg){return"number"==typeof arg}function isObject(arg){return"object"==typeof arg&&null!==arg}function isUndefined(arg){return void 0===arg}module.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||n<0||isNaN(n))throw TypeError("n must be a positive number");return this._maxListeners=n,this},EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(this._events||(this._events={}),"error"===type&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length)){if((er=arguments[1])instanceof Error)throw er;var err=new Error('Uncaught, unspecified "error" event. ('+er+")");throw err.context=er,err}if(handler=this._events[type],isUndefined(handler))return!1;if(isFunction(handler))switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:args=Array.prototype.slice.call(arguments,1),handler.apply(this,args)}else if(isObject(handler))for(args=Array.prototype.slice.call(arguments,1),listeners=handler.slice(),len=listeners.length,i=0;i0&&this._events[type].length>m&&(this._events[type].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[type].length),"function"==typeof console.trace&&console.trace()),this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(type,listener){function g(){this.removeListener(type,g),fired||(fired=!0,listener.apply(this,arguments))}if(!isFunction(listener))throw TypeError("listener must be a function");var fired=!1;return g.listener=listener,this.on(type,g),this},EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;if(list=this._events[type],length=list.length,position=-1,list===listener||isFunction(list.listener)&&list.listener===listener)delete this._events[type],this._events.removeListener&&this.emit("removeListener",type,listener);else if(isObject(list)){for(i=length;i-- >0;)if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}if(position<0)return this;1===list.length?(list.length=0,delete this._events[type]):list.splice(position,1),this._events.removeListener&&this.emit("removeListener",type,listener)}return this},EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[type]&&delete this._events[type],this;if(0===arguments.length){for(key in this._events)"removeListener"!==key&&this.removeAllListeners(key);return this.removeAllListeners("removeListener"),this._events={},this}if(listeners=this._events[type],isFunction(listeners))this.removeListener(type,listeners);else if(listeners)for(;listeners.length;)this.removeListener(type,listeners[listeners.length-1]);return delete this._events[type],this},EventEmitter.prototype.listeners=function(type){return this._events&&this._events[type]?isFunction(this._events[type])?[this._events[type]]:this._events[type].slice():[]},EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;if(evlistener)return evlistener.length}return 0},EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function validate(multihash){exports.decode(multihash)}const bs58=__webpack_require__(79),cs=__webpack_require__(567),varint=__webpack_require__(15);exports.toHexString=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return hash.toString("hex")},exports.fromHexString=function(hash){return new Buffer(hash,"hex")},exports.toB58String=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return bs58.encode(hash)},exports.fromB58String=function(hash){let encoded=hash;return Buffer.isBuffer(hash)&&(encoded=hash.toString()),new Buffer(bs58.decode(encoded))},exports.decode=function(buf){if(!Buffer.isBuffer(buf))throw new Error("multihash must be a Buffer");if(buf.length<3)throw new Error("multihash too short. must be > 3 bytes.");let code=varint.decode(buf);if(!exports.isValidCode(code))throw new Error(`multihash unknown function code: 0x${code.toString(16)}`);buf=buf.slice(varint.decode.bytes);let len=varint.decode(buf);if(len<1)throw new Error(`multihash invalid length: 0x${len.toString(16)}`);if(buf=buf.slice(varint.decode.bytes),buf.length!==len)throw new Error(`multihash length inconsistent: 0x${buf.toString("hex")}`);return{code:code,name:cs.codes[code],length:len,digest:buf}},exports.encode=function(digest,code,length){if(!digest||!code)throw new Error("multihash encode requires at least two args: digest, code");const hashfn=exports.coerceCode(code);if(!Buffer.isBuffer(digest))throw new Error("digest should be a Buffer");if(null==length&&(length=digest.length),length&&digest.length!==length)throw new Error("digest length should be equal to specified length.");return Buffer.concat([new Buffer(varint.encode(hashfn)),new Buffer(varint.encode(length)),digest])},exports.coerceCode=function(name){let code=name;if("string"==typeof name){if(!cs.names[name])throw new Error(`Unrecognized hash function named: ${name}`);code=cs.names[name]}if("number"!=typeof code)throw new Error(`Hash function code should be a number. Got: ${code}`);if(!cs.codes[code]&&!exports.isAppCode(code))throw new Error(`Unrecognized function code: ${code}`);return code},exports.isAppCode=function(code){return code>0&&code<16},exports.isValidCode=function(code){return!!exports.isAppCode(code)||!!cs.codes[code]},exports.validate=validate,exports.prefix=function(multihash){return validate(multihash),multihash.slice(0,2)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function isAsync(fn){return supportsSymbol&&"AsyncFunction"===fn[Symbol.toStringTag]}function wrapAsync(asyncFn){return isAsync(asyncFn)?(0,_asyncify2.default)(asyncFn):asyncFn}Object.defineProperty(exports,"__esModule",{value:!0}),exports.isAsync=void 0;var _asyncify=__webpack_require__(70),_asyncify2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_asyncify),supportsSymbol="function"==typeof Symbol;exports.default=wrapAsync,exports.isAsync=isAsync},function(module,exports,__webpack_require__){(function(module){!function(module,exports){"use strict";function assert(val,msg){if(!val)throw new Error(msg||"Assertion failed")}function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype,ctor.prototype=new TempCtor,ctor.prototype.constructor=ctor}function BN(number,base,endian){if(BN.isBN(number))return number;this.negative=0,this.words=null,this.length=0,this.red=null,null!==number&&("le"!==base&&"be"!==base||(endian=base,base=10),this._init(number||0,base||10,endian||"be"))}function parseHex(str,start,end){for(var r=0,len=Math.min(str.length,end),i=start;i=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:15&c}return r}function parseBase(str,start,end,mul){for(var r=0,len=Math.min(str.length,end),i=start;i=49?c-49+10:c>=17?c-17+10:c}return r}function toBitArray(num){for(var w=new Array(num.bitLength()),bit=0;bit>>wbit}return w}function smallMulTo(self,num,out){out.negative=num.negative^self.negative;var len=self.length+num.length|0;out.length=len,len=len-1|0;var a=0|self.words[0],b=0|num.words[0],r=a*b,lo=67108863&r,carry=r/67108864|0;out.words[0]=lo;for(var k=1;k>>26,rword=67108863&carry,maxJ=Math.min(k,num.length-1),j=Math.max(0,k-self.length+1);j<=maxJ;j++){var i=k-j|0;a=0|self.words[i],b=0|num.words[j],r=a*b+rword,ncarry+=r/67108864|0,rword=67108863&r}out.words[k]=0|rword,carry=0|ncarry}return 0!==carry?out.words[k]=0|carry:out.length--,out.strip()}function bigMulTo(self,num,out){out.negative=num.negative^self.negative,out.length=self.length+num.length;for(var carry=0,hncarry=0,k=0;k>>26)|0,hncarry+=ncarry>>>26,ncarry&=67108863}out.words[k]=rword,carry=ncarry,ncarry=hncarry}return 0!==carry?out.words[k]=carry:out.length--,out.strip()}function jumboMulTo(self,num,out){return(new FFTM).mulp(self,num,out)}function FFTM(x,y){this.x=x,this.y=y}function MPrime(name,p){this.name=name,this.p=new BN(p,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(m){if("string"==typeof m){var prime=BN._prime(m);this.m=prime.p,this.prime=prime}else assert(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}function Mont(m){Red.call(this,m),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof module?module.exports=BN:exports.BN=BN,BN.BN=BN,BN.wordSize=26;var Buffer;try{Buffer=__webpack_require__(0).Buffer}catch(e){}BN.isBN=function(num){return num instanceof BN||null!==num&&"object"==typeof num&&num.constructor.wordSize===BN.wordSize&&Array.isArray(num.words)},BN.max=function(left,right){return left.cmp(right)>0?left:right},BN.min=function(left,right){return left.cmp(right)<0?left:right},BN.prototype._init=function(number,base,endian){if("number"==typeof number)return this._initNumber(number,base,endian);if("object"==typeof number)return this._initArray(number,base,endian);"hex"===base&&(base=16),assert(base===(0|base)&&base>=2&&base<=36),number=number.toString().replace(/\s+/g,"");var start=0;"-"===number[0]&&start++,16===base?this._parseHex(number,start):this._parseBase(number,base,start),"-"===number[0]&&(this.negative=1),this.strip(),"le"===endian&&this._initArray(this.toArray(),base,endian)},BN.prototype._initNumber=function(number,base,endian){number<0&&(this.negative=1,number=-number),number<67108864?(this.words=[67108863&number],this.length=1):number<4503599627370496?(this.words=[67108863&number,number/67108864&67108863],this.length=2):(assert(number<9007199254740992),this.words=[67108863&number,number/67108864&67108863,1],this.length=3),"le"===endian&&this._initArray(this.toArray(),base,endian)},BN.prototype._initArray=function(number,base,endian){if(assert("number"==typeof number.length),number.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(number.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)w=number[i]|number[i-1]<<8|number[i-2]<<16,this.words[j]|=w<>>26-off&67108863,(off+=24)>=26&&(off-=26,j++);else if("le"===endian)for(i=0,j=0;i>>26-off&67108863,(off+=24)>=26&&(off-=26,j++);return this.strip()},BN.prototype._parseHex=function(number,start){this.length=Math.ceil((number.length-start)/6),this.words=new Array(this.length);for(var i=0;i=start;i-=6)w=parseHex(number,i,i+6),this.words[j]|=w<>>26-off&4194303,(off+=24)>=26&&(off-=26,j++);i+6!==start&&(w=parseHex(number,start,i+6),this.words[j]|=w<>>26-off&4194303),this.strip()},BN.prototype._parseBase=function(number,base,start){this.words=[0],this.length=1;for(var limbLen=0,limbPow=1;limbPow<=67108863;limbPow*=base)limbLen++;limbLen--,limbPow=limbPow/base|0;for(var total=number.length-start,mod=total%limbLen,end=Math.min(total,total-mod)+start,word=0,i=start;i1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.inspect=function(){return(this.red?""};var zeros=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],groupSizes=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],groupBases=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];BN.prototype.toString=function(base,padding){base=base||10,padding=0|padding||1;var out;if(16===base||"hex"===base){out="";for(var off=0,carry=0,i=0;i>>24-off&16777215,out=0!==carry||i!==this.length-1?zeros[6-word.length]+word+out:word+out,off+=2,off>=26&&(off-=26,i--)}for(0!==carry&&(out=carry.toString(16)+out);out.length%padding!=0;)out="0"+out;return 0!==this.negative&&(out="-"+out),out}if(base===(0|base)&&base>=2&&base<=36){var groupSize=groupSizes[base],groupBase=groupBases[base];out="";var c=this.clone();for(c.negative=0;!c.isZero();){var r=c.modn(groupBase).toString(base);c=c.idivn(groupBase),out=c.isZero()?r+out:zeros[groupSize-r.length]+r+out}for(this.isZero()&&(out="0"+out);out.length%padding!=0;)out="0"+out;return 0!==this.negative&&(out="-"+out),out}assert(!1,"Base should be between 2 and 36")},BN.prototype.toNumber=function(){var ret=this.words[0];return 2===this.length?ret+=67108864*this.words[1]:3===this.length&&1===this.words[2]?ret+=4503599627370496+67108864*this.words[1]:this.length>2&&assert(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-ret:ret},BN.prototype.toJSON=function(){return this.toString(16)},BN.prototype.toBuffer=function(endian,length){return assert(void 0!==Buffer),this.toArrayLike(Buffer,endian,length)},BN.prototype.toArray=function(endian,length){return this.toArrayLike(Array,endian,length)},BN.prototype.toArrayLike=function(ArrayType,endian,length){var byteLength=this.byteLength(),reqLength=length||Math.max(1,byteLength);assert(byteLength<=reqLength,"byte array longer than desired length"),assert(reqLength>0,"Requested array length <= 0"),this.strip();var b,i,littleEndian="le"===endian,res=new ArrayType(reqLength),q=this.clone();if(littleEndian){for(i=0;!q.isZero();i++)b=q.andln(255),q.iushrn(8),res[i]=b;for(;i=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},BN.prototype._zeroBits=function(w){if(0===w)return 26;var t=w,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},BN.prototype.bitLength=function(){var w=this.words[this.length-1],hi=this._countBits(w);return 26*(this.length-1)+hi},BN.prototype.zeroBits=function(){if(this.isZero())return 0;for(var r=0,i=0;inum.length?this.clone().ior(num):num.clone().ior(this)},BN.prototype.uor=function(num){return this.length>num.length?this.clone().iuor(num):num.clone().iuor(this)},BN.prototype.iuand=function(num){var b;b=this.length>num.length?num:this;for(var i=0;inum.length?this.clone().iand(num):num.clone().iand(this)},BN.prototype.uand=function(num){return this.length>num.length?this.clone().iuand(num):num.clone().iuand(this)},BN.prototype.iuxor=function(num){var a,b;this.length>num.length?(a=this,b=num):(a=num,b=this);for(var i=0;inum.length?this.clone().ixor(num):num.clone().ixor(this)},BN.prototype.uxor=function(num){return this.length>num.length?this.clone().iuxor(num):num.clone().iuxor(this)},BN.prototype.inotn=function(width){assert("number"==typeof width&&width>=0);var bytesNeeded=0|Math.ceil(width/26),bitsLeft=width%26;this._expand(bytesNeeded),bitsLeft>0&&bytesNeeded--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-bitsLeft),this.strip()},BN.prototype.notn=function(width){return this.clone().inotn(width)},BN.prototype.setn=function(bit,val){assert("number"==typeof bit&&bit>=0);var off=bit/26|0,wbit=bit%26;return this._expand(off+1),this.words[off]=val?this.words[off]|1<num.length?(a=this,b=num):(a=num,b=this);for(var carry=0,i=0;i>>26;for(;0!==carry&&i>>26;if(this.length=a.length,0!==carry)this.words[this.length]=carry,this.length++;else if(a!==this)for(;inum.length?this.clone().iadd(num):num.clone().iadd(this)},BN.prototype.isub=function(num){if(0!==num.negative){num.negative=0;var r=this.iadd(num);return num.negative=1,r._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(num),this.negative=1,this._normSign();var cmp=this.cmp(num);if(0===cmp)return this.negative=0,this.length=1,this.words[0]=0,this;var a,b;cmp>0?(a=this,b=num):(a=num,b=this);for(var carry=0,i=0;i>26,this.words[i]=67108863&r;for(;0!==carry&&i>26,this.words[i]=67108863&r;if(0===carry&&i>>13,a1=0|a[1],al1=8191&a1,ah1=a1>>>13,a2=0|a[2],al2=8191&a2,ah2=a2>>>13,a3=0|a[3],al3=8191&a3,ah3=a3>>>13,a4=0|a[4],al4=8191&a4,ah4=a4>>>13,a5=0|a[5],al5=8191&a5,ah5=a5>>>13,a6=0|a[6],al6=8191&a6,ah6=a6>>>13,a7=0|a[7],al7=8191&a7,ah7=a7>>>13,a8=0|a[8],al8=8191&a8,ah8=a8>>>13,a9=0|a[9],al9=8191&a9,ah9=a9>>>13,b0=0|b[0],bl0=8191&b0,bh0=b0>>>13,b1=0|b[1],bl1=8191&b1,bh1=b1>>>13,b2=0|b[2],bl2=8191&b2,bh2=b2>>>13,b3=0|b[3],bl3=8191&b3,bh3=b3>>>13,b4=0|b[4],bl4=8191&b4,bh4=b4>>>13,b5=0|b[5],bl5=8191&b5,bh5=b5>>>13,b6=0|b[6],bl6=8191&b6,bh6=b6>>>13,b7=0|b[7],bl7=8191&b7,bh7=b7>>>13,b8=0|b[8],bl8=8191&b8,bh8=b8>>>13,b9=0|b[9],bl9=8191&b9,bh9=b9>>>13;out.negative=self.negative^num.negative,out.length=19,lo=Math.imul(al0,bl0),mid=Math.imul(al0,bh0),mid=mid+Math.imul(ah0,bl0)|0,hi=Math.imul(ah0,bh0);var w0=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w0>>>26)|0,w0&=67108863,lo=Math.imul(al1,bl0),mid=Math.imul(al1,bh0),mid=mid+Math.imul(ah1,bl0)|0,hi=Math.imul(ah1,bh0),lo=lo+Math.imul(al0,bl1)|0,mid=mid+Math.imul(al0,bh1)|0,mid=mid+Math.imul(ah0,bl1)|0,hi=hi+Math.imul(ah0,bh1)|0;var w1=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w1>>>26)|0,w1&=67108863,lo=Math.imul(al2,bl0),mid=Math.imul(al2,bh0),mid=mid+Math.imul(ah2,bl0)|0,hi=Math.imul(ah2,bh0),lo=lo+Math.imul(al1,bl1)|0,mid=mid+Math.imul(al1,bh1)|0,mid=mid+Math.imul(ah1,bl1)|0,hi=hi+Math.imul(ah1,bh1)|0,lo=lo+Math.imul(al0,bl2)|0,mid=mid+Math.imul(al0,bh2)|0,mid=mid+Math.imul(ah0,bl2)|0,hi=hi+Math.imul(ah0,bh2)|0;var w2=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w2>>>26)|0,w2&=67108863,lo=Math.imul(al3,bl0),mid=Math.imul(al3,bh0),mid=mid+Math.imul(ah3,bl0)|0,hi=Math.imul(ah3,bh0),lo=lo+Math.imul(al2,bl1)|0,mid=mid+Math.imul(al2,bh1)|0,mid=mid+Math.imul(ah2,bl1)|0,hi=hi+Math.imul(ah2,bh1)|0,lo=lo+Math.imul(al1,bl2)|0,mid=mid+Math.imul(al1,bh2)|0,mid=mid+Math.imul(ah1,bl2)|0,hi=hi+Math.imul(ah1,bh2)|0,lo=lo+Math.imul(al0,bl3)|0,mid=mid+Math.imul(al0,bh3)|0,mid=mid+Math.imul(ah0,bl3)|0,hi=hi+Math.imul(ah0,bh3)|0;var w3=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w3>>>26)|0,w3&=67108863,lo=Math.imul(al4,bl0),mid=Math.imul(al4,bh0),mid=mid+Math.imul(ah4,bl0)|0,hi=Math.imul(ah4,bh0),lo=lo+Math.imul(al3,bl1)|0,mid=mid+Math.imul(al3,bh1)|0,mid=mid+Math.imul(ah3,bl1)|0,hi=hi+Math.imul(ah3,bh1)|0,lo=lo+Math.imul(al2,bl2)|0,mid=mid+Math.imul(al2,bh2)|0,mid=mid+Math.imul(ah2,bl2)|0,hi=hi+Math.imul(ah2,bh2)|0,lo=lo+Math.imul(al1,bl3)|0,mid=mid+Math.imul(al1,bh3)|0,mid=mid+Math.imul(ah1,bl3)|0,hi=hi+Math.imul(ah1,bh3)|0,lo=lo+Math.imul(al0,bl4)|0,mid=mid+Math.imul(al0,bh4)|0,mid=mid+Math.imul(ah0,bl4)|0,hi=hi+Math.imul(ah0,bh4)|0;var w4=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w4>>>26)|0,w4&=67108863,lo=Math.imul(al5,bl0),mid=Math.imul(al5,bh0),mid=mid+Math.imul(ah5,bl0)|0,hi=Math.imul(ah5,bh0),lo=lo+Math.imul(al4,bl1)|0,mid=mid+Math.imul(al4,bh1)|0,mid=mid+Math.imul(ah4,bl1)|0,hi=hi+Math.imul(ah4,bh1)|0,lo=lo+Math.imul(al3,bl2)|0,mid=mid+Math.imul(al3,bh2)|0,mid=mid+Math.imul(ah3,bl2)|0,hi=hi+Math.imul(ah3,bh2)|0,lo=lo+Math.imul(al2,bl3)|0,mid=mid+Math.imul(al2,bh3)|0,mid=mid+Math.imul(ah2,bl3)|0,hi=hi+Math.imul(ah2,bh3)|0,lo=lo+Math.imul(al1,bl4)|0,mid=mid+Math.imul(al1,bh4)|0,mid=mid+Math.imul(ah1,bl4)|0,hi=hi+Math.imul(ah1,bh4)|0,lo=lo+Math.imul(al0,bl5)|0,mid=mid+Math.imul(al0,bh5)|0,mid=mid+Math.imul(ah0,bl5)|0,hi=hi+Math.imul(ah0,bh5)|0;var w5=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w5>>>26)|0,w5&=67108863,lo=Math.imul(al6,bl0),mid=Math.imul(al6,bh0),mid=mid+Math.imul(ah6,bl0)|0,hi=Math.imul(ah6,bh0),lo=lo+Math.imul(al5,bl1)|0,mid=mid+Math.imul(al5,bh1)|0,mid=mid+Math.imul(ah5,bl1)|0,hi=hi+Math.imul(ah5,bh1)|0,lo=lo+Math.imul(al4,bl2)|0,mid=mid+Math.imul(al4,bh2)|0,mid=mid+Math.imul(ah4,bl2)|0,hi=hi+Math.imul(ah4,bh2)|0,lo=lo+Math.imul(al3,bl3)|0,mid=mid+Math.imul(al3,bh3)|0,mid=mid+Math.imul(ah3,bl3)|0,hi=hi+Math.imul(ah3,bh3)|0,lo=lo+Math.imul(al2,bl4)|0,mid=mid+Math.imul(al2,bh4)|0,mid=mid+Math.imul(ah2,bl4)|0,hi=hi+Math.imul(ah2,bh4)|0,lo=lo+Math.imul(al1,bl5)|0,mid=mid+Math.imul(al1,bh5)|0,mid=mid+Math.imul(ah1,bl5)|0,hi=hi+Math.imul(ah1,bh5)|0,lo=lo+Math.imul(al0,bl6)|0,mid=mid+Math.imul(al0,bh6)|0,mid=mid+Math.imul(ah0,bl6)|0,hi=hi+Math.imul(ah0,bh6)|0;var w6=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w6>>>26)|0,w6&=67108863,lo=Math.imul(al7,bl0),mid=Math.imul(al7,bh0),mid=mid+Math.imul(ah7,bl0)|0,hi=Math.imul(ah7,bh0),lo=lo+Math.imul(al6,bl1)|0,mid=mid+Math.imul(al6,bh1)|0,mid=mid+Math.imul(ah6,bl1)|0,hi=hi+Math.imul(ah6,bh1)|0,lo=lo+Math.imul(al5,bl2)|0,mid=mid+Math.imul(al5,bh2)|0,mid=mid+Math.imul(ah5,bl2)|0,hi=hi+Math.imul(ah5,bh2)|0,lo=lo+Math.imul(al4,bl3)|0,mid=mid+Math.imul(al4,bh3)|0,mid=mid+Math.imul(ah4,bl3)|0,hi=hi+Math.imul(ah4,bh3)|0,lo=lo+Math.imul(al3,bl4)|0,mid=mid+Math.imul(al3,bh4)|0,mid=mid+Math.imul(ah3,bl4)|0,hi=hi+Math.imul(ah3,bh4)|0,lo=lo+Math.imul(al2,bl5)|0,mid=mid+Math.imul(al2,bh5)|0,mid=mid+Math.imul(ah2,bl5)|0,hi=hi+Math.imul(ah2,bh5)|0,lo=lo+Math.imul(al1,bl6)|0,mid=mid+Math.imul(al1,bh6)|0,mid=mid+Math.imul(ah1,bl6)|0,hi=hi+Math.imul(ah1,bh6)|0,lo=lo+Math.imul(al0,bl7)|0,mid=mid+Math.imul(al0,bh7)|0,mid=mid+Math.imul(ah0,bl7)|0,hi=hi+Math.imul(ah0,bh7)|0;var w7=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w7>>>26)|0,w7&=67108863,lo=Math.imul(al8,bl0),mid=Math.imul(al8,bh0),mid=mid+Math.imul(ah8,bl0)|0,hi=Math.imul(ah8,bh0),lo=lo+Math.imul(al7,bl1)|0,mid=mid+Math.imul(al7,bh1)|0,mid=mid+Math.imul(ah7,bl1)|0,hi=hi+Math.imul(ah7,bh1)|0,lo=lo+Math.imul(al6,bl2)|0,mid=mid+Math.imul(al6,bh2)|0,mid=mid+Math.imul(ah6,bl2)|0,hi=hi+Math.imul(ah6,bh2)|0,lo=lo+Math.imul(al5,bl3)|0,mid=mid+Math.imul(al5,bh3)|0,mid=mid+Math.imul(ah5,bl3)|0,hi=hi+Math.imul(ah5,bh3)|0,lo=lo+Math.imul(al4,bl4)|0,mid=mid+Math.imul(al4,bh4)|0,mid=mid+Math.imul(ah4,bl4)|0,hi=hi+Math.imul(ah4,bh4)|0,lo=lo+Math.imul(al3,bl5)|0,mid=mid+Math.imul(al3,bh5)|0,mid=mid+Math.imul(ah3,bl5)|0,hi=hi+Math.imul(ah3,bh5)|0,lo=lo+Math.imul(al2,bl6)|0,mid=mid+Math.imul(al2,bh6)|0,mid=mid+Math.imul(ah2,bl6)|0,hi=hi+Math.imul(ah2,bh6)|0,lo=lo+Math.imul(al1,bl7)|0,mid=mid+Math.imul(al1,bh7)|0,mid=mid+Math.imul(ah1,bl7)|0,hi=hi+Math.imul(ah1,bh7)|0,lo=lo+Math.imul(al0,bl8)|0,mid=mid+Math.imul(al0,bh8)|0,mid=mid+Math.imul(ah0,bl8)|0,hi=hi+Math.imul(ah0,bh8)|0;var w8=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w8>>>26)|0,w8&=67108863,lo=Math.imul(al9,bl0),mid=Math.imul(al9,bh0),mid=mid+Math.imul(ah9,bl0)|0,hi=Math.imul(ah9,bh0),lo=lo+Math.imul(al8,bl1)|0,mid=mid+Math.imul(al8,bh1)|0,mid=mid+Math.imul(ah8,bl1)|0,hi=hi+Math.imul(ah8,bh1)|0,lo=lo+Math.imul(al7,bl2)|0,mid=mid+Math.imul(al7,bh2)|0,mid=mid+Math.imul(ah7,bl2)|0,hi=hi+Math.imul(ah7,bh2)|0,lo=lo+Math.imul(al6,bl3)|0,mid=mid+Math.imul(al6,bh3)|0,mid=mid+Math.imul(ah6,bl3)|0,hi=hi+Math.imul(ah6,bh3)|0,lo=lo+Math.imul(al5,bl4)|0,mid=mid+Math.imul(al5,bh4)|0,mid=mid+Math.imul(ah5,bl4)|0,hi=hi+Math.imul(ah5,bh4)|0,lo=lo+Math.imul(al4,bl5)|0,mid=mid+Math.imul(al4,bh5)|0,mid=mid+Math.imul(ah4,bl5)|0,hi=hi+Math.imul(ah4,bh5)|0,lo=lo+Math.imul(al3,bl6)|0,mid=mid+Math.imul(al3,bh6)|0,mid=mid+Math.imul(ah3,bl6)|0,hi=hi+Math.imul(ah3,bh6)|0,lo=lo+Math.imul(al2,bl7)|0,mid=mid+Math.imul(al2,bh7)|0,mid=mid+Math.imul(ah2,bl7)|0,hi=hi+Math.imul(ah2,bh7)|0,lo=lo+Math.imul(al1,bl8)|0,mid=mid+Math.imul(al1,bh8)|0,mid=mid+Math.imul(ah1,bl8)|0,hi=hi+Math.imul(ah1,bh8)|0,lo=lo+Math.imul(al0,bl9)|0,mid=mid+Math.imul(al0,bh9)|0,mid=mid+Math.imul(ah0,bl9)|0,hi=hi+Math.imul(ah0,bh9)|0;var w9=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w9>>>26)|0,w9&=67108863,lo=Math.imul(al9,bl1),mid=Math.imul(al9,bh1),mid=mid+Math.imul(ah9,bl1)|0,hi=Math.imul(ah9,bh1),lo=lo+Math.imul(al8,bl2)|0,mid=mid+Math.imul(al8,bh2)|0,mid=mid+Math.imul(ah8,bl2)|0,hi=hi+Math.imul(ah8,bh2)|0,lo=lo+Math.imul(al7,bl3)|0,mid=mid+Math.imul(al7,bh3)|0,mid=mid+Math.imul(ah7,bl3)|0,hi=hi+Math.imul(ah7,bh3)|0,lo=lo+Math.imul(al6,bl4)|0,mid=mid+Math.imul(al6,bh4)|0,mid=mid+Math.imul(ah6,bl4)|0,hi=hi+Math.imul(ah6,bh4)|0,lo=lo+Math.imul(al5,bl5)|0,mid=mid+Math.imul(al5,bh5)|0,mid=mid+Math.imul(ah5,bl5)|0,hi=hi+Math.imul(ah5,bh5)|0,lo=lo+Math.imul(al4,bl6)|0,mid=mid+Math.imul(al4,bh6)|0,mid=mid+Math.imul(ah4,bl6)|0,hi=hi+Math.imul(ah4,bh6)|0,lo=lo+Math.imul(al3,bl7)|0,mid=mid+Math.imul(al3,bh7)|0,mid=mid+Math.imul(ah3,bl7)|0,hi=hi+Math.imul(ah3,bh7)|0,lo=lo+Math.imul(al2,bl8)|0,mid=mid+Math.imul(al2,bh8)|0,mid=mid+Math.imul(ah2,bl8)|0,hi=hi+Math.imul(ah2,bh8)|0,lo=lo+Math.imul(al1,bl9)|0,mid=mid+Math.imul(al1,bh9)|0,mid=mid+Math.imul(ah1,bl9)|0,hi=hi+Math.imul(ah1,bh9)|0;var w10=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w10>>>26)|0,w10&=67108863,lo=Math.imul(al9,bl2),mid=Math.imul(al9,bh2),mid=mid+Math.imul(ah9,bl2)|0,hi=Math.imul(ah9,bh2),lo=lo+Math.imul(al8,bl3)|0,mid=mid+Math.imul(al8,bh3)|0,mid=mid+Math.imul(ah8,bl3)|0,hi=hi+Math.imul(ah8,bh3)|0,lo=lo+Math.imul(al7,bl4)|0,mid=mid+Math.imul(al7,bh4)|0,mid=mid+Math.imul(ah7,bl4)|0,hi=hi+Math.imul(ah7,bh4)|0,lo=lo+Math.imul(al6,bl5)|0,mid=mid+Math.imul(al6,bh5)|0,mid=mid+Math.imul(ah6,bl5)|0,hi=hi+Math.imul(ah6,bh5)|0,lo=lo+Math.imul(al5,bl6)|0,mid=mid+Math.imul(al5,bh6)|0,mid=mid+Math.imul(ah5,bl6)|0,hi=hi+Math.imul(ah5,bh6)|0,lo=lo+Math.imul(al4,bl7)|0,mid=mid+Math.imul(al4,bh7)|0,mid=mid+Math.imul(ah4,bl7)|0,hi=hi+Math.imul(ah4,bh7)|0,lo=lo+Math.imul(al3,bl8)|0,mid=mid+Math.imul(al3,bh8)|0,mid=mid+Math.imul(ah3,bl8)|0,hi=hi+Math.imul(ah3,bh8)|0,lo=lo+Math.imul(al2,bl9)|0,mid=mid+Math.imul(al2,bh9)|0,mid=mid+Math.imul(ah2,bl9)|0,hi=hi+Math.imul(ah2,bh9)|0;var w11=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w11>>>26)|0,w11&=67108863,lo=Math.imul(al9,bl3),mid=Math.imul(al9,bh3),mid=mid+Math.imul(ah9,bl3)|0,hi=Math.imul(ah9,bh3),lo=lo+Math.imul(al8,bl4)|0,mid=mid+Math.imul(al8,bh4)|0,mid=mid+Math.imul(ah8,bl4)|0,hi=hi+Math.imul(ah8,bh4)|0,lo=lo+Math.imul(al7,bl5)|0,mid=mid+Math.imul(al7,bh5)|0,mid=mid+Math.imul(ah7,bl5)|0,hi=hi+Math.imul(ah7,bh5)|0,lo=lo+Math.imul(al6,bl6)|0,mid=mid+Math.imul(al6,bh6)|0,mid=mid+Math.imul(ah6,bl6)|0,hi=hi+Math.imul(ah6,bh6)|0,lo=lo+Math.imul(al5,bl7)|0,mid=mid+Math.imul(al5,bh7)|0,mid=mid+Math.imul(ah5,bl7)|0,hi=hi+Math.imul(ah5,bh7)|0,lo=lo+Math.imul(al4,bl8)|0,mid=mid+Math.imul(al4,bh8)|0,mid=mid+Math.imul(ah4,bl8)|0,hi=hi+Math.imul(ah4,bh8)|0,lo=lo+Math.imul(al3,bl9)|0,mid=mid+Math.imul(al3,bh9)|0,mid=mid+Math.imul(ah3,bl9)|0,hi=hi+Math.imul(ah3,bh9)|0;var w12=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w12>>>26)|0,w12&=67108863,lo=Math.imul(al9,bl4),mid=Math.imul(al9,bh4),mid=mid+Math.imul(ah9,bl4)|0,hi=Math.imul(ah9,bh4),lo=lo+Math.imul(al8,bl5)|0,mid=mid+Math.imul(al8,bh5)|0,mid=mid+Math.imul(ah8,bl5)|0,hi=hi+Math.imul(ah8,bh5)|0,lo=lo+Math.imul(al7,bl6)|0,mid=mid+Math.imul(al7,bh6)|0,mid=mid+Math.imul(ah7,bl6)|0,hi=hi+Math.imul(ah7,bh6)|0,lo=lo+Math.imul(al6,bl7)|0,mid=mid+Math.imul(al6,bh7)|0,mid=mid+Math.imul(ah6,bl7)|0,hi=hi+Math.imul(ah6,bh7)|0,lo=lo+Math.imul(al5,bl8)|0,mid=mid+Math.imul(al5,bh8)|0,mid=mid+Math.imul(ah5,bl8)|0,hi=hi+Math.imul(ah5,bh8)|0,lo=lo+Math.imul(al4,bl9)|0,mid=mid+Math.imul(al4,bh9)|0,mid=mid+Math.imul(ah4,bl9)|0,hi=hi+Math.imul(ah4,bh9)|0;var w13=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w13>>>26)|0,w13&=67108863,lo=Math.imul(al9,bl5),mid=Math.imul(al9,bh5),mid=mid+Math.imul(ah9,bl5)|0,hi=Math.imul(ah9,bh5),lo=lo+Math.imul(al8,bl6)|0,mid=mid+Math.imul(al8,bh6)|0,mid=mid+Math.imul(ah8,bl6)|0,hi=hi+Math.imul(ah8,bh6)|0,lo=lo+Math.imul(al7,bl7)|0,mid=mid+Math.imul(al7,bh7)|0,mid=mid+Math.imul(ah7,bl7)|0,hi=hi+Math.imul(ah7,bh7)|0,lo=lo+Math.imul(al6,bl8)|0,mid=mid+Math.imul(al6,bh8)|0,mid=mid+Math.imul(ah6,bl8)|0,hi=hi+Math.imul(ah6,bh8)|0,lo=lo+Math.imul(al5,bl9)|0,mid=mid+Math.imul(al5,bh9)|0,mid=mid+Math.imul(ah5,bl9)|0,hi=hi+Math.imul(ah5,bh9)|0;var w14=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w14>>>26)|0,w14&=67108863,lo=Math.imul(al9,bl6),mid=Math.imul(al9,bh6),mid=mid+Math.imul(ah9,bl6)|0,hi=Math.imul(ah9,bh6),lo=lo+Math.imul(al8,bl7)|0,mid=mid+Math.imul(al8,bh7)|0,mid=mid+Math.imul(ah8,bl7)|0,hi=hi+Math.imul(ah8,bh7)|0,lo=lo+Math.imul(al7,bl8)|0,mid=mid+Math.imul(al7,bh8)|0,mid=mid+Math.imul(ah7,bl8)|0,hi=hi+Math.imul(ah7,bh8)|0,lo=lo+Math.imul(al6,bl9)|0,mid=mid+Math.imul(al6,bh9)|0,mid=mid+Math.imul(ah6,bl9)|0,hi=hi+Math.imul(ah6,bh9)|0;var w15=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w15>>>26)|0,w15&=67108863,lo=Math.imul(al9,bl7),mid=Math.imul(al9,bh7),mid=mid+Math.imul(ah9,bl7)|0,hi=Math.imul(ah9,bh7),lo=lo+Math.imul(al8,bl8)|0,mid=mid+Math.imul(al8,bh8)|0,mid=mid+Math.imul(ah8,bl8)|0,hi=hi+Math.imul(ah8,bh8)|0,lo=lo+Math.imul(al7,bl9)|0,mid=mid+Math.imul(al7,bh9)|0,mid=mid+Math.imul(ah7,bl9)|0,hi=hi+Math.imul(ah7,bh9)|0;var w16=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w16>>>26)|0,w16&=67108863,lo=Math.imul(al9,bl8),mid=Math.imul(al9,bh8),mid=mid+Math.imul(ah9,bl8)|0,hi=Math.imul(ah9,bh8),lo=lo+Math.imul(al8,bl9)|0,mid=mid+Math.imul(al8,bh9)|0,mid=mid+Math.imul(ah8,bl9)|0,hi=hi+Math.imul(ah8,bh9)|0;var w17=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w17>>>26)|0,w17&=67108863,lo=Math.imul(al9,bl9),mid=Math.imul(al9,bh9),mid=mid+Math.imul(ah9,bl9)|0,hi=Math.imul(ah9,bh9);var w18=(c+lo|0)+((8191&mid)<<13)|0;return c=(hi+(mid>>>13)|0)+(w18>>>26)|0,w18&=67108863,o[0]=w0,o[1]=w1,o[2]=w2,o[3]=w3,o[4]=w4,o[5]=w5,o[6]=w6,o[7]=w7,o[8]=w8,o[9]=w9,o[10]=w10,o[11]=w11,o[12]=w12,o[13]=w13,o[14]=w14,o[15]=w15,o[16]=w16,o[17]=w17,o[18]=w18,0!==c&&(o[19]=c,out.length++),out};Math.imul||(comb10MulTo=smallMulTo),BN.prototype.mulTo=function(num,out){var len=this.length+num.length;return 10===this.length&&10===num.length?comb10MulTo(this,num,out):len<63?smallMulTo(this,num,out):len<1024?bigMulTo(this,num,out):jumboMulTo(this,num,out)},FFTM.prototype.makeRBT=function(N){for(var t=new Array(N),l=BN.prototype._countBits(N)-1,i=0;i>=1;return rb},FFTM.prototype.permute=function(rbt,rws,iws,rtws,itws,N){for(var i=0;i>>=1)i++;return 1<>>=13,rws[2*i+1]=8191&carry,carry>>>=13;for(i=2*len;i>=26,carry+=w/67108864|0,carry+=lo>>>26,this.words[i]=67108863&lo}return 0!==carry&&(this.words[i]=carry,this.length++),this},BN.prototype.muln=function(num){return this.clone().imuln(num)},BN.prototype.sqr=function(){return this.mul(this)},BN.prototype.isqr=function(){return this.imul(this.clone())},BN.prototype.pow=function(num){var w=toBitArray(num);if(0===w.length)return new BN(1);for(var res=this,i=0;i=0);var i,r=bits%26,s=(bits-r)/26,carryMask=67108863>>>26-r<<26-r;if(0!==r){var carry=0;for(i=0;i>>26-r}carry&&(this.words[i]=carry,this.length++)}if(0!==s){for(i=this.length-1;i>=0;i--)this.words[i+s]=this.words[i];for(i=0;i=0);var h;h=hint?(hint-hint%26)/26:0;var r=bits%26,s=Math.min((bits-r)/26,this.length),mask=67108863^67108863>>>r<s)for(this.length-=s,i=0;i=0&&(0!==carry||i>=h);i--){var word=0|this.words[i];this.words[i]=carry<<26-r|word>>>r,carry=word&mask}return maskedWords&&0!==carry&&(maskedWords.words[maskedWords.length++]=carry),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},BN.prototype.ishrn=function(bits,hint,extended){return assert(0===this.negative),this.iushrn(bits,hint,extended)},BN.prototype.shln=function(bits){return this.clone().ishln(bits)},BN.prototype.ushln=function(bits){return this.clone().iushln(bits)},BN.prototype.shrn=function(bits){return this.clone().ishrn(bits)},BN.prototype.ushrn=function(bits){return this.clone().iushrn(bits)},BN.prototype.testn=function(bit){assert("number"==typeof bit&&bit>=0);var r=bit%26,s=(bit-r)/26,q=1<=0);var r=bits%26,s=(bits-r)/26;if(assert(0===this.negative,"imaskn works only with positive numbers"),this.length<=s)return this;if(0!==r&&s++,this.length=Math.min(s,this.length),0!==r){var mask=67108863^67108863>>>r<=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},BN.prototype.isubn=function(num){if(assert("number"==typeof num),assert(num<67108864),num<0)return this.iaddn(-num);if(0!==this.negative)return this.negative=0,this.iaddn(num),this.negative=1,this;if(this.words[0]-=num,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var i=0;i>26)-(right/67108864|0),this.words[i+shift]=67108863&w}for(;i>26,this.words[i+shift]=67108863&w;if(0===carry)return this.strip();for(assert(carry===-1),carry=0,i=0;i>26,this.words[i]=67108863&w;return this.negative=1,this.strip()},BN.prototype._wordDiv=function(num,mode){var shift=this.length-num.length,a=this.clone(),b=num,bhi=0|b.words[b.length-1];0!==(shift=26-this._countBits(bhi))&&(b=b.ushln(shift),a.iushln(shift),bhi=0|b.words[b.length-1]);var q,m=a.length-b.length;if("mod"!==mode){q=new BN(null),q.length=m+1,q.words=new Array(q.length);for(var i=0;i=0;j--){var qj=67108864*(0|a.words[b.length+j])+(0|a.words[b.length+j-1]);for(qj=Math.min(qj/bhi|0,67108863),a._ishlnsubmul(b,qj,j);0!==a.negative;)qj--,a.negative=0,a._ishlnsubmul(b,1,j),a.isZero()||(a.negative^=1);q&&(q.words[j]=qj)}return q&&q.strip(),a.strip(),"div"!==mode&&0!==shift&&a.iushrn(shift),{div:q||null,mod:a}},BN.prototype.divmod=function(num,mode,positive){if(assert(!num.isZero()),this.isZero())return{div:new BN(0),mod:new BN(0)};var div,mod,res;return 0!==this.negative&&0===num.negative?(res=this.neg().divmod(num,mode),"mod"!==mode&&(div=res.div.neg()),"div"!==mode&&(mod=res.mod.neg(),positive&&0!==mod.negative&&mod.iadd(num)),{div:div,mod:mod}):0===this.negative&&0!==num.negative?(res=this.divmod(num.neg(),mode),"mod"!==mode&&(div=res.div.neg()),{div:div,mod:res.mod}):0!=(this.negative&num.negative)?(res=this.neg().divmod(num.neg(),mode),"div"!==mode&&(mod=res.mod.neg(),positive&&0!==mod.negative&&mod.isub(num)),{div:res.div,mod:mod}):num.length>this.length||this.cmp(num)<0?{div:new BN(0),mod:this}:1===num.length?"div"===mode?{div:this.divn(num.words[0]),mod:null}:"mod"===mode?{div:null,mod:new BN(this.modn(num.words[0]))}:{div:this.divn(num.words[0]),mod:new BN(this.modn(num.words[0]))}:this._wordDiv(num,mode)},BN.prototype.div=function(num){return this.divmod(num,"div",!1).div},BN.prototype.mod=function(num){return this.divmod(num,"mod",!1).mod},BN.prototype.umod=function(num){return this.divmod(num,"mod",!0).mod},BN.prototype.divRound=function(num){var dm=this.divmod(num);if(dm.mod.isZero())return dm.div;var mod=0!==dm.div.negative?dm.mod.isub(num):dm.mod,half=num.ushrn(1),r2=num.andln(1),cmp=mod.cmp(half);return cmp<0||1===r2&&0===cmp?dm.div:0!==dm.div.negative?dm.div.isubn(1):dm.div.iaddn(1)}, -BN.prototype.modn=function(num){assert(num<=67108863);for(var p=(1<<26)%num,acc=0,i=this.length-1;i>=0;i--)acc=(p*acc+(0|this.words[i]))%num;return acc},BN.prototype.idivn=function(num){assert(num<=67108863);for(var carry=0,i=this.length-1;i>=0;i--){var w=(0|this.words[i])+67108864*carry;this.words[i]=w/num|0,carry=w%num}return this.strip()},BN.prototype.divn=function(num){return this.clone().idivn(num)},BN.prototype.egcd=function(p){assert(0===p.negative),assert(!p.isZero());var x=this,y=p.clone();x=0!==x.negative?x.umod(p):x.clone();for(var A=new BN(1),B=new BN(0),C=new BN(0),D=new BN(1),g=0;x.isEven()&&y.isEven();)x.iushrn(1),y.iushrn(1),++g;for(var yp=y.clone(),xp=x.clone();!x.isZero();){for(var i=0,im=1;0==(x.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(x.iushrn(i);i-- >0;)(A.isOdd()||B.isOdd())&&(A.iadd(yp),B.isub(xp)),A.iushrn(1),B.iushrn(1);for(var j=0,jm=1;0==(y.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(y.iushrn(j);j-- >0;)(C.isOdd()||D.isOdd())&&(C.iadd(yp),D.isub(xp)),C.iushrn(1),D.iushrn(1);x.cmp(y)>=0?(x.isub(y),A.isub(C),B.isub(D)):(y.isub(x),C.isub(A),D.isub(B))}return{a:C,b:D,gcd:y.iushln(g)}},BN.prototype._invmp=function(p){assert(0===p.negative),assert(!p.isZero());var a=this,b=p.clone();a=0!==a.negative?a.umod(p):a.clone();for(var x1=new BN(1),x2=new BN(0),delta=b.clone();a.cmpn(1)>0&&b.cmpn(1)>0;){for(var i=0,im=1;0==(a.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(a.iushrn(i);i-- >0;)x1.isOdd()&&x1.iadd(delta),x1.iushrn(1);for(var j=0,jm=1;0==(b.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(b.iushrn(j);j-- >0;)x2.isOdd()&&x2.iadd(delta),x2.iushrn(1);a.cmp(b)>=0?(a.isub(b),x1.isub(x2)):(b.isub(a),x2.isub(x1))}var res;return res=0===a.cmpn(1)?x1:x2,res.cmpn(0)<0&&res.iadd(p),res},BN.prototype.gcd=function(num){if(this.isZero())return num.abs();if(num.isZero())return this.abs();var a=this.clone(),b=num.clone();a.negative=0,b.negative=0;for(var shift=0;a.isEven()&&b.isEven();shift++)a.iushrn(1),b.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;b.isEven();)b.iushrn(1);var r=a.cmp(b);if(r<0){var t=a;a=b,b=t}else if(0===r||0===b.cmpn(1))break;a.isub(b)}return b.iushln(shift)},BN.prototype.invm=function(num){return this.egcd(num).a.umod(num)},BN.prototype.isEven=function(){return 0==(1&this.words[0])},BN.prototype.isOdd=function(){return 1==(1&this.words[0])},BN.prototype.andln=function(num){return this.words[0]&num},BN.prototype.bincn=function(bit){assert("number"==typeof bit);var r=bit%26,s=(bit-r)/26,q=1<>>26,w&=67108863,this.words[i]=w}return 0!==carry&&(this.words[i]=carry,this.length++),this},BN.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},BN.prototype.cmpn=function(num){var negative=num<0;if(0!==this.negative&&!negative)return-1;if(0===this.negative&&negative)return 1;this.strip();var res;if(this.length>1)res=1;else{negative&&(num=-num),assert(num<=67108863,"Number is too big");var w=0|this.words[0];res=w===num?0:wnum.length)return 1;if(this.length=0;i--){var a=0|this.words[i],b=0|num.words[i];if(a!==b){ab&&(res=1);break}}return res},BN.prototype.gtn=function(num){return 1===this.cmpn(num)},BN.prototype.gt=function(num){return 1===this.cmp(num)},BN.prototype.gten=function(num){return this.cmpn(num)>=0},BN.prototype.gte=function(num){return this.cmp(num)>=0},BN.prototype.ltn=function(num){return this.cmpn(num)===-1},BN.prototype.lt=function(num){return this.cmp(num)===-1},BN.prototype.lten=function(num){return this.cmpn(num)<=0},BN.prototype.lte=function(num){return this.cmp(num)<=0},BN.prototype.eqn=function(num){return 0===this.cmpn(num)},BN.prototype.eq=function(num){return 0===this.cmp(num)},BN.red=function(num){return new Red(num)},BN.prototype.toRed=function(ctx){return assert(!this.red,"Already a number in reduction context"),assert(0===this.negative,"red works only with positives"),ctx.convertTo(this)._forceRed(ctx)},BN.prototype.fromRed=function(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function(ctx){return this.red=ctx,this},BN.prototype.forceRed=function(ctx){return assert(!this.red,"Already a number in reduction context"),this._forceRed(ctx)},BN.prototype.redAdd=function(num){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,num)},BN.prototype.redIAdd=function(num){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,num)},BN.prototype.redSub=function(num){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,num)},BN.prototype.redISub=function(num){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,num)},BN.prototype.redShl=function(num){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,num)},BN.prototype.redMul=function(num){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,num),this.red.mul(this,num)},BN.prototype.redIMul=function(num){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,num),this.red.imul(this,num)},BN.prototype.redSqr=function(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function(num){return assert(this.red&&!num.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,num)};var primes={k256:null,p224:null,p192:null,p25519:null};MPrime.prototype._tmp=function(){var tmp=new BN(null);return tmp.words=new Array(Math.ceil(this.n/13)),tmp},MPrime.prototype.ireduce=function(num){var rlen,r=num;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),rlen=r.bitLength()}while(rlen>this.n);var cmp=rlen0?r.isub(this.p):r.strip(),r},MPrime.prototype.split=function(input,out){input.iushrn(this.n,0,out)},MPrime.prototype.imulK=function(num){return num.imul(this.k)},inherits(K256,MPrime),K256.prototype.split=function(input,output){for(var outLen=Math.min(input.length,9),i=0;i>>22,prev=next}prev>>>=22,input.words[i-10]=prev,0===prev&&input.length>10?input.length-=10:input.length-=9},K256.prototype.imulK=function(num){num.words[num.length]=0,num.words[num.length+1]=0,num.length+=2;for(var lo=0,i=0;i>>=26,num.words[i]=lo,carry=hi}return 0!==carry&&(num.words[num.length++]=carry),num},BN._prime=function prime(name){if(primes[name])return primes[name];var prime;if("k256"===name)prime=new K256;else if("p224"===name)prime=new P224;else if("p192"===name)prime=new P192;else{if("p25519"!==name)throw new Error("Unknown prime "+name);prime=new P25519}return primes[name]=prime,prime},Red.prototype._verify1=function(a){assert(0===a.negative,"red works only with positives"),assert(a.red,"red works only with red numbers")},Red.prototype._verify2=function(a,b){assert(0==(a.negative|b.negative),"red works only with positives"),assert(a.red&&a.red===b.red,"red works only with red numbers")},Red.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this)},Red.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},Red.prototype.add=function(a,b){this._verify2(a,b);var res=a.add(b);return res.cmp(this.m)>=0&&res.isub(this.m),res._forceRed(this)},Red.prototype.iadd=function(a,b){this._verify2(a,b);var res=a.iadd(b);return res.cmp(this.m)>=0&&res.isub(this.m),res},Red.prototype.sub=function(a,b){this._verify2(a,b);var res=a.sub(b);return res.cmpn(0)<0&&res.iadd(this.m),res._forceRed(this)},Red.prototype.isub=function(a,b){this._verify2(a,b);var res=a.isub(b);return res.cmpn(0)<0&&res.iadd(this.m),res},Red.prototype.shl=function(a,num){return this._verify1(a),this.imod(a.ushln(num))},Red.prototype.imul=function(a,b){return this._verify2(a,b),this.imod(a.imul(b))},Red.prototype.mul=function(a,b){return this._verify2(a,b),this.imod(a.mul(b))},Red.prototype.isqr=function(a){return this.imul(a,a.clone())},Red.prototype.sqr=function(a){return this.mul(a,a)},Red.prototype.sqrt=function(a){if(a.isZero())return a.clone();var mod3=this.m.andln(3);if(assert(mod3%2==1),3===mod3){var pow=this.m.add(new BN(1)).iushrn(2);return this.pow(a,pow)}for(var q=this.m.subn(1),s=0;!q.isZero()&&0===q.andln(1);)s++,q.iushrn(1);assert(!q.isZero());var one=new BN(1).toRed(this),nOne=one.redNeg(),lpow=this.m.subn(1).iushrn(1),z=this.m.bitLength();for(z=new BN(2*z*z).toRed(this);0!==this.pow(z,lpow).cmp(nOne);)z.redIAdd(nOne);for(var c=this.pow(z,q),r=this.pow(a,q.addn(1).iushrn(1)),t=this.pow(a,q),m=s;0!==t.cmp(one);){for(var tmp=t,i=0;0!==tmp.cmp(one);i++)tmp=tmp.redSqr();assert(i=0;i--){for(var word=num.words[i],j=start-1;j>=0;j--){var bit=word>>j&1;res!==wnd[0]&&(res=this.sqr(res)),0!==bit||0!==current?(current<<=1,current|=bit,(4===++currentLen||0===i&&0===j)&&(res=this.mul(res,wnd[current]),currentLen=0,current=0)):currentLen=0}start=26}return res},Red.prototype.convertTo=function(num){var r=num.umod(this.m);return r===num?r.clone():r},Red.prototype.convertFrom=function(num){var res=num.clone();return res.red=null,res},BN.mont=function(num){return new Mont(num)},inherits(Mont,Red),Mont.prototype.convertTo=function(num){return this.imod(num.ushln(this.shift))},Mont.prototype.convertFrom=function(num){var r=this.imod(num.mul(this.rinv));return r.red=null,r},Mont.prototype.imul=function(a,b){if(a.isZero()||b.isZero())return a.words[0]=0,a.length=1,a;var t=a.imul(b),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=t.isub(c).iushrn(this.shift),res=u;return u.cmp(this.m)>=0?res=u.isub(this.m):u.cmpn(0)<0&&(res=u.iadd(this.m)),res._forceRed(this)},Mont.prototype.mul=function(a,b){if(a.isZero()||b.isZero())return new BN(0)._forceRed(this);var t=a.mul(b),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=t.isub(c).iushrn(this.shift),res=u;return u.cmp(this.m)>=0?res=u.isub(this.m):u.cmpn(0)<0&&(res=u.iadd(this.m)),res._forceRed(this)},Mont.prototype.invm=function(a){return this.imod(a._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===module||module,this)}).call(exports,__webpack_require__(18)(module))},function(module,exports,__webpack_require__){module.exports={encode:__webpack_require__(679),decode:__webpack_require__(678),encodingLength:__webpack_require__(680)}},function(module,exports,__webpack_require__){"use strict";const Key=__webpack_require__(191),MemoryDatastore=__webpack_require__(386),utils=__webpack_require__(115);exports.Key=Key,exports.MemoryDatastore=MemoryDatastore,exports.utils=utils},function(module,exports,__webpack_require__){var createCallback=function(method,context){return function(){var args=Array.prototype.slice.call(arguments),lastIndex=args.length-1,lastArg=args&&args.length>0?args[lastIndex]:null;return("function"==typeof lastArg?lastArg:null)?method.apply(context,args):new Promise(function(resolve,reject){args.push(function(err,val){if(err)return reject(err);resolve(val)}),method.apply(context,args)})}};module.exports=function(methods,options){options=options||{};var type=Object.prototype.toString.call(methods);if("[object Object]"===type||"[object Array]"===type){var obj=options.replace?methods:{};for(var key in methods)methods.hasOwnProperty(key)&&(obj[key]=createCallback(methods[key]));return obj}return createCallback(methods,options.context||methods)}},function(module,exports){module.exports=function(module){return module.webpackPolyfill||(module.deprecate=function(){},module.paths=[],module.children||(module.children=[]),Object.defineProperty(module,"loaded",{enumerable:!0,get:function(){return module.l}}),Object.defineProperty(module,"id",{enumerable:!0,get:function(){return module.i}}),module.webpackPolyfill=1),module}},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function eachLimit(coll,iteratee,callback){(0,_eachOf2.default)(coll,(0,_withoutIndex2.default)((0,_wrapAsync2.default)(iteratee)),callback)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=eachLimit;var _eachOf=__webpack_require__(101),_eachOf2=_interopRequireDefault(_eachOf),_withoutIndex=__webpack_require__(159),_withoutIndex2=_interopRequireDefault(_withoutIndex),_wrapAsync=__webpack_require__(13),_wrapAsync2=_interopRequireDefault(_wrapAsync);module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";var elliptic=exports;elliptic.version=__webpack_require__(453).version,elliptic.utils=__webpack_require__(352),elliptic.rand=__webpack_require__(315),elliptic.curve=__webpack_require__(82),elliptic.curves=__webpack_require__(344),elliptic.ec=__webpack_require__(345),elliptic.eddsa=__webpack_require__(348)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function Multihashing(buf,func,length,callback){if("function"==typeof length&&(callback=length,length=void 0),!callback)throw new Error("Missing callback");Multihashing.digest(buf,func,length,(err,digest)=>{if(err)return callback(err);callback(null,multihash.encode(digest,func,length))})}const multihash=__webpack_require__(12),crypto=__webpack_require__(570);module.exports=Multihashing,Multihashing.Buffer=Buffer,Multihashing.multihash=multihash,Multihashing.digest=function(buf,func,length,callback){if("function"==typeof length&&(callback=length,length=void 0),!callback)throw new Error("Missing callback");let cb=callback;length&&(cb=((err,digest)=>{if(err)return callback(err);callback(null,digest.slice(0,length))}));let hash;try{hash=Multihashing.createHash(func)}catch(err){return cb(err)}hash(buf,cb)},Multihashing.createHash=function(func){if(func=multihash.coerceCode(func),!Multihashing.functions[func])throw new Error("multihash function "+func+" not yet supported");return Multihashing.functions[func]},Multihashing.functions={17:crypto.sha1,18:crypto.sha2256,19:crypto.sha2512,20:crypto.sha3512,21:crypto.sha3384,22:crypto.sha3256,23:crypto.sha3224,24:crypto.shake128,25:crypto.shake256,26:crypto.keccak224,27:crypto.keccak256,28:crypto.keccak384,29:crypto.keccak512,34:crypto.murmur3128,35:crypto.murmur332},crypto.addBlake(Multihashing.functions)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function toB64Opt(val){if(val)return val.toString("base64")}const mh=__webpack_require__(12),crypto=__webpack_require__(63),assert=__webpack_require__(9),waterfall=__webpack_require__(7),Buffer=__webpack_require__(6).Buffer;class PeerId{constructor(id,privKey,pubKey){assert(Buffer.isBuffer(id),"invalid id provided"),privKey&&pubKey&&assert(privKey.public.bytes.equals(pubKey.bytes),"inconsistent arguments"),this._id=id,this._idB58String=mh.toB58String(this.id),this._privKey=privKey,this._pubKey=pubKey}get id(){return this._id}set id(val){throw new Error("Id is immutable")}get privKey(){return this._privKey}set privKey(privKey){this._privKey=privKey}get pubKey(){return this._pubKey?this._pubKey:this._privKey?this._privKey.public:void 0}set pubKey(pubKey){this._pubKey=pubKey}marshalPubKey(){if(this.pubKey)return crypto.keys.marshalPublicKey(this.pubKey)}marshalPrivKey(){if(this.privKey)return crypto.keys.marshalPrivateKey(this.privKey)}toPrint(){return this.toJSON()}toJSON(){return{id:this.toB58String(),privKey:toB64Opt(this.marshalPrivKey()),pubKey:toB64Opt(this.marshalPubKey())}}toHexString(){return mh.toHexString(this.id)}toBytes(){return this.id}toB58String(){return this._idB58String}isEqual(id){if(Buffer.isBuffer(id))return this.id.equals(id);if(id.id)return this.id.equals(id.id);throw new Error("not valid Id")}isValid(callback){this.privKey&&this.privKey.public&&this.privKey.public.bytes&&Buffer.isBuffer(this.pubKey.bytes)&&this.privKey.public.bytes.equals(this.pubKey.bytes)?callback():callback(new Error("Keys not match"))}}exports=module.exports=PeerId,exports.create=function(opts,callback){"function"==typeof opts&&(callback=opts,opts={}),opts=opts||{},opts.bits=opts.bits||2048,waterfall([cb=>crypto.keys.generateKeyPair("RSA",opts.bits,cb),(privKey,cb)=>privKey.public.hash((err,digest)=>{cb(err,digest,privKey)})],(err,digest,privKey)=>{if(err)return callback(err);callback(null,new PeerId(digest,privKey))})},exports.createFromHexString=function(str){return new PeerId(mh.fromHexString(str))},exports.createFromBytes=function(buf){return new PeerId(buf)},exports.createFromB58String=function(str){return new PeerId(mh.fromB58String(str))},exports.createFromPubKey=function(key,callback){if("function"!=typeof callback)throw new Error("callback is required");let buf=key;"string"==typeof buf&&(buf=Buffer.from(key,"base64"));const pubKey=crypto.keys.unmarshalPublicKey(buf);pubKey.hash((err,digest)=>{if(err)return callback(err);callback(null,new PeerId(digest,null,pubKey))})},exports.createFromPrivKey=function(key,callback){let buf=key;if("string"==typeof buf&&(buf=Buffer.from(key,"base64")),"function"!=typeof callback)throw new Error("callback is required");waterfall([cb=>crypto.keys.unmarshalPrivateKey(buf,cb),(privKey,cb)=>privKey.public.hash((err,digest)=>{cb(err,digest,privKey)})],(err,digest,privKey)=>{if(err)return callback(err);callback(null,new PeerId(digest,privKey))})},exports.createFromJSON=function(obj,callback){if("function"!=typeof callback)throw new Error("callback is required");const id=mh.fromB58String(obj.id),rawPrivKey=obj.privKey&&Buffer.from(obj.privKey,"base64"),rawPubKey=obj.pubKey&&Buffer.from(obj.pubKey,"base64"),pub=rawPubKey&&crypto.keys.unmarshalPublicKey(rawPubKey);rawPrivKey?waterfall([cb=>crypto.keys.unmarshalPrivateKey(rawPrivKey,cb),(priv,cb)=>priv.public.hash((err,digest)=>{cb(err,digest,priv)}),(privDigest,priv,cb)=>{pub?pub.hash((err,pubDigest)=>{cb(err,privDigest,priv,pubDigest)}):cb(null,privDigest,priv)}],(err,privDigest,priv,pubDigest)=>{return err?callback(err):pub&&!privDigest.equals(pubDigest)?callback(new Error("Public and private key do not match")):id&&!privDigest.equals(id)?callback(new Error("Id and private key do not match")):void callback(null,new PeerId(id,priv,pub))}):callback(null,new PeerId(id,null,pub))},exports.isPeerId=function(peerId){return Boolean("object"==typeof peerId&&peerId._id&&peerId._idB58String)}},function(module,exports,__webpack_require__){"use strict";const encode=__webpack_require__(598),d=__webpack_require__(597);exports.encode=encode,exports.decode=d.decode,exports.decodeFromReader=d.decodeFromReader},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function Multiaddr(addr){if(!(this instanceof Multiaddr))return new Multiaddr(addr);if((addr=addr||"")instanceof Buffer)this.buffer=codec.fromBuffer(addr);else if("string"==typeof addr||addr instanceof String)this.buffer=codec.fromString(addr);else{if(!(addr.buffer&&addr.protos&&addr.protoCodes))throw new Error("addr must be a string, Buffer, or another Multiaddr");this.buffer=codec.fromBuffer(addr.buffer)}}const map=__webpack_require__(128),extend=__webpack_require__(38),codec=__webpack_require__(562),protocols=__webpack_require__(133),varint=__webpack_require__(15),bs58=__webpack_require__(79),NotImplemented=new Error("Sorry, Not Implemented Yet.");exports=module.exports=Multiaddr,Multiaddr.prototype.toString=function(){return codec.bufferToString(this.buffer)},Multiaddr.prototype.toOptions=function(){const opts={},parsed=this.toString().split("/");return opts.family="ip4"===parsed[1]?"ipv4":"ipv6",opts.host=parsed[2],opts.transport=parsed[3],opts.port=parsed[4],opts},Multiaddr.prototype.inspect=function(){return""},Multiaddr.prototype.protos=function(){return map(this.protoCodes(),function(code){return extend(protocols(code))})},Multiaddr.prototype.protoCodes=function(){const codes=[],buf=this.buffer;let i=0;for(;i{if(tuple[0]===protocols.names.ipfs.code)return!0})[0][1],bs58.decode(b58str)}catch(e){b58str=null}return b58str},Multiaddr.prototype.equals=function(addr){return this.buffer.equals(addr.buffer)},Multiaddr.prototype.nodeAddress=function(){if(!this.isThinWaistAddress())throw new Error('Multiaddr must be "thin waist" address for nodeAddress.');const codes=this.protoCodes(),parts=this.toString().split("/").slice(1);return{family:41===codes[0]?"IPv6":"IPv4",address:parts[1],port:parts[3]}},Multiaddr.fromNodeAddress=function(addr,transport){if(!addr)throw new Error("requires node address object");if(!transport)throw new Error("requires transport protocol");return Multiaddr("/"+["IPv6"===addr.family?"ip6":"ip4",addr.address,transport,addr.port].join("/"))},Multiaddr.prototype.isThinWaistAddress=function(addr){const protos=(addr||this).protos();return 2===protos.length&&((4===protos[0].code||41===protos[0].code)&&(6===protos[1].code||17===protos[1].code))},Multiaddr.prototype.fromStupidString=function(str){throw NotImplemented},Multiaddr.protocols=protocols,Multiaddr.isMultiaddr=function(addr){return addr.constructor&&addr.constructor.name?"Multiaddr"===addr.constructor.name:Boolean(addr.fromStupidString&&addr.protos)},Multiaddr.isName=function(addr){return!!Multiaddr.isMultiaddr(addr)&&addr.protos().some(proto=>proto.resolvable)},Multiaddr.resolve=function(addr,callback){return callback(Multiaddr.isMultiaddr(addr)&&Multiaddr.isName(addr)?new Error("not implemented yet"):new Error("not a valid name"))}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function Stream(){EE.call(this)}module.exports=Stream;var EE=__webpack_require__(11).EventEmitter;__webpack_require__(1)(Stream,EE),Stream.Readable=__webpack_require__(36),Stream.Writable=__webpack_require__(642),Stream.Duplex=__webpack_require__(637),Stream.Transform=__webpack_require__(641),Stream.PassThrough=__webpack_require__(640),Stream.Stream=Stream,Stream.prototype.pipe=function(dest,options){function ondata(chunk){dest.writable&&!1===dest.write(chunk)&&source.pause&&source.pause()}function ondrain(){source.readable&&source.resume&&source.resume()}function onend(){didOnEnd||(didOnEnd=!0,dest.end())}function onclose(){didOnEnd||(didOnEnd=!0,"function"==typeof dest.destroy&&dest.destroy())}function onerror(er){if(cleanup(),0===EE.listenerCount(this,"error"))throw er}function cleanup(){source.removeListener("data",ondata),dest.removeListener("drain",ondrain),source.removeListener("end",onend),source.removeListener("close",onclose),source.removeListener("error",onerror),dest.removeListener("error",onerror),source.removeListener("end",cleanup),source.removeListener("close",cleanup),dest.removeListener("close",cleanup)}var source=this;source.on("data",ondata),dest.on("drain",ondrain),dest._isStdio||options&&options.end===!1||(source.on("end",onend),source.on("close",onclose));var didOnEnd=!1;return source.on("error",onerror),dest.on("error",onerror),source.on("end",cleanup),source.on("close",cleanup),dest.on("close",cleanup),dest.emit("pipe",source),dest}},function(module,exports,__webpack_require__){(function(Buffer){function isArray(arg){return Array.isArray?Array.isArray(arg):"[object Array]"===objectToString(arg)}function isBoolean(arg){return"boolean"==typeof arg}function isNull(arg){return null===arg}function isNullOrUndefined(arg){return null==arg}function isNumber(arg){return"number"==typeof arg}function isString(arg){return"string"==typeof arg}function isSymbol(arg){return"symbol"==typeof arg}function isUndefined(arg){return void 0===arg}function isRegExp(re){return"[object RegExp]"===objectToString(re)}function isObject(arg){return"object"==typeof arg&&null!==arg}function isDate(d){return"[object Date]"===objectToString(d)}function isError(e){return"[object Error]"===objectToString(e)||e instanceof Error}function isFunction(arg){return"function"==typeof arg}function isPrimitive(arg){return null===arg||"boolean"==typeof arg||"number"==typeof arg||"string"==typeof arg||"symbol"==typeof arg||void 0===arg}function objectToString(o){return Object.prototype.toString.call(o)}exports.isArray=isArray,exports.isBoolean=isBoolean,exports.isNull=isNull,exports.isNullOrUndefined=isNullOrUndefined,exports.isNumber=isNumber,exports.isString=isString,exports.isSymbol=isSymbol,exports.isUndefined=isUndefined,exports.isRegExp=isRegExp,exports.isObject=isObject,exports.isDate=isDate,exports.isError=isError,exports.isFunction=isFunction,exports.isPrimitive=isPrimitive,exports.isBuffer=Buffer.isBuffer}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function toArray(msg,enc){if(Array.isArray(msg))return msg.slice();if(!msg)return[];var res=[];if("string"==typeof msg)if(enc){if("hex"===enc)for(msg=msg.replace(/[^a-z0-9]+/gi,""),msg.length%2!=0&&(msg="0"+msg),i=0;i>8,lo=255&c;hi?res.push(hi,lo):res.push(lo)}else for(i=0;i>>24|w>>>8&65280|w<<8&16711680|(255&w)<<24)>>>0}function toHex32(msg,endian){for(var res="",i=0;i>>0}return res}function split32(msg,endian){for(var res=new Array(4*msg.length),i=0,k=0;i>>24,res[k+1]=m>>>16&255,res[k+2]=m>>>8&255,res[k+3]=255&m):(res[k+3]=m>>>24,res[k+2]=m>>>16&255,res[k+1]=m>>>8&255,res[k]=255&m)}return res}function rotr32(w,b){return w>>>b|w<<32-b}function rotl32(w,b){return w<>>32-b}function sum32(a,b){return a+b>>>0}function sum32_3(a,b,c){return a+b+c>>>0}function sum32_4(a,b,c,d){return a+b+c+d>>>0}function sum32_5(a,b,c,d,e){return a+b+c+d+e>>>0}function sum64(buf,pos,ah,al){var bh=buf[pos],bl=buf[pos+1],lo=al+bl>>>0,hi=(lo>>0,buf[pos+1]=lo}function sum64_hi(ah,al,bh,bl){return(al+bl>>>0>>0}function sum64_lo(ah,al,bh,bl){return al+bl>>>0}function sum64_4_hi(ah,al,bh,bl,ch,cl,dh,dl){var carry=0,lo=al;return lo=lo+bl>>>0,carry+=lo>>0,carry+=lo>>0,carry+=lo>>0}function sum64_4_lo(ah,al,bh,bl,ch,cl,dh,dl){return al+bl+cl+dl>>>0}function sum64_5_hi(ah,al,bh,bl,ch,cl,dh,dl,eh,el){var carry=0,lo=al;return lo=lo+bl>>>0,carry+=lo>>0,carry+=lo>>0,carry+=lo>>0,carry+=lo>>0}function sum64_5_lo(ah,al,bh,bl,ch,cl,dh,dl,eh,el){return al+bl+cl+dl+el>>>0}function rotr64_hi(ah,al,num){return(al<<32-num|ah>>>num)>>>0}function rotr64_lo(ah,al,num){return(ah<<32-num|al>>>num)>>>0}function shr64_hi(ah,al,num){return ah>>>num}function shr64_lo(ah,al,num){return(ah<<32-num|al>>>num)>>>0}var assert=__webpack_require__(34),inherits=__webpack_require__(1);exports.inherits=inherits,exports.toArray=toArray,exports.toHex=toHex,exports.htonl=htonl,exports.toHex32=toHex32,exports.zero2=zero2,exports.zero8=zero8,exports.join32=join32,exports.split32=split32,exports.rotr32=rotr32,exports.rotl32=rotl32,exports.sum32=sum32,exports.sum32_3=sum32_3,exports.sum32_4=sum32_4,exports.sum32_5=sum32_5,exports.sum64=sum64,exports.sum64_hi=sum64_hi,exports.sum64_lo=sum64_lo,exports.sum64_4_hi=sum64_4_hi,exports.sum64_4_lo=sum64_4_lo,exports.sum64_5_hi=sum64_5_hi,exports.sum64_5_lo=sum64_5_lo,exports.rotr64_hi=rotr64_hi,exports.rotr64_lo=rotr64_lo,exports.shr64_hi=shr64_hi,exports.shr64_lo=shr64_lo},function(module,exports,__webpack_require__){"use strict";exports.Connection=__webpack_require__(385)},function(module,exports){function noop(){}module.exports=noop},function(module,exports){function pullPushable(separated,onClose){function read(_abort,_cb){_abort&&(abort=_abort,cb&&callback(abort)),cb=_cb,drain()}function end(end){ended=ended||end||!0,drain()}function push(data){if(!ended){if(cb)return void callback(abort,data);buffer.push(data),drain()}}function drain(){cb&&(abort?callback(abort):!buffer.length&&ended?callback(ended):buffer.length&&callback(null,buffer.shift()))}function callback(err,val){var _cb=cb;if(err&&onClose){var c=onClose;onClose=null,c(err===!0?null:err)}cb=null,_cb(err,val)}"function"==typeof separated&&(onClose=separated, -separated=!1);var abort,cb,ended,buffer=[];return separated?{push:push,end:end,source:read}:(read.push=push,read.end=end,read)}module.exports=pullPushable},function(module,exports,__webpack_require__){(function(Buffer){var schema=__webpack_require__(587),compile=__webpack_require__(591),flatten=function(values){if(!values)return null;var result={};return Object.keys(values).forEach(function(k){result[k]=values[k].value}),result};module.exports=function(proto,opts){if(opts||(opts={}),!proto)throw new Error("Pass in a .proto string or a protobuf-schema parsed object");var sch="object"!=typeof proto||Buffer.isBuffer(proto)?schema.parse(proto):proto,Messages=function(){var self=this;compile(sch,opts.encodings||{}).forEach(function(m){self[m.name]=flatten(m.values)||m})};return Messages.prototype.toString=function(){return schema.stringify(sch)},Messages.prototype.toJSON=function(){return sch},new Messages}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(global,process){function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(ctx.depth=arguments[2]),arguments.length>=4&&(ctx.colors=arguments[3]),isBoolean(opts)?ctx.showHidden=opts:opts&&exports._extend(ctx,opts),isUndefined(ctx.showHidden)&&(ctx.showHidden=!1),isUndefined(ctx.depth)&&(ctx.depth=2),isUndefined(ctx.colors)&&(ctx.colors=!1),isUndefined(ctx.customInspect)&&(ctx.customInspect=!0),ctx.colors&&(ctx.stylize=stylizeWithColor),formatValue(ctx,obj,ctx.depth)}function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];return style?"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m":str}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};return array.forEach(function(val,idx){hash[val]=!0}),hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&(!value.constructor||value.constructor.prototype!==value)){var ret=value.inspect(recurseTimes,ctx);return isString(ret)||(ret=formatValue(ctx,ret,recurseTimes)),ret}var primitive=formatPrimitive(ctx,value);if(primitive)return primitive;var keys=Object.keys(value),visibleKeys=arrayToHash(keys);if(ctx.showHidden&&(keys=Object.getOwnPropertyNames(value)),isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0))return formatError(value);if(0===keys.length){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value))return ctx.stylize(RegExp.prototype.toString.call(value),"regexp");if(isDate(value))return ctx.stylize(Date.prototype.toString.call(value),"date");if(isError(value))return formatError(value)}var base="",array=!1,braces=["{","}"];if(isArray(value)&&(array=!0,braces=["[","]"]),isFunction(value)){base=" [Function"+(value.name?": "+value.name:"")+"]"}if(isRegExp(value)&&(base=" "+RegExp.prototype.toString.call(value)),isDate(value)&&(base=" "+Date.prototype.toUTCString.call(value)),isError(value)&&(base=" "+formatError(value)),0===keys.length&&(!array||0==value.length))return braces[0]+base+braces[1];if(recurseTimes<0)return isRegExp(value)?ctx.stylize(RegExp.prototype.toString.call(value),"regexp"):ctx.stylize("[Object]","special");ctx.seen.push(value);var output;return output=array?formatArray(ctx,value,recurseTimes,visibleKeys,keys):keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)}),ctx.seen.pop(),reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}return isNumber(value)?ctx.stylize(""+value,"number"):isBoolean(value)?ctx.stylize(""+value,"boolean"):isNull(value)?ctx.stylize("null","null"):void 0}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){for(var output=[],i=0,l=value.length;i-1&&(str=array?str.split("\n").map(function(line){return" "+line}).join("\n").substr(2):"\n"+str.split("\n").map(function(line){return" "+line}).join("\n"))):str=ctx.stylize("[Circular]","special")),isUndefined(name)){if(array&&key.match(/^\d+$/))return str;name=JSON.stringify(""+key),name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(name=name.substr(1,name.length-2),name=ctx.stylize(name,"name")):(name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),name=ctx.stylize(name,"string"))}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;return output.reduce(function(prev,cur){return numLinesEst++,cur.indexOf("\n")>=0&&numLinesEst++,prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?braces[0]+(""===base?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]:braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}function isBoolean(arg){return"boolean"==typeof arg}function isNull(arg){return null===arg}function isNullOrUndefined(arg){return null==arg}function isNumber(arg){return"number"==typeof arg}function isString(arg){return"string"==typeof arg}function isSymbol(arg){return"symbol"==typeof arg}function isUndefined(arg){return void 0===arg}function isRegExp(re){return isObject(re)&&"[object RegExp]"===objectToString(re)}function isObject(arg){return"object"==typeof arg&&null!==arg}function isDate(d){return isObject(d)&&"[object Date]"===objectToString(d)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(arg){return"function"==typeof arg}function isPrimitive(arg){return null===arg||"boolean"==typeof arg||"number"==typeof arg||"string"==typeof arg||"symbol"==typeof arg||void 0===arg}function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}function timestamp(){var d=new Date,time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}exports.format=function(f){if(!isString(f)){for(var objects=[],i=0;i=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}}),x=args[i];i{if("function"==typeof id)return callback=id,id=null,void Id.create((err,id)=>{if(err)return callback(err);callback(null,new PeerInfo(id))});callback(null,new PeerInfo(id))}),PeerInfo.isPeerInfo=(peerInfo=>{return Boolean("object"==typeof peerInfo&&peerInfo.id&&peerInfo.multiaddrs)}),module.exports=PeerInfo},function(module,exports,__webpack_require__){exports=module.exports=__webpack_require__(258),exports.Stream=exports,exports.Readable=exports,exports.Writable=__webpack_require__(143),exports.Duplex=__webpack_require__(44),exports.Transform=__webpack_require__(259),exports.PassThrough=__webpack_require__(638)},function(module,exports,__webpack_require__){function Timeout(id,clearFn){this._id=id,this._clearFn=clearFn}var apply=Function.prototype.apply;exports.setTimeout=function(){return new Timeout(apply.call(setTimeout,window,arguments),clearTimeout)},exports.setInterval=function(){return new Timeout(apply.call(setInterval,window,arguments),clearInterval)},exports.clearTimeout=exports.clearInterval=function(timeout){timeout&&timeout.close()},Timeout.prototype.unref=Timeout.prototype.ref=function(){},Timeout.prototype.close=function(){this._clearFn.call(window,this._id)},exports.enroll=function(item,msecs){clearTimeout(item._idleTimeoutId),item._idleTimeout=msecs},exports.unenroll=function(item){clearTimeout(item._idleTimeoutId),item._idleTimeout=-1},exports._unrefActive=exports.active=function(item){clearTimeout(item._idleTimeoutId);var msecs=item._idleTimeout;msecs>=0&&(item._idleTimeoutId=setTimeout(function(){item._onTimeout&&item._onTimeout()},msecs))},__webpack_require__(652),exports.setImmediate=setImmediate,exports.clearImmediate=clearImmediate},function(module,exports){function extend(){for(var target={},i=0;i{this.blockSizes.push(size)}),this.removeBlockSize=(index=>{this.blockSizes.splice(index,1)}),this.fileSize=(()=>{if(!(dirTypes.indexOf(this.type)>=0)){let sum=0;return this.blockSizes.forEach(size=>{sum+=size}),data&&(sum+=data.length),sum}}),this.marshal=(()=>{let type;switch(this.type){case"raw":type=unixfsData.DataType.Raw;break;case"directory":type=unixfsData.DataType.Directory;break;case"file":type=unixfsData.DataType.File;break;case"metadata":type=unixfsData.DataType.Metadata;break;case"symlink":type=unixfsData.DataType.Symlink;break;case"hamt-sharded-directory":type=unixfsData.DataType.HAMTShard;break;default:throw new Error(`Unkown type: "${this.type}"`)}let fileSize=this.fileSize();return fileSize||(fileSize=void 0),unixfsData.encode({Type:type,Data:this.data,filesize:fileSize,blocksizes:this.blockSizes.length>0?this.blockSizes:void 0,hashType:this.hashType,fanout:this.fanout})})}const protobuf=__webpack_require__(31),pb=protobuf(__webpack_require__(432)),unixfsData=pb.Data,types=["raw","directory","file","metadata","symlink","hamt-sharded-directory"],dirTypes=["directory","hamt-sharded-directory"];Data.unmarshal=(marsheled=>{const decoded=unixfsData.decode(marsheled);decoded.Data||(decoded.Data=void 0);const obj=new Data(types[decoded.Type],decoded.Data);return obj.blockSizes=decoded.blocksizes,obj}),module.exports=Data},function(module,exports,__webpack_require__){"use strict";module.exports={ethAccountSnapshot:__webpack_require__(197),ethBlock:__webpack_require__(198),ethBlockList:__webpack_require__(441),ethStateTrie:__webpack_require__(442),ethStorageTrie:__webpack_require__(443),ethTx:__webpack_require__(199),ethTxTrie:__webpack_require__(444)}},function(module,exports,__webpack_require__){(function(process){function normalizeArray(parts,allowAboveRoot){for(var up=0,i=parts.length-1;i>=0;i--){var last=parts[i];"."===last?parts.splice(i,1):".."===last?(parts.splice(i,1),up++):up&&(parts.splice(i,1),up--)}if(allowAboveRoot)for(;up--;up)parts.unshift("..");return parts}function filter(xs,f){if(xs.filter)return xs.filter(f);for(var res=[],i=0;i=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if("string"!=typeof path)throw new TypeError("Arguments to path.resolve must be strings");path&&(resolvedPath=path+"/"+resolvedPath,resolvedAbsolute="/"===path.charAt(0))}return resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/"),(resolvedAbsolute?"/":"")+resolvedPath||"."},exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash="/"===substr(path,-1);return path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/"),path||isAbsolute||(path="."),path&&trailingSlash&&(path+="/"),(isAbsolute?"/":"")+path},exports.isAbsolute=function(path){return"/"===path.charAt(0)},exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if("string"!=typeof p)throw new TypeError("Arguments to path.join must be strings");return p}).join("/"))},exports.relative=function(from,to){function trim(arr){for(var start=0;start=0&&""===arr[end];end--);return start>end?[]:arr.slice(start,end-start+1)}from=exports.resolve(from).substr(1),to=exports.resolve(to).substr(1);for(var fromParts=trim(from.split("/")),toParts=trim(to.split("/")),length=Math.min(fromParts.length,toParts.length),samePartsLength=length,i=0;iinput.length)throw new Error("invalid rlp: total length is larger than the data");if(innerRemainder=input.slice(llength,totalLength),0===innerRemainder.length)throw new Error("invalid rlp, List has a invalid length");for(;innerRemainder.length;)d=_decode(innerRemainder),decoded.push(d.data),innerRemainder=d.remainder;return{data:decoded,remainder:input.slice(totalLength)}}function isHexPrefixed(str){return"0x"===str.slice(0,2)}function stripHexPrefix(str){return"string"!=typeof str?str:isHexPrefixed(str)?str.slice(2):str}function intToHex(i){var hex=i.toString(16);return hex.length%2&&(hex="0"+hex),hex}function padToEven(a){return a.length%2&&(a="0"+a),a}function intToBuffer(i){return new Buffer(intToHex(i),"hex")}function toBuffer(v){if(!Buffer.isBuffer(v))if("string"==typeof v)v=isHexPrefixed(v)?new Buffer(padToEven(stripHexPrefix(v)),"hex"):new Buffer(v);else if("number"==typeof v)v=v?intToBuffer(v):new Buffer([]);else if(null===v||void 0===v)v=new Buffer([]);else{if(!v.toArray)throw new Error("invalid type");v=new Buffer(v.toArray())}return v}const assert=__webpack_require__(9);exports.encode=function(input){if(input instanceof Array){for(var output=[],i=0;i1?{type:packetslist[type],data:data.substring(1)}:{type:packetslist[type]}:err}var asArray=new Uint8Array(data),type=asArray[0],rest=sliceBuffer(data,1);return Blob&&"blob"===binaryType&&(rest=new Blob([rest])),{type:packetslist[type],data:rest}},exports.decodeBase64Packet=function(msg,binaryType){ -var type=packetslist[msg.charAt(0)];if(!base64encoder)return{type:type,data:{base64:!0,data:msg.substr(1)}};var data=base64encoder.decode(msg.substr(1));return"blob"===binaryType&&Blob&&(data=new Blob([data])),{type:type,data:data}},exports.encodePayload=function(packets,supportsBinary,callback){function setLengthHeader(message){return message.length+":"+message}function encodeOne(packet,doneCallback){exports.encodePacket(packet,!!isBinary&&supportsBinary,!1,function(message){doneCallback(null,setLengthHeader(message))})}"function"==typeof supportsBinary&&(callback=supportsBinary,supportsBinary=null);var isBinary=hasBinary(packets);return supportsBinary&&isBinary?Blob&&!dontSendBlobs?exports.encodePayloadAsBlob(packets,callback):exports.encodePayloadAsArrayBuffer(packets,callback):packets.length?void map(packets,encodeOne,function(err,results){return callback(results.join(""))}):callback("0:")},exports.decodePayload=function(data,binaryType,callback){if("string"!=typeof data)return exports.decodePayloadAsBinary(data,binaryType,callback);"function"==typeof binaryType&&(callback=binaryType,binaryType=null);var packet;if(""===data)return callback(err,0,1);for(var n,msg,length="",i=0,l=data.length;i0;){for(var tailArray=new Uint8Array(bufferTail),isString=0===tailArray[0],msgLength="",i=1;255!==tailArray[i];i++){if(msgLength.length>310)return callback(err,0,1);msgLength+=tailArray[i]}bufferTail=sliceBuffer(bufferTail,2+msgLength.length),msgLength=parseInt(msgLength);var msg=sliceBuffer(bufferTail,0,msgLength);if(isString)try{msg=String.fromCharCode.apply(null,new Uint8Array(msg))}catch(e){var typed=new Uint8Array(msg);msg="";for(var i=0;i`}toJSON(){return{name:this.name,size:this.size,multihash:mh.toB58String(this._multihash)}}get name(){return this._name}set name(name){throw new Error("Can't set property: 'name' is immutable")}get size(){return this._size}set size(size){throw new Error("Can't set property: 'size' is immutable")}get multihash(){return this._multihash}set multihash(multihash){throw new Error("Can't set property: 'multihash' is immutable")}}exports=module.exports=DAGLink,exports.create=__webpack_require__(435)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.DAGNode=__webpack_require__(118),exports.DAGLink=__webpack_require__(51),exports.resolver=__webpack_require__(440),exports.util=__webpack_require__(119)},function(module,exports,__webpack_require__){"use strict";function cidFromHash(codec,hashBuffer){return new CID(1,codec,multihashes.encode(hashBuffer,"keccak-256"))}const CID=__webpack_require__(8),multihashes=__webpack_require__(12);module.exports=cidFromHash},function(module,exports,__webpack_require__){(function(process){function Duplex(options){if(!(this instanceof Duplex))return new Duplex(options);Readable.call(this,options),Writable.call(this,options),options&&options.readable===!1&&(this.readable=!1),options&&options.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,options&&options.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",onend)}function onend(){this.allowHalfOpen||this._writableState.ended||process.nextTick(this.end.bind(this))}module.exports=Duplex;var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)keys.push(key);return keys},util=__webpack_require__(26);util.inherits=__webpack_require__(1);var Readable=__webpack_require__(210),Writable=__webpack_require__(212);util.inherits(Duplex,Readable),function(xs,f){for(var i=0,l=xs.length;i=8*this._finalSize&&(this._update(this._block),this._block.fill(0)),this._block.writeInt32BE(l,this._blockSize-4);var hash=this._update(this._block)||this._hash();return enc?hash.toString(enc):hash},Hash.prototype._update=function(){throw new Error("_update must be implemented by subclass")},module.exports=Hash}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){var base=exports;base.Reporter=__webpack_require__(281).Reporter,base.DecoderBuffer=__webpack_require__(149).DecoderBuffer,base.EncoderBuffer=__webpack_require__(149).EncoderBuffer,base.Node=__webpack_require__(280)},function(module,exports,__webpack_require__){(function(Buffer){module.exports=function(a,b){for(var length=Math.min(a.length,b.length),buffer=new Buffer(length),i=0;i=this._delta8){msg=this.pending;var r=msg.length%this._delta8;this.pending=msg.slice(msg.length-r,msg.length),0===this.pending.length&&(this.pending=null),msg=utils.join32(msg,0,msg.length-r,this.endian);for(var i=0;i>>24&255,res[i++]=len>>>16&255,res[i++]=len>>>8&255,res[i++]=255&len}else for(res[i++]=255&len,res[i++]=len>>>8&255,res[i++]=len>>>16&255,res[i++]=len>>>24&255,res[i++]=0,res[i++]=0,res[i++]=0,res[i++]=0,t=8;tutil.deserialize(ipfsBlock.data,cb),(ethObj,cb)=>treeFromEthObject(ethObj,options,cb)],callback)}function treeFromEthObject(ethObj,options,callback){waterfall([cb=>mapFromEthObject(ethObj,options,cb),(tuples,cb)=>cb(null,tuples.map(tuple=>tuple.path))],callback)}function resolve(ipfsBlock,path,callback){waterfall([cb=>util.deserialize(ipfsBlock.data,cb),(ethObj,cb)=>resolveFromEthObject(ethObj,path,cb)],callback)}function resolveFromEthObject(ethObj,path,callback){if(!path||"/"===path){const result={value:ethObj,remainderPath:""};return callback(null,result)}mapFromEthObject(ethObj,{},(err,paths)=>{if(err)return callback(err);const pathParts=path.split("/");let matches=paths.filter(child=>child.path===path.slice(0,child.path.length));matches=matches.filter(child=>child.path.split("/").every((part,index)=>part===pathParts[index]));const sortedMatches=matches.sort((a,b)=>a.path.length=this.charLength-this.charReceived?this.charLength-this.charReceived:buffer.length;if(buffer.copy(this.charBuffer,this.charReceived,0,available),this.charReceived+=available,this.charReceived=55296&&charCode<=56319)){if(this.charReceived=this.charLength=0,0===buffer.length)return charStr;break}this.charLength+=this.surrogateSize,charStr=""}this.detectIncompleteChar(buffer);var end=buffer.length;this.charLength&&(buffer.copy(this.charBuffer,0,buffer.length-this.charReceived,end),end-=this.charReceived),charStr+=buffer.toString(this.encoding,0,end);var end=charStr.length-1,charCode=charStr.charCodeAt(end);if(charCode>=55296&&charCode<=56319){var size=this.surrogateSize;return this.charLength+=size,this.charReceived+=size,this.charBuffer.copy(this.charBuffer,size,0,size),buffer.copy(this.charBuffer,0,0,size),charStr.substring(0,end)}return charStr},StringDecoder.prototype.detectIncompleteChar=function(buffer){for(var i=buffer.length>=3?3:buffer.length;i>0;i--){var c=buffer[buffer.length-i];if(1==i&&c>>5==6){this.charLength=2;break}if(i<=2&&c>>4==14){this.charLength=3;break}if(i<=3&&c>>3==30){this.charLength=4;break}}this.charReceived=i},StringDecoder.prototype.end=function(buffer){var res="";if(buffer&&buffer.length&&(res=this.write(buffer)),this.charReceived){var cr=this.charReceived,buf=this.charBuffer,enc=this.encoding;res+=buf.slice(0,cr).toString(enc)}return res}},function(module,exports,__webpack_require__){function once(fn){var f=function(){return f.called?f.value:(f.called=!0,f.value=fn.apply(this,arguments))};return f.called=!1,f}function onceStrict(fn){var f=function(){if(f.called)throw new Error(f.onceError);return f.called=!0,f.value=fn.apply(this,arguments)},name=fn.name||"Function wrapped with `once`";return f.onceError=name+" shouldn't be called more than once",f.called=!1,f}var wrappy=__webpack_require__(274);module.exports=wrappy(once),module.exports.strict=wrappy(onceStrict),once.proto=once(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return onceStrict(this)},configurable:!0})})},function(module,exports,__webpack_require__){"use strict";module.exports=function(op,done){function sink(_read){if(read=_read,abort)return sink.abort();!function next(){for(var loop=!0,cbed=!1;loop;)if(cbed=!1,read(null,function(end,data){if(cbed=!0,end=end||abort){if(loop=!1,done)done(end===!0?null:end);else if(end&&end!==!0)throw end}else op&&!1===op(data)||abort?(loop=!1,read(abort||!0,done||function(){})):loop||next()}),!cbed)return void(loop=!1)}()}var read,abort;return sink.abort=function(err,cb){if("function"==typeof err&&(cb=err,err=!0),abort=err||!0,read)return read(abort,cb||function(){})},sink}},function(module,exports){module.exports=function(key){return key&&("string"==typeof key?function(data){return data[key]}:"object"==typeof key&&"function"==typeof key.exec?function(data){var v=key.exec(data);return v&&v[0]}:key)}},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function asyncify(func){return(0,_initialParams2.default)(function(args,callback){var result;try{result=func.apply(this,args)}catch(e){return callback(e)}(0,_isObject2.default)(result)&&"function"==typeof result.then?result.then(function(value){invokeCallback(callback,null,value)},function(err){invokeCallback(callback,err.message?err:new Error(err))}):callback(null,result)})}function invokeCallback(callback,error,value){try{callback(error,value)}catch(e){(0,_setImmediate2.default)(rethrow,e)}}function rethrow(error){throw error}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=asyncify;var _isObject=__webpack_require__(234),_isObject2=_interopRequireDefault(_isObject),_initialParams=__webpack_require__(157),_initialParams2=_interopRequireDefault(_initialParams),_setImmediate=__webpack_require__(105),_setImmediate2=_interopRequireDefault(_setImmediate);module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0});var _eachLimit=__webpack_require__(289),_eachLimit2=_interopRequireDefault(_eachLimit),_doLimit=__webpack_require__(103),_doLimit2=_interopRequireDefault(_doLimit);exports.default=(0,_doLimit2.default)(_eachLimit2.default,1),module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function doParallel(fn){return function(obj,iteratee,callback){return fn(_eachOf2.default,obj,(0,_wrapAsync2.default)(iteratee),callback)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=doParallel;var _eachOf=__webpack_require__(101),_eachOf2=_interopRequireDefault(_eachOf),_wrapAsync=__webpack_require__(13),_wrapAsync2=_interopRequireDefault(_wrapAsync);module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0});var _doParallel=__webpack_require__(72),_doParallel2=_interopRequireDefault(_doParallel),_map=__webpack_require__(295),_map2=_interopRequireDefault(_map);exports.default=(0,_doParallel2.default)(_map2.default),module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function whilst(test,iteratee,callback){callback=(0,_onlyOnce2.default)(callback||_noop2.default);var _iteratee=(0,_wrapAsync2.default)(iteratee);if(!test())return callback(null);var next=function(err){if(err)return callback(err);if(test())return _iteratee(next);var args=(0,_slice2.default)(arguments,1);callback.apply(null,[null].concat(args))};_iteratee(next)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=whilst;var _noop=__webpack_require__(29),_noop2=_interopRequireDefault(_noop),_slice=__webpack_require__(48),_slice2=_interopRequireDefault(_slice),_onlyOnce=__webpack_require__(47),_onlyOnce2=_interopRequireDefault(_onlyOnce),_wrapAsync=__webpack_require__(13),_wrapAsync2=_interopRequireDefault(_wrapAsync);module.exports=exports.default},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_RESULT__;!function(globalObj){"use strict";function constructorFactory(configObj){function BigNumber(n,b){var c,e,i,num,len,str,x=this;if(!(x instanceof BigNumber))return ERRORS&&raise(26,"constructor call without new",n),new BigNumber(n,b);if(null!=b&&isValidInt(b,2,64,id,"base")){if(b|=0,str=n+"",10==b)return x=new BigNumber(n instanceof BigNumber?n:str),round(x,DECIMAL_PLACES+x.e+1,ROUNDING_MODE);if((num="number"==typeof n)&&0*n!=0||!new RegExp("^-?"+(c="["+ALPHABET.slice(0,b)+"]+")+"(?:\\."+c+")?$",b<37?"i":"").test(str))return parseNumeric(x,str,num,b);num?(x.s=1/n<0?(str=str.slice(1),-1):1,ERRORS&&str.replace(/^0\.0*|\./,"").length>15&&raise(id,tooManyDigits,n),num=!1):x.s=45===str.charCodeAt(0)?(str=str.slice(1),-1):1,str=convertBase(str,10,b,x.s)}else{if(n instanceof BigNumber)return x.s=n.s,x.e=n.e,x.c=(n=n.c)?n.slice():n,void(id=0);if((num="number"==typeof n)&&0*n==0){if(x.s=1/n<0?(n=-n,-1):1,n===~~n){for(e=0,i=n;i>=10;i/=10,e++);return x.e=e,x.c=[n],void(id=0)}str=n+""}else{if(!isNumeric.test(str=n+""))return parseNumeric(x,str,num);x.s=45===str.charCodeAt(0)?(str=str.slice(1),-1):1}}for((e=str.indexOf("."))>-1&&(str=str.replace(".","")),(i=str.search(/e/i))>0?(e<0&&(e=i),e+=+str.slice(i+1),str=str.substring(0,i)):e<0&&(e=str.length),i=0;48===str.charCodeAt(i);i++);for(len=str.length;48===str.charCodeAt(--len););if(str=str.slice(i,len+1))if(len=str.length,num&&ERRORS&&len>15&&(n>MAX_SAFE_INTEGER||n!==mathfloor(n))&&raise(id,tooManyDigits,x.s*n),(e=e-i-1)>MAX_EXP)x.c=x.e=null;else if(e=0&&(k=POW_PRECISION,POW_PRECISION=0,str=str.replace(".",""),y=new BigNumber(baseIn),x=y.pow(str.length-i),POW_PRECISION=k,y.c=toBaseOut(toFixedPoint(coeffToString(x.c),x.e),10,baseOut),y.e=y.c.length),xc=toBaseOut(str,baseIn,baseOut),e=k=xc.length;0==xc[--k];xc.pop());if(!xc[0])return"0";if(i<0?--e:(x.c=xc,x.e=e,x.s=sign,x=div(x,y,dp,rm,baseOut),xc=x.c,r=x.r,e=x.e),d=e+dp+1,i=xc[d],k=baseOut/2,r=r||d<0||null!=xc[d+1],r=rm<4?(null!=i||r)&&(0==rm||rm==(x.s<0?3:2)):i>k||i==k&&(4==rm||r||6==rm&&1&xc[d-1]||rm==(x.s<0?8:7)),d<1||!xc[0])str=r?toFixedPoint("1",-dp):"0";else{if(xc.length=d,r)for(--baseOut;++xc[--d]>baseOut;)xc[d]=0,d||(++e,xc.unshift(1));for(k=xc.length;!xc[--k];);for(i=0,str="";i<=k;str+=ALPHABET.charAt(xc[i++]));str=toFixedPoint(str,e)}return str}function format(n,i,rm,caller){var c0,e,ne,len,str;if(rm=null!=rm&&isValidInt(rm,0,8,caller,roundingMode)?0|rm:ROUNDING_MODE,!n.c)return n.toString();if(c0=n.c[0],ne=n.e,null==i)str=coeffToString(n.c),str=19==caller||24==caller&&ne<=TO_EXP_NEG?toExponential(str,ne):toFixedPoint(str,ne);else if(n=round(new BigNumber(n),i,rm),e=n.e,str=coeffToString(n.c),len=str.length,19==caller||24==caller&&(i<=e||e<=TO_EXP_NEG)){for(;lenlen){if(--i>0)for(str+=".";i--;str+="0");}else if((i+=e-len)>0)for(e+1==len&&(str+=".");i--;str+="0");return n.s<0&&c0?"-"+str:str}function maxOrMin(args,method){var m,n,i=0;for(isArray(args[0])&&(args=args[0]),m=new BigNumber(args[0]);++imax||n!=truncate(n))&&raise(caller,(name||"decimal places")+(nmax?" out of range":" not an integer"),n),!0}function normalise(n,c,e){for(var i=1,j=c.length;!c[--j];c.pop());for(j=c[0];j>=10;j/=10,i++);return(e=i+e*LOG_BASE-1)>MAX_EXP?n.c=n.e=null:e=10;k/=10,d++);if((i=sd-d)<0)i+=LOG_BASE,j=sd,n=xc[ni=0],rd=n/pows10[d-j-1]%10|0;else if((ni=mathceil((i+1)/LOG_BASE))>=xc.length){if(!r)break out;for(;xc.length<=ni;xc.push(0));n=rd=0,d=1,i%=LOG_BASE,j=i-LOG_BASE+1}else{for(n=k=xc[ni],d=1;k>=10;k/=10,d++);i%=LOG_BASE,j=i-LOG_BASE+d,rd=j<0?0:n/pows10[d-j-1]%10|0}if(r=r||sd<0||null!=xc[ni+1]||(j<0?n:n%pows10[d-j-1]),r=rm<4?(rd||r)&&(0==rm||rm==(x.s<0?3:2)):rd>5||5==rd&&(4==rm||r||6==rm&&(i>0?j>0?n/pows10[d-j]:0:xc[ni-1])%10&1||rm==(x.s<0?8:7)),sd<1||!xc[0])return xc.length=0,r?(sd-=x.e+1,xc[0]=pows10[(LOG_BASE-sd%LOG_BASE)%LOG_BASE],x.e=-sd||0):xc[0]=x.e=0,x;if(0==i?(xc.length=ni,k=1,ni--):(xc.length=ni+1,k=pows10[LOG_BASE-i],xc[ni]=j>0?mathfloor(n/pows10[d-j]%pows10[j])*k:0),r)for(;;){if(0==ni){for(i=1,j=xc[0];j>=10;j/=10,i++);for(j=xc[0]+=k,k=1;j>=10;j/=10,k++);i!=k&&(x.e++,xc[0]==BASE&&(xc[0]=1));break}if(xc[ni]+=k,xc[ni]!=BASE)break;xc[ni--]=0,k=1}for(i=xc.length;0===xc[--i];xc.pop());}x.e>MAX_EXP?x.c=x.e=null:x.ei)return null!=(v=a[i++])};return has(p="DECIMAL_PLACES")&&isValidInt(v,0,MAX,2,p)&&(DECIMAL_PLACES=0|v), -r[p]=DECIMAL_PLACES,has(p="ROUNDING_MODE")&&isValidInt(v,0,8,2,p)&&(ROUNDING_MODE=0|v),r[p]=ROUNDING_MODE,has(p="EXPONENTIAL_AT")&&(isArray(v)?isValidInt(v[0],-MAX,0,2,p)&&isValidInt(v[1],0,MAX,2,p)&&(TO_EXP_NEG=0|v[0],TO_EXP_POS=0|v[1]):isValidInt(v,-MAX,MAX,2,p)&&(TO_EXP_NEG=-(TO_EXP_POS=0|(v<0?-v:v)))),r[p]=[TO_EXP_NEG,TO_EXP_POS],has(p="RANGE")&&(isArray(v)?isValidInt(v[0],-MAX,-1,2,p)&&isValidInt(v[1],1,MAX,2,p)&&(MIN_EXP=0|v[0],MAX_EXP=0|v[1]):isValidInt(v,-MAX,MAX,2,p)&&(0|v?MIN_EXP=-(MAX_EXP=0|(v<0?-v:v)):ERRORS&&raise(2,p+" cannot be zero",v))),r[p]=[MIN_EXP,MAX_EXP],has(p="ERRORS")&&(v===!!v||1===v||0===v?(id=0,isValidInt=(ERRORS=!!v)?intValidatorWithErrors:intValidatorNoErrors):ERRORS&&raise(2,p+notBool,v)),r[p]=ERRORS,has(p="CRYPTO")&&(v===!0||v===!1||1===v||0===v?v?(v="undefined"==typeof crypto,!v&&crypto&&(crypto.getRandomValues||crypto.randomBytes)?CRYPTO=!0:ERRORS?raise(2,"crypto unavailable",v?void 0:crypto):CRYPTO=!1):CRYPTO=!1:ERRORS&&raise(2,p+notBool,v)),r[p]=CRYPTO,has(p="MODULO_MODE")&&isValidInt(v,0,9,2,p)&&(MODULO_MODE=0|v),r[p]=MODULO_MODE,has(p="POW_PRECISION")&&isValidInt(v,0,MAX,2,p)&&(POW_PRECISION=0|v),r[p]=POW_PRECISION,has(p="FORMAT")&&("object"==typeof v?FORMAT=v:ERRORS&&raise(2,p+" not an object",v)),r[p]=FORMAT,r},BigNumber.max=function(){return maxOrMin(arguments,P.lt)},BigNumber.min=function(){return maxOrMin(arguments,P.gt)},BigNumber.random=function(){var random53bitInt=9007199254740992*Math.random()&2097151?function(){return mathfloor(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(dp){var a,b,e,k,v,i=0,c=[],rand=new BigNumber(ONE);if(dp=null!=dp&&isValidInt(dp,0,MAX,14)?0|dp:DECIMAL_PLACES,k=mathceil(dp/LOG_BASE),CRYPTO)if(crypto.getRandomValues){for(a=crypto.getRandomValues(new Uint32Array(k*=2));i>>11),v>=9e15?(b=crypto.getRandomValues(new Uint32Array(2)),a[i]=b[0],a[i+1]=b[1]):(c.push(v%1e14),i+=2);i=k/2}else if(crypto.randomBytes){for(a=crypto.randomBytes(k*=7);i=9e15?crypto.randomBytes(7).copy(a,i):(c.push(v%1e14),i+=7);i=k/7}else CRYPTO=!1,ERRORS&&raise(14,"crypto unavailable",crypto);if(!CRYPTO)for(;i=10;v/=10,i++);ibL?1:-1;else for(i=cmp=0;ib[i]?1:-1;break}return cmp}function subtract(a,b,aL,base){for(var i=0;aL--;)a[aL]-=i,i=a[aL]1;a.shift());}return function(x,y,dp,rm,base){var cmp,e,i,more,n,prod,prodL,q,qc,rem,remL,rem0,xi,xL,yc0,yL,yz,s=x.s==y.s?1:-1,xc=x.c,yc=y.c;if(!(xc&&xc[0]&&yc&&yc[0]))return new BigNumber(x.s&&y.s&&(xc?!yc||xc[0]!=yc[0]:yc)?xc&&0==xc[0]||!yc?0*s:s/0:NaN);for(q=new BigNumber(s),qc=q.c=[],e=x.e-y.e,s=dp+e+1,base||(base=BASE,e=bitFloor(x.e/LOG_BASE)-bitFloor(y.e/LOG_BASE),s=s/LOG_BASE|0),i=0;yc[i]==(xc[i]||0);i++);if(yc[i]>(xc[i]||0)&&e--,s<0)qc.push(1),more=!0;else{for(xL=xc.length,yL=yc.length,i=0,s+=2,n=mathfloor(base/(yc[0]+1)),n>1&&(yc=multiply(yc,n,base),xc=multiply(xc,n,base),yL=yc.length,xL=xc.length),xi=yL,rem=xc.slice(0,yL),remL=rem.length;remL=base/2&&yc0++;do{if(n=0,(cmp=compare(yc,rem,yL,remL))<0){if(rem0=rem[0],yL!=remL&&(rem0=rem0*base+(rem[1]||0)),(n=mathfloor(rem0/yc0))>1)for(n>=base&&(n=base-1),prod=multiply(yc,n,base),prodL=prod.length,remL=rem.length;1==compare(prod,rem,prodL,remL);)n--,subtract(prod,yL=10;s/=10,i++);round(q,dp+(q.e=i+e*LOG_BASE-1)+1,rm,more)}else q.e=e,q.r=+more;return q}}(),parseNumeric=function(){var isInfinityOrNaN=/^-?(Infinity|NaN)$/;return function(x,str,num,b){var base,s=num?str:str.replace(/^\s*\+(?=[\w.])|^\s+|\s+$/g,"");if(isInfinityOrNaN.test(s))x.s=isNaN(s)?null:s<0?-1:1;else{if(!num&&(s=s.replace(/^(-?)0([xbo])(?=\w[\w.]*$)/i,function(m,p1,p2){return base="x"==(p2=p2.toLowerCase())?16:"b"==p2?2:8,b&&b!=base?m:p1}),b&&(base=b,s=s.replace(/^([^.]+)\.$/,"$1").replace(/^\.([^.]+)$/,"0.$1")),str!=s))return new BigNumber(s,base);ERRORS&&raise(id,"not a"+(b?" base "+b:"")+" number",str),x.s=null}x.c=x.e=null,id=0}}(),P.absoluteValue=P.abs=function(){var x=new BigNumber(this);return x.s<0&&(x.s=1),x},P.ceil=function(){return round(new BigNumber(this),this.e+1,2)},P.comparedTo=P.cmp=function(y,b){return id=1,compare(this,new BigNumber(y,b))},P.decimalPlaces=P.dp=function(){var n,v,c=this.c;if(!c)return null;if(n=((v=c.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,v=c[v])for(;v%10==0;v/=10,n--);return n<0&&(n=0),n},P.dividedBy=P.div=function(y,b){return id=3,div(this,new BigNumber(y,b),DECIMAL_PLACES,ROUNDING_MODE)},P.dividedToIntegerBy=P.divToInt=function(y,b){return id=4,div(this,new BigNumber(y,b),0,1)},P.equals=P.eq=function(y,b){return id=5,0===compare(this,new BigNumber(y,b))},P.floor=function(){return round(new BigNumber(this),this.e+1,3)},P.greaterThan=P.gt=function(y,b){return id=6,compare(this,new BigNumber(y,b))>0},P.greaterThanOrEqualTo=P.gte=function(y,b){return id=7,1===(b=compare(this,new BigNumber(y,b)))||0===b},P.isFinite=function(){return!!this.c},P.isInteger=P.isInt=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},P.isNaN=function(){return!this.s},P.isNegative=P.isNeg=function(){return this.s<0},P.isZero=function(){return!!this.c&&0==this.c[0]},P.lessThan=P.lt=function(y,b){return id=8,compare(this,new BigNumber(y,b))<0},P.lessThanOrEqualTo=P.lte=function(y,b){return id=9,(b=compare(this,new BigNumber(y,b)))===-1||0===b},P.minus=P.sub=function(y,b){var i,j,t,xLTy,x=this,a=x.s;if(id=10,y=new BigNumber(y,b),b=y.s,!a||!b)return new BigNumber(NaN);if(a!=b)return y.s=-b,x.plus(y);var xe=x.e/LOG_BASE,ye=y.e/LOG_BASE,xc=x.c,yc=y.c;if(!xe||!ye){if(!xc||!yc)return xc?(y.s=-b,y):new BigNumber(yc?x:NaN);if(!xc[0]||!yc[0])return yc[0]?(y.s=-b,y):new BigNumber(xc[0]?x:3==ROUNDING_MODE?-0:0)}if(xe=bitFloor(xe),ye=bitFloor(ye),xc=xc.slice(),a=xe-ye){for((xLTy=a<0)?(a=-a,t=xc):(ye=xe,t=yc),t.reverse(),b=a;b--;t.push(0));t.reverse()}else for(j=(xLTy=(a=xc.length)<(b=yc.length))?a:b,a=b=0;b0)for(;b--;xc[i++]=0);for(b=BASE-1;j>a;){if(xc[--j]0?(ye=xe,t=yc):(a=-a,t=xc),t.reverse();a--;t.push(0));t.reverse()}for(a=xc.length,b=yc.length,a-b<0&&(t=yc,yc=xc,xc=t,b=a),a=0;b;)a=(xc[--b]=xc[b]+yc[b]+a)/BASE|0,xc[b]=BASE===xc[b]?0:xc[b]%BASE;return a&&(xc.unshift(a),++ye),normalise(y,xc,ye)},P.precision=P.sd=function(z){var n,v,x=this,c=x.c;if(null!=z&&z!==!!z&&1!==z&&0!==z&&(ERRORS&&raise(13,"argument"+notBool,z),z!=!!z&&(z=null)),!c)return null;if(v=c.length-1,n=v*LOG_BASE+1,v=c[v]){for(;v%10==0;v/=10,n--);for(v=c[0];v>=10;v/=10,n++);}return z&&x.e+1>n&&(n=x.e+1),n},P.round=function(dp,rm){var n=new BigNumber(this);return(null==dp||isValidInt(dp,0,MAX,15))&&round(n,~~dp+this.e+1,null!=rm&&isValidInt(rm,0,8,15,roundingMode)?0|rm:ROUNDING_MODE),n},P.shift=function(k){var n=this;return isValidInt(k,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER,16,"argument")?n.times("1e"+truncate(k)):new BigNumber(n.c&&n.c[0]&&(k<-MAX_SAFE_INTEGER||k>MAX_SAFE_INTEGER)?n.s*(k<0?0:1/0):n)},P.squareRoot=P.sqrt=function(){var m,n,r,rep,t,x=this,c=x.c,s=x.s,e=x.e,dp=DECIMAL_PLACES+4,half=new BigNumber("0.5");if(1!==s||!c||!c[0])return new BigNumber(!s||s<0&&(!c||c[0])?NaN:c?x:1/0);if(s=Math.sqrt(+x),0==s||s==1/0?(n=coeffToString(c),(n.length+e)%2==0&&(n+="0"),s=Math.sqrt(n),e=bitFloor((e+1)/2)-(e<0||e%2),s==1/0?n="1e"+e:(n=s.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),r=new BigNumber(n)):r=new BigNumber(s+""),r.c[0])for(e=r.e,s=e+dp,s<3&&(s=0);;)if(t=r,r=half.times(t.plus(div(x,t,dp,1))),coeffToString(t.c).slice(0,s)===(n=coeffToString(r.c)).slice(0,s)){if(r.e=0;){for(c=0,ylo=yc[i]%sqrtBase,yhi=yc[i]/sqrtBase|0,k=xcL,j=i+k;j>i;)xlo=xc[--k]%sqrtBase,xhi=xc[k]/sqrtBase|0,m=yhi*xlo+xhi*ylo,xlo=ylo*xlo+m%sqrtBase*sqrtBase+zc[j]+c,c=(xlo/base|0)+(m/sqrtBase|0)+yhi*xhi,zc[j--]=xlo%base;zc[j]=c}return c?++e:zc.shift(),normalise(y,zc,e)},P.toDigits=function(sd,rm){var n=new BigNumber(this);return sd=null!=sd&&isValidInt(sd,1,MAX,18,"precision")?0|sd:null,rm=null!=rm&&isValidInt(rm,0,8,18,roundingMode)?0|rm:ROUNDING_MODE,sd?round(n,sd,rm):n},P.toExponential=function(dp,rm){return format(this,null!=dp&&isValidInt(dp,0,MAX,19)?1+~~dp:null,rm,19)},P.toFixed=function(dp,rm){return format(this,null!=dp&&isValidInt(dp,0,MAX,20)?~~dp+this.e+1:null,rm,20)},P.toFormat=function(dp,rm){var str=format(this,null!=dp&&isValidInt(dp,0,MAX,21)?~~dp+this.e+1:null,rm,21);if(this.c){var i,arr=str.split("."),g1=+FORMAT.groupSize,g2=+FORMAT.secondaryGroupSize,groupSeparator=FORMAT.groupSeparator,intPart=arr[0],fractionPart=arr[1],isNeg=this.s<0,intDigits=isNeg?intPart.slice(1):intPart,len=intDigits.length;if(g2&&(i=g1,g1=g2,g2=i,len-=i),g1>0&&len>0){for(i=len%g1||g1,intPart=intDigits.substr(0,i);i0&&(intPart+=groupSeparator+intDigits.slice(i)),isNeg&&(intPart="-"+intPart)}str=fractionPart?intPart+FORMAT.decimalSeparator+((g2=+FORMAT.fractionGroupSize)?fractionPart.replace(new RegExp("\\d{"+g2+"}\\B","g"),"$&"+FORMAT.fractionGroupSeparator):fractionPart):intPart}return str},P.toFraction=function(md){var arr,d0,d2,e,exp,n,n0,q,s,k=ERRORS,x=this,xc=x.c,d=new BigNumber(ONE),n1=d0=new BigNumber(ONE),d1=n0=new BigNumber(ONE);if(null!=md&&(ERRORS=!1,n=new BigNumber(md),ERRORS=k,(k=n.isInt())&&!n.lt(ONE)||(ERRORS&&raise(22,"max denominator "+(k?"out of range":"not an integer"),md),md=!k&&n.c&&round(n,n.e+1,1).gte(ONE)?n:null)),!xc)return x.toString();for(s=coeffToString(xc),e=d.e=s.length-x.e-1,d.c[0]=POWS_TEN[(exp=e%LOG_BASE)<0?LOG_BASE+exp:exp],md=!md||n.cmp(d)>0?e>0?d:n1:n,exp=MAX_EXP,MAX_EXP=1/0,n=new BigNumber(s),n0.c[0]=0;q=div(n,d,0,1),d2=d0.plus(q.times(d1)),1!=d2.cmp(md);)d0=d1,d1=d2,n1=n0.plus(q.times(d2=n1)),n0=d2,d=n.minus(q.times(d2=d)),n=d2;return d2=div(md.minus(d0),d1,0,1),n0=n0.plus(d2.times(n1)),d0=d0.plus(d2.times(d1)),n0.s=n1.s=x.s,e*=2,arr=div(n1,d1,e,ROUNDING_MODE).minus(x).abs().cmp(div(n0,d0,e,ROUNDING_MODE).minus(x).abs())<1?[n1.toString(),d1.toString()]:[n0.toString(),d0.toString()],MAX_EXP=exp,arr},P.toNumber=function(){return+this},P.toPower=P.pow=function(n,m){var k,y,z,i=mathfloor(n<0?-n:+n),x=this;if(null!=m&&(id=23,m=new BigNumber(m)),!isValidInt(n,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER,23,"exponent")&&(!isFinite(n)||i>MAX_SAFE_INTEGER&&(n/=0)||parseFloat(n)!=n&&!(n=NaN))||0==n)return k=Math.pow(+x,n),new BigNumber(m?k%m:k);for(m?n>1&&x.gt(ONE)&&x.isInt()&&m.gt(ONE)&&m.isInt()?x=x.mod(m):(z=m,m=null):POW_PRECISION&&(k=mathceil(POW_PRECISION/LOG_BASE+2)),y=new BigNumber(ONE);;){if(i%2){if(y=y.times(x),!y.c)break;k?y.c.length>k&&(y.c.length=k):m&&(y=y.mod(m))}if(!(i=mathfloor(i/2)))break;x=x.times(x),k?x.c&&x.c.length>k&&(x.c.length=k):m&&(x=x.mod(m))}return m?y:(n<0&&(y=ONE.div(y)),z?y.mod(z):k?round(y,POW_PRECISION,ROUNDING_MODE):y)},P.toPrecision=function(sd,rm){return format(this,null!=sd&&isValidInt(sd,1,MAX,24,"precision")?0|sd:null,rm,24)},P.toString=function(b){var str,n=this,s=n.s,e=n.e;return null===e?s?(str="Infinity",s<0&&(str="-"+str)):str="NaN":(str=coeffToString(n.c),str=null!=b&&isValidInt(b,2,64,25,"base")?convertBase(toFixedPoint(str,e),0|b,10,s):e<=TO_EXP_NEG||e>=TO_EXP_POS?toExponential(str,e):toFixedPoint(str,e),s<0&&n.c[0]&&(str="-"+str)),str},P.truncated=P.trunc=function(){return round(new BigNumber(this),this.e+1,1)},P.valueOf=P.toJSON=function(){var str,n=this,e=n.e;return null===e?n.toString():(str=coeffToString(n.c),str=e<=TO_EXP_NEG||e>=TO_EXP_POS?toExponential(str,e):toFixedPoint(str,e),n.s<0?"-"+str:str)},null!=configObj&&BigNumber.config(configObj),BigNumber}function bitFloor(n){var i=0|n;return n>0||n===i?i:i-1}function coeffToString(a){for(var s,z,i=1,j=a.length,r=a[0]+"";il^a?1:-1;for(j=(k=xc.length)<(l=yc.length)?k:l,i=0;iyc[i]^a?1:-1;return k==l?0:k>l^a?1:-1}function intValidatorNoErrors(n,min,max){return(n=truncate(n))>=min&&n<=max}function isArray(obj){return"[object Array]"==Object.prototype.toString.call(obj)}function toBaseOut(str,baseIn,baseOut){for(var j,arrL,arr=[0],i=0,len=str.length;ibaseOut-1&&(null==arr[j+1]&&(arr[j+1]=0),arr[j+1]+=arr[j]/baseOut|0,arr[j]%=baseOut)}return arr.reverse()}function toExponential(str,e){return(str.length>1?str.charAt(0)+"."+str.slice(1):str)+(e<0?"e":"e+")+e}function toFixedPoint(str,e){var len,z;if(e<0){for(z="0.";++e;z+="0");str=z+str}else if(len=str.length,++e>len){for(z="0",e-=len;--e;z+="0");str+=z}else euint_max||x<0?(x_pos=Math.abs(x)%uint_max,x<0?uint_max-x_pos:x_pos):x}function scrub_vec(v){for(;0>>8^255&sx^99,this.SBOX[x]=sx,this.INV_SBOX[sx]=x,x2=d[x],x4=d[x2],x8=d[x4],t=257*d[sx]^16843008*sx,this.SUB_MIX[0][x]=t<<24|t>>>8,this.SUB_MIX[1][x]=t<<16|t>>>16,this.SUB_MIX[2][x]=t<<8|t>>>24,this.SUB_MIX[3][x]=t,t=16843009*x8^65537*x4^257*x2^16843008*x,this.INV_SUB_MIX[0][sx]=t<<24|t>>>8,this.INV_SUB_MIX[1][sx]=t<<16|t>>>16,this.INV_SUB_MIX[2][sx]=t<<8|t>>>24,this.INV_SUB_MIX[3][sx]=t,0===x?x=xi=1:(x=x2^d[d[d[x8^x2]]],xi^=d[d[xi]]);return!0};var G=new Global;AES.blockSize=16,AES.prototype.blockSize=AES.blockSize,AES.keySize=32,AES.prototype.keySize=AES.keySize,AES.prototype._doReset=function(){var invKsRow,keySize,keyWords,ksRow,ksRows,t;for(keyWords=this._key,keySize=keyWords.length,this._nRounds=keySize+6,ksRows=4*(this._nRounds+1),this._keySchedule=[],ksRow=0;ksRow>>24,t=G.SBOX[t>>>24]<<24|G.SBOX[t>>>16&255]<<16|G.SBOX[t>>>8&255]<<8|G.SBOX[255&t],t^=G.RCON[ksRow/keySize|0]<<24):keySize>6&&ksRow%keySize==4&&(t=G.SBOX[t>>>24]<<24|G.SBOX[t>>>16&255]<<16|G.SBOX[t>>>8&255]<<8|G.SBOX[255&t]),this._keySchedule[ksRow-keySize]^t);for(this._invKeySchedule=[],invKsRow=0;invKsRow>>24]]^G.INV_SUB_MIX[1][G.SBOX[t>>>16&255]]^G.INV_SUB_MIX[2][G.SBOX[t>>>8&255]]^G.INV_SUB_MIX[3][G.SBOX[255&t]];return!0},AES.prototype.encryptBlock=function(M){M=bufferToArray(new Buffer(M));var out=this._doCryptBlock(M,this._keySchedule,G.SUB_MIX,G.SBOX),buf=new Buffer(16);return buf.writeUInt32BE(out[0],0),buf.writeUInt32BE(out[1],4),buf.writeUInt32BE(out[2],8),buf.writeUInt32BE(out[3],12),buf},AES.prototype.decryptBlock=function(M){M=bufferToArray(new Buffer(M));var temp=[M[3],M[1]];M[1]=temp[0],M[3]=temp[1];var out=this._doCryptBlock(M,this._invKeySchedule,G.INV_SUB_MIX,G.INV_SBOX),buf=new Buffer(16);return buf.writeUInt32BE(out[0],0),buf.writeUInt32BE(out[3],4),buf.writeUInt32BE(out[2],8),buf.writeUInt32BE(out[1],12),buf},AES.prototype.scrub=function(){scrub_vec(this._keySchedule),scrub_vec(this._invKeySchedule),scrub_vec(this._key)},AES.prototype._doCryptBlock=function(M,keySchedule,SUB_MIX,SBOX){var ksRow,s0,s1,s2,s3,t0,t1,t2,t3;s0=M[0]^keySchedule[0],s1=M[1]^keySchedule[1],s2=M[2]^keySchedule[2],s3=M[3]^keySchedule[3],ksRow=4;for(var round=1;round>>24]^SUB_MIX[1][s1>>>16&255]^SUB_MIX[2][s2>>>8&255]^SUB_MIX[3][255&s3]^keySchedule[ksRow++],t1=SUB_MIX[0][s1>>>24]^SUB_MIX[1][s2>>>16&255]^SUB_MIX[2][s3>>>8&255]^SUB_MIX[3][255&s0]^keySchedule[ksRow++],t2=SUB_MIX[0][s2>>>24]^SUB_MIX[1][s3>>>16&255]^SUB_MIX[2][s0>>>8&255]^SUB_MIX[3][255&s1]^keySchedule[ksRow++],t3=SUB_MIX[0][s3>>>24]^SUB_MIX[1][s0>>>16&255]^SUB_MIX[2][s1>>>8&255]^SUB_MIX[3][255&s2]^keySchedule[ksRow++],s0=t0,s1=t1,s2=t2,s3=t3;return t0=(SBOX[s0>>>24]<<24|SBOX[s1>>>16&255]<<16|SBOX[s2>>>8&255]<<8|SBOX[255&s3])^keySchedule[ksRow++],t1=(SBOX[s1>>>24]<<24|SBOX[s2>>>16&255]<<16|SBOX[s3>>>8&255]<<8|SBOX[255&s0])^keySchedule[ksRow++],t2=(SBOX[s2>>>24]<<24|SBOX[s3>>>16&255]<<16|SBOX[s0>>>8&255]<<8|SBOX[255&s1])^keySchedule[ksRow++],t3=(SBOX[s3>>>24]<<24|SBOX[s0>>>16&255]<<16|SBOX[s1>>>8&255]<<8|SBOX[255&s2])^keySchedule[ksRow++],[fixup_uint32(t0),fixup_uint32(t1),fixup_uint32(t2),fixup_uint32(t3)]},exports.AES=AES}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function incr32(iv){for(var item,len=iv.length;len--;){if(255!==(item=iv.readUInt8(len))){item++,iv.writeUInt8(item,len);break}iv.writeUInt8(0,len)}}function getBlock(self){var out=self._cipher.encryptBlock(self._prev);return incr32(self._prev),out}var xor=__webpack_require__(58);exports.encrypt=function(self,chunk){for(;self._cache.length{b.put(this.transform.convert(key),value)},delete:key=>{b.delete(this.transform.convert(key))},commit:callback=>{b.commit(callback)}}}query(q){return pull(this.child.query(q),pull.map(e=>{return e.key=this.transform.invert(e.key),e}))}close(callback){this.child.close(callback)}}module.exports=KeyTransformDatastore},function(module,exports,__webpack_require__){"use strict";var curve=exports;curve.base=__webpack_require__(340),curve.short=__webpack_require__(343),curve.mont=__webpack_require__(342),curve.edwards=__webpack_require__(341)},function(module,exports,__webpack_require__){"use strict";(function(setImmediate){const protobuf=__webpack_require__(31),Block=__webpack_require__(61),isEqualWith=__webpack_require__(525),assert=__webpack_require__(9),each=__webpack_require__(19),CID=__webpack_require__(8),codecName=__webpack_require__(237),vd=__webpack_require__(677),multihashing=__webpack_require__(21),pbm=protobuf(__webpack_require__(395)),Entry=__webpack_require__(394);class BitswapMessage{constructor(full){this.full=full,this.wantlist=new Map,this.blocks=new Map}get empty(){return 0===this.blocks.size&&0===this.wantlist.size}addEntry(cid,priority,cancel){assert(cid&&CID.isCID(cid),"must be a valid cid");const cidStr=cid.buffer.toString(),entry=this.wantlist.get(cidStr);entry?(entry.priority=priority,entry.cancel=Boolean(cancel)):this.wantlist.set(cidStr,new Entry(cid,priority,cancel))}addBlock(block){assert(Block.isBlock(block),"must be a valid cid");const cidStr=block.cid.buffer.toString();this.blocks.set(cidStr,block)}cancel(cid){assert(CID.isCID(cid),"must be a valid cid");const cidStr=cid.buffer.toString();this.wantlist.delete(cidStr),this.addEntry(cid,0,!0)}serializeToBitswap100(){const msg={wantlist:{entries:Array.from(this.wantlist.values()).map(entry=>{return{block:entry.cid.buffer,priority:Number(entry.priority),cancel:Boolean(entry.cancel)}})},blocks:Array.from(this.blocks.values()).map(block=>block.data)};return this.full&&(msg.wantlist.full=!0),pbm.Message.encode(msg)}serializeToBitswap110(){const msg={wantlist:{entries:Array.from(this.wantlist.values()).map(entry=>{return{block:entry.cid.buffer,priority:Number(entry.priority),cancel:Boolean(entry.cancel)}})},payload:[]};return this.full&&(msg.wantlist.full=!0),this.blocks.forEach(block=>{msg.payload.push({prefix:block.cid.prefix,data:block.data})}),pbm.Message.encode(msg)}equals(other){const cmp=(a,b)=>{if(a.equals&&"function"==typeof a.equals)return a.equals(b)};return!(this.full!==other.full||!isEqualWith(this.wantlist,other.wantlist,cmp)||!isEqualWith(this.blocks,other.blocks,cmp))}get[Symbol.toStringTag](){const list=Array.from(this.wantlist.keys()),blocks=Array.from(this.blocks.keys());return`BitswapMessage `}}BitswapMessage.deserialize=((raw,callback)=>{let decoded;try{decoded=pbm.Message.decode(raw)}catch(err){return setImmediate(()=>callback(err))}const isFull=decoded.wantlist&&decoded.wantlist.full||!1,msg=new BitswapMessage(isFull);return decoded.wantlist&&decoded.wantlist.entries.forEach(entry=>{const cid=new CID(entry.block);msg.addEntry(cid,entry.priority,entry.cancel)}),decoded.blocks.length>0?each(decoded.blocks,(b,cb)=>{multihashing(b,"sha2-256",(err,hash)=>{if(err)return cb(err);const cid=new CID(hash);msg.addBlock(new Block(b,cid)),cb()})},err=>{if(err)return callback(err);callback(null,msg)}):decoded.payload.length>0?each(decoded.payload,(p,cb)=>{p.prefix&&p.data||cb();const values=vd(p.prefix),cidVersion=values[0],multicodec=values[1],hashAlg=values[2];multihashing(p.data,hashAlg,(err,hash)=>{if(err)return cb(err);const cid=new CID(cidVersion,codecName[multicodec.toString("16")],hash);msg.addBlock(new Block(p.data,cid)),cb()})},err=>{if(err)return callback(err);callback(null,msg)}):void callback(null,msg)}),BitswapMessage.Entry=Entry,module.exports=BitswapMessage}).call(exports,__webpack_require__(37).setImmediate)},function(module,exports,__webpack_require__){"use strict";const sort=__webpack_require__(529),Entry=__webpack_require__(396);class Wantlist{constructor(){this.set=new Map}get length(){return this.set.size}add(cid,priority){const cidStr=cid.buffer.toString(),entry=this.set.get(cidStr);entry?(entry.inc(),entry.priority=priority):this.set.set(cidStr,new Entry(cid,priority))}remove(cid){const cidStr=cid.buffer.toString(),entry=this.set.get(cidStr);entry&&(entry.dec(),entry.hasRefs()||this.set.delete(cidStr))}removeForce(cidStr){this.set.has(cidStr)&&this.set.delete(cidStr)}entries(){return this.set.entries()}sortedEntries(){return new Map(sort(Array.from(this.set.entries()),o=>{return o[1].key}))}contains(cid){const cidStr=cid.buffer.toString();return this.set.get(cidStr)}}Wantlist.Entry=Entry,module.exports=Wantlist},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function create(data,dagLinks,hashAlg,callback){if("function"==typeof data?(callback=data,data=void 0):"string"==typeof data&&(data=new Buffer(data)),"function"==typeof dagLinks&&(callback=dagLinks,dagLinks=[]),"function"==typeof hashAlg&&(callback=hashAlg,hashAlg=void 0),!Buffer.isBuffer(data))return callback("Passed 'data' is not a buffer or a string!");hashAlg||(hashAlg="sha2-256");const links=dagLinks.map(l=>{return l.constructor&&"DAGLink"===l.constructor.name?l:new DAGLink(l.name?l.name:l.Name,l.size?l.size:l.Size,l.hash||l.Hash||l.multihash)}),sortedLinks=sort(links,linkSort);serialize({data:data,links:sortedLinks},(err,serialized)=>{if(err)return callback(err);multihashing(serialized,hashAlg,(err,multihash)=>{if(err)return callback(err);callback(null,new DAGNode(data,sortedLinks,serialized,multihash))})})}const multihashing=__webpack_require__(21),sort=__webpack_require__(664),dagPBUtil=__webpack_require__(119),serialize=dagPBUtil.serialize,dagNodeUtil=__webpack_require__(86),linkSort=dagNodeUtil.linkSort,DAGNode=__webpack_require__(118),DAGLink=__webpack_require__(51);module.exports=create}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function cloneData(dagNode){let data;return dagNode.data&&dagNode.data.length>0?(data=new Buffer(dagNode.data.length),dagNode.data.copy(data)):data=new Buffer(0),data}function cloneLinks(dagNode){return dagNode.links.slice()}function linkSort(a,b){const aBuf=new Buffer(a.name||"","ascii"),bBuf=new Buffer(b.name||"","ascii");return aBuf.compare(bBuf)}function toDAGLink(node){return new DAGLink("",node.size,node.multihash)}const DAGLink=__webpack_require__(51);exports=module.exports,exports.cloneData=cloneData,exports.cloneLinks=cloneLinks,exports.linkSort=linkSort,exports.toDAGLink=toDAGLink}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){var createError=__webpack_require__(363).create,LevelUPError=createError("LevelUPError"),NotFoundError=createError("NotFoundError",LevelUPError);NotFoundError.prototype.notFound=!0,NotFoundError.prototype.status=404,module.exports={LevelUPError:LevelUPError,InitializationError:createError("InitializationError",LevelUPError),OpenError:createError("OpenError",LevelUPError),ReadError:createError("ReadError",LevelUPError),WriteError:createError("WriteError",LevelUPError),NotFoundError:NotFoundError,EncodingError:createError("EncodingError",LevelUPError)}},function(module,exports,__webpack_require__){"use strict";const multistream=__webpack_require__(136);module.exports=function(protocols,conn){const ms=new multistream.Listener;Object.keys(protocols).forEach(protocol=>{protocol&&ms.addHandler(protocol,protocols[protocol].handlerFunc,protocols[protocol].matchFunc)}),ms.handle(conn,err=>{})}},function(module,exports,__webpack_require__){"use strict";function and(){function matches(a){"string"==typeof a&&(a=multiaddr(a));let out=partialMatch(a.protoNames());return null!==out&&0===out.length}function partialMatch(a){return a.lengthor(and(_Circuit,CircuitRecursive),_Circuit),Circuit=CircuitRecursive(),IPFS=or(and(Circuit,_IPFS,Circuit),and(_IPFS,Circuit),and(Circuit,_IPFS),Circuit,_IPFS);exports.DNS=DNS,exports.DNS4=DNS4,exports.DNS6=DNS6,exports.IP=IP,exports.TCP=TCP,exports.UDP=UDP,exports.UTP=UTP,exports.HTTP=HTTP,exports.WebSockets=WebSockets,exports.WebSocketsSecure=WebSocketsSecure,exports.WebRTCStar=WebRTCStar,exports.WebRTCDirect=WebRTCDirect,exports.Reliable=Reliable,exports.Circuit=Circuit,exports.IPFS=IPFS},function(module,exports,__webpack_require__){"use strict";const baseTable=__webpack_require__(65),varintBufferEncode=__webpack_require__(238).varintBufferEncode,varintTable={};module.exports=varintTable;for(let encodingName in baseTable){let code=baseTable[encodingName];varintTable[encodingName]=varintBufferEncode(code)}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function randomId(){return(~~(1e9*Math.random())).toString(36)}function encode(msg,callback){const values=Buffer.isBuffer(msg)?[msg]:[new Buffer(msg)];pull(pull.values(values),pullLP.encode(),pull.collect((err,encoded)=>{if(err)return callback(err);callback(null,encoded[0])}))}function createLogger(type){function printer(logger){return msg=>{Array.isArray(msg)&&(msg=msg.join(" ")),logger("(%s) %s",rId,msg)}}const rId=randomId(),log=printer(debug("mss:"+type));return log.error=printer(debug("mss:"+type+":error")),log}const pull=__webpack_require__(4),pullLP=__webpack_require__(23),debug=__webpack_require__(3);exports=module.exports,exports.writeEncoded=((writer,msg,callback)=>{encode(msg,(err,msg)=>{if(err)return callback(err);writer.write(msg)})}),exports.log={},exports.log.dialer=(()=>{return createLogger("dialer\t")}),exports.log.listener=(()=>{return createLogger("listener\t")})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(setImmediate,process){function nodeify(promise,cb){return"function"!=typeof cb?promise:promise.then(function(res){nextTick(function(){cb(null,res)})},function(err){nextTick(function(){cb(err)})})}function nodeifyThis(cb){return nodeify(this,cb)}function extend(prom){if(prom&&isPromise(prom)){prom.nodeify=nodeifyThis;var then=prom.then;return prom.then=function(){return extend(then.apply(this,arguments))},prom}"function"==typeof prom?prom.prototype.nodeify=nodeifyThis:Promise.prototype.nodeify=nodeifyThis}function NodeifyPromise(fn){if(!(this instanceof NodeifyPromise))return new NodeifyPromise(fn);Promise.call(this,fn),extend(this)}var nextTick,Promise=__webpack_require__(586),isPromise=__webpack_require__(204);nextTick="function"==typeof setImmediate?setImmediate:"object"==typeof process&&process&&process.nextTick?process.nextTick:function(cb){setTimeout(cb,0)},module.exports=nodeify,nodeify.extend=extend,nodeify.Promise=NodeifyPromise,NodeifyPromise.prototype=Object.create(Promise.prototype),NodeifyPromise.prototype.constructor=NodeifyPromise}).call(exports,__webpack_require__(37).setImmediate,__webpack_require__(5))},function(module,exports){exports.encode=function(obj){var str="";for(var i in obj)obj.hasOwnProperty(i)&&(str.length&&(str+="&"),str+=encodeURIComponent(i)+"="+encodeURIComponent(obj[i]));return str},exports.decode=function(qs){for(var qry={},pairs=qs.split("&"),i=0,l=pairs.length;i>>2,bn.words[2]=(63&b32[22])<<20|b32[23]<<12|b32[24]<<4|b32[25]>>>4,bn.words[3]=(255&b32[19])<<18|b32[20]<<10|b32[21]<<2|b32[22]>>>6,bn.words[4]=(3&b32[15])<<24|b32[16]<<16|b32[17]<<8|b32[18],bn.words[5]=(15&b32[12])<<22|b32[13]<<14|b32[14]<<6|b32[15]>>>2,bn.words[6]=(63&b32[9])<<20|b32[10]<<12|b32[11]<<4|b32[12]>>>4,bn.words[7]=(255&b32[6])<<18|b32[7]<<10|b32[8]<<2|b32[9]>>>6,bn.words[8]=(3&b32[2])<<24|b32[3]<<16|b32[4]<<8|b32[5],bn.words[9]=b32[0]<<14|b32[1]<<6|b32[2]>>>2,bn.length=10,bn.strip()},BN.prototype.toBuffer=function(){for(var w=this.words,i=this.length;i<10;++i)w[i]=0;return Buffer.from([w[9]>>>14&255,w[9]>>>6&255,(63&w[9])<<2|w[8]>>>24&3,w[8]>>>16&255,w[8]>>>8&255,255&w[8],w[7]>>>18&255,w[7]>>>10&255,w[7]>>>2&255,(3&w[7])<<6|w[6]>>>20&63,w[6]>>>12&255,w[6]>>>4&255,(15&w[6])<<4|w[5]>>>22&15,w[5]>>>14&255,w[5]>>>6&255,(63&w[5])<<2|w[4]>>>24&3,w[4]>>>16&255,w[4]>>>8&255,255&w[4],w[3]>>>18&255,w[3]>>>10&255,w[3]>>>2&255,(3&w[3])<<6|w[2]>>>20&63,w[2]>>>12&255,w[2]>>>4&255,(15&w[2])<<4|w[1]>>>22&15,w[1]>>>14&255,w[1]>>>6&255,(63&w[1])<<2|w[0]>>>24&3,w[0]>>>16&255,w[0]>>>8&255,255&w[0]])},BN.prototype.clone=function(){var r=new BN;r.words=new Array(this.length);for(var i=0;i1&&0==(0|this.words[this.length-1]);)this.length--;return this},BN.prototype.normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.isEven=function(){return 0==(1&this.words[0])},BN.prototype.isOdd=function(){return 1==(1&this.words[0])},BN.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},BN.prototype.ucmp=function(num){if(this.length!==num.length)return this.length>num.length?1:-1;for(var i=this.length-1;i>=0;--i)if(this.words[i]!==num.words[i])return this.words[i]>num.words[i]?1:-1;return 0},BN.prototype.gtOne=function(){return this.length>1||this.words[0]>1},BN.prototype.isOverflow=function(){return this.ucmp(BN.n)>=0},BN.prototype.isHigh=function(){return 1===this.ucmp(BN.nh)},BN.prototype.bitLengthGT256=function(){return this.length>10||10===this.length&&this.words[9]>4194303},BN.prototype.iuaddn=function(num){this.words[0]+=num;for(var i=0;this.words[i]>67108863&&inum.length?(a=this,b=num):(a=num,b=this);for(var i=0,carry=0;i>>26}for(;0!==carry&&i>>26;if(this.length=a.length,0!==carry)this.words[this.length++]=carry;else if(a!==this)for(;i0?(a=this,b=num):(a=num,b=this);for(var i=0,carry=0;i>26,this.words[i]=67108863&word}for(;0!==carry&&i>26,this.words[i]=67108863&word;if(0===carry&&i>>26,rword=67108863&carry,j=Math.max(0,k-num1.length+1),maxJ=Math.min(k,num2.length-1);j<=maxJ;j++){var i=k-j,a=num1.words[i],b=num2.words[j],r=a*b+rword;ncarry+=r/67108864|0,rword=67108863&r}out.words[k]=rword,carry=ncarry}return 0!==carry&&(out.words[out.length++]=carry),out.strip()},BN.umulTo10x10=Math.imul?optimized.umulTo10x10:BN.umulTo,BN.umulnTo=function(num,k,out){if(0===k)return out.words=[0],out.length=1,out;for(var i=0,carry=0;i0?(out.words[i]=carry,out.length=num.length+1):out.length=num.length,out},BN.prototype.umul=function(num){var out=new BN;return out.words=new Array(this.length+num.length),10===this.length&&10===num.length?BN.umulTo10x10(this,num,out):1===this.length?BN.umulnTo(num,this.words[0],out):1===num.length?BN.umulnTo(this,num.words[0],out):BN.umulTo(this,num,out)},BN.prototype.isplit=function(output){output.length=Math.min(this.length,9);for(var i=0;i>>22,prev=word}return prev>>>=22,this.words[i-10]=prev,0===prev&&this.length>10?this.length-=10:this.length-=9,this},BN.prototype.fireduce=function(){return this.isOverflow()&&this.isub(BN.n),this},BN.prototype.ureduce=function(){var num=this.clone().isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp);return num.bitLengthGT256()&&(num=num.isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp),num.bitLengthGT256()&&(num=num.isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp))),num.fireduce()},BN.prototype.ishrn=function(n){for(var mask=(1<=0;--i){var word=this.words[i];this.words[i]=carry<>>n,carry=word&mask}return this.length>1&&0===this.words[this.length-1]&&(this.length-=1),this},BN.prototype.uinvm=function(){for(var x=this.clone(),y=BN.n.clone(),A=BN.fromNumber(1),B=BN.fromNumber(0),C=BN.fromNumber(0),D=BN.fromNumber(1);x.isEven()&&y.isEven();){for(var k=1,m=1;0==(x.words[0]&m)&&0==(y.words[0]&m)&&k<26;++k,m<<=1);x.ishrn(k),y.ishrn(k)}for(var yp=y.clone(),xp=x.clone();!x.isZero();){for(var i=0,im=1;0==(x.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(x.ishrn(i);i-- >0;)(A.isOdd()||B.isOdd())&&(A.iadd(yp),B.isub(xp)),A.ishrn(1),B.ishrn(1);for(var j=0,jm=1;0==(y.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(y.ishrn(j);j-- >0;)(C.isOdd()||D.isOdd())&&(C.iadd(yp),D.isub(xp)),C.ishrn(1),D.ishrn(1);x.ucmp(y)>=0?(x.isub(y),A.isub(C),B.isub(D)):(y.isub(x),C.isub(A),D.isub(B))}if(1===C.negative){C.negative=0;var result=C.ureduce();return result.negative^=1,result.normSign().iadd(BN.n)}return C.ureduce()},BN.prototype.imulK=function(){this.words[this.length]=0,this.words[this.length+1]=0,this.length+=2;for(var i=0,lo=0;i0?this.isub(BN.p):this.strip(),this},BN.prototype.redNeg=function(){return this.isZero()?BN.fromNumber(0):BN.p.sub(this)},BN.prototype.redAdd=function(num){return this.clone().redIAdd(num)},BN.prototype.redIAdd=function(num){return this.iadd(num),this.ucmp(BN.p)>=0&&this.isub(BN.p),this},BN.prototype.redIAdd7=function(){return this.iuaddn(7),this.ucmp(BN.p)>=0&&this.isub(BN.p),this},BN.prototype.redSub=function(num){return this.clone().redISub(num)},BN.prototype.redISub=function(num){return this.isub(num),0!==this.negative&&this.iadd(BN.p),this},BN.prototype.redMul=function(num){return this.umul(num).redIReduce()},BN.prototype.redSqr=function(){return this.umul(this).redIReduce()},BN.prototype.redSqrt=function(){if(this.isZero())return this.clone();for(var wv2=this.redSqr(),wv4=wv2.redSqr(),wv12=wv4.redSqr().redMul(wv4),wv14=wv12.redMul(wv2),wv15=wv14.redMul(this),out=wv15,i=0;i<54;++i)out=out.redSqr().redSqr().redSqr().redSqr().redMul(wv15);for(out=out.redSqr().redSqr().redSqr().redSqr().redMul(wv14),i=0;i<5;++i)out=out.redSqr().redSqr().redSqr().redSqr().redMul(wv15);return out=out.redSqr().redSqr().redSqr().redSqr().redMul(wv12),out=out.redSqr().redSqr().redSqr().redSqr().redSqr().redSqr().redMul(wv12),0===out.redSqr().ucmp(this)?out:null},BN.prototype.redInvm=function(){for(var a=this.clone(),b=BN.p.clone(),x1=BN.fromNumber(1),x2=BN.fromNumber(0);a.gtOne()&&b.gtOne();){for(var i=0,im=1;0==(a.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(a.ishrn(i);i-- >0;)x1.isOdd()&&x1.iadd(BN.p),x1.ishrn(1);for(var j=0,jm=1;0==(b.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(b.ishrn(j);j-- >0;)x2.isOdd()&&x2.iadd(BN.p),x2.ishrn(1);a.ucmp(b)>=0?(a.isub(b),x1.isub(x2)):(b.isub(a),x2.isub(x1))}var res;return res=1===a.length&&1===a.words[0]?x1:x2,0!==res.negative&&res.iadd(BN.p),0!==res.negative?(res.negative=0,res.redIReduce().redNeg()):res.redIReduce()},BN.prototype.getNAF=function(w){for(var naf=[],ws=1<>1,k=this.clone();!k.isZero();){for(var i=0,m=1;0==(k.words[0]&m)&&i<26;++i,m<<=1)naf.push(0);if(0!==i)k.ishrn(i);else{var mod=k.words[0]&wsm1;if(mod>=ws2)naf.push(ws2-mod),k.iuaddn(mod-ws2).ishrn(1);else if(naf.push(mod),k.words[0]-=mod,!k.isZero()){for(i=w-1;i>0;--i)naf.push(0);k.ishrn(w)}}}return naf},BN.prototype.inspect=function(){if(this.isZero())return"0";for(var buffer=this.toBuffer().toString("hex"),i=0;"0"===buffer[i];++i);return buffer.slice(i)},BN.n=BN.fromBuffer(Buffer.from("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","hex")),BN.nh=BN.n.clone().ishrn(1),BN.nc=BN.fromBuffer(Buffer.from("000000000000000000000000000000014551231950B75FC4402DA1732FC9BEBF","hex")),BN.p=BN.fromBuffer(Buffer.from("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","hex")),BN.psn=BN.p.sub(BN.n),BN.tmp=new BN,BN.tmp.words=new Array(10),function(){BN.fromNumber(1).words[3]=0}(),module.exports=BN},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function eachOfArrayLike(coll,iteratee,callback){function iteratorCallback(err,value){err?callback(err):++completed!==length&&value!==_breakLoop2.default||callback(null)}callback=(0,_once2.default)(callback||_noop2.default);var index=0,completed=0,length=coll.length;for(0===length&&callback(null);index>2,mant=(3&buf[0])<<8|buf[1],exp?31===exp?sign*(mant?NaN:Infinity):sign*Math.pow(2,exp-25)*(1024+mant):5.960464477539063e-8*sign*mant},exports.arrayBufferToBignumber=function(buf){const len=buf.byteLength;let res="";for(let i=0;i{const res=new Map,keys=Object.keys(obj),length=keys.length;for(let i=0;i{return f*SHIFT16+g}),exports.buildInt64=((f1,f2,g1,g2)=>{const f=exports.buildInt32(f1,f2),g=exports.buildInt32(g1,g2);return f>2097151?new Bignumber(f).times(SHIFT32).plus(g):f*SHIFT32+g}),exports.writeHalf=function(buf,half){const u32=new Buffer(4);u32.writeFloatBE(half,0);const u=u32.readUInt32BE(0);if(0!=(8191&u))return!1;var s16=u>>16&32768;const exp=u>>23&255,mant=8388607&u;if(exp>=113&&exp<=142)s16+=(exp-112<<10)+(mant>>13);else{if(!(exp>=103&&exp<113))return!1;if(mant&(1<<126-exp)-1)return!1;s16+=mant+8388608>>126-exp}return buf.writeUInt16BE(s16,0),!0},exports.keySorter=function(a,b){var lenA=a[0].byteLength,lenB=b[0].byteLength;return lenA>lenB?1:lenB>lenA?-1:a[0].compare(b[0])},exports.isNegativeZero=(x=>{return 0===x&&1/x<0}),exports.nextPowerOf2=(n=>{let count=0;if(n&&!(n&n-1))return n;for(;0!==n;)n>>=1,count+=1;return 1<>5]|=128<>>9<<4)]=len;for(var a=1732584193,b=-271733879,c=-1732584194,d=271733878,i=0;i>16)+(y>>16)+(lsw>>16)<<16|65535&lsw}function bit_rol(num,cnt){return num<>>32-cnt}var makeHash=__webpack_require__(323);module.exports=function(buf){return makeHash(buf,core_md5)}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const pull=__webpack_require__(4),levelup=__webpack_require__(470),asyncFilter=__webpack_require__(16).utils.asyncFilter,asyncSort=__webpack_require__(16).utils.asyncSort,Key=__webpack_require__(16).Key;class LevelDatastore{constructor(path,opts){this.db=levelup(path,Object.assign(opts||{},{compression:!1,valueEncoding:"binary"}))}open(callback){this.db.open(callback)}put(key,value,callback){this.db.put(key.toString(),value,callback)}get(key,callback){this.db.get(key.toString(),callback)}has(key,callback){this.db.get(key.toString(),(err,res)=>{if(err)return err.notFound?void callback(null,!1):void callback(err);callback(null,!0)})}delete(key,callback){this.db.del(key.toString(),callback)}close(callback){this.db.close(callback)}batch(){const ops=[];return{put:(key,value)=>{ops.push({type:"put",key:key.toString(),value:value})},delete:key=>{ops.push({type:"del",key:key.toString()})},commit:callback=>{this.db.batch(ops,callback)}}}query(q){let values=!0;null!=q.keysOnly&&(values=!q.keysOnly);const iter=this.db.db.iterator({keys:!0,values:values,keyAsBuffer:!0}),rawStream=(end,cb)=>{if(end)return iter.end(err=>{cb(err||end)});iter.next((err,key,value)=>{if(err)return cb(err);if(null==err&&null==key&&null==value)return iter.end(err=>{cb(err||!0)});const res={key:new Key(key,!1)};values&&(res.value=new Buffer(value)),cb(null,res)})} -;let tasks=[rawStream],filters=[];if(null!=q.prefix){const prefix=q.prefix;filters.push((e,cb)=>cb(null,e.key.toString().startsWith(prefix)))}if(null!=q.filters&&(filters=filters.concat(q.filters)),tasks=tasks.concat(filters.map(f=>asyncFilter(f))),null!=q.orders&&(tasks=tasks.concat(q.orders.map(o=>asyncSort(o)))),null!=q.offset){let i=0;tasks.push(pull.filter(()=>i++>=q.offset))}return null!=q.limit&&tasks.push(pull.take(q.limit)),pull.apply(null,tasks)}}module.exports=LevelDatastore}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function Transport(opts){this.path=opts.path,this.hostname=opts.hostname,this.port=opts.port,this.secure=opts.secure,this.query=opts.query,this.timestampParam=opts.timestampParam,this.timestampRequests=opts.timestampRequests,this.readyState="",this.agent=opts.agent||!1,this.socket=opts.socket,this.enablesXDR=opts.enablesXDR,this.pfx=opts.pfx,this.key=opts.key,this.passphrase=opts.passphrase,this.cert=opts.cert,this.ca=opts.ca,this.ciphers=opts.ciphers,this.rejectUnauthorized=opts.rejectUnauthorized,this.forceNode=opts.forceNode,this.extraHeaders=opts.extraHeaders,this.localAddress=opts.localAddress}var parser=__webpack_require__(50),Emitter=__webpack_require__(49);module.exports=Transport,Emitter(Transport.prototype),Transport.prototype.onError=function(msg,desc){var err=new Error(msg);return err.type="TransportError",err.description=desc,this.emit("error",err),this},Transport.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},Transport.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},Transport.prototype.send=function(packets){if("open"!==this.readyState)throw new Error("Transport not open");this.write(packets)},Transport.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},Transport.prototype.onData=function(data){var packet=parser.decodePacket(data,this.socket.binaryType);this.onPacket(packet)},Transport.prototype.onPacket=function(packet){this.emit("packet",packet)},Transport.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(module,exports,__webpack_require__){(function(global){var hasCORS=__webpack_require__(375);module.exports=function(opts){var xdomain=opts.xdomain,xscheme=opts.xscheme,enablesXDR=opts.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!xdomain||hasCORS))return new XMLHttpRequest}catch(e){}try{if("undefined"!=typeof XDomainRequest&&!xscheme&&enablesXDR)return new XDomainRequest}catch(e){}if(!xdomain)try{return new(global[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){var hash=exports;hash.utils=__webpack_require__(27),hash.common=__webpack_require__(60),hash.sha=__webpack_require__(379),hash.ripemd=__webpack_require__(378),hash.hmac=__webpack_require__(377),hash.sha1=hash.sha.sha1,hash.sha256=hash.sha.sha256,hash.sha224=hash.sha.sha224,hash.sha384=hash.sha.sha384,hash.sha512=hash.sha.sha512,hash.ripemd160=hash.ripemd.ripemd160},function(module,exports){var indexOf=[].indexOf;module.exports=function(arr,obj){if(indexOf)return arr.indexOf(obj);for(var i=0;i{busy?abortCb=cb:cb(abort)}):read(abort,cb)):read(null,(end,data)=>{end?cb(end):aborted?cb(aborted):(busy=!0,test(data,(err,valid)=>{busy=!1,aborted?(cb(aborted),abortCb(aborted)):err?next(err,cb):valid?cb(null,data):next(null,cb)}))})}}},exports.asyncSort=function(sorter){const source=Source(),sink=pull.collect((err,ary)=>{if(err)return source.abort(err);sorter(ary,(err,res)=>{if(err)return source.abort(err);source.resolve(pull.values(ary))})});return function(read){return sink(read),source}},exports.replaceStartWith=function(s,r){const matcher=new RegExp("^"+r);return s.replace(matcher,"")},exports.tmpdir=(()=>{return path.join(os.tmpdir(),uuid())})},function(module,exports,__webpack_require__){"use strict";module.exports={maxProvidersPerRequest:3,providerRequestTimeout:1e4,hasBlockTimeout:15e3,provideTimeout:15e3,kMaxPriority:Math.pow(2,31)-1,rebroadcastDelay:1e4,maxListeners:1e3}},function(module,exports,__webpack_require__){"use strict";module.exports=class Dir{}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(12),assert=__webpack_require__(9);class DAGNode{constructor(data,links,serialized,multihash){assert(serialized,"DAGNode needs its serialized format"),assert(multihash,"DAGNode needs its multihash"),"string"==typeof multihash&&(multihash=mh.fromB58String(multihash)),this._data=data||new Buffer(0),this._links=links||[],this._serialized=serialized,this._multihash=multihash,this._size=this.links.reduce((sum,l)=>sum+l.size,this.serialized.length),this._json={data:this.data,links:this.links.map(l=>l.toJSON()),multihash:mh.toB58String(this.multihash),size:this.size}}toJSON(){return this._json}toString(){return`DAGNode <${mh.toB58String(this.multihash)} - data: "${this.data.toString()}", links: ${this.links.length}, size: ${this.size}>`}get data(){return this._data}set data(data){throw new Error("Can't set property: 'data' is immutable")}get links(){return this._links}set links(links){throw new Error("Can't set property: 'links' is immutable")}get serialized(){return this._serialized}set serialized(serialized){throw new Error("Can't set property: 'serialized' is immutable")}get size(){return this._size}set size(size){throw new Error("Can't set property: 'size' is immutable")}get multihash(){return this._multihash}set multihash(multihash){throw new Error("Can't set property: 'multihash' is immutable")}}exports=module.exports=DAGNode,exports.create=__webpack_require__(85),exports.clone=__webpack_require__(437),exports.addLink=__webpack_require__(436),exports.rmLink=__webpack_require__(438)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function cid(node,callback){if(node.multihash)return callback(null,new CID(node.multihash));callback(new Error("not valid dagPB node"))}function serialize(node,callback){let serialized;try{const pb=toProtoBuf(node);serialized=proto.PBNode.encode(pb)}catch(err){return callback(err)}callback(null,serialized)}function deserialize(data,callback){const pbn=proto.PBNode.decode(data),links=pbn.Links.map(link=>{return new DAGLink(link.Name,link.Tsize,link.Hash)}),buf=pbn.Data||new Buffer(0);DAGNode.create(buf,links,callback)}function toProtoBuf(node){const pbn={};return node.data&&node.data.length>0?pbn.Data=node.data:pbn.Data=null,node.links&&node.links.length>0?pbn.Links=node.links.map(link=>{return{Hash:link.multihash,Name:link.name,Tsize:link.size}}):pbn.Links=null,pbn}const CID=__webpack_require__(434),protobuf=__webpack_require__(31),proto=protobuf(__webpack_require__(439)),DAGLink=__webpack_require__(51),DAGNode=__webpack_require__(118);exports=module.exports,exports.serialize=serialize,exports.deserialize=deserialize,exports.cid=cid}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function createTrieResolver(multicodec,leafResolver){function mapFromEthObj(trieNode,options,callback){mapFromBaseTrie(trieNode,options,(err,basePaths)=>{if(err)return callback(err);if(!leafResolver)return callback(null,basePaths);let paths=basePaths.slice();each(basePaths.filter(child=>Buffer.isBuffer(child.value)),(child,cb)=>{return waterfall([cb=>leafResolver.util.deserialize(child.value,cb),(ethObj,cb)=>leafResolver.resolver._mapFromEthObject(ethObj,options,cb)],(err,grandChildren)=>{if(err)return cb(err);grandChildren.forEach(grandChild=>{paths.push({path:child.path+"/"+grandChild.path,value:grandChild.value})}),cb()})},err=>{if(err)return callback(err);callback(null,paths)})})}function mapFromBaseTrie(trieNode,options,callback){let paths=[];"leaf"===trieNode.type&&paths.push({path:nibbleToPath(trieNode.getKey()),value:trieNode.getValue()}),each(trieNode.getChildren(),(childData,next)=>{const key=nibbleToPath(childData[0]),value=childData[1];if(EthTrieNode.isRawNode(value)){const childNode=new EthTrieNode(value);paths.push({path:key,value:childNode}),mapFromBaseTrie(childNode,options,(err,subtree)=>{if(err)return next(err);subtree.forEach(path=>{path.path=key+"/"+path.path}),paths=paths.concat(subtree),next()})}else{let link={"/":cidFromHash(multicodec,value).toBaseEncodedString()};paths.push({path:key,value:link}),next()}},err=>{if(err)return callback(err);callback(null,paths)})}const baseTrie=createResolver(multicodec,EthTrieNode,mapFromEthObj);return baseTrie.util.deserialize=asyncify(serialized=>{return new EthTrieNode(rlp.decode(serialized))}),baseTrie}function nibbleToPath(data){return data.map(num=>num.toString(16)).join("/")}const each=__webpack_require__(19),waterfall=__webpack_require__(7),asyncify=__webpack_require__(70),rlp=__webpack_require__(45),EthTrieNode=__webpack_require__(560),createResolver=__webpack_require__(62),cidFromHash=(__webpack_require__(445),__webpack_require__(446),__webpack_require__(202),__webpack_require__(201),__webpack_require__(200),__webpack_require__(53));module.exports=createTrieResolver}).call(exports,__webpack_require__(0).Buffer)},function(module,exports){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_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"}},function(module,exports,__webpack_require__){(function(Buffer,process){function Level(location){if(!(this instanceof Level))return new Level(location);AbstractLevelDOWN.call(this,location)}module.exports=Level;var AbstractLevelDOWN=__webpack_require__(216).AbstractLevelDOWN,util=__webpack_require__(32),Iterator=__webpack_require__(467),xtend=__webpack_require__(38);util.inherits(Level,AbstractLevelDOWN),Level.prototype._open=function(options,callback){function onerror(ev){callback(ev.target.error)}function onsuccess(db){self._db=db;var exists=self._db.objectStoreNames.contains(self._idbOpts.storeName);if(options.errorIfExists&&exists)return self._db.close(),void callback(new Error("store already exists"));if(!options.createIfMissing&&!exists)return self._db.close(),void callback(new Error("store does not exist"));if(options.createIfMissing&&!exists){self._db.close();var req2=indexedDB.open(self.location,self._db.version+1);return req2.onerror=function(ev){callback(ev.target.error)},req2.onupgradeneeded=function(){req2.result.createObjectStore(self._idbOpts.storeName,self._idbOpts)},void(req2.onsuccess=function(){self._db=req2.result,callback(null,self)})}callback(null,self)}var self=this;if(this._idbOpts=xtend({storeName:this.location,keyEncoding:"none",valueEncoding:"none"},options),this._idbOpts.idb)onsuccess(this._idbOpts.idb);else{var req=indexedDB.open(this.location);req.onerror=onerror,req.onsuccess=function(){onsuccess(req.result)}}},Level.prototype._get=function(key,options,callback){options=xtend(this._idbOpts,options);var origKey=key;"binary"!==options.keyEncoding||Array.isArray(key)||(key=Array.prototype.slice.call(key));var tx=this._db.transaction(this._idbOpts.storeName),req=tx.objectStore(this._idbOpts.storeName).openCursor(IDBKeyRange.only(key));tx.onabort=function(){callback(tx.error)},req.onsuccess=function(){var cursor=req.result;if(cursor){var value=cursor.value;if(value instanceof Uint8Array&&(value=new Buffer(value)),"binary"!==options.valueEncoding||Buffer.isBuffer(value)||(value=new Buffer(value)),options.asBuffer&&!Buffer.isBuffer(value))if(null==value)value=new Buffer(0);else if("string"==typeof value)value=new Buffer(value);else if("boolean"==typeof value)value=new Buffer(String(value));else if("number"==typeof value)value=new Buffer(String(value));else if(Array.isArray(value))value=new Buffer(String(value));else{if(!(value instanceof Uint8Array))return void callback(new TypeError("can't coerce `"+value.constructor.name+"` into a Buffer"));value=new Buffer(value)}return void callback(null,value,origKey)}return void callback(new Error("NotFound"))}},Level.prototype._del=function(key,options,callback){options=xtend(this._idbOpts,options),"binary"!==options.keyEncoding||Array.isArray(key)||(key=Array.prototype.slice.call(key));var mode="readwrite";options.sync===!0&&(mode="readwriteflush");var tx=this._db.transaction(this._idbOpts.storeName,mode);tx.objectStore(this._idbOpts.storeName).delete(key);tx.onabort=function(){callback(tx.error)},tx.oncomplete=function(){callback()}},Level.prototype._put=function(key,value,options,callback){options=xtend(this._idbOpts,options),"binary"!==options.keyEncoding||Array.isArray(key)||(key=Array.prototype.slice.call(key));var mode="readwrite";options.sync===!0&&(mode="readwriteflush");var tx=this._db.transaction(this._idbOpts.storeName,mode);tx.objectStore(this._idbOpts.storeName).put(value,key);tx.onabort=function(){callback(tx.error)},tx.oncomplete=function(){callback()}},Level.prototype._iterator=function(options){return new Iterator(this,options)},Level.prototype._batch=function(array,options,callback){if(0===array.length)return process.nextTick(callback);var mode="readwrite";options.sync===!0&&(mode="readwriteflush");var tx=this._db.transaction(this._idbOpts.storeName,mode),store=tx.objectStore(this._idbOpts.storeName);tx.onabort=function(){callback(tx.error)},tx.oncomplete=function(){callback()},array.forEach(function(currentOp){"binary"!==xtend(options,currentOp).keyEncoding||Array.isArray(currentOp.key)||(currentOp.key=Array.prototype.slice.call(currentOp.key)),"del"===currentOp.type?store.delete(currentOp.key):store.put(currentOp.value,currentOp.key)})},Level.prototype._close=function(callback){this._db.close(),process.nextTick(callback)},Level.prototype._approximateSize=function(start,end,callback){var err=new Error("Not implemented");if(callback)return void process.nextTick(function(){callback(err)});throw err},Level.destroy=function(db,callback){var idbOpts;if(null!=db&&"object"==typeof db)idbOpts=xtend({location:db.location,storeName:db.location},db._idbOpts);else{if("string"!=typeof db)throw new TypeError("location must be a string or an object");idbOpts={location:db,storeName:db}}if("string"!=typeof idbOpts.location)throw new TypeError("location must be a string");if("string"!=typeof idbOpts.storeName)throw new TypeError("db.storeName must be a string");var req=indexedDB.open(idbOpts.location);req.onerror=function(ev){callback(ev.target.error)},req.onsuccess=function(){function deleteDatabase(name){var req2=indexedDB.deleteDatabase(name);req2.onerror=function(ev){callback(ev.target.error)},req2.onsuccess=function(){callback()}}var db=req.result;if(db.close(),0===db.objectStoreNames.length)return void deleteDatabase(idbOpts.location);if(!db.objectStoreNames.contains(idbOpts.storeName))return void callback();var req2=indexedDB.open(idbOpts.location,db.version+1);req2.onerror=function(ev){callback(ev.target.error)},req2.onupgradeneeded=function(){db=req2.result,db.deleteObjectStore(idbOpts.storeName)},req2.onsuccess=function(){db=req2.result,db.close(),0===db.objectStoreNames.length?deleteDatabase(idbOpts.location):callback()}}}}).call(exports,__webpack_require__(0).Buffer,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";module.exports=`enum KeyType { +var Ipfs=function(modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}var installedModules={};return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.i=function(value){return value},__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module.default}:function(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=745)}([function(module,exports,__webpack_require__){"use strict";(function(global){function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(that,length){if(kMaxLength()=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|length}function SlowBuffer(length){return+length!=length&&(length=0),Buffer.alloc(+length)}function byteLength(string,encoding){if(Buffer.isBuffer(string))return string.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(string)||string instanceof ArrayBuffer))return string.byteLength;"string"!=typeof string&&(string=""+string);var len=string.length;if(0===len)return 0;for(var loweredCase=!1;;)switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":case void 0:return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*len;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase)return utf8ToBytes(string).length;encoding=(""+encoding).toLowerCase(),loweredCase=!0}}function slowToString(encoding,start,end){var loweredCase=!1;if((void 0===start||start<0)&&(start=0),start>this.length)return"";if((void 0===end||end>this.length)&&(end=this.length),end<=0)return"";if(end>>>=0,start>>>=0,end<=start)return"";for(encoding||(encoding="utf8");;)switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase(),loweredCase=!0}}function swap(b,n,m){var i=b[n];b[n]=b[m],b[m]=i}function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){if(0===buffer.length)return-1;if("string"==typeof byteOffset?(encoding=byteOffset,byteOffset=0):byteOffset>2147483647?byteOffset=2147483647:byteOffset<-2147483648&&(byteOffset=-2147483648),byteOffset=+byteOffset,isNaN(byteOffset)&&(byteOffset=dir?0:buffer.length-1),byteOffset<0&&(byteOffset=buffer.length+byteOffset),byteOffset>=buffer.length){if(dir)return-1;byteOffset=buffer.length-1}else if(byteOffset<0){if(!dir)return-1;byteOffset=0}if("string"==typeof val&&(val=Buffer.from(val,encoding)),Buffer.isBuffer(val))return 0===val.length?-1:arrayIndexOf(buffer,val,byteOffset,encoding,dir);if("number"==typeof val)return val&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?dir?Uint8Array.prototype.indexOf.call(buffer,val,byteOffset):Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset):arrayIndexOf(buffer,[val],byteOffset,encoding,dir);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){function read(buf,i){return 1===indexSize?buf[i]:buf.readUInt16BE(i*indexSize)}var indexSize=1,arrLength=arr.length,valLength=val.length;if(void 0!==encoding&&("ucs2"===(encoding=String(encoding).toLowerCase())||"ucs-2"===encoding||"utf16le"===encoding||"utf-16le"===encoding)){if(arr.length<2||val.length<2)return-1;indexSize=2,arrLength/=2,valLength/=2,byteOffset/=2}var i;if(dir){var foundIndex=-1;for(i=byteOffset;iarrLength&&(byteOffset=arrLength-valLength),i=byteOffset;i>=0;i--){for(var found=!0,j=0;jremaining&&(length=remaining):length=remaining;var strLen=string.length;if(strLen%2!=0)throw new TypeError("Invalid hex string");length>strLen/2&&(length=strLen/2);for(var i=0;i239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end){var secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:firstByte<128&&(codePoint=firstByte);break;case 2:secondByte=buf[i+1],128==(192&secondByte)&&(tempCodePoint=(31&firstByte)<<6|63&secondByte)>127&&(codePoint=tempCodePoint);break;case 3:secondByte=buf[i+1],thirdByte=buf[i+2],128==(192&secondByte)&&128==(192&thirdByte)&&(tempCodePoint=(15&firstByte)<<12|(63&secondByte)<<6|63&thirdByte)>2047&&(tempCodePoint<55296||tempCodePoint>57343)&&(codePoint=tempCodePoint);break;case 4:secondByte=buf[i+1],thirdByte=buf[i+2],fourthByte=buf[i+3],128==(192&secondByte)&&128==(192&thirdByte)&&128==(192&fourthByte)&&(tempCodePoint=(15&firstByte)<<18|(63&secondByte)<<12|(63&thirdByte)<<6|63&fourthByte)>65535&&tempCodePoint<1114112&&(codePoint=tempCodePoint)}}null===codePoint?(codePoint=65533,bytesPerSequence=1):codePoint>65535&&(codePoint-=65536,res.push(codePoint>>>10&1023|55296),codePoint=56320|1023&codePoint),res.push(codePoint),i+=bytesPerSequence}return decodeCodePointsArray(res)}function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,codePoints);for(var res="",i=0;ilen)&&(end=len);for(var out="",i=start;ilength)throw new RangeError("Trying to access beyond buffer length")}function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||valuebuf.length)throw new RangeError("Index out of range")}function objectWriteUInt16(buf,value,offset,littleEndian){value<0&&(value=65535+value+1);for(var i=0,j=Math.min(buf.length-offset,2);i>>8*(littleEndian?i:1-i)}function objectWriteUInt32(buf,value,offset,littleEndian){value<0&&(value=4294967295+value+1);for(var i=0,j=Math.min(buf.length-offset,4);i>>8*(littleEndian?i:3-i)&255}function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,value,offset,4,3.4028234663852886e38,-3.4028234663852886e38),ieee754.write(buf,value,offset,littleEndian,23,4),offset+4}function writeDouble(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,value,offset,8,1.7976931348623157e308,-1.7976931348623157e308),ieee754.write(buf,value,offset,littleEndian,52,8),offset+8}function base64clean(str){if(str=stringtrim(str).replace(INVALID_BASE64_RE,""),str.length<2)return"";for(;str.length%4!=0;)str+="=";return str}function stringtrim(str){return str.trim?str.trim():str.replace(/^\s+|\s+$/g,"")}function toHex(n){return n<16?"0"+n.toString(16):n.toString(16)}function utf8ToBytes(string,units){units=units||1/0;for(var codePoint,length=string.length,leadSurrogate=null,bytes=[],i=0;i55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){(units-=3)>-1&&bytes.push(239,191,189);continue}if(i+1===length){(units-=3)>-1&&bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){(units-=3)>-1&&bytes.push(239,191,189),leadSurrogate=codePoint;continue}codePoint=65536+(leadSurrogate-55296<<10|codePoint-56320)}else leadSurrogate&&(units-=3)>-1&&bytes.push(239,191,189);if(leadSurrogate=null,codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,63&codePoint|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,63&codePoint|128)}else{if(!(codePoint<1114112))throw new Error("Invalid code point");if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,63&codePoint|128)}}return bytes}function asciiToBytes(str){for(var byteArray=[],i=0;i>8,lo=c%256,byteArray.push(lo),byteArray.push(hi);return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i=dst.length||i>=src.length);++i)dst[i+offset]=src[i];return i}function isnan(val){return val!==val}var base64=__webpack_require__(312),ieee754=__webpack_require__(197),isArray=__webpack_require__(212);exports.Buffer=Buffer,exports.SlowBuffer=SlowBuffer,exports.INSPECT_MAX_BYTES=50,Buffer.TYPED_ARRAY_SUPPORT=void 0!==global.TYPED_ARRAY_SUPPORT?global.TYPED_ARRAY_SUPPORT:function(){try{var arr=new Uint8Array(1);return arr.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===arr.foo()&&"function"==typeof arr.subarray&&0===arr.subarray(1,1).byteLength}catch(e){return!1}}(),exports.kMaxLength=kMaxLength(),Buffer.poolSize=8192,Buffer._augment=function(arr){return arr.__proto__=Buffer.prototype,arr},Buffer.from=function(value,encodingOrOffset,length){return from(null,value,encodingOrOffset,length)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0})),Buffer.alloc=function(size,fill,encoding){return alloc(null,size,fill,encoding)},Buffer.allocUnsafe=function(size){return allocUnsafe(null,size)},Buffer.allocUnsafeSlow=function(size){return allocUnsafe(null,size)},Buffer.isBuffer=function(b){return!(null==b||!b._isBuffer)},Buffer.compare=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var x=a.length,y=b.length,i=0,len=Math.min(x,y);i0&&(str=this.toString("hex",0,max).match(/.{2}/g).join(" "),this.length>max&&(str+=" ... ")),""},Buffer.prototype.compare=function(target,start,end,thisStart,thisEnd){if(!Buffer.isBuffer(target))throw new TypeError("Argument must be a Buffer");if(void 0===start&&(start=0),void 0===end&&(end=target?target.length:0),void 0===thisStart&&(thisStart=0),void 0===thisEnd&&(thisEnd=this.length),start<0||end>target.length||thisStart<0||thisEnd>this.length)throw new RangeError("out of range index");if(thisStart>=thisEnd&&start>=end)return 0;if(thisStart>=thisEnd)return-1;if(start>=end)return 1;if(start>>>=0,end>>>=0,thisStart>>>=0,thisEnd>>>=0,this===target)return 0;for(var x=thisEnd-thisStart,y=end-start,len=Math.min(x,y),thisCopy=this.slice(thisStart,thisEnd),targetCopy=target.slice(start,end),i=0;iremaining)&&(length=remaining),string.length>0&&(length<0||offset<0)||offset>this.length)throw new RangeError("Attempt to write outside buffer bounds");encoding||(encoding="utf8");for(var loweredCase=!1;;)switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase(),loweredCase=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;Buffer.prototype.slice=function(start,end){var len=this.length;start=~~start,end=void 0===end?len:~~end,start<0?(start+=len)<0&&(start=0):start>len&&(start=len),end<0?(end+=len)<0&&(end=0):end>len&&(end=len),end0&&(mul*=256);)val+=this[offset+--byteLength]*mul;return val},Buffer.prototype.readUInt8=function(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),this[offset]},Buffer.prototype.readUInt16LE=function(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]|this[offset+1]<<8},Buffer.prototype.readUInt16BE=function(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]<<8|this[offset+1]},Buffer.prototype.readUInt32LE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+16777216*this[offset+3]},Buffer.prototype.readUInt32BE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),16777216*this[offset]+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])},Buffer.prototype.readIntLE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset],mul=1,i=0;++i=mul&&(val-=Math.pow(2,8*byteLength)),val},Buffer.prototype.readIntBE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var i=byteLength,mul=1,val=this[offset+--i];i>0&&(mul*=256);)val+=this[offset+--i]*mul;return mul*=128,val>=mul&&(val-=Math.pow(2,8*byteLength)),val},Buffer.prototype.readInt8=function(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),128&this[offset]?(255-this[offset]+1)*-1:this[offset]},Buffer.prototype.readInt16LE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt16BE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt32LE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24},Buffer.prototype.readInt32BE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]},Buffer.prototype.readFloatLE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!0,23,4)},Buffer.prototype.readFloatBE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!1,23,4)},Buffer.prototype.readDoubleLE=function(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!0,52,8)},Buffer.prototype.readDoubleBE=function(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!1,52,8)},Buffer.prototype.writeUIntLE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,byteLength|=0,!noAssert){checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength)-1,0)}var mul=1,i=0;for(this[offset]=255&value;++i=0&&(mul*=256);)this[offset+i]=value/mul&255;return offset+byteLength},Buffer.prototype.writeUInt8=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),this[offset]=255&value,offset+1},Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset+3]=value>>>24,this[offset+2]=value>>>16,this[offset+1]=value>>>8,this[offset]=255&value):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeIntLE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0,mul=1,sub=0;for(this[offset]=255&value;++i>0)-sub&255;return offset+byteLength},Buffer.prototype.writeIntBE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1,mul=1,sub=0;for(this[offset+i]=255&value;--i>=0&&(mul*=256);)value<0&&0===sub&&0!==this[offset+i+1]&&(sub=1),this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength},Buffer.prototype.writeInt8=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),value<0&&(value=255+value+1),this[offset]=255&value,offset+1},Buffer.prototype.writeInt16LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeInt16BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeInt32LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8,this[offset+2]=value>>>16,this[offset+3]=value>>>24):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeInt32BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),value<0&&(value=4294967295+value+1),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeFloatLE=function(value,offset,noAssert){return writeFloat(this,value,offset,!0,noAssert)},Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,!1,noAssert)},Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,!0,noAssert)},Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,!1,noAssert)},Buffer.prototype.copy=function(target,targetStart,start,end){if(start||(start=0),end||0===end||(end=this.length),targetStart>=target.length&&(targetStart=target.length),targetStart||(targetStart=0),end>0&&end=this.length)throw new RangeError("sourceStart out of bounds");if(end<0)throw new RangeError("sourceEnd out of bounds");end>this.length&&(end=this.length),target.length-targetStart=0;--i)target[i+targetStart]=this[i+start];else if(len<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,end=void 0===end?this.length:end>>>0,val||(val=0);var i;if("number"==typeof val)for(i=start;i1)for(var i=1;i=0;i--)if(ka[i]!==kb[i])return!1;for(i=ka.length-1;i>=0;i--)if(key=ka[i],!_deepEqual(a[key],b[key],strict,actualVisitedObjects))return!1;return!0}function notDeepStrictEqual(actual,expected,message){_deepEqual(actual,expected,!0)&&fail(actual,expected,message,"notDeepStrictEqual",notDeepStrictEqual)}function expectedException(actual,expected){if(!actual||!expected)return!1;if("[object RegExp]"==Object.prototype.toString.call(expected))return expected.test(actual);try{if(actual instanceof expected)return!0}catch(e){}return!Error.isPrototypeOf(expected)&&expected.call({},actual)===!0}function _tryBlock(block){var error;try{block()}catch(e){error=e}return error}function _throws(shouldThrow,block,expected,message){var actual;if("function"!=typeof block)throw new TypeError('"block" argument must be a function');"string"==typeof expected&&(message=expected,expected=null),actual=_tryBlock(block),message=(expected&&expected.name?" ("+expected.name+").":".")+(message?" "+message:"."),shouldThrow&&!actual&&fail(actual,expected,"Missing expected exception"+message);var userProvidedMessage="string"==typeof message,isUnwantedException=!shouldThrow&&util.isError(actual),isUnexpectedException=!shouldThrow&&actual&&!expected;if((isUnwantedException&&userProvidedMessage&&expectedException(actual,expected)||isUnexpectedException)&&fail(actual,expected,"Got unwanted exception"+message),shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual)throw actual}var util=__webpack_require__(34),hasOwn=Object.prototype.hasOwnProperty,pSlice=Array.prototype.slice,functionsHaveNames=function(){return"foo"===function(){}.name}(),assert=module.exports=ok,regex=/\s*function\s+([^\(\s]*)\s*/;assert.AssertionError=function(options){this.name="AssertionError",this.actual=options.actual,this.expected=options.expected,this.operator=options.operator,options.message?(this.message=options.message,this.generatedMessage=!1):(this.message=getMessage(this),this.generatedMessage=!0);var stackStartFunction=options.stackStartFunction||fail;if(Error.captureStackTrace)Error.captureStackTrace(this,stackStartFunction);else{var err=new Error;if(err.stack){var out=err.stack,fn_name=getName(stackStartFunction),idx=out.indexOf("\n"+fn_name);if(idx>=0){var next_line=out.indexOf("\n",idx+1);out=out.substring(next_line+1)}this.stack=out}}},util.inherits(assert.AssertionError,Error),assert.fail=fail,assert.ok=ok,assert.equal=function(actual,expected,message){actual!=expected&&fail(actual,expected,message,"==",assert.equal)},assert.notEqual=function(actual,expected,message){actual==expected&&fail(actual,expected,message,"!=",assert.notEqual)},assert.deepEqual=function(actual,expected,message){_deepEqual(actual,expected,!1)||fail(actual,expected,message,"deepEqual",assert.deepEqual)},assert.deepStrictEqual=function(actual,expected,message){_deepEqual(actual,expected,!0)||fail(actual,expected,message,"deepStrictEqual",assert.deepStrictEqual)},assert.notDeepEqual=function(actual,expected,message){_deepEqual(actual,expected,!1)&&fail(actual,expected,message,"notDeepEqual",assert.notDeepEqual)},assert.notDeepStrictEqual=notDeepStrictEqual,assert.strictEqual=function(actual,expected,message){actual!==expected&&fail(actual,expected,message,"===",assert.strictEqual)},assert.notStrictEqual=function(actual,expected,message){actual===expected&&fail(actual,expected,message,"!==",assert.notStrictEqual)},assert.throws=function(block,error,message){_throws(!0,block,error,message)},assert.doesNotThrow=function(block,error,message){_throws(!1,block,error,message)},assert.ifError=function(err){if(err)throw err};var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)hasOwn.call(obj,key)&&keys.push(key);return keys}}).call(exports,__webpack_require__(3))},function(module,exports){function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(arg){return"function"==typeof arg}function isNumber(arg){return"number"==typeof arg}function isObject(arg){return"object"==typeof arg&&null!==arg}function isUndefined(arg){return void 0===arg}module.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||n<0||isNaN(n))throw TypeError("n must be a positive number");return this._maxListeners=n,this},EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(this._events||(this._events={}),"error"===type&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length)){if((er=arguments[1])instanceof Error)throw er;var err=new Error('Uncaught, unspecified "error" event. ('+er+")");throw err.context=er,err}if(handler=this._events[type],isUndefined(handler))return!1;if(isFunction(handler))switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:args=Array.prototype.slice.call(arguments,1),handler.apply(this,args)}else if(isObject(handler))for(args=Array.prototype.slice.call(arguments,1),listeners=handler.slice(),len=listeners.length,i=0;i0&&this._events[type].length>m&&(this._events[type].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[type].length),"function"==typeof console.trace&&console.trace()),this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(type,listener){function g(){this.removeListener(type,g),fired||(fired=!0,listener.apply(this,arguments))}if(!isFunction(listener))throw TypeError("listener must be a function");var fired=!1;return g.listener=listener,this.on(type,g),this},EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;if(list=this._events[type],length=list.length,position=-1,list===listener||isFunction(list.listener)&&list.listener===listener)delete this._events[type],this._events.removeListener&&this.emit("removeListener",type,listener);else if(isObject(list)){for(i=length;i-- >0;)if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}if(position<0)return this;1===list.length?(list.length=0,delete this._events[type]):list.splice(position,1),this._events.removeListener&&this.emit("removeListener",type,listener)}return this},EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[type]&&delete this._events[type],this;if(0===arguments.length){for(key in this._events)"removeListener"!==key&&this.removeAllListeners(key);return this.removeAllListeners("removeListener"),this._events={},this}if(listeners=this._events[type],isFunction(listeners))this.removeListener(type,listeners);else if(listeners)for(;listeners.length;)this.removeListener(type,listeners[listeners.length-1]);return delete this._events[type],this},EventEmitter.prototype.listeners=function(type){return this._events&&this._events[type]?isFunction(this._events[type])?[this._events[type]]:this._events[type].slice():[]},EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;if(evlistener)return evlistener.length}return 0},EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function validate(multihash){exports.decode(multihash)}const bs58=__webpack_require__(81),cs=__webpack_require__(582),varint=__webpack_require__(14);exports.toHexString=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return hash.toString("hex")},exports.fromHexString=function(hash){return new Buffer(hash,"hex")},exports.toB58String=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return bs58.encode(hash)},exports.fromB58String=function(hash){let encoded=hash;return Buffer.isBuffer(hash)&&(encoded=hash.toString()),new Buffer(bs58.decode(encoded))},exports.decode=function(buf){if(!Buffer.isBuffer(buf))throw new Error("multihash must be a Buffer");if(buf.length<3)throw new Error("multihash too short. must be > 3 bytes.");let code=varint.decode(buf);if(!exports.isValidCode(code))throw new Error(`multihash unknown function code: 0x${code.toString(16)}`);buf=buf.slice(varint.decode.bytes);let len=varint.decode(buf);if(len<1)throw new Error(`multihash invalid length: 0x${len.toString(16)}`);if(buf=buf.slice(varint.decode.bytes),buf.length!==len)throw new Error(`multihash length inconsistent: 0x${buf.toString("hex")}`);return{code:code,name:cs.codes[code],length:len,digest:buf}},exports.encode=function(digest,code,length){if(!digest||!code)throw new Error("multihash encode requires at least two args: digest, code");const hashfn=exports.coerceCode(code);if(!Buffer.isBuffer(digest))throw new Error("digest should be a Buffer");if(null==length&&(length=digest.length),length&&digest.length!==length)throw new Error("digest length should be equal to specified length.");return Buffer.concat([new Buffer(varint.encode(hashfn)),new Buffer(varint.encode(length)),digest])},exports.coerceCode=function(name){let code=name;if("string"==typeof name){if(!cs.names[name])throw new Error(`Unrecognized hash function named: ${name}`);code=cs.names[name]}if("number"!=typeof code)throw new Error(`Hash function code should be a number. Got: ${code}`);if(!cs.codes[code]&&!exports.isAppCode(code))throw new Error(`Unrecognized function code: ${code}`);return code},exports.isAppCode=function(code){return code>0&&code<16},exports.isValidCode=function(code){return!!exports.isAppCode(code)||!!cs.codes[code]},exports.validate=validate,exports.prefix=function(multihash){return validate(multihash),multihash.slice(0,2)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function isAsync(fn){return supportsSymbol&&"AsyncFunction"===fn[Symbol.toStringTag]}function wrapAsync(asyncFn){return isAsync(asyncFn)?(0,_asyncify2.default)(asyncFn):asyncFn}Object.defineProperty(exports,"__esModule",{value:!0}),exports.isAsync=void 0;var _asyncify=__webpack_require__(73),_asyncify2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_asyncify),supportsSymbol="function"==typeof Symbol;exports.default=wrapAsync,exports.isAsync=isAsync},function(module,exports,__webpack_require__){(function(module){!function(module,exports){"use strict";function assert(val,msg){if(!val)throw new Error(msg||"Assertion failed")}function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype,ctor.prototype=new TempCtor,ctor.prototype.constructor=ctor}function BN(number,base,endian){if(BN.isBN(number))return number;this.negative=0,this.words=null,this.length=0,this.red=null,null!==number&&("le"!==base&&"be"!==base||(endian=base,base=10),this._init(number||0,base||10,endian||"be"))}function parseHex(str,start,end){for(var r=0,len=Math.min(str.length,end),i=start;i=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:15&c}return r}function parseBase(str,start,end,mul){for(var r=0,len=Math.min(str.length,end),i=start;i=49?c-49+10:c>=17?c-17+10:c}return r}function toBitArray(num){for(var w=new Array(num.bitLength()),bit=0;bit>>wbit}return w}function smallMulTo(self,num,out){out.negative=num.negative^self.negative;var len=self.length+num.length|0;out.length=len,len=len-1|0;var a=0|self.words[0],b=0|num.words[0],r=a*b,lo=67108863&r,carry=r/67108864|0;out.words[0]=lo;for(var k=1;k>>26,rword=67108863&carry,maxJ=Math.min(k,num.length-1),j=Math.max(0,k-self.length+1);j<=maxJ;j++){var i=k-j|0;a=0|self.words[i],b=0|num.words[j],r=a*b+rword,ncarry+=r/67108864|0,rword=67108863&r}out.words[k]=0|rword,carry=0|ncarry}return 0!==carry?out.words[k]=0|carry:out.length--,out.strip()}function bigMulTo(self,num,out){out.negative=num.negative^self.negative,out.length=self.length+num.length;for(var carry=0,hncarry=0,k=0;k>>26)|0,hncarry+=ncarry>>>26,ncarry&=67108863}out.words[k]=rword,carry=ncarry,ncarry=hncarry}return 0!==carry?out.words[k]=carry:out.length--,out.strip()}function jumboMulTo(self,num,out){return(new FFTM).mulp(self,num,out)}function FFTM(x,y){this.x=x,this.y=y}function MPrime(name,p){this.name=name,this.p=new BN(p,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(m){if("string"==typeof m){var prime=BN._prime(m);this.m=prime.p,this.prime=prime}else assert(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}function Mont(m){Red.call(this,m),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof module?module.exports=BN:exports.BN=BN,BN.BN=BN,BN.wordSize=26;var Buffer;try{Buffer=__webpack_require__(734).Buffer}catch(e){}BN.isBN=function(num){return num instanceof BN||null!==num&&"object"==typeof num&&num.constructor.wordSize===BN.wordSize&&Array.isArray(num.words)},BN.max=function(left,right){return left.cmp(right)>0?left:right},BN.min=function(left,right){return left.cmp(right)<0?left:right},BN.prototype._init=function(number,base,endian){if("number"==typeof number)return this._initNumber(number,base,endian);if("object"==typeof number)return this._initArray(number,base,endian);"hex"===base&&(base=16),assert(base===(0|base)&&base>=2&&base<=36),number=number.toString().replace(/\s+/g,"");var start=0;"-"===number[0]&&start++,16===base?this._parseHex(number,start):this._parseBase(number,base,start),"-"===number[0]&&(this.negative=1),this.strip(),"le"===endian&&this._initArray(this.toArray(),base,endian)},BN.prototype._initNumber=function(number,base,endian){number<0&&(this.negative=1,number=-number),number<67108864?(this.words=[67108863&number],this.length=1):number<4503599627370496?(this.words=[67108863&number,number/67108864&67108863],this.length=2):(assert(number<9007199254740992),this.words=[67108863&number,number/67108864&67108863,1],this.length=3),"le"===endian&&this._initArray(this.toArray(),base,endian)},BN.prototype._initArray=function(number,base,endian){if(assert("number"==typeof number.length),number.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(number.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)w=number[i]|number[i-1]<<8|number[i-2]<<16,this.words[j]|=w<>>26-off&67108863,(off+=24)>=26&&(off-=26,j++);else if("le"===endian)for(i=0,j=0;i>>26-off&67108863,(off+=24)>=26&&(off-=26,j++);return this.strip()},BN.prototype._parseHex=function(number,start){this.length=Math.ceil((number.length-start)/6),this.words=new Array(this.length);for(var i=0;i=start;i-=6)w=parseHex(number,i,i+6),this.words[j]|=w<>>26-off&4194303,(off+=24)>=26&&(off-=26,j++);i+6!==start&&(w=parseHex(number,start,i+6),this.words[j]|=w<>>26-off&4194303),this.strip()},BN.prototype._parseBase=function(number,base,start){this.words=[0],this.length=1;for(var limbLen=0,limbPow=1;limbPow<=67108863;limbPow*=base)limbLen++;limbLen--,limbPow=limbPow/base|0;for(var total=number.length-start,mod=total%limbLen,end=Math.min(total,total-mod)+start,word=0,i=start;i1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.inspect=function(){return(this.red?""};var zeros=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],groupSizes=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],groupBases=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];BN.prototype.toString=function(base,padding){base=base||10,padding=0|padding||1;var out;if(16===base||"hex"===base){out="";for(var off=0,carry=0,i=0;i>>24-off&16777215,out=0!==carry||i!==this.length-1?zeros[6-word.length]+word+out:word+out,off+=2,off>=26&&(off-=26,i--)}for(0!==carry&&(out=carry.toString(16)+out);out.length%padding!=0;)out="0"+out;return 0!==this.negative&&(out="-"+out),out}if(base===(0|base)&&base>=2&&base<=36){var groupSize=groupSizes[base],groupBase=groupBases[base];out="";var c=this.clone();for(c.negative=0;!c.isZero();){var r=c.modn(groupBase).toString(base);c=c.idivn(groupBase),out=c.isZero()?r+out:zeros[groupSize-r.length]+r+out} +for(this.isZero()&&(out="0"+out);out.length%padding!=0;)out="0"+out;return 0!==this.negative&&(out="-"+out),out}assert(!1,"Base should be between 2 and 36")},BN.prototype.toNumber=function(){var ret=this.words[0];return 2===this.length?ret+=67108864*this.words[1]:3===this.length&&1===this.words[2]?ret+=4503599627370496+67108864*this.words[1]:this.length>2&&assert(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-ret:ret},BN.prototype.toJSON=function(){return this.toString(16)},BN.prototype.toBuffer=function(endian,length){return assert(void 0!==Buffer),this.toArrayLike(Buffer,endian,length)},BN.prototype.toArray=function(endian,length){return this.toArrayLike(Array,endian,length)},BN.prototype.toArrayLike=function(ArrayType,endian,length){var byteLength=this.byteLength(),reqLength=length||Math.max(1,byteLength);assert(byteLength<=reqLength,"byte array longer than desired length"),assert(reqLength>0,"Requested array length <= 0"),this.strip();var b,i,littleEndian="le"===endian,res=new ArrayType(reqLength),q=this.clone();if(littleEndian){for(i=0;!q.isZero();i++)b=q.andln(255),q.iushrn(8),res[i]=b;for(;i=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},BN.prototype._zeroBits=function(w){if(0===w)return 26;var t=w,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},BN.prototype.bitLength=function(){var w=this.words[this.length-1],hi=this._countBits(w);return 26*(this.length-1)+hi},BN.prototype.zeroBits=function(){if(this.isZero())return 0;for(var r=0,i=0;inum.length?this.clone().ior(num):num.clone().ior(this)},BN.prototype.uor=function(num){return this.length>num.length?this.clone().iuor(num):num.clone().iuor(this)},BN.prototype.iuand=function(num){var b;b=this.length>num.length?num:this;for(var i=0;inum.length?this.clone().iand(num):num.clone().iand(this)},BN.prototype.uand=function(num){return this.length>num.length?this.clone().iuand(num):num.clone().iuand(this)},BN.prototype.iuxor=function(num){var a,b;this.length>num.length?(a=this,b=num):(a=num,b=this);for(var i=0;inum.length?this.clone().ixor(num):num.clone().ixor(this)},BN.prototype.uxor=function(num){return this.length>num.length?this.clone().iuxor(num):num.clone().iuxor(this)},BN.prototype.inotn=function(width){assert("number"==typeof width&&width>=0);var bytesNeeded=0|Math.ceil(width/26),bitsLeft=width%26;this._expand(bytesNeeded),bitsLeft>0&&bytesNeeded--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-bitsLeft),this.strip()},BN.prototype.notn=function(width){return this.clone().inotn(width)},BN.prototype.setn=function(bit,val){assert("number"==typeof bit&&bit>=0);var off=bit/26|0,wbit=bit%26;return this._expand(off+1),this.words[off]=val?this.words[off]|1<num.length?(a=this,b=num):(a=num,b=this);for(var carry=0,i=0;i>>26;for(;0!==carry&&i>>26;if(this.length=a.length,0!==carry)this.words[this.length]=carry,this.length++;else if(a!==this)for(;inum.length?this.clone().iadd(num):num.clone().iadd(this)},BN.prototype.isub=function(num){if(0!==num.negative){num.negative=0;var r=this.iadd(num);return num.negative=1,r._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(num),this.negative=1,this._normSign();var cmp=this.cmp(num);if(0===cmp)return this.negative=0,this.length=1,this.words[0]=0,this;var a,b;cmp>0?(a=this,b=num):(a=num,b=this);for(var carry=0,i=0;i>26,this.words[i]=67108863&r;for(;0!==carry&&i>26,this.words[i]=67108863&r;if(0===carry&&i>>13,a1=0|a[1],al1=8191&a1,ah1=a1>>>13,a2=0|a[2],al2=8191&a2,ah2=a2>>>13,a3=0|a[3],al3=8191&a3,ah3=a3>>>13,a4=0|a[4],al4=8191&a4,ah4=a4>>>13,a5=0|a[5],al5=8191&a5,ah5=a5>>>13,a6=0|a[6],al6=8191&a6,ah6=a6>>>13,a7=0|a[7],al7=8191&a7,ah7=a7>>>13,a8=0|a[8],al8=8191&a8,ah8=a8>>>13,a9=0|a[9],al9=8191&a9,ah9=a9>>>13,b0=0|b[0],bl0=8191&b0,bh0=b0>>>13,b1=0|b[1],bl1=8191&b1,bh1=b1>>>13,b2=0|b[2],bl2=8191&b2,bh2=b2>>>13,b3=0|b[3],bl3=8191&b3,bh3=b3>>>13,b4=0|b[4],bl4=8191&b4,bh4=b4>>>13,b5=0|b[5],bl5=8191&b5,bh5=b5>>>13,b6=0|b[6],bl6=8191&b6,bh6=b6>>>13,b7=0|b[7],bl7=8191&b7,bh7=b7>>>13,b8=0|b[8],bl8=8191&b8,bh8=b8>>>13,b9=0|b[9],bl9=8191&b9,bh9=b9>>>13;out.negative=self.negative^num.negative,out.length=19,lo=Math.imul(al0,bl0),mid=Math.imul(al0,bh0),mid=mid+Math.imul(ah0,bl0)|0,hi=Math.imul(ah0,bh0);var w0=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w0>>>26)|0,w0&=67108863,lo=Math.imul(al1,bl0),mid=Math.imul(al1,bh0),mid=mid+Math.imul(ah1,bl0)|0,hi=Math.imul(ah1,bh0),lo=lo+Math.imul(al0,bl1)|0,mid=mid+Math.imul(al0,bh1)|0,mid=mid+Math.imul(ah0,bl1)|0,hi=hi+Math.imul(ah0,bh1)|0;var w1=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w1>>>26)|0,w1&=67108863,lo=Math.imul(al2,bl0),mid=Math.imul(al2,bh0),mid=mid+Math.imul(ah2,bl0)|0,hi=Math.imul(ah2,bh0),lo=lo+Math.imul(al1,bl1)|0,mid=mid+Math.imul(al1,bh1)|0,mid=mid+Math.imul(ah1,bl1)|0,hi=hi+Math.imul(ah1,bh1)|0,lo=lo+Math.imul(al0,bl2)|0,mid=mid+Math.imul(al0,bh2)|0,mid=mid+Math.imul(ah0,bl2)|0,hi=hi+Math.imul(ah0,bh2)|0;var w2=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w2>>>26)|0,w2&=67108863,lo=Math.imul(al3,bl0),mid=Math.imul(al3,bh0),mid=mid+Math.imul(ah3,bl0)|0,hi=Math.imul(ah3,bh0),lo=lo+Math.imul(al2,bl1)|0,mid=mid+Math.imul(al2,bh1)|0,mid=mid+Math.imul(ah2,bl1)|0,hi=hi+Math.imul(ah2,bh1)|0,lo=lo+Math.imul(al1,bl2)|0,mid=mid+Math.imul(al1,bh2)|0,mid=mid+Math.imul(ah1,bl2)|0,hi=hi+Math.imul(ah1,bh2)|0,lo=lo+Math.imul(al0,bl3)|0,mid=mid+Math.imul(al0,bh3)|0,mid=mid+Math.imul(ah0,bl3)|0,hi=hi+Math.imul(ah0,bh3)|0;var w3=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w3>>>26)|0,w3&=67108863,lo=Math.imul(al4,bl0),mid=Math.imul(al4,bh0),mid=mid+Math.imul(ah4,bl0)|0,hi=Math.imul(ah4,bh0),lo=lo+Math.imul(al3,bl1)|0,mid=mid+Math.imul(al3,bh1)|0,mid=mid+Math.imul(ah3,bl1)|0,hi=hi+Math.imul(ah3,bh1)|0,lo=lo+Math.imul(al2,bl2)|0,mid=mid+Math.imul(al2,bh2)|0,mid=mid+Math.imul(ah2,bl2)|0,hi=hi+Math.imul(ah2,bh2)|0,lo=lo+Math.imul(al1,bl3)|0,mid=mid+Math.imul(al1,bh3)|0,mid=mid+Math.imul(ah1,bl3)|0,hi=hi+Math.imul(ah1,bh3)|0,lo=lo+Math.imul(al0,bl4)|0,mid=mid+Math.imul(al0,bh4)|0,mid=mid+Math.imul(ah0,bl4)|0,hi=hi+Math.imul(ah0,bh4)|0;var w4=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w4>>>26)|0,w4&=67108863,lo=Math.imul(al5,bl0),mid=Math.imul(al5,bh0),mid=mid+Math.imul(ah5,bl0)|0,hi=Math.imul(ah5,bh0),lo=lo+Math.imul(al4,bl1)|0,mid=mid+Math.imul(al4,bh1)|0,mid=mid+Math.imul(ah4,bl1)|0,hi=hi+Math.imul(ah4,bh1)|0,lo=lo+Math.imul(al3,bl2)|0,mid=mid+Math.imul(al3,bh2)|0,mid=mid+Math.imul(ah3,bl2)|0,hi=hi+Math.imul(ah3,bh2)|0,lo=lo+Math.imul(al2,bl3)|0,mid=mid+Math.imul(al2,bh3)|0,mid=mid+Math.imul(ah2,bl3)|0,hi=hi+Math.imul(ah2,bh3)|0,lo=lo+Math.imul(al1,bl4)|0,mid=mid+Math.imul(al1,bh4)|0,mid=mid+Math.imul(ah1,bl4)|0,hi=hi+Math.imul(ah1,bh4)|0,lo=lo+Math.imul(al0,bl5)|0,mid=mid+Math.imul(al0,bh5)|0,mid=mid+Math.imul(ah0,bl5)|0,hi=hi+Math.imul(ah0,bh5)|0;var w5=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w5>>>26)|0,w5&=67108863,lo=Math.imul(al6,bl0),mid=Math.imul(al6,bh0),mid=mid+Math.imul(ah6,bl0)|0,hi=Math.imul(ah6,bh0),lo=lo+Math.imul(al5,bl1)|0,mid=mid+Math.imul(al5,bh1)|0,mid=mid+Math.imul(ah5,bl1)|0,hi=hi+Math.imul(ah5,bh1)|0,lo=lo+Math.imul(al4,bl2)|0,mid=mid+Math.imul(al4,bh2)|0,mid=mid+Math.imul(ah4,bl2)|0,hi=hi+Math.imul(ah4,bh2)|0,lo=lo+Math.imul(al3,bl3)|0,mid=mid+Math.imul(al3,bh3)|0,mid=mid+Math.imul(ah3,bl3)|0,hi=hi+Math.imul(ah3,bh3)|0,lo=lo+Math.imul(al2,bl4)|0,mid=mid+Math.imul(al2,bh4)|0,mid=mid+Math.imul(ah2,bl4)|0,hi=hi+Math.imul(ah2,bh4)|0,lo=lo+Math.imul(al1,bl5)|0,mid=mid+Math.imul(al1,bh5)|0,mid=mid+Math.imul(ah1,bl5)|0,hi=hi+Math.imul(ah1,bh5)|0,lo=lo+Math.imul(al0,bl6)|0,mid=mid+Math.imul(al0,bh6)|0,mid=mid+Math.imul(ah0,bl6)|0,hi=hi+Math.imul(ah0,bh6)|0;var w6=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w6>>>26)|0,w6&=67108863,lo=Math.imul(al7,bl0),mid=Math.imul(al7,bh0),mid=mid+Math.imul(ah7,bl0)|0,hi=Math.imul(ah7,bh0),lo=lo+Math.imul(al6,bl1)|0,mid=mid+Math.imul(al6,bh1)|0,mid=mid+Math.imul(ah6,bl1)|0,hi=hi+Math.imul(ah6,bh1)|0,lo=lo+Math.imul(al5,bl2)|0,mid=mid+Math.imul(al5,bh2)|0,mid=mid+Math.imul(ah5,bl2)|0,hi=hi+Math.imul(ah5,bh2)|0,lo=lo+Math.imul(al4,bl3)|0,mid=mid+Math.imul(al4,bh3)|0,mid=mid+Math.imul(ah4,bl3)|0,hi=hi+Math.imul(ah4,bh3)|0,lo=lo+Math.imul(al3,bl4)|0,mid=mid+Math.imul(al3,bh4)|0,mid=mid+Math.imul(ah3,bl4)|0,hi=hi+Math.imul(ah3,bh4)|0,lo=lo+Math.imul(al2,bl5)|0,mid=mid+Math.imul(al2,bh5)|0,mid=mid+Math.imul(ah2,bl5)|0,hi=hi+Math.imul(ah2,bh5)|0,lo=lo+Math.imul(al1,bl6)|0,mid=mid+Math.imul(al1,bh6)|0,mid=mid+Math.imul(ah1,bl6)|0,hi=hi+Math.imul(ah1,bh6)|0,lo=lo+Math.imul(al0,bl7)|0,mid=mid+Math.imul(al0,bh7)|0,mid=mid+Math.imul(ah0,bl7)|0,hi=hi+Math.imul(ah0,bh7)|0;var w7=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w7>>>26)|0,w7&=67108863,lo=Math.imul(al8,bl0),mid=Math.imul(al8,bh0),mid=mid+Math.imul(ah8,bl0)|0,hi=Math.imul(ah8,bh0),lo=lo+Math.imul(al7,bl1)|0,mid=mid+Math.imul(al7,bh1)|0,mid=mid+Math.imul(ah7,bl1)|0,hi=hi+Math.imul(ah7,bh1)|0,lo=lo+Math.imul(al6,bl2)|0,mid=mid+Math.imul(al6,bh2)|0,mid=mid+Math.imul(ah6,bl2)|0,hi=hi+Math.imul(ah6,bh2)|0,lo=lo+Math.imul(al5,bl3)|0,mid=mid+Math.imul(al5,bh3)|0,mid=mid+Math.imul(ah5,bl3)|0,hi=hi+Math.imul(ah5,bh3)|0,lo=lo+Math.imul(al4,bl4)|0,mid=mid+Math.imul(al4,bh4)|0,mid=mid+Math.imul(ah4,bl4)|0,hi=hi+Math.imul(ah4,bh4)|0,lo=lo+Math.imul(al3,bl5)|0,mid=mid+Math.imul(al3,bh5)|0,mid=mid+Math.imul(ah3,bl5)|0,hi=hi+Math.imul(ah3,bh5)|0,lo=lo+Math.imul(al2,bl6)|0,mid=mid+Math.imul(al2,bh6)|0,mid=mid+Math.imul(ah2,bl6)|0,hi=hi+Math.imul(ah2,bh6)|0,lo=lo+Math.imul(al1,bl7)|0,mid=mid+Math.imul(al1,bh7)|0,mid=mid+Math.imul(ah1,bl7)|0,hi=hi+Math.imul(ah1,bh7)|0,lo=lo+Math.imul(al0,bl8)|0,mid=mid+Math.imul(al0,bh8)|0,mid=mid+Math.imul(ah0,bl8)|0,hi=hi+Math.imul(ah0,bh8)|0;var w8=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w8>>>26)|0,w8&=67108863,lo=Math.imul(al9,bl0),mid=Math.imul(al9,bh0),mid=mid+Math.imul(ah9,bl0)|0,hi=Math.imul(ah9,bh0),lo=lo+Math.imul(al8,bl1)|0,mid=mid+Math.imul(al8,bh1)|0,mid=mid+Math.imul(ah8,bl1)|0,hi=hi+Math.imul(ah8,bh1)|0,lo=lo+Math.imul(al7,bl2)|0,mid=mid+Math.imul(al7,bh2)|0,mid=mid+Math.imul(ah7,bl2)|0,hi=hi+Math.imul(ah7,bh2)|0,lo=lo+Math.imul(al6,bl3)|0,mid=mid+Math.imul(al6,bh3)|0,mid=mid+Math.imul(ah6,bl3)|0,hi=hi+Math.imul(ah6,bh3)|0,lo=lo+Math.imul(al5,bl4)|0,mid=mid+Math.imul(al5,bh4)|0,mid=mid+Math.imul(ah5,bl4)|0,hi=hi+Math.imul(ah5,bh4)|0,lo=lo+Math.imul(al4,bl5)|0,mid=mid+Math.imul(al4,bh5)|0,mid=mid+Math.imul(ah4,bl5)|0,hi=hi+Math.imul(ah4,bh5)|0,lo=lo+Math.imul(al3,bl6)|0,mid=mid+Math.imul(al3,bh6)|0,mid=mid+Math.imul(ah3,bl6)|0,hi=hi+Math.imul(ah3,bh6)|0,lo=lo+Math.imul(al2,bl7)|0,mid=mid+Math.imul(al2,bh7)|0,mid=mid+Math.imul(ah2,bl7)|0,hi=hi+Math.imul(ah2,bh7)|0,lo=lo+Math.imul(al1,bl8)|0,mid=mid+Math.imul(al1,bh8)|0,mid=mid+Math.imul(ah1,bl8)|0,hi=hi+Math.imul(ah1,bh8)|0,lo=lo+Math.imul(al0,bl9)|0,mid=mid+Math.imul(al0,bh9)|0,mid=mid+Math.imul(ah0,bl9)|0,hi=hi+Math.imul(ah0,bh9)|0;var w9=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w9>>>26)|0,w9&=67108863,lo=Math.imul(al9,bl1),mid=Math.imul(al9,bh1),mid=mid+Math.imul(ah9,bl1)|0,hi=Math.imul(ah9,bh1),lo=lo+Math.imul(al8,bl2)|0,mid=mid+Math.imul(al8,bh2)|0,mid=mid+Math.imul(ah8,bl2)|0,hi=hi+Math.imul(ah8,bh2)|0,lo=lo+Math.imul(al7,bl3)|0,mid=mid+Math.imul(al7,bh3)|0,mid=mid+Math.imul(ah7,bl3)|0,hi=hi+Math.imul(ah7,bh3)|0,lo=lo+Math.imul(al6,bl4)|0,mid=mid+Math.imul(al6,bh4)|0,mid=mid+Math.imul(ah6,bl4)|0,hi=hi+Math.imul(ah6,bh4)|0,lo=lo+Math.imul(al5,bl5)|0,mid=mid+Math.imul(al5,bh5)|0,mid=mid+Math.imul(ah5,bl5)|0,hi=hi+Math.imul(ah5,bh5)|0,lo=lo+Math.imul(al4,bl6)|0,mid=mid+Math.imul(al4,bh6)|0,mid=mid+Math.imul(ah4,bl6)|0,hi=hi+Math.imul(ah4,bh6)|0,lo=lo+Math.imul(al3,bl7)|0,mid=mid+Math.imul(al3,bh7)|0,mid=mid+Math.imul(ah3,bl7)|0,hi=hi+Math.imul(ah3,bh7)|0,lo=lo+Math.imul(al2,bl8)|0,mid=mid+Math.imul(al2,bh8)|0,mid=mid+Math.imul(ah2,bl8)|0,hi=hi+Math.imul(ah2,bh8)|0,lo=lo+Math.imul(al1,bl9)|0,mid=mid+Math.imul(al1,bh9)|0,mid=mid+Math.imul(ah1,bl9)|0,hi=hi+Math.imul(ah1,bh9)|0;var w10=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w10>>>26)|0,w10&=67108863,lo=Math.imul(al9,bl2),mid=Math.imul(al9,bh2),mid=mid+Math.imul(ah9,bl2)|0,hi=Math.imul(ah9,bh2),lo=lo+Math.imul(al8,bl3)|0,mid=mid+Math.imul(al8,bh3)|0,mid=mid+Math.imul(ah8,bl3)|0,hi=hi+Math.imul(ah8,bh3)|0,lo=lo+Math.imul(al7,bl4)|0,mid=mid+Math.imul(al7,bh4)|0,mid=mid+Math.imul(ah7,bl4)|0,hi=hi+Math.imul(ah7,bh4)|0,lo=lo+Math.imul(al6,bl5)|0,mid=mid+Math.imul(al6,bh5)|0,mid=mid+Math.imul(ah6,bl5)|0,hi=hi+Math.imul(ah6,bh5)|0,lo=lo+Math.imul(al5,bl6)|0,mid=mid+Math.imul(al5,bh6)|0,mid=mid+Math.imul(ah5,bl6)|0,hi=hi+Math.imul(ah5,bh6)|0,lo=lo+Math.imul(al4,bl7)|0,mid=mid+Math.imul(al4,bh7)|0,mid=mid+Math.imul(ah4,bl7)|0,hi=hi+Math.imul(ah4,bh7)|0,lo=lo+Math.imul(al3,bl8)|0,mid=mid+Math.imul(al3,bh8)|0,mid=mid+Math.imul(ah3,bl8)|0,hi=hi+Math.imul(ah3,bh8)|0,lo=lo+Math.imul(al2,bl9)|0,mid=mid+Math.imul(al2,bh9)|0,mid=mid+Math.imul(ah2,bl9)|0,hi=hi+Math.imul(ah2,bh9)|0;var w11=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w11>>>26)|0,w11&=67108863,lo=Math.imul(al9,bl3),mid=Math.imul(al9,bh3),mid=mid+Math.imul(ah9,bl3)|0,hi=Math.imul(ah9,bh3),lo=lo+Math.imul(al8,bl4)|0,mid=mid+Math.imul(al8,bh4)|0,mid=mid+Math.imul(ah8,bl4)|0,hi=hi+Math.imul(ah8,bh4)|0,lo=lo+Math.imul(al7,bl5)|0,mid=mid+Math.imul(al7,bh5)|0,mid=mid+Math.imul(ah7,bl5)|0,hi=hi+Math.imul(ah7,bh5)|0,lo=lo+Math.imul(al6,bl6)|0,mid=mid+Math.imul(al6,bh6)|0,mid=mid+Math.imul(ah6,bl6)|0,hi=hi+Math.imul(ah6,bh6)|0,lo=lo+Math.imul(al5,bl7)|0,mid=mid+Math.imul(al5,bh7)|0,mid=mid+Math.imul(ah5,bl7)|0,hi=hi+Math.imul(ah5,bh7)|0,lo=lo+Math.imul(al4,bl8)|0,mid=mid+Math.imul(al4,bh8)|0,mid=mid+Math.imul(ah4,bl8)|0,hi=hi+Math.imul(ah4,bh8)|0,lo=lo+Math.imul(al3,bl9)|0,mid=mid+Math.imul(al3,bh9)|0,mid=mid+Math.imul(ah3,bl9)|0,hi=hi+Math.imul(ah3,bh9)|0;var w12=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w12>>>26)|0,w12&=67108863,lo=Math.imul(al9,bl4),mid=Math.imul(al9,bh4),mid=mid+Math.imul(ah9,bl4)|0,hi=Math.imul(ah9,bh4),lo=lo+Math.imul(al8,bl5)|0,mid=mid+Math.imul(al8,bh5)|0,mid=mid+Math.imul(ah8,bl5)|0,hi=hi+Math.imul(ah8,bh5)|0,lo=lo+Math.imul(al7,bl6)|0,mid=mid+Math.imul(al7,bh6)|0,mid=mid+Math.imul(ah7,bl6)|0,hi=hi+Math.imul(ah7,bh6)|0,lo=lo+Math.imul(al6,bl7)|0,mid=mid+Math.imul(al6,bh7)|0,mid=mid+Math.imul(ah6,bl7)|0,hi=hi+Math.imul(ah6,bh7)|0,lo=lo+Math.imul(al5,bl8)|0,mid=mid+Math.imul(al5,bh8)|0,mid=mid+Math.imul(ah5,bl8)|0,hi=hi+Math.imul(ah5,bh8)|0,lo=lo+Math.imul(al4,bl9)|0,mid=mid+Math.imul(al4,bh9)|0,mid=mid+Math.imul(ah4,bl9)|0,hi=hi+Math.imul(ah4,bh9)|0;var w13=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w13>>>26)|0,w13&=67108863,lo=Math.imul(al9,bl5),mid=Math.imul(al9,bh5),mid=mid+Math.imul(ah9,bl5)|0,hi=Math.imul(ah9,bh5),lo=lo+Math.imul(al8,bl6)|0,mid=mid+Math.imul(al8,bh6)|0,mid=mid+Math.imul(ah8,bl6)|0,hi=hi+Math.imul(ah8,bh6)|0,lo=lo+Math.imul(al7,bl7)|0,mid=mid+Math.imul(al7,bh7)|0,mid=mid+Math.imul(ah7,bl7)|0,hi=hi+Math.imul(ah7,bh7)|0,lo=lo+Math.imul(al6,bl8)|0,mid=mid+Math.imul(al6,bh8)|0,mid=mid+Math.imul(ah6,bl8)|0,hi=hi+Math.imul(ah6,bh8)|0,lo=lo+Math.imul(al5,bl9)|0,mid=mid+Math.imul(al5,bh9)|0,mid=mid+Math.imul(ah5,bl9)|0,hi=hi+Math.imul(ah5,bh9)|0;var w14=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w14>>>26)|0,w14&=67108863,lo=Math.imul(al9,bl6),mid=Math.imul(al9,bh6),mid=mid+Math.imul(ah9,bl6)|0,hi=Math.imul(ah9,bh6),lo=lo+Math.imul(al8,bl7)|0,mid=mid+Math.imul(al8,bh7)|0,mid=mid+Math.imul(ah8,bl7)|0,hi=hi+Math.imul(ah8,bh7)|0,lo=lo+Math.imul(al7,bl8)|0,mid=mid+Math.imul(al7,bh8)|0,mid=mid+Math.imul(ah7,bl8)|0,hi=hi+Math.imul(ah7,bh8)|0,lo=lo+Math.imul(al6,bl9)|0,mid=mid+Math.imul(al6,bh9)|0,mid=mid+Math.imul(ah6,bl9)|0,hi=hi+Math.imul(ah6,bh9)|0;var w15=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w15>>>26)|0,w15&=67108863,lo=Math.imul(al9,bl7),mid=Math.imul(al9,bh7),mid=mid+Math.imul(ah9,bl7)|0,hi=Math.imul(ah9,bh7),lo=lo+Math.imul(al8,bl8)|0,mid=mid+Math.imul(al8,bh8)|0,mid=mid+Math.imul(ah8,bl8)|0,hi=hi+Math.imul(ah8,bh8)|0,lo=lo+Math.imul(al7,bl9)|0,mid=mid+Math.imul(al7,bh9)|0,mid=mid+Math.imul(ah7,bl9)|0,hi=hi+Math.imul(ah7,bh9)|0;var w16=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w16>>>26)|0,w16&=67108863,lo=Math.imul(al9,bl8),mid=Math.imul(al9,bh8),mid=mid+Math.imul(ah9,bl8)|0,hi=Math.imul(ah9,bh8),lo=lo+Math.imul(al8,bl9)|0,mid=mid+Math.imul(al8,bh9)|0,mid=mid+Math.imul(ah8,bl9)|0,hi=hi+Math.imul(ah8,bh9)|0;var w17=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w17>>>26)|0,w17&=67108863,lo=Math.imul(al9,bl9),mid=Math.imul(al9,bh9),mid=mid+Math.imul(ah9,bl9)|0,hi=Math.imul(ah9,bh9);var w18=(c+lo|0)+((8191&mid)<<13)|0;return c=(hi+(mid>>>13)|0)+(w18>>>26)|0,w18&=67108863,o[0]=w0,o[1]=w1,o[2]=w2,o[3]=w3,o[4]=w4,o[5]=w5,o[6]=w6,o[7]=w7,o[8]=w8,o[9]=w9,o[10]=w10,o[11]=w11,o[12]=w12,o[13]=w13,o[14]=w14,o[15]=w15,o[16]=w16,o[17]=w17,o[18]=w18,0!==c&&(o[19]=c,out.length++),out};Math.imul||(comb10MulTo=smallMulTo),BN.prototype.mulTo=function(num,out){var len=this.length+num.length;return 10===this.length&&10===num.length?comb10MulTo(this,num,out):len<63?smallMulTo(this,num,out):len<1024?bigMulTo(this,num,out):jumboMulTo(this,num,out)},FFTM.prototype.makeRBT=function(N){for(var t=new Array(N),l=BN.prototype._countBits(N)-1,i=0;i>=1;return rb},FFTM.prototype.permute=function(rbt,rws,iws,rtws,itws,N){for(var i=0;i>>=1)i++;return 1<>>=13,rws[2*i+1]=8191&carry,carry>>>=13;for(i=2*len;i>=26,carry+=w/67108864|0,carry+=lo>>>26,this.words[i]=67108863&lo}return 0!==carry&&(this.words[i]=carry,this.length++),this},BN.prototype.muln=function(num){return this.clone().imuln(num)},BN.prototype.sqr=function(){return this.mul(this)},BN.prototype.isqr=function(){return this.imul(this.clone())},BN.prototype.pow=function(num){var w=toBitArray(num);if(0===w.length)return new BN(1);for(var res=this,i=0;i=0);var i,r=bits%26,s=(bits-r)/26,carryMask=67108863>>>26-r<<26-r;if(0!==r){var carry=0;for(i=0;i>>26-r}carry&&(this.words[i]=carry,this.length++)}if(0!==s){for(i=this.length-1;i>=0;i--)this.words[i+s]=this.words[i];for(i=0;i=0);var h;h=hint?(hint-hint%26)/26:0;var r=bits%26,s=Math.min((bits-r)/26,this.length),mask=67108863^67108863>>>r<s)for(this.length-=s,i=0;i=0&&(0!==carry||i>=h);i--){var word=0|this.words[i];this.words[i]=carry<<26-r|word>>>r,carry=word&mask}return maskedWords&&0!==carry&&(maskedWords.words[maskedWords.length++]=carry),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},BN.prototype.ishrn=function(bits,hint,extended){return assert(0===this.negative),this.iushrn(bits,hint,extended)},BN.prototype.shln=function(bits){return this.clone().ishln(bits)},BN.prototype.ushln=function(bits){return this.clone().iushln(bits)},BN.prototype.shrn=function(bits){return this.clone().ishrn(bits)},BN.prototype.ushrn=function(bits){return this.clone().iushrn(bits)},BN.prototype.testn=function(bit){assert("number"==typeof bit&&bit>=0);var r=bit%26,s=(bit-r)/26,q=1<=0);var r=bits%26,s=(bits-r)/26;if(assert(0===this.negative,"imaskn works only with positive numbers"),this.length<=s)return this;if(0!==r&&s++,this.length=Math.min(s,this.length),0!==r){var mask=67108863^67108863>>>r<=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},BN.prototype.isubn=function(num){if(assert("number"==typeof num),assert(num<67108864),num<0)return this.iaddn(-num);if(0!==this.negative)return this.negative=0,this.iaddn(num),this.negative=1,this;if(this.words[0]-=num,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var i=0;i>26)-(right/67108864|0),this.words[i+shift]=67108863&w}for(;i>26,this.words[i+shift]=67108863&w;if(0===carry)return this.strip();for(assert(carry===-1),carry=0,i=0;i>26,this.words[i]=67108863&w;return this.negative=1,this.strip()},BN.prototype._wordDiv=function(num,mode){var shift=this.length-num.length,a=this.clone(),b=num,bhi=0|b.words[b.length-1];0!==(shift=26-this._countBits(bhi))&&(b=b.ushln(shift),a.iushln(shift),bhi=0|b.words[b.length-1]);var q,m=a.length-b.length;if("mod"!==mode){q=new BN(null),q.length=m+1,q.words=new Array(q.length);for(var i=0;i=0;j--){var qj=67108864*(0|a.words[b.length+j])+(0|a.words[b.length+j-1]);for(qj=Math.min(qj/bhi|0,67108863),a._ishlnsubmul(b,qj,j);0!==a.negative;)qj--,a.negative=0,a._ishlnsubmul(b,1,j),a.isZero()||(a.negative^=1);q&&(q.words[j]=qj)}return q&&q.strip(),a.strip(),"div"!==mode&&0!==shift&&a.iushrn(shift),{div:q||null,mod:a}},BN.prototype.divmod=function(num,mode,positive){if(assert(!num.isZero()),this.isZero())return{div:new BN(0),mod:new BN(0)};var div,mod,res;return 0!==this.negative&&0===num.negative?(res=this.neg().divmod(num,mode),"mod"!==mode&&(div=res.div.neg()),"div"!==mode&&(mod=res.mod.neg(),positive&&0!==mod.negative&&mod.iadd(num)),{div:div,mod:mod}):0===this.negative&&0!==num.negative?(res=this.divmod(num.neg(),mode),"mod"!==mode&&(div=res.div.neg()),{div:div,mod:res.mod}):0!=(this.negative&num.negative)?(res=this.neg().divmod(num.neg(),mode),"div"!==mode&&(mod=res.mod.neg(),positive&&0!==mod.negative&&mod.isub(num)),{div:res.div,mod:mod}):num.length>this.length||this.cmp(num)<0?{div:new BN(0),mod:this}:1===num.length?"div"===mode?{div:this.divn(num.words[0]),mod:null}:"mod"===mode?{div:null,mod:new BN(this.modn(num.words[0]))}:{div:this.divn(num.words[0]),mod:new BN(this.modn(num.words[0]))}:this._wordDiv(num,mode)},BN.prototype.div=function(num){return this.divmod(num,"div",!1).div},BN.prototype.mod=function(num){return this.divmod(num,"mod",!1).mod},BN.prototype.umod=function(num){return this.divmod(num,"mod",!0).mod},BN.prototype.divRound=function(num){var dm=this.divmod(num);if(dm.mod.isZero())return dm.div;var mod=0!==dm.div.negative?dm.mod.isub(num):dm.mod,half=num.ushrn(1),r2=num.andln(1),cmp=mod.cmp(half);return cmp<0||1===r2&&0===cmp?dm.div:0!==dm.div.negative?dm.div.isubn(1):dm.div.iaddn(1)},BN.prototype.modn=function(num){assert(num<=67108863);for(var p=(1<<26)%num,acc=0,i=this.length-1;i>=0;i--)acc=(p*acc+(0|this.words[i]))%num;return acc},BN.prototype.idivn=function(num){assert(num<=67108863);for(var carry=0,i=this.length-1;i>=0;i--){var w=(0|this.words[i])+67108864*carry;this.words[i]=w/num|0,carry=w%num}return this.strip()},BN.prototype.divn=function(num){return this.clone().idivn(num)},BN.prototype.egcd=function(p){assert(0===p.negative),assert(!p.isZero());var x=this,y=p.clone();x=0!==x.negative?x.umod(p):x.clone();for(var A=new BN(1),B=new BN(0),C=new BN(0),D=new BN(1),g=0;x.isEven()&&y.isEven();)x.iushrn(1),y.iushrn(1),++g;for(var yp=y.clone(),xp=x.clone();!x.isZero();){for(var i=0,im=1;0==(x.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(x.iushrn(i);i-- >0;)(A.isOdd()||B.isOdd())&&(A.iadd(yp),B.isub(xp)),A.iushrn(1),B.iushrn(1);for(var j=0,jm=1;0==(y.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(y.iushrn(j);j-- >0;)(C.isOdd()||D.isOdd())&&(C.iadd(yp),D.isub(xp)),C.iushrn(1),D.iushrn(1);x.cmp(y)>=0?(x.isub(y),A.isub(C),B.isub(D)):(y.isub(x),C.isub(A),D.isub(B))}return{a:C,b:D,gcd:y.iushln(g)}},BN.prototype._invmp=function(p){assert(0===p.negative),assert(!p.isZero());var a=this,b=p.clone();a=0!==a.negative?a.umod(p):a.clone();for(var x1=new BN(1),x2=new BN(0),delta=b.clone();a.cmpn(1)>0&&b.cmpn(1)>0;){for(var i=0,im=1;0==(a.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(a.iushrn(i);i-- >0;)x1.isOdd()&&x1.iadd(delta),x1.iushrn(1);for(var j=0,jm=1;0==(b.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(b.iushrn(j);j-- >0;)x2.isOdd()&&x2.iadd(delta),x2.iushrn(1);a.cmp(b)>=0?(a.isub(b),x1.isub(x2)):(b.isub(a),x2.isub(x1))}var res;return res=0===a.cmpn(1)?x1:x2,res.cmpn(0)<0&&res.iadd(p),res},BN.prototype.gcd=function(num){if(this.isZero())return num.abs();if(num.isZero())return this.abs();var a=this.clone(),b=num.clone();a.negative=0,b.negative=0;for(var shift=0;a.isEven()&&b.isEven();shift++)a.iushrn(1),b.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;b.isEven();)b.iushrn(1);var r=a.cmp(b);if(r<0){var t=a;a=b,b=t}else if(0===r||0===b.cmpn(1))break;a.isub(b)}return b.iushln(shift)}, +BN.prototype.invm=function(num){return this.egcd(num).a.umod(num)},BN.prototype.isEven=function(){return 0==(1&this.words[0])},BN.prototype.isOdd=function(){return 1==(1&this.words[0])},BN.prototype.andln=function(num){return this.words[0]&num},BN.prototype.bincn=function(bit){assert("number"==typeof bit);var r=bit%26,s=(bit-r)/26,q=1<>>26,w&=67108863,this.words[i]=w}return 0!==carry&&(this.words[i]=carry,this.length++),this},BN.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},BN.prototype.cmpn=function(num){var negative=num<0;if(0!==this.negative&&!negative)return-1;if(0===this.negative&&negative)return 1;this.strip();var res;if(this.length>1)res=1;else{negative&&(num=-num),assert(num<=67108863,"Number is too big");var w=0|this.words[0];res=w===num?0:wnum.length)return 1;if(this.length=0;i--){var a=0|this.words[i],b=0|num.words[i];if(a!==b){ab&&(res=1);break}}return res},BN.prototype.gtn=function(num){return 1===this.cmpn(num)},BN.prototype.gt=function(num){return 1===this.cmp(num)},BN.prototype.gten=function(num){return this.cmpn(num)>=0},BN.prototype.gte=function(num){return this.cmp(num)>=0},BN.prototype.ltn=function(num){return this.cmpn(num)===-1},BN.prototype.lt=function(num){return this.cmp(num)===-1},BN.prototype.lten=function(num){return this.cmpn(num)<=0},BN.prototype.lte=function(num){return this.cmp(num)<=0},BN.prototype.eqn=function(num){return 0===this.cmpn(num)},BN.prototype.eq=function(num){return 0===this.cmp(num)},BN.red=function(num){return new Red(num)},BN.prototype.toRed=function(ctx){return assert(!this.red,"Already a number in reduction context"),assert(0===this.negative,"red works only with positives"),ctx.convertTo(this)._forceRed(ctx)},BN.prototype.fromRed=function(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function(ctx){return this.red=ctx,this},BN.prototype.forceRed=function(ctx){return assert(!this.red,"Already a number in reduction context"),this._forceRed(ctx)},BN.prototype.redAdd=function(num){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,num)},BN.prototype.redIAdd=function(num){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,num)},BN.prototype.redSub=function(num){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,num)},BN.prototype.redISub=function(num){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,num)},BN.prototype.redShl=function(num){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,num)},BN.prototype.redMul=function(num){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,num),this.red.mul(this,num)},BN.prototype.redIMul=function(num){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,num),this.red.imul(this,num)},BN.prototype.redSqr=function(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function(num){return assert(this.red&&!num.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,num)};var primes={k256:null,p224:null,p192:null,p25519:null};MPrime.prototype._tmp=function(){var tmp=new BN(null);return tmp.words=new Array(Math.ceil(this.n/13)),tmp},MPrime.prototype.ireduce=function(num){var rlen,r=num;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),rlen=r.bitLength()}while(rlen>this.n);var cmp=rlen0?r.isub(this.p):r.strip(),r},MPrime.prototype.split=function(input,out){input.iushrn(this.n,0,out)},MPrime.prototype.imulK=function(num){return num.imul(this.k)},inherits(K256,MPrime),K256.prototype.split=function(input,output){for(var outLen=Math.min(input.length,9),i=0;i>>22,prev=next}prev>>>=22,input.words[i-10]=prev,0===prev&&input.length>10?input.length-=10:input.length-=9},K256.prototype.imulK=function(num){num.words[num.length]=0,num.words[num.length+1]=0,num.length+=2;for(var lo=0,i=0;i>>=26,num.words[i]=lo,carry=hi}return 0!==carry&&(num.words[num.length++]=carry),num},BN._prime=function prime(name){if(primes[name])return primes[name];var prime;if("k256"===name)prime=new K256;else if("p224"===name)prime=new P224;else if("p192"===name)prime=new P192;else{if("p25519"!==name)throw new Error("Unknown prime "+name);prime=new P25519}return primes[name]=prime,prime},Red.prototype._verify1=function(a){assert(0===a.negative,"red works only with positives"),assert(a.red,"red works only with red numbers")},Red.prototype._verify2=function(a,b){assert(0==(a.negative|b.negative),"red works only with positives"),assert(a.red&&a.red===b.red,"red works only with red numbers")},Red.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this)},Red.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},Red.prototype.add=function(a,b){this._verify2(a,b);var res=a.add(b);return res.cmp(this.m)>=0&&res.isub(this.m),res._forceRed(this)},Red.prototype.iadd=function(a,b){this._verify2(a,b);var res=a.iadd(b);return res.cmp(this.m)>=0&&res.isub(this.m),res},Red.prototype.sub=function(a,b){this._verify2(a,b);var res=a.sub(b);return res.cmpn(0)<0&&res.iadd(this.m),res._forceRed(this)},Red.prototype.isub=function(a,b){this._verify2(a,b);var res=a.isub(b);return res.cmpn(0)<0&&res.iadd(this.m),res},Red.prototype.shl=function(a,num){return this._verify1(a),this.imod(a.ushln(num))},Red.prototype.imul=function(a,b){return this._verify2(a,b),this.imod(a.imul(b))},Red.prototype.mul=function(a,b){return this._verify2(a,b),this.imod(a.mul(b))},Red.prototype.isqr=function(a){return this.imul(a,a.clone())},Red.prototype.sqr=function(a){return this.mul(a,a)},Red.prototype.sqrt=function(a){if(a.isZero())return a.clone();var mod3=this.m.andln(3);if(assert(mod3%2==1),3===mod3){var pow=this.m.add(new BN(1)).iushrn(2);return this.pow(a,pow)}for(var q=this.m.subn(1),s=0;!q.isZero()&&0===q.andln(1);)s++,q.iushrn(1);assert(!q.isZero());var one=new BN(1).toRed(this),nOne=one.redNeg(),lpow=this.m.subn(1).iushrn(1),z=this.m.bitLength();for(z=new BN(2*z*z).toRed(this);0!==this.pow(z,lpow).cmp(nOne);)z.redIAdd(nOne);for(var c=this.pow(z,q),r=this.pow(a,q.addn(1).iushrn(1)),t=this.pow(a,q),m=s;0!==t.cmp(one);){for(var tmp=t,i=0;0!==tmp.cmp(one);i++)tmp=tmp.redSqr();assert(i=0;i--){for(var word=num.words[i],j=start-1;j>=0;j--){var bit=word>>j&1;res!==wnd[0]&&(res=this.sqr(res)),0!==bit||0!==current?(current<<=1,current|=bit,(4===++currentLen||0===i&&0===j)&&(res=this.mul(res,wnd[current]),currentLen=0,current=0)):currentLen=0}start=26}return res},Red.prototype.convertTo=function(num){var r=num.umod(this.m);return r===num?r.clone():r},Red.prototype.convertFrom=function(num){var res=num.clone();return res.red=null,res},BN.mont=function(num){return new Mont(num)},inherits(Mont,Red),Mont.prototype.convertTo=function(num){return this.imod(num.ushln(this.shift))},Mont.prototype.convertFrom=function(num){var r=this.imod(num.mul(this.rinv));return r.red=null,r},Mont.prototype.imul=function(a,b){if(a.isZero()||b.isZero())return a.words[0]=0,a.length=1,a;var t=a.imul(b),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=t.isub(c).iushrn(this.shift),res=u;return u.cmp(this.m)>=0?res=u.isub(this.m):u.cmpn(0)<0&&(res=u.iadd(this.m)),res._forceRed(this)},Mont.prototype.mul=function(a,b){if(a.isZero()||b.isZero())return new BN(0)._forceRed(this);var t=a.mul(b),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=t.isub(c).iushrn(this.shift),res=u;return u.cmp(this.m)>=0?res=u.isub(this.m):u.cmpn(0)<0&&(res=u.iadd(this.m)),res._forceRed(this)},Mont.prototype.invm=function(a){return this.imod(a._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===module||module,this)}).call(exports,__webpack_require__(18)(module))},function(module,exports,__webpack_require__){module.exports={encode:__webpack_require__(702),decode:__webpack_require__(701),encodingLength:__webpack_require__(703)}},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function eachLimit(coll,iteratee,callback){(0,_eachOf2.default)(coll,(0,_withoutIndex2.default)((0,_wrapAsync2.default)(iteratee)),callback)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=eachLimit;var _eachOf=__webpack_require__(106),_eachOf2=_interopRequireDefault(_eachOf),_withoutIndex=__webpack_require__(164),_withoutIndex2=_interopRequireDefault(_withoutIndex),_wrapAsync=__webpack_require__(12),_wrapAsync2=_interopRequireDefault(_wrapAsync);module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";const Key=__webpack_require__(198),MemoryDatastore=__webpack_require__(391),utils=__webpack_require__(119);exports.Key=Key,exports.MemoryDatastore=MemoryDatastore,exports.utils=utils},function(module,exports,__webpack_require__){var createCallback=function(method,context){return function(){var args=Array.prototype.slice.call(arguments),lastIndex=args.length-1,lastArg=args&&args.length>0?args[lastIndex]:null;return("function"==typeof lastArg?lastArg:null)?method.apply(context,args):new Promise(function(resolve,reject){args.push(function(err,val){if(err)return reject(err);resolve(val)}),method.apply(context,args)})}};module.exports=function(methods,options){options=options||{};var type=Object.prototype.toString.call(methods);if("[object Object]"===type||"[object Array]"===type){var obj=options.replace?methods:{};for(var key in methods)methods.hasOwnProperty(key)&&(obj[key]=createCallback(methods[key]));return obj}return createCallback(methods,options.context||methods)}},function(module,exports){module.exports=function(module){return module.webpackPolyfill||(module.deprecate=function(){},module.paths=[],module.children||(module.children=[]),Object.defineProperty(module,"loaded",{enumerable:!0,get:function(){return module.l}}),Object.defineProperty(module,"id",{enumerable:!0,get:function(){return module.i}}),module.webpackPolyfill=1),module}},function(module,exports,__webpack_require__){(function(process){function useColors(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(args){var useColors=this.useColors;if(args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff),useColors){var c="color: "+this.color;args.splice(1,0,c,"color: inherit");var index=0,lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){"%%"!==match&&(index++,"%c"===match&&(lastC=index))}),args.splice(lastC,0,c)}}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{null==namespaces?exports.storage.removeItem("debug"):exports.storage.debug=namespaces}catch(e){}}function load(){var r;try{r=exports.storage.debug}catch(e){}return!r&&void 0!==process&&"env"in process&&(r=process.env.DEBUG),r}exports=module.exports=__webpack_require__(339),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),exports.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"],exports.formatters.j=function(v){try{return JSON.stringify(v)}catch(err){return"[UnexpectedJSONParseError]: "+err.message}},exports.enable(load())}).call(exports,__webpack_require__(1))},function(module,exports,__webpack_require__){"use strict";var elliptic=exports;elliptic.version=__webpack_require__(460).version,elliptic.utils=__webpack_require__(357),elliptic.rand=__webpack_require__(322),elliptic.curve=__webpack_require__(84),elliptic.curves=__webpack_require__(349),elliptic.ec=__webpack_require__(350),elliptic.eddsa=__webpack_require__(353)},function(module,exports){function parse(str){if(str=String(str),!(str.length>100)){var match=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);if(match){var n=parseFloat(match[1]);switch((match[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*y;case"days":case"day":case"d":return n*d;case"hours":case"hour":case"hrs":case"hr":case"h":return n*h;case"minutes":case"minute":case"mins":case"min":case"m":return n*m;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function fmtShort(ms){return ms>=d?Math.round(ms/d)+"d":ms>=h?Math.round(ms/h)+"h":ms>=m?Math.round(ms/m)+"m":ms>=s?Math.round(ms/s)+"s":ms+"ms"}function fmtLong(ms){return plural(ms,d,"day")||plural(ms,h,"hour")||plural(ms,m,"minute")||plural(ms,s,"second")||ms+" ms"}function plural(ms,n,name){if(!(ms0)return parse(val);if("number"===type&&isNaN(val)===!1)return options.long?fmtLong(val):fmtShort(val);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(val))}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function Multihashing(buf,func,length,callback){if("function"==typeof length&&(callback=length,length=void 0),!callback)throw new Error("Missing callback");Multihashing.digest(buf,func,length,(err,digest)=>{if(err)return callback(err);callback(null,multihash.encode(digest,func,length))})}const multihash=__webpack_require__(11),crypto=__webpack_require__(585);module.exports=Multihashing,Multihashing.Buffer=Buffer,Multihashing.multihash=multihash,Multihashing.digest=function(buf,func,length,callback){if("function"==typeof length&&(callback=length,length=void 0),!callback)throw new Error("Missing callback");let cb=callback;length&&(cb=((err,digest)=>{if(err)return callback(err);callback(null,digest.slice(0,length))}));let hash;try{hash=Multihashing.createHash(func)}catch(err){return cb(err)}hash(buf,cb)},Multihashing.createHash=function(func){if(func=multihash.coerceCode(func),!Multihashing.functions[func])throw new Error("multihash function "+func+" not yet supported");return Multihashing.functions[func]},Multihashing.functions={17:crypto.sha1,18:crypto.sha2256,19:crypto.sha2512,20:crypto.sha3512,21:crypto.sha3384,22:crypto.sha3256,23:crypto.sha3224,24:crypto.shake128,25:crypto.shake256,26:crypto.keccak224,27:crypto.keccak256,28:crypto.keccak384,29:crypto.keccak512,34:crypto.murmur3128,35:crypto.murmur332},crypto.addBlake(Multihashing.functions)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function toB64Opt(val){if(val)return val.toString("base64")}const mh=__webpack_require__(11),crypto=__webpack_require__(67),assert=__webpack_require__(9),waterfall=__webpack_require__(6),Buffer=__webpack_require__(5).Buffer;class PeerId{constructor(id,privKey,pubKey){assert(Buffer.isBuffer(id),"invalid id provided"),privKey&&pubKey&&assert(privKey.public.bytes.equals(pubKey.bytes),"inconsistent arguments"),this._id=id,this._idB58String=mh.toB58String(this.id),this._privKey=privKey,this._pubKey=pubKey}get id(){return this._id}set id(val){throw new Error("Id is immutable")}get privKey(){return this._privKey}set privKey(privKey){this._privKey=privKey}get pubKey(){return this._pubKey?this._pubKey:this._privKey?this._privKey.public:void 0}set pubKey(pubKey){this._pubKey=pubKey}marshalPubKey(){if(this.pubKey)return crypto.keys.marshalPublicKey(this.pubKey)}marshalPrivKey(){if(this.privKey)return crypto.keys.marshalPrivateKey(this.privKey)}toPrint(){return this.toJSON()}toJSON(){return{id:this.toB58String(),privKey:toB64Opt(this.marshalPrivKey()),pubKey:toB64Opt(this.marshalPubKey())}}toHexString(){return mh.toHexString(this.id)}toBytes(){return this.id}toB58String(){return this._idB58String}isEqual(id){if(Buffer.isBuffer(id))return this.id.equals(id);if(id.id)return this.id.equals(id.id);throw new Error("not valid Id")}isValid(callback){this.privKey&&this.privKey.public&&this.privKey.public.bytes&&Buffer.isBuffer(this.pubKey.bytes)&&this.privKey.public.bytes.equals(this.pubKey.bytes)?callback():callback(new Error("Keys not match"))}}exports=module.exports=PeerId,exports.create=function(opts,callback){"function"==typeof opts&&(callback=opts,opts={}),opts=opts||{},opts.bits=opts.bits||2048,waterfall([cb=>crypto.keys.generateKeyPair("RSA",opts.bits,cb),(privKey,cb)=>privKey.public.hash((err,digest)=>{cb(err,digest,privKey)})],(err,digest,privKey)=>{if(err)return callback(err);callback(null,new PeerId(digest,privKey))})},exports.createFromHexString=function(str){return new PeerId(mh.fromHexString(str))},exports.createFromBytes=function(buf){return new PeerId(buf)},exports.createFromB58String=function(str){return new PeerId(mh.fromB58String(str))},exports.createFromPubKey=function(key,callback){if("function"!=typeof callback)throw new Error("callback is required");let buf=key;"string"==typeof buf&&(buf=Buffer.from(key,"base64"));const pubKey=crypto.keys.unmarshalPublicKey(buf);pubKey.hash((err,digest)=>{if(err)return callback(err);callback(null,new PeerId(digest,null,pubKey))})},exports.createFromPrivKey=function(key,callback){let buf=key;if("string"==typeof buf&&(buf=Buffer.from(key,"base64")),"function"!=typeof callback)throw new Error("callback is required");waterfall([cb=>crypto.keys.unmarshalPrivateKey(buf,cb),(privKey,cb)=>privKey.public.hash((err,digest)=>{cb(err,digest,privKey)})],(err,digest,privKey)=>{if(err)return callback(err);callback(null,new PeerId(digest,privKey))})},exports.createFromJSON=function(obj,callback){if("function"!=typeof callback)throw new Error("callback is required");const id=mh.fromB58String(obj.id),rawPrivKey=obj.privKey&&Buffer.from(obj.privKey,"base64"),rawPubKey=obj.pubKey&&Buffer.from(obj.pubKey,"base64"),pub=rawPubKey&&crypto.keys.unmarshalPublicKey(rawPubKey);rawPrivKey?waterfall([cb=>crypto.keys.unmarshalPrivateKey(rawPrivKey,cb),(priv,cb)=>priv.public.hash((err,digest)=>{cb(err,digest,priv)}),(privDigest,priv,cb)=>{pub?pub.hash((err,pubDigest)=>{cb(err,privDigest,priv,pubDigest)}):cb(null,privDigest,priv)}],(err,privDigest,priv,pubDigest)=>{return err?callback(err):pub&&!privDigest.equals(pubDigest)?callback(new Error("Public and private key do not match")):id&&!privDigest.equals(id)?callback(new Error("Id and private key do not match")):void callback(null,new PeerId(id,priv,pub))}):callback(null,new PeerId(id,null,pub))},exports.isPeerId=function(peerId){return Boolean("object"==typeof peerId&&peerId._id&&peerId._idB58String)}},function(module,exports,__webpack_require__){"use strict";const encode=__webpack_require__(616),d=__webpack_require__(615);exports.encode=encode,exports.decode=d.decode,exports.decodeFromReader=d.decodeFromReader},function(module,exports,__webpack_require__){function Stream(){EE.call(this)}module.exports=Stream;var EE=__webpack_require__(10).EventEmitter;__webpack_require__(2)(Stream,EE),Stream.Readable=__webpack_require__(37),Stream.Writable=__webpack_require__(660),Stream.Duplex=__webpack_require__(655),Stream.Transform=__webpack_require__(659),Stream.PassThrough=__webpack_require__(658),Stream.Stream=Stream,Stream.prototype.pipe=function(dest,options){function ondata(chunk){dest.writable&&!1===dest.write(chunk)&&source.pause&&source.pause()}function ondrain(){source.readable&&source.resume&&source.resume()}function onend(){didOnEnd||(didOnEnd=!0,dest.end())}function onclose(){didOnEnd||(didOnEnd=!0,"function"==typeof dest.destroy&&dest.destroy())}function onerror(er){if(cleanup(),0===EE.listenerCount(this,"error"))throw er}function cleanup(){source.removeListener("data",ondata),dest.removeListener("drain",ondrain),source.removeListener("end",onend),source.removeListener("close",onclose),source.removeListener("error",onerror),dest.removeListener("error",onerror),source.removeListener("end",cleanup),source.removeListener("close",cleanup),dest.removeListener("close",cleanup)}var source=this;source.on("data",ondata),dest.on("drain",ondrain),dest._isStdio||options&&options.end===!1||(source.on("end",onend),source.on("close",onclose));var didOnEnd=!1;return source.on("error",onerror),dest.on("error",onerror),source.on("end",cleanup),source.on("close",cleanup),dest.on("close",cleanup),dest.emit("pipe",source),dest}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function Multiaddr(addr){if(!(this instanceof Multiaddr))return new Multiaddr(addr);if((addr=addr||"")instanceof Buffer)this.buffer=codec.fromBuffer(addr);else if("string"==typeof addr||addr instanceof String)this.buffer=codec.fromString(addr);else{if(!(addr.buffer&&addr.protos&&addr.protoCodes))throw new Error("addr must be a string, Buffer, or another Multiaddr");this.buffer=codec.fromBuffer(addr.buffer)}}const map=__webpack_require__(133),extend=__webpack_require__(39),codec=__webpack_require__(577),protocols=__webpack_require__(138),varint=__webpack_require__(14),bs58=__webpack_require__(81),NotImplemented=new Error("Sorry, Not Implemented Yet.");exports=module.exports=Multiaddr,Multiaddr.prototype.toString=function(){return codec.bufferToString(this.buffer)},Multiaddr.prototype.toOptions=function(){const opts={},parsed=this.toString().split("/");return opts.family="ip4"===parsed[1]?"ipv4":"ipv6",opts.host=parsed[2],opts.transport=parsed[3],opts.port=parsed[4],opts},Multiaddr.prototype.inspect=function(){return""},Multiaddr.prototype.protos=function(){return map(this.protoCodes(),function(code){return extend(protocols(code))})},Multiaddr.prototype.protoCodes=function(){const codes=[],buf=this.buffer;let i=0;for(;i{if(tuple[0]===protocols.names.ipfs.code)return!0})[0][1],bs58.decode(b58str)}catch(e){b58str=null}return b58str},Multiaddr.prototype.equals=function(addr){return this.buffer.equals(addr.buffer)},Multiaddr.prototype.nodeAddress=function(){if(!this.isThinWaistAddress())throw new Error('Multiaddr must be "thin waist" address for nodeAddress.');const codes=this.protoCodes(),parts=this.toString().split("/").slice(1);return{family:41===codes[0]?"IPv6":"IPv4",address:parts[1],port:parts[3]}},Multiaddr.fromNodeAddress=function(addr,transport){if(!addr)throw new Error("requires node address object");if(!transport)throw new Error("requires transport protocol");return Multiaddr("/"+["IPv6"===addr.family?"ip6":"ip4",addr.address,transport,addr.port].join("/"))},Multiaddr.prototype.isThinWaistAddress=function(addr){const protos=(addr||this).protos();return 2===protos.length&&((4===protos[0].code||41===protos[0].code)&&(6===protos[1].code||17===protos[1].code))},Multiaddr.prototype.fromStupidString=function(str){throw NotImplemented},Multiaddr.protocols=protocols,Multiaddr.isMultiaddr=function(addr){return addr.constructor&&addr.constructor.name?"Multiaddr"===addr.constructor.name:Boolean(addr.fromStupidString&&addr.protos)},Multiaddr.isName=function(addr){return!!Multiaddr.isMultiaddr(addr)&&addr.protos().some(proto=>proto.resolvable)},Multiaddr.resolve=function(addr,callback){return callback(Multiaddr.isMultiaddr(addr)&&Multiaddr.isName(addr)?new Error("not implemented yet"):new Error("not a valid name"))}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function isArray(arg){return Array.isArray?Array.isArray(arg):"[object Array]"===objectToString(arg)}function isBoolean(arg){return"boolean"==typeof arg}function isNull(arg){return null===arg}function isNullOrUndefined(arg){return null==arg}function isNumber(arg){return"number"==typeof arg}function isString(arg){return"string"==typeof arg}function isSymbol(arg){return"symbol"==typeof arg}function isUndefined(arg){return void 0===arg}function isRegExp(re){return"[object RegExp]"===objectToString(re)}function isObject(arg){return"object"==typeof arg&&null!==arg}function isDate(d){return"[object Date]"===objectToString(d)}function isError(e){return"[object Error]"===objectToString(e)||e instanceof Error}function isFunction(arg){return"function"==typeof arg}function isPrimitive(arg){return null===arg||"boolean"==typeof arg||"number"==typeof arg||"string"==typeof arg||"symbol"==typeof arg||void 0===arg}function objectToString(o){return Object.prototype.toString.call(o)}exports.isArray=isArray,exports.isBoolean=isBoolean,exports.isNull=isNull,exports.isNullOrUndefined=isNullOrUndefined,exports.isNumber=isNumber,exports.isString=isString,exports.isSymbol=isSymbol,exports.isUndefined=isUndefined,exports.isRegExp=isRegExp,exports.isObject=isObject,exports.isDate=isDate,exports.isError=isError,exports.isFunction=isFunction,exports.isPrimitive=isPrimitive,exports.isBuffer=Buffer.isBuffer}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function toArray(msg,enc){if(Array.isArray(msg))return msg.slice();if(!msg)return[];var res=[];if("string"==typeof msg)if(enc){if("hex"===enc)for(msg=msg.replace(/[^a-z0-9]+/gi,""),msg.length%2!=0&&(msg="0"+msg),i=0;i>8,lo=255&c;hi?res.push(hi,lo):res.push(lo)}else for(i=0;i>>24|w>>>8&65280|w<<8&16711680|(255&w)<<24)>>>0}function toHex32(msg,endian){for(var res="",i=0;i>>0}return res}function split32(msg,endian){for(var res=new Array(4*msg.length),i=0,k=0;i>>24,res[k+1]=m>>>16&255,res[k+2]=m>>>8&255,res[k+3]=255&m):(res[k+3]=m>>>24,res[k+2]=m>>>16&255,res[k+1]=m>>>8&255,res[k]=255&m)}return res}function rotr32(w,b){return w>>>b|w<<32-b}function rotl32(w,b){return w<>>32-b}function sum32(a,b){return a+b>>>0}function sum32_3(a,b,c){return a+b+c>>>0}function sum32_4(a,b,c,d){return a+b+c+d>>>0}function sum32_5(a,b,c,d,e){return a+b+c+d+e>>>0}function sum64(buf,pos,ah,al){var bh=buf[pos],bl=buf[pos+1],lo=al+bl>>>0,hi=(lo>>0,buf[pos+1]=lo}function sum64_hi(ah,al,bh,bl){return(al+bl>>>0>>0}function sum64_lo(ah,al,bh,bl){return al+bl>>>0}function sum64_4_hi(ah,al,bh,bl,ch,cl,dh,dl){var carry=0,lo=al;return lo=lo+bl>>>0,carry+=lo>>0,carry+=lo>>0,carry+=lo>>0}function sum64_4_lo(ah,al,bh,bl,ch,cl,dh,dl){return al+bl+cl+dl>>>0}function sum64_5_hi(ah,al,bh,bl,ch,cl,dh,dl,eh,el){var carry=0,lo=al;return lo=lo+bl>>>0,carry+=lo>>0,carry+=lo>>0,carry+=lo>>0,carry+=lo>>0}function sum64_5_lo(ah,al,bh,bl,ch,cl,dh,dl,eh,el){return al+bl+cl+dl+el>>>0}function rotr64_hi(ah,al,num){return(al<<32-num|ah>>>num)>>>0}function rotr64_lo(ah,al,num){return(ah<<32-num|al>>>num)>>>0}function shr64_hi(ah,al,num){return ah>>>num}function shr64_lo(ah,al,num){return(ah<<32-num|al>>>num)>>>0}var assert=__webpack_require__(35),inherits=__webpack_require__(2);exports.inherits=inherits,exports.toArray=toArray,exports.toHex=toHex,exports.htonl=htonl,exports.toHex32=toHex32,exports.zero2=zero2,exports.zero8=zero8,exports.join32=join32,exports.split32=split32,exports.rotr32=rotr32,exports.rotl32=rotl32,exports.sum32=sum32,exports.sum32_3=sum32_3,exports.sum32_4=sum32_4,exports.sum32_5=sum32_5,exports.sum64=sum64,exports.sum64_hi=sum64_hi,exports.sum64_lo=sum64_lo,exports.sum64_4_hi=sum64_4_hi,exports.sum64_4_lo=sum64_4_lo,exports.sum64_5_hi=sum64_5_hi,exports.sum64_5_lo=sum64_5_lo,exports.rotr64_hi=rotr64_hi,exports.rotr64_lo=rotr64_lo,exports.shr64_hi=shr64_hi,exports.shr64_lo=shr64_lo},function(module,exports,__webpack_require__){"use strict";exports.Connection=__webpack_require__(390)},function(module,exports){function noop(){}module.exports=noop},function(module,exports){function pullPushable(separated,onClose){function read(_abort,_cb){_abort&&(abort=_abort,cb&&callback(abort)),cb=_cb,drain()}function end(end){ended=ended||end||!0,drain()}function push(data){if(!ended){if(cb)return void callback(abort,data);buffer.push(data),drain()}}function drain(){cb&&(abort?callback(abort):!buffer.length&&ended?callback(ended):buffer.length&&callback(null,buffer.shift()))}function callback(err,val){var _cb=cb;if(err&&onClose){var c=onClose;onClose=null,c(err===!0?null:err)}cb=null,_cb(err,val)}"function"==typeof separated&&(onClose=separated,separated=!1);var abort,cb,ended,buffer=[];return separated?{push:push,end:end,source:read}:(read.push=push,read.end=end,read)}module.exports=pullPushable},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function series(tasks,callback){(0,_parallel2.default)(_eachOfSeries2.default,tasks,callback)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=series;var _parallel=__webpack_require__(163),_parallel2=_interopRequireDefault(_parallel),_eachOfSeries=__webpack_require__(159),_eachOfSeries2=_interopRequireDefault(_eachOfSeries);module.exports=exports.default},function(module,exports,__webpack_require__){(function(Buffer){var schema=__webpack_require__(605),compile=__webpack_require__(609),flatten=function(values){if(!values)return null;var result={};return Object.keys(values).forEach(function(k){result[k]=values[k].value}),result};module.exports=function(proto,opts){if(opts||(opts={}),!proto)throw new Error("Pass in a .proto string or a protobuf-schema parsed object");var sch="object"!=typeof proto||Buffer.isBuffer(proto)?schema.parse(proto):proto,Messages=function(){var self=this;compile(sch,opts.encodings||{}).forEach(function(m){self[m.name]=flatten(m.values)||m})};return Messages.prototype.toString=function(){return schema.stringify(sch)},Messages.prototype.toJSON=function(){return sch},new Messages}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(global,process){function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(ctx.depth=arguments[2]),arguments.length>=4&&(ctx.colors=arguments[3]),isBoolean(opts)?ctx.showHidden=opts:opts&&exports._extend(ctx,opts),isUndefined(ctx.showHidden)&&(ctx.showHidden=!1),isUndefined(ctx.depth)&&(ctx.depth=2),isUndefined(ctx.colors)&&(ctx.colors=!1),isUndefined(ctx.customInspect)&&(ctx.customInspect=!0),ctx.colors&&(ctx.stylize=stylizeWithColor),formatValue(ctx,obj,ctx.depth)}function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];return style?"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m":str}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};return array.forEach(function(val,idx){hash[val]=!0}),hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&(!value.constructor||value.constructor.prototype!==value)){var ret=value.inspect(recurseTimes,ctx);return isString(ret)||(ret=formatValue(ctx,ret,recurseTimes)),ret}var primitive=formatPrimitive(ctx,value);if(primitive)return primitive;var keys=Object.keys(value),visibleKeys=arrayToHash(keys);if(ctx.showHidden&&(keys=Object.getOwnPropertyNames(value)),isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0))return formatError(value);if(0===keys.length){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value))return ctx.stylize(RegExp.prototype.toString.call(value),"regexp");if(isDate(value))return ctx.stylize(Date.prototype.toString.call(value),"date");if(isError(value))return formatError(value)}var base="",array=!1,braces=["{","}"];if(isArray(value)&&(array=!0,braces=["[","]"]),isFunction(value)){base=" [Function"+(value.name?": "+value.name:"")+"]"}if(isRegExp(value)&&(base=" "+RegExp.prototype.toString.call(value)),isDate(value)&&(base=" "+Date.prototype.toUTCString.call(value)),isError(value)&&(base=" "+formatError(value)),0===keys.length&&(!array||0==value.length))return braces[0]+base+braces[1];if(recurseTimes<0)return isRegExp(value)?ctx.stylize(RegExp.prototype.toString.call(value),"regexp"):ctx.stylize("[Object]","special");ctx.seen.push(value);var output;return output=array?formatArray(ctx,value,recurseTimes,visibleKeys,keys):keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)}),ctx.seen.pop(),reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}return isNumber(value)?ctx.stylize(""+value,"number"):isBoolean(value)?ctx.stylize(""+value,"boolean"):isNull(value)?ctx.stylize("null","null"):void 0}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){for(var output=[],i=0,l=value.length;i-1&&(str=array?str.split("\n").map(function(line){return" "+line}).join("\n").substr(2):"\n"+str.split("\n").map(function(line){return" "+line}).join("\n"))):str=ctx.stylize("[Circular]","special")),isUndefined(name)){if(array&&key.match(/^\d+$/))return str;name=JSON.stringify(""+key),name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(name=name.substr(1,name.length-2),name=ctx.stylize(name,"name")):(name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),name=ctx.stylize(name,"string"))}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;return output.reduce(function(prev,cur){return numLinesEst++,cur.indexOf("\n")>=0&&numLinesEst++,prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?braces[0]+(""===base?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]:braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}function isBoolean(arg){return"boolean"==typeof arg}function isNull(arg){return null===arg}function isNullOrUndefined(arg){return null==arg}function isNumber(arg){return"number"==typeof arg}function isString(arg){return"string"==typeof arg}function isSymbol(arg){return"symbol"==typeof arg}function isUndefined(arg){return void 0===arg}function isRegExp(re){return isObject(re)&&"[object RegExp]"===objectToString(re)}function isObject(arg){return"object"==typeof arg&&null!==arg}function isDate(d){return isObject(d)&&"[object Date]"===objectToString(d)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(arg){return"function"==typeof arg}function isPrimitive(arg){return null===arg||"boolean"==typeof arg||"number"==typeof arg||"string"==typeof arg||"symbol"==typeof arg||void 0===arg}function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}function timestamp(){var d=new Date,time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}exports.format=function(f){if(!isString(f)){for(var objects=[],i=0;i=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}}),x=args[i];i{if("function"==typeof id)return callback=id,id=null,void Id.create((err,id)=>{if(err)return callback(err);callback(null,new PeerInfo(id))});callback(null,new PeerInfo(id))}),PeerInfo.isPeerInfo=(peerInfo=>{return Boolean("object"==typeof peerInfo&&peerInfo.id&&peerInfo.multiaddrs)}),module.exports=PeerInfo},function(module,exports,__webpack_require__){exports=module.exports=__webpack_require__(266),exports.Stream=exports,exports.Readable=exports,exports.Writable=__webpack_require__(148),exports.Duplex=__webpack_require__(45),exports.Transform=__webpack_require__(267),exports.PassThrough=__webpack_require__(656)},function(module,exports,__webpack_require__){function Timeout(id,clearFn){this._id=id,this._clearFn=clearFn}var apply=Function.prototype.apply;exports.setTimeout=function(){return new Timeout(apply.call(setTimeout,window,arguments),clearTimeout)},exports.setInterval=function(){return new Timeout(apply.call(setInterval,window,arguments),clearInterval)},exports.clearTimeout=exports.clearInterval=function(timeout){timeout&&timeout.close()},Timeout.prototype.unref=Timeout.prototype.ref=function(){},Timeout.prototype.close=function(){this._clearFn.call(window,this._id)},exports.enroll=function(item,msecs){clearTimeout(item._idleTimeoutId),item._idleTimeout=msecs},exports.unenroll=function(item){clearTimeout(item._idleTimeoutId),item._idleTimeout=-1},exports._unrefActive=exports.active=function(item){clearTimeout(item._idleTimeoutId);var msecs=item._idleTimeout;msecs>=0&&(item._idleTimeoutId=setTimeout(function(){item._onTimeout&&item._onTimeout()},msecs))},__webpack_require__(670),exports.setImmediate=setImmediate,exports.clearImmediate=clearImmediate},function(module,exports){function extend(){for(var target={},i=0;i{this.blockSizes.push(size)}),this.removeBlockSize=(index=>{this.blockSizes.splice(index,1)}),this.fileSize=(()=>{if(!(dirTypes.indexOf(this.type)>=0)){let sum=0;return this.blockSizes.forEach(size=>{sum+=size}),data&&(sum+=data.length),sum}}),this.marshal=(()=>{let type;switch(this.type){case"raw":type=unixfsData.DataType.Raw;break;case"directory":type=unixfsData.DataType.Directory;break;case"file":type=unixfsData.DataType.File;break;case"metadata":type=unixfsData.DataType.Metadata;break;case"symlink":type=unixfsData.DataType.Symlink;break;case"hamt-sharded-directory":type=unixfsData.DataType.HAMTShard;break;default:throw new Error(`Unkown type: "${this.type}"`)}let fileSize=this.fileSize();return fileSize||(fileSize=void 0),unixfsData.encode({Type:type,Data:this.data,filesize:fileSize,blocksizes:this.blockSizes.length>0?this.blockSizes:void 0,hashType:this.hashType,fanout:this.fanout})})}const protobuf=__webpack_require__(33),pb=protobuf(__webpack_require__(439)),unixfsData=pb.Data,types=["raw","directory","file","metadata","symlink","hamt-sharded-directory"],dirTypes=["directory","hamt-sharded-directory"];Data.unmarshal=(marsheled=>{const decoded=unixfsData.decode(marsheled);decoded.Data||(decoded.Data=void 0);const obj=new Data(types[decoded.Type],decoded.Data);return obj.blockSizes=decoded.blocksizes,obj}),module.exports=Data},function(module,exports,__webpack_require__){"use strict";module.exports={ethAccountSnapshot:__webpack_require__(204),ethBlock:__webpack_require__(205),ethBlockList:__webpack_require__(448),ethStateTrie:__webpack_require__(449),ethStorageTrie:__webpack_require__(450),ethTx:__webpack_require__(206),ethTxTrie:__webpack_require__(451)}},function(module,exports,__webpack_require__){(function(process){function normalizeArray(parts,allowAboveRoot){for(var up=0,i=parts.length-1;i>=0;i--){var last=parts[i];"."===last?parts.splice(i,1):".."===last?(parts.splice(i,1),up++):up&&(parts.splice(i,1),up--)}if(allowAboveRoot)for(;up--;up)parts.unshift("..");return parts}function filter(xs,f){if(xs.filter)return xs.filter(f);for(var res=[],i=0;i=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if("string"!=typeof path)throw new TypeError("Arguments to path.resolve must be strings");path&&(resolvedPath=path+"/"+resolvedPath,resolvedAbsolute="/"===path.charAt(0))}return resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/"),(resolvedAbsolute?"/":"")+resolvedPath||"."},exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash="/"===substr(path,-1);return path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/"),path||isAbsolute||(path="."),path&&trailingSlash&&(path+="/"),(isAbsolute?"/":"")+path},exports.isAbsolute=function(path){return"/"===path.charAt(0)},exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if("string"!=typeof p)throw new TypeError("Arguments to path.join must be strings");return p}).join("/"))},exports.relative=function(from,to){function trim(arr){for(var start=0;start=0&&""===arr[end];end--);return start>end?[]:arr.slice(start,end-start+1)}from=exports.resolve(from).substr(1),to=exports.resolve(to).substr(1);for(var fromParts=trim(from.split("/")),toParts=trim(to.split("/")),length=Math.min(fromParts.length,toParts.length),samePartsLength=length,i=0;iinput.length)throw new Error("invalid rlp: total length is larger than the data");if(innerRemainder=input.slice(llength,totalLength),0===innerRemainder.length)throw new Error("invalid rlp, List has a invalid length");for(;innerRemainder.length;)d=_decode(innerRemainder),decoded.push(d.data),innerRemainder=d.remainder;return{data:decoded,remainder:input.slice(totalLength)}}function isHexPrefixed(str){return"0x"===str.slice(0,2)}function stripHexPrefix(str){return"string"!=typeof str?str:isHexPrefixed(str)?str.slice(2):str}function intToHex(i){var hex=i.toString(16);return hex.length%2&&(hex="0"+hex),hex}function padToEven(a){return a.length%2&&(a="0"+a),a}function intToBuffer(i){return new Buffer(intToHex(i),"hex")}function toBuffer(v){if(!Buffer.isBuffer(v))if("string"==typeof v)v=isHexPrefixed(v)?new Buffer(padToEven(stripHexPrefix(v)),"hex"):new Buffer(v);else if("number"==typeof v)v=v?intToBuffer(v):new Buffer([]);else if(null===v||void 0===v)v=new Buffer([]);else{if(!v.toArray)throw new Error("invalid type");v=new Buffer(v.toArray())}return v}const assert=__webpack_require__(9);exports.encode=function(input){if(input instanceof Array){for(var output=[],i=0;i1?{type:packetslist[type],data:data.substring(1)}:{type:packetslist[type]}:err}var asArray=new Uint8Array(data),type=asArray[0],rest=sliceBuffer(data,1);return Blob&&"blob"===binaryType&&(rest=new Blob([rest])),{type:packetslist[type],data:rest}},exports.decodeBase64Packet=function(msg,binaryType){var type=packetslist[msg.charAt(0)];if(!base64encoder)return{type:type,data:{base64:!0,data:msg.substr(1)}};var data=base64encoder.decode(msg.substr(1));return"blob"===binaryType&&Blob&&(data=new Blob([data])),{type:type,data:data}},exports.encodePayload=function(packets,supportsBinary,callback){function setLengthHeader(message){return message.length+":"+message}function encodeOne(packet,doneCallback){exports.encodePacket(packet,!!isBinary&&supportsBinary,!1,function(message){doneCallback(null,setLengthHeader(message))})}"function"==typeof supportsBinary&&(callback=supportsBinary,supportsBinary=null);var isBinary=hasBinary(packets);return supportsBinary&&isBinary?Blob&&!dontSendBlobs?exports.encodePayloadAsBlob(packets,callback):exports.encodePayloadAsArrayBuffer(packets,callback):packets.length?void map(packets,encodeOne,function(err,results){return callback(results.join(""))}):callback("0:")},exports.decodePayload=function(data,binaryType,callback){if("string"!=typeof data)return exports.decodePayloadAsBinary(data,binaryType,callback);"function"==typeof binaryType&&(callback=binaryType,binaryType=null);var packet;if(""===data)return callback(err,0,1);for(var n,msg,length="",i=0,l=data.length;i0;){for(var tailArray=new Uint8Array(bufferTail),isString=0===tailArray[0],msgLength="",i=1;255!==tailArray[i];i++){if(msgLength.length>310)return callback(err,0,1);msgLength+=tailArray[i]}bufferTail=sliceBuffer(bufferTail,2+msgLength.length),msgLength=parseInt(msgLength);var msg=sliceBuffer(bufferTail,0,msgLength);if(isString)try{msg=String.fromCharCode.apply(null,new Uint8Array(msg))}catch(e){var typed=new Uint8Array(msg);msg="";for(var i=0;i{const name=["bitswap"];subsystem&&name.push(subsystem),id&&name.push(`${id.toB58String().slice(0,8)}`);const logger=debug(name.join(":"));return logger.error=debug(name.concat(["error"]).join(":")),logger})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(11),assert=__webpack_require__(9);class DAGLink{constructor(name,size,multihash){assert(multihash,"A link requires a multihash to point to"),assert(size,"A link requires a size"),this._name=name,this._size=size,"string"==typeof multihash?this._multihash=mh.fromB58String(multihash):Buffer.isBuffer(multihash)&&(this._multihash=multihash)}toString(){return`DAGLink <${mh.toB58String(this.multihash)} - name: "${this.name}", size: ${this.size}>`}toJSON(){return{name:this.name,size:this.size,multihash:mh.toB58String(this._multihash)}}get name(){return this._name}set name(name){throw new Error("Can't set property: 'name' is immutable")}get size(){return this._size}set size(size){throw new Error("Can't set property: 'size' is immutable")}get multihash(){return this._multihash}set multihash(multihash){throw new Error("Can't set property: 'multihash' is immutable")}}exports=module.exports=DAGLink,exports.create=__webpack_require__(442)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.DAGNode=__webpack_require__(123),exports.DAGLink=__webpack_require__(53),exports.resolver=__webpack_require__(447),exports.util=__webpack_require__(124)},function(module,exports,__webpack_require__){"use strict";function cidFromHash(codec,hashBuffer){return new CID(1,codec,multihashes.encode(hashBuffer,"keccak-256"))}const CID=__webpack_require__(8),multihashes=__webpack_require__(11);module.exports=cidFromHash},function(module,exports,__webpack_require__){(function(process){function Duplex(options){if(!(this instanceof Duplex))return new Duplex(options);Readable.call(this,options),Writable.call(this,options),options&&options.readable===!1&&(this.readable=!1),options&&options.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,options&&options.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",onend)}function onend(){this.allowHalfOpen||this._writableState.ended||process.nextTick(this.end.bind(this))}module.exports=Duplex;var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)keys.push(key);return keys},util=__webpack_require__(27);util.inherits=__webpack_require__(2);var Readable=__webpack_require__(217),Writable=__webpack_require__(219);util.inherits(Duplex,Readable),function(xs,f){for(var i=0,l=xs.length;i=8*this._finalSize&&(this._update(this._block),this._block.fill(0)),this._block.writeInt32BE(l,this._blockSize-4);var hash=this._update(this._block)||this._hash();return enc?hash.toString(enc):hash},Hash.prototype._update=function(){throw new Error("_update must be implemented by subclass")},module.exports=Hash}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){var base=exports;base.Reporter=__webpack_require__(288).Reporter,base.DecoderBuffer=__webpack_require__(154).DecoderBuffer,base.EncoderBuffer=__webpack_require__(154).EncoderBuffer,base.Node=__webpack_require__(287)},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0});var _doParallel=__webpack_require__(75),_doParallel2=_interopRequireDefault(_doParallel),_map=__webpack_require__(302),_map2=_interopRequireDefault(_map);exports.default=(0,_doParallel2.default)(_map2.default),module.exports=exports.default},function(module,exports,__webpack_require__){(function(Buffer){module.exports=function(a,b){for(var length=Math.min(a.length,b.length),buffer=new Buffer(length),i=0;i=this._delta8){msg=this.pending;var r=msg.length%this._delta8;this.pending=msg.slice(msg.length-r,msg.length),0===this.pending.length&&(this.pending=null),msg=utils.join32(msg,0,msg.length-r,this.endian);for(var i=0;i>>24&255,res[i++]=len>>>16&255,res[i++]=len>>>8&255,res[i++]=255&len}else for(res[i++]=255&len,res[i++]=len>>>8&255,res[i++]=len>>>16&255,res[i++]=len>>>24&255,res[i++]=0,res[i++]=0,res[i++]=0,res[i++]=0,t=8;tutil.deserialize(ipfsBlock.data,cb),(ethObj,cb)=>treeFromEthObject(ethObj,options,cb)],callback)}function treeFromEthObject(ethObj,options,callback){waterfall([cb=>mapFromEthObject(ethObj,options,cb),(tuples,cb)=>cb(null,tuples.map(tuple=>tuple.path))],callback)}function resolve(ipfsBlock,path,callback){waterfall([cb=>util.deserialize(ipfsBlock.data,cb),(ethObj,cb)=>resolveFromEthObject(ethObj,path,cb)],callback)}function resolveFromEthObject(ethObj,path,callback){if(!path||"/"===path){const result={value:ethObj,remainderPath:""};return callback(null,result)}mapFromEthObject(ethObj,{},(err,paths)=>{if(err)return callback(err);const pathParts=path.split("/");let matches=paths.filter(child=>child.path===path.slice(0,child.path.length));matches=matches.filter(child=>child.path.split("/").every((part,index)=>part===pathParts[index]));const sortedMatches=matches.sort((a,b)=>a.path.length=this.charLength-this.charReceived?this.charLength-this.charReceived:buffer.length;if(buffer.copy(this.charBuffer,this.charReceived,0,available),this.charReceived+=available,this.charReceived=55296&&charCode<=56319)){if(this.charReceived=this.charLength=0,0===buffer.length)return charStr;break}this.charLength+=this.surrogateSize,charStr=""}this.detectIncompleteChar(buffer);var end=buffer.length;this.charLength&&(buffer.copy(this.charBuffer,0,buffer.length-this.charReceived,end),end-=this.charReceived),charStr+=buffer.toString(this.encoding,0,end);var end=charStr.length-1,charCode=charStr.charCodeAt(end);if(charCode>=55296&&charCode<=56319){var size=this.surrogateSize;return this.charLength+=size,this.charReceived+=size,this.charBuffer.copy(this.charBuffer,size,0,size),buffer.copy(this.charBuffer,0,0,size),charStr.substring(0,end)}return charStr},StringDecoder.prototype.detectIncompleteChar=function(buffer){for(var i=buffer.length>=3?3:buffer.length;i>0;i--){var c=buffer[buffer.length-i];if(1==i&&c>>5==6){this.charLength=2;break}if(i<=2&&c>>4==14){this.charLength=3;break}if(i<=3&&c>>3==30){this.charLength=4;break}}this.charReceived=i},StringDecoder.prototype.end=function(buffer){var res="";if(buffer&&buffer.length&&(res=this.write(buffer)),this.charReceived){var cr=this.charReceived,buf=this.charBuffer,enc=this.encoding;res+=buf.slice(0,cr).toString(enc)}return res}},function(module,exports,__webpack_require__){"use strict";module.exports=function(op,done){function sink(_read){if(read=_read,abort)return sink.abort();!function next(){for(var loop=!0,cbed=!1;loop;)if(cbed=!1,read(null,function(end,data){if(cbed=!0,end=end||abort){if(loop=!1,done)done(end===!0?null:end);else if(end&&end!==!0)throw end}else op&&!1===op(data)||abort?(loop=!1,read(abort||!0,done||function(){})):loop||next()}),!cbed)return void(loop=!1)}()}var read,abort;return sink.abort=function(err,cb){if("function"==typeof err&&(cb=err,err=!0),abort=err||!0,read)return read(abort,cb||function(){})},sink}},function(module,exports){module.exports=function(key){return key&&("string"==typeof key?function(data){return data[key]}:"object"==typeof key&&"function"==typeof key.exec?function(data){var v=key.exec(data);return v&&v[0]}:key)}},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function asyncify(func){return(0,_initialParams2.default)(function(args,callback){var result;try{result=func.apply(this,args)}catch(e){return callback(e)}(0,_isObject2.default)(result)&&"function"==typeof result.then?result.then(function(value){invokeCallback(callback,null,value)},function(err){invokeCallback(callback,err.message?err:new Error(err))}):callback(null,result)})}function invokeCallback(callback,error,value){try{callback(error,value)}catch(e){(0,_setImmediate2.default)(rethrow,e)}}function rethrow(error){throw error}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=asyncify;var _isObject=__webpack_require__(241),_isObject2=_interopRequireDefault(_isObject),_initialParams=__webpack_require__(162),_initialParams2=_interopRequireDefault(_initialParams),_setImmediate=__webpack_require__(110),_setImmediate2=_interopRequireDefault(_setImmediate);module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0});var _eachLimit=__webpack_require__(296),_eachLimit2=_interopRequireDefault(_eachLimit),_doLimit=__webpack_require__(108),_doLimit2=_interopRequireDefault(_doLimit);exports.default=(0,_doLimit2.default)(_eachLimit2.default,1),module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function doParallel(fn){return function(obj,iteratee,callback){return fn(_eachOf2.default,obj,(0,_wrapAsync2.default)(iteratee),callback)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=doParallel;var _eachOf=__webpack_require__(106),_eachOf2=_interopRequireDefault(_eachOf),_wrapAsync=__webpack_require__(12),_wrapAsync2=_interopRequireDefault(_wrapAsync);module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function whilst(test,iteratee,callback){callback=(0,_onlyOnce2.default)(callback||_noop2.default);var _iteratee=(0,_wrapAsync2.default)(iteratee);if(!test())return callback(null);var next=function(err){if(err)return callback(err);if(test())return _iteratee(next);var args=(0,_slice2.default)(arguments,1);callback.apply(null,[null].concat(args))};_iteratee(next)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=whilst;var _noop=__webpack_require__(30),_noop2=_interopRequireDefault(_noop),_slice=__webpack_require__(49),_slice2=_interopRequireDefault(_slice),_onlyOnce=__webpack_require__(48),_onlyOnce2=_interopRequireDefault(_onlyOnce),_wrapAsync=__webpack_require__(12),_wrapAsync2=_interopRequireDefault(_wrapAsync);module.exports=exports.default},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_RESULT__;!function(globalObj){"use strict";function constructorFactory(configObj){function BigNumber(n,b){var c,e,i,num,len,str,x=this;if(!(x instanceof BigNumber))return ERRORS&&raise(26,"constructor call without new",n),new BigNumber(n,b);if(null!=b&&isValidInt(b,2,64,id,"base")){if(b|=0,str=n+"",10==b)return x=new BigNumber(n instanceof BigNumber?n:str),round(x,DECIMAL_PLACES+x.e+1,ROUNDING_MODE);if((num="number"==typeof n)&&0*n!=0||!new RegExp("^-?"+(c="["+ALPHABET.slice(0,b)+"]+")+"(?:\\."+c+")?$",b<37?"i":"").test(str))return parseNumeric(x,str,num,b);num?(x.s=1/n<0?(str=str.slice(1),-1):1,ERRORS&&str.replace(/^0\.0*|\./,"").length>15&&raise(id,tooManyDigits,n),num=!1):x.s=45===str.charCodeAt(0)?(str=str.slice(1),-1):1,str=convertBase(str,10,b,x.s)}else{if(n instanceof BigNumber)return x.s=n.s,x.e=n.e,x.c=(n=n.c)?n.slice():n,void(id=0);if((num="number"==typeof n)&&0*n==0){if(x.s=1/n<0?(n=-n,-1):1,n===~~n){for(e=0,i=n;i>=10;i/=10,e++);return x.e=e,x.c=[n],void(id=0)}str=n+""}else{if(!isNumeric.test(str=n+""))return parseNumeric(x,str,num);x.s=45===str.charCodeAt(0)?(str=str.slice(1),-1):1}}for((e=str.indexOf("."))>-1&&(str=str.replace(".","")),(i=str.search(/e/i))>0?(e<0&&(e=i),e+=+str.slice(i+1),str=str.substring(0,i)):e<0&&(e=str.length),i=0;48===str.charCodeAt(i);i++);for(len=str.length;48===str.charCodeAt(--len););if(str=str.slice(i,len+1))if(len=str.length,num&&ERRORS&&len>15&&(n>MAX_SAFE_INTEGER||n!==mathfloor(n))&&raise(id,tooManyDigits,x.s*n),(e=e-i-1)>MAX_EXP)x.c=x.e=null;else if(e=0&&(k=POW_PRECISION,POW_PRECISION=0,str=str.replace(".",""),y=new BigNumber(baseIn),x=y.pow(str.length-i),POW_PRECISION=k,y.c=toBaseOut(toFixedPoint(coeffToString(x.c),x.e),10,baseOut),y.e=y.c.length),xc=toBaseOut(str,baseIn,baseOut),e=k=xc.length;0==xc[--k];xc.pop());if(!xc[0])return"0";if(i<0?--e:(x.c=xc,x.e=e,x.s=sign,x=div(x,y,dp,rm,baseOut),xc=x.c,r=x.r,e=x.e),d=e+dp+1,i=xc[d],k=baseOut/2,r=r||d<0||null!=xc[d+1],r=rm<4?(null!=i||r)&&(0==rm||rm==(x.s<0?3:2)):i>k||i==k&&(4==rm||r||6==rm&&1&xc[d-1]||rm==(x.s<0?8:7)),d<1||!xc[0])str=r?toFixedPoint("1",-dp):"0";else{if(xc.length=d,r)for(--baseOut;++xc[--d]>baseOut;)xc[d]=0,d||(++e,xc.unshift(1));for(k=xc.length;!xc[--k];);for(i=0,str="";i<=k;str+=ALPHABET.charAt(xc[i++]));str=toFixedPoint(str,e)}return str}function format(n,i,rm,caller){var c0,e,ne,len,str;if(rm=null!=rm&&isValidInt(rm,0,8,caller,roundingMode)?0|rm:ROUNDING_MODE,!n.c)return n.toString();if(c0=n.c[0],ne=n.e,null==i)str=coeffToString(n.c),str=19==caller||24==caller&&ne<=TO_EXP_NEG?toExponential(str,ne):toFixedPoint(str,ne);else if(n=round(new BigNumber(n),i,rm),e=n.e,str=coeffToString(n.c),len=str.length,19==caller||24==caller&&(i<=e||e<=TO_EXP_NEG)){for(;lenlen){if(--i>0)for(str+=".";i--;str+="0");}else if((i+=e-len)>0)for(e+1==len&&(str+=".");i--;str+="0");return n.s<0&&c0?"-"+str:str}function maxOrMin(args,method){var m,n,i=0;for(isArray(args[0])&&(args=args[0]),m=new BigNumber(args[0]);++imax||n!=truncate(n))&&raise(caller,(name||"decimal places")+(nmax?" out of range":" not an integer"),n),!0}function normalise(n,c,e){for(var i=1,j=c.length;!c[--j];c.pop());for(j=c[0];j>=10;j/=10,i++); +return(e=i+e*LOG_BASE-1)>MAX_EXP?n.c=n.e=null:e=10;k/=10,d++);if((i=sd-d)<0)i+=LOG_BASE,j=sd,n=xc[ni=0],rd=n/pows10[d-j-1]%10|0;else if((ni=mathceil((i+1)/LOG_BASE))>=xc.length){if(!r)break out;for(;xc.length<=ni;xc.push(0));n=rd=0,d=1,i%=LOG_BASE,j=i-LOG_BASE+1}else{for(n=k=xc[ni],d=1;k>=10;k/=10,d++);i%=LOG_BASE,j=i-LOG_BASE+d,rd=j<0?0:n/pows10[d-j-1]%10|0}if(r=r||sd<0||null!=xc[ni+1]||(j<0?n:n%pows10[d-j-1]),r=rm<4?(rd||r)&&(0==rm||rm==(x.s<0?3:2)):rd>5||5==rd&&(4==rm||r||6==rm&&(i>0?j>0?n/pows10[d-j]:0:xc[ni-1])%10&1||rm==(x.s<0?8:7)),sd<1||!xc[0])return xc.length=0,r?(sd-=x.e+1,xc[0]=pows10[(LOG_BASE-sd%LOG_BASE)%LOG_BASE],x.e=-sd||0):xc[0]=x.e=0,x;if(0==i?(xc.length=ni,k=1,ni--):(xc.length=ni+1,k=pows10[LOG_BASE-i],xc[ni]=j>0?mathfloor(n/pows10[d-j]%pows10[j])*k:0),r)for(;;){if(0==ni){for(i=1,j=xc[0];j>=10;j/=10,i++);for(j=xc[0]+=k,k=1;j>=10;j/=10,k++);i!=k&&(x.e++,xc[0]==BASE&&(xc[0]=1));break}if(xc[ni]+=k,xc[ni]!=BASE)break;xc[ni--]=0,k=1}for(i=xc.length;0===xc[--i];xc.pop());}x.e>MAX_EXP?x.c=x.e=null:x.ei)return null!=(v=a[i++])};return has(p="DECIMAL_PLACES")&&isValidInt(v,0,MAX,2,p)&&(DECIMAL_PLACES=0|v),r[p]=DECIMAL_PLACES,has(p="ROUNDING_MODE")&&isValidInt(v,0,8,2,p)&&(ROUNDING_MODE=0|v),r[p]=ROUNDING_MODE,has(p="EXPONENTIAL_AT")&&(isArray(v)?isValidInt(v[0],-MAX,0,2,p)&&isValidInt(v[1],0,MAX,2,p)&&(TO_EXP_NEG=0|v[0],TO_EXP_POS=0|v[1]):isValidInt(v,-MAX,MAX,2,p)&&(TO_EXP_NEG=-(TO_EXP_POS=0|(v<0?-v:v)))),r[p]=[TO_EXP_NEG,TO_EXP_POS],has(p="RANGE")&&(isArray(v)?isValidInt(v[0],-MAX,-1,2,p)&&isValidInt(v[1],1,MAX,2,p)&&(MIN_EXP=0|v[0],MAX_EXP=0|v[1]):isValidInt(v,-MAX,MAX,2,p)&&(0|v?MIN_EXP=-(MAX_EXP=0|(v<0?-v:v)):ERRORS&&raise(2,p+" cannot be zero",v))),r[p]=[MIN_EXP,MAX_EXP],has(p="ERRORS")&&(v===!!v||1===v||0===v?(id=0,isValidInt=(ERRORS=!!v)?intValidatorWithErrors:intValidatorNoErrors):ERRORS&&raise(2,p+notBool,v)),r[p]=ERRORS,has(p="CRYPTO")&&(v===!0||v===!1||1===v||0===v?v?(v="undefined"==typeof crypto,!v&&crypto&&(crypto.getRandomValues||crypto.randomBytes)?CRYPTO=!0:ERRORS?raise(2,"crypto unavailable",v?void 0:crypto):CRYPTO=!1):CRYPTO=!1:ERRORS&&raise(2,p+notBool,v)),r[p]=CRYPTO,has(p="MODULO_MODE")&&isValidInt(v,0,9,2,p)&&(MODULO_MODE=0|v),r[p]=MODULO_MODE,has(p="POW_PRECISION")&&isValidInt(v,0,MAX,2,p)&&(POW_PRECISION=0|v),r[p]=POW_PRECISION,has(p="FORMAT")&&("object"==typeof v?FORMAT=v:ERRORS&&raise(2,p+" not an object",v)),r[p]=FORMAT,r},BigNumber.max=function(){return maxOrMin(arguments,P.lt)},BigNumber.min=function(){return maxOrMin(arguments,P.gt)},BigNumber.random=function(){var random53bitInt=9007199254740992*Math.random()&2097151?function(){return mathfloor(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(dp){var a,b,e,k,v,i=0,c=[],rand=new BigNumber(ONE);if(dp=null!=dp&&isValidInt(dp,0,MAX,14)?0|dp:DECIMAL_PLACES,k=mathceil(dp/LOG_BASE),CRYPTO)if(crypto.getRandomValues){for(a=crypto.getRandomValues(new Uint32Array(k*=2));i>>11),v>=9e15?(b=crypto.getRandomValues(new Uint32Array(2)),a[i]=b[0],a[i+1]=b[1]):(c.push(v%1e14),i+=2);i=k/2}else if(crypto.randomBytes){for(a=crypto.randomBytes(k*=7);i=9e15?crypto.randomBytes(7).copy(a,i):(c.push(v%1e14),i+=7);i=k/7}else CRYPTO=!1,ERRORS&&raise(14,"crypto unavailable",crypto);if(!CRYPTO)for(;i=10;v/=10,i++);ibL?1:-1;else for(i=cmp=0;ib[i]?1:-1;break}return cmp}function subtract(a,b,aL,base){for(var i=0;aL--;)a[aL]-=i,i=a[aL]1;a.shift());}return function(x,y,dp,rm,base){var cmp,e,i,more,n,prod,prodL,q,qc,rem,remL,rem0,xi,xL,yc0,yL,yz,s=x.s==y.s?1:-1,xc=x.c,yc=y.c;if(!(xc&&xc[0]&&yc&&yc[0]))return new BigNumber(x.s&&y.s&&(xc?!yc||xc[0]!=yc[0]:yc)?xc&&0==xc[0]||!yc?0*s:s/0:NaN);for(q=new BigNumber(s),qc=q.c=[],e=x.e-y.e,s=dp+e+1,base||(base=BASE,e=bitFloor(x.e/LOG_BASE)-bitFloor(y.e/LOG_BASE),s=s/LOG_BASE|0),i=0;yc[i]==(xc[i]||0);i++);if(yc[i]>(xc[i]||0)&&e--,s<0)qc.push(1),more=!0;else{for(xL=xc.length,yL=yc.length,i=0,s+=2,n=mathfloor(base/(yc[0]+1)),n>1&&(yc=multiply(yc,n,base),xc=multiply(xc,n,base),yL=yc.length,xL=xc.length),xi=yL,rem=xc.slice(0,yL),remL=rem.length;remL=base/2&&yc0++;do{if(n=0,(cmp=compare(yc,rem,yL,remL))<0){if(rem0=rem[0],yL!=remL&&(rem0=rem0*base+(rem[1]||0)),(n=mathfloor(rem0/yc0))>1)for(n>=base&&(n=base-1),prod=multiply(yc,n,base),prodL=prod.length,remL=rem.length;1==compare(prod,rem,prodL,remL);)n--,subtract(prod,yL=10;s/=10,i++);round(q,dp+(q.e=i+e*LOG_BASE-1)+1,rm,more)}else q.e=e,q.r=+more;return q}}(),parseNumeric=function(){var isInfinityOrNaN=/^-?(Infinity|NaN)$/;return function(x,str,num,b){var base,s=num?str:str.replace(/^\s*\+(?=[\w.])|^\s+|\s+$/g,"");if(isInfinityOrNaN.test(s))x.s=isNaN(s)?null:s<0?-1:1;else{if(!num&&(s=s.replace(/^(-?)0([xbo])(?=\w[\w.]*$)/i,function(m,p1,p2){return base="x"==(p2=p2.toLowerCase())?16:"b"==p2?2:8,b&&b!=base?m:p1}),b&&(base=b,s=s.replace(/^([^.]+)\.$/,"$1").replace(/^\.([^.]+)$/,"0.$1")),str!=s))return new BigNumber(s,base);ERRORS&&raise(id,"not a"+(b?" base "+b:"")+" number",str),x.s=null}x.c=x.e=null,id=0}}(),P.absoluteValue=P.abs=function(){var x=new BigNumber(this);return x.s<0&&(x.s=1),x},P.ceil=function(){return round(new BigNumber(this),this.e+1,2)},P.comparedTo=P.cmp=function(y,b){return id=1,compare(this,new BigNumber(y,b))},P.decimalPlaces=P.dp=function(){var n,v,c=this.c;if(!c)return null;if(n=((v=c.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,v=c[v])for(;v%10==0;v/=10,n--);return n<0&&(n=0),n},P.dividedBy=P.div=function(y,b){return id=3,div(this,new BigNumber(y,b),DECIMAL_PLACES,ROUNDING_MODE)},P.dividedToIntegerBy=P.divToInt=function(y,b){return id=4,div(this,new BigNumber(y,b),0,1)},P.equals=P.eq=function(y,b){return id=5,0===compare(this,new BigNumber(y,b))},P.floor=function(){return round(new BigNumber(this),this.e+1,3)},P.greaterThan=P.gt=function(y,b){return id=6,compare(this,new BigNumber(y,b))>0},P.greaterThanOrEqualTo=P.gte=function(y,b){return id=7,1===(b=compare(this,new BigNumber(y,b)))||0===b},P.isFinite=function(){return!!this.c},P.isInteger=P.isInt=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},P.isNaN=function(){return!this.s},P.isNegative=P.isNeg=function(){return this.s<0},P.isZero=function(){return!!this.c&&0==this.c[0]},P.lessThan=P.lt=function(y,b){return id=8,compare(this,new BigNumber(y,b))<0},P.lessThanOrEqualTo=P.lte=function(y,b){return id=9,(b=compare(this,new BigNumber(y,b)))===-1||0===b},P.minus=P.sub=function(y,b){var i,j,t,xLTy,x=this,a=x.s;if(id=10,y=new BigNumber(y,b),b=y.s,!a||!b)return new BigNumber(NaN);if(a!=b)return y.s=-b,x.plus(y);var xe=x.e/LOG_BASE,ye=y.e/LOG_BASE,xc=x.c,yc=y.c;if(!xe||!ye){if(!xc||!yc)return xc?(y.s=-b,y):new BigNumber(yc?x:NaN);if(!xc[0]||!yc[0])return yc[0]?(y.s=-b,y):new BigNumber(xc[0]?x:3==ROUNDING_MODE?-0:0)}if(xe=bitFloor(xe),ye=bitFloor(ye),xc=xc.slice(),a=xe-ye){for((xLTy=a<0)?(a=-a,t=xc):(ye=xe,t=yc),t.reverse(),b=a;b--;t.push(0));t.reverse()}else for(j=(xLTy=(a=xc.length)<(b=yc.length))?a:b,a=b=0;b0)for(;b--;xc[i++]=0);for(b=BASE-1;j>a;){if(xc[--j]0?(ye=xe,t=yc):(a=-a,t=xc),t.reverse();a--;t.push(0));t.reverse()}for(a=xc.length,b=yc.length,a-b<0&&(t=yc,yc=xc,xc=t,b=a),a=0;b;)a=(xc[--b]=xc[b]+yc[b]+a)/BASE|0,xc[b]=BASE===xc[b]?0:xc[b]%BASE;return a&&(xc.unshift(a),++ye),normalise(y,xc,ye)},P.precision=P.sd=function(z){var n,v,x=this,c=x.c;if(null!=z&&z!==!!z&&1!==z&&0!==z&&(ERRORS&&raise(13,"argument"+notBool,z),z!=!!z&&(z=null)),!c)return null;if(v=c.length-1,n=v*LOG_BASE+1,v=c[v]){for(;v%10==0;v/=10,n--);for(v=c[0];v>=10;v/=10,n++);}return z&&x.e+1>n&&(n=x.e+1),n},P.round=function(dp,rm){var n=new BigNumber(this);return(null==dp||isValidInt(dp,0,MAX,15))&&round(n,~~dp+this.e+1,null!=rm&&isValidInt(rm,0,8,15,roundingMode)?0|rm:ROUNDING_MODE),n},P.shift=function(k){var n=this;return isValidInt(k,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER,16,"argument")?n.times("1e"+truncate(k)):new BigNumber(n.c&&n.c[0]&&(k<-MAX_SAFE_INTEGER||k>MAX_SAFE_INTEGER)?n.s*(k<0?0:1/0):n)},P.squareRoot=P.sqrt=function(){var m,n,r,rep,t,x=this,c=x.c,s=x.s,e=x.e,dp=DECIMAL_PLACES+4,half=new BigNumber("0.5");if(1!==s||!c||!c[0])return new BigNumber(!s||s<0&&(!c||c[0])?NaN:c?x:1/0);if(s=Math.sqrt(+x),0==s||s==1/0?(n=coeffToString(c),(n.length+e)%2==0&&(n+="0"),s=Math.sqrt(n),e=bitFloor((e+1)/2)-(e<0||e%2),s==1/0?n="1e"+e:(n=s.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),r=new BigNumber(n)):r=new BigNumber(s+""),r.c[0])for(e=r.e,s=e+dp,s<3&&(s=0);;)if(t=r,r=half.times(t.plus(div(x,t,dp,1))),coeffToString(t.c).slice(0,s)===(n=coeffToString(r.c)).slice(0,s)){if(r.e=0;){for(c=0,ylo=yc[i]%sqrtBase,yhi=yc[i]/sqrtBase|0,k=xcL,j=i+k;j>i;)xlo=xc[--k]%sqrtBase,xhi=xc[k]/sqrtBase|0,m=yhi*xlo+xhi*ylo,xlo=ylo*xlo+m%sqrtBase*sqrtBase+zc[j]+c,c=(xlo/base|0)+(m/sqrtBase|0)+yhi*xhi,zc[j--]=xlo%base;zc[j]=c}return c?++e:zc.shift(),normalise(y,zc,e)},P.toDigits=function(sd,rm){var n=new BigNumber(this);return sd=null!=sd&&isValidInt(sd,1,MAX,18,"precision")?0|sd:null,rm=null!=rm&&isValidInt(rm,0,8,18,roundingMode)?0|rm:ROUNDING_MODE,sd?round(n,sd,rm):n},P.toExponential=function(dp,rm){return format(this,null!=dp&&isValidInt(dp,0,MAX,19)?1+~~dp:null,rm,19)},P.toFixed=function(dp,rm){return format(this,null!=dp&&isValidInt(dp,0,MAX,20)?~~dp+this.e+1:null,rm,20)},P.toFormat=function(dp,rm){var str=format(this,null!=dp&&isValidInt(dp,0,MAX,21)?~~dp+this.e+1:null,rm,21);if(this.c){var i,arr=str.split("."),g1=+FORMAT.groupSize,g2=+FORMAT.secondaryGroupSize,groupSeparator=FORMAT.groupSeparator,intPart=arr[0],fractionPart=arr[1],isNeg=this.s<0,intDigits=isNeg?intPart.slice(1):intPart,len=intDigits.length;if(g2&&(i=g1,g1=g2,g2=i,len-=i),g1>0&&len>0){for(i=len%g1||g1,intPart=intDigits.substr(0,i);i0&&(intPart+=groupSeparator+intDigits.slice(i)),isNeg&&(intPart="-"+intPart)}str=fractionPart?intPart+FORMAT.decimalSeparator+((g2=+FORMAT.fractionGroupSize)?fractionPart.replace(new RegExp("\\d{"+g2+"}\\B","g"),"$&"+FORMAT.fractionGroupSeparator):fractionPart):intPart}return str},P.toFraction=function(md){var arr,d0,d2,e,exp,n,n0,q,s,k=ERRORS,x=this,xc=x.c,d=new BigNumber(ONE),n1=d0=new BigNumber(ONE),d1=n0=new BigNumber(ONE);if(null!=md&&(ERRORS=!1,n=new BigNumber(md),ERRORS=k,(k=n.isInt())&&!n.lt(ONE)||(ERRORS&&raise(22,"max denominator "+(k?"out of range":"not an integer"),md),md=!k&&n.c&&round(n,n.e+1,1).gte(ONE)?n:null)),!xc)return x.toString();for(s=coeffToString(xc),e=d.e=s.length-x.e-1,d.c[0]=POWS_TEN[(exp=e%LOG_BASE)<0?LOG_BASE+exp:exp],md=!md||n.cmp(d)>0?e>0?d:n1:n,exp=MAX_EXP,MAX_EXP=1/0,n=new BigNumber(s),n0.c[0]=0;q=div(n,d,0,1),d2=d0.plus(q.times(d1)),1!=d2.cmp(md);)d0=d1,d1=d2,n1=n0.plus(q.times(d2=n1)),n0=d2,d=n.minus(q.times(d2=d)),n=d2;return d2=div(md.minus(d0),d1,0,1),n0=n0.plus(d2.times(n1)),d0=d0.plus(d2.times(d1)),n0.s=n1.s=x.s,e*=2,arr=div(n1,d1,e,ROUNDING_MODE).minus(x).abs().cmp(div(n0,d0,e,ROUNDING_MODE).minus(x).abs())<1?[n1.toString(),d1.toString()]:[n0.toString(),d0.toString()],MAX_EXP=exp,arr},P.toNumber=function(){return+this},P.toPower=P.pow=function(n,m){var k,y,z,i=mathfloor(n<0?-n:+n),x=this;if(null!=m&&(id=23,m=new BigNumber(m)),!isValidInt(n,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER,23,"exponent")&&(!isFinite(n)||i>MAX_SAFE_INTEGER&&(n/=0)||parseFloat(n)!=n&&!(n=NaN))||0==n)return k=Math.pow(+x,n),new BigNumber(m?k%m:k);for(m?n>1&&x.gt(ONE)&&x.isInt()&&m.gt(ONE)&&m.isInt()?x=x.mod(m):(z=m,m=null):POW_PRECISION&&(k=mathceil(POW_PRECISION/LOG_BASE+2)),y=new BigNumber(ONE);;){if(i%2){if(y=y.times(x),!y.c)break;k?y.c.length>k&&(y.c.length=k):m&&(y=y.mod(m))}if(!(i=mathfloor(i/2)))break;x=x.times(x),k?x.c&&x.c.length>k&&(x.c.length=k):m&&(x=x.mod(m))}return m?y:(n<0&&(y=ONE.div(y)),z?y.mod(z):k?round(y,POW_PRECISION,ROUNDING_MODE):y)},P.toPrecision=function(sd,rm){return format(this,null!=sd&&isValidInt(sd,1,MAX,24,"precision")?0|sd:null,rm,24)},P.toString=function(b){var str,n=this,s=n.s,e=n.e;return null===e?s?(str="Infinity",s<0&&(str="-"+str)):str="NaN":(str=coeffToString(n.c),str=null!=b&&isValidInt(b,2,64,25,"base")?convertBase(toFixedPoint(str,e),0|b,10,s):e<=TO_EXP_NEG||e>=TO_EXP_POS?toExponential(str,e):toFixedPoint(str,e),s<0&&n.c[0]&&(str="-"+str)),str},P.truncated=P.trunc=function(){return round(new BigNumber(this),this.e+1,1)},P.valueOf=P.toJSON=function(){var str,n=this,e=n.e;return null===e?n.toString():(str=coeffToString(n.c),str=e<=TO_EXP_NEG||e>=TO_EXP_POS?toExponential(str,e):toFixedPoint(str,e),n.s<0?"-"+str:str)},null!=configObj&&BigNumber.config(configObj),BigNumber}function bitFloor(n){var i=0|n;return n>0||n===i?i:i-1}function coeffToString(a){for(var s,z,i=1,j=a.length,r=a[0]+"";il^a?1:-1;for(j=(k=xc.length)<(l=yc.length)?k:l,i=0;iyc[i]^a?1:-1;return k==l?0:k>l^a?1:-1}function intValidatorNoErrors(n,min,max){return(n=truncate(n))>=min&&n<=max}function isArray(obj){return"[object Array]"==Object.prototype.toString.call(obj)}function toBaseOut(str,baseIn,baseOut){for(var j,arrL,arr=[0],i=0,len=str.length;ibaseOut-1&&(null==arr[j+1]&&(arr[j+1]=0),arr[j+1]+=arr[j]/baseOut|0,arr[j]%=baseOut)}return arr.reverse()}function toExponential(str,e){return(str.length>1?str.charAt(0)+"."+str.slice(1):str)+(e<0?"e":"e+")+e}function toFixedPoint(str,e){var len,z;if(e<0){for(z="0.";++e;z+="0");str=z+str}else if(len=str.length,++e>len){for(z="0",e-=len;--e;z+="0");str+=z}else euint_max||x<0?(x_pos=Math.abs(x)%uint_max,x<0?uint_max-x_pos:x_pos):x}function scrub_vec(v){for(;0>>8^255&sx^99,this.SBOX[x]=sx,this.INV_SBOX[sx]=x,x2=d[x],x4=d[x2],x8=d[x4],t=257*d[sx]^16843008*sx,this.SUB_MIX[0][x]=t<<24|t>>>8,this.SUB_MIX[1][x]=t<<16|t>>>16,this.SUB_MIX[2][x]=t<<8|t>>>24,this.SUB_MIX[3][x]=t,t=16843009*x8^65537*x4^257*x2^16843008*x,this.INV_SUB_MIX[0][sx]=t<<24|t>>>8,this.INV_SUB_MIX[1][sx]=t<<16|t>>>16,this.INV_SUB_MIX[2][sx]=t<<8|t>>>24,this.INV_SUB_MIX[3][sx]=t,0===x?x=xi=1:(x=x2^d[d[d[x8^x2]]],xi^=d[d[xi]]);return!0};var G=new Global;AES.blockSize=16,AES.prototype.blockSize=AES.blockSize,AES.keySize=32,AES.prototype.keySize=AES.keySize,AES.prototype._doReset=function(){var invKsRow,keySize,keyWords,ksRow,ksRows,t;for(keyWords=this._key,keySize=keyWords.length,this._nRounds=keySize+6,ksRows=4*(this._nRounds+1),this._keySchedule=[],ksRow=0;ksRow>>24,t=G.SBOX[t>>>24]<<24|G.SBOX[t>>>16&255]<<16|G.SBOX[t>>>8&255]<<8|G.SBOX[255&t],t^=G.RCON[ksRow/keySize|0]<<24):keySize>6&&ksRow%keySize==4&&(t=G.SBOX[t>>>24]<<24|G.SBOX[t>>>16&255]<<16|G.SBOX[t>>>8&255]<<8|G.SBOX[255&t]),this._keySchedule[ksRow-keySize]^t);for(this._invKeySchedule=[],invKsRow=0;invKsRow>>24]]^G.INV_SUB_MIX[1][G.SBOX[t>>>16&255]]^G.INV_SUB_MIX[2][G.SBOX[t>>>8&255]]^G.INV_SUB_MIX[3][G.SBOX[255&t]];return!0},AES.prototype.encryptBlock=function(M){M=bufferToArray(new Buffer(M));var out=this._doCryptBlock(M,this._keySchedule,G.SUB_MIX,G.SBOX),buf=new Buffer(16);return buf.writeUInt32BE(out[0],0),buf.writeUInt32BE(out[1],4),buf.writeUInt32BE(out[2],8),buf.writeUInt32BE(out[3],12),buf},AES.prototype.decryptBlock=function(M){M=bufferToArray(new Buffer(M));var temp=[M[3],M[1]];M[1]=temp[0],M[3]=temp[1];var out=this._doCryptBlock(M,this._invKeySchedule,G.INV_SUB_MIX,G.INV_SBOX),buf=new Buffer(16);return buf.writeUInt32BE(out[0],0),buf.writeUInt32BE(out[3],4),buf.writeUInt32BE(out[2],8),buf.writeUInt32BE(out[1],12),buf},AES.prototype.scrub=function(){scrub_vec(this._keySchedule),scrub_vec(this._invKeySchedule),scrub_vec(this._key)},AES.prototype._doCryptBlock=function(M,keySchedule,SUB_MIX,SBOX){var ksRow,s0,s1,s2,s3,t0,t1,t2,t3;s0=M[0]^keySchedule[0],s1=M[1]^keySchedule[1],s2=M[2]^keySchedule[2],s3=M[3]^keySchedule[3],ksRow=4;for(var round=1;round>>24]^SUB_MIX[1][s1>>>16&255]^SUB_MIX[2][s2>>>8&255]^SUB_MIX[3][255&s3]^keySchedule[ksRow++],t1=SUB_MIX[0][s1>>>24]^SUB_MIX[1][s2>>>16&255]^SUB_MIX[2][s3>>>8&255]^SUB_MIX[3][255&s0]^keySchedule[ksRow++],t2=SUB_MIX[0][s2>>>24]^SUB_MIX[1][s3>>>16&255]^SUB_MIX[2][s0>>>8&255]^SUB_MIX[3][255&s1]^keySchedule[ksRow++],t3=SUB_MIX[0][s3>>>24]^SUB_MIX[1][s0>>>16&255]^SUB_MIX[2][s1>>>8&255]^SUB_MIX[3][255&s2]^keySchedule[ksRow++],s0=t0,s1=t1,s2=t2,s3=t3;return t0=(SBOX[s0>>>24]<<24|SBOX[s1>>>16&255]<<16|SBOX[s2>>>8&255]<<8|SBOX[255&s3])^keySchedule[ksRow++],t1=(SBOX[s1>>>24]<<24|SBOX[s2>>>16&255]<<16|SBOX[s3>>>8&255]<<8|SBOX[255&s0])^keySchedule[ksRow++],t2=(SBOX[s2>>>24]<<24|SBOX[s3>>>16&255]<<16|SBOX[s0>>>8&255]<<8|SBOX[255&s1])^keySchedule[ksRow++],t3=(SBOX[s3>>>24]<<24|SBOX[s0>>>16&255]<<16|SBOX[s1>>>8&255]<<8|SBOX[255&s2])^keySchedule[ksRow++],[fixup_uint32(t0),fixup_uint32(t1),fixup_uint32(t2),fixup_uint32(t3)]},exports.AES=AES}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function incr32(iv){for(var item,len=iv.length;len--;){if(255!==(item=iv.readUInt8(len))){item++,iv.writeUInt8(item,len);break}iv.writeUInt8(0,len)}}function getBlock(self){var out=self._cipher.encryptBlock(self._prev);return incr32(self._prev),out}var xor=__webpack_require__(62);exports.encrypt=function(self,chunk){for(;self._cache.length{b.put(this.transform.convert(key),value)},delete:key=>{b.delete(this.transform.convert(key))},commit:callback=>{b.commit(callback)}}}query(q){return pull(this.child.query(q),pull.map(e=>{return e.key=this.transform.invert(e.key),e}))}close(callback){this.child.close(callback)}}module.exports=KeyTransformDatastore},function(module,exports,__webpack_require__){"use strict";var curve=exports;curve.base=__webpack_require__(345),curve.short=__webpack_require__(348),curve.mont=__webpack_require__(347),curve.edwards=__webpack_require__(346)},function(module,exports,__webpack_require__){(function(process){function useColors(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(args){var useColors=this.useColors;if(args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff),useColors){var c="color: "+this.color;args.splice(1,0,c,"color: inherit");var index=0,lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){"%%"!==match&&(index++,"%c"===match&&(lastC=index))}),args.splice(lastC,0,c)}}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{null==namespaces?exports.storage.removeItem("debug"):exports.storage.debug=namespaces}catch(e){}}function load(){var r;try{r=exports.storage.debug}catch(e){}return!r&&void 0!==process&&"env"in process&&(r=process.env.DEBUG),r}exports=module.exports=__webpack_require__(364),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],exports.formatters.j=function(v){try{return JSON.stringify(v)}catch(err){return"[UnexpectedJSONParseError]: "+err.message}},exports.enable(load())}).call(exports,__webpack_require__(1))},function(module,exports,__webpack_require__){"use strict";(function(setImmediate){const protobuf=__webpack_require__(33),Block=__webpack_require__(65),isEqualWith=__webpack_require__(539),assert=__webpack_require__(9),each=__webpack_require__(15),CID=__webpack_require__(8),codecName=__webpack_require__(244),vd=__webpack_require__(700),multihashing=__webpack_require__(22),pbm=protobuf(__webpack_require__(399)),Entry=__webpack_require__(398);class BitswapMessage{constructor(full){this.full=full,this.wantlist=new Map,this.blocks=new Map}get empty(){return 0===this.blocks.size&&0===this.wantlist.size}addEntry(cid,priority,cancel){assert(cid&&CID.isCID(cid),"must be a valid cid");const cidStr=cid.buffer.toString(),entry=this.wantlist.get(cidStr);entry?(entry.priority=priority,entry.cancel=Boolean(cancel)):this.wantlist.set(cidStr,new Entry(cid,priority,cancel))}addBlock(block){assert(Block.isBlock(block),"must be a valid cid");const cidStr=block.cid.buffer.toString();this.blocks.set(cidStr,block)}cancel(cid){assert(CID.isCID(cid),"must be a valid cid");const cidStr=cid.buffer.toString();this.wantlist.delete(cidStr),this.addEntry(cid,0,!0)}serializeToBitswap100(){const msg={wantlist:{entries:Array.from(this.wantlist.values()).map(entry=>{return{block:entry.cid.buffer,priority:Number(entry.priority),cancel:Boolean(entry.cancel)}})},blocks:Array.from(this.blocks.values()).map(block=>block.data)};return this.full&&(msg.wantlist.full=!0),pbm.Message.encode(msg)}serializeToBitswap110(){const msg={wantlist:{entries:Array.from(this.wantlist.values()).map(entry=>{return{block:entry.cid.buffer,priority:Number(entry.priority),cancel:Boolean(entry.cancel)}})},payload:[]};return this.full&&(msg.wantlist.full=!0),this.blocks.forEach(block=>{msg.payload.push({prefix:block.cid.prefix,data:block.data})}),pbm.Message.encode(msg)}equals(other){const cmp=(a,b)=>{if(a.equals&&"function"==typeof a.equals)return a.equals(b)};return!(this.full!==other.full||!isEqualWith(this.wantlist,other.wantlist,cmp)||!isEqualWith(this.blocks,other.blocks,cmp))}get[Symbol.toStringTag](){const list=Array.from(this.wantlist.keys()),blocks=Array.from(this.blocks.keys());return`BitswapMessage `}}BitswapMessage.deserialize=((raw,callback)=>{let decoded;try{decoded=pbm.Message.decode(raw)}catch(err){return setImmediate(()=>callback(err))}const isFull=decoded.wantlist&&decoded.wantlist.full||!1,msg=new BitswapMessage(isFull);return decoded.wantlist&&decoded.wantlist.entries.forEach(entry=>{const cid=new CID(entry.block);msg.addEntry(cid,entry.priority,entry.cancel)}),decoded.blocks.length>0?each(decoded.blocks,(b,cb)=>{multihashing(b,"sha2-256",(err,hash)=>{if(err)return cb(err);const cid=new CID(hash);msg.addBlock(new Block(b,cid)),cb()})},err=>{if(err)return callback(err);callback(null,msg)}):decoded.payload.length>0?each(decoded.payload,(p,cb)=>{p.prefix&&p.data||cb();const values=vd(p.prefix),cidVersion=values[0],multicodec=values[1],hashAlg=values[2];multihashing(p.data,hashAlg,(err,hash)=>{if(err)return cb(err);const cid=new CID(cidVersion,codecName[multicodec.toString("16")],hash);msg.addBlock(new Block(p.data,cid)),cb()})},err=>{if(err)return callback(err);callback(null,msg)}):void callback(null,msg)}),BitswapMessage.Entry=Entry,module.exports=BitswapMessage +}).call(exports,__webpack_require__(38).setImmediate)},function(module,exports,__webpack_require__){"use strict";const sort=__webpack_require__(543),Entry=__webpack_require__(400);class Wantlist{constructor(){this.set=new Map}get length(){return this.set.size}add(cid,priority){const cidStr=cid.buffer.toString(),entry=this.set.get(cidStr);entry?(entry.inc(),entry.priority=priority):this.set.set(cidStr,new Entry(cid,priority))}remove(cid){const cidStr=cid.buffer.toString(),entry=this.set.get(cidStr);entry&&(entry.dec(),entry.hasRefs()||this.set.delete(cidStr))}removeForce(cidStr){this.set.has(cidStr)&&this.set.delete(cidStr)}forEach(fn){return this.set.forEach(fn)}entries(){return this.set.entries()}sortedEntries(){return new Map(sort(Array.from(this.set.entries()),o=>{return o[1].key}))}contains(cid){const cidStr=cid.buffer.toString();return this.set.get(cidStr)}}Wantlist.Entry=Entry,module.exports=Wantlist},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function create(data,dagLinks,hashAlg,callback){if("function"==typeof data?(callback=data,data=void 0):"string"==typeof data&&(data=new Buffer(data)),"function"==typeof dagLinks&&(callback=dagLinks,dagLinks=[]),"function"==typeof hashAlg&&(callback=hashAlg,hashAlg=void 0),!Buffer.isBuffer(data))return callback("Passed 'data' is not a buffer or a string!");hashAlg||(hashAlg="sha2-256");const links=dagLinks.map(l=>{return l.constructor&&"DAGLink"===l.constructor.name?l:new DAGLink(l.name?l.name:l.Name,l.size?l.size:l.Size,l.hash||l.Hash||l.multihash)}),sortedLinks=sort(links,linkSort);serialize({data:data,links:sortedLinks},(err,serialized)=>{if(err)return callback(err);multihashing(serialized,hashAlg,(err,multihash)=>{if(err)return callback(err);callback(null,new DAGNode(data,sortedLinks,serialized,multihash))})})}const multihashing=__webpack_require__(22),sort=__webpack_require__(687),dagPBUtil=__webpack_require__(124),serialize=dagPBUtil.serialize,dagNodeUtil=__webpack_require__(89),linkSort=dagNodeUtil.linkSort,DAGNode=__webpack_require__(123),DAGLink=__webpack_require__(53);module.exports=create}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function cloneData(dagNode){let data;return dagNode.data&&dagNode.data.length>0?(data=new Buffer(dagNode.data.length),dagNode.data.copy(data)):data=new Buffer(0),data}function cloneLinks(dagNode){return dagNode.links.slice()}function linkSort(a,b){const aBuf=new Buffer(a.name||"","ascii"),bBuf=new Buffer(b.name||"","ascii");return aBuf.compare(bBuf)}function toDAGLink(node){return new DAGLink("",node.size,node.multihash)}const DAGLink=__webpack_require__(53);exports=module.exports,exports.cloneData=cloneData,exports.cloneLinks=cloneLinks,exports.linkSort=linkSort,exports.toDAGLink=toDAGLink}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){var createError=__webpack_require__(368).create,LevelUPError=createError("LevelUPError"),NotFoundError=createError("NotFoundError",LevelUPError);NotFoundError.prototype.notFound=!0,NotFoundError.prototype.status=404,module.exports={LevelUPError:LevelUPError,InitializationError:createError("InitializationError",LevelUPError),OpenError:createError("OpenError",LevelUPError),ReadError:createError("ReadError",LevelUPError),WriteError:createError("WriteError",LevelUPError),NotFoundError:NotFoundError,EncodingError:createError("EncodingError",LevelUPError)}},function(module,exports,__webpack_require__){(function(process){function useColors(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(args){var useColors=this.useColors;if(args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff),useColors){var c="color: "+this.color;args.splice(1,0,c,"color: inherit");var index=0,lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){"%%"!==match&&(index++,"%c"===match&&(lastC=index))}),args.splice(lastC,0,c)}}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{null==namespaces?exports.storage.removeItem("debug"):exports.storage.debug=namespaces}catch(e){}}function load(){var r;try{r=exports.storage.debug}catch(e){}return!r&&void 0!==process&&"env"in process&&(r=process.env.DEBUG),r}exports=module.exports=__webpack_require__(511),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],exports.formatters.j=function(v){try{return JSON.stringify(v)}catch(err){return"[UnexpectedJSONParseError]: "+err.message}},exports.enable(load())}).call(exports,__webpack_require__(1))},function(module,exports,__webpack_require__){"use strict";const multistream=__webpack_require__(141);module.exports=function(protocols,conn){const ms=new multistream.Listener;Object.keys(protocols).forEach(protocol=>{protocol&&ms.addHandler(protocol,protocols[protocol].handlerFunc,protocols[protocol].matchFunc)}),ms.handle(conn,err=>{})}},function(module,exports,__webpack_require__){"use strict";function and(){function matches(a){"string"==typeof a&&(a=multiaddr(a));let out=partialMatch(a.protoNames());return null!==out&&0===out.length}function partialMatch(a){return a.lengthor(and(_Circuit,CircuitRecursive),_Circuit),Circuit=CircuitRecursive(),IPFS=or(and(Circuit,_IPFS,Circuit),and(_IPFS,Circuit),and(Circuit,_IPFS),Circuit,_IPFS);exports.DNS=DNS,exports.DNS4=DNS4,exports.DNS6=DNS6,exports.IP=IP,exports.TCP=TCP,exports.UDP=UDP,exports.UTP=UTP,exports.HTTP=HTTP,exports.WebSockets=WebSockets,exports.WebSocketsSecure=WebSocketsSecure,exports.WebRTCStar=WebRTCStar,exports.WebRTCDirect=WebRTCDirect,exports.Reliable=Reliable,exports.Circuit=Circuit,exports.IPFS=IPFS},function(module,exports,__webpack_require__){"use strict";const baseTable=__webpack_require__(69),varintBufferEncode=__webpack_require__(245).varintBufferEncode,varintTable={};module.exports=varintTable;for(let encodingName in baseTable){let code=baseTable[encodingName];varintTable[encodingName]=varintBufferEncode(code)}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function randomId(){return(~~(1e9*Math.random())).toString(36)}function encode(msg,callback){const values=Buffer.isBuffer(msg)?[msg]:[new Buffer(msg)];pull(pull.values(values),pullLP.encode(),pull.collect((err,encoded)=>{if(err)return callback(err);callback(null,encoded[0])}))}function createLogger(type){function printer(logger){return msg=>{Array.isArray(msg)&&(msg=msg.join(" ")),logger("(%s) %s",rId,msg)}}const rId=randomId(),log=printer(debug("mss:"+type));return log.error=printer(debug("mss:"+type+":error")),log}const pull=__webpack_require__(4),pullLP=__webpack_require__(24),debug=__webpack_require__(593);exports=module.exports,exports.writeEncoded=((writer,msg,callback)=>{encode(msg,(err,msg)=>{if(err)return callback(err);writer.write(msg)})}),exports.log={},exports.log.dialer=(()=>{return createLogger("dialer\t")}),exports.log.listener=(()=>{return createLogger("listener\t")})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(setImmediate,process){function nodeify(promise,cb){return"function"!=typeof cb?promise:promise.then(function(res){nextTick(function(){cb(null,res)})},function(err){nextTick(function(){cb(err)})})}function nodeifyThis(cb){return nodeify(this,cb)}function extend(prom){if(prom&&isPromise(prom)){prom.nodeify=nodeifyThis;var then=prom.then;return prom.then=function(){return extend(then.apply(this,arguments))},prom}"function"==typeof prom?prom.prototype.nodeify=nodeifyThis:Promise.prototype.nodeify=nodeifyThis}function NodeifyPromise(fn){if(!(this instanceof NodeifyPromise))return new NodeifyPromise(fn);Promise.call(this,fn),extend(this)}var nextTick,Promise=__webpack_require__(604),isPromise=__webpack_require__(211);nextTick="function"==typeof setImmediate?setImmediate:"object"==typeof process&&process&&process.nextTick?process.nextTick:function(cb){setTimeout(cb,0)},module.exports=nodeify,nodeify.extend=extend,nodeify.Promise=NodeifyPromise,NodeifyPromise.prototype=Object.create(Promise.prototype),NodeifyPromise.prototype.constructor=NodeifyPromise}).call(exports,__webpack_require__(38).setImmediate,__webpack_require__(1))},function(module,exports){exports.encode=function(obj){var str="";for(var i in obj)obj.hasOwnProperty(i)&&(str.length&&(str+="&"),str+=encodeURIComponent(i)+"="+encodeURIComponent(obj[i]));return str},exports.decode=function(qs){for(var qry={},pairs=qs.split("&"),i=0,l=pairs.length;i>>2,bn.words[2]=(63&b32[22])<<20|b32[23]<<12|b32[24]<<4|b32[25]>>>4,bn.words[3]=(255&b32[19])<<18|b32[20]<<10|b32[21]<<2|b32[22]>>>6,bn.words[4]=(3&b32[15])<<24|b32[16]<<16|b32[17]<<8|b32[18],bn.words[5]=(15&b32[12])<<22|b32[13]<<14|b32[14]<<6|b32[15]>>>2,bn.words[6]=(63&b32[9])<<20|b32[10]<<12|b32[11]<<4|b32[12]>>>4,bn.words[7]=(255&b32[6])<<18|b32[7]<<10|b32[8]<<2|b32[9]>>>6,bn.words[8]=(3&b32[2])<<24|b32[3]<<16|b32[4]<<8|b32[5],bn.words[9]=b32[0]<<14|b32[1]<<6|b32[2]>>>2,bn.length=10,bn.strip()},BN.prototype.toBuffer=function(){for(var w=this.words,i=this.length;i<10;++i)w[i]=0;return Buffer.from([w[9]>>>14&255,w[9]>>>6&255,(63&w[9])<<2|w[8]>>>24&3,w[8]>>>16&255,w[8]>>>8&255,255&w[8],w[7]>>>18&255,w[7]>>>10&255,w[7]>>>2&255,(3&w[7])<<6|w[6]>>>20&63,w[6]>>>12&255,w[6]>>>4&255,(15&w[6])<<4|w[5]>>>22&15,w[5]>>>14&255,w[5]>>>6&255,(63&w[5])<<2|w[4]>>>24&3,w[4]>>>16&255,w[4]>>>8&255,255&w[4],w[3]>>>18&255,w[3]>>>10&255,w[3]>>>2&255,(3&w[3])<<6|w[2]>>>20&63,w[2]>>>12&255,w[2]>>>4&255,(15&w[2])<<4|w[1]>>>22&15,w[1]>>>14&255,w[1]>>>6&255,(63&w[1])<<2|w[0]>>>24&3,w[0]>>>16&255,w[0]>>>8&255,255&w[0]])},BN.prototype.clone=function(){var r=new BN;r.words=new Array(this.length);for(var i=0;i1&&0==(0|this.words[this.length-1]);)this.length--;return this},BN.prototype.normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.isEven=function(){return 0==(1&this.words[0])},BN.prototype.isOdd=function(){return 1==(1&this.words[0])},BN.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},BN.prototype.ucmp=function(num){if(this.length!==num.length)return this.length>num.length?1:-1;for(var i=this.length-1;i>=0;--i)if(this.words[i]!==num.words[i])return this.words[i]>num.words[i]?1:-1;return 0},BN.prototype.gtOne=function(){return this.length>1||this.words[0]>1},BN.prototype.isOverflow=function(){return this.ucmp(BN.n)>=0},BN.prototype.isHigh=function(){return 1===this.ucmp(BN.nh)},BN.prototype.bitLengthGT256=function(){return this.length>10||10===this.length&&this.words[9]>4194303},BN.prototype.iuaddn=function(num){this.words[0]+=num;for(var i=0;this.words[i]>67108863&&inum.length?(a=this,b=num):(a=num,b=this);for(var i=0,carry=0;i>>26}for(;0!==carry&&i>>26;if(this.length=a.length,0!==carry)this.words[this.length++]=carry;else if(a!==this)for(;i0?(a=this,b=num):(a=num,b=this);for(var i=0,carry=0;i>26,this.words[i]=67108863&word}for(;0!==carry&&i>26,this.words[i]=67108863&word;if(0===carry&&i>>26,rword=67108863&carry,j=Math.max(0,k-num1.length+1),maxJ=Math.min(k,num2.length-1);j<=maxJ;j++){var i=k-j,a=num1.words[i],b=num2.words[j],r=a*b+rword;ncarry+=r/67108864|0,rword=67108863&r}out.words[k]=rword,carry=ncarry}return 0!==carry&&(out.words[out.length++]=carry),out.strip()},BN.umulTo10x10=Math.imul?optimized.umulTo10x10:BN.umulTo,BN.umulnTo=function(num,k,out){if(0===k)return out.words=[0],out.length=1,out;for(var i=0,carry=0;i0?(out.words[i]=carry,out.length=num.length+1):out.length=num.length,out},BN.prototype.umul=function(num){var out=new BN;return out.words=new Array(this.length+num.length),10===this.length&&10===num.length?BN.umulTo10x10(this,num,out):1===this.length?BN.umulnTo(num,this.words[0],out):1===num.length?BN.umulnTo(this,num.words[0],out):BN.umulTo(this,num,out)},BN.prototype.isplit=function(output){output.length=Math.min(this.length,9);for(var i=0;i>>22,prev=word}return prev>>>=22,this.words[i-10]=prev,0===prev&&this.length>10?this.length-=10:this.length-=9,this},BN.prototype.fireduce=function(){return this.isOverflow()&&this.isub(BN.n),this},BN.prototype.ureduce=function(){var num=this.clone().isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp);return num.bitLengthGT256()&&(num=num.isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp),num.bitLengthGT256()&&(num=num.isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp))),num.fireduce()},BN.prototype.ishrn=function(n){for(var mask=(1<=0;--i){var word=this.words[i];this.words[i]=carry<>>n,carry=word&mask}return this.length>1&&0===this.words[this.length-1]&&(this.length-=1),this},BN.prototype.uinvm=function(){for(var x=this.clone(),y=BN.n.clone(),A=BN.fromNumber(1),B=BN.fromNumber(0),C=BN.fromNumber(0),D=BN.fromNumber(1);x.isEven()&&y.isEven();){for(var k=1,m=1;0==(x.words[0]&m)&&0==(y.words[0]&m)&&k<26;++k,m<<=1);x.ishrn(k),y.ishrn(k)}for(var yp=y.clone(),xp=x.clone();!x.isZero();){for(var i=0,im=1;0==(x.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(x.ishrn(i);i-- >0;)(A.isOdd()||B.isOdd())&&(A.iadd(yp),B.isub(xp)),A.ishrn(1),B.ishrn(1);for(var j=0,jm=1;0==(y.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(y.ishrn(j);j-- >0;)(C.isOdd()||D.isOdd())&&(C.iadd(yp),D.isub(xp)),C.ishrn(1),D.ishrn(1);x.ucmp(y)>=0?(x.isub(y),A.isub(C),B.isub(D)):(y.isub(x),C.isub(A),D.isub(B))}if(1===C.negative){C.negative=0;var result=C.ureduce();return result.negative^=1,result.normSign().iadd(BN.n)}return C.ureduce()},BN.prototype.imulK=function(){this.words[this.length]=0,this.words[this.length+1]=0,this.length+=2;for(var i=0,lo=0;i0?this.isub(BN.p):this.strip(),this},BN.prototype.redNeg=function(){return this.isZero()?BN.fromNumber(0):BN.p.sub(this)},BN.prototype.redAdd=function(num){return this.clone().redIAdd(num)},BN.prototype.redIAdd=function(num){return this.iadd(num),this.ucmp(BN.p)>=0&&this.isub(BN.p),this},BN.prototype.redIAdd7=function(){return this.iuaddn(7),this.ucmp(BN.p)>=0&&this.isub(BN.p),this},BN.prototype.redSub=function(num){return this.clone().redISub(num)},BN.prototype.redISub=function(num){return this.isub(num),0!==this.negative&&this.iadd(BN.p),this},BN.prototype.redMul=function(num){return this.umul(num).redIReduce()},BN.prototype.redSqr=function(){return this.umul(this).redIReduce()},BN.prototype.redSqrt=function(){if(this.isZero())return this.clone();for(var wv2=this.redSqr(),wv4=wv2.redSqr(),wv12=wv4.redSqr().redMul(wv4),wv14=wv12.redMul(wv2),wv15=wv14.redMul(this),out=wv15,i=0;i<54;++i)out=out.redSqr().redSqr().redSqr().redSqr().redMul(wv15);for(out=out.redSqr().redSqr().redSqr().redSqr().redMul(wv14),i=0;i<5;++i)out=out.redSqr().redSqr().redSqr().redSqr().redMul(wv15);return out=out.redSqr().redSqr().redSqr().redSqr().redMul(wv12),out=out.redSqr().redSqr().redSqr().redSqr().redSqr().redSqr().redMul(wv12),0===out.redSqr().ucmp(this)?out:null},BN.prototype.redInvm=function(){for(var a=this.clone(),b=BN.p.clone(),x1=BN.fromNumber(1),x2=BN.fromNumber(0);a.gtOne()&&b.gtOne();){for(var i=0,im=1;0==(a.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(a.ishrn(i);i-- >0;)x1.isOdd()&&x1.iadd(BN.p),x1.ishrn(1);for(var j=0,jm=1;0==(b.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(b.ishrn(j);j-- >0;)x2.isOdd()&&x2.iadd(BN.p),x2.ishrn(1);a.ucmp(b)>=0?(a.isub(b),x1.isub(x2)):(b.isub(a),x2.isub(x1))}var res;return res=1===a.length&&1===a.words[0]?x1:x2,0!==res.negative&&res.iadd(BN.p),0!==res.negative?(res.negative=0,res.redIReduce().redNeg()):res.redIReduce()},BN.prototype.getNAF=function(w){for(var naf=[],ws=1<>1,k=this.clone();!k.isZero();){for(var i=0,m=1;0==(k.words[0]&m)&&i<26;++i,m<<=1)naf.push(0);if(0!==i)k.ishrn(i);else{var mod=k.words[0]&wsm1;if(mod>=ws2)naf.push(ws2-mod),k.iuaddn(mod-ws2).ishrn(1);else if(naf.push(mod),k.words[0]-=mod,!k.isZero()){for(i=w-1;i>0;--i)naf.push(0);k.ishrn(w)}}}return naf},BN.prototype.inspect=function(){if(this.isZero())return"0";for(var buffer=this.toBuffer().toString("hex"),i=0;"0"===buffer[i];++i);return buffer.slice(i)},BN.n=BN.fromBuffer(Buffer.from("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","hex")),BN.nh=BN.n.clone().ishrn(1),BN.nc=BN.fromBuffer(Buffer.from("000000000000000000000000000000014551231950B75FC4402DA1732FC9BEBF","hex")),BN.p=BN.fromBuffer(Buffer.from("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","hex")),BN.psn=BN.p.sub(BN.n),BN.tmp=new BN,BN.tmp.words=new Array(10),function(){BN.fromNumber(1).words[3]=0}(),module.exports=BN},function(module,exports,__webpack_require__){(function(process){function useColors(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(args){var useColors=this.useColors;if(args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff),useColors){var c="color: "+this.color;args.splice(1,0,c,"color: inherit");var index=0,lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){"%%"!==match&&(index++,"%c"===match&&(lastC=index))}),args.splice(lastC,0,c)}}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{null==namespaces?exports.storage.removeItem("debug"):exports.storage.debug=namespaces}catch(e){}}function load(){var r;try{r=exports.storage.debug}catch(e){}return!r&&void 0!==process&&"env"in process&&(r=process.env.DEBUG),r}exports=module.exports=__webpack_require__(681),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],exports.formatters.j=function(v){try{return JSON.stringify(v)}catch(err){return"[UnexpectedJSONParseError]: "+err.message}},exports.enable(load())}).call(exports,__webpack_require__(1))},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function eachOfArrayLike(coll,iteratee,callback){function iteratorCallback(err,value){err?callback(err):++completed!==length&&value!==_breakLoop2.default||callback(null)}callback=(0,_once2.default)(callback||_noop2.default);var index=0,completed=0,length=coll.length;for(0===length&&callback(null);index>2,mant=(3&buf[0])<<8|buf[1],exp?31===exp?sign*(mant?NaN:Infinity):sign*Math.pow(2,exp-25)*(1024+mant):5.960464477539063e-8*sign*mant},exports.arrayBufferToBignumber=function(buf){const len=buf.byteLength;let res="";for(let i=0;i{const res=new Map,keys=Object.keys(obj),length=keys.length;for(let i=0;i{return f*SHIFT16+g}),exports.buildInt64=((f1,f2,g1,g2)=>{const f=exports.buildInt32(f1,f2),g=exports.buildInt32(g1,g2);return f>2097151?new Bignumber(f).times(SHIFT32).plus(g):f*SHIFT32+g}),exports.writeHalf=function(buf,half){const u32=new Buffer(4);u32.writeFloatBE(half,0);const u=u32.readUInt32BE(0);if(0!=(8191&u))return!1;var s16=u>>16&32768;const exp=u>>23&255,mant=8388607&u;if(exp>=113&&exp<=142)s16+=(exp-112<<10)+(mant>>13);else{if(!(exp>=103&&exp<113))return!1;if(mant&(1<<126-exp)-1)return!1;s16+=mant+8388608>>126-exp}return buf.writeUInt16BE(s16,0),!0},exports.keySorter=function(a,b){var lenA=a[0].byteLength,lenB=b[0].byteLength;return lenA>lenB?1:lenB>lenA?-1:a[0].compare(b[0])},exports.isNegativeZero=(x=>{return 0===x&&1/x<0}),exports.nextPowerOf2=(n=>{let count=0;if(n&&!(n&n-1))return n;for(;0!==n;)n>>=1,count+=1;return 1<{if(err)return err.notFound?void callback(null,!1):void callback(err);callback(null,!0)})}delete(key,callback){this.db.del(key.toString(),callback)}close(callback){this.db.close(callback)}batch(){const ops=[];return{put:(key,value)=>{ops.push({type:"put",key:key.toString(),value:value})},delete:key=>{ops.push({type:"del",key:key.toString()})},commit:callback=>{this.db.batch(ops,callback)}}}query(q){let values=!0;null!=q.keysOnly&&(values=!q.keysOnly);const iter=this.db.db.iterator({keys:!0,values:values,keyAsBuffer:!0}),rawStream=(end,cb)=>{if(end)return iter.end(err=>{cb(err||end)});iter.next((err,key,value)=>{if(err)return cb(err);if(null==err&&null==key&&null==value)return iter.end(err=>{cb(err||!0)});const res={key:new Key(key,!1)};values&&(res.value=new Buffer(value)),cb(null,res)})};let tasks=[rawStream],filters=[];if(null!=q.prefix){const prefix=q.prefix;filters.push((e,cb)=>cb(null,e.key.toString().startsWith(prefix)))}if(null!=q.filters&&(filters=filters.concat(q.filters)),tasks=tasks.concat(filters.map(f=>asyncFilter(f))),null!=q.orders&&(tasks=tasks.concat(q.orders.map(o=>asyncSort(o)))),null!=q.offset){let i=0;tasks.push(pull.filter(()=>i++>=q.offset))}return null!=q.limit&&tasks.push(pull.take(q.limit)),pull.apply(null,tasks)}}module.exports=LevelDatastore}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function Transport(opts){this.path=opts.path,this.hostname=opts.hostname,this.port=opts.port,this.secure=opts.secure,this.query=opts.query,this.timestampParam=opts.timestampParam,this.timestampRequests=opts.timestampRequests,this.readyState="",this.agent=opts.agent||!1,this.socket=opts.socket,this.enablesXDR=opts.enablesXDR,this.pfx=opts.pfx,this.key=opts.key,this.passphrase=opts.passphrase,this.cert=opts.cert,this.ca=opts.ca,this.ciphers=opts.ciphers,this.rejectUnauthorized=opts.rejectUnauthorized,this.forceNode=opts.forceNode,this.extraHeaders=opts.extraHeaders,this.localAddress=opts.localAddress}var parser=__webpack_require__(51),Emitter=__webpack_require__(50);module.exports=Transport,Emitter(Transport.prototype),Transport.prototype.onError=function(msg,desc){var err=new Error(msg);return err.type="TransportError",err.description=desc,this.emit("error",err),this},Transport.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},Transport.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},Transport.prototype.send=function(packets){if("open"!==this.readyState)throw new Error("Transport not open");this.write(packets)},Transport.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},Transport.prototype.onData=function(data){var packet=parser.decodePacket(data,this.socket.binaryType);this.onPacket(packet)},Transport.prototype.onPacket=function(packet){this.emit("packet",packet)},Transport.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(module,exports,__webpack_require__){(function(global){var hasCORS=__webpack_require__(380);module.exports=function(opts){var xdomain=opts.xdomain,xscheme=opts.xscheme,enablesXDR=opts.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!xdomain||hasCORS))return new XMLHttpRequest}catch(e){}try{if("undefined"!=typeof XDomainRequest&&!xscheme&&enablesXDR)return new XDomainRequest}catch(e){}if(!xdomain)try{return new(global[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}}).call(exports,__webpack_require__(3))},function(module,exports,__webpack_require__){var hash=exports;hash.utils=__webpack_require__(28),hash.common=__webpack_require__(64),hash.sha=__webpack_require__(384),hash.ripemd=__webpack_require__(383),hash.hmac=__webpack_require__(382),hash.sha1=hash.sha.sha1,hash.sha256=hash.sha.sha256,hash.sha224=hash.sha.sha224,hash.sha384=hash.sha.sha384,hash.sha512=hash.sha.sha512,hash.ripemd160=hash.ripemd.ripemd160},function(module,exports){var indexOf=[].indexOf;module.exports=function(arr,obj){if(indexOf)return arr.indexOf(obj);for(var i=0;i{busy?abortCb=cb:cb(abort)}):read(abort,cb)):read(null,(end,data)=>{end?cb(end):aborted?cb(aborted):(busy=!0,test(data,(err,valid)=>{busy=!1,aborted?(cb(aborted),abortCb(aborted)):err?next(err,cb):valid?cb(null,data):next(null,cb)}))})}}},exports.asyncSort=function(sorter){const source=Source(),sink=pull.collect((err,ary)=>{if(err)return source.abort(err);sorter(ary,(err,res)=>{if(err)return source.abort(err);source.resolve(pull.values(ary))})});return function(read){return sink(read),source}},exports.replaceStartWith=function(s,r){const matcher=new RegExp("^"+r);return s.replace(matcher,"")},exports.tmpdir=(()=>{return path.join(os.tmpdir(),uuid())})},function(module,exports,__webpack_require__){"use strict";module.exports={maxProvidersPerRequest:3,providerRequestTimeout:1e4,hasBlockTimeout:15e3,provideTimeout:15e3,kMaxPriority:Math.pow(2,31)-1,rebroadcastDelay:1e4,maxListeners:1e3}},function(module,exports,__webpack_require__){(function(process){function useColors(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(args){var useColors=this.useColors;if(args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff),useColors){var c="color: "+this.color;args.splice(1,0,c,"color: inherit");var index=0,lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){"%%"!==match&&(index++,"%c"===match&&(lastC=index))}),args.splice(lastC,0,c)}}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{null==namespaces?exports.storage.removeItem("debug"):exports.storage.debug=namespaces}catch(e){}}function load(){var r;try{r=exports.storage.debug}catch(e){}return!r&&void 0!==process&&"env"in process&&(r=process.env.DEBUG),r}exports=module.exports=__webpack_require__(404),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],exports.formatters.j=function(v){try{return JSON.stringify(v)}catch(err){return"[UnexpectedJSONParseError]: "+err.message}},exports.enable(load())}).call(exports,__webpack_require__(1))},function(module,exports,__webpack_require__){"use strict";module.exports=class Dir{}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(11),assert=__webpack_require__(9);class DAGNode{constructor(data,links,serialized,multihash){assert(serialized,"DAGNode needs its serialized format"),assert(multihash,"DAGNode needs its multihash"),"string"==typeof multihash&&(multihash=mh.fromB58String(multihash)),this._data=data||new Buffer(0),this._links=links||[],this._serialized=serialized,this._multihash=multihash,this._size=this.links.reduce((sum,l)=>sum+l.size,this.serialized.length),this._json={data:this.data,links:this.links.map(l=>l.toJSON()),multihash:mh.toB58String(this.multihash),size:this.size}}toJSON(){return this._json}toString(){return`DAGNode <${mh.toB58String(this.multihash)} - data: "${this.data.toString()}", links: ${this.links.length}, size: ${this.size}>`}get data(){return this._data}set data(data){throw new Error("Can't set property: 'data' is immutable")}get links(){return this._links}set links(links){throw new Error("Can't set property: 'links' is immutable")}get serialized(){return this._serialized}set serialized(serialized){throw new Error("Can't set property: 'serialized' is immutable")}get size(){return this._size}set size(size){throw new Error("Can't set property: 'size' is immutable")}get multihash(){return this._multihash}set multihash(multihash){throw new Error("Can't set property: 'multihash' is immutable")}}exports=module.exports=DAGNode,exports.create=__webpack_require__(88),exports.clone=__webpack_require__(444),exports.addLink=__webpack_require__(443),exports.rmLink=__webpack_require__(445)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function cid(node,callback){if(node.multihash)return callback(null,new CID(node.multihash));callback(new Error("not valid dagPB node"))}function serialize(node,callback){let serialized;try{const pb=toProtoBuf(node);serialized=proto.PBNode.encode(pb)}catch(err){return callback(err)}callback(null,serialized)}function deserialize(data,callback){const pbn=proto.PBNode.decode(data),links=pbn.Links.map(link=>{return new DAGLink(link.Name,link.Tsize,link.Hash)}),buf=pbn.Data||new Buffer(0);DAGNode.create(buf,links,callback)}function toProtoBuf(node){const pbn={};return node.data&&node.data.length>0?pbn.Data=node.data:pbn.Data=null,node.links&&node.links.length>0?pbn.Links=node.links.map(link=>{return{Hash:link.multihash,Name:link.name,Tsize:link.size}}):pbn.Links=null,pbn}const CID=__webpack_require__(441),protobuf=__webpack_require__(33),proto=protobuf(__webpack_require__(446)),DAGLink=__webpack_require__(53),DAGNode=__webpack_require__(123);exports=module.exports,exports.serialize=serialize,exports.deserialize=deserialize,exports.cid=cid}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function createTrieResolver(multicodec,leafResolver){function mapFromEthObj(trieNode,options,callback){mapFromBaseTrie(trieNode,options,(err,basePaths)=>{if(err)return callback(err);if(!leafResolver)return callback(null,basePaths);let paths=basePaths.slice();each(basePaths.filter(child=>Buffer.isBuffer(child.value)),(child,cb)=>{return waterfall([cb=>leafResolver.util.deserialize(child.value,cb),(ethObj,cb)=>leafResolver.resolver._mapFromEthObject(ethObj,options,cb)],(err,grandChildren)=>{if(err)return cb(err);grandChildren.forEach(grandChild=>{paths.push({path:child.path+"/"+grandChild.path,value:grandChild.value})}),cb()})},err=>{if(err)return callback(err);callback(null,paths)})})}function mapFromBaseTrie(trieNode,options,callback){let paths=[];"leaf"===trieNode.type&&paths.push({path:nibbleToPath(trieNode.getKey()),value:trieNode.getValue()}),each(trieNode.getChildren(),(childData,next)=>{const key=nibbleToPath(childData[0]),value=childData[1];if(EthTrieNode.isRawNode(value)){const childNode=new EthTrieNode(value);paths.push({path:key,value:childNode}),mapFromBaseTrie(childNode,options,(err,subtree)=>{if(err)return next(err);subtree.forEach(path=>{path.path=key+"/"+path.path}),paths=paths.concat(subtree),next()})}else{let link={"/":cidFromHash(multicodec,value).toBaseEncodedString()};paths.push({path:key,value:link}),next()}},err=>{if(err)return callback(err);callback(null,paths)})}const baseTrie=createResolver(multicodec,EthTrieNode,mapFromEthObj);return baseTrie.util.deserialize=asyncify(serialized=>{return new EthTrieNode(rlp.decode(serialized))}),baseTrie}function nibbleToPath(data){return data.map(num=>num.toString(16)).join("/")}const each=__webpack_require__(15),waterfall=__webpack_require__(6),asyncify=__webpack_require__(73),rlp=__webpack_require__(46),EthTrieNode=__webpack_require__(576),createResolver=__webpack_require__(66),cidFromHash=(__webpack_require__(452),__webpack_require__(453),__webpack_require__(209),__webpack_require__(208),__webpack_require__(207),__webpack_require__(55));module.exports=createTrieResolver}).call(exports,__webpack_require__(0).Buffer)},function(module,exports){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_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"}},function(module,exports,__webpack_require__){(function(Buffer,process){function Level(location){if(!(this instanceof Level))return new Level(location);AbstractLevelDOWN.call(this,location)}module.exports=Level;var AbstractLevelDOWN=__webpack_require__(223).AbstractLevelDOWN,util=__webpack_require__(34),Iterator=__webpack_require__(474),xtend=__webpack_require__(39);util.inherits(Level,AbstractLevelDOWN),Level.prototype._open=function(options,callback){function onerror(ev){callback(ev.target.error)}function onsuccess(db){self._db=db;var exists=self._db.objectStoreNames.contains(self._idbOpts.storeName);if(options.errorIfExists&&exists)return self._db.close(),void callback(new Error("store already exists"));if(!options.createIfMissing&&!exists)return self._db.close(),void callback(new Error("store does not exist"));if(options.createIfMissing&&!exists){self._db.close();var req2=indexedDB.open(self.location,self._db.version+1);return req2.onerror=function(ev){callback(ev.target.error)},req2.onupgradeneeded=function(){req2.result.createObjectStore(self._idbOpts.storeName,self._idbOpts)},void(req2.onsuccess=function(){self._db=req2.result,callback(null,self)})}callback(null,self)}var self=this;if(this._idbOpts=xtend({storeName:this.location,keyEncoding:"none",valueEncoding:"none"},options),this._idbOpts.idb)onsuccess(this._idbOpts.idb);else{var req=indexedDB.open(this.location);req.onerror=onerror,req.onsuccess=function(){onsuccess(req.result)}}},Level.prototype._get=function(key,options,callback){options=xtend(this._idbOpts,options);var origKey=key;"binary"!==options.keyEncoding||Array.isArray(key)||(key=Array.prototype.slice.call(key));var tx=this._db.transaction(this._idbOpts.storeName),req=tx.objectStore(this._idbOpts.storeName).openCursor(IDBKeyRange.only(key));tx.onabort=function(){callback(tx.error)},req.onsuccess=function(){var cursor=req.result;if(cursor){var value=cursor.value;if(value instanceof Uint8Array&&(value=new Buffer(value)),"binary"!==options.valueEncoding||Buffer.isBuffer(value)||(value=new Buffer(value)),options.asBuffer&&!Buffer.isBuffer(value))if(null==value)value=new Buffer(0);else if("string"==typeof value)value=new Buffer(value);else if("boolean"==typeof value)value=new Buffer(String(value));else if("number"==typeof value)value=new Buffer(String(value));else if(Array.isArray(value))value=new Buffer(String(value));else{if(!(value instanceof Uint8Array))return void callback(new TypeError("can't coerce `"+value.constructor.name+"` into a Buffer"));value=new Buffer(value)}return void callback(null,value,origKey)}return void callback(new Error("NotFound"))}},Level.prototype._del=function(key,options,callback){options=xtend(this._idbOpts,options),"binary"!==options.keyEncoding||Array.isArray(key)||(key=Array.prototype.slice.call(key));var mode="readwrite";options.sync===!0&&(mode="readwriteflush");var tx=this._db.transaction(this._idbOpts.storeName,mode);tx.objectStore(this._idbOpts.storeName).delete(key);tx.onabort=function(){callback(tx.error)},tx.oncomplete=function(){callback()}},Level.prototype._put=function(key,value,options,callback){options=xtend(this._idbOpts,options),"binary"!==options.keyEncoding||Array.isArray(key)||(key=Array.prototype.slice.call(key));var mode="readwrite";options.sync===!0&&(mode="readwriteflush");var tx=this._db.transaction(this._idbOpts.storeName,mode);tx.objectStore(this._idbOpts.storeName).put(value,key);tx.onabort=function(){callback(tx.error)},tx.oncomplete=function(){callback()}},Level.prototype._iterator=function(options){return new Iterator(this,options)},Level.prototype._batch=function(array,options,callback){if(0===array.length)return process.nextTick(callback);var mode="readwrite";options.sync===!0&&(mode="readwriteflush");var tx=this._db.transaction(this._idbOpts.storeName,mode),store=tx.objectStore(this._idbOpts.storeName);tx.onabort=function(){callback(tx.error)},tx.oncomplete=function(){callback()},array.forEach(function(currentOp){"binary"!==xtend(options,currentOp).keyEncoding||Array.isArray(currentOp.key)||(currentOp.key=Array.prototype.slice.call(currentOp.key)),"del"===currentOp.type?store.delete(currentOp.key):store.put(currentOp.value,currentOp.key)})},Level.prototype._close=function(callback){this._db.close(),process.nextTick(callback)},Level.prototype._approximateSize=function(start,end,callback){var err=new Error("Not implemented");if(callback)return void process.nextTick(function(){callback(err)});throw err},Level.destroy=function(db,callback){var idbOpts;if(null!=db&&"object"==typeof db)idbOpts=xtend({location:db.location,storeName:db.location},db._idbOpts);else{if("string"!=typeof db)throw new TypeError("location must be a string or an object");idbOpts={location:db,storeName:db}}if("string"!=typeof idbOpts.location)throw new TypeError("location must be a string");if("string"!=typeof idbOpts.storeName)throw new TypeError("db.storeName must be a string");var req=indexedDB.open(idbOpts.location);req.onerror=function(ev){callback(ev.target.error)},req.onsuccess=function(){function deleteDatabase(name){var req2=indexedDB.deleteDatabase(name);req2.onerror=function(ev){callback(ev.target.error)},req2.onsuccess=function(){callback()}}var db=req.result;if(db.close(),0===db.objectStoreNames.length)return void deleteDatabase(idbOpts.location);if(!db.objectStoreNames.contains(idbOpts.storeName))return void callback();var req2=indexedDB.open(idbOpts.location,db.version+1);req2.onerror=function(ev){callback(ev.target.error)},req2.onupgradeneeded=function(){db=req2.result,db.deleteObjectStore(idbOpts.storeName)},req2.onsuccess=function(){db=req2.result,db.close(),0===db.objectStoreNames.length?deleteDatabase(idbOpts.location):callback()}}}}).call(exports,__webpack_require__(0).Buffer,__webpack_require__(1))},function(module,exports,__webpack_require__){"use strict";module.exports=`enum KeyType { RSA = 0; Ed25519 = 1; Secp256k1 = 2; @@ -20,13 +20,13 @@ message PublicKey { message PrivateKey { required KeyType Type = 1; required bytes Data = 2; -}`},function(module,exports,__webpack_require__){"use strict";module.exports=(()=>{if("undefined"!=typeof self&&(__webpack_require__(682)(self),self.crypto))return self.crypto;throw new Error("Please use an environment with crypto support")})},function(module,exports,__webpack_require__){"use strict";module.exports={PROTOCOL:"/ipfs/ping/1.0.0",PING_LENGTH:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const protobuf=__webpack_require__(31),PeerId=__webpack_require__(22),crypto=__webpack_require__(63),parallel=__webpack_require__(39),waterfall=__webpack_require__(7),debug=__webpack_require__(3),log=debug("libp2p:secio");log.error=debug("libp2p:secio:error");const pbm=protobuf(__webpack_require__(505)),support=__webpack_require__(127);exports.createProposal=(state=>{return state.proposal.out={rand:crypto.randomBytes(16),pubkey:state.key.local.public.bytes,exchanges:support.exchanges.join(","),ciphers:support.ciphers.join(","),hashes:support.hashes.join(",")},state.proposalEncoded.out=pbm.Propose.encode(state.proposal.out),state.proposalEncoded.out}),exports.createExchange=((state,callback)=>{crypto.keys.generateEphemeralKeyPair(state.protocols.local.curveT,(err,res)=>{if(err)return callback(err);state.ephemeralKey.local=res.key,state.shared.generate=res.genSharedKey;const selectionOut=Buffer.concat([state.proposalEncoded.out,state.proposalEncoded.in,state.ephemeralKey.local]);state.key.local.sign(selectionOut,(err,sig)=>{if(err)return callback(err);state.exchange.out={epubkey:state.ephemeralKey.local,signature:sig},callback(null,pbm.Exchange.encode(state.exchange.out))})})}),exports.identify=((state,msg,callback)=>{log("1.1 identify"),state.proposalEncoded.in=msg,state.proposal.in=pbm.Propose.decode(msg);const pubkey=state.proposal.in.pubkey;state.key.remote=crypto.keys.unmarshalPublicKey(pubkey),PeerId.createFromPubKey(pubkey.toString("base64"),(err,remoteId)=>{if(err)return callback(err);state.id.remote=remoteId,log("1.1 identify - %s - identified remote peer as %s",state.id.local.toB58String(),state.id.remote.toB58String()),callback()})}),exports.selectProtocols=((state,callback)=>{log("1.2 selection");const local={pubKeyBytes:state.key.local.public.bytes,exchanges:support.exchanges,hashes:support.hashes,ciphers:support.ciphers,nonce:state.proposal.out.rand},remote={pubKeyBytes:state.proposal.in.pubkey,exchanges:state.proposal.in.exchanges.split(","),hashes:state.proposal.in.hashes.split(","),ciphers:state.proposal.in.ciphers.split(","),nonce:state.proposal.in.rand};support.selectBest(local,remote,(err,selected)=>{if(err)return callback(err);state.protocols.remote={order:selected.order,curveT:selected.curveT,cipherT:selected.cipherT,hashT:selected.hashT},state.protocols.local={order:selected.order,curveT:selected.curveT,cipherT:selected.cipherT,hashT:selected.hashT},callback()})}),exports.verify=((state,msg,callback)=>{log("2.1. verify"),state.exchange.in=pbm.Exchange.decode(msg),state.ephemeralKey.remote=state.exchange.in.epubkey;const selectionIn=Buffer.concat([state.proposalEncoded.in,state.proposalEncoded.out,state.ephemeralKey.remote]);state.key.remote.verify(selectionIn,state.exchange.in.signature,(err,sigOk)=>{return err?callback(err):sigOk?(log("2.1. verify - signature verified"),void callback()):callback(new Error("Bad signature"))})}),exports.generateKeys=((state,callback)=>{log("2.2. keys"),waterfall([cb=>state.shared.generate(state.exchange.in.epubkey,cb),(secret,cb)=>{state.shared.secret=secret,crypto.keys.keyStretcher(state.protocols.local.cipherT,state.protocols.local.hashT,state.shared.secret,cb)},(keys,cb)=>{if(state.protocols.local.order>0)state.protocols.local.keys=keys.k1,state.protocols.remote.keys=keys.k2;else{if(!(state.protocols.local.order<0))return cb(new Error("you are trying to talk to yourself"));state.protocols.local.keys=keys.k2,state.protocols.remote.keys=keys.k1}log("2.3. mac + cipher"),parallel([cb=>support.makeMacAndCipher(state.protocols.local,cb),cb=>support.makeMacAndCipher(state.protocols.remote,cb)],cb)}],callback)}),exports.verifyNonce=((state,n2)=>{const n1=state.proposal.out.rand;if(!n1.equals(n2))throw new Error(`Failed to read our encrypted nonce: ${n1.toString("hex")} != ${n2.toString("hex")}`)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function makeMac(hash,key,callback){crypto.hmac.create(hash,key,callback)}function makeCipher(cipherType,iv,key,callback){if("AES-128"===cipherType||"AES-256"===cipherType)return crypto.aes.create(key,iv,callback);callback(new Error(`unrecognized cipher type: ${cipherType}`))}const mh=__webpack_require__(21),lp=__webpack_require__(23),pull=__webpack_require__(4),crypto=__webpack_require__(63),parallel=__webpack_require__(39);exports.exchanges=["P-256","P-384","P-521"],exports.ciphers=["AES-256","AES-128"],exports.hashes=["SHA256","SHA512"],exports.theBest=((order,p1,p2)=>{let first,second;if(order<0)first=p2,second=p1;else{if(!(order>0))return p1[0];first=p1,second=p2}for(let firstCandidate of first)for(let secondCandidate of second)if(firstCandidate===secondCandidate)return firstCandidate;throw new Error("No algorithms in common!")}),exports.makeMacAndCipher=((target,callback)=>{parallel([cb=>makeMac(target.hashT,target.keys.macKey,cb),cb=>makeCipher(target.cipherT,target.keys.iv,target.keys.cipherKey,cb)],(err,macAndCipher)=>{if(err)return callback(err);target.mac=macAndCipher[0],target.cipher=macAndCipher[1],callback()})}),exports.selectBest=((local,remote,cb)=>{exports.digest(Buffer.concat([remote.pubKeyBytes,local.nonce]),(err,oh1)=>{if(err)return cb(err);exports.digest(Buffer.concat([local.pubKeyBytes,remote.nonce]),(err,oh2)=>{if(err)return cb(err);const order=Buffer.compare(oh1,oh2);if(0===order)return cb(new Error("you are trying to talk to yourself"));cb(null,{curveT:exports.theBest(order,local.exchanges,remote.exchanges),cipherT:exports.theBest(order,local.ciphers,remote.ciphers),hashT:exports.theBest(order,local.hashes,remote.hashes),order:order})})})}),exports.digest=((buf,cb)=>{mh.digest(buf,"sha2-256",buf.length,cb)}),exports.write=function(state,msg,cb){cb=cb||(()=>{}),pull(pull.values([msg]),lp.encode({fixed:!0,bytes:4}),pull.collect((err,res)=>{if(err)return cb(err);state.shake.write(res[0]),cb()}))},exports.read=function(reader,cb){lp.decodeFromReader(reader,{fixed:!0,bytes:4},cb)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(global,module){function arrayMap(array,iteratee){for(var index=-1,length=array?array.length:0,result=Array(length);++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function values(object){return object?baseValues(object,keys(object)):[]}var MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",reIsUint=/^(?:0|[1-9]\d*)$/,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,propertyIsEnumerable=objectProto.propertyIsEnumerable,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),isArray=Array.isArray;module.exports=values},function(module,exports,__webpack_require__){function baseGetTag(value){return null==value?void 0===value?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(value)?getRawTag(value):objectToString(value)}var Symbol=__webpack_require__(230),getRawTag=__webpack_require__(544),objectToString=__webpack_require__(549),nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=Symbol?Symbol.toStringTag:void 0;module.exports=baseGetTag},function(module,exports){var isArray=Array.isArray;module.exports=isArray},function(module,exports){function isObjectLike(value){return null!=value&&"object"==typeof value}module.exports=isObjectLike -},function(module,exports,__webpack_require__){"use strict";function Protocols(proto){if("number"==typeof proto){if(Protocols.codes[proto])return Protocols.codes[proto];throw new Error("no protocol with code: "+proto)}if("string"==typeof proto||proto instanceof String){if(Protocols.names[proto])return Protocols.names[proto];throw new Error("no protocol with name: "+proto)}throw new Error("invalid protocol id type: "+proto)}function p(code,size,name,resolvable){return{code:code,size:size,name:name,resolvable:Boolean(resolvable)}}const map=__webpack_require__(128);Protocols.lengthPrefixedVarSize=-1,Protocols.V=-1,Protocols.table=[[4,32,"ip4"],[6,16,"tcp"],[17,16,"udp"],[33,16,"dccp"],[41,128,"ip6"],[53,-1,"dns","resolvable"],[54,-1,"dns4","resolvable"],[55,-1,"dns6","resolvable"],[132,16,"sctp"],[302,0,"utp"],[421,Protocols.lengthPrefixedVarSize,"ipfs"],[480,0,"http"],[443,0,"https"],[477,0,"ws"],[478,0,"wss"],[275,0,"libp2p-webrtc-star"],[276,0,"libp2p-webrtc-direct"],[290,0,"p2p-circuit"]],Protocols.names={},Protocols.codes={},map(Protocols.table,function(row){const proto=p.apply(null,row);Protocols.codes[proto.code]=proto,Protocols.names[proto.name]=proto}),Protocols.object=p,module.exports=Protocols},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function multibase(nameOrCode,buf){if(!buf)throw new Error("requires an encoded buffer");const base=getBase(nameOrCode),codeBuf=new Buffer(base.code);return validEncode(base.name,buf),Buffer.concat([codeBuf,buf])}function encode(nameOrCode,buf){const base=getBase(nameOrCode);return multibase(base.name,new Buffer(base.encode(buf)))}function decode(bufOrString){Buffer.isBuffer(bufOrString)&&(bufOrString=bufOrString.toString());const code=bufOrString.substring(0,1);"string"==typeof(bufOrString=bufOrString.substring(1,bufOrString.length))&&(bufOrString=new Buffer(bufOrString));const base=getBase(code);return{base:base.name,data:new Buffer(base.decode(bufOrString.toString()))}.data}function isEncoded(bufOrString){Buffer.isBuffer(bufOrString)&&(bufOrString=bufOrString.toString());const code=bufOrString.substring(0,1);try{const base=getBase(code);return base.name}catch(err){return!1}}function validEncode(name,buf){getBase(name).decode(buf.toString())}function getBase(nameOrCode){let base;if(constants.names[nameOrCode])base=constants.names[nameOrCode];else{if(!constants.codes[nameOrCode])throw errNotSupported;base=constants.codes[nameOrCode]}if(!base.isImplemented())throw new Error("Base "+nameOrCode+" is not implemented yet");return base}const constants=__webpack_require__(566);exports=module.exports=multibase,exports.encode=encode,exports.decode=decode,exports.isEncoded=isEncoded;const errNotSupported=new Error("Unsupported encoding")}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const varint=__webpack_require__(15),codecNameToCodeVarint=__webpack_require__(90),codeToCodecName=__webpack_require__(237),util=__webpack_require__(238);exports=module.exports,exports.addPrefix=((multicodecStrOrCode,data)=>{let prefix;if(Buffer.isBuffer(multicodecStrOrCode))prefix=util.varintBufferEncode(multicodecStrOrCode);else{if(!codecNameToCodeVarint[multicodecStrOrCode])throw new Error("multicodec not recognized");prefix=codecNameToCodeVarint[multicodecStrOrCode]}return Buffer.concat([prefix,data])}),exports.rmPrefix=(data=>{return varint.decode(data),data.slice(varint.decode.bytes)}),exports.getCodec=(prefixedData=>{return codeToCodecName[util.varintBufferDecode(prefixedData).toString("hex")]})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.Listener=exports.listener=__webpack_require__(578),exports.Dialer=exports.dialer=__webpack_require__(577),exports.matchSemver=__webpack_require__(580),exports.matchExact=__webpack_require__(241)},function(module,exports,__webpack_require__){"use strict";const through=__webpack_require__(98);module.exports=function(_maxLength){const maxLength=_maxLength||100;var buffered=[];return through(function(data){for(buffered=buffered.concat(data);buffered.length>=maxLength;){const end=maxLength,slice=buffered.slice(0,end);buffered=buffered.slice(end),this.queue(slice)}},function(end){buffered.length&&(this.queue(buffered),buffered=[]),this.queue(null)})}},function(module,exports){function abortAll(ary,abort,cb){function next(){--n||cb(abort)}var n=ary.length;if(!n)return cb(abort);ary.forEach(function(f){f?f(abort,next):next()}),n||next()}module.exports=function(streams){return function(abort,cb){!function next(){abort?abortAll(streams,abort,cb):streams.length?streams[0]?streams[0](null,function(err,data){err?(streams.shift(),err===!0?next():abortAll(streams,err,cb)):cb(null,data)}):(streams.shift(),next()):cb(!0)}()}}},function(module,exports,__webpack_require__){var looper=__webpack_require__(600);module.exports=function(map,width,inOrder){inOrder=void 0===inOrder||inOrder;var abort,reading=!1;return function(read){function drain(){if(_cb){var cb=_cb;if(error)return _cb=null,cb(error);if(Object.hasOwnProperty.call(seen,j)){_cb=null;var data=seen[j];delete seen[j],j++,cb(null,data),width&&start()}else j>=last&&ended&&(_cb=null,cb(ended))}}var _cb,error,i=0,j=0,last=0,seen=[],started=!1,ended=!1,start=looper(function(){if(started=!0,ended)return drain();reading||width&&i-width>=j||(reading=!0,read(abort,function(end,data){if(reading=!1,end)last=i,ended=end,drain();else{var k=i++;map(data,function(err,data){inOrder?seen[k]=data:seen.push(data),err&&(error=err),drain()}),ended||start()}}))});return function(_abort,cb){_abort?read(ended=abort=_abort,function(err){if(cb)return cb(err)}):(_cb=cb,started||start(),drain())}}}},function(module,exports,__webpack_require__){"use strict";var drain=__webpack_require__(68);module.exports=function(reducer,acc,cb){cb||(cb=acc,acc=null);var sink=drain(function(data){acc=reducer(acc,data)},function(err){cb(err,acc)});return 2===arguments.length?function(source){source(null,function(end,data){if(end)return cb(end===!0?null:end);acc=data,sink(source)})}:sink}},function(module,exports,__webpack_require__){"use strict";var abortCb=__webpack_require__(255);module.exports=function(array,onAbort){if(!array)return function(abort,cb){return abort?abortCb(cb,abort,onAbort):cb(!0)};Array.isArray(array)||(array=Object.keys(array).map(function(k){return array[k]}));var i=0;return function(abort,cb){if(abort)return abortCb(cb,abort,onAbort);i>=array.length?cb(!0):cb(null,array[i++])}}},function(module,exports,__webpack_require__){"use strict";var tester=__webpack_require__(256);module.exports=function(test){return test=tester(test),function(read){return function next(end,cb){for(var sync,loop=!0;loop;)loop=!1,sync=!0,read(end,function(end,data){if(!end&&!test(data))return sync?loop=!0:next(end,cb);cb(end,data)}),sync=!1}}}},function(module,exports,__webpack_require__){"use strict";(function(process,setImmediate,global){function CorkedRequest(state){var _this=this;this.next=null,this.entry=null,this.finish=function(){onCorkedFinish(_this,state)}}function _uint8ArrayToBuffer(chunk){return Buffer.from(chunk)}function _isUint8Array(obj){return Buffer.isBuffer(obj)||obj instanceof OurUint8Array}function nop(){}function WritableState(options,stream){Duplex=Duplex||__webpack_require__(44),options=options||{},this.objectMode=!!options.objectMode,stream instanceof Duplex&&(this.objectMode=this.objectMode||!!options.writableObjectMode);var hwm=options.highWaterMark,defaultHwm=this.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:defaultHwm,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var noDecode=options.decodeStrings===!1;this.decodeStrings=!noDecode,this.defaultEncoding=options.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(er){onwrite(stream,er)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}function Writable(options){if(Duplex=Duplex||__webpack_require__(44),!(realHasInstance.call(Writable,this)||this instanceof Duplex))return new Writable(options);this._writableState=new WritableState(options,this),this.writable=!0,options&&("function"==typeof options.write&&(this._write=options.write),"function"==typeof options.writev&&(this._writev=options.writev),"function"==typeof options.destroy&&(this._destroy=options.destroy),"function"==typeof options.final&&(this._final=options.final)),Stream.call(this)}function writeAfterEnd(stream,cb){var er=new Error("write after end");stream.emit("error",er),processNextTick(cb,er)}function validChunk(stream,state,chunk,cb){var valid=!0,er=!1;return null===chunk?er=new TypeError("May not write null values to stream"):"string"==typeof chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er&&(stream.emit("error",er),processNextTick(cb,er),valid=!1),valid}function decodeChunk(state,chunk,encoding){return state.objectMode||state.decodeStrings===!1||"string"!=typeof chunk||(chunk=Buffer.from(chunk,encoding)),chunk}function writeOrBuffer(stream,state,isBuf,chunk,encoding,cb){if(!isBuf){var newChunk=decodeChunk(state,chunk,encoding);chunk!==newChunk&&(isBuf=!0,encoding="buffer",chunk=newChunk)}var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length-1?setImmediate:processNextTick;Writable.WritableState=WritableState;var util=__webpack_require__(26);util.inherits=__webpack_require__(1);var internalUtil={deprecate:__webpack_require__(672)},Stream=__webpack_require__(261),Buffer=__webpack_require__(6).Buffer,OurUint8Array=global.Uint8Array||function(){},destroyImpl=__webpack_require__(260);util.inherits(Writable,Stream),WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(_){}}();var realHasInstance;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return!!realHasInstance.call(this,object)||object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=_isUint8Array(chunk)&&!state.objectMode;return isBuf&&!Buffer.isBuffer(chunk)&&(chunk=_uint8ArrayToBuffer(chunk)),"function"==typeof encoding&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),"function"!=typeof cb&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,state.writing||state.corked||state.finished||state.bufferProcessing||!state.bufferedRequest||clearBuffer(this,state))},Writable.prototype.setDefaultEncoding=function(encoding){if("string"==typeof encoding&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this},Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;"function"==typeof chunk?(cb=chunk,chunk=null,encoding=null):"function"==typeof encoding&&(cb=encoding,encoding=null),null!==chunk&&void 0!==chunk&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||state.finished||endWritable(this,state,cb)},Object.defineProperty(Writable.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(value){this._writableState&&(this._writableState.destroyed=value)}}),Writable.prototype.destroy=destroyImpl.destroy,Writable.prototype._undestroy=destroyImpl.undestroy,Writable.prototype._destroy=function(err,cb){this.end(),cb(err)}}).call(exports,__webpack_require__(5),__webpack_require__(37).setImmediate,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(263)(__webpack_require__(647))},function(module,exports,__webpack_require__){function Encoder(){}function encodeAsString(obj){var str=""+obj.type;return exports.BINARY_EVENT!==obj.type&&exports.BINARY_ACK!==obj.type||(str+=obj.attachments+"-"),obj.nsp&&"/"!==obj.nsp&&(str+=obj.nsp+","),null!=obj.id&&(str+=obj.id),null!=obj.data&&(str+=JSON.stringify(obj.data)),debug("encoded %j as %s",obj,str),str}function encodeAsBinary(obj,callback){function writeEncoding(bloblessData){var deconstruction=binary.deconstructPacket(bloblessData),pack=encodeAsString(deconstruction.packet),buffers=deconstruction.buffers;buffers.unshift(pack),callback(buffers)}binary.removeBlobs(obj,writeEncoding)}function Decoder(){this.reconstructor=null}function decodeString(str){var i=0,p={type:Number(str.charAt(0))};if(null==exports.types[p.type])return error();if(exports.BINARY_EVENT===p.type||exports.BINARY_ACK===p.type){for(var buf="";"-"!==str.charAt(++i)&&(buf+=str.charAt(i),i!=str.length););if(buf!=Number(buf)||"-"!==str.charAt(i))throw new Error("Illegal attachments");p.attachments=Number(buf)}if("/"===str.charAt(i+1))for(p.nsp="";++i;){var c=str.charAt(i);if(","===c)break;if(p.nsp+=c,i===str.length)break}else p.nsp="/";var next=str.charAt(i+1);if(""!==next&&Number(next)==next){for(p.id="";++i;){var c=str.charAt(i);if(null==c||Number(c)!=c){--i;break}if(p.id+=str.charAt(i),i===str.length)break}p.id=Number(p.id)}return str.charAt(++i)&&(p=tryParse(p,str.substr(i))),debug("decoded %s as %j",str,p),p}function tryParse(p,str){try{p.data=JSON.parse(str)}catch(e){return error()}return p}function BinaryReconstructor(packet){this.reconPack=packet,this.buffers=[]}function error(){return{type:exports.ERROR,data:"parser error"}}var debug=__webpack_require__(3)("socket.io-parser"),Emitter=__webpack_require__(49),hasBin=__webpack_require__(186),binary=__webpack_require__(661),isBuf=__webpack_require__(272);exports.protocol=4,exports.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],exports.CONNECT=0,exports.DISCONNECT=1,exports.EVENT=2,exports.ACK=3,exports.ERROR=4,exports.BINARY_EVENT=5,exports.BINARY_ACK=6,exports.Encoder=Encoder,exports.Decoder=Decoder,Encoder.prototype.encode=function(obj,callback){if(obj.type!==exports.EVENT&&obj.type!==exports.ACK||!hasBin(obj.data)||(obj.type=obj.type===exports.EVENT?exports.BINARY_EVENT:exports.BINARY_ACK),debug("encoding packet %j",obj),exports.BINARY_EVENT===obj.type||exports.BINARY_ACK===obj.type)encodeAsBinary(obj,callback);else{callback([encodeAsString(obj)])}},Emitter(Decoder.prototype),Decoder.prototype.add=function(obj){var packet;if("string"==typeof obj)packet=decodeString(obj),exports.BINARY_EVENT===packet.type||exports.BINARY_ACK===packet.type?(this.reconstructor=new BinaryReconstructor(packet),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",packet)):this.emit("decoded",packet);else{if(!isBuf(obj)&&!obj.base64)throw new Error("Unknown type: "+obj);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(packet=this.reconstructor.takeBinaryData(obj))&&(this.reconstructor=null,this.emit("decoded",packet))}},Decoder.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},BinaryReconstructor.prototype.takeBinaryData=function(binData){if(this.buffers.push(binData),this.buffers.length===this.reconPack.attachments){var packet=binary.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),packet}return null},BinaryReconstructor.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(module,exports,__webpack_require__){(function(process){function destroy(stream,cb){function onClose(){cleanup(),cb()}function onError(err){cleanup(),cb(err)}function cleanup(){stream.removeListener("close",onClose),stream.removeListener("error",onError)}stream.on("close",onClose),stream.on("error",onError)}function destroy(stream){stream.destroy?stream.destroy():console.error("warning, stream-to-pull-stream: \nthe wrapped node-stream does not implement `destroy`, \nthis may cause resource leaks.")}function write(read,stream,cb){function done(){did||(did=!0,cb&&cb(ended===!0?null:ended))}function onClose(){closed||(closed=!0,cleanup(),ended?done():read(ended=!0,done))}function onError(err){cleanup(),ended||read(ended=err,done)}function cleanup(){stream.on("finish",onClose),stream.removeListener("close",onClose),stream.removeListener("error",onError)}var ended,did,closed=!1;stream.on("close",onClose),stream.on("finish",onClose),stream.on("error",onError),process.nextTick(function(){looper(function(next){read(null,function(end,data){if(ended=ended||end,end===!0)return stream._isStdio?done():stream.end();if(ended=ended||end)return destroy(stream),done(ended);if(stream._isStdio)stream.write(data,function(){next()});else{stream.write(data)===!1?stream.once("drain",next):next()}})})})}function read2(stream){function read(){var data=stream.read();if(null!==data&&_cb){var cb=_cb;_cb=null,cb(null,data)}}var _cb,ended=!1,waiting=!1;return stream.on("readable",function(){waiting=!0,_cb&&read()}).on("end",function(){ended=!0,_cb&&_cb(ended)}).on("error",function(err){ended=err,_cb&&_cb(ended)}),function(end,cb){_cb=cb,ended?cb(ended):waiting&&read()}}function read1(stream){function drain(){for(;(buffer.length||ended)&&cbs.length;)cbs.shift()(buffer.length?null:ended,buffer.shift());!buffer.length&&paused&&(paused=!1,stream.resume())}var ended,buffer=[],cbs=[],paused=!1;return stream.on("data",function(data){buffer.push(data),drain(),buffer.length&&stream.pause&&(paused=!0,stream.pause())}),stream.on("end",function(){ended=!0,drain()}),stream.on("close",function(){ended=!0,drain()}),stream.on("error",function(err){ended=err,drain()}),function(abort,cb){function onAbort(){for(;cbs.length;)cbs.shift()(abort);cb(abort)}if(!cb)throw new Error("*must* provide cb");if(abort){if(ended)return onAbort();stream.once("close",onAbort),destroy(stream)}else cbs.push(cb),drain()}}var looper=(__webpack_require__(252),__webpack_require__(235)),read=read1,sink=function(stream,cb){return function(read){return write(read,stream,cb)}},source=function(stream){return read1(stream)};exports=module.exports=function(stream,cb){return stream.writable&&stream.write?stream.readable?function(_read){return write(_read,stream,cb),read1(stream)}:sink(stream,cb):source(stream)},exports.sink=sink,exports.source=source,exports.read=read,exports.read1=read1,exports.read2=read2,exports.duplex=function(stream,cb){return{source:source(stream),sink:sink(stream,cb)}},exports.transform=function(stream){return function(read){var _source=source(stream);return sink(stream)(read),_source}}}).call(exports,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";function Url(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function urlParse(url,parseQueryString,slashesDenoteHost){if(url&&util.isObject(url)&&url instanceof Url)return url;var u=new Url;return u.parse(url,parseQueryString,slashesDenoteHost),u}function urlFormat(obj){return util.isString(obj)&&(obj=urlParse(obj)),obj instanceof Url?obj.format():Url.prototype.format.call(obj)}function urlResolve(source,relative){return urlParse(source,!1,!0).resolve(relative)}function urlResolveObject(source,relative){return source?urlParse(source,!1,!0).resolveObject(relative):relative}var punycode=__webpack_require__(632),util=__webpack_require__(671);exports.parse=urlParse,exports.resolve=urlResolve,exports.resolveObject=urlResolveObject,exports.format=urlFormat,exports.Url=Url;var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,simplePathPattern=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,delims=["<",">",'"',"`"," ","\r","\n","\t"],unwise=["{","}","|","\\","^","`"].concat(delims),autoEscape=["'"].concat(unwise),nonHostChars=["%","/","?",";","#"].concat(autoEscape),hostEndingChars=["/","?","#"],unsafeProtocol={javascript:!0,"javascript:":!0},hostlessProtocol={javascript:!0,"javascript:":!0},slashedProtocol={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},querystring=__webpack_require__(635);Url.prototype.parse=function(url,parseQueryString,slashesDenoteHost){if(!util.isString(url))throw new TypeError("Parameter 'url' must be a string, not "+typeof url);var queryIndex=url.indexOf("?"),splitter=queryIndex!==-1&&queryIndex127?"x":part[j];if(!newpart.match(/^[+a-z0-9A-Z_-]{0,63}$/)){var validParts=hostparts.slice(0,i),notHost=hostparts.slice(i+1),bit=part.match(/^([+a-z0-9A-Z_-]{0,63})(.*)$/);bit&&(validParts.push(bit[1]),notHost.unshift(bit[2])),notHost.length&&(rest="/"+notHost.join(".")+rest),this.hostname=validParts.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),ipv6Hostname||(this.hostname=punycode.toASCII(this.hostname));var p=this.port?":"+this.port:"",h=this.hostname||"";this.host=h+p,this.href+=this.host,ipv6Hostname&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==rest[0]&&(rest="/"+rest))}if(!unsafeProtocol[lowerProto])for(var i=0,l=autoEscape.length;i0)&&result.host.split("@");authInHost&&(result.auth=authInHost.shift(),result.host=result.hostname=authInHost.shift())}return result.search=relative.search,result.query=relative.query,util.isNull(result.pathname)&&util.isNull(result.search)||(result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")),result.href=result.format(),result}if(!srcPath.length)return result.pathname=null,result.search?result.path="/"+result.search:result.path=null,result.href=result.format(),result;for(var last=srcPath.slice(-1)[0],hasTrailingSlash=(result.host||relative.host||srcPath.length>1)&&("."===last||".."===last)||""===last,up=0,i=srcPath.length;i>=0;i--)last=srcPath[i],"."===last?srcPath.splice(i,1):".."===last?(srcPath.splice(i,1),up++):up&&(srcPath.splice(i,1),up--);if(!mustEndAbs&&!removeAllDots)for(;up--;up)srcPath.unshift("..");!mustEndAbs||""===srcPath[0]||srcPath[0]&&"/"===srcPath[0].charAt(0)||srcPath.unshift(""),hasTrailingSlash&&"/"!==srcPath.join("/").substr(-1)&&srcPath.push("");var isAbsolute=""===srcPath[0]||srcPath[0]&&"/"===srcPath[0].charAt(0);if(psychotic){result.hostname=result.host=isAbsolute?"":srcPath.length?srcPath.shift():"";var authInHost=!!(result.host&&result.host.indexOf("@")>0)&&result.host.split("@");authInHost&&(result.auth=authInHost.shift(),result.host=result.hostname=authInHost.shift())}return mustEndAbs=mustEndAbs||result.host&&srcPath.length,mustEndAbs&&!isAbsolute&&srcPath.unshift(""),srcPath.length?result.pathname=srcPath.join("/"):(result.pathname=null,result.path=null),util.isNull(result.pathname)&&util.isNull(result.search)||(result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")),result.auth=relative.auth||result.auth,result.slashes=result.slashes||relative.slashes,result.href=result.format(),result},Url.prototype.parseHost=function(){var host=this.host,port=portPattern.exec(host);port&&(port=port[0],":"!==port&&(this.port=port.substr(1)),host=host.substr(0,host.length-port.length)),host&&(this.hostname=host)}},function(module,exports,__webpack_require__){"use strict";exports.OFFLINE_ERROR=new Error("This command must be run in online mode. Try running 'ipfs daemon' first.")},function(module,exports,__webpack_require__){function DecoderBuffer(base,options){if(Reporter.call(this,options),!Buffer.isBuffer(base))return void this.error("Input not Buffer");this.base=base,this.offset=0,this.length=base.length}function EncoderBuffer(value,reporter){if(Array.isArray(value))this.length=0,this.value=value.map(function(item){return item instanceof EncoderBuffer||(item=new EncoderBuffer(item,reporter)),this.length+=item.length,item},this);else if("number"==typeof value){if(!(0<=value&&value<=255))return reporter.error("non-byte EncoderBuffer value");this.value=value,this.length=1}else if("string"==typeof value)this.value=value,this.length=Buffer.byteLength(value);else{if(!Buffer.isBuffer(value))return reporter.error("Unsupported type: "+typeof value);this.value=value,this.length=value.length}}var inherits=__webpack_require__(1),Reporter=__webpack_require__(57).Reporter,Buffer=__webpack_require__(0).Buffer;inherits(DecoderBuffer,Reporter),exports.DecoderBuffer=DecoderBuffer,DecoderBuffer.prototype.save=function(){return{offset:this.offset,reporter:Reporter.prototype.save.call(this)}},DecoderBuffer.prototype.restore=function(save){var res=new DecoderBuffer(this.base);return res.offset=save.offset,res.length=this.offset,this.offset=save.offset,Reporter.prototype.restore.call(this,save.reporter),res},DecoderBuffer.prototype.isEmpty=function(){return this.offset===this.length},DecoderBuffer.prototype.readUInt8=function(fail){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(fail||"DecoderBuffer overrun")},DecoderBuffer.prototype.skip=function(bytes,fail){if(!(this.offset+bytes<=this.length))return this.error(fail||"DecoderBuffer overrun");var res=new DecoderBuffer(this.base);return res._reporterState=this._reporterState,res.offset=this.offset,res.length=this.offset+bytes,this.offset+=bytes,res},DecoderBuffer.prototype.raw=function(save){return this.base.slice(save?save.offset:this.offset,this.length)},exports.EncoderBuffer=EncoderBuffer,EncoderBuffer.prototype.join=function(out,offset){return out||(out=new Buffer(this.length)),offset||(offset=0),0===this.length?out:(Array.isArray(this.value)?this.value.forEach(function(item){item.join(out,offset),offset+=item.length}):("number"==typeof this.value?out[offset]=this.value:"string"==typeof this.value?out.write(this.value,offset):Buffer.isBuffer(this.value)&&this.value.copy(out,offset),offset+=this.length),out)}},function(module,exports,__webpack_require__){var constants=exports;constants._reverse=function(map){var res={};return Object.keys(map).forEach(function(key){(0|key)==key&&(key|=0),res[map[key]]=key}),res},constants.der=__webpack_require__(282)},function(module,exports,__webpack_require__){function DERDecoder(entity){this.enc="der",this.name=entity.name,this.entity=entity,this.tree=new DERNode,this.tree._init(entity.body)}function DERNode(parent){base.Node.call(this,"der",parent)}function derDecodeTag(buf,fail){var tag=buf.readUInt8(fail);if(buf.isError(tag))return tag;var cls=der.tagClass[tag>>6],primitive=0==(32&tag);if(31==(31&tag)){var oct=tag;for(tag=0;128==(128&oct);){if(oct=buf.readUInt8(fail),buf.isError(oct))return oct;tag<<=7,tag|=127&oct}}else tag&=31;return{cls:cls,primitive:primitive,tag:tag,tagStr:der.tag[tag]}}function derDecodeLen(buf,primitive,fail){var len=buf.readUInt8(fail);if(buf.isError(len))return len;if(!primitive&&128===len)return null;if(0==(128&len))return len;var num=127&len;if(num>4)return buf.error("length octect is too long");len=0;for(var i=0;i=31?reporter.error("Multi-octet tag encoding unsupported"):(primitive||(res|=32),res|=der.tagClassByName[cls||"universal"]<<6)}var inherits=__webpack_require__(1),Buffer=__webpack_require__(0).Buffer,asn1=__webpack_require__(46),base=asn1.base,der=asn1.constants.der;module.exports=DEREncoder,DEREncoder.prototype.encode=function(data,reporter){return this.tree._encode(data,reporter).join()},inherits(DERNode,base.Node),DERNode.prototype._encodeComposite=function(tag,primitive,cls,content){var encodedTag=encodeTag(tag,primitive,cls,this.reporter);if(content.length<128){var header=new Buffer(2);return header[0]=encodedTag,header[1]=content.length,this._createEncoderBuffer([header,content])}for(var lenOctets=1,i=content.length;i>=256;i>>=8)lenOctets++;var header=new Buffer(2+lenOctets);header[0]=encodedTag,header[1]=128|lenOctets;for(var i=1+lenOctets,j=content.length;j>0;i--,j>>=8)header[i]=255&j;return this._createEncoderBuffer([header,content])},DERNode.prototype._encodeStr=function(str,tag){if("bitstr"===tag)return this._createEncoderBuffer([0|str.unused,str.data]);if("bmpstr"===tag){for(var buf=new Buffer(2*str.length),i=0;i=40)return this.reporter.error("Second objid identifier OOB");id.splice(0,2,40*id[0]+id[1])}for(var size=0,i=0;i=128;ident>>=7)size++}for(var objid=new Buffer(size),offset=objid.length-1,i=id.length-1;i>=0;i--){var ident=id[i];for(objid[offset--]=127&ident;(ident>>=7)>0;)objid[offset--]=128|127&ident}return this._createEncoderBuffer(objid)},DERNode.prototype._encodeTime=function(time,tag){var str,date=new Date(time);return"gentime"===tag?str=[two(date.getFullYear()),two(date.getUTCMonth()+1),two(date.getUTCDate()),two(date.getUTCHours()),two(date.getUTCMinutes()),two(date.getUTCSeconds()),"Z"].join(""):"utctime"===tag?str=[two(date.getFullYear()%100),two(date.getUTCMonth()+1),two(date.getUTCDate()),two(date.getUTCHours()),two(date.getUTCMinutes()),two(date.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+tag+" time is not supported yet"),this._encodeStr(str,"octstr")},DERNode.prototype._encodeNull=function(){return this._createEncoderBuffer("")},DERNode.prototype._encodeInt=function(num,values){if("string"==typeof num){if(!values)return this.reporter.error("String int or enum given, but no values map");if(!values.hasOwnProperty(num))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(num));num=values[num]}if("number"!=typeof num&&!Buffer.isBuffer(num)){var numArray=num.toArray();!num.sign&&128&numArray[0]&&numArray.unshift(0),num=new Buffer(numArray)}if(Buffer.isBuffer(num)){var size=num.length;0===num.length&&size++;var out=new Buffer(size);return num.copy(out),0===num.length&&(out[0]=0),this._createEncoderBuffer(out)}if(num<128)return this._createEncoderBuffer(num);if(num<256)return this._createEncoderBuffer([0,num]);for(var size=1,i=num;i>=256;i>>=8)size++;for(var out=new Array(size),i=out.length-1;i>=0;i--)out[i]=255&num,num>>=8;return 128&out[0]&&out.unshift(0),this._createEncoderBuffer(new Buffer(out))},DERNode.prototype._encodeBool=function(value){return this._createEncoderBuffer(value?255:0)},DERNode.prototype._use=function(entity,obj){return"function"==typeof entity&&(entity=entity(obj)),entity._getEncoder("der").tree},DERNode.prototype._skipDefault=function(dataBuffer,reporter,parent){var i,state=this._baseState;if(null===state.default)return!1;var data=dataBuffer.join();if(void 0===state.defaultBuffer&&(state.defaultBuffer=this._encodeValue(state.default,reporter,parent).join()),data.length!==state.defaultBuffer.length)return!1;for(i=0;i2&&(result=(0,_slice2.default)(arguments,1)),results[key]=result,callback(err)})},function(err){callback(err,results)})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=_parallel;var _noop=__webpack_require__(29),_noop2=_interopRequireDefault(_noop),_isArrayLike=__webpack_require__(64),_isArrayLike2=_interopRequireDefault(_isArrayLike),_slice=__webpack_require__(48),_slice2=_interopRequireDefault(_slice),_wrapAsync=__webpack_require__(13),_wrapAsync2=_interopRequireDefault(_wrapAsync);module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _withoutIndex(iteratee){return function(value,index,callback){return iteratee(value,callback)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=_withoutIndex,module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0});var _reject=__webpack_require__(298),_reject2=_interopRequireDefault(_reject),_doParallel=__webpack_require__(72),_doParallel2=_interopRequireDefault(_doParallel);exports.default=(0,_doParallel2.default)(_reject2.default),module.exports=exports.default},function(module,exports,__webpack_require__){(function(Buffer){function normalizeInput(input){var ret;if(input instanceof Uint8Array)ret=input;else if(input instanceof Buffer)ret=new Uint8Array(input);else{if("string"!=typeof input)throw new Error(ERROR_MSG_INPUT);ret=new Uint8Array(Buffer.from(input,"utf8"))}return ret}function toHex(bytes){return Array.prototype.map.call(bytes,function(n){return(n<16?"0":"")+n.toString(16)}).join("")}function uint32ToHex(val){return(4294967296+val).toString(16).substring(1)}function debugPrint(label,arr,size){for(var msg="\n"+label+" = ",i=0;inew Date(val),1:val=>new Date(1e3*val),2:val=>utils.arrayBufferToBignumber(val),3:val=>c.NEG_ONE.minus(utils.arrayBufferToBignumber(val)),4:v=>{return c.TEN.pow(v[0]).times(v[1])},5:v=>{return c.TWO.pow(v[0]).times(v[1])},32:val=>url.parse(val),35:val=>new RegExp(val)},opts.tags),this.parser=parser(global,{log:console.log.bind(console),pushInt:this.pushInt.bind(this),pushInt32:this.pushInt32.bind(this),pushInt32Neg:this.pushInt32Neg.bind(this),pushInt64:this.pushInt64.bind(this),pushInt64Neg:this.pushInt64Neg.bind(this),pushFloat:this.pushFloat.bind(this),pushFloatSingle:this.pushFloatSingle.bind(this),pushFloatDouble:this.pushFloatDouble.bind(this),pushTrue:this.pushTrue.bind(this),pushFalse:this.pushFalse.bind(this),pushUndefined:this.pushUndefined.bind(this),pushNull:this.pushNull.bind(this),pushInfinity:this.pushInfinity.bind(this),pushInfinityNeg:this.pushInfinityNeg.bind(this),pushNaN:this.pushNaN.bind(this),pushNaNNeg:this.pushNaNNeg.bind(this),pushArrayStart:this.pushArrayStart.bind(this),pushArrayStartFixed:this.pushArrayStartFixed.bind(this),pushArrayStartFixed32:this.pushArrayStartFixed32.bind(this),pushArrayStartFixed64:this.pushArrayStartFixed64.bind(this),pushObjectStart:this.pushObjectStart.bind(this),pushObjectStartFixed:this.pushObjectStartFixed.bind(this),pushObjectStartFixed32:this.pushObjectStartFixed32.bind(this),pushObjectStartFixed64:this.pushObjectStartFixed64.bind(this),pushByteString:this.pushByteString.bind(this),pushByteStringStart:this.pushByteStringStart.bind(this),pushUtf8String:this.pushUtf8String.bind(this),pushUtf8StringStart:this.pushUtf8StringStart.bind(this),pushSimpleUnassigned:this.pushSimpleUnassigned.bind(this),pushTagUnassigned:this.pushTagUnassigned.bind(this),pushTagStart:this.pushTagStart.bind(this),pushTagStart4:this.pushTagStart4.bind(this),pushTagStart8:this.pushTagStart8.bind(this),pushBreak:this.pushBreak.bind(this)},this._heap)}get _depth(){return this._parents.length}get _currentParent(){return this._parents[this._depth-1]}get _ref(){return this._currentParent.ref}_closeParent(){var p=this._parents.pop();if(p.length>0)throw new Error(`Missing ${p.length} elements`);switch(p.type){case c.PARENT.TAG:this._push(this.createTag(p.ref[0],p.ref[1]));break;case c.PARENT.BYTE_STRING:this._push(this.createByteString(p.ref,p.length));break;case c.PARENT.UTF8_STRING:this._push(this.createUtf8String(p.ref,p.length));break;case c.PARENT.MAP:if(p.values%2>0)throw new Error("Odd number of elements in the map");this._push(this.createMap(p.ref,p.length));break;case c.PARENT.OBJECT:if(p.values%2>0)throw new Error("Odd number of elements in the map");this._push(this.createObject(p.ref,p.length));break;case c.PARENT.ARRAY:this._push(this.createArray(p.ref,p.length))}this._currentParent&&this._currentParent.type===c.PARENT.TAG&&this._dec()}_dec(){const p=this._currentParent;p.length<0||0===--p.length&&this._closeParent()}_push(val,hasChildren){const p=this._currentParent;switch(p.values++,p.type){case c.PARENT.ARRAY:case c.PARENT.BYTE_STRING:case c.PARENT.UTF8_STRING:p.length>-1?this._ref[this._ref.length-p.length]=val:this._ref.push(val),this._dec();break;case c.PARENT.OBJECT:null!=p.tmpKey?(this._ref[p.tmpKey]=val,p.tmpKey=null,this._dec()):(p.tmpKey=val,"string"!=typeof p.tmpKey&&(p.type=c.PARENT.MAP,p.ref=utils.buildMap(p.ref)));break;case c.PARENT.MAP:null!=p.tmpKey?(this._ref.set(p.tmpKey,val),p.tmpKey=null,this._dec()):p.tmpKey=val;break;case c.PARENT.TAG:this._ref.push(val),hasChildren||this._dec();break;default:throw new Error("Unknown parent type")}}_createParent(obj,type,len){this._parents[this._depth]={type:type,length:len,ref:obj,values:0,tmpKey:null}}_reset(){this._res=[],this._parents=[{type:c.PARENT.ARRAY,length:-1,ref:this._res,values:0,tmpKey:null}]}createTag(tagNumber,value){const typ=this._knownTags[tagNumber];return typ?typ(value):new Tagged(tagNumber,value)}createMap(obj,len){return obj}createObject(obj,len){return obj}createArray(arr,len){return arr}createByteString(raw,len){return Buffer.concat(raw)}createByteStringFromHeap(start,end){return new Buffer(start===end?0:this._heap.slice(start,end))}createInt(val){return val}createInt32(f,g){return utils.buildInt32(f,g)}createInt64(f1,f2,g1,g2){return utils.buildInt64(f1,f2,g1,g2)}createFloat(val){return val}createFloatSingle(a,b,c,d){return ieee754.read([a,b,c,d],0,!1,23,4)}createFloatDouble(a,b,c,d,e,f,g,h){return ieee754.read([a,b,c,d,e,f,g,h],0,!1,52,8)}createInt32Neg(f,g){return-1-utils.buildInt32(f,g)}createInt64Neg(f1,f2,g1,g2){const f=utils.buildInt32(f1,f2),g=utils.buildInt32(g1,g2);return f>c.MAX_SAFE_HIGH?c.NEG_ONE.sub(new Bignumber(f).times(c.SHIFT32).plus(g)):-1-(f*c.SHIFT32+g)}createTrue(){return!0}createFalse(){return!1}createNull(){return null}createUndefined(){}createInfinity(){return 1/0}createInfinityNeg(){return-(1/0)}createNaN(){return NaN}createNaNNeg(){return NaN}createUtf8String(raw,len){return raw.join("")}createUtf8StringFromHeap(start,end){return start===end?"":new Buffer(this._heap.slice(start,end)).toString("utf8")}createSimpleUnassigned(val){return new Simple(val)}pushInt(val){this._push(this.createInt(val))}pushInt32(f,g){this._push(this.createInt32(f,g))}pushInt64(f1,f2,g1,g2){this._push(this.createInt64(f1,f2,g1,g2))}pushFloat(val){this._push(this.createFloat(val))}pushFloatSingle(a,b,c,d){this._push(this.createFloatSingle(a,b,c,d))}pushFloatDouble(a,b,c,d,e,f,g,h){this._push(this.createFloatDouble(a,b,c,d,e,f,g,h))}pushInt32Neg(f,g){this._push(this.createInt32Neg(f,g))}pushInt64Neg(f1,f2,g1,g2){this._push(this.createInt64Neg(f1,f2,g1,g2))}pushTrue(){this._push(this.createTrue())}pushFalse(){this._push(this.createFalse())}pushNull(){this._push(this.createNull())}pushUndefined(){this._push(this.createUndefined())}pushInfinity(){this._push(this.createInfinity())}pushInfinityNeg(){this._push(this.createInfinityNeg())}pushNaN(){this._push(this.createNaN())}pushNaNNeg(){this._push(this.createNaNNeg())}pushArrayStart(){this._createParent([],c.PARENT.ARRAY,-1)}pushArrayStartFixed(len){this._createArrayStartFixed(len)}pushArrayStartFixed32(len1,len2){const len=utils.buildInt32(len1,len2);this._createArrayStartFixed(len)}pushArrayStartFixed64(len1,len2,len3,len4){const len=utils.buildInt64(len1,len2,len3,len4);this._createArrayStartFixed(len)}pushObjectStart(){this._createObjectStartFixed(-1)}pushObjectStartFixed(len){this._createObjectStartFixed(len)}pushObjectStartFixed32(len1,len2){const len=utils.buildInt32(len1,len2);this._createObjectStartFixed(len)}pushObjectStartFixed64(len1,len2,len3,len4){const len=utils.buildInt64(len1,len2,len3,len4);this._createObjectStartFixed(len)}pushByteStringStart(){this._parents[this._depth]={type:c.PARENT.BYTE_STRING,length:-1,ref:[],values:0,tmpKey:null}}pushByteString(start,end){this._push(this.createByteStringFromHeap(start,end))}pushUtf8StringStart(){this._parents[this._depth]={type:c.PARENT.UTF8_STRING,length:-1,ref:[],values:0,tmpKey:null}}pushUtf8String(start,end){this._push(this.createUtf8StringFromHeap(start,end))}pushSimpleUnassigned(val){this._push(this.createSimpleUnassigned(val))}pushTagStart(tag){this._parents[this._depth]={type:c.PARENT.TAG,length:1,ref:[tag]}}pushTagStart4(f,g){this.pushTagStart(utils.buildInt32(f,g))}pushTagStart8(f1,f2,g1,g2){this.pushTagStart(utils.buildInt64(f1,f2,g1,g2))}pushTagUnassigned(tagNumber){ -this._push(this.createTag(tagNumber))}pushBreak(){if(this._currentParent.length>-1)throw new Error("Unexpected break");this._closeParent()}_createObjectStartFixed(len){if(0===len)return void this._push(this.createObject({}));this._createParent({},c.PARENT.OBJECT,len)}_createArrayStartFixed(len){if(0===len)return void this._push(this.createArray([]));this._createParent(new Array(len),c.PARENT.ARRAY,len)}_decode(input){if(0===input.byteLength)throw new Error("Input too short");this._reset(),this._heap8.set(input);const code=this.parser.parse(input.byteLength);if(this._depth>1){for(;0===this._currentParent.length;)this._closeParent();if(this._depth>1)throw new Error("Undeterminated nesting")}if(code>0)throw new Error("Failed to parse");if(0===this._res.length)throw new Error("No valid result")}decodeFirst(input){return this._decode(input),this._res[0]}decodeAll(input){return this._decode(input),this._res}static decode(input,enc){return"string"==typeof input&&(input=new Buffer(input,enc||"hex")),new Decoder({size:input.length}).decodeFirst(input)}static decodeAll(input,enc){return"string"==typeof input&&(input=new Buffer(input,enc||"hex")),new Decoder({size:input.length}).decodeAll(input)}}Decoder.decodeFirst=Decoder.decode,module.exports=Decoder}).call(exports,__webpack_require__(2),__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const constants=__webpack_require__(76),MT=constants.MT,SIMPLE=constants.SIMPLE,SYMS=constants.SYMS;class Simple{constructor(value){if("number"!=typeof value)throw new Error("Invalid Simple type: "+typeof value);if(value<0||value>255||(0|value)!==value)throw new Error("value must be a small positive integer: "+value);this.value=value}toString(){return"simple("+this.value+")"}inspect(){return"simple("+this.value+")"}encodeCBOR(gen){return gen._pushInt(this.value,MT.SIMPLE_FLOAT)}static isSimple(obj){return obj instanceof Simple}static decode(val,hasParent){switch(null==hasParent&&(hasParent=!0),val){case SIMPLE.FALSE:return!1;case SIMPLE.TRUE:return!0;case SIMPLE.NULL:return hasParent?null:SYMS.NULL;case SIMPLE.UNDEFINED:return hasParent?void 0:SYMS.UNDEFINED;case-1:if(!hasParent)throw new Error("Invalid BREAK");return SYMS.BREAK;default:return new Simple(val)}}}module.exports=Simple},function(module,exports,__webpack_require__){"use strict";class Tagged{constructor(tag,value,err){if(this.tag=tag,this.value=value,this.err=err,"number"!=typeof this.tag)throw new Error("Invalid tag type ("+typeof this.tag+")");if(this.tag<0||(0|this.tag)!==this.tag)throw new Error("Tag must be a positive integer: "+this.tag)}toString(){return`${this.tag}(${JSON.stringify(this.value)})`}encodeCBOR(gen){return gen._pushTag(this.tag),gen.pushAny(this.value)}convert(converters){var er,f;if("function"!=typeof(f=null!=converters?converters[this.tag]:void 0)&&"function"!=typeof(f=Tagged["_tag"+this.tag]))return this;try{return f.call(Tagged,this.value)}catch(error){return er=error,this.err=er,this}}}module.exports=Tagged},function(module,exports,__webpack_require__){(function(Buffer){function StreamCipher(mode,key,iv,decrypt){if(!(this instanceof StreamCipher))return new StreamCipher(mode,key,iv);Transform.call(this),this._finID=Buffer.concat([iv,new Buffer([0,0,0,1])]),iv=Buffer.concat([iv,new Buffer([0,0,0,2])]),this._cipher=new aes.AES(key),this._prev=new Buffer(iv.length),this._cache=new Buffer(""),this._secCache=new Buffer(""),this._decrypt=decrypt,this._alen=0,this._len=0,iv.copy(this._prev),this._mode=mode;var h=new Buffer(4);h.fill(0),this._ghash=new GHASH(this._cipher.encryptBlock(h)),this._authTag=null,this._called=!1}function xorTest(a,b){var out=0;a.length!==b.length&&out++;for(var len=Math.min(a.length,b.length),i=-1;++i>i%8,self._prev=shiftIn(self._prev,decrypt?bit:value);return out}function shiftIn(buffer,value){var len=buffer.length,i=-1,out=new Buffer(buffer.length);for(buffer=Buffer.concat([buffer,new Buffer([value])]);++i>7;return out}exports.encrypt=function(self,chunk,decrypt){for(var len=chunk.length,out=new Buffer(len),i=-1;++i{const key=new Key(path).child(new Key(SHARDING_FN));("function"==typeof store.getRaw?store.getRaw.bind(store):store.get.bind(store))(key,(err,res)=>{if(err)return callback(err);let shard;try{shard=parseShardFun((res||"").toString().trim())}catch(err){return callback(err)}callback(null,shard)})}),exports.readme=readme,exports.parseShardFun=parseShardFun,exports.Prefix=Prefix,exports.Suffix=Suffix,exports.NextToLast=NextToLast},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function isSpecificValue(val){return val instanceof Buffer||val instanceof Date||val instanceof RegExp}function cloneSpecificValue(val){if(val instanceof Buffer){var x=new Buffer(val.length);return val.copy(x),x}if(val instanceof Date)return new Date(val.getTime());if(val instanceof RegExp)return new RegExp(val);throw new Error("Unexpected situation")}function deepCloneArray(arr){var clone=[];return arr.forEach(function(item,index){"object"==typeof item&&null!==item?Array.isArray(item)?clone[index]=deepCloneArray(item):isSpecificValue(item)?clone[index]=cloneSpecificValue(item):clone[index]=deepExtend({},item):clone[index]=item}),clone}var deepExtend=module.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var val,src,target=arguments[0],args=Array.prototype.slice.call(arguments,1);return args.forEach(function(obj){"object"!=typeof obj||null===obj||Array.isArray(obj)||Object.keys(obj).forEach(function(key){return src=target[key],val=obj[key],val===target?void 0:"object"!=typeof val||null===val?void(target[key]=val):Array.isArray(val)?void(target[key]=deepCloneArray(val)):isSpecificValue(val)?void(target[key]=cloneSpecificValue(val)):"object"!=typeof src||null===src||Array.isArray(src)?void(target[key]=deepExtend({},val)):void(target[key]=deepExtend(src,val))})}),target}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(process){function AbstractChainedBatch(db){this._db=db,this._operations=[],this._written=!1}AbstractChainedBatch.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},AbstractChainedBatch.prototype.put=function(key,value){this._checkWritten();var err=this._db._checkKey(key,"key",this._db._isBuffer);if(err)throw err;return this._db._isBuffer(key)||(key=String(key)),this._db._isBuffer(value)||(value=String(value)),"function"==typeof this._put?this._put(key,value):this._operations.push({type:"put",key:key,value:value}),this},AbstractChainedBatch.prototype.del=function(key){this._checkWritten();var err=this._db._checkKey(key,"key",this._db._isBuffer);if(err)throw err;return this._db._isBuffer(key)||(key=String(key)),"function"==typeof this._del?this._del(key):this._operations.push({type:"del",key:key}),this},AbstractChainedBatch.prototype.clear=function(){return this._checkWritten(),this._operations=[],"function"==typeof this._clear&&this._clear(),this},AbstractChainedBatch.prototype.write=function(options,callback){if(this._checkWritten(),"function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("write() requires a callback argument");return"object"!=typeof options&&(options={}),this._written=!0,"function"==typeof this._write?this._write(callback):"function"==typeof this._db._batch?this._db._batch(this._operations,options,callback):void process.nextTick(callback)},module.exports=AbstractChainedBatch}).call(exports,__webpack_require__(5))},function(module,exports,__webpack_require__){(function(process){function AbstractIterator(db){this.db=db,this._ended=!1,this._nexting=!1}AbstractIterator.prototype.next=function(callback){var self=this;if("function"!=typeof callback)throw new Error("next() requires a callback argument");return self._ended?callback(new Error("cannot call next() after end()")):self._nexting?callback(new Error("cannot call next() before previous next() has completed")):(self._nexting=!0,"function"==typeof self._next?self._next(function(){self._nexting=!1,callback.apply(null,arguments)}):void process.nextTick(function(){self._nexting=!1,callback()}))},AbstractIterator.prototype.end=function(callback){if("function"!=typeof callback)throw new Error("end() requires a callback argument");return this._ended?callback(new Error("end() already called on iterator")):(this._ended=!0,"function"==typeof this._end?this._end(callback):void process.nextTick(callback))},module.exports=AbstractIterator}).call(exports,__webpack_require__(5))},function(module,exports,__webpack_require__){(function(process,Buffer){function AbstractLevelDOWN(location){if(!arguments.length||void 0===location)throw new Error("constructor requires at least a location argument");if("string"!=typeof location)throw new Error("constructor requires a location string argument");this.location=location,this.status="new"}var xtend=__webpack_require__(38),AbstractIterator=__webpack_require__(177),AbstractChainedBatch=__webpack_require__(176);AbstractLevelDOWN.prototype.open=function(options,callback){var self=this,oldStatus=this.status;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("open() requires a callback argument");"object"!=typeof options&&(options={}),options.createIfMissing=0!=options.createIfMissing,options.errorIfExists=!!options.errorIfExists,"function"==typeof this._open?(this.status="opening",this._open(options,function(err){if(err)return self.status=oldStatus,callback(err);self.status="open",callback()})):(this.status="open",process.nextTick(callback))},AbstractLevelDOWN.prototype.close=function(callback){var self=this,oldStatus=this.status;if("function"!=typeof callback)throw new Error("close() requires a callback argument");"function"==typeof this._close?(this.status="closing",this._close(function(err){if(err)return self.status=oldStatus,callback(err);self.status="closed",callback()})):(this.status="closed",process.nextTick(callback))},AbstractLevelDOWN.prototype.get=function(key,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("get() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),"object"!=typeof options&&(options={}),options.asBuffer=0!=options.asBuffer,"function"==typeof this._get?this._get(key,options,callback):void process.nextTick(function(){callback(new Error("NotFound"))}))},AbstractLevelDOWN.prototype.put=function(key,value,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("put() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),null==value||this._isBuffer(value)||process.browser||(value=String(value)),"object"!=typeof options&&(options={}),"function"==typeof this._put?this._put(key,value,options,callback):void process.nextTick(callback))},AbstractLevelDOWN.prototype.del=function(key,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("del() requires a callback argument");return(err=this._checkKey(key,"key",this._isBuffer))?callback(err):(this._isBuffer(key)||(key=String(key)),"object"!=typeof options&&(options={}),"function"==typeof this._del?this._del(key,options,callback):void process.nextTick(callback))},AbstractLevelDOWN.prototype.batch=function(array,options,callback){if(!arguments.length)return this._chainedBatch();if("function"==typeof options&&(callback=options),"function"==typeof array&&(callback=array),"function"!=typeof callback)throw new Error("batch(array) requires a callback argument");if(!Array.isArray(array))return callback(new Error("batch(array) requires an array argument"));options&&"object"==typeof options||(options={});for(var e,err,i=0,l=array.length;iparams.maximumExtraDataSize.v?cb("invalid amount of extra data"):void cb():cb("invalid gas limit"):cb("invalid Difficulty")})},BlockHeader.prototype.hash=function(){return utils.rlphash(this.raw)},BlockHeader.prototype.isGenesis=function(){return""===this.number.toString("hex")},BlockHeader.prototype.isHomestead=function(){return utils.bufferToInt(this.number)>=params.homeSteadForkNumber.v},BlockHeader.prototype.isHomesteadReprice=function(){return utils.bufferToInt(this.number)>=params.homesteadRepriceForkNumber.v}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){const SHA3=__webpack_require__(460),secp256k1=__webpack_require__(144),assert=__webpack_require__(9),rlp=__webpack_require__(45),BN=__webpack_require__(14),createHash=__webpack_require__(59);exports.MAX_INTEGER=new BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),exports.TWO_POW256=new BN("10000000000000000000000000000000000000000000000000000000000000000",16),exports.SHA3_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",exports.SHA3_NULL=new Buffer(exports.SHA3_NULL_S,"hex"),exports.SHA3_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",exports.SHA3_RLP_ARRAY=new Buffer(exports.SHA3_RLP_ARRAY_S,"hex"),exports.SHA3_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",exports.SHA3_RLP=new Buffer(exports.SHA3_RLP_S,"hex"),exports.BN=BN,exports.rlp=rlp,exports.secp256k1=secp256k1,exports.zeros=function(bytes){var buf=new Buffer(bytes);return buf.fill(0),buf},exports.setLengthLeft=exports.setLength=function(msg,length,right){var buf=exports.zeros(length);return msg=exports.toBuffer(msg),right?msg.length0&&"0"===first.toString();)a=a.slice(1),first=a[0];return a},exports.toBuffer=function(v){if(!Buffer.isBuffer(v))if(Array.isArray(v))v=new Buffer(v);else if("string"==typeof v)v=exports.isHexPrefixed(v)?new Buffer(exports.padToEven(exports.stripHexPrefix(v)),"hex"):new Buffer(v);else if("number"==typeof v)v=exports.intToBuffer(v);else if(null===v||void 0===v)v=new Buffer([]);else{if(!v.toArray)throw new Error("invalid type");v=new Buffer(v.toArray())}return v},exports.intToHex=function(i){assert(i%1==0,"number is not a integer"),assert(i>=0,"number must be positive");var hex=i.toString(16);return hex.length%2&&(hex="0"+hex),"0x"+hex},exports.intToBuffer=function(i){return new Buffer(exports.intToHex(i).slice(2),"hex")},exports.bufferToInt=function(buf){return parseInt(exports.bufferToHex(buf),16)},exports.bufferToHex=function(buf){return buf=exports.toBuffer(buf),0===buf.length?0:"0x"+buf.toString("hex")},exports.fromSigned=function(num){return new BN(num).fromTwos(256)},exports.toUnsigned=function(num){return new Buffer(num.toTwos(256).toArray())},exports.sha3=function(a,bytes){a=exports.toBuffer(a),bytes||(bytes=256);var h=new SHA3(bytes);return a&&h.update(a),new Buffer(h.digest("hex"),"hex")},exports.sha256=function(a){return a=exports.toBuffer(a),createHash("sha256").update(a).digest()},exports.ripemd160=function(a,padded){a=exports.toBuffer(a);var hash=createHash("rmd160").update(a).digest();return padded===!0?exports.setLength(hash,32):hash},exports.rlphash=function(a){return exports.sha3(rlp.encode(a))},exports.isValidPrivate=function(privateKey){return secp256k1.privateKeyVerify(privateKey)},exports.isValidPublic=function(publicKey,sanitize){return 64===publicKey.length?secp256k1.publicKeyVerify(Buffer.concat([new Buffer([4]),publicKey])):!!sanitize&&secp256k1.publicKeyVerify(publicKey)},exports.pubToAddress=exports.publicToAddress=function(pubKey,sanitize){return pubKey=exports.toBuffer(pubKey),sanitize&&64!==pubKey.length&&(pubKey=secp256k1.publicKeyConvert(pubKey,!1).slice(1)), -assert(64===pubKey.length),exports.sha3(pubKey).slice(-20)};var privateToPublic=exports.privateToPublic=function(privateKey){return privateKey=exports.toBuffer(privateKey),secp256k1.publicKeyCreate(privateKey,!1).slice(1)};exports.importPublic=function(publicKey){return publicKey=exports.toBuffer(publicKey),64!==publicKey.length&&(publicKey=secp256k1.publicKeyConvert(publicKey,!1).slice(1)),publicKey},exports.ecsign=function(msgHash,privateKey){var sig=secp256k1.sign(msgHash,privateKey),ret={};return ret.r=sig.signature.slice(0,32),ret.s=sig.signature.slice(32,64),ret.v=sig.recovery+27,ret},exports.ecrecover=function(msgHash,v,r,s){var signature=Buffer.concat([exports.setLength(r,32),exports.setLength(s,32)],64),recovery=exports.bufferToInt(v)-27;if(0!==recovery&&1!==recovery)throw new Error("Invalid signature v value");var senderPubKey=secp256k1.recover(msgHash,signature,recovery);return secp256k1.publicKeyConvert(senderPubKey,!1).slice(1)},exports.toRpcSig=function(v,r,s){return exports.bufferToHex(Buffer.concat([r,s,exports.toBuffer(v-27)]))},exports.fromRpcSig=function(sig){sig=exports.toBuffer(sig);var v=sig[64];return v<27&&(v+=27),{v:v,r:sig.slice(0,32),s:sig.slice(32,64)}},exports.privateToAddress=function(privateKey){return exports.publicToAddress(privateToPublic(privateKey))},exports.isValidAddress=function(address){return/^0x[0-9a-fA-F]{40}$/i.test(address)},exports.toChecksumAddress=function(address){address=exports.stripHexPrefix(address).toLowerCase();for(var hash=exports.sha3(address).toString("hex"),ret="0x",i=0;i=8?address[i].toUpperCase():address[i];return ret},exports.isValidChecksumAddress=function(address){return exports.isValidAddress(address)&&exports.toChecksumAddress(address)===address},exports.generateAddress=function(from,nonce){return from=exports.toBuffer(from),nonce=new BN(nonce),nonce=nonce.isZero()?null:new Buffer(nonce.toArray()),exports.rlphash([from,nonce]).slice(-20)},exports.isPrecompiled=function(address){var a=exports.unpad(address);return 1===a.length&&a[0]>0&&a[0]<5},exports.isHexPrefixed=function(str){return"0x"===str.slice(0,2)},exports.stripHexPrefix=function(str){return"string"!=typeof str?str:exports.isHexPrefixed(str)?str.slice(2):str},exports.addHexPrefix=function(str){return"string"!=typeof str?str:exports.isHexPrefixed(str)?str:"0x"+str},exports.padToEven=function(a){return a.length%2&&(a="0"+a),a},exports.baToJSON=function(ba){if(Buffer.isBuffer(ba))return"0x"+ba.toString("hex");if(ba instanceof Array){for(var array=[],i=0;i=v.length,"The field "+field.name+" must not have more "+field.length+" bytes")):field.allowZero&&0===v.length||!field.length||assert(field.length===v.length,"The field "+field.name+" must have byte length of "+field.length),self.raw[i]=v}self._fields.push(field.name),Object.defineProperty(self,field.name,{enumerable:!0,configurable:!0,get:getter,set:setter}),field.default&&(self[field.name]=field.default),field.alias&&Object.defineProperty(self,field.alias,{enumerable:!1,configurable:!0,set:setter,get:getter})}),data)if("string"==typeof data&&(data=new Buffer(exports.stripHexPrefix(data),"hex")),Buffer.isBuffer(data)&&(data=rlp.decode(data)),Array.isArray(data)){if(data.length>self._fields.length)throw new Error("wrong number of fields in data");data.forEach(function(d,i){self[self._fields[i]]=exports.toBuffer(d)})}else{if("object"!=typeof data)throw new Error("invalid data");for(var prop in data)self._fields.indexOf(prop)!==-1&&(self[prop]=data[prop])}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function padToEven(value){var a=value;if("string"!=typeof a)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof a+", while padToEven.");return a.length%2&&(a="0"+a),a}function intToHex(i){return"0x"+padToEven(i.toString(16))}function intToBuffer(i){return new Buffer(intToHex(i).slice(2),"hex")}function getBinarySize(str){if("string"!=typeof str)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof str+"'.");return Buffer.byteLength(str,"utf8")}function arrayContainsArray(superset,subset,some){if(Array.isArray(superset)!==!0)throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof superset+"'");if(Array.isArray(subset)!==!0)throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof subset+"'");return subset[Boolean(some)&&"some"||"every"](function(value){return superset.indexOf(value)>=0})}function toUtf8(hex){return new Buffer(padToEven(stripHexPrefix(hex).replace(/^0+|0+$/g,"")),"hex").toString("utf8")}function toAscii(hex){var str="",i=0,l=hex.length;for("0x"===hex.substring(0,2)&&(i=2);i0&&bufs.push(md_buf),bufs.push(password),salt&&bufs.push(salt),md_buf=md5(Buffer.concat(bufs)),bufs=[],i=0,keyLen>0)for(;;){if(0===keyLen)break;if(i===md_buf.length)break;key[ki++]=md_buf[i],keyLen--,i++}if(ivLen>0&&i!==md_buf.length)for(;;){if(0===ivLen)break;if(i===md_buf.length)break;iv[ii++]=md_buf[i],ivLen--,i++}if(0===keyLen&&0===ivLen)break}for(i=0;i>>3}function g1_256(x){return rotr32(x,17)^rotr32(x,19)^x>>>10}var utils=__webpack_require__(27),rotr32=utils.rotr32;exports.ft_1=ft_1,exports.ch32=ch32,exports.maj32=maj32,exports.p32=p32,exports.s0_256=s0_256,exports.s1_256=s1_256,exports.g0_256=g0_256,exports.g1_256=g1_256},function(module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=8*nBytes-mLen-1,eMax=(1<>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];for(i+=d,e=s&(1<<-nBits)-1,s>>=-nBits,nBits+=eLen;nBits>0;e=256*e+buffer[offset+i],i+=d,nBits-=8);for(m=e&(1<<-nBits)-1,e>>=-nBits,nBits+=mLen;nBits>0;m=256*m+buffer[offset+i],i+=d,nBits-=8);if(0===e)e=1-eBias;else{if(e===eMax)return m?NaN:1/0*(s?-1:1);m+=Math.pow(2,mLen),e-=eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)},exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c,eLen=8*nBytes-mLen-1,eMax=(1<>1,rt=23===mLen?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||0===value&&1/value<0?1:0;for(value=Math.abs(value),isNaN(value)||value===1/0?(m=isNaN(value)?1:0,e=eMax):(e=Math.floor(Math.log(value)/Math.LN2),value*(c=Math.pow(2,-e))<1&&(e--,c*=2),value+=e+eBias>=1?rt/c:rt*Math.pow(2,1-eBias),value*c>=2&&(e++,c/=2),e+eBias>=eMax?(m=0,e=eMax):e+eBias>=1?(m=(value*c-1)*Math.pow(2,mLen),e+=eBias):(m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen),e=0));mLen>=8;buffer[offset+i]=255&m,i+=d,m/=256,mLen-=8);for(e=e<0;buffer[offset+i]=255&e,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=128*s}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function namespaceType(ns){const parts=ns.split(":");return parts.length<2?"":parts.slice(0,-1).join(":")}function namespaceValue(ns){const parts=ns.split(":");return parts[parts.length-1]}const path=__webpack_require__(43),uuid=__webpack_require__(273),pathSepS=path.sep,pathSep=new Buffer(pathSepS,"utf8")[0];class Key{constructor(s,clean){if("string"==typeof s?this._buf=new Buffer(s):Buffer.isBuffer(s)&&(this._buf=s),null==clean&&(clean=!0),clean&&this.clean(),0===this._buf.length||this._buf[0]!==pathSep)throw new Error(`Invalid key: ${this.toString()}`)}toString(encoding){return this._buf.toString(encoding||"utf8")}toBuffer(){return this._buf}get[Symbol.toStringTag](){return`[Key ${this.toString()}]`}static withNamespaces(list){return new Key(list.join(pathSepS))}static random(){return new Key(uuid().replace(/-/g,""))}clean(){this._buf&&0!==this._buf.length||(this._buf=new Buffer(pathSepS,"utf8")),this._buf=new Buffer(path.normalize(this.toString())),this._buf[0]!==pathSep&&(this._buf=Buffer.concat([new Buffer(pathSepS,"utf8"),this._buf])),this.toString().length>1&&this._buf[this._buf.length-1]===pathSep&&(this._buf=this._buf.slice(0,-1))}less(key){const list1=this.list(),list2=key.list();for(let i=0;ic2)return!1}return list1.length{cb(err&&!cond(err)?err:null)}}function ignoringAlreadyOpened(cb){return ignoringIf(err=>"Already open"===err.message,cb)}function ignoringNotFound(cb){return ignoringIf(err=>err.message.startsWith("ENOENT"),cb)}function buildOptions(_options){const options=Object.assign({},defaultOptions,_options);return options.storageBackends=Object.assign({},defaultOptions.storageBackends,options.storageBackends),options.storageBackendOptions=Object.assign({},defaultOptions.storageBackendOptions,options.storageBackendOptions),options}const waterfall=__webpack_require__(7),series=__webpack_require__(33),parallel=__webpack_require__(39),each=__webpack_require__(19),assert=__webpack_require__(9),path=__webpack_require__(43),debug=__webpack_require__(3),backends=__webpack_require__(399),version=__webpack_require__(403),config=__webpack_require__(401),apiAddr=__webpack_require__(398),blockstore=__webpack_require__(400),defaultOptions=__webpack_require__(402),log=debug("repo"),lockers={memory:__webpack_require__(194),fs:__webpack_require__(194)};class IpfsRepo{constructor(repoPath,options){assert.equal(typeof repoPath,"string","missing repoPath"),this.options=buildOptions(options),this.closed=!0,this.path=repoPath,this._locker=lockers[this.options.lock],assert(this._locker,"Unknown lock type: "+this.options.lock),this.root=backends.create("root",this.path,this.options),this.version=version(this.root),this.config=config(this.root),this.apiAddr=apiAddr(this.root)}init(config,callback){log("initializing at: %s",this.path),series([cb=>this.root.open(ignoringAlreadyOpened(cb)),cb=>this.config.set(config,cb),cb=>this.version.set(5,cb)],callback)}open(callback){if(!this.closed)return void setImmediate(()=>callback(new Error("repo is already open")));log("opening at: %s",this.path),waterfall([cb=>this.root.open(ignoringAlreadyOpened(cb)),cb=>this._isInitialized(cb),cb=>this._locker.lock(this.path,cb),(lck,cb)=>{log("aquired repo.lock"),this.lockfile=lck,cb()},cb=>{log("creating datastore"),this.datastore=backends.create("datastore",path.join(this.path,"datastore"),this.options),log("creating blocks"),blockstore(backends.create("blocks",path.join(this.path,"blocks"),this.options),this.options.storageBackendOptions.blocks,cb)},(blocks,cb)=>{this.blocks=blocks,cb()},cb=>{this.closed=!1,log("all opened"),cb()}],err=>{err&&this.lockfile?this.lockfile.close(err2=>{err2?log("error removing lock",err2):this.lockfile=null,callback(err)}):callback(err)})}_isInitialized(callback){log("init check"),parallel({config:cb=>this.config.exists(cb),version:cb=>this.version.check(5,cb)},(err,res)=>{return log("init",err,res),err?callback(err):res.config?void callback():callback(new Error("repo is not initialized yet"))})}close(callback){if(this.closed)return callback(new Error("repo is already closed"));log("closing at: %s",this.path),series([cb=>this.apiAddr.delete(ignoringNotFound(cb)),cb=>{each([this.blocks,this.datastore],(store,callback)=>store.close(callback),cb)},cb=>{log("unlocking"),this.closed=!0,this.lockfile.close(cb)},cb=>{this.lockfile=null,cb()}],err=>callback(err))}exists(callback){this.version.exists(callback)}}module.exports=IpfsRepo}).call(exports,__webpack_require__(37).setImmediate)},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),setImmediate=__webpack_require__(10),log=debug("repo:lock"),LOCKS={};exports.lock=((dir,callback)=>{const file=dir+"/repo.lock";log("locking %s",file),LOCKS[file]=!0;const closer={close(cb){LOCKS[file]&&delete LOCKS[file],setImmediate(cb)}};setImmediate(()=>{callback(null,closer)})}),exports.locked=((dir,callback)=>{const file=dir+"/repo.lock";log("checking lock: %s");const locked=LOCKS[file];setImmediate(()=>{callback(null,locked)})})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function flattenObject(obj,delimiter){return delimiter=delimiter||"/",0===Object.keys(obj).length?[]:traverse(obj).reduce(function(acc,x){"object"==typeof x&&x["/"]&&this.update(void 0);const path=this.path.join(delimiter);return""!==path&&acc.push({path:path,value:x}),acc},[])}const util=__webpack_require__(196),traverse=__webpack_require__(669);exports=module.exports,exports.multicodec="dag-cbor",exports.resolve=((block,path,callback)=>{"function"==typeof path&&(callback=path,path=void 0),util.deserialize(block.data,(err,node)=>{if(err)return callback(err);if(!path||"/"===path)return callback(null,{value:node,remainderPath:""});const parts=path.split("/"),val=traverse(node).get(parts);if(val)return callback(null,{value:val,remainderPath:""});let value,len=parts.length;for(let i=0;i{"function"==typeof options&&(callback=options,options=void 0),options=options||{},util.deserialize(block.data,(err,node)=>{if(err)return callback(err);callback(null,flattenObject(node).map(el=>el.path))})}),exports.isLink=((block,path,callback)=>{exports.resolve(block,path,(err,result)=>{return err?callback(err):result.remainderPath.length>0?callback(new Error("path out of scope")):void("object"==typeof result.value&&result.value["/"]?callback(null,result.value):callback(null,!1))})})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function tagCID(cid){return"string"==typeof cid&&(cid=new CID(cid).buffer),new cbor.Tagged(CID_CBOR_TAG,Buffer.concat([new Buffer("00","hex"),cid]))}function replaceCIDbyTAG(dagNode){function transform(obj){if(!obj||Buffer.isBuffer(obj)||"string"==typeof obj)return obj;if(Array.isArray(obj))return obj.map(transform);const keys=Object.keys(obj);if(1===keys.length&&"/"===keys[0])return tagCID(obj["/"]);if(keys.length>0){let out={};return keys.forEach(key=>{"object"==typeof obj[key]?out[key]=transform(obj[key]):out[key]=obj[key]}),out}return obj}let circular;try{circular=isCircular(dagNode)}catch(e){circular=!1}if(circular)throw new Error("The object passed has circular references");return transform(dagNode)}const cbor=__webpack_require__(314),multihashing=__webpack_require__(21),CID=__webpack_require__(8),waterfall=__webpack_require__(7),setImmediate=__webpack_require__(10),isCircular=__webpack_require__(448),resolver=__webpack_require__(195),CID_CBOR_TAG=42,decoder=new cbor.Decoder({tags:{[CID_CBOR_TAG]:val=>{return val=val.slice(1),{"/":val}}}});exports=module.exports,exports.serialize=((dagNode,callback)=>{let serialized;try{const dagNodeTagged=replaceCIDbyTAG(dagNode);serialized=cbor.encode(dagNodeTagged)}catch(err){return setImmediate(()=>callback(err))}setImmediate(()=>callback(null,serialized))}),exports.deserialize=((data,callback)=>{let deserialized;try{deserialized=decoder.decodeFirst(data)}catch(err){return setImmediate(()=>callback(err))}setImmediate(()=>callback(null,deserialized))}),exports.cid=((dagNode,callback)=>{waterfall([cb=>exports.serialize(dagNode,cb),(serialized,cb)=>multihashing(serialized,"sha2-256",cb),(mh,cb)=>cb(null,new CID(1,resolver.multicodec,mh))],callback)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function mapFromEthObj(account,options,callback){const paths=[];paths.push({path:"storage",value:{"/":cidFromHash("eth-storage-trie",account.stateRoot).toBaseEncodedString()}}),paths.push({path:"code",value:{"/":cidFromHash("raw",account.codeHash).toBaseEncodedString()}}),paths.push({path:"stateRoot",value:account.stateRoot}),paths.push({path:"codeHash",value:account.codeHash}),paths.push({path:"nonce",value:account.nonce}),paths.push({path:"balance",value:account.balance}),paths.push({path:"isEmpty",value:account.isEmpty()}),paths.push({path:"isContract",value:account.isContract()}),callback(null,paths)}const EthAccount=__webpack_require__(365),createResolver=__webpack_require__(62),cidFromHash=__webpack_require__(53);module.exports=createResolver("eth-account-snapshot",EthAccount,mapFromEthObj)},function(module,exports,__webpack_require__){"use strict";function mapFromEthObj(ethObj,options,callback){const paths=[];paths.push({path:"parent",value:{"/":cidFromHash("eth-block",ethObj.parentHash).toBaseEncodedString()}}),paths.push({path:"ommers",value:{"/":cidFromHash("eth-block-list",ethObj.uncleHash).toBaseEncodedString()}}),paths.push({path:"transactions",value:{"/":cidFromHash("eth-tx-trie",ethObj.transactionsTrie).toBaseEncodedString()}}),paths.push({path:"transactionReceipts",value:{"/":cidFromHash("eth-tx-receipt-trie",ethObj.receiptTrie).toBaseEncodedString()}}),paths.push({path:"state",value:{"/":cidFromHash("eth-state-trie",ethObj.stateRoot).toBaseEncodedString()}}),paths.push({path:"parentHash",value:ethObj.parentHash}),paths.push({path:"ommerHash",value:ethObj.uncleHash}),paths.push({path:"transactionTrieRoot",value:ethObj.transactionsTrie}),paths.push({path:"transactionReceiptTrieRoot",value:ethObj.receiptTrie}),paths.push({path:"stateRoot",value:ethObj.stateRoot}),paths.push({path:"authorAddress",value:ethObj.coinbase}),paths.push({path:"bloom",value:ethObj.bloom}),paths.push({path:"difficulty",value:ethObj.difficulty}),paths.push({path:"number", -value:ethObj.number}),paths.push({path:"gasLimit",value:ethObj.gasLimit}),paths.push({path:"gasUsed",value:ethObj.gasUsed}),paths.push({path:"timestamp",value:ethObj.timestamp}),paths.push({path:"extraData",value:ethObj.extraData}),paths.push({path:"mixHash",value:ethObj.mixHash}),paths.push({path:"nonce",value:ethObj.nonce}),callback(null,paths)}const EthBlockHeader=__webpack_require__(182),createResolver=__webpack_require__(62),cidFromHash=__webpack_require__(53);module.exports=createResolver("eth-block",EthBlockHeader,mapFromEthObj)},function(module,exports,__webpack_require__){"use strict";function mapFromEthObj(tx,options,callback){const paths=[];paths.push({path:"nonce",value:tx.nonce}),paths.push({path:"gasPrice",value:tx.gasPrice}),paths.push({path:"gasLimit",value:tx.gasLimit}),paths.push({path:"toAddress",value:tx.to}),paths.push({path:"value",value:tx.value}),paths.push({path:"data",value:tx.data}),paths.push({path:"v",value:tx.v}),paths.push({path:"r",value:tx.r}),paths.push({path:"s",value:tx.s}),paths.push({path:"fromAddress",value:tx.from}),paths.push({path:"signature",value:[tx.v,tx.r,tx.s]}),paths.push({path:"isContractPublish",value:tx.toCreationAddress()}),callback(null,paths)}const EthTx=__webpack_require__(367),createResolver=__webpack_require__(62);__webpack_require__(53);module.exports=createResolver("eth-tx",EthTx,mapFromEthObj)},function(module,exports,__webpack_require__){"use strict";function cidFromEthObj(multicodec,ethObj){return cidFromHash(multicodec,ethObj.hash())}const cidFromHash=__webpack_require__(53);module.exports=cidFromEthObj},function(module,exports){function createIsLink(resolve){return function(block,path,callback){resolve(block,path,(err,result)=>{return err?callback(err):result.remainderPath.length>0?callback(new Error("path out of scope")):void("object"==typeof result.value&&result.value["/"]?callback(null,result.value):callback(null,!1))})}}module.exports=createIsLink},function(module,exports,__webpack_require__){function createUtil(multicodec,EthObjClass){return{deserialize:asyncify(serialized=>new EthObjClass(serialized)),serialize:asyncify(ethObj=>ethObj.serialize()),cid:asyncify(ethObj=>cidFromEthObj(multicodec,ethObj))}}const cidFromEthObj=__webpack_require__(200),asyncify=__webpack_require__(70);module.exports=createUtil},function(module,exports){module.exports=function(str){if("string"!=typeof str)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof str+", while checking isHexPrefixed.");return"0x"===str.slice(0,2)}},function(module,exports){function isPromise(obj){return obj&&"function"==typeof obj.then}module.exports=isPromise},function(module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return"[object Array]"==toString.call(arr)}},function(module,exports){module.exports={genesisGasLimit:{v:5e3,d:"Gas limit of the Genesis block."},genesisDifficulty:{v:17179869184,d:"Difficulty of the Genesis block."},genesisNonce:{v:"0x0000000000000042",d:"the geneis nonce"},genesisExtraData:{v:"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa",d:"extra data "},genesisHash:{v:"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3",d:"genesis hash"},genesisStateRoot:{v:"0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544",d:"the genesis state root"},minGasLimit:{v:5e3,d:"Minimum the gas limit may ever be."},gasLimitBoundDivisor:{v:1024,d:"The bound divisor of the gas limit, used in update calculations."},minimumDifficulty:{v:131072,d:"The minimum that the difficulty may ever be."},difficultyBoundDivisor:{v:2048,d:"The bound divisor of the difficulty, used in the update calculations."},durationLimit:{v:13,d:"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not."},maximumExtraDataSize:{v:32,d:"Maximum size extra data may be after Genesis."},epochDuration:{v:3e4,d:"Duration between proof-of-work epochs."},stackLimit:{v:1024,d:"Maximum size of VM stack allowed."},callCreateDepth:{v:1024,d:"Maximum depth of call/create stack."},tierStepGas:{v:[0,2,3,5,8,10,20],d:"Once per operation, for a selection of them."},expGas:{v:10,d:"Once per EXP instuction."},expByteGas:{v:10,d:"Times ceil(log256(exponent)) for the EXP instruction."},sha3Gas:{v:30,d:"Once per SHA3 operation."},sha3WordGas:{v:6,d:"Once per word of the SHA3 operation's data."},sloadGas:{v:50,d:"Once per SLOAD operation."},sstoreSetGas:{v:2e4,d:"Once per SSTORE operation if the zeroness changes from zero."},sstoreResetGas:{v:5e3,d:"Once per SSTORE operation if the zeroness does not change from zero."},sstoreRefundGas:{v:15e3,d:"Once per SSTORE operation if the zeroness changes to zero."},jumpdestGas:{v:1,d:"Refunded gas, once per SSTORE operation if the zeroness changes to zero."},logGas:{v:375,d:"Per LOG* operation."},logDataGas:{v:8,d:"Per byte in a LOG* operation's data."},logTopicGas:{v:375,d:"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas."},createGas:{v:32e3,d:"Once per CREATE operation & contract-creation transaction."},callGas:{v:40,d:"Once per CALL operation & message call transaction."},callStipend:{v:2300,d:"Free gas given at beginning of call."},callValueTransferGas:{v:9e3,d:"Paid for CALL when the value transfor is non-zero."},callNewAccountGas:{v:25e3,d:"Paid for CALL when the destination address didn't exist prior."},suicideRefundGas:{v:24e3,d:"Refunded following a suicide operation."},memoryGas:{v:3,d:"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL."},quadCoeffDiv:{v:512,d:"Divisor for the quadratic particle of the memory cost equation."},createDataGas:{v:200,d:""},txGas:{v:21e3,d:"Per transaction. NOTE: Not payable on data of calls between transactions."},txCreation:{v:32e3,d:"the cost of creating a contract via tx"},txDataZeroGas:{v:4,d:"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions."},txDataNonZeroGas:{v:68,d:"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions."},copyGas:{v:3,d:"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added."},ecrecoverGas:{v:3e3,d:""},sha256Gas:{v:60,d:""},sha256WordGas:{v:12,d:""},ripemd160Gas:{v:600,d:""},ripemd160WordGas:{v:120,d:""},identityGas:{v:15,d:""},identityWordGas:{v:3,d:""},minerReward:{v:"5000000000000000000",d:"the amount a miner get rewarded for mining a block"},ommerReward:{v:"625000000000000000",d:"The amount of wei a miner of an uncle block gets for being inculded in the blockchain"},niblingReward:{v:"156250000000000000",d:"the amount a miner gets for inculding a uncle"},homeSteadForkNumber:{v:115e4,d:"the block that the Homestead fork started at"},homesteadRepriceForkNumber:{v:2463e3,d:"the block that the Homestead Reprice (EIP150) fork started at"},timebombPeriod:{v:1e5,d:"Exponential difficulty timebomb period"},freeBlockPeriod:{v:2}}},function(module,exports){module.exports={Addresses:{Swarm:["/libp2p-webrtc-star/dns4/star-signal.cloud.ipfs.team/wss"],API:"",Gateway:""},Discovery:{MDNS:{Enabled:!1,Interval:10},webRTCStar:{Enabled:!0}},Bootstrap:["/dns4/ams-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd","/dns4/sfo-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx","/dns4/lon-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3","/dns4/sfo-2.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z","/dns4/sfo-3.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM","/dns4/sgp-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu","/dns4/nyc-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm","/dns4/nyc-2.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64"]}},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(455)(__webpack_require__(459))},function(module,exports,__webpack_require__){"use strict";function leftPad(str,len,ch){if(str+="",(len-=str.length)<=0)return str;if(ch||0===ch||(ch=" ")," "===(ch+="")&&len<10)return cache[len]+str;for(var pad="";;){if(1&len&&(pad+=ch),!(len>>=1))break;ch+=ch}return pad+str}module.exports=leftPad;var cache=[""," "," "," "," "," "," "," "," "," "]},function(module,exports,__webpack_require__){(function(process){function ReadableState(options,stream){var Duplex=__webpack_require__(54);options=options||{};var hwm=options.highWaterMark,defaultHwm=options.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:defaultHwm,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!options.objectMode,stream instanceof Duplex&&(this.objectMode=this.objectMode||!!options.readableObjectMode),this.defaultEncoding=options.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(StringDecoder||(StringDecoder=__webpack_require__(66).StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding)}function Readable(options){__webpack_require__(54);if(!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this),this.readable=!0,Stream.call(this)}function readableAddChunk(stream,state,chunk,encoding,addToFront){var er=chunkInvalid(state,chunk);if(er)stream.emit("error",er);else if(util.isNullOrUndefined(chunk))state.reading=!1,state.ended||onEofChunk(stream,state);else if(state.objectMode||chunk&&chunk.length>0)if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var e=new Error("stream.unshift() after end event");stream.emit("error",e)}else!state.decoder||addToFront||encoding||(chunk=state.decoder.write(chunk)),addToFront||(state.reading=!1),state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream)),maybeReadMore(stream,state);else addToFront||(state.reading=!1);return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM)n=MAX_HWM;else{n--;for(var p=1;p<32;p<<=1)n|=n>>p;n++}return n}function howMuchToRead(n,state){return 0===state.length&&state.ended?0:state.objectMode?0===n?0:1:isNaN(n)||util.isNull(n)?state.flowing&&state.buffer.length?state.buffer[0].length:state.length:n<=0?0:(n>state.highWaterMark&&(state.highWaterMark=roundUpToNextPowerOf2(n)),n>state.length?state.ended?state.length:(state.needReadable=!0,0):n)}function chunkInvalid(state,chunk){var er=null;return util.isBuffer(chunk)||util.isString(chunk)||util.isNullOrUndefined(chunk)||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function onEofChunk(stream,state){if(state.decoder&&!state.ended){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?process.nextTick(function(){emitReadable_(stream)}):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,process.nextTick(function(){maybeReadMore_(stream,state)}))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=length)ret=stringMode?list.join(""):Buffer.concat(list,length),list.length=0;else if(n0)throw new Error("endReadable called on non-empty stream");state.endEmitted||(state.ended=!0,process.nextTick(function(){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}))}function forEach(xs,f){for(var i=0,l=xs.length;i0)&&(state.emittedReadable=!1),0===n&&state.needReadable&&(state.length>=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n0?fromList(n,state):null,util.isNull(ret)&&(state.needReadable=!0,n=0),state.length-=n,0!==state.length||state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&0===state.length&&endReadable(this),util.isNull(ret)||this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable){debug("onunpipe"),readable===src&&cleanup()}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",cleanup),src.removeListener("data",ondata),!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain()}function ondata(chunk){debug("ondata"),!1===dest.write(chunk)&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EE.listenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:cleanup;state.endEmitted?process.nextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);return dest.on("drain",ondrain),src.on("data",ondata),dest._events&&dest._events.error?isArray(dest._events.error)?dest._events.error.unshift(onerror):dest._events.error=[onerror,dest._events.error]:dest.on("error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState;if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i1){for(var cbs=[],c=0;c{return{digest(data,cb){nodeify(crypto.subtle.sign({name:"HMAC"},key,data).then(raw=>Buffer.from(raw)),cb)},length:lengths[hashType]}}),callback)}},function(module,exports,__webpack_require__){"use strict";function exportKey(pair){return Promise.all([webcrypto.subtle.exportKey("jwk",pair.privateKey),webcrypto.subtle.exportKey("jwk",pair.publicKey)])}function derivePublicFromPrivate(jwKey){return webcrypto.subtle.importKey("jwk",{kty:jwKey.kty,n:jwKey.n,e:jwKey.e,alg:jwKey.alg,kid:jwKey.kid},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"])}const nodeify=__webpack_require__(92),Buffer=__webpack_require__(6).Buffer,webcrypto=__webpack_require__(124)();exports.utils=__webpack_require__(483),exports.generateKey=function(bits,callback){nodeify(webcrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:bits,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(exportKey).then(keys=>({privateKey:keys[0],publicKey:keys[1]})),callback)},exports.unmarshalPrivateKey=function(key,callback){const privateKey=webcrypto.subtle.importKey("jwk",key,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]);nodeify(Promise.all([privateKey,derivePublicFromPrivate(key)]).then(keys=>exportKey({privateKey:keys[0],publicKey:keys[1]})).then(keys=>({privateKey:keys[0],publicKey:keys[1]})),callback)},exports.getRandomValues=function(arr){return Buffer.from(webcrypto.getRandomValues(arr))},exports.hashAndSign=function(key,msg,callback){nodeify(webcrypto.subtle.importKey("jwk",key,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]).then(privateKey=>{return webcrypto.subtle.sign({name:"RSASSA-PKCS1-v1_5"},privateKey,Uint8Array.from(msg))}).then(sig=>Buffer.from(sig)),callback)},exports.hashAndVerify=function(key,sig,msg,callback){nodeify(webcrypto.subtle.importKey("jwk",key,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]).then(publicKey=>{return webcrypto.subtle.verify({name:"RSASSA-PKCS1-v1_5"},publicKey,sig,msg)}),callback)}},function(module,exports,__webpack_require__){"use strict";function randomBytes(number){if(!number||"number"!=typeof number)throw new Error("first argument must be a Number bigger than 0");return rsa.getRandomValues(new Uint8Array(number))}const rsa=__webpack_require__(219);module.exports=randomBytes},function(module,exports,__webpack_require__){"use strict";const BN=__webpack_require__(46).bignum,Buffer=__webpack_require__(6).Buffer;exports.toBase64=function(bn,len){return bn.toArrayLike(Buffer,"be",len).toString("base64").replace(/(=*)$/,"").replace(/\+/g,"-").replace(/\//g,"_")},exports.toBn=function(str){return new BN(Buffer.from(str,"base64"))}},function(module,exports,__webpack_require__){"use strict";const protobuf=__webpack_require__(31),rpcProto=protobuf(__webpack_require__(486)),topicDescriptorProto=protobuf(__webpack_require__(487));exports=module.exports,exports.rpc=rpcProto,exports.td=topicDescriptorProto},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const protobuf=__webpack_require__(31),schema=new Buffer(` +}`},function(module,exports,__webpack_require__){"use strict";module.exports=(()=>{if("undefined"!=typeof self&&(__webpack_require__(705)(self),self.crypto))return self.crypto;throw new Error("Please use an environment with crypto support")})},function(module,exports,__webpack_require__){"use strict";module.exports={PROTOCOL:"/ipfs/ping/1.0.0",PING_LENGTH:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const protobuf=__webpack_require__(33),PeerId=__webpack_require__(23),crypto=__webpack_require__(67),parallel=__webpack_require__(40),waterfall=__webpack_require__(6),debug=__webpack_require__(91),log=debug("libp2p:secio");log.error=debug("libp2p:secio:error");const pbm=protobuf(__webpack_require__(517)),support=__webpack_require__(132);exports.createProposal=(state=>{return state.proposal.out={rand:crypto.randomBytes(16),pubkey:state.key.local.public.bytes,exchanges:support.exchanges.join(","),ciphers:support.ciphers.join(","),hashes:support.hashes.join(",")},state.proposalEncoded.out=pbm.Propose.encode(state.proposal.out),state.proposalEncoded.out}),exports.createExchange=((state,callback)=>{crypto.keys.generateEphemeralKeyPair(state.protocols.local.curveT,(err,res)=>{if(err)return callback(err);state.ephemeralKey.local=res.key,state.shared.generate=res.genSharedKey;const selectionOut=Buffer.concat([state.proposalEncoded.out,state.proposalEncoded.in,state.ephemeralKey.local]);state.key.local.sign(selectionOut,(err,sig)=>{if(err)return callback(err);state.exchange.out={epubkey:state.ephemeralKey.local,signature:sig},callback(null,pbm.Exchange.encode(state.exchange.out))})})}),exports.identify=((state,msg,callback)=>{log("1.1 identify"),state.proposalEncoded.in=msg,state.proposal.in=pbm.Propose.decode(msg);const pubkey=state.proposal.in.pubkey;state.key.remote=crypto.keys.unmarshalPublicKey(pubkey),PeerId.createFromPubKey(pubkey.toString("base64"),(err,remoteId)=>{if(err)return callback(err);state.id.remote=remoteId,log("1.1 identify - %s - identified remote peer as %s",state.id.local.toB58String(),state.id.remote.toB58String()),callback()})}),exports.selectProtocols=((state,callback)=>{log("1.2 selection");const local={pubKeyBytes:state.key.local.public.bytes,exchanges:support.exchanges,hashes:support.hashes,ciphers:support.ciphers,nonce:state.proposal.out.rand},remote={pubKeyBytes:state.proposal.in.pubkey,exchanges:state.proposal.in.exchanges.split(","),hashes:state.proposal.in.hashes.split(","),ciphers:state.proposal.in.ciphers.split(","),nonce:state.proposal.in.rand};support.selectBest(local,remote,(err,selected)=>{if(err)return callback(err);state.protocols.remote={order:selected.order,curveT:selected.curveT,cipherT:selected.cipherT,hashT:selected.hashT},state.protocols.local={order:selected.order,curveT:selected.curveT,cipherT:selected.cipherT,hashT:selected.hashT},callback()})}),exports.verify=((state,msg,callback)=>{log("2.1. verify"),state.exchange.in=pbm.Exchange.decode(msg),state.ephemeralKey.remote=state.exchange.in.epubkey;const selectionIn=Buffer.concat([state.proposalEncoded.in,state.proposalEncoded.out,state.ephemeralKey.remote]);state.key.remote.verify(selectionIn,state.exchange.in.signature,(err,sigOk)=>{return err?callback(err):sigOk?(log("2.1. verify - signature verified"),void callback()):callback(new Error("Bad signature"))})}),exports.generateKeys=((state,callback)=>{log("2.2. keys"),waterfall([cb=>state.shared.generate(state.exchange.in.epubkey,cb),(secret,cb)=>{state.shared.secret=secret,crypto.keys.keyStretcher(state.protocols.local.cipherT,state.protocols.local.hashT,state.shared.secret,cb)},(keys,cb)=>{if(state.protocols.local.order>0)state.protocols.local.keys=keys.k1,state.protocols.remote.keys=keys.k2;else{if(!(state.protocols.local.order<0))return cb(new Error("you are trying to talk to yourself"));state.protocols.local.keys=keys.k2,state.protocols.remote.keys=keys.k1}log("2.3. mac + cipher"),parallel([cb=>support.makeMacAndCipher(state.protocols.local,cb),cb=>support.makeMacAndCipher(state.protocols.remote,cb)],cb)}],callback)}),exports.verifyNonce=((state,n2)=>{const n1=state.proposal.out.rand;if(!n1.equals(n2))throw new Error(`Failed to read our encrypted nonce: ${n1.toString("hex")} != ${n2.toString("hex")}`)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function makeMac(hash,key,callback){crypto.hmac.create(hash,key,callback)}function makeCipher(cipherType,iv,key,callback){if("AES-128"===cipherType||"AES-256"===cipherType)return crypto.aes.create(key,iv,callback);callback(new Error(`unrecognized cipher type: ${cipherType}`))}const mh=__webpack_require__(22),lp=__webpack_require__(24),pull=__webpack_require__(4),crypto=__webpack_require__(67),parallel=__webpack_require__(40);exports.exchanges=["P-256","P-384","P-521"],exports.ciphers=["AES-256","AES-128"],exports.hashes=["SHA256","SHA512"],exports.theBest=((order,p1,p2)=>{let first,second;if(order<0)first=p2,second=p1;else{if(!(order>0))return p1[0];first=p1,second=p2}for(let firstCandidate of first)for(let secondCandidate of second)if(firstCandidate===secondCandidate)return firstCandidate;throw new Error("No algorithms in common!")}),exports.makeMacAndCipher=((target,callback)=>{parallel([cb=>makeMac(target.hashT,target.keys.macKey,cb),cb=>makeCipher(target.cipherT,target.keys.iv,target.keys.cipherKey,cb)],(err,macAndCipher)=>{if(err)return callback(err);target.mac=macAndCipher[0],target.cipher=macAndCipher[1],callback()})}),exports.selectBest=((local,remote,cb)=>{exports.digest(Buffer.concat([remote.pubKeyBytes,local.nonce]),(err,oh1)=>{if(err)return cb(err);exports.digest(Buffer.concat([local.pubKeyBytes,remote.nonce]),(err,oh2)=>{if(err)return cb(err);const order=Buffer.compare(oh1,oh2);if(0===order)return cb(new Error("you are trying to talk to yourself"));cb(null,{curveT:exports.theBest(order,local.exchanges,remote.exchanges),cipherT:exports.theBest(order,local.ciphers,remote.ciphers),hashT:exports.theBest(order,local.hashes,remote.hashes),order:order})})})}),exports.digest=((buf,cb)=>{mh.digest(buf,"sha2-256",buf.length,cb)}),exports.write=function(state,msg,cb){cb=cb||(()=>{}),pull(pull.values([msg]),lp.encode({fixed:!0,bytes:4}),pull.collect((err,res)=>{if(err)return cb(err);state.shake.write(res[0]),cb()}))},exports.read=function(reader,cb){lp.decodeFromReader(reader,{fixed:!0,bytes:4},cb)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(global,module){function arrayMap(array,iteratee){for(var index=-1,length=array?array.length:0,result=Array(length);++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function values(object){return object?baseValues(object,keys(object)):[]}var MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",reIsUint=/^(?:0|[1-9]\d*)$/,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,propertyIsEnumerable=objectProto.propertyIsEnumerable,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),isArray=Array.isArray;module.exports=values},function(module,exports,__webpack_require__){function baseGetTag(value){return null==value?void 0===value?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(value)?getRawTag(value):objectToString(value)}var Symbol=__webpack_require__(237),getRawTag=__webpack_require__(558),objectToString=__webpack_require__(563),nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=Symbol?Symbol.toStringTag:void 0;module.exports=baseGetTag},function(module,exports){var isArray=Array.isArray;module.exports=isArray},function(module,exports){function isObjectLike(value){return null!=value&&"object"==typeof value}module.exports=isObjectLike +},function(module,exports,__webpack_require__){"use strict";function Protocols(proto){if("number"==typeof proto){if(Protocols.codes[proto])return Protocols.codes[proto];throw new Error("no protocol with code: "+proto)}if("string"==typeof proto||proto instanceof String){if(Protocols.names[proto])return Protocols.names[proto];throw new Error("no protocol with name: "+proto)}throw new Error("invalid protocol id type: "+proto)}function p(code,size,name,resolvable){return{code:code,size:size,name:name,resolvable:Boolean(resolvable)}}const map=__webpack_require__(133);Protocols.lengthPrefixedVarSize=-1,Protocols.V=-1,Protocols.table=[[4,32,"ip4"],[6,16,"tcp"],[17,16,"udp"],[33,16,"dccp"],[41,128,"ip6"],[53,-1,"dns","resolvable"],[54,-1,"dns4","resolvable"],[55,-1,"dns6","resolvable"],[132,16,"sctp"],[302,0,"utp"],[421,Protocols.lengthPrefixedVarSize,"ipfs"],[480,0,"http"],[443,0,"https"],[477,0,"ws"],[478,0,"wss"],[275,0,"libp2p-webrtc-star"],[276,0,"libp2p-webrtc-direct"],[290,0,"p2p-circuit"]],Protocols.names={},Protocols.codes={},map(Protocols.table,function(row){const proto=p.apply(null,row);Protocols.codes[proto.code]=proto,Protocols.names[proto.name]=proto}),Protocols.object=p,module.exports=Protocols},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function multibase(nameOrCode,buf){if(!buf)throw new Error("requires an encoded buffer");const base=getBase(nameOrCode),codeBuf=new Buffer(base.code);return validEncode(base.name,buf),Buffer.concat([codeBuf,buf])}function encode(nameOrCode,buf){const base=getBase(nameOrCode);return multibase(base.name,new Buffer(base.encode(buf)))}function decode(bufOrString){Buffer.isBuffer(bufOrString)&&(bufOrString=bufOrString.toString());const code=bufOrString.substring(0,1);"string"==typeof(bufOrString=bufOrString.substring(1,bufOrString.length))&&(bufOrString=new Buffer(bufOrString));const base=getBase(code);return{base:base.name,data:new Buffer(base.decode(bufOrString.toString()))}.data}function isEncoded(bufOrString){Buffer.isBuffer(bufOrString)&&(bufOrString=bufOrString.toString());const code=bufOrString.substring(0,1);try{const base=getBase(code);return base.name}catch(err){return!1}}function validEncode(name,buf){getBase(name).decode(buf.toString())}function getBase(nameOrCode){let base;if(constants.names[nameOrCode])base=constants.names[nameOrCode];else{if(!constants.codes[nameOrCode])throw errNotSupported;base=constants.codes[nameOrCode]}if(!base.isImplemented())throw new Error("Base "+nameOrCode+" is not implemented yet");return base}const constants=__webpack_require__(581);exports=module.exports=multibase,exports.encode=encode,exports.decode=decode,exports.isEncoded=isEncoded;const errNotSupported=new Error("Unsupported encoding")}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const varint=__webpack_require__(14),codecNameToCodeVarint=__webpack_require__(94),codeToCodecName=__webpack_require__(244),util=__webpack_require__(245);exports=module.exports,exports.addPrefix=((multicodecStrOrCode,data)=>{let prefix;if(Buffer.isBuffer(multicodecStrOrCode))prefix=util.varintBufferEncode(multicodecStrOrCode);else{if(!codecNameToCodeVarint[multicodecStrOrCode])throw new Error("multicodec not recognized");prefix=codecNameToCodeVarint[multicodecStrOrCode]}return Buffer.concat([prefix,data])}),exports.rmPrefix=(data=>{return varint.decode(data),data.slice(varint.decode.bytes)}),exports.getCodec=(prefixedData=>{return codeToCodecName[util.varintBufferDecode(prefixedData).toString("hex")]})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.Listener=exports.listener=__webpack_require__(596),exports.Dialer=exports.dialer=__webpack_require__(595),exports.matchSemver=__webpack_require__(598),exports.matchExact=__webpack_require__(249)},function(module,exports,__webpack_require__){"use strict";const through=__webpack_require__(102);module.exports=function(_maxLength){const maxLength=_maxLength||100;var buffered=[];return through(function(data){for(buffered=buffered.concat(data);buffered.length>=maxLength;){const end=maxLength,slice=buffered.slice(0,end);buffered=buffered.slice(end),this.queue(slice)}},function(end){buffered.length&&(this.queue(buffered),buffered=[]),this.queue(null)})}},function(module,exports){function abortAll(ary,abort,cb){function next(){--n||cb(abort)}var n=ary.length;if(!n)return cb(abort);ary.forEach(function(f){f?f(abort,next):next()}),n||next()}module.exports=function(streams){return function(abort,cb){!function next(){abort?abortAll(streams,abort,cb):streams.length?streams[0]?streams[0](null,function(err,data){err?(streams.shift(),err===!0?next():abortAll(streams,err,cb)):cb(null,data)}):(streams.shift(),next()):cb(!0)}()}}},function(module,exports,__webpack_require__){var looper=__webpack_require__(618);module.exports=function(map,width,inOrder){inOrder=void 0===inOrder||inOrder;var abort,reading=!1;return function(read){function drain(){if(_cb){var cb=_cb;if(error)return _cb=null,cb(error);if(Object.hasOwnProperty.call(seen,j)){_cb=null;var data=seen[j];delete seen[j],j++,cb(null,data),width&&start()}else j>=last&&ended&&(_cb=null,cb(ended))}}var _cb,error,i=0,j=0,last=0,seen=[],started=!1,ended=!1,start=looper(function(){if(started=!0,ended)return drain();reading||width&&i-width>=j||(reading=!0,read(abort,function(end,data){if(reading=!1,end)last=i,ended=end,drain();else{var k=i++;map(data,function(err,data){inOrder?seen[k]=data:seen.push(data),err&&(error=err),drain()}),ended||start()}}))});return function(_abort,cb){_abort?read(ended=abort=_abort,function(err){if(cb)return cb(err)}):(_cb=cb,started||start(),drain())}}}},function(module,exports,__webpack_require__){"use strict";var drain=__webpack_require__(71);module.exports=function(reducer,acc,cb){cb||(cb=acc,acc=null);var sink=drain(function(data){acc=reducer(acc,data)},function(err){cb(err,acc)});return 2===arguments.length?function(source){source(null,function(end,data){if(end)return cb(end===!0?null:end);acc=data,sink(source)})}:sink}},function(module,exports,__webpack_require__){"use strict";var abortCb=__webpack_require__(263);module.exports=function(array,onAbort){if(!array)return function(abort,cb){return abort?abortCb(cb,abort,onAbort):cb(!0)};Array.isArray(array)||(array=Object.keys(array).map(function(k){return array[k]}));var i=0;return function(abort,cb){if(abort)return abortCb(cb,abort,onAbort);i>=array.length?cb(!0):cb(null,array[i++])}}},function(module,exports,__webpack_require__){"use strict";var tester=__webpack_require__(264);module.exports=function(test){return test=tester(test),function(read){return function next(end,cb){for(var sync,loop=!0;loop;)loop=!1,sync=!0,read(end,function(end,data){if(!end&&!test(data))return sync?loop=!0:next(end,cb);cb(end,data)}),sync=!1}}}},function(module,exports,__webpack_require__){"use strict";(function(process,setImmediate,global){function CorkedRequest(state){var _this=this;this.next=null,this.entry=null,this.finish=function(){onCorkedFinish(_this,state)}}function _uint8ArrayToBuffer(chunk){return Buffer.from(chunk)}function _isUint8Array(obj){return Buffer.isBuffer(obj)||obj instanceof OurUint8Array}function nop(){}function WritableState(options,stream){Duplex=Duplex||__webpack_require__(45),options=options||{},this.objectMode=!!options.objectMode,stream instanceof Duplex&&(this.objectMode=this.objectMode||!!options.writableObjectMode);var hwm=options.highWaterMark,defaultHwm=this.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:defaultHwm,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var noDecode=options.decodeStrings===!1;this.decodeStrings=!noDecode,this.defaultEncoding=options.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(er){onwrite(stream,er)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}function Writable(options){if(Duplex=Duplex||__webpack_require__(45),!(realHasInstance.call(Writable,this)||this instanceof Duplex))return new Writable(options);this._writableState=new WritableState(options,this),this.writable=!0,options&&("function"==typeof options.write&&(this._write=options.write),"function"==typeof options.writev&&(this._writev=options.writev),"function"==typeof options.destroy&&(this._destroy=options.destroy),"function"==typeof options.final&&(this._final=options.final)),Stream.call(this)}function writeAfterEnd(stream,cb){var er=new Error("write after end");stream.emit("error",er),processNextTick(cb,er)}function validChunk(stream,state,chunk,cb){var valid=!0,er=!1;return null===chunk?er=new TypeError("May not write null values to stream"):"string"==typeof chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er&&(stream.emit("error",er),processNextTick(cb,er),valid=!1),valid}function decodeChunk(state,chunk,encoding){return state.objectMode||state.decodeStrings===!1||"string"!=typeof chunk||(chunk=Buffer.from(chunk,encoding)),chunk}function writeOrBuffer(stream,state,isBuf,chunk,encoding,cb){if(!isBuf){var newChunk=decodeChunk(state,chunk,encoding);chunk!==newChunk&&(isBuf=!0,encoding="buffer",chunk=newChunk)}var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length-1?setImmediate:processNextTick;Writable.WritableState=WritableState;var util=__webpack_require__(27);util.inherits=__webpack_require__(2);var internalUtil={deprecate:__webpack_require__(695)},Stream=__webpack_require__(269),Buffer=__webpack_require__(5).Buffer,OurUint8Array=global.Uint8Array||function(){},destroyImpl=__webpack_require__(268);util.inherits(Writable,Stream),WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(_){}}();var realHasInstance;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return!!realHasInstance.call(this,object)||object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=_isUint8Array(chunk)&&!state.objectMode;return isBuf&&!Buffer.isBuffer(chunk)&&(chunk=_uint8ArrayToBuffer(chunk)),"function"==typeof encoding&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),"function"!=typeof cb&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,state.writing||state.corked||state.finished||state.bufferProcessing||!state.bufferedRequest||clearBuffer(this,state))},Writable.prototype.setDefaultEncoding=function(encoding){if("string"==typeof encoding&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this},Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;"function"==typeof chunk?(cb=chunk,chunk=null,encoding=null):"function"==typeof encoding&&(cb=encoding,encoding=null),null!==chunk&&void 0!==chunk&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||state.finished||endWritable(this,state,cb)},Object.defineProperty(Writable.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(value){this._writableState&&(this._writableState.destroyed=value)}}),Writable.prototype.destroy=destroyImpl.destroy,Writable.prototype._undestroy=destroyImpl.undestroy,Writable.prototype._destroy=function(err,cb){this.end(),cb(err)}}).call(exports,__webpack_require__(1),__webpack_require__(38).setImmediate,__webpack_require__(3))},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(271)(__webpack_require__(665))},function(module,exports,__webpack_require__){function Encoder(){}function encodeAsString(obj){var str=""+obj.type;return exports.BINARY_EVENT!==obj.type&&exports.BINARY_ACK!==obj.type||(str+=obj.attachments+"-"),obj.nsp&&"/"!==obj.nsp&&(str+=obj.nsp+","),null!=obj.id&&(str+=obj.id),null!=obj.data&&(str+=JSON.stringify(obj.data)),debug("encoded %j as %s",obj,str),str}function encodeAsBinary(obj,callback){function writeEncoding(bloblessData){var deconstruction=binary.deconstructPacket(bloblessData),pack=encodeAsString(deconstruction.packet),buffers=deconstruction.buffers;buffers.unshift(pack),callback(buffers)}binary.removeBlobs(obj,writeEncoding)}function Decoder(){this.reconstructor=null}function decodeString(str){var i=0,p={type:Number(str.charAt(0))};if(null==exports.types[p.type])return error();if(exports.BINARY_EVENT===p.type||exports.BINARY_ACK===p.type){for(var buf="";"-"!==str.charAt(++i)&&(buf+=str.charAt(i),i!=str.length););if(buf!=Number(buf)||"-"!==str.charAt(i))throw new Error("Illegal attachments");p.attachments=Number(buf)}if("/"===str.charAt(i+1))for(p.nsp="";++i;){var c=str.charAt(i);if(","===c)break;if(p.nsp+=c,i===str.length)break}else p.nsp="/";var next=str.charAt(i+1);if(""!==next&&Number(next)==next){for(p.id="";++i;){var c=str.charAt(i);if(null==c||Number(c)!=c){--i;break}if(p.id+=str.charAt(i),i===str.length)break}p.id=Number(p.id)}return str.charAt(++i)&&(p=tryParse(p,str.substr(i))),debug("decoded %s as %j",str,p),p}function tryParse(p,str){try{p.data=JSON.parse(str)}catch(e){return error()}return p}function BinaryReconstructor(packet){this.reconPack=packet,this.buffers=[]}function error(){return{type:exports.ERROR,data:"parser error"}}var debug=__webpack_require__(683)("socket.io-parser"),Emitter=__webpack_require__(50),hasBin=__webpack_require__(193),binary=__webpack_require__(682),isBuf=__webpack_require__(280);exports.protocol=4,exports.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],exports.CONNECT=0,exports.DISCONNECT=1,exports.EVENT=2,exports.ACK=3,exports.ERROR=4,exports.BINARY_EVENT=5,exports.BINARY_ACK=6,exports.Encoder=Encoder,exports.Decoder=Decoder,Encoder.prototype.encode=function(obj,callback){if(obj.type!==exports.EVENT&&obj.type!==exports.ACK||!hasBin(obj.data)||(obj.type=obj.type===exports.EVENT?exports.BINARY_EVENT:exports.BINARY_ACK),debug("encoding packet %j",obj),exports.BINARY_EVENT===obj.type||exports.BINARY_ACK===obj.type)encodeAsBinary(obj,callback);else{callback([encodeAsString(obj)])}},Emitter(Decoder.prototype),Decoder.prototype.add=function(obj){var packet;if("string"==typeof obj)packet=decodeString(obj),exports.BINARY_EVENT===packet.type||exports.BINARY_ACK===packet.type?(this.reconstructor=new BinaryReconstructor(packet),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",packet)):this.emit("decoded",packet);else{if(!isBuf(obj)&&!obj.base64)throw new Error("Unknown type: "+obj);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(packet=this.reconstructor.takeBinaryData(obj))&&(this.reconstructor=null,this.emit("decoded",packet))}},Decoder.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},BinaryReconstructor.prototype.takeBinaryData=function(binData){if(this.buffers.push(binData),this.buffers.length===this.reconPack.attachments){var packet=binary.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),packet}return null},BinaryReconstructor.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(module,exports,__webpack_require__){(function(process){function destroy(stream,cb){function onClose(){cleanup(),cb()}function onError(err){cleanup(),cb(err)}function cleanup(){stream.removeListener("close",onClose),stream.removeListener("error",onError)}stream.on("close",onClose),stream.on("error",onError)}function destroy(stream){stream.destroy?stream.destroy():console.error("warning, stream-to-pull-stream: \nthe wrapped node-stream does not implement `destroy`, \nthis may cause resource leaks.")}function write(read,stream,cb){function done(){did||(did=!0,cb&&cb(ended===!0?null:ended))}function onClose(){closed||(closed=!0,cleanup(),ended?done():read(ended=!0,done))}function onError(err){cleanup(),ended||read(ended=err,done)}function cleanup(){stream.on("finish",onClose),stream.removeListener("close",onClose),stream.removeListener("error",onError)}var ended,did,closed=!1;stream.on("close",onClose),stream.on("finish",onClose),stream.on("error",onError),process.nextTick(function(){looper(function(next){read(null,function(end,data){if(ended=ended||end,end===!0)return stream._isStdio?done():stream.end();if(ended=ended||end)return destroy(stream),done(ended);if(stream._isStdio)stream.write(data,function(){next()});else{stream.write(data)===!1?stream.once("drain",next):next()}})})})}function read2(stream){function read(){var data=stream.read();if(null!==data&&_cb){var cb=_cb;_cb=null,cb(null,data)}}var _cb,ended=!1,waiting=!1;return stream.on("readable",function(){waiting=!0,_cb&&read()}).on("end",function(){ended=!0,_cb&&_cb(ended)}).on("error",function(err){ended=err,_cb&&_cb(ended)}),function(end,cb){_cb=cb,ended?cb(ended):waiting&&read()}}function read1(stream){function drain(){for(;(buffer.length||ended)&&cbs.length;)cbs.shift()(buffer.length?null:ended,buffer.shift());!buffer.length&&paused&&(paused=!1,stream.resume())}var ended,buffer=[],cbs=[],paused=!1;return stream.on("data",function(data){buffer.push(data),drain(),buffer.length&&stream.pause&&(paused=!0,stream.pause())}),stream.on("end",function(){ended=!0,drain()}),stream.on("close",function(){ended=!0,drain()}),stream.on("error",function(err){ended=err,drain()}),function(abort,cb){function onAbort(){for(;cbs.length;)cbs.shift()(abort);cb(abort)}if(!cb)throw new Error("*must* provide cb");if(abort){if(ended)return onAbort();stream.once("close",onAbort),destroy(stream)}else cbs.push(cb),drain()}}var looper=(__webpack_require__(260),__webpack_require__(242)),read=read1,sink=function(stream,cb){return function(read){return write(read,stream,cb)}},source=function(stream){return read1(stream)};exports=module.exports=function(stream,cb){return stream.writable&&stream.write?stream.readable?function(_read){return write(_read,stream,cb),read1(stream)}:sink(stream,cb):source(stream)},exports.sink=sink,exports.source=source,exports.read=read,exports.read1=read1,exports.read2=read2,exports.duplex=function(stream,cb){return{source:source(stream),sink:sink(stream,cb)}},exports.transform=function(stream){return function(read){var _source=source(stream);return sink(stream)(read),_source}}}).call(exports,__webpack_require__(1))},function(module,exports,__webpack_require__){"use strict";function Url(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function urlParse(url,parseQueryString,slashesDenoteHost){if(url&&util.isObject(url)&&url instanceof Url)return url;var u=new Url;return u.parse(url,parseQueryString,slashesDenoteHost),u}function urlFormat(obj){return util.isString(obj)&&(obj=urlParse(obj)),obj instanceof Url?obj.format():Url.prototype.format.call(obj)}function urlResolve(source,relative){return urlParse(source,!1,!0).resolve(relative)}function urlResolveObject(source,relative){return source?urlParse(source,!1,!0).resolveObject(relative):relative}var punycode=__webpack_require__(650),util=__webpack_require__(694);exports.parse=urlParse,exports.resolve=urlResolve,exports.resolveObject=urlResolveObject,exports.format=urlFormat,exports.Url=Url;var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,simplePathPattern=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,delims=["<",">",'"',"`"," ","\r","\n","\t"],unwise=["{","}","|","\\","^","`"].concat(delims),autoEscape=["'"].concat(unwise),nonHostChars=["%","/","?",";","#"].concat(autoEscape),hostEndingChars=["/","?","#"],unsafeProtocol={javascript:!0,"javascript:":!0},hostlessProtocol={javascript:!0,"javascript:":!0},slashedProtocol={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},querystring=__webpack_require__(653);Url.prototype.parse=function(url,parseQueryString,slashesDenoteHost){if(!util.isString(url))throw new TypeError("Parameter 'url' must be a string, not "+typeof url);var queryIndex=url.indexOf("?"),splitter=queryIndex!==-1&&queryIndex127?"x":part[j];if(!newpart.match(/^[+a-z0-9A-Z_-]{0,63}$/)){var validParts=hostparts.slice(0,i),notHost=hostparts.slice(i+1),bit=part.match(/^([+a-z0-9A-Z_-]{0,63})(.*)$/);bit&&(validParts.push(bit[1]),notHost.unshift(bit[2])),notHost.length&&(rest="/"+notHost.join(".")+rest),this.hostname=validParts.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),ipv6Hostname||(this.hostname=punycode.toASCII(this.hostname));var p=this.port?":"+this.port:"",h=this.hostname||"";this.host=h+p,this.href+=this.host,ipv6Hostname&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==rest[0]&&(rest="/"+rest))}if(!unsafeProtocol[lowerProto])for(var i=0,l=autoEscape.length;i0)&&result.host.split("@");authInHost&&(result.auth=authInHost.shift(),result.host=result.hostname=authInHost.shift())}return result.search=relative.search,result.query=relative.query,util.isNull(result.pathname)&&util.isNull(result.search)||(result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")),result.href=result.format(),result}if(!srcPath.length)return result.pathname=null,result.search?result.path="/"+result.search:result.path=null,result.href=result.format(),result;for(var last=srcPath.slice(-1)[0],hasTrailingSlash=(result.host||relative.host||srcPath.length>1)&&("."===last||".."===last)||""===last,up=0,i=srcPath.length;i>=0;i--)last=srcPath[i],"."===last?srcPath.splice(i,1):".."===last?(srcPath.splice(i,1),up++):up&&(srcPath.splice(i,1),up--);if(!mustEndAbs&&!removeAllDots)for(;up--;up)srcPath.unshift("..");!mustEndAbs||""===srcPath[0]||srcPath[0]&&"/"===srcPath[0].charAt(0)||srcPath.unshift(""),hasTrailingSlash&&"/"!==srcPath.join("/").substr(-1)&&srcPath.push("");var isAbsolute=""===srcPath[0]||srcPath[0]&&"/"===srcPath[0].charAt(0);if(psychotic){result.hostname=result.host=isAbsolute?"":srcPath.length?srcPath.shift():"";var authInHost=!!(result.host&&result.host.indexOf("@")>0)&&result.host.split("@");authInHost&&(result.auth=authInHost.shift(),result.host=result.hostname=authInHost.shift())}return mustEndAbs=mustEndAbs||result.host&&srcPath.length,mustEndAbs&&!isAbsolute&&srcPath.unshift(""),srcPath.length?result.pathname=srcPath.join("/"):(result.pathname=null,result.path=null),util.isNull(result.pathname)&&util.isNull(result.search)||(result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")),result.auth=relative.auth||result.auth,result.slashes=result.slashes||relative.slashes,result.href=result.format(),result},Url.prototype.parseHost=function(){var host=this.host,port=portPattern.exec(host);port&&(port=port[0],":"!==port&&(this.port=port.substr(1)),host=host.substr(0,host.length-port.length)),host&&(this.hostname=host)}},function(module,exports,__webpack_require__){"use strict";exports.OFFLINE_ERROR=new Error("This command must be run in online mode. Try running 'ipfs daemon' first.")},function(module,exports,__webpack_require__){function DecoderBuffer(base,options){if(Reporter.call(this,options),!Buffer.isBuffer(base))return void this.error("Input not Buffer");this.base=base,this.offset=0,this.length=base.length}function EncoderBuffer(value,reporter){if(Array.isArray(value))this.length=0,this.value=value.map(function(item){return item instanceof EncoderBuffer||(item=new EncoderBuffer(item,reporter)),this.length+=item.length,item},this);else if("number"==typeof value){if(!(0<=value&&value<=255))return reporter.error("non-byte EncoderBuffer value");this.value=value,this.length=1}else if("string"==typeof value)this.value=value,this.length=Buffer.byteLength(value);else{if(!Buffer.isBuffer(value))return reporter.error("Unsupported type: "+typeof value);this.value=value,this.length=value.length}}var inherits=__webpack_require__(2),Reporter=__webpack_require__(60).Reporter,Buffer=__webpack_require__(0).Buffer;inherits(DecoderBuffer,Reporter),exports.DecoderBuffer=DecoderBuffer,DecoderBuffer.prototype.save=function(){return{offset:this.offset,reporter:Reporter.prototype.save.call(this)}},DecoderBuffer.prototype.restore=function(save){var res=new DecoderBuffer(this.base);return res.offset=save.offset,res.length=this.offset,this.offset=save.offset,Reporter.prototype.restore.call(this,save.reporter),res},DecoderBuffer.prototype.isEmpty=function(){return this.offset===this.length},DecoderBuffer.prototype.readUInt8=function(fail){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(fail||"DecoderBuffer overrun")},DecoderBuffer.prototype.skip=function(bytes,fail){if(!(this.offset+bytes<=this.length))return this.error(fail||"DecoderBuffer overrun");var res=new DecoderBuffer(this.base);return res._reporterState=this._reporterState,res.offset=this.offset,res.length=this.offset+bytes,this.offset+=bytes,res},DecoderBuffer.prototype.raw=function(save){return this.base.slice(save?save.offset:this.offset,this.length)},exports.EncoderBuffer=EncoderBuffer,EncoderBuffer.prototype.join=function(out,offset){return out||(out=new Buffer(this.length)),offset||(offset=0),0===this.length?out:(Array.isArray(this.value)?this.value.forEach(function(item){item.join(out,offset),offset+=item.length}):("number"==typeof this.value?out[offset]=this.value:"string"==typeof this.value?out.write(this.value,offset):Buffer.isBuffer(this.value)&&this.value.copy(out,offset),offset+=this.length),out)}},function(module,exports,__webpack_require__){var constants=exports;constants._reverse=function(map){var res={};return Object.keys(map).forEach(function(key){(0|key)==key&&(key|=0),res[map[key]]=key}),res},constants.der=__webpack_require__(289)},function(module,exports,__webpack_require__){function DERDecoder(entity){this.enc="der",this.name=entity.name,this.entity=entity,this.tree=new DERNode,this.tree._init(entity.body)}function DERNode(parent){base.Node.call(this,"der",parent)}function derDecodeTag(buf,fail){var tag=buf.readUInt8(fail);if(buf.isError(tag))return tag;var cls=der.tagClass[tag>>6],primitive=0==(32&tag);if(31==(31&tag)){var oct=tag;for(tag=0;128==(128&oct);){if(oct=buf.readUInt8(fail),buf.isError(oct))return oct;tag<<=7,tag|=127&oct}}else tag&=31;return{cls:cls,primitive:primitive,tag:tag,tagStr:der.tag[tag]}}function derDecodeLen(buf,primitive,fail){var len=buf.readUInt8(fail);if(buf.isError(len))return len;if(!primitive&&128===len)return null;if(0==(128&len))return len;var num=127&len;if(num>4)return buf.error("length octect is too long");len=0;for(var i=0;i=31?reporter.error("Multi-octet tag encoding unsupported"):(primitive||(res|=32),res|=der.tagClassByName[cls||"universal"]<<6)}var inherits=__webpack_require__(2),Buffer=__webpack_require__(0).Buffer,asn1=__webpack_require__(47),base=asn1.base,der=asn1.constants.der;module.exports=DEREncoder,DEREncoder.prototype.encode=function(data,reporter){return this.tree._encode(data,reporter).join()},inherits(DERNode,base.Node),DERNode.prototype._encodeComposite=function(tag,primitive,cls,content){var encodedTag=encodeTag(tag,primitive,cls,this.reporter);if(content.length<128){var header=new Buffer(2);return header[0]=encodedTag,header[1]=content.length,this._createEncoderBuffer([header,content])}for(var lenOctets=1,i=content.length;i>=256;i>>=8)lenOctets++;var header=new Buffer(2+lenOctets);header[0]=encodedTag,header[1]=128|lenOctets;for(var i=1+lenOctets,j=content.length;j>0;i--,j>>=8)header[i]=255&j;return this._createEncoderBuffer([header,content])},DERNode.prototype._encodeStr=function(str,tag){if("bitstr"===tag)return this._createEncoderBuffer([0|str.unused,str.data]);if("bmpstr"===tag){for(var buf=new Buffer(2*str.length),i=0;i=40)return this.reporter.error("Second objid identifier OOB");id.splice(0,2,40*id[0]+id[1])}for(var size=0,i=0;i=128;ident>>=7)size++}for(var objid=new Buffer(size),offset=objid.length-1,i=id.length-1;i>=0;i--){var ident=id[i];for(objid[offset--]=127&ident;(ident>>=7)>0;)objid[offset--]=128|127&ident}return this._createEncoderBuffer(objid)},DERNode.prototype._encodeTime=function(time,tag){var str,date=new Date(time);return"gentime"===tag?str=[two(date.getFullYear()),two(date.getUTCMonth()+1),two(date.getUTCDate()),two(date.getUTCHours()),two(date.getUTCMinutes()),two(date.getUTCSeconds()),"Z"].join(""):"utctime"===tag?str=[two(date.getFullYear()%100),two(date.getUTCMonth()+1),two(date.getUTCDate()),two(date.getUTCHours()),two(date.getUTCMinutes()),two(date.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+tag+" time is not supported yet"),this._encodeStr(str,"octstr")},DERNode.prototype._encodeNull=function(){return this._createEncoderBuffer("")},DERNode.prototype._encodeInt=function(num,values){if("string"==typeof num){if(!values)return this.reporter.error("String int or enum given, but no values map");if(!values.hasOwnProperty(num))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(num));num=values[num]}if("number"!=typeof num&&!Buffer.isBuffer(num)){var numArray=num.toArray();!num.sign&&128&numArray[0]&&numArray.unshift(0),num=new Buffer(numArray)}if(Buffer.isBuffer(num)){var size=num.length;0===num.length&&size++;var out=new Buffer(size);return num.copy(out),0===num.length&&(out[0]=0),this._createEncoderBuffer(out)}if(num<128)return this._createEncoderBuffer(num);if(num<256)return this._createEncoderBuffer([0,num]);for(var size=1,i=num;i>=256;i>>=8)size++;for(var out=new Array(size),i=out.length-1;i>=0;i--)out[i]=255&num,num>>=8;return 128&out[0]&&out.unshift(0),this._createEncoderBuffer(new Buffer(out))},DERNode.prototype._encodeBool=function(value){return this._createEncoderBuffer(value?255:0)},DERNode.prototype._use=function(entity,obj){return"function"==typeof entity&&(entity=entity(obj)),entity._getEncoder("der").tree},DERNode.prototype._skipDefault=function(dataBuffer,reporter,parent){var i,state=this._baseState;if(null===state.default)return!1;var data=dataBuffer.join();if(void 0===state.defaultBuffer&&(state.defaultBuffer=this._encodeValue(state.default,reporter,parent).join()),data.length!==state.defaultBuffer.length)return!1;for(i=0;i2&&(result=(0,_slice2.default)(arguments,1)),results[key]=result,callback(err)})},function(err){callback(err,results)})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=_parallel;var _noop=__webpack_require__(30),_noop2=_interopRequireDefault(_noop),_isArrayLike=__webpack_require__(68),_isArrayLike2=_interopRequireDefault(_isArrayLike),_slice=__webpack_require__(49),_slice2=_interopRequireDefault(_slice),_wrapAsync=__webpack_require__(12),_wrapAsync2=_interopRequireDefault(_wrapAsync);module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _withoutIndex(iteratee){return function(value,index,callback){return iteratee(value,callback)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=_withoutIndex,module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0});var _reject=__webpack_require__(305),_reject2=_interopRequireDefault(_reject),_doParallel=__webpack_require__(75),_doParallel2=_interopRequireDefault(_doParallel);exports.default=(0,_doParallel2.default)(_reject2.default),module.exports=exports.default},function(module,exports,__webpack_require__){(function(Buffer){function normalizeInput(input){var ret;if(input instanceof Uint8Array)ret=input;else if(input instanceof Buffer)ret=new Uint8Array(input);else{if("string"!=typeof input)throw new Error(ERROR_MSG_INPUT);ret=new Uint8Array(Buffer.from(input,"utf8"))}return ret}function toHex(bytes){return Array.prototype.map.call(bytes,function(n){return(n<16?"0":"")+n.toString(16)}).join("")}function uint32ToHex(val){return(4294967296+val).toString(16).substring(1)}function debugPrint(label,arr,size){for(var msg="\n"+label+" = ",i=0;inew Date(val),1:val=>new Date(1e3*val),2:val=>utils.arrayBufferToBignumber(val),3:val=>c.NEG_ONE.minus(utils.arrayBufferToBignumber(val)),4:v=>{return c.TEN.pow(v[0]).times(v[1])},5:v=>{return c.TWO.pow(v[0]).times(v[1])},32:val=>url.parse(val),35:val=>new RegExp(val)},opts.tags),this.parser=parser(global,{log:console.log.bind(console),pushInt:this.pushInt.bind(this),pushInt32:this.pushInt32.bind(this),pushInt32Neg:this.pushInt32Neg.bind(this),pushInt64:this.pushInt64.bind(this),pushInt64Neg:this.pushInt64Neg.bind(this),pushFloat:this.pushFloat.bind(this),pushFloatSingle:this.pushFloatSingle.bind(this),pushFloatDouble:this.pushFloatDouble.bind(this),pushTrue:this.pushTrue.bind(this),pushFalse:this.pushFalse.bind(this),pushUndefined:this.pushUndefined.bind(this),pushNull:this.pushNull.bind(this),pushInfinity:this.pushInfinity.bind(this),pushInfinityNeg:this.pushInfinityNeg.bind(this),pushNaN:this.pushNaN.bind(this),pushNaNNeg:this.pushNaNNeg.bind(this),pushArrayStart:this.pushArrayStart.bind(this),pushArrayStartFixed:this.pushArrayStartFixed.bind(this),pushArrayStartFixed32:this.pushArrayStartFixed32.bind(this),pushArrayStartFixed64:this.pushArrayStartFixed64.bind(this),pushObjectStart:this.pushObjectStart.bind(this),pushObjectStartFixed:this.pushObjectStartFixed.bind(this),pushObjectStartFixed32:this.pushObjectStartFixed32.bind(this),pushObjectStartFixed64:this.pushObjectStartFixed64.bind(this),pushByteString:this.pushByteString.bind(this),pushByteStringStart:this.pushByteStringStart.bind(this),pushUtf8String:this.pushUtf8String.bind(this),pushUtf8StringStart:this.pushUtf8StringStart.bind(this),pushSimpleUnassigned:this.pushSimpleUnassigned.bind(this),pushTagUnassigned:this.pushTagUnassigned.bind(this),pushTagStart:this.pushTagStart.bind(this),pushTagStart4:this.pushTagStart4.bind(this),pushTagStart8:this.pushTagStart8.bind(this),pushBreak:this.pushBreak.bind(this)},this._heap)}get _depth(){return this._parents.length}get _currentParent(){return this._parents[this._depth-1]}get _ref(){return this._currentParent.ref}_closeParent(){var p=this._parents.pop();if(p.length>0)throw new Error(`Missing ${p.length} elements`);switch(p.type){case c.PARENT.TAG:this._push(this.createTag(p.ref[0],p.ref[1]));break;case c.PARENT.BYTE_STRING:this._push(this.createByteString(p.ref,p.length));break;case c.PARENT.UTF8_STRING:this._push(this.createUtf8String(p.ref,p.length));break;case c.PARENT.MAP:if(p.values%2>0)throw new Error("Odd number of elements in the map");this._push(this.createMap(p.ref,p.length));break;case c.PARENT.OBJECT:if(p.values%2>0)throw new Error("Odd number of elements in the map");this._push(this.createObject(p.ref,p.length));break;case c.PARENT.ARRAY:this._push(this.createArray(p.ref,p.length))}this._currentParent&&this._currentParent.type===c.PARENT.TAG&&this._dec()}_dec(){const p=this._currentParent;p.length<0||0===--p.length&&this._closeParent()}_push(val,hasChildren){const p=this._currentParent;switch(p.values++,p.type){case c.PARENT.ARRAY:case c.PARENT.BYTE_STRING:case c.PARENT.UTF8_STRING:p.length>-1?this._ref[this._ref.length-p.length]=val:this._ref.push(val),this._dec();break;case c.PARENT.OBJECT:null!=p.tmpKey?(this._ref[p.tmpKey]=val,p.tmpKey=null,this._dec()):(p.tmpKey=val,"string"!=typeof p.tmpKey&&(p.type=c.PARENT.MAP,p.ref=utils.buildMap(p.ref)));break;case c.PARENT.MAP:null!=p.tmpKey?(this._ref.set(p.tmpKey,val),p.tmpKey=null,this._dec()):p.tmpKey=val;break;case c.PARENT.TAG:this._ref.push(val),hasChildren||this._dec();break;default:throw new Error("Unknown parent type")}}_createParent(obj,type,len){this._parents[this._depth]={type:type,length:len,ref:obj,values:0,tmpKey:null}}_reset(){this._res=[],this._parents=[{type:c.PARENT.ARRAY,length:-1,ref:this._res,values:0,tmpKey:null}]}createTag(tagNumber,value){const typ=this._knownTags[tagNumber];return typ?typ(value):new Tagged(tagNumber,value)}createMap(obj,len){return obj}createObject(obj,len){return obj}createArray(arr,len){return arr}createByteString(raw,len){return Buffer.concat(raw)}createByteStringFromHeap(start,end){return new Buffer(start===end?0:this._heap.slice(start,end))}createInt(val){return val}createInt32(f,g){return utils.buildInt32(f,g)}createInt64(f1,f2,g1,g2){return utils.buildInt64(f1,f2,g1,g2)}createFloat(val){return val}createFloatSingle(a,b,c,d){return ieee754.read([a,b,c,d],0,!1,23,4)}createFloatDouble(a,b,c,d,e,f,g,h){return ieee754.read([a,b,c,d,e,f,g,h],0,!1,52,8)}createInt32Neg(f,g){return-1-utils.buildInt32(f,g)}createInt64Neg(f1,f2,g1,g2){const f=utils.buildInt32(f1,f2),g=utils.buildInt32(g1,g2);return f>c.MAX_SAFE_HIGH?c.NEG_ONE.sub(new Bignumber(f).times(c.SHIFT32).plus(g)):-1-(f*c.SHIFT32+g)}createTrue(){return!0}createFalse(){return!1}createNull(){return null}createUndefined(){}createInfinity(){return 1/0}createInfinityNeg(){return-(1/0)}createNaN(){return NaN}createNaNNeg(){return NaN}createUtf8String(raw,len){return raw.join("")}createUtf8StringFromHeap(start,end){return start===end?"":new Buffer(this._heap.slice(start,end)).toString("utf8")}createSimpleUnassigned(val){return new Simple(val)}pushInt(val){this._push(this.createInt(val))}pushInt32(f,g){this._push(this.createInt32(f,g))}pushInt64(f1,f2,g1,g2){this._push(this.createInt64(f1,f2,g1,g2))}pushFloat(val){this._push(this.createFloat(val))}pushFloatSingle(a,b,c,d){this._push(this.createFloatSingle(a,b,c,d))}pushFloatDouble(a,b,c,d,e,f,g,h){this._push(this.createFloatDouble(a,b,c,d,e,f,g,h))}pushInt32Neg(f,g){this._push(this.createInt32Neg(f,g))}pushInt64Neg(f1,f2,g1,g2){this._push(this.createInt64Neg(f1,f2,g1,g2))}pushTrue(){this._push(this.createTrue())}pushFalse(){this._push(this.createFalse())}pushNull(){this._push(this.createNull())}pushUndefined(){this._push(this.createUndefined())}pushInfinity(){this._push(this.createInfinity())}pushInfinityNeg(){this._push(this.createInfinityNeg())}pushNaN(){this._push(this.createNaN())}pushNaNNeg(){this._push(this.createNaNNeg())}pushArrayStart(){this._createParent([],c.PARENT.ARRAY,-1)}pushArrayStartFixed(len){this._createArrayStartFixed(len)}pushArrayStartFixed32(len1,len2){const len=utils.buildInt32(len1,len2);this._createArrayStartFixed(len)}pushArrayStartFixed64(len1,len2,len3,len4){const len=utils.buildInt64(len1,len2,len3,len4);this._createArrayStartFixed(len)}pushObjectStart(){this._createObjectStartFixed(-1)}pushObjectStartFixed(len){this._createObjectStartFixed(len)}pushObjectStartFixed32(len1,len2){const len=utils.buildInt32(len1,len2);this._createObjectStartFixed(len)}pushObjectStartFixed64(len1,len2,len3,len4){const len=utils.buildInt64(len1,len2,len3,len4);this._createObjectStartFixed(len)}pushByteStringStart(){this._parents[this._depth]={type:c.PARENT.BYTE_STRING,length:-1,ref:[],values:0,tmpKey:null}}pushByteString(start,end){this._push(this.createByteStringFromHeap(start,end))}pushUtf8StringStart(){this._parents[this._depth]={type:c.PARENT.UTF8_STRING,length:-1,ref:[],values:0,tmpKey:null}}pushUtf8String(start,end){this._push(this.createUtf8StringFromHeap(start,end))}pushSimpleUnassigned(val){this._push(this.createSimpleUnassigned(val))}pushTagStart(tag){this._parents[this._depth]={type:c.PARENT.TAG,length:1,ref:[tag]}}pushTagStart4(f,g){this.pushTagStart(utils.buildInt32(f,g))}pushTagStart8(f1,f2,g1,g2){this.pushTagStart(utils.buildInt64(f1,f2,g1,g2))}pushTagUnassigned(tagNumber){ +this._push(this.createTag(tagNumber))}pushBreak(){if(this._currentParent.length>-1)throw new Error("Unexpected break");this._closeParent()}_createObjectStartFixed(len){if(0===len)return void this._push(this.createObject({}));this._createParent({},c.PARENT.OBJECT,len)}_createArrayStartFixed(len){if(0===len)return void this._push(this.createArray([]));this._createParent(new Array(len),c.PARENT.ARRAY,len)}_decode(input){if(0===input.byteLength)throw new Error("Input too short");this._reset(),this._heap8.set(input);const code=this.parser.parse(input.byteLength);if(this._depth>1){for(;0===this._currentParent.length;)this._closeParent();if(this._depth>1)throw new Error("Undeterminated nesting")}if(code>0)throw new Error("Failed to parse");if(0===this._res.length)throw new Error("No valid result")}decodeFirst(input){return this._decode(input),this._res[0]}decodeAll(input){return this._decode(input),this._res}static decode(input,enc){return"string"==typeof input&&(input=new Buffer(input,enc||"hex")),new Decoder({size:input.length}).decodeFirst(input)}static decodeAll(input,enc){return"string"==typeof input&&(input=new Buffer(input,enc||"hex")),new Decoder({size:input.length}).decodeAll(input)}}Decoder.decodeFirst=Decoder.decode,module.exports=Decoder}).call(exports,__webpack_require__(3),__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const constants=__webpack_require__(78),MT=constants.MT,SIMPLE=constants.SIMPLE,SYMS=constants.SYMS;class Simple{constructor(value){if("number"!=typeof value)throw new Error("Invalid Simple type: "+typeof value);if(value<0||value>255||(0|value)!==value)throw new Error("value must be a small positive integer: "+value);this.value=value}toString(){return"simple("+this.value+")"}inspect(){return"simple("+this.value+")"}encodeCBOR(gen){return gen._pushInt(this.value,MT.SIMPLE_FLOAT)}static isSimple(obj){return obj instanceof Simple}static decode(val,hasParent){switch(null==hasParent&&(hasParent=!0),val){case SIMPLE.FALSE:return!1;case SIMPLE.TRUE:return!0;case SIMPLE.NULL:return hasParent?null:SYMS.NULL;case SIMPLE.UNDEFINED:return hasParent?void 0:SYMS.UNDEFINED;case-1:if(!hasParent)throw new Error("Invalid BREAK");return SYMS.BREAK;default:return new Simple(val)}}}module.exports=Simple},function(module,exports,__webpack_require__){"use strict";class Tagged{constructor(tag,value,err){if(this.tag=tag,this.value=value,this.err=err,"number"!=typeof this.tag)throw new Error("Invalid tag type ("+typeof this.tag+")");if(this.tag<0||(0|this.tag)!==this.tag)throw new Error("Tag must be a positive integer: "+this.tag)}toString(){return`${this.tag}(${JSON.stringify(this.value)})`}encodeCBOR(gen){return gen._pushTag(this.tag),gen.pushAny(this.value)}convert(converters){var er,f;if("function"!=typeof(f=null!=converters?converters[this.tag]:void 0)&&"function"!=typeof(f=Tagged["_tag"+this.tag]))return this;try{return f.call(Tagged,this.value)}catch(error){return er=error,this.err=er,this}}}module.exports=Tagged},function(module,exports,__webpack_require__){(function(Buffer){function StreamCipher(mode,key,iv,decrypt){if(!(this instanceof StreamCipher))return new StreamCipher(mode,key,iv);Transform.call(this),this._finID=Buffer.concat([iv,new Buffer([0,0,0,1])]),iv=Buffer.concat([iv,new Buffer([0,0,0,2])]),this._cipher=new aes.AES(key),this._prev=new Buffer(iv.length),this._cache=new Buffer(""),this._secCache=new Buffer(""),this._decrypt=decrypt,this._alen=0,this._len=0,iv.copy(this._prev),this._mode=mode;var h=new Buffer(4);h.fill(0),this._ghash=new GHASH(this._cipher.encryptBlock(h)),this._authTag=null,this._called=!1}function xorTest(a,b){var out=0;a.length!==b.length&&out++;for(var len=Math.min(a.length,b.length),i=-1;++i>i%8,self._prev=shiftIn(self._prev,decrypt?bit:value);return out}function shiftIn(buffer,value){var len=buffer.length,i=-1,out=new Buffer(buffer.length);for(buffer=Buffer.concat([buffer,new Buffer([value])]);++i>7;return out}exports.encrypt=function(self,chunk,decrypt){for(var len=chunk.length,out=new Buffer(len),i=-1;++i>5]|=128<>>9<<4)]=len;for(var a=1732584193,b=-271733879,c=-1732584194,d=271733878,i=0;i>16)+(y>>16)+(lsw>>16)<<16|65535&lsw}function bit_rol(num,cnt){return num<>>32-cnt}var makeHash=__webpack_require__(330);module.exports=function(buf){return makeHash(buf,core_md5)}},function(module,exports,__webpack_require__){"use strict";function parseShardFun(str){if(str=str.trim(),0===str.length)throw new Error("empty shard string");if(!str.startsWith(PREFIX))throw new Error(`invalid or no path prefix: ${str}`);const parts=str.slice(PREFIX.length).split("/"),version=parts[0];if("v1"!==version)throw new Error(`expect 'v1' version, got '${version}'`);const name=parts[1];if(!parts[2])throw new Error("missing param");const param=parseInt(parts[2],10);switch(name){case"prefix":return new Prefix(param);case"suffix":return new Suffix(param);case"next-to-last":return new NextToLast(param);default:throw new Error(`unkown sharding function: ${name}`)}}const leftPad=__webpack_require__(216),Key=__webpack_require__(16).Key,readme=__webpack_require__(336),PREFIX=exports.PREFIX="/repo/flatfs/shard/",SHARDING_FN=exports.SHARDING_FN="SHARDING";exports.README_FN="_README";class Shard{constructor(param){this.param=param}fun(str){throw new Error("implement me")}toString(){return`${PREFIX}v1/${this.name}/${this.param}`}}class Prefix extends Shard{constructor(prefixLen){super(prefixLen),this._padding=leftPad("",prefixLen,"_"),this.name="prefix"}fun(noslash){return(noslash+this._padding).slice(0,this.param)}}class Suffix extends Shard{constructor(suffixLen){super(suffixLen),this._padding=leftPad("",suffixLen,"_"),this.name="suffix"}fun(noslash){const s=this._padding+noslash;return s.slice(s.length-this.param)}}class NextToLast extends Shard{constructor(suffixLen){super(suffixLen),this._padding=leftPad("",suffixLen+1,"_"),this.name="next-to-last"}fun(noslash){const s=this._padding+noslash,offset=s.length-this.param-1;return s.slice(offset,offset+this.param)}}exports.readShardFun=((path,store,callback)=>{const key=new Key(path).child(new Key(SHARDING_FN));("function"==typeof store.getRaw?store.getRaw.bind(store):store.get.bind(store))(key,(err,res)=>{if(err)return callback(err);let shard;try{shard=parseShardFun((res||"").toString().trim())}catch(err){return callback(err)}callback(null,shard)})}),exports.readme=readme,exports.parseShardFun=parseShardFun,exports.Prefix=Prefix,exports.Suffix=Suffix,exports.NextToLast=NextToLast},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function isSpecificValue(val){return val instanceof Buffer||val instanceof Date||val instanceof RegExp}function cloneSpecificValue(val){if(val instanceof Buffer){var x=new Buffer(val.length);return val.copy(x),x}if(val instanceof Date)return new Date(val.getTime());if(val instanceof RegExp)return new RegExp(val);throw new Error("Unexpected situation")}function deepCloneArray(arr){var clone=[];return arr.forEach(function(item,index){"object"==typeof item&&null!==item?Array.isArray(item)?clone[index]=deepCloneArray(item):isSpecificValue(item)?clone[index]=cloneSpecificValue(item):clone[index]=deepExtend({},item):clone[index]=item}),clone}var deepExtend=module.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var val,src,target=arguments[0],args=Array.prototype.slice.call(arguments,1);return args.forEach(function(obj){"object"!=typeof obj||null===obj||Array.isArray(obj)||Object.keys(obj).forEach(function(key){return src=target[key],val=obj[key],val===target?void 0:"object"!=typeof val||null===val?void(target[key]=val):Array.isArray(val)?void(target[key]=deepCloneArray(val)):isSpecificValue(val)?void(target[key]=cloneSpecificValue(val)):"object"!=typeof src||null===src||Array.isArray(src)?void(target[key]=deepExtend({},val)):void(target[key]=deepExtend(src,val))})}),target}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(process){function AbstractChainedBatch(db){this._db=db,this._operations=[],this._written=!1}AbstractChainedBatch.prototype._serializeKey=function(key){return this._db._serializeKey(key)},AbstractChainedBatch.prototype._serializeValue=function(value){return this._db._serializeValue(value)},AbstractChainedBatch.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},AbstractChainedBatch.prototype.put=function(key,value){this._checkWritten();var err=this._db._checkKey(key,"key",this._db._isBuffer);if(err)throw err;return key=this._serializeKey(key),value=this._serializeValue(value),"function"==typeof this._put?this._put(key,value):this._operations.push({type:"put",key:key,value:value}),this},AbstractChainedBatch.prototype.del=function(key){this._checkWritten();var err=this._db._checkKey(key,"key",this._db._isBuffer);if(err)throw err;return key=this._serializeKey(key),"function"==typeof this._del?this._del(key):this._operations.push({type:"del",key:key}),this},AbstractChainedBatch.prototype.clear=function(){return this._checkWritten(),this._operations=[],"function"==typeof this._clear&&this._clear(),this},AbstractChainedBatch.prototype.write=function(options,callback){if(this._checkWritten(),"function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("write() requires a callback argument");return"object"!=typeof options&&(options={}),this._written=!0,"function"==typeof this._write?this._write(callback):"function"==typeof this._db._batch?this._db._batch(this._operations,options,callback):void process.nextTick(callback)},module.exports=AbstractChainedBatch}).call(exports,__webpack_require__(1))},function(module,exports,__webpack_require__){(function(process){function AbstractIterator(db){this.db=db,this._ended=!1,this._nexting=!1}AbstractIterator.prototype.next=function(callback){var self=this;if("function"!=typeof callback)throw new Error("next() requires a callback argument");return self._ended?callback(new Error("cannot call next() after end()")):self._nexting?callback(new Error("cannot call next() before previous next() has completed")):(self._nexting=!0,"function"==typeof self._next?self._next(function(){self._nexting=!1,callback.apply(null,arguments)}):void process.nextTick(function(){self._nexting=!1,callback()}))},AbstractIterator.prototype.end=function(callback){if("function"!=typeof callback)throw new Error("end() requires a callback argument");return this._ended?callback(new Error("end() already called on iterator")):(this._ended=!0,"function"==typeof this._end?this._end(callback):void process.nextTick(callback))},module.exports=AbstractIterator}).call(exports,__webpack_require__(1))},function(module,exports,__webpack_require__){(function(process,Buffer){function AbstractLevelDOWN(location){if(!arguments.length||void 0===location)throw new Error("constructor requires at least a location argument");if("string"!=typeof location)throw new Error("constructor requires a location string argument");this.location=location,this.status="new"}var xtend=__webpack_require__(39),AbstractIterator=__webpack_require__(183),AbstractChainedBatch=__webpack_require__(182);AbstractLevelDOWN.prototype.open=function(options,callback){var self=this,oldStatus=this.status;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("open() requires a callback argument");"object"!=typeof options&&(options={}),options.createIfMissing=0!=options.createIfMissing,options.errorIfExists=!!options.errorIfExists,"function"==typeof this._open?(this.status="opening",this._open(options,function(err){if(err)return self.status=oldStatus,callback(err);self.status="open",callback()})):(this.status="open",process.nextTick(callback))},AbstractLevelDOWN.prototype.close=function(callback){var self=this,oldStatus=this.status;if("function"!=typeof callback)throw new Error("close() requires a callback argument");"function"==typeof this._close?(this.status="closing",this._close(function(err){if(err)return self.status=oldStatus,callback(err);self.status="closed",callback()})):(this.status="closed",process.nextTick(callback))},AbstractLevelDOWN.prototype.get=function(key,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("get() requires a callback argument");return(err=this._checkKey(key,"key"))?callback(err):(key=this._serializeKey(key),"object"!=typeof options&&(options={}),options.asBuffer=0!=options.asBuffer,"function"==typeof this._get?this._get(key,options,callback):void process.nextTick(function(){callback(new Error("NotFound"))}))},AbstractLevelDOWN.prototype.put=function(key,value,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("put() requires a callback argument");return(err=this._checkKey(key,"key"))?callback(err):(key=this._serializeKey(key),value=this._serializeValue(value),"object"!=typeof options&&(options={}),"function"==typeof this._put?this._put(key,value,options,callback):void process.nextTick(callback))},AbstractLevelDOWN.prototype.del=function(key,options,callback){var err;if("function"==typeof options&&(callback=options),"function"!=typeof callback)throw new Error("del() requires a callback argument");return(err=this._checkKey(key,"key"))?callback(err):(key=this._serializeKey(key),"object"!=typeof options&&(options={}),"function"==typeof this._del?this._del(key,options,callback):void process.nextTick(callback))},AbstractLevelDOWN.prototype.batch=function(array,options,callback){if(!arguments.length)return this._chainedBatch();if("function"==typeof options&&(callback=options),"function"==typeof array&&(callback=array),"function"!=typeof callback)throw new Error("batch(array) requires a callback argument");if(!Array.isArray(array))return callback(new Error("batch(array) requires an array argument"));options&&"object"==typeof options||(options={});for(var e,err,i=0,l=array.length;iparams.maximumExtraDataSize.v?cb("invalid amount of extra data"):void cb():cb("invalid gas limit"):cb("invalid Difficulty")})},BlockHeader.prototype.hash=function(){return utils.rlphash(this.raw)},BlockHeader.prototype.isGenesis=function(){return""===this.number.toString("hex")},BlockHeader.prototype.isHomestead=function(){return utils.bufferToInt(this.number)>=params.homeSteadForkNumber.v},BlockHeader.prototype.isHomesteadReprice=function(){return utils.bufferToInt(this.number)>=params.homesteadRepriceForkNumber.v}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){const SHA3=__webpack_require__(467),secp256k1=__webpack_require__(149),assert=__webpack_require__(9),rlp=__webpack_require__(46),BN=__webpack_require__(13),createHash=__webpack_require__(63);exports.MAX_INTEGER=new BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),exports.TWO_POW256=new BN("10000000000000000000000000000000000000000000000000000000000000000",16),exports.SHA3_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",exports.SHA3_NULL=new Buffer(exports.SHA3_NULL_S,"hex"),exports.SHA3_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",exports.SHA3_RLP_ARRAY=new Buffer(exports.SHA3_RLP_ARRAY_S,"hex"),exports.SHA3_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",exports.SHA3_RLP=new Buffer(exports.SHA3_RLP_S,"hex"),exports.BN=BN,exports.rlp=rlp,exports.secp256k1=secp256k1,exports.zeros=function(bytes){var buf=new Buffer(bytes);return buf.fill(0),buf},exports.setLengthLeft=exports.setLength=function(msg,length,right){var buf=exports.zeros(length);return msg=exports.toBuffer(msg),right?msg.length0&&"0"===first.toString();)a=a.slice(1),first=a[0];return a},exports.toBuffer=function(v){if(!Buffer.isBuffer(v))if(Array.isArray(v))v=new Buffer(v);else if("string"==typeof v)v=exports.isHexPrefixed(v)?new Buffer(exports.padToEven(exports.stripHexPrefix(v)),"hex"):new Buffer(v);else if("number"==typeof v)v=exports.intToBuffer(v);else if(null===v||void 0===v)v=new Buffer([]);else{if(!v.toArray)throw new Error("invalid type");v=new Buffer(v.toArray())}return v},exports.intToHex=function(i){assert(i%1==0,"number is not a integer"),assert(i>=0,"number must be positive");var hex=i.toString(16);return hex.length%2&&(hex="0"+hex),"0x"+hex},exports.intToBuffer=function(i){return new Buffer(exports.intToHex(i).slice(2),"hex")},exports.bufferToInt=function(buf){return parseInt(exports.bufferToHex(buf),16)},exports.bufferToHex=function(buf){return buf=exports.toBuffer(buf),0===buf.length?0:"0x"+buf.toString("hex")},exports.fromSigned=function(num){return new BN(num).fromTwos(256)},exports.toUnsigned=function(num){return new Buffer(num.toTwos(256).toArray())},exports.sha3=function(a,bytes){a=exports.toBuffer(a),bytes||(bytes=256);var h=new SHA3(bytes);return a&&h.update(a),new Buffer(h.digest("hex"),"hex")},exports.sha256=function(a){return a=exports.toBuffer(a),createHash("sha256").update(a).digest()},exports.ripemd160=function(a,padded){a=exports.toBuffer(a);var hash=createHash("rmd160").update(a).digest();return padded===!0?exports.setLength(hash,32):hash},exports.rlphash=function(a){return exports.sha3(rlp.encode(a))},exports.isValidPrivate=function(privateKey){return secp256k1.privateKeyVerify(privateKey)},exports.isValidPublic=function(publicKey,sanitize){return 64===publicKey.length?secp256k1.publicKeyVerify(Buffer.concat([new Buffer([4]),publicKey])):!!sanitize&&secp256k1.publicKeyVerify(publicKey)},exports.pubToAddress=exports.publicToAddress=function(pubKey,sanitize){return pubKey=exports.toBuffer(pubKey),sanitize&&64!==pubKey.length&&(pubKey=secp256k1.publicKeyConvert(pubKey,!1).slice(1)),assert(64===pubKey.length),exports.sha3(pubKey).slice(-20)};var privateToPublic=exports.privateToPublic=function(privateKey){return privateKey=exports.toBuffer(privateKey),secp256k1.publicKeyCreate(privateKey,!1).slice(1)};exports.importPublic=function(publicKey){return publicKey=exports.toBuffer(publicKey),64!==publicKey.length&&(publicKey=secp256k1.publicKeyConvert(publicKey,!1).slice(1)),publicKey},exports.ecsign=function(msgHash,privateKey){var sig=secp256k1.sign(msgHash,privateKey),ret={};return ret.r=sig.signature.slice(0,32),ret.s=sig.signature.slice(32,64),ret.v=sig.recovery+27,ret},exports.ecrecover=function(msgHash,v,r,s){var signature=Buffer.concat([exports.setLength(r,32),exports.setLength(s,32)],64),recovery=exports.bufferToInt(v)-27;if(0!==recovery&&1!==recovery)throw new Error("Invalid signature v value");var senderPubKey=secp256k1.recover(msgHash,signature,recovery);return secp256k1.publicKeyConvert(senderPubKey,!1).slice(1)},exports.toRpcSig=function(v,r,s){return exports.bufferToHex(Buffer.concat([r,s,exports.toBuffer(v-27)]))},exports.fromRpcSig=function(sig){sig=exports.toBuffer(sig);var v=sig[64];return v<27&&(v+=27),{v:v,r:sig.slice(0,32),s:sig.slice(32,64)}},exports.privateToAddress=function(privateKey){return exports.publicToAddress(privateToPublic(privateKey))},exports.isValidAddress=function(address){return/^0x[0-9a-fA-F]{40}$/i.test(address)},exports.toChecksumAddress=function(address){address=exports.stripHexPrefix(address).toLowerCase();for(var hash=exports.sha3(address).toString("hex"),ret="0x",i=0;i=8?address[i].toUpperCase():address[i];return ret},exports.isValidChecksumAddress=function(address){return exports.isValidAddress(address)&&exports.toChecksumAddress(address)===address},exports.generateAddress=function(from,nonce){return from=exports.toBuffer(from),nonce=new BN(nonce),nonce=nonce.isZero()?null:new Buffer(nonce.toArray()),exports.rlphash([from,nonce]).slice(-20)},exports.isPrecompiled=function(address){var a=exports.unpad(address);return 1===a.length&&a[0]>0&&a[0]<5},exports.isHexPrefixed=function(str){return"0x"===str.slice(0,2)},exports.stripHexPrefix=function(str){return"string"!=typeof str?str:exports.isHexPrefixed(str)?str.slice(2):str},exports.addHexPrefix=function(str){return"string"!=typeof str?str:exports.isHexPrefixed(str)?str:"0x"+str},exports.padToEven=function(a){return a.length%2&&(a="0"+a),a},exports.baToJSON=function(ba){if(Buffer.isBuffer(ba))return"0x"+ba.toString("hex");if(ba instanceof Array){for(var array=[],i=0;i=v.length,"The field "+field.name+" must not have more "+field.length+" bytes")):field.allowZero&&0===v.length||!field.length||assert(field.length===v.length,"The field "+field.name+" must have byte length of "+field.length),self.raw[i]=v}self._fields.push(field.name),Object.defineProperty(self,field.name,{enumerable:!0,configurable:!0,get:getter,set:setter}),field.default&&(self[field.name]=field.default),field.alias&&Object.defineProperty(self,field.alias,{enumerable:!1,configurable:!0,set:setter,get:getter})}),data)if("string"==typeof data&&(data=new Buffer(exports.stripHexPrefix(data),"hex")),Buffer.isBuffer(data)&&(data=rlp.decode(data)),Array.isArray(data)){if(data.length>self._fields.length)throw new Error("wrong number of fields in data");data.forEach(function(d,i){self[self._fields[i]]=exports.toBuffer(d)})}else{if("object"!=typeof data)throw new Error("invalid data");for(var prop in data)self._fields.indexOf(prop)!==-1&&(self[prop]=data[prop])}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function padToEven(value){var a=value;if("string"!=typeof a)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof a+", while padToEven.");return a.length%2&&(a="0"+a),a}function intToHex(i){return"0x"+padToEven(i.toString(16))}function intToBuffer(i){return new Buffer(intToHex(i).slice(2),"hex")}function getBinarySize(str){if("string"!=typeof str)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof str+"'.");return Buffer.byteLength(str,"utf8")}function arrayContainsArray(superset,subset,some){if(Array.isArray(superset)!==!0)throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof superset+"'");if(Array.isArray(subset)!==!0)throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof subset+"'");return subset[Boolean(some)&&"some"||"every"](function(value){return superset.indexOf(value)>=0})}function toUtf8(hex){return new Buffer(padToEven(stripHexPrefix(hex).replace(/^0+|0+$/g,"")),"hex").toString("utf8")}function toAscii(hex){var str="",i=0,l=hex.length;for("0x"===hex.substring(0,2)&&(i=2);i0||ivLen>0;){var hash=new MD5;hash.update(tmp),hash.update(password),salt&&hash.update(salt),tmp=hash.digest();var used=0;if(keyLen>0){var keyStart=key.length-keyLen;used=Math.min(keyLen,tmp.length),tmp.copy(key,keyStart,0,used),keyLen-=used}if(used0){var ivStart=iv.length-ivLen,length=Math.min(ivLen,tmp.length-used);tmp.copy(iv,ivStart,used,used+length),ivLen-=length}}return tmp.fill(0),{key:key,iv:iv}}var Buffer=__webpack_require__(5).Buffer,MD5=__webpack_require__(574);module.exports=EVP_BytesToKey},function(module,exports,__webpack_require__){(function(global){function hasBinary(obj){if(!obj||"object"!=typeof obj)return!1;if(isArray(obj)){for(var i=0,l=obj.length;i>>3}function g1_256(x){return rotr32(x,17)^rotr32(x,19)^x>>>10}var utils=__webpack_require__(28),rotr32=utils.rotr32;exports.ft_1=ft_1,exports.ch32=ch32,exports.maj32=maj32,exports.p32=p32,exports.s0_256=s0_256,exports.s1_256=s1_256,exports.g0_256=g0_256,exports.g1_256=g1_256},function(module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=8*nBytes-mLen-1,eMax=(1<>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];for(i+=d,e=s&(1<<-nBits)-1,s>>=-nBits,nBits+=eLen;nBits>0;e=256*e+buffer[offset+i],i+=d,nBits-=8);for(m=e&(1<<-nBits)-1,e>>=-nBits,nBits+=mLen;nBits>0;m=256*m+buffer[offset+i],i+=d,nBits-=8);if(0===e)e=1-eBias;else{if(e===eMax)return m?NaN:1/0*(s?-1:1);m+=Math.pow(2,mLen),e-=eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)},exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c,eLen=8*nBytes-mLen-1,eMax=(1<>1,rt=23===mLen?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||0===value&&1/value<0?1:0;for(value=Math.abs(value),isNaN(value)||value===1/0?(m=isNaN(value)?1:0,e=eMax):(e=Math.floor(Math.log(value)/Math.LN2),value*(c=Math.pow(2,-e))<1&&(e--,c*=2),value+=e+eBias>=1?rt/c:rt*Math.pow(2,1-eBias),value*c>=2&&(e++,c/=2),e+eBias>=eMax?(m=0,e=eMax):e+eBias>=1?(m=(value*c-1)*Math.pow(2,mLen),e+=eBias):(m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen),e=0));mLen>=8;buffer[offset+i]=255&m,i+=d,m/=256,mLen-=8);for(e=e<0;buffer[offset+i]=255&e,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=128*s}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function namespaceType(ns){const parts=ns.split(":");return parts.length<2?"":parts.slice(0,-1).join(":")}function namespaceValue(ns){const parts=ns.split(":");return parts[parts.length-1]}const path=__webpack_require__(44),uuid=__webpack_require__(281),pathSepS=path.sep,pathSep=new Buffer(pathSepS,"utf8")[0];class Key{constructor(s,clean){if("string"==typeof s?this._buf=new Buffer(s):Buffer.isBuffer(s)&&(this._buf=s),null==clean&&(clean=!0),clean&&this.clean(),0===this._buf.length||this._buf[0]!==pathSep)throw new Error(`Invalid key: ${this.toString()}`)}toString(encoding){return this._buf.toString(encoding||"utf8")}toBuffer(){return this._buf}get[Symbol.toStringTag](){return`[Key ${this.toString()}]`}static withNamespaces(list){return new Key(list.join(pathSepS))}static random(){return new Key(uuid().replace(/-/g,""))}clean(){this._buf&&0!==this._buf.length||(this._buf=new Buffer(pathSepS,"utf8")),this._buf=new Buffer(path.normalize(this.toString())),this._buf[0]!==pathSep&&(this._buf=Buffer.concat([new Buffer(pathSepS,"utf8"),this._buf])),this.toString().length>1&&this._buf[this._buf.length-1]===pathSep&&(this._buf=this._buf.slice(0,-1))}less(key){const list1=this.list(),list2=key.list();for(let i=0;ic2)return!1}return list1.length{cb(err&&!cond(err)?err:null)}}function ignoringAlreadyOpened(cb){return ignoringIf(err=>"Already open"===err.message,cb)}function ignoringNotFound(cb){return ignoringIf(err=>err.message.startsWith("ENOENT"),cb)}function buildOptions(_options){const options=Object.assign({},defaultOptions,_options);return options.storageBackends=Object.assign({},defaultOptions.storageBackends,options.storageBackends),options.storageBackendOptions=Object.assign({},defaultOptions.storageBackendOptions,options.storageBackendOptions),options}const waterfall=__webpack_require__(6),series=__webpack_require__(32),parallel=__webpack_require__(40),each=__webpack_require__(15),assert=__webpack_require__(9),path=__webpack_require__(44),debug=__webpack_require__(121),backends=__webpack_require__(406),version=__webpack_require__(410),config=__webpack_require__(408),apiAddr=__webpack_require__(405),blockstore=__webpack_require__(407),defaultOptions=__webpack_require__(409),log=debug("repo"),lockers={memory:__webpack_require__(201),fs:__webpack_require__(201)};class IpfsRepo{constructor(repoPath,options){assert.equal(typeof repoPath,"string","missing repoPath"),this.options=buildOptions(options),this.closed=!0,this.path=repoPath,this._locker=lockers[this.options.lock],assert(this._locker,"Unknown lock type: "+this.options.lock),this.root=backends.create("root",this.path,this.options),this.version=version(this.root),this.config=config(this.root),this.apiAddr=apiAddr(this.root)}init(config,callback){log("initializing at: %s",this.path),series([cb=>this.root.open(ignoringAlreadyOpened(cb)),cb=>this.config.set(config,cb),cb=>this.version.set(5,cb)],callback)}open(callback){if(!this.closed)return void setImmediate(()=>callback(new Error("repo is already open")));log("opening at: %s",this.path),waterfall([cb=>this.root.open(ignoringAlreadyOpened(cb)),cb=>this._isInitialized(cb),cb=>this._locker.lock(this.path,cb),(lck,cb)=>{log("aquired repo.lock"),this.lockfile=lck,cb()},cb=>{log("creating datastore"),this.datastore=backends.create("datastore",path.join(this.path,"datastore"),this.options),log("creating blocks"),blockstore(backends.create("blocks",path.join(this.path,"blocks"),this.options),this.options.storageBackendOptions.blocks,cb)},(blocks,cb)=>{this.blocks=blocks,cb()},cb=>{this.closed=!1,log("all opened"),cb()}],err=>{err&&this.lockfile?this.lockfile.close(err2=>{err2?log("error removing lock",err2):this.lockfile=null,callback(err)}):callback(err)})}_isInitialized(callback){log("init check"),parallel({config:cb=>this.config.exists(cb),version:cb=>this.version.check(5,cb)},(err,res)=>{return log("init",err,res),err?callback(err):res.config?void callback():callback(new Error("repo is not initialized yet"))})}close(callback){if(this.closed)return callback(new Error("repo is already closed"));log("closing at: %s",this.path),series([cb=>this.apiAddr.delete(ignoringNotFound(cb)),cb=>{each([this.blocks,this.datastore],(store,callback)=>store.close(callback),cb)},cb=>{log("unlocking"),this.closed=!0,this.lockfile.close(cb)},cb=>{this.lockfile=null,cb()}],err=>callback(err))}exists(callback){this.version.exists(callback)}}module.exports=IpfsRepo}).call(exports,__webpack_require__(38).setImmediate)},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(121),setImmediate=__webpack_require__(7),log=debug("repo:lock"),LOCKS={};exports.lock=((dir,callback)=>{const file=dir+"/repo.lock";log("locking %s",file),LOCKS[file]=!0;const closer={close(cb){LOCKS[file]&&delete LOCKS[file],setImmediate(cb)}};setImmediate(()=>{callback(null,closer)})}),exports.locked=((dir,callback)=>{const file=dir+"/repo.lock";log("checking lock: %s") +;const locked=LOCKS[file];setImmediate(()=>{callback(null,locked)})})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function flattenObject(obj,delimiter){return delimiter=delimiter||"/",0===Object.keys(obj).length?[]:traverse(obj).reduce(function(acc,x){"object"==typeof x&&x["/"]&&this.update(void 0);const path=this.path.join(delimiter);return""!==path&&acc.push({path:path,value:x}),acc},[])}const util=__webpack_require__(203),traverse=__webpack_require__(692);exports=module.exports,exports.multicodec="dag-cbor",exports.resolve=((block,path,callback)=>{"function"==typeof path&&(callback=path,path=void 0),util.deserialize(block.data,(err,node)=>{if(err)return callback(err);if(!path||"/"===path)return callback(null,{value:node,remainderPath:""});const parts=path.split("/"),val=traverse(node).get(parts);if(val)return callback(null,{value:val,remainderPath:""});let value,len=parts.length;for(let i=0;i{"function"==typeof options&&(callback=options,options=void 0),options=options||{},util.deserialize(block.data,(err,node)=>{if(err)return callback(err);callback(null,flattenObject(node).map(el=>el.path))})}),exports.isLink=((block,path,callback)=>{exports.resolve(block,path,(err,result)=>{return err?callback(err):result.remainderPath.length>0?callback(new Error("path out of scope")):void("object"==typeof result.value&&result.value["/"]?callback(null,result.value):callback(null,!1))})})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function tagCID(cid){return"string"==typeof cid&&(cid=new CID(cid).buffer),new cbor.Tagged(CID_CBOR_TAG,Buffer.concat([new Buffer("00","hex"),cid]))}function replaceCIDbyTAG(dagNode){function transform(obj){if(!obj||Buffer.isBuffer(obj)||"string"==typeof obj)return obj;if(Array.isArray(obj))return obj.map(transform);const keys=Object.keys(obj);if(1===keys.length&&"/"===keys[0])return tagCID(obj["/"]);if(keys.length>0){let out={};return keys.forEach(key=>{"object"==typeof obj[key]?out[key]=transform(obj[key]):out[key]=obj[key]}),out}return obj}let circular;try{circular=isCircular(dagNode)}catch(e){circular=!1}if(circular)throw new Error("The object passed has circular references");return transform(dagNode)}const cbor=__webpack_require__(321),multihashing=__webpack_require__(22),CID=__webpack_require__(8),waterfall=__webpack_require__(6),setImmediate=__webpack_require__(7),isCircular=__webpack_require__(455),resolver=__webpack_require__(202),CID_CBOR_TAG=42,decoder=new cbor.Decoder({tags:{[CID_CBOR_TAG]:val=>{return val=val.slice(1),{"/":val}}}});exports=module.exports,exports.serialize=((dagNode,callback)=>{let serialized;try{const dagNodeTagged=replaceCIDbyTAG(dagNode);serialized=cbor.encode(dagNodeTagged)}catch(err){return setImmediate(()=>callback(err))}setImmediate(()=>callback(null,serialized))}),exports.deserialize=((data,callback)=>{let deserialized;try{deserialized=decoder.decodeFirst(data)}catch(err){return setImmediate(()=>callback(err))}setImmediate(()=>callback(null,deserialized))}),exports.cid=((dagNode,callback)=>{waterfall([cb=>exports.serialize(dagNode,cb),(serialized,cb)=>multihashing(serialized,"sha2-256",cb),(mh,cb)=>cb(null,new CID(1,resolver.multicodec,mh))],callback)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function mapFromEthObj(account,options,callback){const paths=[];paths.push({path:"storage",value:{"/":cidFromHash("eth-storage-trie",account.stateRoot).toBaseEncodedString()}}),paths.push({path:"code",value:{"/":cidFromHash("raw",account.codeHash).toBaseEncodedString()}}),paths.push({path:"stateRoot",value:account.stateRoot}),paths.push({path:"codeHash",value:account.codeHash}),paths.push({path:"nonce",value:account.nonce}),paths.push({path:"balance",value:account.balance}),paths.push({path:"isEmpty",value:account.isEmpty()}),paths.push({path:"isContract",value:account.isContract()}),callback(null,paths)}const EthAccount=__webpack_require__(370),createResolver=__webpack_require__(66),cidFromHash=__webpack_require__(55);module.exports=createResolver("eth-account-snapshot",EthAccount,mapFromEthObj)},function(module,exports,__webpack_require__){"use strict";function mapFromEthObj(ethObj,options,callback){const paths=[];paths.push({path:"parent",value:{"/":cidFromHash("eth-block",ethObj.parentHash).toBaseEncodedString()}}),paths.push({path:"ommers",value:{"/":cidFromHash("eth-block-list",ethObj.uncleHash).toBaseEncodedString()}}),paths.push({path:"transactions",value:{"/":cidFromHash("eth-tx-trie",ethObj.transactionsTrie).toBaseEncodedString()}}),paths.push({path:"transactionReceipts",value:{"/":cidFromHash("eth-tx-receipt-trie",ethObj.receiptTrie).toBaseEncodedString()}}),paths.push({path:"state",value:{"/":cidFromHash("eth-state-trie",ethObj.stateRoot).toBaseEncodedString()}}),paths.push({path:"parentHash",value:ethObj.parentHash}),paths.push({path:"ommerHash",value:ethObj.uncleHash}),paths.push({path:"transactionTrieRoot",value:ethObj.transactionsTrie}),paths.push({path:"transactionReceiptTrieRoot",value:ethObj.receiptTrie}),paths.push({path:"stateRoot",value:ethObj.stateRoot}),paths.push({path:"authorAddress",value:ethObj.coinbase}),paths.push({path:"bloom",value:ethObj.bloom}),paths.push({path:"difficulty",value:ethObj.difficulty}),paths.push({path:"number",value:ethObj.number}),paths.push({path:"gasLimit",value:ethObj.gasLimit}),paths.push({path:"gasUsed",value:ethObj.gasUsed}),paths.push({path:"timestamp",value:ethObj.timestamp}),paths.push({path:"extraData",value:ethObj.extraData}),paths.push({path:"mixHash",value:ethObj.mixHash}),paths.push({path:"nonce",value:ethObj.nonce}),callback(null,paths)}const EthBlockHeader=__webpack_require__(189),createResolver=__webpack_require__(66),cidFromHash=__webpack_require__(55);module.exports=createResolver("eth-block",EthBlockHeader,mapFromEthObj)},function(module,exports,__webpack_require__){"use strict";function mapFromEthObj(tx,options,callback){const paths=[];paths.push({path:"nonce",value:tx.nonce}),paths.push({path:"gasPrice",value:tx.gasPrice}),paths.push({path:"gasLimit",value:tx.gasLimit}),paths.push({path:"toAddress",value:tx.to}),paths.push({path:"value",value:tx.value}),paths.push({path:"data",value:tx.data}),paths.push({path:"v",value:tx.v}),paths.push({path:"r",value:tx.r}),paths.push({path:"s",value:tx.s}),paths.push({path:"fromAddress",value:tx.from}),paths.push({path:"signature",value:[tx.v,tx.r,tx.s]}),paths.push({path:"isContractPublish",value:tx.toCreationAddress()}),callback(null,paths)}const EthTx=__webpack_require__(372),createResolver=__webpack_require__(66);__webpack_require__(55);module.exports=createResolver("eth-tx",EthTx,mapFromEthObj)},function(module,exports,__webpack_require__){"use strict";function cidFromEthObj(multicodec,ethObj){return cidFromHash(multicodec,ethObj.hash())}const cidFromHash=__webpack_require__(55);module.exports=cidFromEthObj},function(module,exports){function createIsLink(resolve){return function(block,path,callback){resolve(block,path,(err,result)=>{return err?callback(err):result.remainderPath.length>0?callback(new Error("path out of scope")):void("object"==typeof result.value&&result.value["/"]?callback(null,result.value):callback(null,!1))})}}module.exports=createIsLink},function(module,exports,__webpack_require__){function createUtil(multicodec,EthObjClass){return{deserialize:asyncify(serialized=>new EthObjClass(serialized)),serialize:asyncify(ethObj=>ethObj.serialize()),cid:asyncify(ethObj=>cidFromEthObj(multicodec,ethObj))}}const cidFromEthObj=__webpack_require__(207),asyncify=__webpack_require__(73);module.exports=createUtil},function(module,exports){module.exports=function(str){if("string"!=typeof str)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof str+", while checking isHexPrefixed.");return"0x"===str.slice(0,2)}},function(module,exports){function isPromise(obj){return obj&&"function"==typeof obj.then}module.exports=isPromise},function(module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return"[object Array]"==toString.call(arr)}},function(module,exports){module.exports={genesisGasLimit:{v:5e3,d:"Gas limit of the Genesis block."},genesisDifficulty:{v:17179869184,d:"Difficulty of the Genesis block."},genesisNonce:{v:"0x0000000000000042",d:"the geneis nonce"},genesisExtraData:{v:"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa",d:"extra data "},genesisHash:{v:"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3",d:"genesis hash"},genesisStateRoot:{v:"0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544",d:"the genesis state root"},minGasLimit:{v:5e3,d:"Minimum the gas limit may ever be."},gasLimitBoundDivisor:{v:1024,d:"The bound divisor of the gas limit, used in update calculations."},minimumDifficulty:{v:131072,d:"The minimum that the difficulty may ever be."},difficultyBoundDivisor:{v:2048,d:"The bound divisor of the difficulty, used in the update calculations."},durationLimit:{v:13,d:"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not."},maximumExtraDataSize:{v:32,d:"Maximum size extra data may be after Genesis."},epochDuration:{v:3e4,d:"Duration between proof-of-work epochs."},stackLimit:{v:1024,d:"Maximum size of VM stack allowed."},callCreateDepth:{v:1024,d:"Maximum depth of call/create stack."},tierStepGas:{v:[0,2,3,5,8,10,20],d:"Once per operation, for a selection of them."},expGas:{v:10,d:"Once per EXP instuction."},expByteGas:{v:10,d:"Times ceil(log256(exponent)) for the EXP instruction."},sha3Gas:{v:30,d:"Once per SHA3 operation."},sha3WordGas:{v:6,d:"Once per word of the SHA3 operation's data."},sloadGas:{v:50,d:"Once per SLOAD operation."},sstoreSetGas:{v:2e4,d:"Once per SSTORE operation if the zeroness changes from zero."},sstoreResetGas:{v:5e3,d:"Once per SSTORE operation if the zeroness does not change from zero."},sstoreRefundGas:{v:15e3,d:"Once per SSTORE operation if the zeroness changes to zero."},jumpdestGas:{v:1,d:"Refunded gas, once per SSTORE operation if the zeroness changes to zero."},logGas:{v:375,d:"Per LOG* operation."},logDataGas:{v:8,d:"Per byte in a LOG* operation's data."},logTopicGas:{v:375,d:"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas."},createGas:{v:32e3,d:"Once per CREATE operation & contract-creation transaction."},callGas:{v:40,d:"Once per CALL operation & message call transaction."},callStipend:{v:2300,d:"Free gas given at beginning of call."},callValueTransferGas:{v:9e3,d:"Paid for CALL when the value transfor is non-zero."},callNewAccountGas:{v:25e3,d:"Paid for CALL when the destination address didn't exist prior."},suicideRefundGas:{v:24e3,d:"Refunded following a suicide operation."},memoryGas:{v:3,d:"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL."},quadCoeffDiv:{v:512,d:"Divisor for the quadratic particle of the memory cost equation."},createDataGas:{v:200,d:""},txGas:{v:21e3,d:"Per transaction. NOTE: Not payable on data of calls between transactions."},txCreation:{v:32e3,d:"the cost of creating a contract via tx"},txDataZeroGas:{v:4,d:"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions."},txDataNonZeroGas:{v:68,d:"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions."},copyGas:{v:3,d:"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added."},ecrecoverGas:{v:3e3,d:""},sha256Gas:{v:60,d:""},sha256WordGas:{v:12,d:""},ripemd160Gas:{v:600,d:""},ripemd160WordGas:{v:120,d:""},identityGas:{v:15,d:""},identityWordGas:{v:3,d:""},minerReward:{v:"5000000000000000000",d:"the amount a miner get rewarded for mining a block"},ommerReward:{v:"625000000000000000",d:"The amount of wei a miner of an uncle block gets for being inculded in the blockchain"},niblingReward:{v:"156250000000000000",d:"the amount a miner gets for inculding a uncle"},homeSteadForkNumber:{v:115e4,d:"the block that the Homestead fork started at"},homesteadRepriceForkNumber:{v:2463e3,d:"the block that the Homestead Reprice (EIP150) fork started at"},timebombPeriod:{v:1e5,d:"Exponential difficulty timebomb period"},freeBlockPeriod:{v:2}}},function(module,exports){module.exports={Addresses:{Swarm:["/libp2p-webrtc-star/dns4/star-signal.cloud.ipfs.team/wss"],API:"",Gateway:""},Discovery:{MDNS:{Enabled:!1,Interval:10},webRTCStar:{Enabled:!0}},Bootstrap:["/dns4/ams-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd","/dns4/sfo-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx","/dns4/lon-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3","/dns4/sfo-2.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z","/dns4/sfo-3.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM","/dns4/sgp-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu","/dns4/nyc-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm","/dns4/nyc-2.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64"]}},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(462)(__webpack_require__(466))},function(module,exports,__webpack_require__){"use strict";function leftPad(str,len,ch){if(str+="",(len-=str.length)<=0)return str;if(ch||0===ch||(ch=" ")," "===(ch+="")&&len<10)return cache[len]+str;for(var pad="";;){if(1&len&&(pad+=ch),!(len>>=1))break;ch+=ch}return pad+str}module.exports=leftPad;var cache=[""," "," "," "," "," "," "," "," "," "]},function(module,exports,__webpack_require__){(function(process){function ReadableState(options,stream){var Duplex=__webpack_require__(56);options=options||{};var hwm=options.highWaterMark,defaultHwm=options.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:defaultHwm,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!options.objectMode,stream instanceof Duplex&&(this.objectMode=this.objectMode||!!options.readableObjectMode),this.defaultEncoding=options.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(StringDecoder||(StringDecoder=__webpack_require__(70).StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding)}function Readable(options){__webpack_require__(56);if(!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this),this.readable=!0,Stream.call(this)}function readableAddChunk(stream,state,chunk,encoding,addToFront){var er=chunkInvalid(state,chunk);if(er)stream.emit("error",er);else if(util.isNullOrUndefined(chunk))state.reading=!1,state.ended||onEofChunk(stream,state);else if(state.objectMode||chunk&&chunk.length>0)if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var e=new Error("stream.unshift() after end event");stream.emit("error",e)}else!state.decoder||addToFront||encoding||(chunk=state.decoder.write(chunk)),addToFront||(state.reading=!1),state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream)),maybeReadMore(stream,state);else addToFront||(state.reading=!1);return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM)n=MAX_HWM;else{n--;for(var p=1;p<32;p<<=1)n|=n>>p;n++}return n}function howMuchToRead(n,state){return 0===state.length&&state.ended?0:state.objectMode?0===n?0:1:isNaN(n)||util.isNull(n)?state.flowing&&state.buffer.length?state.buffer[0].length:state.length:n<=0?0:(n>state.highWaterMark&&(state.highWaterMark=roundUpToNextPowerOf2(n)),n>state.length?state.ended?state.length:(state.needReadable=!0,0):n)}function chunkInvalid(state,chunk){var er=null;return util.isBuffer(chunk)||util.isString(chunk)||util.isNullOrUndefined(chunk)||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function onEofChunk(stream,state){if(state.decoder&&!state.ended){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?process.nextTick(function(){emitReadable_(stream)}):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,process.nextTick(function(){maybeReadMore_(stream,state)}))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=length)ret=stringMode?list.join(""):Buffer.concat(list,length),list.length=0;else if(n0)throw new Error("endReadable called on non-empty stream");state.endEmitted||(state.ended=!0,process.nextTick(function(){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}))}function forEach(xs,f){for(var i=0,l=xs.length;i0)&&(state.emittedReadable=!1),0===n&&state.needReadable&&(state.length>=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n0?fromList(n,state):null,util.isNull(ret)&&(state.needReadable=!0,n=0),state.length-=n,0!==state.length||state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&0===state.length&&endReadable(this),util.isNull(ret)||this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable){debug("onunpipe"),readable===src&&cleanup()}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",cleanup),src.removeListener("data",ondata),!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain()}function ondata(chunk){debug("ondata"),!1===dest.write(chunk)&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EE.listenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:cleanup;state.endEmitted?process.nextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);return dest.on("drain",ondrain),src.on("data",ondata),dest._events&&dest._events.error?isArray(dest._events.error)?dest._events.error.unshift(onerror):dest._events.error=[onerror,dest._events.error]:dest.on("error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState;if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i1){for(var cbs=[],c=0;c{return{digest(data,cb){nodeify(crypto.subtle.sign({name:"HMAC"},key,data).then(raw=>Buffer.from(raw)),cb)},length:lengths[hashType]}}),callback)}},function(module,exports,__webpack_require__){"use strict";function exportKey(pair){return Promise.all([webcrypto.subtle.exportKey("jwk",pair.privateKey),webcrypto.subtle.exportKey("jwk",pair.publicKey)])}function derivePublicFromPrivate(jwKey){return webcrypto.subtle.importKey("jwk",{kty:jwKey.kty,n:jwKey.n,e:jwKey.e,alg:jwKey.alg,kid:jwKey.kid},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"])}const nodeify=__webpack_require__(96),Buffer=__webpack_require__(5).Buffer,webcrypto=__webpack_require__(129)();exports.utils=__webpack_require__(490),exports.generateKey=function(bits,callback){nodeify(webcrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:bits,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(exportKey).then(keys=>({privateKey:keys[0],publicKey:keys[1]})),callback)},exports.unmarshalPrivateKey=function(key,callback){const privateKey=webcrypto.subtle.importKey("jwk",key,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]);nodeify(Promise.all([privateKey,derivePublicFromPrivate(key)]).then(keys=>exportKey({privateKey:keys[0],publicKey:keys[1]})).then(keys=>({privateKey:keys[0],publicKey:keys[1]})),callback)},exports.getRandomValues=function(arr){return Buffer.from(webcrypto.getRandomValues(arr))},exports.hashAndSign=function(key,msg,callback){nodeify(webcrypto.subtle.importKey("jwk",key,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]).then(privateKey=>{return webcrypto.subtle.sign({name:"RSASSA-PKCS1-v1_5"},privateKey,Uint8Array.from(msg))}).then(sig=>Buffer.from(sig)),callback)},exports.hashAndVerify=function(key,sig,msg,callback){nodeify(webcrypto.subtle.importKey("jwk",key,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]).then(publicKey=>{return webcrypto.subtle.verify({name:"RSASSA-PKCS1-v1_5"},publicKey,sig,msg)}),callback)}},function(module,exports,__webpack_require__){"use strict";function randomBytes(number){if(!number||"number"!=typeof number)throw new Error("first argument must be a Number bigger than 0");return rsa.getRandomValues(new Uint8Array(number))}const rsa=__webpack_require__(226);module.exports=randomBytes},function(module,exports,__webpack_require__){"use strict";const BN=__webpack_require__(47).bignum,Buffer=__webpack_require__(5).Buffer;exports.toBase64=function(bn,len){return bn.toArrayLike(Buffer,"be",len).toString("base64").replace(/(=*)$/,"").replace(/\+/g,"-").replace(/\//g,"_")},exports.toBn=function(str){return new BN(Buffer.from(str,"base64"))}},function(module,exports,__webpack_require__){"use strict";const protobuf=__webpack_require__(33),rpcProto=protobuf(__webpack_require__(495)),topicDescriptorProto=protobuf(__webpack_require__(496));exports=module.exports,exports.rpc=rpcProto,exports.td=topicDescriptorProto},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const protobuf=__webpack_require__(33),schema=new Buffer(` message Identify { // protocolVersion determines compatibility between peers optional string protocolVersion = 5; // e.g. ipfs/1.0.0 @@ -50,13 +50,13 @@ message Identify { repeated string protocols = 3; } -`);module.exports=protobuf(schema).Identify}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";module.exports="/mplex/6.7.0"},function(module,exports,__webpack_require__){"use strict";function getPeerInfo(peer,peerBook){let p;if(PeerInfo.isPeerInfo(peer))p=peer;else if(multiaddr.isMultiaddr(peer)){const peerIdB58Str=peer.getPeerId();try{p=peerBook.get(peerIdB58Str)}catch(err){p=new PeerInfo(PeerId.createFromB58String(peerIdB58Str))}p.multiaddrs.add(peer)}else{if(!PeerId.isPeerId(peer))throw new Error("peer type not recognized");{const peerIdB58Str=peer.toB58String();try{p=peerBook.get(peerIdB58Str)}catch(err){throw new Error("Couldnt get PeerInfo")}}}return p}const PeerId=__webpack_require__(22),PeerInfo=__webpack_require__(35),multiaddr=__webpack_require__(24);module.exports=getPeerInfo},function(module,exports,__webpack_require__){"use strict";module.exports={tag:"/plaintext/1.0.0",encrypt(id,privKey,conn){return conn}}},function(module,exports,__webpack_require__){(function(global){function debounce(func,wait,options){function invokeFunc(time){var args=lastArgs,thisArg=lastThis;return lastArgs=lastThis=void 0,lastInvokeTime=time,result=func.apply(thisArg,args)}function leadingEdge(time){return lastInvokeTime=time,timerId=setTimeout(timerExpired,wait),leading?invokeFunc(time):result}function remainingWait(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime,result=wait-timeSinceLastCall;return maxing?nativeMin(result,maxWait-timeSinceLastInvoke):result}function shouldInvoke(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime;return void 0===lastCallTime||timeSinceLastCall>=wait||timeSinceLastCall<0||maxing&&timeSinceLastInvoke>=maxWait}function timerExpired(){var time=now();if(shouldInvoke(time))return trailingEdge(time);timerId=setTimeout(timerExpired,remainingWait(time))}function trailingEdge(time){return timerId=void 0,trailing&&lastArgs?invokeFunc(time):(lastArgs=lastThis=void 0,result)}function cancel(){void 0!==timerId&&clearTimeout(timerId),lastInvokeTime=0,lastArgs=lastCallTime=lastThis=timerId=void 0}function flush(){return void 0===timerId?result:trailingEdge(now())}function debounced(){var time=now(),isInvoking=shouldInvoke(time);if(lastArgs=arguments,lastThis=this,lastCallTime=time,isInvoking){if(void 0===timerId)return leadingEdge(lastCallTime);if(maxing)return timerId=setTimeout(timerExpired,wait),invokeFunc(lastCallTime)}return void 0===timerId&&(timerId=setTimeout(timerExpired,wait)),result}var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime=0,leading=!1,maxing=!1,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return wait=toNumber(wait)||0,isObject(options)&&(leading=!!options.leading,maxing="maxWait"in options,maxWait=maxing?nativeMax(toNumber(options.maxWait)||0,wait):maxWait,trailing="trailing"in options?!!options.trailing:trailing),debounced.cancel=cancel,debounced.flush=flush,debounced}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}var FUNC_ERROR_TEXT="Expected a function",NAN=NaN,symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),objectProto=Object.prototype,objectToString=objectProto.toString,nativeMax=Math.max,nativeMin=Math.min,now=function(){return root.Date.now()};module.exports=debounce}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(global){function getValue(object,key){return null==object?void 0:object[key]}function isHostObject(value){var result=!1;if(null!=value&&"function"!=typeof value.toString)try{result=!!(value+"")}catch(e){}return result}function Hash(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index-1&&value%1==0&&value-1:!!length&&baseIndexOf(collection,value,fromIndex)>-1}function isArguments(value){return isArrayLikeObject(value)&&hasOwnProperty.call(value,"callee")&&(!propertyIsEnumerable.call(value,"callee")||objectToString.call(value)==argsTag)}function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isString(value){return"string"==typeof value||!isArray(value)&&isObjectLike(value)&&objectToString.call(value)==stringTag}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toFinite(value){if(!value)return 0===value?value:0;if((value=toNumber(value))===INFINITY||value===-INFINITY){return(value<0?-1:1)*MAX_INTEGER}return value===value?value:0}function toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function values(object){return object?baseValues(object,keys(object)):[]}var INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,MAX_INTEGER=1.7976931348623157e308,NAN=NaN,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",stringTag="[object String]",symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,reIsUint=/^(?:0|[1-9]\d*)$/,freeParseInt=parseInt,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,propertyIsEnumerable=objectProto.propertyIsEnumerable,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),nativeMax=Math.max,isArray=Array.isArray;module.exports=includes},function(module,exports,__webpack_require__){var root=__webpack_require__(232),Symbol=root.Symbol;module.exports=Symbol},function(module,exports,__webpack_require__){(function(global){var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global;module.exports=freeGlobal}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){var freeGlobal=__webpack_require__(231),freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")();module.exports=root},function(module,exports){function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}var MAX_SAFE_INTEGER=9007199254740991;module.exports=isLength},function(module,exports){function isObject(value){var type=typeof value;return null!=value&&("object"==type||"function"==type)}module.exports=isObject},function(module,exports){module.exports=function(fun){!function next(){var loop=!0,sync=!1;do{sync=!0,loop=!1,fun.call(this,function(){sync?loop=!0:next()}),sync=!1}while(loop)}()}},function(module,exports,__webpack_require__){"use strict";function toArray(msg,enc){if(Array.isArray(msg))return msg.slice();if(!msg)return[];var res=[];if("string"!=typeof msg){for(var i=0;i>8,lo=255&c;hi?res.push(hi,lo):res.push(lo)}return res}function zero2(word){return 1===word.length?"0"+word:word}function toHex(msg){for(var res="",i=0;i{return function(input,callback){const done=(err,res)=>setImmediate(()=>{callback(err,res)});let res;try{res=doWork(input)}catch(err){return void done(err)}done(null,res)}}),exports.toBuf=((doWork,other)=>input=>{return new Buffer(doWork(input,other),"hex")}),exports.fromString=((doWork,other)=>_input=>{return doWork(Buffer.isBuffer(_input)?_input.toString():_input,other)}),exports.fromNumberTo32BitBuf=((doWork,other)=>input=>{let number=doWork(input,other);const bytes=new Array(4);for(let i=0;i<4;i++)bytes[i]=255&number,number>>=8;return Buffer.from(bytes)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";exports=module.exports,exports.PROTOCOL_ID="/multistream/1.0.0"},function(module,exports,__webpack_require__){"use strict";function matchExact(myProtocol,senderProtocol,callback){callback(null,myProtocol===senderProtocol)}module.exports=matchExact},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function select(multicodec,callback,log){const stream=handshake({timeout:6e4},callback),shake=stream.handshake;return log("writing multicodec: "+multicodec),writeEncoded(shake,new Buffer(multicodec+"\n"),callback),pullLP.decodeFromReader(shake,(err,data)=>{if(err)return callback(err);const protocol=data.toString().slice(0,-1);if(protocol!==multicodec)return callback(new Error(`"${multicodec}" not supported`),shake.rest());log("received ack: "+protocol),callback(null,shake.rest())}),stream}const handshake=__webpack_require__(55),pullLP=__webpack_require__(23),util=__webpack_require__(91),writeEncoded=util.writeEncoded;module.exports=select}).call(exports,__webpack_require__(0).Buffer)},function(module,exports){exports.endianness=function(){return"LE"},exports.hostname=function(){return"undefined"!=typeof location?location.hostname:""},exports.loadavg=function(){return[]},exports.uptime=function(){return 0},exports.freemem=function(){return Number.MAX_VALUE},exports.totalmem=function(){return Number.MAX_VALUE},exports.cpus=function(){return[]},exports.type=function(){return"Browser"},exports.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},exports.networkInterfaces=exports.getNetworkInterfaces=function(){return{}},exports.arch=function(){return"javascript"},exports.platform=function(){return"browser"},exports.tmpdir=exports.tmpDir=function(){return"/tmp"},exports.EOL="\n"},function(module,exports){var re=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,parts=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];module.exports=function(str){var src=str,b=str.indexOf("["),e=str.indexOf("]");b!=-1&&e!=-1&&(str=str.substring(0,b)+str.substring(b,e).replace(/:/g,";")+str.substring(e,str.length));for(var m=re.exec(str||""),uri={},i=14;i--;)uri[parts[i]]=m[i]||"";return b!=-1&&e!=-1&&(uri.source=src,uri.host=uri.host.substring(1,uri.host.length-1).replace(/;/g,":"),uri.authority=uri.authority.replace("[","").replace("]","").replace(/;/g,":"),uri.ipv6uri=!0),uri}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function getB58Str(peer){let b58Str;if("string"==typeof peer)b58Str=peer;else if(Buffer.isBuffer(peer))b58Str=bs58.encode(peer).toString();else if(PeerId.isPeerId(peer))b58Str=peer.toB58String();else{if(!PeerInfo.isPeerInfo(peer))throw new Error("not valid PeerId or PeerInfo, or B58Str");b58Str=peer.id.toB58String()}return b58Str}const bs58=__webpack_require__(79),PeerId=__webpack_require__(22),PeerInfo=__webpack_require__(35);class PeerBook{constructor(){this._peers={}}has(peer){const b58Str=getB58Str(peer);return Boolean(this._peers[b58Str])}put(peerInfo,replace){const localPeerInfo=this._peers[peerInfo.id.toB58String()];if(!localPeerInfo||replace)return this._peers[peerInfo.id.toB58String()]=peerInfo,peerInfo;peerInfo.multiaddrs.forEach(ma=>localPeerInfo.multiaddrs.add(ma));const ma=peerInfo.isConnected();return ma&&localPeerInfo.connect(ma),peerInfo.protocols.forEach(p=>localPeerInfo.protocols.add(p)),!localPeerInfo.id.privKey&&peerInfo.id.privKey&&(localPeerInfo.id.privKey=peerInfo.id.privKey),!localPeerInfo.id.pubKey&&peerInfo.id.pubKey&&(localPeerInfo.id.pubKey=peerInfo.id.pubKey),localPeerInfo}get(peer){const b58Str=getB58Str(peer),peerInfo=this._peers[b58Str];if(peerInfo)return peerInfo;throw new Error("PeerInfo not found")}getAll(){return this._peers}getAllArray(){return Object.keys(this._peers).map(b58Str=>this._peers[b58Str])}getMultiaddrs(peer){return this.get(peer).multiaddrs.toArray()}remove(peer){const b58Str=getB58Str(peer);this._peers[b58Str]&&delete this._peers[b58Str]}}module.exports=PeerBook}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function ensureMultiaddr(ma){return multiaddr.isMultiaddr(ma)?ma:multiaddr(ma)}const multiaddr=__webpack_require__(24);module.exports={ensureMultiaddr:ensureMultiaddr}},function(module,exports,__webpack_require__){var Source=__webpack_require__(96),Sink=__webpack_require__(248);module.exports=function(){var source=Source(),sink=Sink();return{source:source,sink:sink,resolve:function(duplex){source.resolve(duplex.source),sink.resolve(duplex.sink)}}}},function(module,exports){module.exports=function(stream){function consume(_read){if(!_read)throw new Error("must be passed a readable");read=_read,started&&stream(read)}var read,started=!1;Math.random();return consume.resolve=consume.ready=consume.start=function(_stream){return started=!0,stream=_stream||stream,read&&stream(read),consume},consume}},function(module,exports){module.exports=function(onPause){function reader(_read){return read=_read,function(abort,cb){paused?wait=[abort,cb]:read(abort,cb)}}var wait,read,paused;return reader.pause=function(){paused||onPause&&onPause(paused=!0)},reader.resume=function(){if(paused&&(paused=!1,onPause&&onPause(paused),wait)){var _wait=wait;wait=null,read(_wait[0],_wait[1])}},reader}},function(module,exports,__webpack_require__){"use strict";function isInteger(i){return Number.isFinite(i)}function isFunction(f){return"function"==typeof f}function maxDelay(fn,delay){return delay?function(a,cb){var timer=setTimeout(function(){fn(new Error("pull-reader: read exceeded timeout"),cb)},delay);fn(a,function(err,value){clearTimeout(timer),cb(err,value)})}:fn}var State=__webpack_require__(601);module.exports=function(timeout){function drain(){for(;queue.length;)if(null==queue[0].length&&state.has(1))queue.shift().cb(null,state.get());else if(state.has(queue[0].length)){var next=queue.shift();next.cb(null,state.get(next.length))}else{if(!ended)return!!queue.length;queue.shift().cb(ended)}return queue.length||!state.has(1)||abort}function more(){drain()&&!reading&&(!read||reading||streaming||(reading=!0,readTimed(null,function(err,data){if(reading=!1,err)return ended=err,drain();state.add(data),more()})))}function reader(_read){if(abort){for(;queue.length;)queue.shift().cb(abort);return cb&&cb(abort)}readTimed=maxDelay(_read,timeout),read=_read,more()}var read,readTimed,ended,streaming,abort,queue=[],reading=!1,state=State();return reader.abort=function(err,cb){abort=err||!0,read?(reading=!0,read(abort,function(){for(;queue.length;)queue.shift().cb(abort);cb&&cb(abort)})):cb()},reader.read=function(len,_timeout,cb){if(isFunction(_timeout)&&(cb=_timeout,_timeout=timeout),!isFunction(cb))return streaming=!0,function(abort,cb){if(reading||state.has(1)){if(abort)return read(abort,cb);queue.push({length:null,cb:cb}),more()}else maxDelay(read,_timeout)(abort,function(err,data){cb(err,data)})};queue.push({length:isInteger(len)?len:null,cb:cb}),more()},reader}},function(module,exports,__webpack_require__){(function(setImmediate,process){function duplex(reader,read){function drain(){if(waiting=!1,read&&!busy){for(;output.length&&!s.paused;)s.emit("data",output.shift());if(!s.paused){if(_ended)return s.emit("end");busy=!0,read(null,function next(end,data){busy=!1,s.paused?(end===!0?_ended=end:end?s.emit("error",end):output.push(data),waiting=!0):end&&(ended=end)!==!0?s.emit("error",end):(ended=ended||end)?s.emit("end"):(s.emit("data",data),busy=!0,read(null,next))})}}}reader&&"object"==typeof reader&&(read=reader.source,reader=reader.sink);var ended,needDrain,cbs=[],input=[],s=new Stream;s.writable=s.readable=!0,s.write=function(data){return cbs.length?cbs.shift()(null,data):input.push(data),cbs.length||(needDrain=!0),!!cbs.length},s.end=function(){read?input.length?drain():read(ended=!0,cbs.length?cbs.shift():function(){}):cbs.length&&cbs.shift()(!0)},s.source=function(end,cb){input.length?(cb(null,input.shift()),input.length||s.emit("drain")):((ended=ended||end)?cb(ended):cbs.push(cb),needDrain&&(needDrain=!1,s.emit("drain")))};var n;reader&&(n=reader(s.source)),n&&!read&&(read=n);var output=[],_ended=!1,waiting=!1,busy=!1;if(s.sink=function(_read){read=_read,next(drain)},read){s.sink(read);var pipe=s.pipe.bind(s);s.pipe=function(dest,opts){var res=pipe(dest,opts);return s.paused&&s.resume(),res}}return s.pause=function(){return s.paused=!0,s},s.resume=function(){return s.paused=!1,drain(),s},s.destroy=function(){!ended&&read&&read(ended=!0,function(){}),ended=!0,cbs.length&&cbs.shift()(!0),s.emit("close")},s}var Stream=__webpack_require__(25);module.exports=duplex,module.exports.source=function(source){return duplex(null,source)},module.exports.sink=function(sink){return duplex(sink,null)};var next=void 0===setImmediate?process.nextTick:setImmediate}).call(exports,__webpack_require__(37).setImmediate,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";module.exports=function pull(a){var length=arguments.length;if("function"==typeof a&&1===a.length){for(var args=new Array(length),i=0;i0?("string"==typeof chunk||state.objectMode||Object.getPrototypeOf(chunk)===Buffer.prototype||(chunk=_uint8ArrayToBuffer(chunk)),addToFront?state.endEmitted?stream.emit("error",new Error("stream.unshift() after end event")):addChunk(stream,state,chunk,!0):state.ended?stream.emit("error",new Error("stream.push() after EOF")):(state.reading=!1,state.decoder&&!encoding?(chunk=state.decoder.write(chunk),state.objectMode||0!==chunk.length?addChunk(stream,state,chunk,!1):maybeReadMore(stream,state)):addChunk(stream,state,chunk,!1))):addToFront||(state.reading=!1)}return needMoreData(state)}function addChunk(stream,state,chunk,addToFront){state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream)),maybeReadMore(stream,state)}function chunkInvalid(state,chunk){var er;return _isUint8Array(chunk)||"string"==typeof chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||0===state.length&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}function onEofChunk(stream,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?processNextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,processNextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return nstr.length?str.length:n;if(ret+=nb===str.length?str:str.slice(0,n),0===(n-=nb)){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=Buffer.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),0===(n-=nb)){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,processNextTick(endReadableNT,state,stream))}function endReadableNT(state,stream){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}function indexOf(xs,x){for(var i=0,l=xs.length;i=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n0?fromList(n,state):null,null===ret?(state.needReadable=!0,n=0):state.length-=n,0===state.length&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),null!==ret&&this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable,unpipeInfo){debug("onunpipe"),readable===src&&unpipeInfo&&unpipeInfo.hasUnpiped===!1&&(unpipeInfo.hasUnpiped=!0,cleanup())}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",unpipe),src.removeListener("data",ondata),cleanedUp=!0,!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain()}function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1,!1!==dest.write(chunk)||increasedAwaitDrain||((1===state.pipesCount&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EElistenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:unpipe;state.endEmitted?processNextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1,increasedAwaitDrain=!1;return src.on("data",ondata),prependListener(dest,"error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState,unpipeInfo={hasUnpiped:!1};if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this,unpipeInfo),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i>>32-n}function fn1(a,b,c,d,e,m,k,s){return rotl(a+(b^c^d)+m+k|0,s)+e|0}function fn2(a,b,c,d,e,m,k,s){return rotl(a+(b&c|~b&d)+m+k|0,s)+e|0}function fn3(a,b,c,d,e,m,k,s){return rotl(a+((b|~c)^d)+m+k|0,s)+e|0}function fn4(a,b,c,d,e,m,k,s){return rotl(a+(b&d|c&~d)+m+k|0,s)+e|0}function fn5(a,b,c,d,e,m,k,s){return rotl(a+(b^(c|~d))+m+k|0,s)+e|0}var inherits=__webpack_require__(1),HashBase=__webpack_require__(376);inherits(RIPEMD160,HashBase),RIPEMD160.prototype._update=function(){for(var m=new Array(16),i=0;i<16;++i)m[i]=this._block.readInt32LE(4*i);var al=this._a,bl=this._b,cl=this._c,dl=this._d,el=this._e;al=fn1(al,bl,cl,dl,el,m[0],0,11),cl=rotl(cl,10),el=fn1(el,al,bl,cl,dl,m[1],0,14),bl=rotl(bl,10),dl=fn1(dl,el,al,bl,cl,m[2],0,15),al=rotl(al,10),cl=fn1(cl,dl,el,al,bl,m[3],0,12),el=rotl(el,10),bl=fn1(bl,cl,dl,el,al,m[4],0,5),dl=rotl(dl,10),al=fn1(al,bl,cl,dl,el,m[5],0,8),cl=rotl(cl,10),el=fn1(el,al,bl,cl,dl,m[6],0,7),bl=rotl(bl,10),dl=fn1(dl,el,al,bl,cl,m[7],0,9),al=rotl(al,10),cl=fn1(cl,dl,el,al,bl,m[8],0,11),el=rotl(el,10),bl=fn1(bl,cl,dl,el,al,m[9],0,13),dl=rotl(dl,10),al=fn1(al,bl,cl,dl,el,m[10],0,14),cl=rotl(cl,10),el=fn1(el,al,bl,cl,dl,m[11],0,15),bl=rotl(bl,10),dl=fn1(dl,el,al,bl,cl,m[12],0,6),al=rotl(al,10),cl=fn1(cl,dl,el,al,bl,m[13],0,7),el=rotl(el,10),bl=fn1(bl,cl,dl,el,al,m[14],0,9),dl=rotl(dl,10),al=fn1(al,bl,cl,dl,el,m[15],0,8),cl=rotl(cl,10),el=fn2(el,al,bl,cl,dl,m[7],1518500249,7),bl=rotl(bl,10),dl=fn2(dl,el,al,bl,cl,m[4],1518500249,6),al=rotl(al,10),cl=fn2(cl,dl,el,al,bl,m[13],1518500249,8),el=rotl(el,10),bl=fn2(bl,cl,dl,el,al,m[1],1518500249,13),dl=rotl(dl,10),al=fn2(al,bl,cl,dl,el,m[10],1518500249,11),cl=rotl(cl,10),el=fn2(el,al,bl,cl,dl,m[6],1518500249,9),bl=rotl(bl,10),dl=fn2(dl,el,al,bl,cl,m[15],1518500249,7),al=rotl(al,10),cl=fn2(cl,dl,el,al,bl,m[3],1518500249,15),el=rotl(el,10),bl=fn2(bl,cl,dl,el,al,m[12],1518500249,7),dl=rotl(dl,10),al=fn2(al,bl,cl,dl,el,m[0],1518500249,12),cl=rotl(cl,10),el=fn2(el,al,bl,cl,dl,m[9],1518500249,15),bl=rotl(bl,10),dl=fn2(dl,el,al,bl,cl,m[5],1518500249,9),al=rotl(al,10),cl=fn2(cl,dl,el,al,bl,m[2],1518500249,11),el=rotl(el,10),bl=fn2(bl,cl,dl,el,al,m[14],1518500249,7),dl=rotl(dl,10),al=fn2(al,bl,cl,dl,el,m[11],1518500249,13),cl=rotl(cl,10),el=fn2(el,al,bl,cl,dl,m[8],1518500249,12),bl=rotl(bl,10),dl=fn3(dl,el,al,bl,cl,m[3],1859775393,11),al=rotl(al,10),cl=fn3(cl,dl,el,al,bl,m[10],1859775393,13),el=rotl(el,10),bl=fn3(bl,cl,dl,el,al,m[14],1859775393,6),dl=rotl(dl,10),al=fn3(al,bl,cl,dl,el,m[4],1859775393,7),cl=rotl(cl,10),el=fn3(el,al,bl,cl,dl,m[9],1859775393,14),bl=rotl(bl,10),dl=fn3(dl,el,al,bl,cl,m[15],1859775393,9),al=rotl(al,10),cl=fn3(cl,dl,el,al,bl,m[8],1859775393,13),el=rotl(el,10),bl=fn3(bl,cl,dl,el,al,m[1],1859775393,15),dl=rotl(dl,10),al=fn3(al,bl,cl,dl,el,m[2],1859775393,14),cl=rotl(cl,10),el=fn3(el,al,bl,cl,dl,m[7],1859775393,8),bl=rotl(bl,10),dl=fn3(dl,el,al,bl,cl,m[0],1859775393,13),al=rotl(al,10),cl=fn3(cl,dl,el,al,bl,m[6],1859775393,6),el=rotl(el,10),bl=fn3(bl,cl,dl,el,al,m[13],1859775393,5),dl=rotl(dl,10),al=fn3(al,bl,cl,dl,el,m[11],1859775393,12),cl=rotl(cl,10),el=fn3(el,al,bl,cl,dl,m[5],1859775393,7),bl=rotl(bl,10),dl=fn3(dl,el,al,bl,cl,m[12],1859775393,5),al=rotl(al,10),cl=fn4(cl,dl,el,al,bl,m[1],2400959708,11),el=rotl(el,10),bl=fn4(bl,cl,dl,el,al,m[9],2400959708,12),dl=rotl(dl,10),al=fn4(al,bl,cl,dl,el,m[11],2400959708,14),cl=rotl(cl,10),el=fn4(el,al,bl,cl,dl,m[10],2400959708,15),bl=rotl(bl,10),dl=fn4(dl,el,al,bl,cl,m[0],2400959708,14),al=rotl(al,10),cl=fn4(cl,dl,el,al,bl,m[8],2400959708,15),el=rotl(el,10),bl=fn4(bl,cl,dl,el,al,m[12],2400959708,9),dl=rotl(dl,10),al=fn4(al,bl,cl,dl,el,m[4],2400959708,8),cl=rotl(cl,10),el=fn4(el,al,bl,cl,dl,m[13],2400959708,9),bl=rotl(bl,10),dl=fn4(dl,el,al,bl,cl,m[3],2400959708,14),al=rotl(al,10),cl=fn4(cl,dl,el,al,bl,m[7],2400959708,5),el=rotl(el,10),bl=fn4(bl,cl,dl,el,al,m[15],2400959708,6),dl=rotl(dl,10),al=fn4(al,bl,cl,dl,el,m[14],2400959708,8),cl=rotl(cl,10),el=fn4(el,al,bl,cl,dl,m[5],2400959708,6),bl=rotl(bl,10),dl=fn4(dl,el,al,bl,cl,m[6],2400959708,5),al=rotl(al,10),cl=fn4(cl,dl,el,al,bl,m[2],2400959708,12),el=rotl(el,10),bl=fn5(bl,cl,dl,el,al,m[4],2840853838,9),dl=rotl(dl,10),al=fn5(al,bl,cl,dl,el,m[0],2840853838,15),cl=rotl(cl,10),el=fn5(el,al,bl,cl,dl,m[5],2840853838,5),bl=rotl(bl,10),dl=fn5(dl,el,al,bl,cl,m[9],2840853838,11),al=rotl(al,10),cl=fn5(cl,dl,el,al,bl,m[7],2840853838,6),el=rotl(el,10),bl=fn5(bl,cl,dl,el,al,m[12],2840853838,8),dl=rotl(dl,10),al=fn5(al,bl,cl,dl,el,m[2],2840853838,13),cl=rotl(cl,10),el=fn5(el,al,bl,cl,dl,m[10],2840853838,12),bl=rotl(bl,10),dl=fn5(dl,el,al,bl,cl,m[14],2840853838,5),al=rotl(al,10),cl=fn5(cl,dl,el,al,bl,m[1],2840853838,12),el=rotl(el,10),bl=fn5(bl,cl,dl,el,al,m[3],2840853838,13),dl=rotl(dl,10),al=fn5(al,bl,cl,dl,el,m[8],2840853838,14),cl=rotl(cl,10),el=fn5(el,al,bl,cl,dl,m[11],2840853838,11),bl=rotl(bl,10),dl=fn5(dl,el,al,bl,cl,m[6],2840853838,8),al=rotl(al,10),cl=fn5(cl,dl,el,al,bl,m[15],2840853838,5),el=rotl(el,10),bl=fn5(bl,cl,dl,el,al,m[13],2840853838,6),dl=rotl(dl,10);var ar=this._a,br=this._b,cr=this._c,dr=this._d,er=this._e;ar=fn5(ar,br,cr,dr,er,m[5],1352829926,8),cr=rotl(cr,10),er=fn5(er,ar,br,cr,dr,m[14],1352829926,9),br=rotl(br,10),dr=fn5(dr,er,ar,br,cr,m[7],1352829926,9),ar=rotl(ar,10),cr=fn5(cr,dr,er,ar,br,m[0],1352829926,11),er=rotl(er,10),br=fn5(br,cr,dr,er,ar,m[9],1352829926,13),dr=rotl(dr,10),ar=fn5(ar,br,cr,dr,er,m[2],1352829926,15),cr=rotl(cr,10),er=fn5(er,ar,br,cr,dr,m[11],1352829926,15),br=rotl(br,10),dr=fn5(dr,er,ar,br,cr,m[4],1352829926,5),ar=rotl(ar,10),cr=fn5(cr,dr,er,ar,br,m[13],1352829926,7),er=rotl(er,10),br=fn5(br,cr,dr,er,ar,m[6],1352829926,7),dr=rotl(dr,10),ar=fn5(ar,br,cr,dr,er,m[15],1352829926,8),cr=rotl(cr,10),er=fn5(er,ar,br,cr,dr,m[8],1352829926,11),br=rotl(br,10),dr=fn5(dr,er,ar,br,cr,m[1],1352829926,14),ar=rotl(ar,10),cr=fn5(cr,dr,er,ar,br,m[10],1352829926,14),er=rotl(er,10),br=fn5(br,cr,dr,er,ar,m[3],1352829926,12),dr=rotl(dr,10),ar=fn5(ar,br,cr,dr,er,m[12],1352829926,6),cr=rotl(cr,10),er=fn4(er,ar,br,cr,dr,m[6],1548603684,9),br=rotl(br,10),dr=fn4(dr,er,ar,br,cr,m[11],1548603684,13),ar=rotl(ar,10),cr=fn4(cr,dr,er,ar,br,m[3],1548603684,15),er=rotl(er,10),br=fn4(br,cr,dr,er,ar,m[7],1548603684,7),dr=rotl(dr,10),ar=fn4(ar,br,cr,dr,er,m[0],1548603684,12),cr=rotl(cr,10),er=fn4(er,ar,br,cr,dr,m[13],1548603684,8),br=rotl(br,10),dr=fn4(dr,er,ar,br,cr,m[5],1548603684,9),ar=rotl(ar,10),cr=fn4(cr,dr,er,ar,br,m[10],1548603684,11),er=rotl(er,10),br=fn4(br,cr,dr,er,ar,m[14],1548603684,7),dr=rotl(dr,10),ar=fn4(ar,br,cr,dr,er,m[15],1548603684,7),cr=rotl(cr,10),er=fn4(er,ar,br,cr,dr,m[8],1548603684,12),br=rotl(br,10),dr=fn4(dr,er,ar,br,cr,m[12],1548603684,7),ar=rotl(ar,10),cr=fn4(cr,dr,er,ar,br,m[4],1548603684,6),er=rotl(er,10),br=fn4(br,cr,dr,er,ar,m[9],1548603684,15),dr=rotl(dr,10),ar=fn4(ar,br,cr,dr,er,m[1],1548603684,13),cr=rotl(cr,10),er=fn4(er,ar,br,cr,dr,m[2],1548603684,11),br=rotl(br,10),dr=fn3(dr,er,ar,br,cr,m[15],1836072691,9),ar=rotl(ar,10),cr=fn3(cr,dr,er,ar,br,m[5],1836072691,7),er=rotl(er,10),br=fn3(br,cr,dr,er,ar,m[1],1836072691,15),dr=rotl(dr,10),ar=fn3(ar,br,cr,dr,er,m[3],1836072691,11),cr=rotl(cr,10),er=fn3(er,ar,br,cr,dr,m[7],1836072691,8),br=rotl(br,10),dr=fn3(dr,er,ar,br,cr,m[14],1836072691,6),ar=rotl(ar,10),cr=fn3(cr,dr,er,ar,br,m[6],1836072691,6),er=rotl(er,10),br=fn3(br,cr,dr,er,ar,m[9],1836072691,14),dr=rotl(dr,10),ar=fn3(ar,br,cr,dr,er,m[11],1836072691,12),cr=rotl(cr,10),er=fn3(er,ar,br,cr,dr,m[8],1836072691,13),br=rotl(br,10),dr=fn3(dr,er,ar,br,cr,m[12],1836072691,5),ar=rotl(ar,10),cr=fn3(cr,dr,er,ar,br,m[2],1836072691,14),er=rotl(er,10),br=fn3(br,cr,dr,er,ar,m[10],1836072691,13),dr=rotl(dr,10),ar=fn3(ar,br,cr,dr,er,m[0],1836072691,13),cr=rotl(cr,10),er=fn3(er,ar,br,cr,dr,m[4],1836072691,7),br=rotl(br,10),dr=fn3(dr,er,ar,br,cr,m[13],1836072691,5),ar=rotl(ar,10),cr=fn2(cr,dr,er,ar,br,m[8],2053994217,15),er=rotl(er,10),br=fn2(br,cr,dr,er,ar,m[6],2053994217,5),dr=rotl(dr,10),ar=fn2(ar,br,cr,dr,er,m[4],2053994217,8),cr=rotl(cr,10),er=fn2(er,ar,br,cr,dr,m[1],2053994217,11),br=rotl(br,10),dr=fn2(dr,er,ar,br,cr,m[3],2053994217,14),ar=rotl(ar,10),cr=fn2(cr,dr,er,ar,br,m[11],2053994217,14),er=rotl(er,10),br=fn2(br,cr,dr,er,ar,m[15],2053994217,6),dr=rotl(dr,10),ar=fn2(ar,br,cr,dr,er,m[0],2053994217,14),cr=rotl(cr,10),er=fn2(er,ar,br,cr,dr,m[5],2053994217,6),br=rotl(br,10),dr=fn2(dr,er,ar,br,cr,m[12],2053994217,9),ar=rotl(ar,10),cr=fn2(cr,dr,er,ar,br,m[2],2053994217,12),er=rotl(er,10),br=fn2(br,cr,dr,er,ar,m[13],2053994217,9),dr=rotl(dr,10),ar=fn2(ar,br,cr,dr,er,m[9],2053994217,12),cr=rotl(cr,10),er=fn2(er,ar,br,cr,dr,m[7],2053994217,5),br=rotl(br,10),dr=fn2(dr,er,ar,br,cr,m[10],2053994217,15),ar=rotl(ar,10),cr=fn2(cr,dr,er,ar,br,m[14],2053994217,8),er=rotl(er,10),br=fn1(br,cr,dr,er,ar,m[12],0,8),dr=rotl(dr,10),ar=fn1(ar,br,cr,dr,er,m[15],0,5),cr=rotl(cr,10),er=fn1(er,ar,br,cr,dr,m[10],0,12),br=rotl(br,10),dr=fn1(dr,er,ar,br,cr,m[4],0,9),ar=rotl(ar,10),cr=fn1(cr,dr,er,ar,br,m[1],0,12),er=rotl(er,10),br=fn1(br,cr,dr,er,ar,m[5],0,5),dr=rotl(dr,10),ar=fn1(ar,br,cr,dr,er,m[8],0,14),cr=rotl(cr,10),er=fn1(er,ar,br,cr,dr,m[7],0,6),br=rotl(br,10),dr=fn1(dr,er,ar,br,cr,m[6],0,8),ar=rotl(ar,10),cr=fn1(cr,dr,er,ar,br,m[2],0,13),er=rotl(er,10),br=fn1(br,cr,dr,er,ar,m[13],0,6),dr=rotl(dr,10),ar=fn1(ar,br,cr,dr,er,m[14],0,5),cr=rotl(cr,10),er=fn1(er,ar,br,cr,dr,m[0],0,15),br=rotl(br,10),dr=fn1(dr,er,ar,br,cr,m[3],0,13),ar=rotl(ar,10),cr=fn1(cr,dr,er,ar,br,m[9],0,11),er=rotl(er,10),br=fn1(br,cr,dr,er,ar,m[11],0,11),dr=rotl(dr,10);var t=this._b+cl+dr|0;this._b=this._c+dl+er|0,this._c=this._d+el+ar|0,this._d=this._e+al+br|0,this._e=this._a+bl+cr|0,this._a=t},RIPEMD160.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var buffer=new Buffer(20);return buffer.writeInt32LE(this._a,0),buffer.writeInt32LE(this._b,4),buffer.writeInt32LE(this._c,8),buffer.writeInt32LE(this._d,12),buffer.writeInt32LE(this._e,16),buffer},module.exports=RIPEMD160}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function initCompressedValue(value,defaultValue){return void 0===value?defaultValue:(assert.isBoolean(value,messages.COMPRESSED_TYPE_INVALID),value)}var assert=__webpack_require__(645),der=__webpack_require__(646),messages=__webpack_require__(121);module.exports=function(secp256k1){return{privateKeyVerify:function(privateKey){return assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),32===privateKey.length&&secp256k1.privateKeyVerify(privateKey)},privateKeyExport:function(privateKey,compressed){assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),assert.isBufferLength(privateKey,32,messages.EC_PRIVATE_KEY_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0);var publicKey=secp256k1.privateKeyExport(privateKey,compressed);return der.privateKeyExport(privateKey,publicKey,compressed)},privateKeyImport:function(privateKey){if(assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),(privateKey=der.privateKeyImport(privateKey))&&32===privateKey.length&&secp256k1.privateKeyVerify(privateKey))return privateKey;throw new Error(messages.EC_PRIVATE_KEY_IMPORT_DER_FAIL)},privateKeyTweakAdd:function(privateKey,tweak){return assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),assert.isBufferLength(privateKey,32,messages.EC_PRIVATE_KEY_LENGTH_INVALID),assert.isBuffer(tweak,messages.TWEAK_TYPE_INVALID),assert.isBufferLength(tweak,32,messages.TWEAK_LENGTH_INVALID),secp256k1.privateKeyTweakAdd(privateKey,tweak)},privateKeyTweakMul:function(privateKey,tweak){return assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),assert.isBufferLength(privateKey,32,messages.EC_PRIVATE_KEY_LENGTH_INVALID),assert.isBuffer(tweak,messages.TWEAK_TYPE_INVALID),assert.isBufferLength(tweak,32,messages.TWEAK_LENGTH_INVALID),secp256k1.privateKeyTweakMul(privateKey,tweak)},publicKeyCreate:function(privateKey,compressed){return assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),assert.isBufferLength(privateKey,32,messages.EC_PRIVATE_KEY_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0),secp256k1.publicKeyCreate(privateKey,compressed)},publicKeyConvert:function(publicKey,compressed){return assert.isBuffer(publicKey,messages.EC_PUBLIC_KEY_TYPE_INVALID),assert.isBufferLength2(publicKey,33,65,messages.EC_PUBLIC_KEY_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0),secp256k1.publicKeyConvert(publicKey,compressed)},publicKeyVerify:function(publicKey){return assert.isBuffer(publicKey,messages.EC_PUBLIC_KEY_TYPE_INVALID), -secp256k1.publicKeyVerify(publicKey)},publicKeyTweakAdd:function(publicKey,tweak,compressed){return assert.isBuffer(publicKey,messages.EC_PUBLIC_KEY_TYPE_INVALID),assert.isBufferLength2(publicKey,33,65,messages.EC_PUBLIC_KEY_LENGTH_INVALID),assert.isBuffer(tweak,messages.TWEAK_TYPE_INVALID),assert.isBufferLength(tweak,32,messages.TWEAK_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0),secp256k1.publicKeyTweakAdd(publicKey,tweak,compressed)},publicKeyTweakMul:function(publicKey,tweak,compressed){return assert.isBuffer(publicKey,messages.EC_PUBLIC_KEY_TYPE_INVALID),assert.isBufferLength2(publicKey,33,65,messages.EC_PUBLIC_KEY_LENGTH_INVALID),assert.isBuffer(tweak,messages.TWEAK_TYPE_INVALID),assert.isBufferLength(tweak,32,messages.TWEAK_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0),secp256k1.publicKeyTweakMul(publicKey,tweak,compressed)},publicKeyCombine:function(publicKeys,compressed){assert.isArray(publicKeys,messages.EC_PUBLIC_KEYS_TYPE_INVALID),assert.isLengthGTZero(publicKeys,messages.EC_PUBLIC_KEYS_LENGTH_INVALID);for(var i=0;i=0||y.ucmp(BN.p)>=0?null:6!==first&&7!==first||y.isOdd()===(7===first)?0!==x.redSqr().redMul(x).redIAdd7().ucmp(y.redSqr())?null:new ECPoint(x,y):null):(x=BN.fromBuffer(publicKey.slice(1,33)),x.ucmp(BN.p)>=0?null:null===(y=x.redSqr().redMul(x).redIAdd7().redSqrt())?null:(3===first!==y.isOdd()&&(y=y.redNeg()),new ECPoint(x,y)))},ECPoint.prototype.toPublicKey=function(compressed){var publicKey,x=this.x,y=this.y;return compressed?(publicKey=Buffer.alloc(33),publicKey[0]=y.isOdd()?3:2,x.toBuffer().copy(publicKey,1)):(publicKey=Buffer.alloc(65),publicKey[0]=4,x.toBuffer().copy(publicKey,1),y.toBuffer().copy(publicKey,33)),publicKey},ECPoint.fromECJPoint=function(p){if(p.inf)return new ECPoint(null,null);var zinv=p.z.redInvm(),zinv2=zinv.redSqr();return new ECPoint(p.x.redMul(zinv2),p.y.redMul(zinv2).redMul(zinv))},ECPoint.prototype.toECJPoint=function(){return this.inf?new ECJPoint(null,null,null):new ECJPoint(this.x,this.y,ECJPoint.one)},ECPoint.prototype.neg=function(){return this.inf?this:new ECPoint(this.x,this.y.redNeg())},ECPoint.prototype.add=function(p){if(this.inf)return p;if(p.inf)return this;if(0===this.x.ucmp(p.x))return 0===this.y.ucmp(p.y)?this.dbl():new ECPoint(null,null);var s=this.y.redSub(p.y);s.isZero()||(s=s.redMul(this.x.redSub(p.x).redInvm()));var nx=s.redSqr().redISub(this.x).redISub(p.x);return new ECPoint(nx,s.redMul(this.x.redSub(nx)).redISub(this.y))},ECPoint.prototype.dbl=function(){if(this.inf)return this;var yy=this.y.redAdd(this.y);if(yy.isZero())return new ECPoint(null,null);var x2=this.x.redSqr(),s=x2.redAdd(x2).redIAdd(x2).redMul(yy.redInvm()),nx=s.redSqr().redISub(this.x.redAdd(this.x));return new ECPoint(nx,s.redMul(this.x.redSub(nx)).redISub(this.y))},ECPoint.prototype.mul=function(num){for(var nafPoints=this._getNAFPoints(4),points=nafPoints.points,naf=num.getNAF(nafPoints.wnd),acc=new ECJPoint(null,null,null),i=naf.length-1;i>=0;i--){for(var k=0;i>=0&&0===naf[i];i--,++k);if(i>=0&&(k+=1),acc=acc.dblp(k),i<0)break;var z=naf[i];acc=z>0?acc.mixedAdd(points[z-1>>1]):acc.mixedAdd(points[-z-1>>1].neg())}return ECPoint.fromECJPoint(acc)},ECPoint.prototype._getNAFPoints1=function(){return{wnd:1,points:[this]}},ECPoint.prototype._getNAFPoints=function(wnd){var points=new Array((1<>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10)}function sigma1(x){return(x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7)}function gamma0(x){return(x>>>7|x<<25)^(x>>>18|x<<14)^x>>>3}function gamma1(x){return(x>>>17|x<<15)^(x>>>19|x<<13)^x>>>10}var inherits=__webpack_require__(1),Hash=__webpack_require__(56),K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],W=new Array(64);inherits(Sha256,Hash),Sha256.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},Sha256.prototype._update=function(M){for(var W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,f=0|this._f,g=0|this._g,h=0|this._h,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<64;++i)W[i]=gamma1(W[i-2])+W[i-7]+gamma0(W[i-15])+W[i-16]|0;for(var j=0;j<64;++j){var T1=h+sigma1(e)+ch(e,f,g)+K[j]+W[j]|0,T2=sigma0(a)+maj(a,b,c)|0;h=g,g=f,f=e,e=d+T1|0,d=c,c=b,b=a,a=T1+T2|0}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0,this._f=f+this._f|0,this._g=g+this._g|0,this._h=h+this._h|0},Sha256.prototype._hash=function(){var H=new Buffer(32);return H.writeInt32BE(this._a,0),H.writeInt32BE(this._b,4),H.writeInt32BE(this._c,8),H.writeInt32BE(this._d,12),H.writeInt32BE(this._e,16),H.writeInt32BE(this._f,20),H.writeInt32BE(this._g,24),H.writeInt32BE(this._h,28),H},module.exports=Sha256}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Sha512(){this.init(),this._w=W,Hash.call(this,128,112)}function Ch(x,y,z){return z^x&(y^z)}function maj(x,y,z){return x&y|z&(x|y)}function sigma0(x,xl){return(x>>>28|xl<<4)^(xl>>>2|x<<30)^(xl>>>7|x<<25)}function sigma1(x,xl){return(x>>>14|xl<<18)^(x>>>18|xl<<14)^(xl>>>9|x<<23)}function Gamma0(x,xl){return(x>>>1|xl<<31)^(x>>>8|xl<<24)^x>>>7}function Gamma0l(x,xl){return(x>>>1|xl<<31)^(x>>>8|xl<<24)^(x>>>7|xl<<25)}function Gamma1(x,xl){return(x>>>19|xl<<13)^(xl>>>29|x<<3)^x>>>6}function Gamma1l(x,xl){return(x>>>19|xl<<13)^(xl>>>29|x<<3)^(x>>>6|xl<<26)}function getCarry(a,b){return a>>>0>>0?1:0}var inherits=__webpack_require__(1),Hash=__webpack_require__(56),K=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],W=new Array(160);inherits(Sha512,Hash),Sha512.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},Sha512.prototype._update=function(M){for(var W=this._w,ah=0|this._ah,bh=0|this._bh,ch=0|this._ch,dh=0|this._dh,eh=0|this._eh,fh=0|this._fh,gh=0|this._gh,hh=0|this._hh,al=0|this._al,bl=0|this._bl,cl=0|this._cl,dl=0|this._dl,el=0|this._el,fl=0|this._fl,gl=0|this._gl,hl=0|this._hl,i=0;i<32;i+=2)W[i]=M.readInt32BE(4*i),W[i+1]=M.readInt32BE(4*i+4);for(;i<160;i+=2){var xh=W[i-30],xl=W[i-30+1],gamma0=Gamma0(xh,xl),gamma0l=Gamma0l(xl,xh);xh=W[i-4],xl=W[i-4+1];var gamma1=Gamma1(xh,xl),gamma1l=Gamma1l(xl,xh),Wi7h=W[i-14],Wi7l=W[i-14+1],Wi16h=W[i-32],Wi16l=W[i-32+1],Wil=gamma0l+Wi7l|0,Wih=gamma0+Wi7h+getCarry(Wil,gamma0l)|0;Wil=Wil+gamma1l|0,Wih=Wih+gamma1+getCarry(Wil,gamma1l)|0,Wil=Wil+Wi16l|0,Wih=Wih+Wi16h+getCarry(Wil,Wi16l)|0,W[i]=Wih,W[i+1]=Wil}for(var j=0;j<160;j+=2){Wih=W[j],Wil=W[j+1];var majh=maj(ah,bh,ch),majl=maj(al,bl,cl),sigma0h=sigma0(ah,al),sigma0l=sigma0(al,ah),sigma1h=sigma1(eh,el),sigma1l=sigma1(el,eh),Kih=K[j],Kil=K[j+1],chh=Ch(eh,fh,gh),chl=Ch(el,fl,gl),t1l=hl+sigma1l|0,t1h=hh+sigma1h+getCarry(t1l,hl)|0;t1l=t1l+chl|0,t1h=t1h+chh+getCarry(t1l,chl)|0,t1l=t1l+Kil|0,t1h=t1h+Kih+getCarry(t1l,Kil)|0,t1l=t1l+Wil|0,t1h=t1h+Wih+getCarry(t1l,Wil)|0;var t2l=sigma0l+majl|0,t2h=sigma0h+majh+getCarry(t2l,sigma0l)|0;hh=gh,hl=gl,gh=fh,gl=fl,fh=eh,fl=el,el=dl+t1l|0,eh=dh+t1h+getCarry(el,dl)|0,dh=ch,dl=cl,ch=bh,cl=bl,bh=ah,bl=al,al=t1l+t2l|0,ah=t1h+t2h+getCarry(al,t1l)|0}this._al=this._al+al|0,this._bl=this._bl+bl|0,this._cl=this._cl+cl|0,this._dl=this._dl+dl|0,this._el=this._el+el|0,this._fl=this._fl+fl|0,this._gl=this._gl+gl|0,this._hl=this._hl+hl|0,this._ah=this._ah+ah+getCarry(this._al,al)|0,this._bh=this._bh+bh+getCarry(this._bl,bl)|0,this._ch=this._ch+ch+getCarry(this._cl,cl)|0,this._dh=this._dh+dh+getCarry(this._dl,dl)|0,this._eh=this._eh+eh+getCarry(this._el,el)|0,this._fh=this._fh+fh+getCarry(this._fl,fl)|0,this._gh=this._gh+gh+getCarry(this._gl,gl)|0,this._hh=this._hh+hh+getCarry(this._hl,hl)|0},Sha512.prototype._hash=function(){function writeInt64BE(h,l,offset){H.writeInt32BE(h,offset),H.writeInt32BE(l,offset+4)}var H=new Buffer(64);return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),writeInt64BE(this._gh,this._gl,48),writeInt64BE(this._hh,this._hl,56),H},module.exports=Sha512}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function Manager(uri,opts){if(!(this instanceof Manager))return new Manager(uri,opts);uri&&"object"==typeof uri&&(opts=uri,uri=void 0),opts=opts||{},opts.path=opts.path||"/socket.io",this.nsps={},this.subs=[],this.opts=opts,this.reconnection(opts.reconnection!==!1),this.reconnectionAttempts(opts.reconnectionAttempts||1/0),this.reconnectionDelay(opts.reconnectionDelay||1e3),this.reconnectionDelayMax(opts.reconnectionDelayMax||5e3),this.randomizationFactor(opts.randomizationFactor||.5),this.backoff=new Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==opts.timeout?2e4:opts.timeout),this.readyState="closed",this.uri=uri,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var _parser=opts.parser||parser;this.encoder=new _parser.Encoder,this.decoder=new _parser.Decoder,this.autoConnect=opts.autoConnect!==!1,this.autoConnect&&this.open()}var eio=__webpack_require__(354),Socket=__webpack_require__(271),Emitter=__webpack_require__(49),parser=__webpack_require__(145),on=__webpack_require__(270),bind=__webpack_require__(173),debug=__webpack_require__(3)("socket.io-client:manager"),indexOf=__webpack_require__(114),Backoff=__webpack_require__(301),has=Object.prototype.hasOwnProperty;module.exports=Manager,Manager.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var nsp in this.nsps)has.call(this.nsps,nsp)&&this.nsps[nsp].emit.apply(this.nsps[nsp],arguments)},Manager.prototype.updateSocketIds=function(){for(var nsp in this.nsps)has.call(this.nsps,nsp)&&(this.nsps[nsp].id=this.generateId(nsp))},Manager.prototype.generateId=function(nsp){return("/"===nsp?"":nsp+"#")+this.engine.id},Emitter(Manager.prototype),Manager.prototype.reconnection=function(v){return arguments.length?(this._reconnection=!!v,this):this._reconnection},Manager.prototype.reconnectionAttempts=function(v){return arguments.length?(this._reconnectionAttempts=v,this):this._reconnectionAttempts},Manager.prototype.reconnectionDelay=function(v){return arguments.length?(this._reconnectionDelay=v,this.backoff&&this.backoff.setMin(v),this):this._reconnectionDelay},Manager.prototype.randomizationFactor=function(v){return arguments.length?(this._randomizationFactor=v,this.backoff&&this.backoff.setJitter(v),this):this._randomizationFactor},Manager.prototype.reconnectionDelayMax=function(v){return arguments.length?(this._reconnectionDelayMax=v,this.backoff&&this.backoff.setMax(v),this):this._reconnectionDelayMax},Manager.prototype.timeout=function(v){return arguments.length?(this._timeout=v,this):this._timeout},Manager.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},Manager.prototype.open=Manager.prototype.connect=function(fn,opts){if(debug("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;debug("opening %s",this.uri),this.engine=eio(this.uri,this.opts);var socket=this.engine,self=this;this.readyState="opening",this.skipReconnect=!1;var openSub=on(socket,"open",function(){self.onopen(),fn&&fn()}),errorSub=on(socket,"error",function(data){if(debug("connect_error"),self.cleanup(),self.readyState="closed",self.emitAll("connect_error",data),fn){var err=new Error("Connection error");err.data=data,fn(err)}else self.maybeReconnectOnOpen()});if(!1!==this._timeout){var timeout=this._timeout;debug("connect attempt will timeout after %d",timeout);var timer=setTimeout(function(){debug("connect attempt timed out after %d",timeout),openSub.destroy(),socket.close(),socket.emit("error","timeout"),self.emitAll("connect_timeout",timeout)},timeout);this.subs.push({destroy:function(){clearTimeout(timer)}})}return this.subs.push(openSub),this.subs.push(errorSub),this},Manager.prototype.onopen=function(){debug("open"),this.cleanup(),this.readyState="open",this.emit("open");var socket=this.engine;this.subs.push(on(socket,"data",bind(this,"ondata"))),this.subs.push(on(socket,"ping",bind(this,"onping"))),this.subs.push(on(socket,"pong",bind(this,"onpong"))),this.subs.push(on(socket,"error",bind(this,"onerror"))),this.subs.push(on(socket,"close",bind(this,"onclose"))),this.subs.push(on(this.decoder,"decoded",bind(this,"ondecoded")))},Manager.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},Manager.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},Manager.prototype.ondata=function(data){this.decoder.add(data)},Manager.prototype.ondecoded=function(packet){this.emit("packet",packet)},Manager.prototype.onerror=function(err){debug("error",err),this.emitAll("error",err)},Manager.prototype.socket=function(nsp,opts){function onConnecting(){~indexOf(self.connecting,socket)||self.connecting.push(socket)}var socket=this.nsps[nsp];if(!socket){socket=new Socket(this,nsp,opts),this.nsps[nsp]=socket;var self=this;socket.on("connecting",onConnecting),socket.on("connect",function(){socket.id=self.generateId(nsp)}),this.autoConnect&&onConnecting()}return socket},Manager.prototype.destroy=function(socket){var index=indexOf(this.connecting,socket);~index&&this.connecting.splice(index,1),this.connecting.length||this.close()},Manager.prototype.packet=function(packet){debug("writing packet %j",packet);var self=this;packet.query&&0===packet.type&&(packet.nsp+="?"+packet.query),self.encoding?self.packetBuffer.push(packet):(self.encoding=!0,this.encoder.encode(packet,function(encodedPackets){for(var i=0;i0&&!this.encoding){var pack=this.packetBuffer.shift();this.packet(pack)}},Manager.prototype.cleanup=function(){debug("cleanup");for(var subsLength=this.subs.length,i=0;i=this._reconnectionAttempts)debug("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var delay=this.backoff.duration();debug("will wait %dms before reconnect attempt",delay),this.reconnecting=!0;var timer=setTimeout(function(){self.skipReconnect||(debug("attempting reconnect"),self.emitAll("reconnect_attempt",self.backoff.attempts),self.emitAll("reconnecting",self.backoff.attempts),self.skipReconnect||self.open(function(err){err?(debug("reconnect attempt error"),self.reconnecting=!1,self.reconnect(),self.emitAll("reconnect_error",err.data)):(debug("reconnect success"),self.onreconnect())}))},delay);this.subs.push({destroy:function(){clearTimeout(timer)}})}},Manager.prototype.onreconnect=function(){var attempt=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",attempt)}},function(module,exports){function on(obj,ev,fn){return obj.on(ev,fn),{destroy:function(){obj.removeListener(ev,fn)}}}module.exports=on},function(module,exports,__webpack_require__){function Socket(io,nsp,opts){this.io=io,this.nsp=nsp,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,opts&&opts.query&&(this.query=opts.query),this.io.autoConnect&&this.open()}var parser=__webpack_require__(145),Emitter=__webpack_require__(49),toArray=__webpack_require__(668),on=__webpack_require__(270),bind=__webpack_require__(173),debug=__webpack_require__(3)("socket.io-client:socket"),parseqs=__webpack_require__(93);module.exports=Socket;var events={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},emit=Emitter.prototype.emit;Emitter(Socket.prototype),Socket.prototype.subEvents=function(){if(!this.subs){var io=this.io;this.subs=[on(io,"open",bind(this,"onopen")),on(io,"packet",bind(this,"onpacket")),on(io,"close",bind(this,"onclose"))]}},Socket.prototype.open=Socket.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting"),this)},Socket.prototype.send=function(){var args=toArray(arguments);return args.unshift("message"),this.emit.apply(this,args),this},Socket.prototype.emit=function(ev){if(events.hasOwnProperty(ev))return emit.apply(this,arguments),this;var args=toArray(arguments),packet={type:parser.EVENT,data:args};return packet.options={},packet.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof args[args.length-1]&&(debug("emitting packet with ack id %d",this.ids),this.acks[this.ids]=args.pop(),packet.id=this.ids++),this.connected?this.packet(packet):this.sendBuffer.push(packet),delete this.flags,this},Socket.prototype.packet=function(packet){packet.nsp=this.nsp,this.io.packet(packet)},Socket.prototype.onopen=function(){if(debug("transport is open - connecting"),"/"!==this.nsp)if(this.query){var query="object"==typeof this.query?parseqs.encode(this.query):this.query;debug("sending connect packet with query %s",query),this.packet({type:parser.CONNECT,query:query})}else this.packet({type:parser.CONNECT})},Socket.prototype.onclose=function(reason){debug("close (%s)",reason),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",reason)},Socket.prototype.onpacket=function(packet){if(packet.nsp===this.nsp)switch(packet.type){case parser.CONNECT:this.onconnect();break;case parser.EVENT:this.onevent(packet);break;case parser.BINARY_EVENT:this.onevent(packet);break;case parser.ACK:this.onack(packet);break;case parser.BINARY_ACK:this.onack(packet);break;case parser.DISCONNECT:this.ondisconnect();break;case parser.ERROR:this.emit("error",packet.data)}},Socket.prototype.onevent=function(packet){var args=packet.data||[];debug("emitting event %j",args),null!=packet.id&&(debug("attaching ack callback to event"),args.push(this.ack(packet.id))),this.connected?emit.apply(this,args):this.receiveBuffer.push(args)},Socket.prototype.ack=function(id){var self=this,sent=!1;return function(){if(!sent){sent=!0;var args=toArray(arguments);debug("sending ack %j",args),self.packet({type:parser.ACK,id:id,data:args})}}},Socket.prototype.onack=function(packet){var ack=this.acks[packet.id];"function"==typeof ack?(debug("calling ack %s with %j",packet.id,packet.data),ack.apply(this,packet.data),delete this.acks[packet.id]):debug("bad ack %s",packet.id)},Socket.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},Socket.prototype.emitBuffered=function(){var i;for(i=0;i0);return encoded}function decode(str){var decoded=0;for(i=0;ibytes&&(end=bytes),start>=bytes||start>=end||0===bytes)return new ArrayBuffer(0);for(var abv=new Uint8Array(arraybuffer),result=new Uint8Array(end-start),i=start,ii=0;i=0&&workersList.splice(index,1),task.callback.apply(task,arguments),null!=err&&q.error(err,task.data)}numRunning<=q.concurrency-q.buffer&&q.unsaturated(),q.idle()&&q.drain(),q.process()}}if(null==concurrency)concurrency=1;else if(0===concurrency)throw new Error("Concurrency must not be zero");var _worker=(0,_wrapAsync2.default)(worker),numRunning=0,workersList=[],isProcessing=!1,q={_tasks:new _DoublyLinkedList2.default,concurrency:concurrency,payload:payload,saturated:_noop2.default,unsaturated:_noop2.default,buffer:concurrency/4,empty:_noop2.default,drain:_noop2.default,error:_noop2.default,started:!1,paused:!1,push:function(data,callback){_insert(data,!1,callback)},kill:function(){q.drain=_noop2.default,q._tasks.empty()},unshift:function(data,callback){_insert(data,!0,callback)},remove:function(testFn){q._tasks.remove(testFn)},process:function(){if(!isProcessing){for(isProcessing=!0;!q.paused&&numRunning0&&opts.jitter<=1?opts.jitter:0, -this.attempts=0}module.exports=Backoff,Backoff.prototype.duration=function(){var ms=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var rand=Math.random(),deviation=Math.floor(rand*this.jitter*ms);ms=0==(1&Math.floor(10*rand))?ms-deviation:ms+deviation}return 0|Math.min(ms,this.max)},Backoff.prototype.reset=function(){this.attempts=0},Backoff.prototype.setMin=function(min){this.ms=min},Backoff.prototype.setMax=function(max){this.max=max},Backoff.prototype.setJitter=function(jitter){this.jitter=jitter}},function(module,exports,__webpack_require__){(function(Buffer){module.exports=function(ALPHABET){function encode(source){if(0===source.length)return"";for(var digits=[0],i=0;i0;)digits.push(carry%BASE),carry=carry/BASE|0}for(var string="",k=0;0===source[k]&&k=0;--q)string+=ALPHABET[digits[q]];return string}function decodeUnsafe(string){if(0===string.length)return Buffer.allocUnsafe(0);for(var bytes=[0],i=0;i>=8;for(;carry>0;)bytes.push(255&carry),carry>>=8}for(var k=0;string[k]===LEADER&&k>2],base64+=chars[(3&bytes[i])<<4|bytes[i+1]>>4],base64+=chars[(15&bytes[i+1])<<2|bytes[i+2]>>6],base64+=chars[63&bytes[i+2]];return len%3==2?base64=base64.substring(0,base64.length-1)+"=":len%3==1&&(base64=base64.substring(0,base64.length-2)+"=="),base64},exports.decode=function(base64){var i,encoded1,encoded2,encoded3,encoded4,bufferLength=.75*base64.length,len=base64.length,p=0;"="===base64[base64.length-1]&&(bufferLength--,"="===base64[base64.length-2]&&bufferLength--);var arraybuffer=new ArrayBuffer(bufferLength),bytes=new Uint8Array(arraybuffer);for(i=0;i>4,bytes[p++]=(15&encoded2)<<4|encoded3>>2,bytes[p++]=(3&encoded3)<<6|63&encoded4;return arraybuffer}}()},function(module,exports,__webpack_require__){"use strict";function placeHoldersCount(b64){var len=b64.length;if(len%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===b64[len-2]?2:"="===b64[len-1]?1:0}function byteLength(b64){return 3*b64.length/4-placeHoldersCount(b64)}function toByteArray(b64){var i,l,tmp,placeHolders,arr,len=b64.length;placeHolders=placeHoldersCount(b64),arr=new Arr(3*len/4-placeHolders),l=placeHolders>0?len-4:len;var L=0;for(i=0;i>16&255,arr[L++]=tmp>>8&255,arr[L++]=255&tmp;return 2===placeHolders?(tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4,arr[L++]=255&tmp):1===placeHolders&&(tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2,arr[L++]=tmp>>8&255,arr[L++]=255&tmp),arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[63&num]}function encodeChunk(uint8,start,end){for(var tmp,output=[],i=start;ilen2?len2:i+16383));return 1===extraBytes?(tmp=uint8[len-1],output+=lookup[tmp>>2],output+=lookup[tmp<<4&63],output+="=="):2===extraBytes&&(tmp=(uint8[len-2]<<8)+uint8[len-1],output+=lookup[tmp>>10],output+=lookup[tmp>>4&63],output+=lookup[tmp<<2&63],output+="="),parts.push(output),parts.join("")}exports.byteLength=byteLength,exports.toByteArray=toByteArray,exports.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i72)return!1;if(48!==buffer[0])return!1;if(buffer[1]!==buffer.length-2)return!1;if(2!==buffer[2])return!1;var lenR=buffer[3];if(0===lenR)return!1;if(5+lenR>=buffer.length)return!1;if(2!==buffer[4+lenR])return!1;var lenS=buffer[5+lenR];return 0!==lenS&&(6+lenR+lenS===buffer.length&&(!(128&buffer[4])&&(!(lenR>1&&0===buffer[4]&&!(128&buffer[5]))&&(!(128&buffer[lenR+6])&&!(lenS>1&&0===buffer[lenR+6]&&!(128&buffer[lenR+7]))))))}function decode(buffer){if(buffer.length<8)throw new Error("DER sequence length is too short");if(buffer.length>72)throw new Error("DER sequence length is too long");if(48!==buffer[0])throw new Error("Expected DER sequence");if(buffer[1]!==buffer.length-2)throw new Error("DER sequence length is invalid");if(2!==buffer[2])throw new Error("Expected DER integer");var lenR=buffer[3];if(0===lenR)throw new Error("R length is zero");if(5+lenR>=buffer.length)throw new Error("R length is too long");if(2!==buffer[4+lenR])throw new Error("Expected DER integer (2)");var lenS=buffer[5+lenR];if(0===lenS)throw new Error("S length is zero");if(6+lenR+lenS!==buffer.length)throw new Error("S length is invalid");if(128&buffer[4])throw new Error("R value is negative");if(lenR>1&&0===buffer[4]&&!(128&buffer[5]))throw new Error("R value excessively padded");if(128&buffer[lenR+6])throw new Error("S value is negative");if(lenS>1&&0===buffer[lenR+6]&&!(128&buffer[lenR+7]))throw new Error("S value excessively padded");return{r:buffer.slice(4,4+lenR),s:buffer.slice(6+lenR)}}function encode(r,s){var lenR=r.length,lenS=s.length;if(0===lenR)throw new Error("R length is zero");if(0===lenS)throw new Error("S length is zero");if(lenR>33)throw new Error("R length is too long");if(lenS>33)throw new Error("S length is too long");if(128&r[0])throw new Error("R value is negative");if(128&s[0])throw new Error("S value is negative");if(lenR>1&&0===r[0]&&!(128&r[1]))throw new Error("R value excessively padded");if(lenS>1&&0===s[0]&&!(128&s[1]))throw new Error("S value excessively padded");var signature=Buffer.allocUnsafe(6+lenR+lenS);return signature[0]=48,signature[1]=signature.length-2,signature[2]=2,signature[3]=r.length,r.copy(signature,4),signature[4+lenR]=2,signature[5+lenR]=s.length,s.copy(signature,6+lenR),signature}var Buffer=__webpack_require__(6).Buffer;module.exports={check:check,decode:decode,encode:encode}},function(module,exports,__webpack_require__){function ADD64AA(v,a,b){var o0=v[a]+v[b],o1=v[a+1]+v[b+1];o0>=4294967296&&o1++,v[a]=o0,v[a+1]=o1}function ADD64AC(v,a,b0,b1){var o0=v[a]+b0;b0<0&&(o0+=4294967296);var o1=v[a+1]+b1;o0>=4294967296&&o1++,v[a]=o0,v[a+1]=o1}function B2B_GET32(arr,i){return arr[i]^arr[i+1]<<8^arr[i+2]<<16^arr[i+3]<<24}function B2B_G(a,b,c,d,ix,iy){var x0=m[ix],x1=m[ix+1],y0=m[iy],y1=m[iy+1];ADD64AA(v,a,b),ADD64AC(v,a,x0,x1);var xor0=v[d]^v[a],xor1=v[d+1]^v[a+1];v[d]=xor1,v[d+1]=xor0,ADD64AA(v,c,d),xor0=v[b]^v[c],xor1=v[b+1]^v[c+1],v[b]=xor0>>>24^xor1<<8,v[b+1]=xor1>>>24^xor0<<8,ADD64AA(v,a,b),ADD64AC(v,a,y0,y1),xor0=v[d]^v[a],xor1=v[d+1]^v[a+1],v[d]=xor0>>>16^xor1<<16,v[d+1]=xor1>>>16^xor0<<16,ADD64AA(v,c,d),xor0=v[b]^v[c],xor1=v[b+1]^v[c+1],v[b]=xor1>>>31^xor0<<1,v[b+1]=xor0>>>31^xor1<<1}function blake2bCompress(ctx,last){var i=0;for(i=0;i<16;i++)v[i]=ctx.h[i],v[i+16]=BLAKE2B_IV32[i];for(v[24]=v[24]^ctx.t,v[25]=v[25]^ctx.t/4294967296,last&&(v[28]=~v[28],v[29]=~v[29]),i=0;i<32;i++)m[i]=B2B_GET32(ctx.b,4*i);for(i=0;i<12;i++)B2B_G(0,8,16,24,SIGMA82[16*i+0],SIGMA82[16*i+1]),B2B_G(2,10,18,26,SIGMA82[16*i+2],SIGMA82[16*i+3]),B2B_G(4,12,20,28,SIGMA82[16*i+4],SIGMA82[16*i+5]),B2B_G(6,14,22,30,SIGMA82[16*i+6],SIGMA82[16*i+7]),B2B_G(0,10,20,30,SIGMA82[16*i+8],SIGMA82[16*i+9]),B2B_G(2,12,22,24,SIGMA82[16*i+10],SIGMA82[16*i+11]),B2B_G(4,14,16,26,SIGMA82[16*i+12],SIGMA82[16*i+13]),B2B_G(6,8,18,28,SIGMA82[16*i+14],SIGMA82[16*i+15]);for(i=0;i<16;i++)ctx.h[i]=ctx.h[i]^v[i]^v[i+16]}function blake2bInit(outlen,key){if(0===outlen||outlen>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(key&&key.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");for(var ctx={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:outlen},i=0;i<16;i++)ctx.h[i]=BLAKE2B_IV32[i];var keylen=key?key.length:0;return ctx.h[0]^=16842752^keylen<<8^outlen,key&&(blake2bUpdate(ctx,key),ctx.c=128),ctx}function blake2bUpdate(ctx,input){for(var i=0;i>2]>>8*(3&i);return out}function blake2b(input,key,outlen){outlen=outlen||64,input=util.normalizeInput(input);var ctx=blake2bInit(outlen,key);return blake2bUpdate(ctx,input),blake2bFinal(ctx)}function blake2bHex(input,key,outlen){var output=blake2b(input,key,outlen);return util.toHex(output)}var util=__webpack_require__(161),BLAKE2B_IV32=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),SIGMA8=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],SIGMA82=new Uint8Array(SIGMA8.map(function(x){return 2*x})),v=new Uint32Array(32),m=new Uint32Array(32);module.exports={blake2b:blake2b,blake2bHex:blake2bHex,blake2bInit:blake2bInit,blake2bUpdate:blake2bUpdate,blake2bFinal:blake2bFinal}},function(module,exports,__webpack_require__){function B2S_GET32(v,i){return v[i]^v[i+1]<<8^v[i+2]<<16^v[i+3]<<24}function B2S_G(a,b,c,d,x,y){v[a]=v[a]+v[b]+x,v[d]=ROTR32(v[d]^v[a],16),v[c]=v[c]+v[d],v[b]=ROTR32(v[b]^v[c],12),v[a]=v[a]+v[b]+y,v[d]=ROTR32(v[d]^v[a],8),v[c]=v[c]+v[d],v[b]=ROTR32(v[b]^v[c],7)}function ROTR32(x,y){return x>>>y^x<<32-y}function blake2sCompress(ctx,last){var i=0;for(i=0;i<8;i++)v[i]=ctx.h[i],v[i+8]=BLAKE2S_IV[i];for(v[12]^=ctx.t,v[13]^=ctx.t/4294967296,last&&(v[14]=~v[14]),i=0;i<16;i++)m[i]=B2S_GET32(ctx.b,4*i);for(i=0;i<10;i++)B2S_G(0,4,8,12,m[SIGMA[16*i+0]],m[SIGMA[16*i+1]]),B2S_G(1,5,9,13,m[SIGMA[16*i+2]],m[SIGMA[16*i+3]]),B2S_G(2,6,10,14,m[SIGMA[16*i+4]],m[SIGMA[16*i+5]]),B2S_G(3,7,11,15,m[SIGMA[16*i+6]],m[SIGMA[16*i+7]]),B2S_G(0,5,10,15,m[SIGMA[16*i+8]],m[SIGMA[16*i+9]]),B2S_G(1,6,11,12,m[SIGMA[16*i+10]],m[SIGMA[16*i+11]]),B2S_G(2,7,8,13,m[SIGMA[16*i+12]],m[SIGMA[16*i+13]]),B2S_G(3,4,9,14,m[SIGMA[16*i+14]],m[SIGMA[16*i+15]]);for(i=0;i<8;i++)ctx.h[i]^=v[i]^v[i+8]}function blake2sInit(outlen,key){if(!(outlen>0&&outlen<=32))throw new Error("Incorrect output length, should be in [1, 32]");var keylen=key?key.length:0;if(key&&!(keylen>0&&keylen<=32))throw new Error("Incorrect key length, should be in [1, 32]");var ctx={h:new Uint32Array(BLAKE2S_IV),b:new Uint32Array(64),c:0,t:0,outlen:outlen};return ctx.h[0]^=16842752^keylen<<8^outlen,keylen>0&&(blake2sUpdate(ctx,key),ctx.c=64),ctx}function blake2sUpdate(ctx,input){for(var i=0;i>2]>>8*(3&i)&255;return out}function blake2s(input,key,outlen){outlen=outlen||32,input=util.normalizeInput(input);var ctx=blake2sInit(outlen,key);return blake2sUpdate(ctx,input),blake2sFinal(ctx)}function blake2sHex(input,key,outlen){var output=blake2s(input,key,outlen);return util.toHex(output)}var util=__webpack_require__(161),BLAKE2S_IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SIGMA=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),v=new Uint32Array(16),m=new Uint32Array(16);module.exports={blake2s:blake2s,blake2sHex:blake2sHex,blake2sInit:blake2sInit,blake2sUpdate:blake2sUpdate,blake2sFinal:blake2sFinal}},function(module,exports,__webpack_require__){var b2b=__webpack_require__(307),b2s=__webpack_require__(308);module.exports={blake2b:b2b.blake2b,blake2bHex:b2b.blake2bHex,blake2bInit:b2b.blake2bInit,blake2bUpdate:b2b.blake2bUpdate,blake2bFinal:b2b.blake2bFinal,blake2s:b2s.blake2s,blake2sHex:b2s.blake2sHex,blake2sInit:b2s.blake2sInit,blake2sUpdate:b2s.blake2sUpdate,blake2sFinal:b2s.blake2sFinal}},function(module,exports,__webpack_require__){(function(global){function mapArrayBufferViews(ary){for(var i=0;i0){break}}return code|0}function checkOffset(n){n=n|0;if(((offset|0)+(n|0)|0)<(inputLength|0)){return 0}return 1}function readUInt16(n){n=n|0;return heap[n|0]<<8|heap[n+1|0]|0}function INT_P(octet){octet=octet|0;pushInt(octet|0);offset=offset+1|0;return 0}function UINT_P_8(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushInt(heap[offset+1|0]|0);offset=offset+2|0;return 0}function UINT_P_16(octet){octet=octet|0;if(checkOffset(2)|0){return 1}pushInt(readUInt16(offset+1|0)|0);offset=offset+3|0;return 0}function UINT_P_32(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushInt32(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function UINT_P_64(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushInt64(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function INT_N(octet){octet=octet|0;pushInt(-1-(octet-32|0)|0);offset=offset+1|0;return 0}function UINT_N_8(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushInt(-1-(heap[offset+1|0]|0)|0);offset=offset+2|0;return 0}function UINT_N_16(octet){octet=octet|0;var val=0;if(checkOffset(2)|0){return 1}val=readUInt16(offset+1|0)|0;pushInt(-1-(val|0)|0);offset=offset+3|0;return 0}function UINT_N_32(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushInt32Neg(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function UINT_N_64(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushInt64Neg(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function BYTE_STRING(octet){octet=octet|0;var start=0;var end=0;var step=0;step=octet-64|0;if(checkOffset(step|0)|0){return 1}start=offset+1|0;end=(offset+1|0)+(step|0)|0;pushByteString(start|0,end|0);offset=end|0;return 0}function BYTE_STRING_8(octet){octet=octet|0;var start=0;var end=0;var length=0;if(checkOffset(1)|0){return 1}length=heap[offset+1|0]|0;start=offset+2|0;end=(offset+2|0)+(length|0)|0;if(checkOffset(length+1|0)|0){return 1}pushByteString(start|0,end|0);offset=end|0;return 0}function BYTE_STRING_16(octet){octet=octet|0;var start=0;var end=0;var length=0;if(checkOffset(2)|0){return 1}length=readUInt16(offset+1|0)|0;start=offset+3|0;end=(offset+3|0)+(length|0)|0;if(checkOffset(length+2|0)|0){return 1}pushByteString(start|0,end|0);offset=end|0;return 0}function BYTE_STRING_32(octet){octet=octet|0;return 1}function BYTE_STRING_64(octet){octet=octet|0;return 1}function BYTE_STRING_BREAK(octet){octet=octet|0;pushByteStringStart();offset=offset+1|0;return 0}function UTF8_STRING(octet){octet=octet|0;var start=0;var end=0;var step=0;step=octet-96|0;if(checkOffset(step|0)|0){return 1}start=offset+1|0;end=(offset+1|0)+(step|0)|0;pushUtf8String(start|0,end|0);offset=end|0;return 0}function UTF8_STRING_8(octet){octet=octet|0;var start=0;var end=0;var length=0;if(checkOffset(1)|0){return 1}length=heap[offset+1|0]|0;start=offset+2|0;end=(offset+2|0)+(length|0)|0;if(checkOffset(length+1|0)|0){return 1}pushUtf8String(start|0,end|0);offset=end|0;return 0}function UTF8_STRING_16(octet){octet=octet|0;var start=0;var end=0;var length=0;if(checkOffset(2)|0){return 1}length=readUInt16(offset+1|0)|0;start=offset+3|0;end=(offset+3|0)+(length|0)|0;if(checkOffset(length+2|0)|0){return 1}pushUtf8String(start|0,end|0);offset=end|0;return 0}function UTF8_STRING_32(octet){octet=octet|0;return 1}function UTF8_STRING_64(octet){octet=octet|0;return 1}function UTF8_STRING_BREAK(octet){octet=octet|0;pushUtf8StringStart();offset=offset+1|0;return 0}function ARRAY(octet){octet=octet|0;pushArrayStartFixed(octet-128|0);offset=offset+1|0;return 0}function ARRAY_8(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushArrayStartFixed(heap[offset+1|0]|0);offset=offset+2|0;return 0}function ARRAY_16(octet){octet=octet|0;if(checkOffset(2)|0){return 1}pushArrayStartFixed(readUInt16(offset+1|0)|0);offset=offset+3|0;return 1}function ARRAY_32(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushArrayStartFixed32(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function ARRAY_64(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushArrayStartFixed64(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function ARRAY_BREAK(octet){octet=octet|0;pushArrayStart();offset=offset+1|0;return 0}function MAP(octet){octet=octet|0;var step=0;step=octet-160|0;if(checkOffset(step|0)|0){return 1}pushObjectStartFixed(step|0);offset=offset+1|0;return 0}function MAP_8(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushObjectStartFixed(heap[offset+1|0]|0);offset=offset+2|0;return 0}function MAP_16(octet){octet=octet|0;if(checkOffset(2)|0){return 1}pushObjectStartFixed(readUInt16(offset+1|0)|0);offset=offset+3|0;return 0}function MAP_32(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushObjectStartFixed32(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function MAP_64(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushObjectStartFixed64(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function MAP_BREAK(octet){octet=octet|0;pushObjectStart();offset=offset+1|0;return 0}function TAG_KNOWN(octet){octet=octet|0;pushTagStart(octet-192|0|0);offset=offset+1|0;return 0}function TAG_BIGNUM_POS(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_BIGNUM_NEG(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_FRAC(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_BIGNUM_FLOAT(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_UNASSIGNED(octet){octet=octet|0;pushTagStart(octet-192|0|0);offset=offset+1|0;return 0}function TAG_BASE64_URL(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_BASE64(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_BASE16(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_MORE_1(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushTagStart(heap[offset+1|0]|0);offset=offset+2|0;return 0}function TAG_MORE_2(octet){octet=octet|0;if(checkOffset(2)|0){return 1}pushTagStart(readUInt16(offset+1|0)|0);offset=offset+3|0;return 0}function TAG_MORE_4(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushTagStart4(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function TAG_MORE_8(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushTagStart8(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function SIMPLE_UNASSIGNED(octet){octet=octet|0;pushSimpleUnassigned((octet|0)-224|0);offset=offset+1|0;return 0}function SIMPLE_FALSE(octet){octet=octet|0;pushFalse();offset=offset+1|0;return 0}function SIMPLE_TRUE(octet){octet=octet|0;pushTrue();offset=offset+1|0;return 0}function SIMPLE_NULL(octet){octet=octet|0;pushNull();offset=offset+1|0;return 0}function SIMPLE_UNDEFINED(octet){octet=octet|0;pushUndefined();offset=offset+1|0;return 0}function SIMPLE_BYTE(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushSimpleUnassigned(heap[offset+1|0]|0);offset=offset+2|0;return 0}function SIMPLE_FLOAT_HALF(octet){octet=octet|0;var f=0;var g=0;var sign=1;var exp=0;var mant=0;var r=0;if(checkOffset(2)|0){return 1}f=heap[offset+1|0]|0;g=heap[offset+2|0]|0;if((f|0)&128){sign=-1}exp=+(((f|0)&124)>>2);mant=+(((f|0)&3)<<8|g);if(+exp==0){pushFloat(+(+sign*+5.960464477539063e-8*+mant))}else if(+exp==31){if(+sign==1){if(+mant>0){pushNaN()}else{pushInfinity()}}else{if(+mant>0){pushNaNNeg()}else{pushInfinityNeg()}}}else{pushFloat(+(+sign*pow(+2,+(+exp-25))*+(1024+mant)))}offset=offset+3|0;return 0}function SIMPLE_FLOAT_SINGLE(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushFloatSingle(heap[offset+1|0]|0,heap[offset+2|0]|0,heap[offset+3|0]|0,heap[offset+4|0]|0);offset=offset+5|0;return 0}function SIMPLE_FLOAT_DOUBLE(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushFloatDouble(heap[offset+1|0]|0,heap[offset+2|0]|0,heap[offset+3|0]|0,heap[offset+4|0]|0,heap[offset+5|0]|0,heap[offset+6|0]|0,heap[offset+7|0]|0,heap[offset+8|0]|0);offset=offset+9|0;return 0}function ERROR(octet){octet=octet|0;return 1}function BREAK(octet){octet=octet|0;pushBreak();offset=offset+1|0;return 0}var jumpTable=[INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,UINT_P_8,UINT_P_16,UINT_P_32,UINT_P_64,ERROR,ERROR,ERROR,ERROR,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,UINT_N_8,UINT_N_16,UINT_N_32,UINT_N_64,ERROR,ERROR,ERROR,ERROR,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING_8,BYTE_STRING_16,BYTE_STRING_32,BYTE_STRING_64,ERROR,ERROR,ERROR,BYTE_STRING_BREAK,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING_8,UTF8_STRING_16,UTF8_STRING_32,UTF8_STRING_64,ERROR,ERROR,ERROR,UTF8_STRING_BREAK,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY_8,ARRAY_16,ARRAY_32,ARRAY_64,ERROR,ERROR,ERROR,ARRAY_BREAK,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP_8,MAP_16,MAP_32,MAP_64,ERROR,ERROR,ERROR,MAP_BREAK,TAG_KNOWN,TAG_KNOWN,TAG_KNOWN,TAG_KNOWN,TAG_KNOWN,TAG_KNOWN,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_MORE_1,TAG_MORE_2,TAG_MORE_4,TAG_MORE_8,ERROR,ERROR,ERROR,ERROR,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_FALSE,SIMPLE_TRUE,SIMPLE_NULL,SIMPLE_UNDEFINED,SIMPLE_BYTE,SIMPLE_FLOAT_HALF,SIMPLE_FLOAT_SINGLE,SIMPLE_FLOAT_DOUBLE,ERROR,ERROR,ERROR,BREAK];return{parse:parse}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function collectObject(val){return(acc,key)=>{return acc?`${acc}, ${key}: ${val[key]}`:`${key}: ${val[key]}`}}const Decoder=__webpack_require__(162),utils=__webpack_require__(107);class Diagnose extends Decoder{createTag(tagNumber,value){return`${tagNumber}(${value})`}createInt(val){return super.createInt(val).toString()}createInt32(f,g){return super.createInt32(f,g).toString()}createInt64(f1,f2,g1,g2){return super.createInt64(f1,f2,g1,g2).toString()}createInt32Neg(f,g){return super.createInt32Neg(f,g).toString()} -createInt64Neg(f1,f2,g1,g2){return super.createInt64Neg(f1,f2,g1,g2).toString()}createTrue(){return"true"}createFalse(){return"false"}createFloat(val){const fl=super.createFloat(val);return utils.isNegativeZero(val)?"-0_1":`${fl}_1`}createFloatSingle(a,b,c,d){return`${super.createFloatSingle(a,b,c,d)}_2`}createFloatDouble(a,b,c,d,e,f,g,h){return`${super.createFloatDouble(a,b,c,d,e,f,g,h)}_3`}createByteString(raw,len){const val=raw.join(", ");return len===-1?`(_ ${val})`:`h'${val}`}createByteStringFromHeap(start,end){return`h'${new Buffer(super.createByteStringFromHeap(start,end)).toString("hex")}'`}createInfinity(){return"Infinity_1"}createInfinityNeg(){return"-Infinity_1"}createNaN(){return"NaN_1"}createNaNNeg(){return"-NaN_1"}createNull(){return"null"}createUndefined(){return"undefined"}createSimpleUnassigned(val){return`simple(${val})`}createArray(arr,len){const val=super.createArray(arr,len);return len===-1?`[_ ${val.join(", ")}]`:`[${val.join(", ")}]`}createMap(map,len){const val=super.createMap(map),list=Array.from(val.keys()).reduce(collectObject(val),"");return len===-1?`{_ ${list}}`:`{${list}}`}createObject(obj,len){const val=super.createObject(obj),map=Object.keys(val).reduce(collectObject(val),"");return len===-1?`{_ ${map}}`:`{${map}}`}createUtf8String(raw,len){const val=raw.join(", ");return len===-1?`(_ ${val})`:`"${val}"`}createUtf8StringFromHeap(start,end){return`"${new Buffer(super.createUtf8StringFromHeap(start,end)).toString("utf8")}"`}static diagnose(input,enc){return"string"==typeof input&&(input=new Buffer(input,enc||"hex")),(new Diagnose).decodeFirst(input)}}module.exports=Diagnose}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function toType(obj){return{}.toString.call(obj).slice(8,-1)}const url=__webpack_require__(147),Bignumber=__webpack_require__(75),utils=__webpack_require__(107),constants=__webpack_require__(76),MT=constants.MT,NUMBYTES=constants.NUMBYTES,SHIFT32=constants.SHIFT32,SYMS=constants.SYMS,TAG=constants.TAG,HALF=constants.MT.SIMPLE_FLOAT<<5|constants.NUMBYTES.TWO,FLOAT=constants.MT.SIMPLE_FLOAT<<5|constants.NUMBYTES.FOUR,DOUBLE=constants.MT.SIMPLE_FLOAT<<5|constants.NUMBYTES.EIGHT,TRUE=constants.MT.SIMPLE_FLOAT<<5|constants.SIMPLE.TRUE,FALSE=constants.MT.SIMPLE_FLOAT<<5|constants.SIMPLE.FALSE,UNDEFINED=constants.MT.SIMPLE_FLOAT<<5|constants.SIMPLE.UNDEFINED,NULL=constants.MT.SIMPLE_FLOAT<<5|constants.SIMPLE.NULL,MAXINT_BN=new Bignumber("0x20000000000000"),BUF_NAN=new Buffer("f97e00","hex"),BUF_INF_NEG=new Buffer("f9fc00","hex"),BUF_INF_POS=new Buffer("f97c00","hex");class Encoder{constructor(options){options=options||{},this.streaming="function"==typeof options.stream,this.onData=options.stream,this.semanticTypes=[[url.Url,this._pushUrl],[Bignumber,this._pushBigNumber]];const addTypes=options.genTypes||[],len=addTypes.length;for(let i=0;i[k,obj[k]]))}_pushRawMap(len,map){map=map.map(function(a){return a[0]=Encoder.encode(a[0]),a}).sort(utils.keySorter);for(var j=0;j16)return out=this.cache.slice(0,16),this.cache=this.cache.slice(16),out}else if(this.cache.length>=16)return out=this.cache.slice(0,16),this.cache=this.cache.slice(16),out;return null},Splitter.prototype.flush=function(){if(this.cache.length)return this.cache};var modelist={ECB:__webpack_require__(170),CBC:__webpack_require__(166),CFB:__webpack_require__(167),CFB8:__webpack_require__(169),CFB1:__webpack_require__(168),OFB:__webpack_require__(171),CTR:__webpack_require__(78),GCM:__webpack_require__(78)};exports.createDecipher=createDecipher,exports.createDecipheriv=createDecipheriv}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Cipher(mode,key,iv){if(!(this instanceof Cipher))return new Cipher(mode,key,iv);Transform.call(this),this._cache=new Splitter,this._cipher=new aes.AES(key),this._prev=new Buffer(iv.length),iv.copy(this._prev),this._mode=mode,this._autopadding=!0}function Splitter(){if(!(this instanceof Splitter))return new Splitter;this.cache=new Buffer("")}function createCipheriv(suite,password,iv){var config=modes[suite.toLowerCase()];if(!config)throw new TypeError("invalid suite type");if("string"==typeof iv&&(iv=new Buffer(iv)),"string"==typeof password&&(password=new Buffer(password)),password.length!==config.key/8)throw new TypeError("invalid key length "+password.length);if(iv.length!==config.iv)throw new TypeError("invalid iv length "+iv.length);return"stream"===config.type?new StreamCipher(modelist[config.mode],password,iv):"auth"===config.type?new AuthCipher(modelist[config.mode],password,iv):new Cipher(modelist[config.mode],password,iv)}function createCipher(suite,password){var config=modes[suite.toLowerCase()];if(!config)throw new TypeError("invalid suite type");var keys=ebtk(password,!1,config.key,config.iv);return createCipheriv(suite,keys.key,keys.iv)}var aes=__webpack_require__(77),Transform=__webpack_require__(40),inherits=__webpack_require__(1),modes=__webpack_require__(108),ebtk=__webpack_require__(185),StreamCipher=__webpack_require__(172),AuthCipher=__webpack_require__(165);inherits(Cipher,Transform),Cipher.prototype._update=function(data){this._cache.add(data);for(var chunk,thing,out=[];chunk=this._cache.get();)thing=this._mode.encrypt(this,chunk),out.push(thing);return Buffer.concat(out)},Cipher.prototype._final=function(){var chunk=this._cache.flush();if(this._autopadding)return chunk=this._mode.encrypt(this,chunk),this._cipher.scrub(),chunk;if("10101010101010101010101010101010"!==chunk.toString("hex"))throw this._cipher.scrub(),new Error("data not multiple of block length")},Cipher.prototype.setAutoPadding=function(setTo){return this._autopadding=!!setTo,this},Splitter.prototype.add=function(data){this.cache=Buffer.concat([this.cache,data])},Splitter.prototype.get=function(){if(this.cache.length>15){var out=this.cache.slice(0,16);return this.cache=this.cache.slice(16),out}return null},Splitter.prototype.flush=function(){for(var len=16-this.cache.length,padBuff=new Buffer(len),i=-1;++iuint_max||x<0?(x_pos=Math.abs(x)%uint_max,x<0?uint_max-x_pos:x_pos):x}function xor(a,b){return[a[0]^b[0],a[1]^b[1],a[2]^b[2],a[3]^b[3]]}var zeros=new Buffer(16);zeros.fill(0),module.exports=GHASH,GHASH.prototype.ghash=function(block){for(var i=-1;++i0;j--)Vi[j]=Vi[j]>>>1|(1&Vi[j-1])<<31;Vi[0]=Vi[0]>>>1,lsb_Vi&&(Vi[0]=Vi[0]^225<<24)}this.state=fromArray(Zi)},GHASH.prototype.update=function(buf){this.cache=Buffer.concat([this.cache,buf]);for(var chunk;this.cache.length>=16;)chunk=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(chunk)},GHASH.prototype.final=function(abl,bl){return this.cache.length&&this.ghash(Buffer.concat([this.cache,zeros],16)),this.ghash(fromArray([0,abl,0,bl])),this.state};var uint_max=Math.pow(2,32)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){const Sha3=__webpack_require__(321),hashLengths=[224,256,384,512];var hash=function(bitcount){if(void 0!==bitcount&&hashLengths.indexOf(bitcount)==-1)throw new Error("Unsupported hash length");this.content=[],this.bitcount=bitcount?"keccak_"+bitcount:"keccak_512"};hash.prototype.update=function(i){if(Buffer.isBuffer(i))this.content.push(i);else{if("string"!=typeof i)throw new Error("Unsupported argument to update");this.content.push(new Buffer(i))}return this},hash.prototype.digest=function(encoding){var result=Sha3[this.bitcount](Buffer.concat(this.content));if("hex"===encoding)return result;if("binary"===encoding||void 0===encoding)return new Buffer(result,"hex").toString("binary");throw new Error("Unsupported encoding for digest: "+encoding)},module.exports={SHA3Hash:hash}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(global){!function(root,undefined){"use strict";var NODE_JS=void 0!==module;NODE_JS&&(root=global,root.JS_SHA3_TEST&&(root.navigator={userAgent:"Chrome"}));var CHROME=(root.JS_SHA3_TEST||!NODE_JS)&&navigator.userAgent.indexOf("Chrome")!=-1,HEX_CHARS="0123456789abcdef".split(""),KECCAK_PADDING=[1,256,65536,16777216],PADDING=[6,1536,393216,100663296],SHIFT=[0,8,16,24],RC=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],blocks=[],s=[],keccak_224=function(message){return keccak(message,224,KECCAK_PADDING)},keccak_256=function(message){return keccak(message,256,KECCAK_PADDING)},keccak_384=function(message){return keccak(message,384,KECCAK_PADDING)},sha3_224=function(message){return keccak(message,224,PADDING)},sha3_256=function(message){return keccak(message,256,PADDING)},sha3_384=function(message){return keccak(message,384,PADDING)},sha3_512=function(message){return keccak(message,512,PADDING)},keccak=function(message,bits,padding){var notString="string"!=typeof message;notString&&message.constructor==root.ArrayBuffer&&(message=new Uint8Array(message)),void 0===bits&&(bits=512,padding=KECCAK_PADDING);var block,code,n,i,h,l,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49,end=!1,index=0,start=0,length=message.length,blockCount=(1600-2*bits)/32,byteCount=4*blockCount;for(i=0;i<50;++i)s[i]=0;block=0;do{for(blocks[0]=block,i=1;i>2]|=message[index]<>2]|=code<>2]|=(192|code>>6)<>2]|=(128|63&code)<=57344?(blocks[i>>2]|=(224|code>>12)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<>2]|=(240|code>>18)<>2]|=(128|code>>12&63)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<>2]|=padding[3&i],++index),block=blocks[blockCount],index>length&&i>>31),l=c9^(c3<<1|c2>>>31),s[0]^=h,s[1]^=l,s[10]^=h,s[11]^=l,s[20]^=h,s[21]^=l,s[30]^=h,s[31]^=l,s[40]^=h,s[41]^=l,h=c0^(c4<<1|c5>>>31),l=c1^(c5<<1|c4>>>31),s[2]^=h,s[3]^=l,s[12]^=h,s[13]^=l,s[22]^=h,s[23]^=l,s[32]^=h,s[33]^=l,s[42]^=h,s[43]^=l,h=c2^(c6<<1|c7>>>31),l=c3^(c7<<1|c6>>>31),s[4]^=h,s[5]^=l,s[14]^=h,s[15]^=l,s[24]^=h,s[25]^=l,s[34]^=h,s[35]^=l,s[44]^=h,s[45]^=l,h=c4^(c8<<1|c9>>>31),l=c5^(c9<<1|c8>>>31),s[6]^=h,s[7]^=l,s[16]^=h,s[17]^=l,s[26]^=h,s[27]^=l,s[36]^=h,s[37]^=l,s[46]^=h,s[47]^=l,h=c6^(c0<<1|c1>>>31),l=c7^(c1<<1|c0>>>31),s[8]^=h,s[9]^=l,s[18]^=h,s[19]^=l,s[28]^=h,s[29]^=l,s[38]^=h,s[39]^=l,s[48]^=h,s[49]^=l,b0=s[0],b1=s[1],b32=s[11]<<4|s[10]>>>28,b33=s[10]<<4|s[11]>>>28,b14=s[20]<<3|s[21]>>>29,b15=s[21]<<3|s[20]>>>29,b46=s[31]<<9|s[30]>>>23,b47=s[30]<<9|s[31]>>>23,b28=s[40]<<18|s[41]>>>14,b29=s[41]<<18|s[40]>>>14,b20=s[2]<<1|s[3]>>>31,b21=s[3]<<1|s[2]>>>31,b2=s[13]<<12|s[12]>>>20,b3=s[12]<<12|s[13]>>>20,b34=s[22]<<10|s[23]>>>22,b35=s[23]<<10|s[22]>>>22,b16=s[33]<<13|s[32]>>>19,b17=s[32]<<13|s[33]>>>19,b48=s[42]<<2|s[43]>>>30,b49=s[43]<<2|s[42]>>>30,b40=s[5]<<30|s[4]>>>2,b41=s[4]<<30|s[5]>>>2,b22=s[14]<<6|s[15]>>>26,b23=s[15]<<6|s[14]>>>26,b4=s[25]<<11|s[24]>>>21,b5=s[24]<<11|s[25]>>>21,b36=s[34]<<15|s[35]>>>17,b37=s[35]<<15|s[34]>>>17,b18=s[45]<<29|s[44]>>>3,b19=s[44]<<29|s[45]>>>3,b10=s[6]<<28|s[7]>>>4,b11=s[7]<<28|s[6]>>>4,b42=s[17]<<23|s[16]>>>9,b43=s[16]<<23|s[17]>>>9,b24=s[26]<<25|s[27]>>>7,b25=s[27]<<25|s[26]>>>7,b6=s[36]<<21|s[37]>>>11,b7=s[37]<<21|s[36]>>>11,b38=s[47]<<24|s[46]>>>8,b39=s[46]<<24|s[47]>>>8,b30=s[8]<<27|s[9]>>>5,b31=s[9]<<27|s[8]>>>5,b12=s[18]<<20|s[19]>>>12,b13=s[19]<<20|s[18]>>>12,b44=s[29]<<7|s[28]>>>25,b45=s[28]<<7|s[29]>>>25,b26=s[38]<<8|s[39]>>>24,b27=s[39]<<8|s[38]>>>24,b8=s[48]<<14|s[49]>>>18,b9=s[49]<<14|s[48]>>>18,s[0]=b0^~b2&b4,s[1]=b1^~b3&b5,s[10]=b10^~b12&b14,s[11]=b11^~b13&b15,s[20]=b20^~b22&b24,s[21]=b21^~b23&b25,s[30]=b30^~b32&b34,s[31]=b31^~b33&b35,s[40]=b40^~b42&b44,s[41]=b41^~b43&b45,s[2]=b2^~b4&b6,s[3]=b3^~b5&b7,s[12]=b12^~b14&b16,s[13]=b13^~b15&b17,s[22]=b22^~b24&b26,s[23]=b23^~b25&b27,s[32]=b32^~b34&b36,s[33]=b33^~b35&b37,s[42]=b42^~b44&b46,s[43]=b43^~b45&b47,s[4]=b4^~b6&b8,s[5]=b5^~b7&b9,s[14]=b14^~b16&b18,s[15]=b15^~b17&b19,s[24]=b24^~b26&b28,s[25]=b25^~b27&b29,s[34]=b34^~b36&b38,s[35]=b35^~b37&b39,s[44]=b44^~b46&b48,s[45]=b45^~b47&b49,s[6]=b6^~b8&b0,s[7]=b7^~b9&b1,s[16]=b16^~b18&b10,s[17]=b17^~b19&b11,s[26]=b26^~b28&b20,s[27]=b27^~b29&b21,s[36]=b36^~b38&b30,s[37]=b37^~b39&b31,s[46]=b46^~b48&b40,s[47]=b47^~b49&b41,s[8]=b8^~b0&b2,s[9]=b9^~b1&b3,s[18]=b18^~b10&b12,s[19]=b19^~b11&b13,s[28]=b28^~b20&b22,s[29]=b29^~b21&b23,s[38]=b38^~b30&b32,s[39]=b39^~b31&b33,s[48]=b48^~b40&b42,s[49]=b49^~b41&b43,s[0]^=RC[n],s[1]^=RC[n+1]}while(!end);var hex="";if(CHROME)b0=s[0],b1=s[1],b2=s[2],b3=s[3],b4=s[4],b5=s[5],b6=s[6],b7=s[7],b8=s[8],b9=s[9],b10=s[10],b11=s[11],b12=s[12],b13=s[13],b14=s[14],b15=s[15],hex+=HEX_CHARS[b0>>4&15]+HEX_CHARS[15&b0]+HEX_CHARS[b0>>12&15]+HEX_CHARS[b0>>8&15]+HEX_CHARS[b0>>20&15]+HEX_CHARS[b0>>16&15]+HEX_CHARS[b0>>28&15]+HEX_CHARS[b0>>24&15]+HEX_CHARS[b1>>4&15]+HEX_CHARS[15&b1]+HEX_CHARS[b1>>12&15]+HEX_CHARS[b1>>8&15]+HEX_CHARS[b1>>20&15]+HEX_CHARS[b1>>16&15]+HEX_CHARS[b1>>28&15]+HEX_CHARS[b1>>24&15]+HEX_CHARS[b2>>4&15]+HEX_CHARS[15&b2]+HEX_CHARS[b2>>12&15]+HEX_CHARS[b2>>8&15]+HEX_CHARS[b2>>20&15]+HEX_CHARS[b2>>16&15]+HEX_CHARS[b2>>28&15]+HEX_CHARS[b2>>24&15]+HEX_CHARS[b3>>4&15]+HEX_CHARS[15&b3]+HEX_CHARS[b3>>12&15]+HEX_CHARS[b3>>8&15]+HEX_CHARS[b3>>20&15]+HEX_CHARS[b3>>16&15]+HEX_CHARS[b3>>28&15]+HEX_CHARS[b3>>24&15]+HEX_CHARS[b4>>4&15]+HEX_CHARS[15&b4]+HEX_CHARS[b4>>12&15]+HEX_CHARS[b4>>8&15]+HEX_CHARS[b4>>20&15]+HEX_CHARS[b4>>16&15]+HEX_CHARS[b4>>28&15]+HEX_CHARS[b4>>24&15]+HEX_CHARS[b5>>4&15]+HEX_CHARS[15&b5]+HEX_CHARS[b5>>12&15]+HEX_CHARS[b5>>8&15]+HEX_CHARS[b5>>20&15]+HEX_CHARS[b5>>16&15]+HEX_CHARS[b5>>28&15]+HEX_CHARS[b5>>24&15]+HEX_CHARS[b6>>4&15]+HEX_CHARS[15&b6]+HEX_CHARS[b6>>12&15]+HEX_CHARS[b6>>8&15]+HEX_CHARS[b6>>20&15]+HEX_CHARS[b6>>16&15]+HEX_CHARS[b6>>28&15]+HEX_CHARS[b6>>24&15],bits>=256&&(hex+=HEX_CHARS[b7>>4&15]+HEX_CHARS[15&b7]+HEX_CHARS[b7>>12&15]+HEX_CHARS[b7>>8&15]+HEX_CHARS[b7>>20&15]+HEX_CHARS[b7>>16&15]+HEX_CHARS[b7>>28&15]+HEX_CHARS[b7>>24&15]),bits>=384&&(hex+=HEX_CHARS[b8>>4&15]+HEX_CHARS[15&b8]+HEX_CHARS[b8>>12&15]+HEX_CHARS[b8>>8&15]+HEX_CHARS[b8>>20&15]+HEX_CHARS[b8>>16&15]+HEX_CHARS[b8>>28&15]+HEX_CHARS[b8>>24&15]+HEX_CHARS[b9>>4&15]+HEX_CHARS[15&b9]+HEX_CHARS[b9>>12&15]+HEX_CHARS[b9>>8&15]+HEX_CHARS[b9>>20&15]+HEX_CHARS[b9>>16&15]+HEX_CHARS[b9>>28&15]+HEX_CHARS[b9>>24&15]+HEX_CHARS[b10>>4&15]+HEX_CHARS[15&b10]+HEX_CHARS[b10>>12&15]+HEX_CHARS[b10>>8&15]+HEX_CHARS[b10>>20&15]+HEX_CHARS[b10>>16&15]+HEX_CHARS[b10>>28&15]+HEX_CHARS[b10>>24&15]+HEX_CHARS[b11>>4&15]+HEX_CHARS[15&b11]+HEX_CHARS[b11>>12&15]+HEX_CHARS[b11>>8&15]+HEX_CHARS[b11>>20&15]+HEX_CHARS[b11>>16&15]+HEX_CHARS[b11>>28&15]+HEX_CHARS[b11>>24&15]),512==bits&&(hex+=HEX_CHARS[b12>>4&15]+HEX_CHARS[15&b12]+HEX_CHARS[b12>>12&15]+HEX_CHARS[b12>>8&15]+HEX_CHARS[b12>>20&15]+HEX_CHARS[b12>>16&15]+HEX_CHARS[b12>>28&15]+HEX_CHARS[b12>>24&15]+HEX_CHARS[b13>>4&15]+HEX_CHARS[15&b13]+HEX_CHARS[b13>>12&15]+HEX_CHARS[b13>>8&15]+HEX_CHARS[b13>>20&15]+HEX_CHARS[b13>>16&15]+HEX_CHARS[b13>>28&15]+HEX_CHARS[b13>>24&15]+HEX_CHARS[b14>>4&15]+HEX_CHARS[15&b14]+HEX_CHARS[b14>>12&15]+HEX_CHARS[b14>>8&15]+HEX_CHARS[b14>>20&15]+HEX_CHARS[b14>>16&15]+HEX_CHARS[b14>>28&15]+HEX_CHARS[b14>>24&15]+HEX_CHARS[b15>>4&15]+HEX_CHARS[15&b15]+HEX_CHARS[b15>>12&15]+HEX_CHARS[b15>>8&15]+HEX_CHARS[b15>>20&15]+HEX_CHARS[b15>>16&15]+HEX_CHARS[b15>>28&15]+HEX_CHARS[b15>>24&15]);else for(i=0,n=bits/32;i>4&15]+HEX_CHARS[15&h]+HEX_CHARS[h>>12&15]+HEX_CHARS[h>>8&15]+HEX_CHARS[h>>20&15]+HEX_CHARS[h>>16&15]+HEX_CHARS[h>>28&15]+HEX_CHARS[h>>24&15];return hex};!root.JS_SHA3_TEST&&NODE_JS?module.exports={sha3_512:sha3_512,sha3_384:sha3_384,sha3_256:sha3_256,sha3_224:sha3_224,keccak_512:keccak,keccak_384:keccak_384,keccak_256:keccak_256,keccak_224:keccak_224}:root&&(root.sha3_512=sha3_512,root.sha3_384=sha3_384,root.sha3_256=sha3_256,root.sha3_224=sha3_224,root.keccak_512=keccak,root.keccak_384=keccak_384,root.keccak_256=keccak_256,root.keccak_224=keccak_224)}(this)}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){var Buffer=__webpack_require__(6).Buffer;module.exports=function(ALPHABET){function encode(source){if(0===source.length)return"";for(var digits=[0],i=0;i0;)digits.push(carry%BASE),carry=carry/BASE|0}for(var string="",k=0;0===source[k]&&k=0;--q)string+=ALPHABET[digits[q]];return string}function decodeUnsafe(string){if(0===string.length)return Buffer.allocUnsafe(0);for(var bytes=[0],i=0;i>=8;for(;carry>0;)bytes.push(255&carry),carry>>=8}for(var k=0;string[k]===LEADER&&k>>2),i=0,j=0;iblocksize){key=("rmd160"===alg?new RIPEMD160:sha(alg)).update(key).digest()}else key.lengthblocksize?key=alg(key):key.length{m.datastore.open(cb)},callback)}_lookup(key){for(let mount of this.mounts)if(mount.prefix.toString()===key.toString()||mount.prefix.isAncestorOf(key)){const s=replaceStartWith(key.toString(),mount.prefix.toString());return{datastore:mount.datastore,mountpoint:mount.prefix,rest:new Key(s)}}}put(key,value,callback){const match=this._lookup(key);if(null==match)return void callback(new Error("No datastore mounted for this key"));match.datastore.put(match.rest,value,callback)}get(key,callback){const match=this._lookup(key);if(null==match)return void callback(new Error("No datastore mounted for this key"));match.datastore.get(match.rest,callback)}has(key,callback){const match=this._lookup(key);if(null==match)return void callback(null,!1);match.datastore.has(match.rest,callback)}delete(key,callback){const match=this._lookup(key);if(null==match)return void callback(new Error("No datastore mounted for this key"));match.datastore.delete(match.rest,callback)}close(callback){each(this.mounts,(m,cb)=>{m.datastore.close(cb)},callback)}batch(){const batchMounts={},lookup=key=>{const match=this._lookup(key);if(null==match)throw new Error("No datastore mounted for this key");const m=match.mountpoint.toString();return null==batchMounts[m]&&(batchMounts[m]=match.datastore.batch()),{batch:batchMounts[m],rest:match.rest}};return{put:(key,value)=>{const match=lookup(key);match.batch.put(match.rest,value)},delete:key=>{const match=lookup(key);match.batch.delete(match.rest)},commit:callback=>{each(Object.keys(batchMounts),(p,cb)=>{batchMounts[p].commit(cb)},callback)}}}query(q){const qs=this.mounts.map(m=>{const ks=new Keytransform(m.datastore,{convert:key=>{throw new Error("should never be called")},invert:key=>{return m.prefix.child(key)}});let prefix;return null!=q.prefix&&(prefix=replaceStartWith(q.prefix,m.prefix.toString())),ks.query({prefix:prefix,filters:q.filters,keysOnly:q.keysOnly})});let tasks=[many(qs)];if(null!=q.filters&&(tasks=tasks.concat(q.filters.map(f=>asyncFilter(f)))),null!=q.orders&&(tasks=tasks.concat(q.orders.map(o=>asyncSort(o)))),null!=q.offset){let i=0;tasks.push(pull.filter(()=>i++>=q.offset))}return null!=q.limit&&tasks.push(pull.take(q.limit)),pull.apply(null,tasks)}}module.exports=MountDatastore},function(module,exports,__webpack_require__){"use strict";const Key=__webpack_require__(16).Key,KeytransformDatastore=__webpack_require__(81);class NamespaceDatastore extends KeytransformDatastore{constructor(child,prefix){super(child,{convert(key){return prefix.child(key)},invert(key){if("/"===prefix.toString())return key;if(!prefix.isAncestorOf(key))throw new Error(`Expected prefix: (${prefix.toString()}) in key: ${key.toString()}`);return new Key(key.toString().slice(prefix.toString().length),!1)}}),this.prefix=prefix}query(q){return q.prefix&&"/"!==this.prefix.toString()?super.query(Object.assign({},q,{prefix:this.prefix.child(new Key(q.prefix)).toString()})):super.query(q)}}module.exports=NamespaceDatastore},function(module,exports,__webpack_require__){"use strict";module.exports=`This is a repository of IPLD objects. Each IPLD object is in a single file, +`);module.exports=protobuf(schema).Identify}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";module.exports="/mplex/6.7.0"},function(module,exports,__webpack_require__){"use strict";function getPeerInfo(peer,peerBook){let p;if(PeerInfo.isPeerInfo(peer))p=peer;else if(multiaddr.isMultiaddr(peer)){const peerIdB58Str=peer.getPeerId();try{p=peerBook.get(peerIdB58Str)}catch(err){p=new PeerInfo(PeerId.createFromB58String(peerIdB58Str))}p.multiaddrs.add(peer)}else{if(!PeerId.isPeerId(peer))throw new Error("peer type not recognized");{const peerIdB58Str=peer.toB58String();try{p=peerBook.get(peerIdB58Str)}catch(err){throw new Error("Couldnt get PeerInfo")}}}return p}const PeerId=__webpack_require__(23),PeerInfo=__webpack_require__(36),multiaddr=__webpack_require__(26);module.exports=getPeerInfo},function(module,exports,__webpack_require__){"use strict";module.exports={tag:"/plaintext/1.0.0",encrypt(id,privKey,conn){return conn}}},function(module,exports,__webpack_require__){(function(global){function debounce(func,wait,options){function invokeFunc(time){var args=lastArgs,thisArg=lastThis;return lastArgs=lastThis=void 0,lastInvokeTime=time,result=func.apply(thisArg,args)}function leadingEdge(time){return lastInvokeTime=time,timerId=setTimeout(timerExpired,wait),leading?invokeFunc(time):result}function remainingWait(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime,result=wait-timeSinceLastCall;return maxing?nativeMin(result,maxWait-timeSinceLastInvoke):result}function shouldInvoke(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime;return void 0===lastCallTime||timeSinceLastCall>=wait||timeSinceLastCall<0||maxing&&timeSinceLastInvoke>=maxWait}function timerExpired(){var time=now();if(shouldInvoke(time))return trailingEdge(time);timerId=setTimeout(timerExpired,remainingWait(time))}function trailingEdge(time){return timerId=void 0,trailing&&lastArgs?invokeFunc(time):(lastArgs=lastThis=void 0,result)}function cancel(){void 0!==timerId&&clearTimeout(timerId),lastInvokeTime=0,lastArgs=lastCallTime=lastThis=timerId=void 0}function flush(){return void 0===timerId?result:trailingEdge(now())}function debounced(){var time=now(),isInvoking=shouldInvoke(time);if(lastArgs=arguments,lastThis=this,lastCallTime=time,isInvoking){if(void 0===timerId)return leadingEdge(lastCallTime);if(maxing)return timerId=setTimeout(timerExpired,wait),invokeFunc(lastCallTime)}return void 0===timerId&&(timerId=setTimeout(timerExpired,wait)),result}var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime=0,leading=!1,maxing=!1,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return wait=toNumber(wait)||0,isObject(options)&&(leading=!!options.leading,maxing="maxWait"in options,maxWait=maxing?nativeMax(toNumber(options.maxWait)||0,wait):maxWait,trailing="trailing"in options?!!options.trailing:trailing),debounced.cancel=cancel,debounced.flush=flush,debounced}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}var FUNC_ERROR_TEXT="Expected a function",NAN=NaN,symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),objectProto=Object.prototype,objectToString=objectProto.toString,nativeMax=Math.max,nativeMin=Math.min,now=function(){return root.Date.now()};module.exports=debounce}).call(exports,__webpack_require__(3))},function(module,exports,__webpack_require__){(function(global){function getValue(object,key){return null==object?void 0:object[key]}function isHostObject(value){var result=!1;if(null!=value&&"function"!=typeof value.toString)try{result=!!(value+"")}catch(e){}return result}function Hash(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index-1&&value%1==0&&value-1:!!length&&baseIndexOf(collection,value,fromIndex)>-1}function isArguments(value){return isArrayLikeObject(value)&&hasOwnProperty.call(value,"callee")&&(!propertyIsEnumerable.call(value,"callee")||objectToString.call(value)==argsTag)}function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isString(value){return"string"==typeof value||!isArray(value)&&isObjectLike(value)&&objectToString.call(value)==stringTag}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toFinite(value){if(!value)return 0===value?value:0;if((value=toNumber(value))===INFINITY||value===-INFINITY){return(value<0?-1:1)*MAX_INTEGER}return value===value?value:0}function toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function values(object){return object?baseValues(object,keys(object)):[]}var INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,MAX_INTEGER=1.7976931348623157e308,NAN=NaN,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",stringTag="[object String]",symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,reIsUint=/^(?:0|[1-9]\d*)$/,freeParseInt=parseInt,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,propertyIsEnumerable=objectProto.propertyIsEnumerable,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),nativeMax=Math.max,isArray=Array.isArray;module.exports=includes},function(module,exports,__webpack_require__){var root=__webpack_require__(239),Symbol=root.Symbol;module.exports=Symbol},function(module,exports,__webpack_require__){(function(global){var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global;module.exports=freeGlobal}).call(exports,__webpack_require__(3))},function(module,exports,__webpack_require__){var freeGlobal=__webpack_require__(238),freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")();module.exports=root},function(module,exports){function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}var MAX_SAFE_INTEGER=9007199254740991;module.exports=isLength},function(module,exports){function isObject(value){var type=typeof value;return null!=value&&("object"==type||"function"==type)}module.exports=isObject},function(module,exports){module.exports=function(fun){!function next(){var loop=!0,sync=!1;do{sync=!0,loop=!1,fun.call(this,function(){sync?loop=!0:next()}),sync=!1}while(loop)}()}},function(module,exports,__webpack_require__){"use strict";function toArray(msg,enc){if(Array.isArray(msg))return msg.slice();if(!msg)return[];var res=[];if("string"!=typeof msg){for(var i=0;i>8,lo=255&c;hi?res.push(hi,lo):res.push(lo)}return res}function zero2(word){return 1===word.length?"0"+word:word}function toHex(msg){for(var res="",i=0;i{return function(input,callback){const done=(err,res)=>setImmediate(()=>{callback(err,res)});let res;try{res=doWork(input)}catch(err){return void done(err)}done(null,res)}}),exports.toBuf=((doWork,other)=>input=>{return new Buffer(doWork(input,other),"hex")}),exports.fromString=((doWork,other)=>_input=>{return doWork(Buffer.isBuffer(_input)?_input.toString():_input,other)}),exports.fromNumberTo32BitBuf=((doWork,other)=>input=>{let number=doWork(input,other);const bytes=new Array(4);for(let i=0;i<4;i++)bytes[i]=255&number,number>>=8;return Buffer.from(bytes)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(process){function useColors(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(args){var useColors=this.useColors;if(args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff),useColors){var c="color: "+this.color;args.splice(1,0,c,"color: inherit");var index=0,lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){"%%"!==match&&(index++,"%c"===match&&(lastC=index))}),args.splice(lastC,0,c)}}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{null==namespaces?exports.storage.removeItem("debug"):exports.storage.debug=namespaces}catch(e){}}function load(){var r;try{r=exports.storage.debug}catch(e){}return!r&&void 0!==process&&"env"in process&&(r=process.env.DEBUG),r}exports=module.exports=__webpack_require__(586),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],exports.formatters.j=function(v){try{return JSON.stringify(v)}catch(err){return"[UnexpectedJSONParseError]: "+err.message}},exports.enable(load())}).call(exports,__webpack_require__(1))},function(module,exports,__webpack_require__){"use strict";exports=module.exports,exports.PROTOCOL_ID="/multistream/1.0.0"},function(module,exports,__webpack_require__){"use strict";function matchExact(myProtocol,senderProtocol,callback){callback(null,myProtocol===senderProtocol)}module.exports=matchExact},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function select(multicodec,callback,log){const stream=handshake({timeout:6e4},callback),shake=stream.handshake;return log("writing multicodec: "+multicodec),writeEncoded(shake,new Buffer(multicodec+"\n"),callback),pullLP.decodeFromReader(shake,(err,data)=>{if(err)return callback(err);const protocol=data.toString().slice(0,-1);if(protocol!==multicodec)return callback(new Error(`"${multicodec}" not supported`),shake.rest());log("received ack: "+protocol),callback(null,shake.rest())}),stream}const handshake=__webpack_require__(58),pullLP=__webpack_require__(24),util=__webpack_require__(95),writeEncoded=util.writeEncoded;module.exports=select}).call(exports,__webpack_require__(0).Buffer)},function(module,exports){exports.endianness=function(){return"LE"},exports.hostname=function(){return"undefined"!=typeof location?location.hostname:""},exports.loadavg=function(){return[]},exports.uptime=function(){return 0},exports.freemem=function(){return Number.MAX_VALUE},exports.totalmem=function(){return Number.MAX_VALUE},exports.cpus=function(){return[]},exports.type=function(){return"Browser"},exports.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},exports.networkInterfaces=exports.getNetworkInterfaces=function(){return{}},exports.arch=function(){return"javascript"},exports.platform=function(){return"browser"},exports.tmpdir=exports.tmpDir=function(){return"/tmp"},exports.EOL="\n"},function(module,exports){var re=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,parts=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];module.exports=function(str){var src=str,b=str.indexOf("["),e=str.indexOf("]");b!=-1&&e!=-1&&(str=str.substring(0,b)+str.substring(b,e).replace(/:/g,";")+str.substring(e,str.length));for(var m=re.exec(str||""),uri={},i=14;i--;)uri[parts[i]]=m[i]||"";return b!=-1&&e!=-1&&(uri.source=src,uri.host=uri.host.substring(1,uri.host.length-1).replace(/;/g,":"),uri.authority=uri.authority.replace("[","").replace("]","").replace(/;/g,":"),uri.ipv6uri=!0),uri}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function getB58Str(peer){let b58Str;if("string"==typeof peer)b58Str=peer;else if(Buffer.isBuffer(peer))b58Str=bs58.encode(peer).toString();else if(PeerId.isPeerId(peer))b58Str=peer.toB58String();else{if(!PeerInfo.isPeerInfo(peer))throw new Error("not valid PeerId or PeerInfo, or B58Str");b58Str=peer.id.toB58String()}return b58Str}const bs58=__webpack_require__(81),PeerId=__webpack_require__(23),PeerInfo=__webpack_require__(36);class PeerBook{constructor(){this._peers={}}has(peer){const b58Str=getB58Str(peer);return Boolean(this._peers[b58Str])}put(peerInfo,replace){const localPeerInfo=this._peers[peerInfo.id.toB58String()];if(!localPeerInfo||replace)return this._peers[peerInfo.id.toB58String()]=peerInfo,peerInfo;peerInfo.multiaddrs.forEach(ma=>localPeerInfo.multiaddrs.add(ma));const ma=peerInfo.isConnected();return ma&&localPeerInfo.connect(ma),peerInfo.protocols.forEach(p=>localPeerInfo.protocols.add(p)),!localPeerInfo.id.privKey&&peerInfo.id.privKey&&(localPeerInfo.id.privKey=peerInfo.id.privKey),!localPeerInfo.id.pubKey&&peerInfo.id.pubKey&&(localPeerInfo.id.pubKey=peerInfo.id.pubKey),localPeerInfo}get(peer){const b58Str=getB58Str(peer),peerInfo=this._peers[b58Str];if(peerInfo)return peerInfo;throw new Error("PeerInfo not found")}getAll(){return this._peers}getAllArray(){return Object.keys(this._peers).map(b58Str=>this._peers[b58Str])}getMultiaddrs(peer){return this.get(peer).multiaddrs.toArray()}remove(peer){const b58Str=getB58Str(peer);this._peers[b58Str]&&delete this._peers[b58Str]}}module.exports=PeerBook}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function ensureMultiaddr(ma){return multiaddr.isMultiaddr(ma)?ma:multiaddr(ma)}const multiaddr=__webpack_require__(26);module.exports={ensureMultiaddr:ensureMultiaddr}},function(module,exports,__webpack_require__){var Source=__webpack_require__(100),Sink=__webpack_require__(256);module.exports=function(){var source=Source(),sink=Sink();return{source:source,sink:sink,resolve:function(duplex){source.resolve(duplex.source),sink.resolve(duplex.sink)}}}},function(module,exports){module.exports=function(stream){function consume(_read){if(!_read)throw new Error("must be passed a readable");read=_read,started&&stream(read)}var read,started=!1;Math.random();return consume.resolve=consume.ready=consume.start=function(_stream){return started=!0,stream=_stream||stream,read&&stream(read),consume},consume}},function(module,exports){module.exports=function(onPause){function reader(_read){return read=_read,function(abort,cb){paused?wait=[abort,cb]:read(abort,cb)}}var wait,read,paused;return reader.pause=function(){paused||onPause&&onPause(paused=!0)},reader.resume=function(){if(paused&&(paused=!1,onPause&&onPause(paused),wait)){var _wait=wait;wait=null,read(_wait[0],_wait[1])}},reader}},function(module,exports,__webpack_require__){"use strict";function isInteger(i){return Number.isFinite(i)}function isFunction(f){return"function"==typeof f}function maxDelay(fn,delay){return delay?function(a,cb){var timer=setTimeout(function(){fn(new Error("pull-reader: read exceeded timeout"),cb)},delay);fn(a,function(err,value){clearTimeout(timer),cb(err,value)})}:fn}var State=__webpack_require__(619);module.exports=function(timeout){function drain(){for(;queue.length;)if(null==queue[0].length&&state.has(1))queue.shift().cb(null,state.get());else if(state.has(queue[0].length)){var next=queue.shift();next.cb(null,state.get(next.length))}else{if(!ended)return!!queue.length;queue.shift().cb(ended)}return queue.length||!state.has(1)||abort}function more(){drain()&&!reading&&(!read||reading||streaming||(reading=!0,readTimed(null,function(err,data){if(reading=!1,err)return ended=err,drain();state.add(data),more()})))}function reader(_read){if(abort){for(;queue.length;)queue.shift().cb(abort);return cb&&cb(abort)}readTimed=maxDelay(_read,timeout),read=_read,more()}var read,readTimed,ended,streaming,abort,queue=[],reading=!1,state=State();return reader.abort=function(err,cb){abort=err||!0,read?(reading=!0,read(abort,function(){for(;queue.length;)queue.shift().cb(abort);cb&&cb(abort)})):cb()},reader.read=function(len,_timeout,cb){if(isFunction(_timeout)&&(cb=_timeout,_timeout=timeout),!isFunction(cb))return streaming=!0,function(abort,cb){if(reading||state.has(1)){if(abort)return read(abort,cb);queue.push({length:null,cb:cb}),more()}else maxDelay(read,_timeout)(abort,function(err,data){cb(err,data)})};queue.push({length:isInteger(len)?len:null,cb:cb}),more()},reader}},function(module,exports,__webpack_require__){(function(setImmediate,process){function duplex(reader,read){function drain(){if(waiting=!1,read&&!busy){for(;output.length&&!s.paused;)s.emit("data",output.shift());if(!s.paused){if(_ended)return s.emit("end");busy=!0,read(null,function next(end,data){busy=!1,s.paused?(end===!0?_ended=end:end?s.emit("error",end):output.push(data),waiting=!0):end&&(ended=end)!==!0?s.emit("error",end):(ended=ended||end)?s.emit("end"):(s.emit("data",data),busy=!0,read(null,next))})}}}reader&&"object"==typeof reader&&(read=reader.source,reader=reader.sink);var ended,needDrain,cbs=[],input=[],s=new Stream;s.writable=s.readable=!0,s.write=function(data){return cbs.length?cbs.shift()(null,data):input.push(data),cbs.length||(needDrain=!0),!!cbs.length},s.end=function(){read?input.length?drain():read(ended=!0,cbs.length?cbs.shift():function(){}):cbs.length&&cbs.shift()(!0)},s.source=function(end,cb){input.length?(cb(null,input.shift()),input.length||s.emit("drain")):((ended=ended||end)?cb(ended):cbs.push(cb),needDrain&&(needDrain=!1,s.emit("drain")))};var n;reader&&(n=reader(s.source)),n&&!read&&(read=n);var output=[],_ended=!1,waiting=!1,busy=!1;if(s.sink=function(_read){read=_read,next(drain)},read){s.sink(read);var pipe=s.pipe.bind(s);s.pipe=function(dest,opts){var res=pipe(dest,opts);return s.paused&&s.resume(),res}}return s.pause=function(){return s.paused=!0,s},s.resume=function(){return s.paused=!1,drain(),s},s.destroy=function(){!ended&&read&&read(ended=!0,function(){}),ended=!0,cbs.length&&cbs.shift()(!0),s.emit("close")},s}var Stream=__webpack_require__(25);module.exports=duplex,module.exports.source=function(source){return duplex(null,source)},module.exports.sink=function(sink){return duplex(sink,null)};var next=void 0===setImmediate?process.nextTick:setImmediate}).call(exports,__webpack_require__(38).setImmediate,__webpack_require__(1))},function(module,exports,__webpack_require__){"use strict";module.exports=function pull(a){var length=arguments.length;if("function"==typeof a&&1===a.length){for(var args=new Array(length),i=0;i0?("string"==typeof chunk||state.objectMode||Object.getPrototypeOf(chunk)===Buffer.prototype||(chunk=_uint8ArrayToBuffer(chunk)),addToFront?state.endEmitted?stream.emit("error",new Error("stream.unshift() after end event")):addChunk(stream,state,chunk,!0):state.ended?stream.emit("error",new Error("stream.push() after EOF")):(state.reading=!1,state.decoder&&!encoding?(chunk=state.decoder.write(chunk),state.objectMode||0!==chunk.length?addChunk(stream,state,chunk,!1):maybeReadMore(stream,state)):addChunk(stream,state,chunk,!1))):addToFront||(state.reading=!1)}return needMoreData(state)}function addChunk(stream,state,chunk,addToFront){state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream)),maybeReadMore(stream,state)}function chunkInvalid(state,chunk){var er;return _isUint8Array(chunk)||"string"==typeof chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||0===state.length&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}function onEofChunk(stream,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?processNextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,processNextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return nstr.length?str.length:n;if(ret+=nb===str.length?str:str.slice(0,n),0===(n-=nb)){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=Buffer.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),0===(n-=nb)){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,processNextTick(endReadableNT,state,stream))}function endReadableNT(state,stream){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}function indexOf(xs,x){for(var i=0,l=xs.length;i=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n0?fromList(n,state):null,null===ret?(state.needReadable=!0,n=0):state.length-=n,0===state.length&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),null!==ret&&this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable,unpipeInfo){debug("onunpipe"),readable===src&&unpipeInfo&&unpipeInfo.hasUnpiped===!1&&(unpipeInfo.hasUnpiped=!0,cleanup())}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",unpipe),src.removeListener("data",ondata),cleanedUp=!0,!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain()}function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1,!1!==dest.write(chunk)||increasedAwaitDrain||((1===state.pipesCount&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EElistenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:unpipe;state.endEmitted?processNextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1,increasedAwaitDrain=!1;return src.on("data",ondata),prependListener(dest,"error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState,unpipeInfo={hasUnpiped:!1};if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this,unpipeInfo),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i>>32-n}function fn1(a,b,c,d,e,m,k,s){return rotl(a+(b^c^d)+m+k|0,s)+e|0}function fn2(a,b,c,d,e,m,k,s){return rotl(a+(b&c|~b&d)+m+k|0,s)+e|0}function fn3(a,b,c,d,e,m,k,s){return rotl(a+((b|~c)^d)+m+k|0,s)+e|0}function fn4(a,b,c,d,e,m,k,s){return rotl(a+(b&d|c&~d)+m+k|0,s)+e|0}function fn5(a,b,c,d,e,m,k,s){return rotl(a+(b^(c|~d))+m+k|0,s)+e|0}var inherits=__webpack_require__(2),HashBase=__webpack_require__(381);inherits(RIPEMD160,HashBase),RIPEMD160.prototype._update=function(){for(var m=new Array(16),i=0;i<16;++i)m[i]=this._block.readInt32LE(4*i);var al=this._a,bl=this._b,cl=this._c,dl=this._d,el=this._e;al=fn1(al,bl,cl,dl,el,m[0],0,11),cl=rotl(cl,10),el=fn1(el,al,bl,cl,dl,m[1],0,14),bl=rotl(bl,10),dl=fn1(dl,el,al,bl,cl,m[2],0,15),al=rotl(al,10),cl=fn1(cl,dl,el,al,bl,m[3],0,12),el=rotl(el,10),bl=fn1(bl,cl,dl,el,al,m[4],0,5),dl=rotl(dl,10),al=fn1(al,bl,cl,dl,el,m[5],0,8),cl=rotl(cl,10),el=fn1(el,al,bl,cl,dl,m[6],0,7),bl=rotl(bl,10),dl=fn1(dl,el,al,bl,cl,m[7],0,9),al=rotl(al,10),cl=fn1(cl,dl,el,al,bl,m[8],0,11),el=rotl(el,10),bl=fn1(bl,cl,dl,el,al,m[9],0,13),dl=rotl(dl,10),al=fn1(al,bl,cl,dl,el,m[10],0,14),cl=rotl(cl,10),el=fn1(el,al,bl,cl,dl,m[11],0,15),bl=rotl(bl,10),dl=fn1(dl,el,al,bl,cl,m[12],0,6),al=rotl(al,10),cl=fn1(cl,dl,el,al,bl,m[13],0,7),el=rotl(el,10),bl=fn1(bl,cl,dl,el,al,m[14],0,9),dl=rotl(dl,10),al=fn1(al,bl,cl,dl,el,m[15],0,8),cl=rotl(cl,10),el=fn2(el,al,bl,cl,dl,m[7],1518500249,7),bl=rotl(bl,10),dl=fn2(dl,el,al,bl,cl,m[4],1518500249,6),al=rotl(al,10),cl=fn2(cl,dl,el,al,bl,m[13],1518500249,8),el=rotl(el,10),bl=fn2(bl,cl,dl,el,al,m[1],1518500249,13),dl=rotl(dl,10),al=fn2(al,bl,cl,dl,el,m[10],1518500249,11),cl=rotl(cl,10),el=fn2(el,al,bl,cl,dl,m[6],1518500249,9),bl=rotl(bl,10),dl=fn2(dl,el,al,bl,cl,m[15],1518500249,7),al=rotl(al,10),cl=fn2(cl,dl,el,al,bl,m[3],1518500249,15),el=rotl(el,10),bl=fn2(bl,cl,dl,el,al,m[12],1518500249,7),dl=rotl(dl,10),al=fn2(al,bl,cl,dl,el,m[0],1518500249,12),cl=rotl(cl,10),el=fn2(el,al,bl,cl,dl,m[9],1518500249,15),bl=rotl(bl,10),dl=fn2(dl,el,al,bl,cl,m[5],1518500249,9),al=rotl(al,10),cl=fn2(cl,dl,el,al,bl,m[2],1518500249,11),el=rotl(el,10),bl=fn2(bl,cl,dl,el,al,m[14],1518500249,7),dl=rotl(dl,10),al=fn2(al,bl,cl,dl,el,m[11],1518500249,13),cl=rotl(cl,10),el=fn2(el,al,bl,cl,dl,m[8],1518500249,12),bl=rotl(bl,10),dl=fn3(dl,el,al,bl,cl,m[3],1859775393,11),al=rotl(al,10),cl=fn3(cl,dl,el,al,bl,m[10],1859775393,13),el=rotl(el,10),bl=fn3(bl,cl,dl,el,al,m[14],1859775393,6),dl=rotl(dl,10),al=fn3(al,bl,cl,dl,el,m[4],1859775393,7),cl=rotl(cl,10),el=fn3(el,al,bl,cl,dl,m[9],1859775393,14),bl=rotl(bl,10),dl=fn3(dl,el,al,bl,cl,m[15],1859775393,9),al=rotl(al,10),cl=fn3(cl,dl,el,al,bl,m[8],1859775393,13),el=rotl(el,10),bl=fn3(bl,cl,dl,el,al,m[1],1859775393,15),dl=rotl(dl,10),al=fn3(al,bl,cl,dl,el,m[2],1859775393,14),cl=rotl(cl,10),el=fn3(el,al,bl,cl,dl,m[7],1859775393,8),bl=rotl(bl,10),dl=fn3(dl,el,al,bl,cl,m[0],1859775393,13),al=rotl(al,10),cl=fn3(cl,dl,el,al,bl,m[6],1859775393,6),el=rotl(el,10),bl=fn3(bl,cl,dl,el,al,m[13],1859775393,5),dl=rotl(dl,10),al=fn3(al,bl,cl,dl,el,m[11],1859775393,12),cl=rotl(cl,10),el=fn3(el,al,bl,cl,dl,m[5],1859775393,7),bl=rotl(bl,10),dl=fn3(dl,el,al,bl,cl,m[12],1859775393,5),al=rotl(al,10),cl=fn4(cl,dl,el,al,bl,m[1],2400959708,11),el=rotl(el,10),bl=fn4(bl,cl,dl,el,al,m[9],2400959708,12),dl=rotl(dl,10),al=fn4(al,bl,cl,dl,el,m[11],2400959708,14),cl=rotl(cl,10),el=fn4(el,al,bl,cl,dl,m[10],2400959708,15),bl=rotl(bl,10),dl=fn4(dl,el,al,bl,cl,m[0],2400959708,14),al=rotl(al,10),cl=fn4(cl,dl,el,al,bl,m[8],2400959708,15),el=rotl(el,10),bl=fn4(bl,cl,dl,el,al,m[12],2400959708,9),dl=rotl(dl,10),al=fn4(al,bl,cl,dl,el,m[4],2400959708,8),cl=rotl(cl,10),el=fn4(el,al,bl,cl,dl,m[13],2400959708,9),bl=rotl(bl,10),dl=fn4(dl,el,al,bl,cl,m[3],2400959708,14),al=rotl(al,10),cl=fn4(cl,dl,el,al,bl,m[7],2400959708,5),el=rotl(el,10),bl=fn4(bl,cl,dl,el,al,m[15],2400959708,6),dl=rotl(dl,10),al=fn4(al,bl,cl,dl,el,m[14],2400959708,8),cl=rotl(cl,10),el=fn4(el,al,bl,cl,dl,m[5],2400959708,6),bl=rotl(bl,10),dl=fn4(dl,el,al,bl,cl,m[6],2400959708,5),al=rotl(al,10),cl=fn4(cl,dl,el,al,bl,m[2],2400959708,12),el=rotl(el,10),bl=fn5(bl,cl,dl,el,al,m[4],2840853838,9),dl=rotl(dl,10),al=fn5(al,bl,cl,dl,el,m[0],2840853838,15),cl=rotl(cl,10),el=fn5(el,al,bl,cl,dl,m[5],2840853838,5),bl=rotl(bl,10),dl=fn5(dl,el,al,bl,cl,m[9],2840853838,11),al=rotl(al,10),cl=fn5(cl,dl,el,al,bl,m[7],2840853838,6),el=rotl(el,10),bl=fn5(bl,cl,dl,el,al,m[12],2840853838,8),dl=rotl(dl,10),al=fn5(al,bl,cl,dl,el,m[2],2840853838,13),cl=rotl(cl,10),el=fn5(el,al,bl,cl,dl,m[10],2840853838,12),bl=rotl(bl,10),dl=fn5(dl,el,al,bl,cl,m[14],2840853838,5),al=rotl(al,10),cl=fn5(cl,dl,el,al,bl,m[1],2840853838,12),el=rotl(el,10),bl=fn5(bl,cl,dl,el,al,m[3],2840853838,13),dl=rotl(dl,10),al=fn5(al,bl,cl,dl,el,m[8],2840853838,14),cl=rotl(cl,10),el=fn5(el,al,bl,cl,dl,m[11],2840853838,11),bl=rotl(bl,10),dl=fn5(dl,el,al,bl,cl,m[6],2840853838,8),al=rotl(al,10),cl=fn5(cl,dl,el,al,bl,m[15],2840853838,5),el=rotl(el,10),bl=fn5(bl,cl,dl,el,al,m[13],2840853838,6),dl=rotl(dl,10);var ar=this._a,br=this._b,cr=this._c,dr=this._d,er=this._e;ar=fn5(ar,br,cr,dr,er,m[5],1352829926,8),cr=rotl(cr,10),er=fn5(er,ar,br,cr,dr,m[14],1352829926,9),br=rotl(br,10),dr=fn5(dr,er,ar,br,cr,m[7],1352829926,9),ar=rotl(ar,10),cr=fn5(cr,dr,er,ar,br,m[0],1352829926,11),er=rotl(er,10),br=fn5(br,cr,dr,er,ar,m[9],1352829926,13),dr=rotl(dr,10),ar=fn5(ar,br,cr,dr,er,m[2],1352829926,15),cr=rotl(cr,10),er=fn5(er,ar,br,cr,dr,m[11],1352829926,15),br=rotl(br,10),dr=fn5(dr,er,ar,br,cr,m[4],1352829926,5),ar=rotl(ar,10),cr=fn5(cr,dr,er,ar,br,m[13],1352829926,7),er=rotl(er,10),br=fn5(br,cr,dr,er,ar,m[6],1352829926,7),dr=rotl(dr,10),ar=fn5(ar,br,cr,dr,er,m[15],1352829926,8),cr=rotl(cr,10),er=fn5(er,ar,br,cr,dr,m[8],1352829926,11),br=rotl(br,10),dr=fn5(dr,er,ar,br,cr,m[1],1352829926,14),ar=rotl(ar,10),cr=fn5(cr,dr,er,ar,br,m[10],1352829926,14),er=rotl(er,10),br=fn5(br,cr,dr,er,ar,m[3],1352829926,12),dr=rotl(dr,10),ar=fn5(ar,br,cr,dr,er,m[12],1352829926,6),cr=rotl(cr,10),er=fn4(er,ar,br,cr,dr,m[6],1548603684,9),br=rotl(br,10),dr=fn4(dr,er,ar,br,cr,m[11],1548603684,13),ar=rotl(ar,10),cr=fn4(cr,dr,er,ar,br,m[3],1548603684,15),er=rotl(er,10),br=fn4(br,cr,dr,er,ar,m[7],1548603684,7),dr=rotl(dr,10),ar=fn4(ar,br,cr,dr,er,m[0],1548603684,12),cr=rotl(cr,10),er=fn4(er,ar,br,cr,dr,m[13],1548603684,8),br=rotl(br,10),dr=fn4(dr,er,ar,br,cr,m[5],1548603684,9),ar=rotl(ar,10),cr=fn4(cr,dr,er,ar,br,m[10],1548603684,11),er=rotl(er,10),br=fn4(br,cr,dr,er,ar,m[14],1548603684,7),dr=rotl(dr,10),ar=fn4(ar,br,cr,dr,er,m[15],1548603684,7),cr=rotl(cr,10),er=fn4(er,ar,br,cr,dr,m[8],1548603684,12),br=rotl(br,10),dr=fn4(dr,er,ar,br,cr,m[12],1548603684,7),ar=rotl(ar,10),cr=fn4(cr,dr,er,ar,br,m[4],1548603684,6),er=rotl(er,10),br=fn4(br,cr,dr,er,ar,m[9],1548603684,15),dr=rotl(dr,10),ar=fn4(ar,br,cr,dr,er,m[1],1548603684,13),cr=rotl(cr,10),er=fn4(er,ar,br,cr,dr,m[2],1548603684,11),br=rotl(br,10),dr=fn3(dr,er,ar,br,cr,m[15],1836072691,9),ar=rotl(ar,10),cr=fn3(cr,dr,er,ar,br,m[5],1836072691,7),er=rotl(er,10),br=fn3(br,cr,dr,er,ar,m[1],1836072691,15),dr=rotl(dr,10),ar=fn3(ar,br,cr,dr,er,m[3],1836072691,11),cr=rotl(cr,10),er=fn3(er,ar,br,cr,dr,m[7],1836072691,8),br=rotl(br,10),dr=fn3(dr,er,ar,br,cr,m[14],1836072691,6),ar=rotl(ar,10),cr=fn3(cr,dr,er,ar,br,m[6],1836072691,6),er=rotl(er,10),br=fn3(br,cr,dr,er,ar,m[9],1836072691,14),dr=rotl(dr,10),ar=fn3(ar,br,cr,dr,er,m[11],1836072691,12),cr=rotl(cr,10),er=fn3(er,ar,br,cr,dr,m[8],1836072691,13),br=rotl(br,10),dr=fn3(dr,er,ar,br,cr,m[12],1836072691,5),ar=rotl(ar,10),cr=fn3(cr,dr,er,ar,br,m[2],1836072691,14),er=rotl(er,10),br=fn3(br,cr,dr,er,ar,m[10],1836072691,13),dr=rotl(dr,10),ar=fn3(ar,br,cr,dr,er,m[0],1836072691,13),cr=rotl(cr,10),er=fn3(er,ar,br,cr,dr,m[4],1836072691,7),br=rotl(br,10),dr=fn3(dr,er,ar,br,cr,m[13],1836072691,5),ar=rotl(ar,10),cr=fn2(cr,dr,er,ar,br,m[8],2053994217,15),er=rotl(er,10),br=fn2(br,cr,dr,er,ar,m[6],2053994217,5),dr=rotl(dr,10),ar=fn2(ar,br,cr,dr,er,m[4],2053994217,8),cr=rotl(cr,10),er=fn2(er,ar,br,cr,dr,m[1],2053994217,11),br=rotl(br,10),dr=fn2(dr,er,ar,br,cr,m[3],2053994217,14),ar=rotl(ar,10),cr=fn2(cr,dr,er,ar,br,m[11],2053994217,14),er=rotl(er,10),br=fn2(br,cr,dr,er,ar,m[15],2053994217,6),dr=rotl(dr,10),ar=fn2(ar,br,cr,dr,er,m[0],2053994217,14),cr=rotl(cr,10),er=fn2(er,ar,br,cr,dr,m[5],2053994217,6),br=rotl(br,10),dr=fn2(dr,er,ar,br,cr,m[12],2053994217,9),ar=rotl(ar,10),cr=fn2(cr,dr,er,ar,br,m[2],2053994217,12),er=rotl(er,10),br=fn2(br,cr,dr,er,ar,m[13],2053994217,9),dr=rotl(dr,10),ar=fn2(ar,br,cr,dr,er,m[9],2053994217,12),cr=rotl(cr,10),er=fn2(er,ar,br,cr,dr,m[7],2053994217,5),br=rotl(br,10),dr=fn2(dr,er,ar,br,cr,m[10],2053994217,15),ar=rotl(ar,10),cr=fn2(cr,dr,er,ar,br,m[14],2053994217,8),er=rotl(er,10),br=fn1(br,cr,dr,er,ar,m[12],0,8),dr=rotl(dr,10),ar=fn1(ar,br,cr,dr,er,m[15],0,5),cr=rotl(cr,10),er=fn1(er,ar,br,cr,dr,m[10],0,12),br=rotl(br,10),dr=fn1(dr,er,ar,br,cr,m[4],0,9),ar=rotl(ar,10),cr=fn1(cr,dr,er,ar,br,m[1],0,12),er=rotl(er,10),br=fn1(br,cr,dr,er,ar,m[5],0,5),dr=rotl(dr,10),ar=fn1(ar,br,cr,dr,er,m[8],0,14),cr=rotl(cr,10),er=fn1(er,ar,br,cr,dr,m[7],0,6),br=rotl(br,10),dr=fn1(dr,er,ar,br,cr,m[6],0,8),ar=rotl(ar,10),cr=fn1(cr,dr,er,ar,br,m[2],0,13),er=rotl(er,10),br=fn1(br,cr,dr,er,ar,m[13],0,6),dr=rotl(dr,10),ar=fn1(ar,br,cr,dr,er,m[14],0,5),cr=rotl(cr,10),er=fn1(er,ar,br,cr,dr,m[0],0,15),br=rotl(br,10),dr=fn1(dr,er,ar,br,cr,m[3],0,13),ar=rotl(ar,10),cr=fn1(cr,dr,er,ar,br,m[9],0,11),er=rotl(er,10),br=fn1(br,cr,dr,er,ar,m[11],0,11),dr=rotl(dr,10);var t=this._b+cl+dr|0;this._b=this._c+dl+er|0,this._c=this._d+el+ar|0,this._d=this._e+al+br|0,this._e=this._a+bl+cr|0,this._a=t},RIPEMD160.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var buffer=new Buffer(20);return buffer.writeInt32LE(this._a,0),buffer.writeInt32LE(this._b,4),buffer.writeInt32LE(this._c,8),buffer.writeInt32LE(this._d,12),buffer.writeInt32LE(this._e,16),buffer},module.exports=RIPEMD160}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function initCompressedValue(value,defaultValue){return void 0===value?defaultValue:(assert.isBoolean(value,messages.COMPRESSED_TYPE_INVALID),value)}var assert=__webpack_require__(663),der=__webpack_require__(664),messages=__webpack_require__(126);module.exports=function(secp256k1){return{privateKeyVerify:function(privateKey){return assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID), +32===privateKey.length&&secp256k1.privateKeyVerify(privateKey)},privateKeyExport:function(privateKey,compressed){assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),assert.isBufferLength(privateKey,32,messages.EC_PRIVATE_KEY_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0);var publicKey=secp256k1.privateKeyExport(privateKey,compressed);return der.privateKeyExport(privateKey,publicKey,compressed)},privateKeyImport:function(privateKey){if(assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),(privateKey=der.privateKeyImport(privateKey))&&32===privateKey.length&&secp256k1.privateKeyVerify(privateKey))return privateKey;throw new Error(messages.EC_PRIVATE_KEY_IMPORT_DER_FAIL)},privateKeyTweakAdd:function(privateKey,tweak){return assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),assert.isBufferLength(privateKey,32,messages.EC_PRIVATE_KEY_LENGTH_INVALID),assert.isBuffer(tweak,messages.TWEAK_TYPE_INVALID),assert.isBufferLength(tweak,32,messages.TWEAK_LENGTH_INVALID),secp256k1.privateKeyTweakAdd(privateKey,tweak)},privateKeyTweakMul:function(privateKey,tweak){return assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),assert.isBufferLength(privateKey,32,messages.EC_PRIVATE_KEY_LENGTH_INVALID),assert.isBuffer(tweak,messages.TWEAK_TYPE_INVALID),assert.isBufferLength(tweak,32,messages.TWEAK_LENGTH_INVALID),secp256k1.privateKeyTweakMul(privateKey,tweak)},publicKeyCreate:function(privateKey,compressed){return assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),assert.isBufferLength(privateKey,32,messages.EC_PRIVATE_KEY_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0),secp256k1.publicKeyCreate(privateKey,compressed)},publicKeyConvert:function(publicKey,compressed){return assert.isBuffer(publicKey,messages.EC_PUBLIC_KEY_TYPE_INVALID),assert.isBufferLength2(publicKey,33,65,messages.EC_PUBLIC_KEY_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0),secp256k1.publicKeyConvert(publicKey,compressed)},publicKeyVerify:function(publicKey){return assert.isBuffer(publicKey,messages.EC_PUBLIC_KEY_TYPE_INVALID),secp256k1.publicKeyVerify(publicKey)},publicKeyTweakAdd:function(publicKey,tweak,compressed){return assert.isBuffer(publicKey,messages.EC_PUBLIC_KEY_TYPE_INVALID),assert.isBufferLength2(publicKey,33,65,messages.EC_PUBLIC_KEY_LENGTH_INVALID),assert.isBuffer(tweak,messages.TWEAK_TYPE_INVALID),assert.isBufferLength(tweak,32,messages.TWEAK_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0),secp256k1.publicKeyTweakAdd(publicKey,tweak,compressed)},publicKeyTweakMul:function(publicKey,tweak,compressed){return assert.isBuffer(publicKey,messages.EC_PUBLIC_KEY_TYPE_INVALID),assert.isBufferLength2(publicKey,33,65,messages.EC_PUBLIC_KEY_LENGTH_INVALID),assert.isBuffer(tweak,messages.TWEAK_TYPE_INVALID),assert.isBufferLength(tweak,32,messages.TWEAK_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0),secp256k1.publicKeyTweakMul(publicKey,tweak,compressed)},publicKeyCombine:function(publicKeys,compressed){assert.isArray(publicKeys,messages.EC_PUBLIC_KEYS_TYPE_INVALID),assert.isLengthGTZero(publicKeys,messages.EC_PUBLIC_KEYS_LENGTH_INVALID);for(var i=0;i=0||y.ucmp(BN.p)>=0?null:6!==first&&7!==first||y.isOdd()===(7===first)?0!==x.redSqr().redMul(x).redIAdd7().ucmp(y.redSqr())?null:new ECPoint(x,y):null):(x=BN.fromBuffer(publicKey.slice(1,33)),x.ucmp(BN.p)>=0?null:null===(y=x.redSqr().redMul(x).redIAdd7().redSqrt())?null:(3===first!==y.isOdd()&&(y=y.redNeg()),new ECPoint(x,y)))},ECPoint.prototype.toPublicKey=function(compressed){var publicKey,x=this.x,y=this.y;return compressed?(publicKey=Buffer.alloc(33),publicKey[0]=y.isOdd()?3:2,x.toBuffer().copy(publicKey,1)):(publicKey=Buffer.alloc(65),publicKey[0]=4,x.toBuffer().copy(publicKey,1),y.toBuffer().copy(publicKey,33)),publicKey},ECPoint.fromECJPoint=function(p){if(p.inf)return new ECPoint(null,null);var zinv=p.z.redInvm(),zinv2=zinv.redSqr();return new ECPoint(p.x.redMul(zinv2),p.y.redMul(zinv2).redMul(zinv))},ECPoint.prototype.toECJPoint=function(){return this.inf?new ECJPoint(null,null,null):new ECJPoint(this.x,this.y,ECJPoint.one)},ECPoint.prototype.neg=function(){return this.inf?this:new ECPoint(this.x,this.y.redNeg())},ECPoint.prototype.add=function(p){if(this.inf)return p;if(p.inf)return this;if(0===this.x.ucmp(p.x))return 0===this.y.ucmp(p.y)?this.dbl():new ECPoint(null,null);var s=this.y.redSub(p.y);s.isZero()||(s=s.redMul(this.x.redSub(p.x).redInvm()));var nx=s.redSqr().redISub(this.x).redISub(p.x);return new ECPoint(nx,s.redMul(this.x.redSub(nx)).redISub(this.y))},ECPoint.prototype.dbl=function(){if(this.inf)return this;var yy=this.y.redAdd(this.y);if(yy.isZero())return new ECPoint(null,null);var x2=this.x.redSqr(),s=x2.redAdd(x2).redIAdd(x2).redMul(yy.redInvm()),nx=s.redSqr().redISub(this.x.redAdd(this.x));return new ECPoint(nx,s.redMul(this.x.redSub(nx)).redISub(this.y))},ECPoint.prototype.mul=function(num){for(var nafPoints=this._getNAFPoints(4),points=nafPoints.points,naf=num.getNAF(nafPoints.wnd),acc=new ECJPoint(null,null,null),i=naf.length-1;i>=0;i--){for(var k=0;i>=0&&0===naf[i];i--,++k);if(i>=0&&(k+=1),acc=acc.dblp(k),i<0)break;var z=naf[i];acc=z>0?acc.mixedAdd(points[z-1>>1]):acc.mixedAdd(points[-z-1>>1].neg())}return ECPoint.fromECJPoint(acc)},ECPoint.prototype._getNAFPoints1=function(){return{wnd:1,points:[this]}},ECPoint.prototype._getNAFPoints=function(wnd){var points=new Array((1<>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10)}function sigma1(x){return(x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7)}function gamma0(x){return(x>>>7|x<<25)^(x>>>18|x<<14)^x>>>3}function gamma1(x){return(x>>>17|x<<15)^(x>>>19|x<<13)^x>>>10}var inherits=__webpack_require__(2),Hash=__webpack_require__(59),K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],W=new Array(64);inherits(Sha256,Hash),Sha256.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},Sha256.prototype._update=function(M){for(var W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,f=0|this._f,g=0|this._g,h=0|this._h,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<64;++i)W[i]=gamma1(W[i-2])+W[i-7]+gamma0(W[i-15])+W[i-16]|0;for(var j=0;j<64;++j){var T1=h+sigma1(e)+ch(e,f,g)+K[j]+W[j]|0,T2=sigma0(a)+maj(a,b,c)|0;h=g,g=f,f=e,e=d+T1|0,d=c,c=b,b=a,a=T1+T2|0}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0,this._f=f+this._f|0,this._g=g+this._g|0,this._h=h+this._h|0},Sha256.prototype._hash=function(){var H=new Buffer(32);return H.writeInt32BE(this._a,0),H.writeInt32BE(this._b,4),H.writeInt32BE(this._c,8),H.writeInt32BE(this._d,12),H.writeInt32BE(this._e,16),H.writeInt32BE(this._f,20),H.writeInt32BE(this._g,24),H.writeInt32BE(this._h,28),H},module.exports=Sha256}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Sha512(){this.init(),this._w=W,Hash.call(this,128,112)}function Ch(x,y,z){return z^x&(y^z)}function maj(x,y,z){return x&y|z&(x|y)}function sigma0(x,xl){return(x>>>28|xl<<4)^(xl>>>2|x<<30)^(xl>>>7|x<<25)}function sigma1(x,xl){return(x>>>14|xl<<18)^(x>>>18|xl<<14)^(xl>>>9|x<<23)}function Gamma0(x,xl){return(x>>>1|xl<<31)^(x>>>8|xl<<24)^x>>>7}function Gamma0l(x,xl){return(x>>>1|xl<<31)^(x>>>8|xl<<24)^(x>>>7|xl<<25)}function Gamma1(x,xl){return(x>>>19|xl<<13)^(xl>>>29|x<<3)^x>>>6}function Gamma1l(x,xl){return(x>>>19|xl<<13)^(xl>>>29|x<<3)^(x>>>6|xl<<26)}function getCarry(a,b){return a>>>0>>0?1:0}var inherits=__webpack_require__(2),Hash=__webpack_require__(59),K=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],W=new Array(160);inherits(Sha512,Hash),Sha512.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},Sha512.prototype._update=function(M){for(var W=this._w,ah=0|this._ah,bh=0|this._bh,ch=0|this._ch,dh=0|this._dh,eh=0|this._eh,fh=0|this._fh,gh=0|this._gh,hh=0|this._hh,al=0|this._al,bl=0|this._bl,cl=0|this._cl,dl=0|this._dl,el=0|this._el,fl=0|this._fl,gl=0|this._gl,hl=0|this._hl,i=0;i<32;i+=2)W[i]=M.readInt32BE(4*i),W[i+1]=M.readInt32BE(4*i+4);for(;i<160;i+=2){var xh=W[i-30],xl=W[i-30+1],gamma0=Gamma0(xh,xl),gamma0l=Gamma0l(xl,xh);xh=W[i-4],xl=W[i-4+1];var gamma1=Gamma1(xh,xl),gamma1l=Gamma1l(xl,xh),Wi7h=W[i-14],Wi7l=W[i-14+1],Wi16h=W[i-32],Wi16l=W[i-32+1],Wil=gamma0l+Wi7l|0,Wih=gamma0+Wi7h+getCarry(Wil,gamma0l)|0;Wil=Wil+gamma1l|0,Wih=Wih+gamma1+getCarry(Wil,gamma1l)|0,Wil=Wil+Wi16l|0,Wih=Wih+Wi16h+getCarry(Wil,Wi16l)|0,W[i]=Wih,W[i+1]=Wil}for(var j=0;j<160;j+=2){Wih=W[j],Wil=W[j+1];var majh=maj(ah,bh,ch),majl=maj(al,bl,cl),sigma0h=sigma0(ah,al),sigma0l=sigma0(al,ah),sigma1h=sigma1(eh,el),sigma1l=sigma1(el,eh),Kih=K[j],Kil=K[j+1],chh=Ch(eh,fh,gh),chl=Ch(el,fl,gl),t1l=hl+sigma1l|0,t1h=hh+sigma1h+getCarry(t1l,hl)|0;t1l=t1l+chl|0,t1h=t1h+chh+getCarry(t1l,chl)|0,t1l=t1l+Kil|0,t1h=t1h+Kih+getCarry(t1l,Kil)|0,t1l=t1l+Wil|0,t1h=t1h+Wih+getCarry(t1l,Wil)|0;var t2l=sigma0l+majl|0,t2h=sigma0h+majh+getCarry(t2l,sigma0l)|0;hh=gh,hl=gl,gh=fh,gl=fl,fh=eh,fl=el,el=dl+t1l|0,eh=dh+t1h+getCarry(el,dl)|0,dh=ch,dl=cl,ch=bh,cl=bl,bh=ah,bl=al,al=t1l+t2l|0,ah=t1h+t2h+getCarry(al,t1l)|0}this._al=this._al+al|0,this._bl=this._bl+bl|0,this._cl=this._cl+cl|0,this._dl=this._dl+dl|0,this._el=this._el+el|0,this._fl=this._fl+fl|0,this._gl=this._gl+gl|0,this._hl=this._hl+hl|0,this._ah=this._ah+ah+getCarry(this._al,al)|0,this._bh=this._bh+bh+getCarry(this._bl,bl)|0,this._ch=this._ch+ch+getCarry(this._cl,cl)|0,this._dh=this._dh+dh+getCarry(this._dl,dl)|0,this._eh=this._eh+eh+getCarry(this._el,el)|0,this._fh=this._fh+fh+getCarry(this._fl,fl)|0,this._gh=this._gh+gh+getCarry(this._gl,gl)|0,this._hh=this._hh+hh+getCarry(this._hl,hl)|0},Sha512.prototype._hash=function(){function writeInt64BE(h,l,offset){H.writeInt32BE(h,offset),H.writeInt32BE(l,offset+4)}var H=new Buffer(64);return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),writeInt64BE(this._gh,this._gl,48),writeInt64BE(this._hh,this._hl,56),H},module.exports=Sha512}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function Manager(uri,opts){if(!(this instanceof Manager))return new Manager(uri,opts);uri&&"object"==typeof uri&&(opts=uri,uri=void 0),opts=opts||{},opts.path=opts.path||"/socket.io",this.nsps={},this.subs=[],this.opts=opts,this.reconnection(opts.reconnection!==!1),this.reconnectionAttempts(opts.reconnectionAttempts||1/0),this.reconnectionDelay(opts.reconnectionDelay||1e3),this.reconnectionDelayMax(opts.reconnectionDelayMax||5e3),this.randomizationFactor(opts.randomizationFactor||.5),this.backoff=new Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==opts.timeout?2e4:opts.timeout),this.readyState="closed",this.uri=uri,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var _parser=opts.parser||parser;this.encoder=new _parser.Encoder,this.decoder=new _parser.Decoder,this.autoConnect=opts.autoConnect!==!1,this.autoConnect&&this.open()}var eio=__webpack_require__(358),Socket=__webpack_require__(279),Emitter=__webpack_require__(50),parser=__webpack_require__(150),on=__webpack_require__(278),bind=__webpack_require__(178),debug=__webpack_require__(105)("socket.io-client:manager"),indexOf=__webpack_require__(118),Backoff=__webpack_require__(308),has=Object.prototype.hasOwnProperty;module.exports=Manager,Manager.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var nsp in this.nsps)has.call(this.nsps,nsp)&&this.nsps[nsp].emit.apply(this.nsps[nsp],arguments)},Manager.prototype.updateSocketIds=function(){for(var nsp in this.nsps)has.call(this.nsps,nsp)&&(this.nsps[nsp].id=this.generateId(nsp))},Manager.prototype.generateId=function(nsp){return("/"===nsp?"":nsp+"#")+this.engine.id},Emitter(Manager.prototype),Manager.prototype.reconnection=function(v){return arguments.length?(this._reconnection=!!v,this):this._reconnection},Manager.prototype.reconnectionAttempts=function(v){return arguments.length?(this._reconnectionAttempts=v,this):this._reconnectionAttempts},Manager.prototype.reconnectionDelay=function(v){return arguments.length?(this._reconnectionDelay=v,this.backoff&&this.backoff.setMin(v),this):this._reconnectionDelay},Manager.prototype.randomizationFactor=function(v){return arguments.length?(this._randomizationFactor=v,this.backoff&&this.backoff.setJitter(v),this):this._randomizationFactor},Manager.prototype.reconnectionDelayMax=function(v){return arguments.length?(this._reconnectionDelayMax=v,this.backoff&&this.backoff.setMax(v),this):this._reconnectionDelayMax},Manager.prototype.timeout=function(v){return arguments.length?(this._timeout=v,this):this._timeout},Manager.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},Manager.prototype.open=Manager.prototype.connect=function(fn,opts){if(debug("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;debug("opening %s",this.uri),this.engine=eio(this.uri,this.opts);var socket=this.engine,self=this;this.readyState="opening",this.skipReconnect=!1;var openSub=on(socket,"open",function(){self.onopen(),fn&&fn()}),errorSub=on(socket,"error",function(data){if(debug("connect_error"),self.cleanup(),self.readyState="closed",self.emitAll("connect_error",data),fn){var err=new Error("Connection error");err.data=data,fn(err)}else self.maybeReconnectOnOpen()});if(!1!==this._timeout){var timeout=this._timeout;debug("connect attempt will timeout after %d",timeout);var timer=setTimeout(function(){debug("connect attempt timed out after %d",timeout),openSub.destroy(),socket.close(),socket.emit("error","timeout"),self.emitAll("connect_timeout",timeout)},timeout);this.subs.push({destroy:function(){clearTimeout(timer)}})}return this.subs.push(openSub),this.subs.push(errorSub),this},Manager.prototype.onopen=function(){debug("open"),this.cleanup(),this.readyState="open",this.emit("open");var socket=this.engine;this.subs.push(on(socket,"data",bind(this,"ondata"))),this.subs.push(on(socket,"ping",bind(this,"onping"))),this.subs.push(on(socket,"pong",bind(this,"onpong"))),this.subs.push(on(socket,"error",bind(this,"onerror"))),this.subs.push(on(socket,"close",bind(this,"onclose"))),this.subs.push(on(this.decoder,"decoded",bind(this,"ondecoded")))},Manager.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},Manager.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},Manager.prototype.ondata=function(data){this.decoder.add(data)},Manager.prototype.ondecoded=function(packet){this.emit("packet",packet)},Manager.prototype.onerror=function(err){debug("error",err),this.emitAll("error",err)},Manager.prototype.socket=function(nsp,opts){function onConnecting(){~indexOf(self.connecting,socket)||self.connecting.push(socket)}var socket=this.nsps[nsp];if(!socket){socket=new Socket(this,nsp,opts),this.nsps[nsp]=socket;var self=this;socket.on("connecting",onConnecting),socket.on("connect",function(){socket.id=self.generateId(nsp)}),this.autoConnect&&onConnecting()}return socket},Manager.prototype.destroy=function(socket){var index=indexOf(this.connecting,socket);~index&&this.connecting.splice(index,1),this.connecting.length||this.close()},Manager.prototype.packet=function(packet){debug("writing packet %j",packet);var self=this;packet.query&&0===packet.type&&(packet.nsp+="?"+packet.query),self.encoding?self.packetBuffer.push(packet):(self.encoding=!0,this.encoder.encode(packet,function(encodedPackets){for(var i=0;i0&&!this.encoding){var pack=this.packetBuffer.shift();this.packet(pack)}},Manager.prototype.cleanup=function(){debug("cleanup");for(var subsLength=this.subs.length,i=0;i=this._reconnectionAttempts)debug("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var delay=this.backoff.duration();debug("will wait %dms before reconnect attempt",delay),this.reconnecting=!0;var timer=setTimeout(function(){self.skipReconnect||(debug("attempting reconnect"),self.emitAll("reconnect_attempt",self.backoff.attempts),self.emitAll("reconnecting",self.backoff.attempts),self.skipReconnect||self.open(function(err){err?(debug("reconnect attempt error"),self.reconnecting=!1,self.reconnect(),self.emitAll("reconnect_error",err.data)):(debug("reconnect success"),self.onreconnect())}))},delay);this.subs.push({destroy:function(){clearTimeout(timer)}})}},Manager.prototype.onreconnect=function(){var attempt=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",attempt)}},function(module,exports){function on(obj,ev,fn){return obj.on(ev,fn),{destroy:function(){obj.removeListener(ev,fn)}}}module.exports=on},function(module,exports,__webpack_require__){function Socket(io,nsp,opts){this.io=io,this.nsp=nsp,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,opts&&opts.query&&(this.query=opts.query),this.io.autoConnect&&this.open()}var parser=__webpack_require__(150),Emitter=__webpack_require__(50),toArray=__webpack_require__(691),on=__webpack_require__(278),bind=__webpack_require__(178),debug=__webpack_require__(105)("socket.io-client:socket"),parseqs=__webpack_require__(97);module.exports=Socket;var events={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},emit=Emitter.prototype.emit;Emitter(Socket.prototype),Socket.prototype.subEvents=function(){if(!this.subs){var io=this.io;this.subs=[on(io,"open",bind(this,"onopen")),on(io,"packet",bind(this,"onpacket")),on(io,"close",bind(this,"onclose"))]}},Socket.prototype.open=Socket.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting"),this)},Socket.prototype.send=function(){var args=toArray(arguments);return args.unshift("message"),this.emit.apply(this,args),this},Socket.prototype.emit=function(ev){if(events.hasOwnProperty(ev))return emit.apply(this,arguments),this;var args=toArray(arguments),packet={type:parser.EVENT,data:args};return packet.options={},packet.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof args[args.length-1]&&(debug("emitting packet with ack id %d",this.ids),this.acks[this.ids]=args.pop(),packet.id=this.ids++),this.connected?this.packet(packet):this.sendBuffer.push(packet),delete this.flags,this},Socket.prototype.packet=function(packet){packet.nsp=this.nsp,this.io.packet(packet)},Socket.prototype.onopen=function(){if(debug("transport is open - connecting"),"/"!==this.nsp)if(this.query){var query="object"==typeof this.query?parseqs.encode(this.query):this.query;debug("sending connect packet with query %s",query),this.packet({type:parser.CONNECT,query:query})}else this.packet({type:parser.CONNECT})},Socket.prototype.onclose=function(reason){debug("close (%s)",reason),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",reason)},Socket.prototype.onpacket=function(packet){if(packet.nsp===this.nsp)switch(packet.type){case parser.CONNECT:this.onconnect();break;case parser.EVENT:this.onevent(packet);break;case parser.BINARY_EVENT:this.onevent(packet);break;case parser.ACK:this.onack(packet);break;case parser.BINARY_ACK:this.onack(packet);break;case parser.DISCONNECT:this.ondisconnect();break;case parser.ERROR:this.emit("error",packet.data)}},Socket.prototype.onevent=function(packet){var args=packet.data||[];debug("emitting event %j",args),null!=packet.id&&(debug("attaching ack callback to event"),args.push(this.ack(packet.id))),this.connected?emit.apply(this,args):this.receiveBuffer.push(args)},Socket.prototype.ack=function(id){var self=this,sent=!1;return function(){if(!sent){sent=!0;var args=toArray(arguments);debug("sending ack %j",args),self.packet({type:parser.ACK,id:id,data:args})}}},Socket.prototype.onack=function(packet){var ack=this.acks[packet.id];"function"==typeof ack?(debug("calling ack %s with %j",packet.id,packet.data),ack.apply(this,packet.data),delete this.acks[packet.id]):debug("bad ack %s",packet.id)},Socket.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},Socket.prototype.emitBuffered=function(){var i +;for(i=0;i0);return encoded}function decode(str){var decoded=0;for(i=0;ibytes&&(end=bytes),start>=bytes||start>=end||0===bytes)return new ArrayBuffer(0);for(var abv=new Uint8Array(arraybuffer),result=new Uint8Array(end-start),i=start,ii=0;i=0&&workersList.splice(index,1),task.callback.apply(task,arguments),null!=err&&q.error(err,task.data)}numRunning<=q.concurrency-q.buffer&&q.unsaturated(),q.idle()&&q.drain(),q.process()}}if(null==concurrency)concurrency=1;else if(0===concurrency)throw new Error("Concurrency must not be zero");var _worker=(0,_wrapAsync2.default)(worker),numRunning=0,workersList=[],isProcessing=!1,q={_tasks:new _DoublyLinkedList2.default,concurrency:concurrency,payload:payload,saturated:_noop2.default,unsaturated:_noop2.default,buffer:concurrency/4,empty:_noop2.default,drain:_noop2.default,error:_noop2.default,started:!1,paused:!1,push:function(data,callback){_insert(data,!1,callback)},kill:function(){q.drain=_noop2.default,q._tasks.empty()},unshift:function(data,callback){_insert(data,!0,callback)},remove:function(testFn){q._tasks.remove(testFn)},process:function(){if(!isProcessing){for(isProcessing=!0;!q.paused&&numRunning0&&opts.jitter<=1?opts.jitter:0,this.attempts=0}module.exports=Backoff,Backoff.prototype.duration=function(){var ms=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var rand=Math.random(),deviation=Math.floor(rand*this.jitter*ms);ms=0==(1&Math.floor(10*rand))?ms-deviation:ms+deviation}return 0|Math.min(ms,this.max)},Backoff.prototype.reset=function(){this.attempts=0},Backoff.prototype.setMin=function(min){this.ms=min},Backoff.prototype.setMax=function(max){this.max=max},Backoff.prototype.setJitter=function(jitter){this.jitter=jitter}},function(module,exports,__webpack_require__){(function(Buffer){module.exports=function(ALPHABET){function encode(source){if(0===source.length)return"";for(var digits=[0],i=0;i0;)digits.push(carry%BASE),carry=carry/BASE|0}for(var string="",k=0;0===source[k]&&k=0;--q)string+=ALPHABET[digits[q]];return string}function decodeUnsafe(string){if(0===string.length)return Buffer.allocUnsafe(0);for(var bytes=[0],i=0;i>=8;for(;carry>0;)bytes.push(255&carry),carry>>=8}for(var k=0;string[k]===LEADER&&k>2],base64+=chars[(3&bytes[i])<<4|bytes[i+1]>>4],base64+=chars[(15&bytes[i+1])<<2|bytes[i+2]>>6],base64+=chars[63&bytes[i+2]];return len%3==2?base64=base64.substring(0,base64.length-1)+"=":len%3==1&&(base64=base64.substring(0,base64.length-2)+"=="),base64},exports.decode=function(base64){var i,encoded1,encoded2,encoded3,encoded4,bufferLength=.75*base64.length,len=base64.length,p=0;"="===base64[base64.length-1]&&(bufferLength--,"="===base64[base64.length-2]&&bufferLength--);var arraybuffer=new ArrayBuffer(bufferLength),bytes=new Uint8Array(arraybuffer);for(i=0;i>4,bytes[p++]=(15&encoded2)<<4|encoded3>>2,bytes[p++]=(3&encoded3)<<6|63&encoded4;return arraybuffer}}()},function(module,exports,__webpack_require__){"use strict";function placeHoldersCount(b64){var len=b64.length;if(len%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===b64[len-2]?2:"="===b64[len-1]?1:0}function byteLength(b64){return 3*b64.length/4-placeHoldersCount(b64)}function toByteArray(b64){var i,l,tmp,placeHolders,arr,len=b64.length;placeHolders=placeHoldersCount(b64),arr=new Arr(3*len/4-placeHolders),l=placeHolders>0?len-4:len;var L=0;for(i=0;i>16&255,arr[L++]=tmp>>8&255,arr[L++]=255&tmp;return 2===placeHolders?(tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4,arr[L++]=255&tmp):1===placeHolders&&(tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2,arr[L++]=tmp>>8&255,arr[L++]=255&tmp),arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[63&num]}function encodeChunk(uint8,start,end){for(var tmp,output=[],i=start;ilen2?len2:i+16383));return 1===extraBytes?(tmp=uint8[len-1],output+=lookup[tmp>>2],output+=lookup[tmp<<4&63],output+="=="):2===extraBytes&&(tmp=(uint8[len-2]<<8)+uint8[len-1],output+=lookup[tmp>>10],output+=lookup[tmp>>4&63],output+=lookup[tmp<<2&63],output+="="),parts.push(output),parts.join("")}exports.byteLength=byteLength,exports.toByteArray=toByteArray,exports.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i72)return!1;if(48!==buffer[0])return!1;if(buffer[1]!==buffer.length-2)return!1;if(2!==buffer[2])return!1;var lenR=buffer[3];if(0===lenR)return!1;if(5+lenR>=buffer.length)return!1;if(2!==buffer[4+lenR])return!1;var lenS=buffer[5+lenR];return 0!==lenS&&(6+lenR+lenS===buffer.length&&(!(128&buffer[4])&&(!(lenR>1&&0===buffer[4]&&!(128&buffer[5]))&&(!(128&buffer[lenR+6])&&!(lenS>1&&0===buffer[lenR+6]&&!(128&buffer[lenR+7]))))))}function decode(buffer){if(buffer.length<8)throw new Error("DER sequence length is too short");if(buffer.length>72)throw new Error("DER sequence length is too long");if(48!==buffer[0])throw new Error("Expected DER sequence");if(buffer[1]!==buffer.length-2)throw new Error("DER sequence length is invalid");if(2!==buffer[2])throw new Error("Expected DER integer");var lenR=buffer[3];if(0===lenR)throw new Error("R length is zero");if(5+lenR>=buffer.length)throw new Error("R length is too long");if(2!==buffer[4+lenR])throw new Error("Expected DER integer (2)");var lenS=buffer[5+lenR];if(0===lenS)throw new Error("S length is zero");if(6+lenR+lenS!==buffer.length)throw new Error("S length is invalid");if(128&buffer[4])throw new Error("R value is negative");if(lenR>1&&0===buffer[4]&&!(128&buffer[5]))throw new Error("R value excessively padded");if(128&buffer[lenR+6])throw new Error("S value is negative");if(lenS>1&&0===buffer[lenR+6]&&!(128&buffer[lenR+7]))throw new Error("S value excessively padded");return{r:buffer.slice(4,4+lenR),s:buffer.slice(6+lenR)}}function encode(r,s){var lenR=r.length,lenS=s.length;if(0===lenR)throw new Error("R length is zero");if(0===lenS)throw new Error("S length is zero");if(lenR>33)throw new Error("R length is too long");if(lenS>33)throw new Error("S length is too long");if(128&r[0])throw new Error("R value is negative");if(128&s[0])throw new Error("S value is negative");if(lenR>1&&0===r[0]&&!(128&r[1]))throw new Error("R value excessively padded");if(lenS>1&&0===s[0]&&!(128&s[1]))throw new Error("S value excessively padded");var signature=Buffer.allocUnsafe(6+lenR+lenS);return signature[0]=48,signature[1]=signature.length-2,signature[2]=2,signature[3]=r.length,r.copy(signature,4),signature[4+lenR]=2,signature[5+lenR]=s.length,s.copy(signature,6+lenR),signature}var Buffer=__webpack_require__(5).Buffer;module.exports={check:check,decode:decode,encode:encode}},function(module,exports,__webpack_require__){function ADD64AA(v,a,b){var o0=v[a]+v[b],o1=v[a+1]+v[b+1];o0>=4294967296&&o1++,v[a]=o0,v[a+1]=o1}function ADD64AC(v,a,b0,b1){var o0=v[a]+b0;b0<0&&(o0+=4294967296);var o1=v[a+1]+b1;o0>=4294967296&&o1++,v[a]=o0,v[a+1]=o1}function B2B_GET32(arr,i){return arr[i]^arr[i+1]<<8^arr[i+2]<<16^arr[i+3]<<24}function B2B_G(a,b,c,d,ix,iy){var x0=m[ix],x1=m[ix+1],y0=m[iy],y1=m[iy+1];ADD64AA(v,a,b),ADD64AC(v,a,x0,x1);var xor0=v[d]^v[a],xor1=v[d+1]^v[a+1];v[d]=xor1,v[d+1]=xor0,ADD64AA(v,c,d),xor0=v[b]^v[c],xor1=v[b+1]^v[c+1],v[b]=xor0>>>24^xor1<<8,v[b+1]=xor1>>>24^xor0<<8,ADD64AA(v,a,b),ADD64AC(v,a,y0,y1),xor0=v[d]^v[a],xor1=v[d+1]^v[a+1],v[d]=xor0>>>16^xor1<<16,v[d+1]=xor1>>>16^xor0<<16,ADD64AA(v,c,d),xor0=v[b]^v[c],xor1=v[b+1]^v[c+1],v[b]=xor1>>>31^xor0<<1,v[b+1]=xor0>>>31^xor1<<1}function blake2bCompress(ctx,last){var i=0;for(i=0;i<16;i++)v[i]=ctx.h[i],v[i+16]=BLAKE2B_IV32[i];for(v[24]=v[24]^ctx.t,v[25]=v[25]^ctx.t/4294967296,last&&(v[28]=~v[28],v[29]=~v[29]),i=0;i<32;i++)m[i]=B2B_GET32(ctx.b,4*i);for(i=0;i<12;i++)B2B_G(0,8,16,24,SIGMA82[16*i+0],SIGMA82[16*i+1]),B2B_G(2,10,18,26,SIGMA82[16*i+2],SIGMA82[16*i+3]),B2B_G(4,12,20,28,SIGMA82[16*i+4],SIGMA82[16*i+5]),B2B_G(6,14,22,30,SIGMA82[16*i+6],SIGMA82[16*i+7]),B2B_G(0,10,20,30,SIGMA82[16*i+8],SIGMA82[16*i+9]),B2B_G(2,12,22,24,SIGMA82[16*i+10],SIGMA82[16*i+11]),B2B_G(4,14,16,26,SIGMA82[16*i+12],SIGMA82[16*i+13]),B2B_G(6,8,18,28,SIGMA82[16*i+14],SIGMA82[16*i+15]);for(i=0;i<16;i++)ctx.h[i]=ctx.h[i]^v[i]^v[i+16]}function blake2bInit(outlen,key){if(0===outlen||outlen>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(key&&key.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");for(var ctx={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:outlen},i=0;i<16;i++)ctx.h[i]=BLAKE2B_IV32[i];var keylen=key?key.length:0;return ctx.h[0]^=16842752^keylen<<8^outlen,key&&(blake2bUpdate(ctx,key),ctx.c=128),ctx}function blake2bUpdate(ctx,input){for(var i=0;i>2]>>8*(3&i);return out}function blake2b(input,key,outlen){outlen=outlen||64,input=util.normalizeInput(input);var ctx=blake2bInit(outlen,key);return blake2bUpdate(ctx,input),blake2bFinal(ctx)}function blake2bHex(input,key,outlen){var output=blake2b(input,key,outlen);return util.toHex(output)}var util=__webpack_require__(166),BLAKE2B_IV32=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),SIGMA8=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],SIGMA82=new Uint8Array(SIGMA8.map(function(x){return 2*x})),v=new Uint32Array(32),m=new Uint32Array(32);module.exports={blake2b:blake2b,blake2bHex:blake2bHex,blake2bInit:blake2bInit,blake2bUpdate:blake2bUpdate,blake2bFinal:blake2bFinal}},function(module,exports,__webpack_require__){function B2S_GET32(v,i){return v[i]^v[i+1]<<8^v[i+2]<<16^v[i+3]<<24}function B2S_G(a,b,c,d,x,y){v[a]=v[a]+v[b]+x,v[d]=ROTR32(v[d]^v[a],16),v[c]=v[c]+v[d],v[b]=ROTR32(v[b]^v[c],12),v[a]=v[a]+v[b]+y,v[d]=ROTR32(v[d]^v[a],8),v[c]=v[c]+v[d],v[b]=ROTR32(v[b]^v[c],7)}function ROTR32(x,y){return x>>>y^x<<32-y}function blake2sCompress(ctx,last){var i=0;for(i=0;i<8;i++)v[i]=ctx.h[i],v[i+8]=BLAKE2S_IV[i];for(v[12]^=ctx.t,v[13]^=ctx.t/4294967296,last&&(v[14]=~v[14]),i=0;i<16;i++)m[i]=B2S_GET32(ctx.b,4*i);for(i=0;i<10;i++)B2S_G(0,4,8,12,m[SIGMA[16*i+0]],m[SIGMA[16*i+1]]),B2S_G(1,5,9,13,m[SIGMA[16*i+2]],m[SIGMA[16*i+3]]),B2S_G(2,6,10,14,m[SIGMA[16*i+4]],m[SIGMA[16*i+5]]),B2S_G(3,7,11,15,m[SIGMA[16*i+6]],m[SIGMA[16*i+7]]),B2S_G(0,5,10,15,m[SIGMA[16*i+8]],m[SIGMA[16*i+9]]),B2S_G(1,6,11,12,m[SIGMA[16*i+10]],m[SIGMA[16*i+11]]),B2S_G(2,7,8,13,m[SIGMA[16*i+12]],m[SIGMA[16*i+13]]),B2S_G(3,4,9,14,m[SIGMA[16*i+14]],m[SIGMA[16*i+15]]);for(i=0;i<8;i++)ctx.h[i]^=v[i]^v[i+8]}function blake2sInit(outlen,key){if(!(outlen>0&&outlen<=32))throw new Error("Incorrect output length, should be in [1, 32]");var keylen=key?key.length:0;if(key&&!(keylen>0&&keylen<=32))throw new Error("Incorrect key length, should be in [1, 32]");var ctx={h:new Uint32Array(BLAKE2S_IV),b:new Uint32Array(64),c:0,t:0,outlen:outlen};return ctx.h[0]^=16842752^keylen<<8^outlen,keylen>0&&(blake2sUpdate(ctx,key),ctx.c=64),ctx}function blake2sUpdate(ctx,input){for(var i=0;i>2]>>8*(3&i)&255;return out}function blake2s(input,key,outlen){outlen=outlen||32,input=util.normalizeInput(input);var ctx=blake2sInit(outlen,key);return blake2sUpdate(ctx,input),blake2sFinal(ctx)}function blake2sHex(input,key,outlen){var output=blake2s(input,key,outlen);return util.toHex(output)}var util=__webpack_require__(166),BLAKE2S_IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SIGMA=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),v=new Uint32Array(16),m=new Uint32Array(16);module.exports={blake2s:blake2s,blake2sHex:blake2sHex,blake2sInit:blake2sInit,blake2sUpdate:blake2sUpdate,blake2sFinal:blake2sFinal}},function(module,exports,__webpack_require__){var b2b=__webpack_require__(314),b2s=__webpack_require__(315);module.exports={blake2b:b2b.blake2b,blake2bHex:b2b.blake2bHex,blake2bInit:b2b.blake2bInit,blake2bUpdate:b2b.blake2bUpdate,blake2bFinal:b2b.blake2bFinal,blake2s:b2s.blake2s,blake2sHex:b2s.blake2sHex,blake2sInit:b2s.blake2sInit,blake2sUpdate:b2s.blake2sUpdate,blake2sFinal:b2s.blake2sFinal}},function(module,exports,__webpack_require__){(function(global){function mapArrayBufferViews(ary){for(var i=0;i0){break}}return code|0}function checkOffset(n){n=n|0;if(((offset|0)+(n|0)|0)<(inputLength|0)){return 0}return 1}function readUInt16(n){n=n|0;return heap[n|0]<<8|heap[n+1|0]|0}function INT_P(octet){octet=octet|0;pushInt(octet|0);offset=offset+1|0;return 0}function UINT_P_8(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushInt(heap[offset+1|0]|0);offset=offset+2|0;return 0}function UINT_P_16(octet){octet=octet|0;if(checkOffset(2)|0){return 1}pushInt(readUInt16(offset+1|0)|0);offset=offset+3|0;return 0}function UINT_P_32(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushInt32(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function UINT_P_64(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushInt64(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function INT_N(octet){octet=octet|0;pushInt(-1-(octet-32|0)|0);offset=offset+1|0;return 0}function UINT_N_8(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushInt(-1-(heap[offset+1|0]|0)|0);offset=offset+2|0;return 0}function UINT_N_16(octet){octet=octet|0;var val=0;if(checkOffset(2)|0){return 1}val=readUInt16(offset+1|0)|0;pushInt(-1-(val|0)|0);offset=offset+3|0;return 0}function UINT_N_32(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushInt32Neg(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function UINT_N_64(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushInt64Neg(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function BYTE_STRING(octet){octet=octet|0;var start=0;var end=0;var step=0;step=octet-64|0;if(checkOffset(step|0)|0){return 1}start=offset+1|0;end=(offset+1|0)+(step|0)|0;pushByteString(start|0,end|0);offset=end|0;return 0}function BYTE_STRING_8(octet){octet=octet|0;var start=0;var end=0;var length=0;if(checkOffset(1)|0){return 1}length=heap[offset+1|0]|0;start=offset+2|0;end=(offset+2|0)+(length|0)|0;if(checkOffset(length+1|0)|0){return 1}pushByteString(start|0,end|0);offset=end|0;return 0}function BYTE_STRING_16(octet){octet=octet|0;var start=0;var end=0;var length=0;if(checkOffset(2)|0){return 1}length=readUInt16(offset+1|0)|0;start=offset+3|0;end=(offset+3|0)+(length|0)|0;if(checkOffset(length+2|0)|0){return 1}pushByteString(start|0,end|0);offset=end|0;return 0}function BYTE_STRING_32(octet){octet=octet|0;return 1}function BYTE_STRING_64(octet){octet=octet|0;return 1}function BYTE_STRING_BREAK(octet){octet=octet|0;pushByteStringStart();offset=offset+1|0;return 0}function UTF8_STRING(octet){octet=octet|0;var start=0;var end=0;var step=0;step=octet-96|0;if(checkOffset(step|0)|0){return 1}start=offset+1|0;end=(offset+1|0)+(step|0)|0;pushUtf8String(start|0,end|0);offset=end|0;return 0}function UTF8_STRING_8(octet){octet=octet|0;var start=0;var end=0;var length=0;if(checkOffset(1)|0){return 1}length=heap[offset+1|0]|0;start=offset+2|0;end=(offset+2|0)+(length|0)|0;if(checkOffset(length+1|0)|0){return 1}pushUtf8String(start|0,end|0);offset=end|0;return 0}function UTF8_STRING_16(octet){octet=octet|0;var start=0;var end=0;var length=0;if(checkOffset(2)|0){return 1}length=readUInt16(offset+1|0)|0;start=offset+3|0;end=(offset+3|0)+(length|0)|0;if(checkOffset(length+2|0)|0){return 1}pushUtf8String(start|0,end|0);offset=end|0;return 0}function UTF8_STRING_32(octet){octet=octet|0;return 1}function UTF8_STRING_64(octet){octet=octet|0;return 1}function UTF8_STRING_BREAK(octet){octet=octet|0;pushUtf8StringStart();offset=offset+1|0;return 0}function ARRAY(octet){octet=octet|0;pushArrayStartFixed(octet-128|0);offset=offset+1|0;return 0}function ARRAY_8(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushArrayStartFixed(heap[offset+1|0]|0);offset=offset+2|0;return 0}function ARRAY_16(octet){octet=octet|0;if(checkOffset(2)|0){return 1}pushArrayStartFixed(readUInt16(offset+1|0)|0);offset=offset+3|0;return 1}function ARRAY_32(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushArrayStartFixed32(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function ARRAY_64(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushArrayStartFixed64(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function ARRAY_BREAK(octet){octet=octet|0;pushArrayStart();offset=offset+1|0;return 0}function MAP(octet){octet=octet|0;var step=0;step=octet-160|0;if(checkOffset(step|0)|0){return 1}pushObjectStartFixed(step|0);offset=offset+1|0;return 0}function MAP_8(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushObjectStartFixed(heap[offset+1|0]|0);offset=offset+2|0;return 0}function MAP_16(octet){octet=octet|0;if(checkOffset(2)|0){return 1}pushObjectStartFixed(readUInt16(offset+1|0)|0);offset=offset+3|0;return 0}function MAP_32(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushObjectStartFixed32(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function MAP_64(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushObjectStartFixed64(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function MAP_BREAK(octet){octet=octet|0;pushObjectStart();offset=offset+1|0;return 0}function TAG_KNOWN(octet){octet=octet|0;pushTagStart(octet-192|0|0);offset=offset+1|0;return 0}function TAG_BIGNUM_POS(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_BIGNUM_NEG(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_FRAC(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_BIGNUM_FLOAT(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_UNASSIGNED(octet){octet=octet|0;pushTagStart(octet-192|0|0);offset=offset+1|0;return 0}function TAG_BASE64_URL(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_BASE64(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_BASE16(octet){octet=octet|0;pushTagStart(octet|0);offset=offset+1|0;return 0}function TAG_MORE_1(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushTagStart(heap[offset+1|0]|0);offset=offset+2|0;return 0}function TAG_MORE_2(octet){octet=octet|0;if(checkOffset(2)|0){return 1}pushTagStart(readUInt16(offset+1|0)|0);offset=offset+3|0;return 0}function TAG_MORE_4(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushTagStart4(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0);offset=offset+5|0;return 0}function TAG_MORE_8(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushTagStart8(readUInt16(offset+1|0)|0,readUInt16(offset+3|0)|0,readUInt16(offset+5|0)|0,readUInt16(offset+7|0)|0);offset=offset+9|0;return 0}function SIMPLE_UNASSIGNED(octet){octet=octet|0;pushSimpleUnassigned((octet|0)-224|0);offset=offset+1|0;return 0}function SIMPLE_FALSE(octet){octet=octet|0;pushFalse();offset=offset+1|0;return 0}function SIMPLE_TRUE(octet){octet=octet|0;pushTrue();offset=offset+1|0;return 0}function SIMPLE_NULL(octet){octet=octet|0;pushNull();offset=offset+1|0;return 0}function SIMPLE_UNDEFINED(octet){octet=octet|0;pushUndefined();offset=offset+1|0;return 0}function SIMPLE_BYTE(octet){octet=octet|0;if(checkOffset(1)|0){return 1}pushSimpleUnassigned(heap[offset+1|0]|0);offset=offset+2|0;return 0}function SIMPLE_FLOAT_HALF(octet){octet=octet|0;var f=0;var g=0;var sign=1;var exp=0;var mant=0;var r=0;if(checkOffset(2)|0){return 1}f=heap[offset+1|0]|0;g=heap[offset+2|0]|0;if((f|0)&128){sign=-1}exp=+(((f|0)&124)>>2);mant=+(((f|0)&3)<<8|g);if(+exp==0){pushFloat(+(+sign*+5.960464477539063e-8*+mant))}else if(+exp==31){if(+sign==1){if(+mant>0){pushNaN()}else{pushInfinity()}}else{if(+mant>0){pushNaNNeg()}else{pushInfinityNeg()}}}else{pushFloat(+(+sign*pow(+2,+(+exp-25))*+(1024+mant)))}offset=offset+3|0;return 0}function SIMPLE_FLOAT_SINGLE(octet){octet=octet|0;if(checkOffset(4)|0){return 1}pushFloatSingle(heap[offset+1|0]|0,heap[offset+2|0]|0,heap[offset+3|0]|0,heap[offset+4|0]|0);offset=offset+5|0;return 0}function SIMPLE_FLOAT_DOUBLE(octet){octet=octet|0;if(checkOffset(8)|0){return 1}pushFloatDouble(heap[offset+1|0]|0,heap[offset+2|0]|0,heap[offset+3|0]|0,heap[offset+4|0]|0,heap[offset+5|0]|0,heap[offset+6|0]|0,heap[offset+7|0]|0,heap[offset+8|0]|0);offset=offset+9|0;return 0}function ERROR(octet){octet=octet|0;return 1}function BREAK(octet){octet=octet|0;pushBreak();offset=offset+1|0;return 0} +var jumpTable=[INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,INT_P,UINT_P_8,UINT_P_16,UINT_P_32,UINT_P_64,ERROR,ERROR,ERROR,ERROR,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,INT_N,UINT_N_8,UINT_N_16,UINT_N_32,UINT_N_64,ERROR,ERROR,ERROR,ERROR,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING,BYTE_STRING_8,BYTE_STRING_16,BYTE_STRING_32,BYTE_STRING_64,ERROR,ERROR,ERROR,BYTE_STRING_BREAK,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING,UTF8_STRING_8,UTF8_STRING_16,UTF8_STRING_32,UTF8_STRING_64,ERROR,ERROR,ERROR,UTF8_STRING_BREAK,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY,ARRAY_8,ARRAY_16,ARRAY_32,ARRAY_64,ERROR,ERROR,ERROR,ARRAY_BREAK,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP_8,MAP_16,MAP_32,MAP_64,ERROR,ERROR,ERROR,MAP_BREAK,TAG_KNOWN,TAG_KNOWN,TAG_KNOWN,TAG_KNOWN,TAG_KNOWN,TAG_KNOWN,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_UNASSIGNED,TAG_MORE_1,TAG_MORE_2,TAG_MORE_4,TAG_MORE_8,ERROR,ERROR,ERROR,ERROR,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_UNASSIGNED,SIMPLE_FALSE,SIMPLE_TRUE,SIMPLE_NULL,SIMPLE_UNDEFINED,SIMPLE_BYTE,SIMPLE_FLOAT_HALF,SIMPLE_FLOAT_SINGLE,SIMPLE_FLOAT_DOUBLE,ERROR,ERROR,ERROR,BREAK];return{parse:parse}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function collectObject(val){return(acc,key)=>{return acc?`${acc}, ${key}: ${val[key]}`:`${key}: ${val[key]}`}}const Decoder=__webpack_require__(167),utils=__webpack_require__(112);class Diagnose extends Decoder{createTag(tagNumber,value){return`${tagNumber}(${value})`}createInt(val){return super.createInt(val).toString()}createInt32(f,g){return super.createInt32(f,g).toString()}createInt64(f1,f2,g1,g2){return super.createInt64(f1,f2,g1,g2).toString()}createInt32Neg(f,g){return super.createInt32Neg(f,g).toString()}createInt64Neg(f1,f2,g1,g2){return super.createInt64Neg(f1,f2,g1,g2).toString()}createTrue(){return"true"}createFalse(){return"false"}createFloat(val){const fl=super.createFloat(val);return utils.isNegativeZero(val)?"-0_1":`${fl}_1`}createFloatSingle(a,b,c,d){return`${super.createFloatSingle(a,b,c,d)}_2`}createFloatDouble(a,b,c,d,e,f,g,h){return`${super.createFloatDouble(a,b,c,d,e,f,g,h)}_3`}createByteString(raw,len){const val=raw.join(", ");return len===-1?`(_ ${val})`:`h'${val}`}createByteStringFromHeap(start,end){return`h'${new Buffer(super.createByteStringFromHeap(start,end)).toString("hex")}'`}createInfinity(){return"Infinity_1"}createInfinityNeg(){return"-Infinity_1"}createNaN(){return"NaN_1"}createNaNNeg(){return"-NaN_1"}createNull(){return"null"}createUndefined(){return"undefined"}createSimpleUnassigned(val){return`simple(${val})`}createArray(arr,len){const val=super.createArray(arr,len);return len===-1?`[_ ${val.join(", ")}]`:`[${val.join(", ")}]`}createMap(map,len){const val=super.createMap(map),list=Array.from(val.keys()).reduce(collectObject(val),"");return len===-1?`{_ ${list}}`:`{${list}}`}createObject(obj,len){const val=super.createObject(obj),map=Object.keys(val).reduce(collectObject(val),"");return len===-1?`{_ ${map}}`:`{${map}}`}createUtf8String(raw,len){const val=raw.join(", ");return len===-1?`(_ ${val})`:`"${val}"`}createUtf8StringFromHeap(start,end){return`"${new Buffer(super.createUtf8StringFromHeap(start,end)).toString("utf8")}"`}static diagnose(input,enc){return"string"==typeof input&&(input=new Buffer(input,enc||"hex")),(new Diagnose).decodeFirst(input)}}module.exports=Diagnose}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function toType(obj){return{}.toString.call(obj).slice(8,-1)}const url=__webpack_require__(152),Bignumber=__webpack_require__(77),utils=__webpack_require__(112),constants=__webpack_require__(78),MT=constants.MT,NUMBYTES=constants.NUMBYTES,SHIFT32=constants.SHIFT32,SYMS=constants.SYMS,TAG=constants.TAG,HALF=constants.MT.SIMPLE_FLOAT<<5|constants.NUMBYTES.TWO,FLOAT=constants.MT.SIMPLE_FLOAT<<5|constants.NUMBYTES.FOUR,DOUBLE=constants.MT.SIMPLE_FLOAT<<5|constants.NUMBYTES.EIGHT,TRUE=constants.MT.SIMPLE_FLOAT<<5|constants.SIMPLE.TRUE,FALSE=constants.MT.SIMPLE_FLOAT<<5|constants.SIMPLE.FALSE,UNDEFINED=constants.MT.SIMPLE_FLOAT<<5|constants.SIMPLE.UNDEFINED,NULL=constants.MT.SIMPLE_FLOAT<<5|constants.SIMPLE.NULL,MAXINT_BN=new Bignumber("0x20000000000000"),BUF_NAN=new Buffer("f97e00","hex"),BUF_INF_NEG=new Buffer("f9fc00","hex"),BUF_INF_POS=new Buffer("f97c00","hex");class Encoder{constructor(options){options=options||{},this.streaming="function"==typeof options.stream,this.onData=options.stream,this.semanticTypes=[[url.Url,this._pushUrl],[Bignumber,this._pushBigNumber]];const addTypes=options.genTypes||[],len=addTypes.length;for(let i=0;i[k,obj[k]]))}_pushRawMap(len,map){map=map.map(function(a){return a[0]=Encoder.encode(a[0]),a}).sort(utils.keySorter);for(var j=0;j16)return out=this.cache.slice(0,16),this.cache=this.cache.slice(16),out}else if(this.cache.length>=16)return out=this.cache.slice(0,16),this.cache=this.cache.slice(16),out;return null},Splitter.prototype.flush=function(){if(this.cache.length)return this.cache};var modelist={ECB:__webpack_require__(175),CBC:__webpack_require__(171),CFB:__webpack_require__(172),CFB8:__webpack_require__(174),CFB1:__webpack_require__(173),OFB:__webpack_require__(176),CTR:__webpack_require__(80),GCM:__webpack_require__(80)};exports.createDecipher=createDecipher,exports.createDecipheriv=createDecipheriv}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Cipher(mode,key,iv){if(!(this instanceof Cipher))return new Cipher(mode,key,iv);Transform.call(this),this._cache=new Splitter,this._cipher=new aes.AES(key),this._prev=new Buffer(iv.length),iv.copy(this._prev),this._mode=mode,this._autopadding=!0}function Splitter(){if(!(this instanceof Splitter))return new Splitter;this.cache=new Buffer("")}function createCipheriv(suite,password,iv){var config=modes[suite.toLowerCase()];if(!config)throw new TypeError("invalid suite type");if("string"==typeof iv&&(iv=new Buffer(iv)),"string"==typeof password&&(password=new Buffer(password)),password.length!==config.key/8)throw new TypeError("invalid key length "+password.length);if(iv.length!==config.iv)throw new TypeError("invalid iv length "+iv.length);return"stream"===config.type?new StreamCipher(modelist[config.mode],password,iv):"auth"===config.type?new AuthCipher(modelist[config.mode],password,iv):new Cipher(modelist[config.mode],password,iv)}function createCipher(suite,password){var config=modes[suite.toLowerCase()];if(!config)throw new TypeError("invalid suite type");var keys=ebtk(password,!1,config.key,config.iv);return createCipheriv(suite,keys.key,keys.iv)}var aes=__webpack_require__(79),Transform=__webpack_require__(41),inherits=__webpack_require__(2),modes=__webpack_require__(113),ebtk=__webpack_require__(192),StreamCipher=__webpack_require__(177),AuthCipher=__webpack_require__(170);inherits(Cipher,Transform),Cipher.prototype._update=function(data){this._cache.add(data);for(var chunk,thing,out=[];chunk=this._cache.get();)thing=this._mode.encrypt(this,chunk),out.push(thing);return Buffer.concat(out)},Cipher.prototype._final=function(){var chunk=this._cache.flush();if(this._autopadding)return chunk=this._mode.encrypt(this,chunk),this._cipher.scrub(),chunk;if("10101010101010101010101010101010"!==chunk.toString("hex"))throw this._cipher.scrub(),new Error("data not multiple of block length")},Cipher.prototype.setAutoPadding=function(setTo){return this._autopadding=!!setTo,this},Splitter.prototype.add=function(data){this.cache=Buffer.concat([this.cache,data])},Splitter.prototype.get=function(){if(this.cache.length>15){var out=this.cache.slice(0,16);return this.cache=this.cache.slice(16),out}return null},Splitter.prototype.flush=function(){for(var len=16-this.cache.length,padBuff=new Buffer(len),i=-1;++iuint_max||x<0?(x_pos=Math.abs(x)%uint_max,x<0?uint_max-x_pos:x_pos):x}function xor(a,b){return[a[0]^b[0],a[1]^b[1],a[2]^b[2],a[3]^b[3]]}var zeros=new Buffer(16);zeros.fill(0),module.exports=GHASH,GHASH.prototype.ghash=function(block){for(var i=-1;++i0;j--)Vi[j]=Vi[j]>>>1|(1&Vi[j-1])<<31;Vi[0]=Vi[0]>>>1,lsb_Vi&&(Vi[0]=Vi[0]^225<<24)}this.state=fromArray(Zi)},GHASH.prototype.update=function(buf){this.cache=Buffer.concat([this.cache,buf]);for(var chunk;this.cache.length>=16;)chunk=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(chunk)},GHASH.prototype.final=function(abl,bl){return this.cache.length&&this.ghash(Buffer.concat([this.cache,zeros],16)),this.ghash(fromArray([0,abl,0,bl])),this.state};var uint_max=Math.pow(2,32)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){const Sha3=__webpack_require__(328),hashLengths=[224,256,384,512];var hash=function(bitcount){if(void 0!==bitcount&&hashLengths.indexOf(bitcount)==-1)throw new Error("Unsupported hash length");this.content=[],this.bitcount=bitcount?"keccak_"+bitcount:"keccak_512"};hash.prototype.update=function(i){if(Buffer.isBuffer(i))this.content.push(i);else{if("string"!=typeof i)throw new Error("Unsupported argument to update");this.content.push(new Buffer(i))}return this},hash.prototype.digest=function(encoding){var result=Sha3[this.bitcount](Buffer.concat(this.content));if("hex"===encoding)return result;if("binary"===encoding||void 0===encoding)return new Buffer(result,"hex").toString("binary");throw new Error("Unsupported encoding for digest: "+encoding)},module.exports={SHA3Hash:hash}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(global){!function(root,undefined){"use strict";var NODE_JS=void 0!==module;NODE_JS&&(root=global,root.JS_SHA3_TEST&&(root.navigator={userAgent:"Chrome"}));var CHROME=(root.JS_SHA3_TEST||!NODE_JS)&&navigator.userAgent.indexOf("Chrome")!=-1,HEX_CHARS="0123456789abcdef".split(""),KECCAK_PADDING=[1,256,65536,16777216],PADDING=[6,1536,393216,100663296],SHIFT=[0,8,16,24],RC=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],blocks=[],s=[],keccak_224=function(message){return keccak(message,224,KECCAK_PADDING)},keccak_256=function(message){return keccak(message,256,KECCAK_PADDING)},keccak_384=function(message){return keccak(message,384,KECCAK_PADDING)},sha3_224=function(message){return keccak(message,224,PADDING)},sha3_256=function(message){return keccak(message,256,PADDING)},sha3_384=function(message){return keccak(message,384,PADDING)},sha3_512=function(message){return keccak(message,512,PADDING)},keccak=function(message,bits,padding){var notString="string"!=typeof message;notString&&message.constructor==root.ArrayBuffer&&(message=new Uint8Array(message)),void 0===bits&&(bits=512,padding=KECCAK_PADDING);var block,code,n,i,h,l,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49,end=!1,index=0,start=0,length=message.length,blockCount=(1600-2*bits)/32,byteCount=4*blockCount;for(i=0;i<50;++i)s[i]=0;block=0;do{for(blocks[0]=block,i=1;i>2]|=message[index]<>2]|=code<>2]|=(192|code>>6)<>2]|=(128|63&code)<=57344?(blocks[i>>2]|=(224|code>>12)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<>2]|=(240|code>>18)<>2]|=(128|code>>12&63)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<>2]|=padding[3&i],++index),block=blocks[blockCount],index>length&&i>>31),l=c9^(c3<<1|c2>>>31),s[0]^=h,s[1]^=l,s[10]^=h,s[11]^=l,s[20]^=h,s[21]^=l,s[30]^=h,s[31]^=l,s[40]^=h,s[41]^=l,h=c0^(c4<<1|c5>>>31),l=c1^(c5<<1|c4>>>31),s[2]^=h,s[3]^=l,s[12]^=h,s[13]^=l,s[22]^=h,s[23]^=l,s[32]^=h,s[33]^=l,s[42]^=h,s[43]^=l,h=c2^(c6<<1|c7>>>31),l=c3^(c7<<1|c6>>>31),s[4]^=h,s[5]^=l,s[14]^=h,s[15]^=l,s[24]^=h,s[25]^=l,s[34]^=h,s[35]^=l,s[44]^=h,s[45]^=l,h=c4^(c8<<1|c9>>>31),l=c5^(c9<<1|c8>>>31),s[6]^=h,s[7]^=l,s[16]^=h,s[17]^=l,s[26]^=h,s[27]^=l,s[36]^=h,s[37]^=l,s[46]^=h,s[47]^=l,h=c6^(c0<<1|c1>>>31),l=c7^(c1<<1|c0>>>31),s[8]^=h,s[9]^=l,s[18]^=h,s[19]^=l,s[28]^=h,s[29]^=l,s[38]^=h,s[39]^=l,s[48]^=h,s[49]^=l,b0=s[0],b1=s[1],b32=s[11]<<4|s[10]>>>28,b33=s[10]<<4|s[11]>>>28,b14=s[20]<<3|s[21]>>>29,b15=s[21]<<3|s[20]>>>29,b46=s[31]<<9|s[30]>>>23,b47=s[30]<<9|s[31]>>>23,b28=s[40]<<18|s[41]>>>14,b29=s[41]<<18|s[40]>>>14,b20=s[2]<<1|s[3]>>>31,b21=s[3]<<1|s[2]>>>31,b2=s[13]<<12|s[12]>>>20,b3=s[12]<<12|s[13]>>>20,b34=s[22]<<10|s[23]>>>22,b35=s[23]<<10|s[22]>>>22,b16=s[33]<<13|s[32]>>>19,b17=s[32]<<13|s[33]>>>19,b48=s[42]<<2|s[43]>>>30,b49=s[43]<<2|s[42]>>>30,b40=s[5]<<30|s[4]>>>2,b41=s[4]<<30|s[5]>>>2,b22=s[14]<<6|s[15]>>>26,b23=s[15]<<6|s[14]>>>26,b4=s[25]<<11|s[24]>>>21,b5=s[24]<<11|s[25]>>>21,b36=s[34]<<15|s[35]>>>17,b37=s[35]<<15|s[34]>>>17,b18=s[45]<<29|s[44]>>>3,b19=s[44]<<29|s[45]>>>3,b10=s[6]<<28|s[7]>>>4,b11=s[7]<<28|s[6]>>>4,b42=s[17]<<23|s[16]>>>9,b43=s[16]<<23|s[17]>>>9,b24=s[26]<<25|s[27]>>>7,b25=s[27]<<25|s[26]>>>7,b6=s[36]<<21|s[37]>>>11,b7=s[37]<<21|s[36]>>>11,b38=s[47]<<24|s[46]>>>8,b39=s[46]<<24|s[47]>>>8,b30=s[8]<<27|s[9]>>>5,b31=s[9]<<27|s[8]>>>5,b12=s[18]<<20|s[19]>>>12,b13=s[19]<<20|s[18]>>>12,b44=s[29]<<7|s[28]>>>25,b45=s[28]<<7|s[29]>>>25,b26=s[38]<<8|s[39]>>>24,b27=s[39]<<8|s[38]>>>24,b8=s[48]<<14|s[49]>>>18,b9=s[49]<<14|s[48]>>>18,s[0]=b0^~b2&b4,s[1]=b1^~b3&b5,s[10]=b10^~b12&b14,s[11]=b11^~b13&b15,s[20]=b20^~b22&b24,s[21]=b21^~b23&b25,s[30]=b30^~b32&b34,s[31]=b31^~b33&b35,s[40]=b40^~b42&b44,s[41]=b41^~b43&b45,s[2]=b2^~b4&b6,s[3]=b3^~b5&b7,s[12]=b12^~b14&b16,s[13]=b13^~b15&b17,s[22]=b22^~b24&b26,s[23]=b23^~b25&b27,s[32]=b32^~b34&b36,s[33]=b33^~b35&b37,s[42]=b42^~b44&b46,s[43]=b43^~b45&b47,s[4]=b4^~b6&b8,s[5]=b5^~b7&b9,s[14]=b14^~b16&b18,s[15]=b15^~b17&b19,s[24]=b24^~b26&b28,s[25]=b25^~b27&b29,s[34]=b34^~b36&b38,s[35]=b35^~b37&b39,s[44]=b44^~b46&b48,s[45]=b45^~b47&b49,s[6]=b6^~b8&b0,s[7]=b7^~b9&b1,s[16]=b16^~b18&b10,s[17]=b17^~b19&b11,s[26]=b26^~b28&b20,s[27]=b27^~b29&b21,s[36]=b36^~b38&b30,s[37]=b37^~b39&b31,s[46]=b46^~b48&b40,s[47]=b47^~b49&b41,s[8]=b8^~b0&b2,s[9]=b9^~b1&b3,s[18]=b18^~b10&b12,s[19]=b19^~b11&b13,s[28]=b28^~b20&b22,s[29]=b29^~b21&b23,s[38]=b38^~b30&b32,s[39]=b39^~b31&b33,s[48]=b48^~b40&b42,s[49]=b49^~b41&b43,s[0]^=RC[n],s[1]^=RC[n+1]}while(!end);var hex="";if(CHROME)b0=s[0],b1=s[1],b2=s[2],b3=s[3],b4=s[4],b5=s[5],b6=s[6],b7=s[7],b8=s[8],b9=s[9],b10=s[10],b11=s[11],b12=s[12],b13=s[13],b14=s[14],b15=s[15],hex+=HEX_CHARS[b0>>4&15]+HEX_CHARS[15&b0]+HEX_CHARS[b0>>12&15]+HEX_CHARS[b0>>8&15]+HEX_CHARS[b0>>20&15]+HEX_CHARS[b0>>16&15]+HEX_CHARS[b0>>28&15]+HEX_CHARS[b0>>24&15]+HEX_CHARS[b1>>4&15]+HEX_CHARS[15&b1]+HEX_CHARS[b1>>12&15]+HEX_CHARS[b1>>8&15]+HEX_CHARS[b1>>20&15]+HEX_CHARS[b1>>16&15]+HEX_CHARS[b1>>28&15]+HEX_CHARS[b1>>24&15]+HEX_CHARS[b2>>4&15]+HEX_CHARS[15&b2]+HEX_CHARS[b2>>12&15]+HEX_CHARS[b2>>8&15]+HEX_CHARS[b2>>20&15]+HEX_CHARS[b2>>16&15]+HEX_CHARS[b2>>28&15]+HEX_CHARS[b2>>24&15]+HEX_CHARS[b3>>4&15]+HEX_CHARS[15&b3]+HEX_CHARS[b3>>12&15]+HEX_CHARS[b3>>8&15]+HEX_CHARS[b3>>20&15]+HEX_CHARS[b3>>16&15]+HEX_CHARS[b3>>28&15]+HEX_CHARS[b3>>24&15]+HEX_CHARS[b4>>4&15]+HEX_CHARS[15&b4]+HEX_CHARS[b4>>12&15]+HEX_CHARS[b4>>8&15]+HEX_CHARS[b4>>20&15]+HEX_CHARS[b4>>16&15]+HEX_CHARS[b4>>28&15]+HEX_CHARS[b4>>24&15]+HEX_CHARS[b5>>4&15]+HEX_CHARS[15&b5]+HEX_CHARS[b5>>12&15]+HEX_CHARS[b5>>8&15]+HEX_CHARS[b5>>20&15]+HEX_CHARS[b5>>16&15]+HEX_CHARS[b5>>28&15]+HEX_CHARS[b5>>24&15]+HEX_CHARS[b6>>4&15]+HEX_CHARS[15&b6]+HEX_CHARS[b6>>12&15]+HEX_CHARS[b6>>8&15]+HEX_CHARS[b6>>20&15]+HEX_CHARS[b6>>16&15]+HEX_CHARS[b6>>28&15]+HEX_CHARS[b6>>24&15],bits>=256&&(hex+=HEX_CHARS[b7>>4&15]+HEX_CHARS[15&b7]+HEX_CHARS[b7>>12&15]+HEX_CHARS[b7>>8&15]+HEX_CHARS[b7>>20&15]+HEX_CHARS[b7>>16&15]+HEX_CHARS[b7>>28&15]+HEX_CHARS[b7>>24&15]),bits>=384&&(hex+=HEX_CHARS[b8>>4&15]+HEX_CHARS[15&b8]+HEX_CHARS[b8>>12&15]+HEX_CHARS[b8>>8&15]+HEX_CHARS[b8>>20&15]+HEX_CHARS[b8>>16&15]+HEX_CHARS[b8>>28&15]+HEX_CHARS[b8>>24&15]+HEX_CHARS[b9>>4&15]+HEX_CHARS[15&b9]+HEX_CHARS[b9>>12&15]+HEX_CHARS[b9>>8&15]+HEX_CHARS[b9>>20&15]+HEX_CHARS[b9>>16&15]+HEX_CHARS[b9>>28&15]+HEX_CHARS[b9>>24&15]+HEX_CHARS[b10>>4&15]+HEX_CHARS[15&b10]+HEX_CHARS[b10>>12&15]+HEX_CHARS[b10>>8&15]+HEX_CHARS[b10>>20&15]+HEX_CHARS[b10>>16&15]+HEX_CHARS[b10>>28&15]+HEX_CHARS[b10>>24&15]+HEX_CHARS[b11>>4&15]+HEX_CHARS[15&b11]+HEX_CHARS[b11>>12&15]+HEX_CHARS[b11>>8&15]+HEX_CHARS[b11>>20&15]+HEX_CHARS[b11>>16&15]+HEX_CHARS[b11>>28&15]+HEX_CHARS[b11>>24&15]),512==bits&&(hex+=HEX_CHARS[b12>>4&15]+HEX_CHARS[15&b12]+HEX_CHARS[b12>>12&15]+HEX_CHARS[b12>>8&15]+HEX_CHARS[b12>>20&15]+HEX_CHARS[b12>>16&15]+HEX_CHARS[b12>>28&15]+HEX_CHARS[b12>>24&15]+HEX_CHARS[b13>>4&15]+HEX_CHARS[15&b13]+HEX_CHARS[b13>>12&15]+HEX_CHARS[b13>>8&15]+HEX_CHARS[b13>>20&15]+HEX_CHARS[b13>>16&15]+HEX_CHARS[b13>>28&15]+HEX_CHARS[b13>>24&15]+HEX_CHARS[b14>>4&15]+HEX_CHARS[15&b14]+HEX_CHARS[b14>>12&15]+HEX_CHARS[b14>>8&15]+HEX_CHARS[b14>>20&15]+HEX_CHARS[b14>>16&15]+HEX_CHARS[b14>>28&15]+HEX_CHARS[b14>>24&15]+HEX_CHARS[b15>>4&15]+HEX_CHARS[15&b15]+HEX_CHARS[b15>>12&15]+HEX_CHARS[b15>>8&15]+HEX_CHARS[b15>>20&15]+HEX_CHARS[b15>>16&15]+HEX_CHARS[b15>>28&15]+HEX_CHARS[b15>>24&15]);else for(i=0,n=bits/32;i>4&15]+HEX_CHARS[15&h]+HEX_CHARS[h>>12&15]+HEX_CHARS[h>>8&15]+HEX_CHARS[h>>20&15]+HEX_CHARS[h>>16&15]+HEX_CHARS[h>>28&15]+HEX_CHARS[h>>24&15];return hex};!root.JS_SHA3_TEST&&NODE_JS?module.exports={sha3_512:sha3_512,sha3_384:sha3_384,sha3_256:sha3_256,sha3_224:sha3_224,keccak_512:keccak,keccak_384:keccak_384,keccak_256:keccak_256,keccak_224:keccak_224}:root&&(root.sha3_512=sha3_512,root.sha3_384=sha3_384,root.sha3_256=sha3_256,root.sha3_224=sha3_224,root.keccak_512=keccak, +root.keccak_384=keccak_384,root.keccak_256=keccak_256,root.keccak_224=keccak_224)}(this)}).call(exports,__webpack_require__(3))},function(module,exports,__webpack_require__){var Buffer=__webpack_require__(5).Buffer;module.exports=function(ALPHABET){function encode(source){if(0===source.length)return"";for(var digits=[0],i=0;i0;)digits.push(carry%BASE),carry=carry/BASE|0}for(var string="",k=0;0===source[k]&&k=0;--q)string+=ALPHABET[digits[q]];return string}function decodeUnsafe(string){if(0===string.length)return Buffer.allocUnsafe(0);for(var bytes=[0],i=0;i>=8;for(;carry>0;)bytes.push(255&carry),carry>>=8}for(var k=0;string[k]===LEADER&&k>>2),i=0,j=0;iblocksize){key=("rmd160"===alg?new RIPEMD160:sha(alg)).update(key).digest()}else key.lengthblocksize?key=alg(key):key.length{m.datastore.open(cb)},callback)}_lookup(key){for(let mount of this.mounts)if(mount.prefix.toString()===key.toString()||mount.prefix.isAncestorOf(key)){const s=replaceStartWith(key.toString(),mount.prefix.toString());return{datastore:mount.datastore,mountpoint:mount.prefix,rest:new Key(s)}}}put(key,value,callback){const match=this._lookup(key);if(null==match)return void callback(new Error("No datastore mounted for this key"));match.datastore.put(match.rest,value,callback)}get(key,callback){const match=this._lookup(key);if(null==match)return void callback(new Error("No datastore mounted for this key"));match.datastore.get(match.rest,callback)}has(key,callback){const match=this._lookup(key);if(null==match)return void callback(null,!1);match.datastore.has(match.rest,callback)}delete(key,callback){const match=this._lookup(key);if(null==match)return void callback(new Error("No datastore mounted for this key"));match.datastore.delete(match.rest,callback)}close(callback){each(this.mounts,(m,cb)=>{m.datastore.close(cb)},callback)}batch(){const batchMounts={},lookup=key=>{const match=this._lookup(key);if(null==match)throw new Error("No datastore mounted for this key");const m=match.mountpoint.toString();return null==batchMounts[m]&&(batchMounts[m]=match.datastore.batch()),{batch:batchMounts[m],rest:match.rest}};return{put:(key,value)=>{const match=lookup(key);match.batch.put(match.rest,value)},delete:key=>{const match=lookup(key);match.batch.delete(match.rest)},commit:callback=>{each(Object.keys(batchMounts),(p,cb)=>{batchMounts[p].commit(cb)},callback)}}}query(q){const qs=this.mounts.map(m=>{const ks=new Keytransform(m.datastore,{convert:key=>{throw new Error("should never be called")},invert:key=>{return m.prefix.child(key)}});let prefix;return null!=q.prefix&&(prefix=replaceStartWith(q.prefix,m.prefix.toString())),ks.query({prefix:prefix,filters:q.filters,keysOnly:q.keysOnly})});let tasks=[many(qs)];if(null!=q.filters&&(tasks=tasks.concat(q.filters.map(f=>asyncFilter(f)))),null!=q.orders&&(tasks=tasks.concat(q.orders.map(o=>asyncSort(o)))),null!=q.offset){let i=0;tasks.push(pull.filter(()=>i++>=q.offset))}return null!=q.limit&&tasks.push(pull.take(q.limit)),pull.apply(null,tasks)}}module.exports=MountDatastore},function(module,exports,__webpack_require__){"use strict";const Key=__webpack_require__(16).Key,KeytransformDatastore=__webpack_require__(83);class NamespaceDatastore extends KeytransformDatastore{constructor(child,prefix){super(child,{convert(key){return prefix.child(key)},invert(key){if("/"===prefix.toString())return key;if(!prefix.isAncestorOf(key))throw new Error(`Expected prefix: (${prefix.toString()}) in key: ${key.toString()}`);return new Key(key.toString().slice(prefix.toString().length),!1)}}),this.prefix=prefix}query(q){return q.prefix&&"/"!==this.prefix.toString()?super.query(Object.assign({},q,{prefix:this.prefix.child(new Key(q.prefix)).toString()})):super.query(q)}}module.exports=NamespaceDatastore},function(module,exports,__webpack_require__){"use strict";module.exports=`This is a repository of IPLD objects. Each IPLD object is in a single file, named .data. Where is the "base32" encoding of the CID (as specified in https://github.com/multiformats/multibase) without the 'B' prefix. @@ -78,13 +78,13 @@ and will be placed at with 'SC' being the last-to-next two characters and the 'B' at the beginning of the CIDv1 string is the multibase prefix that is not stored in the filename. -`},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const waterfall=__webpack_require__(7),parallel=__webpack_require__(39),pull=__webpack_require__(4),Key=__webpack_require__(16).Key,sh=__webpack_require__(174),KeytransformStore=__webpack_require__(81),shardKey=new Key(sh.SHARDING_FN),shardReadmeKey=new Key(sh.README_FN);class ShardingDatastore{constructor(store,shard){this.child=new KeytransformStore(store,{convert:this._convertKey.bind(this),invert:this._invertKey.bind(this)}),this.shard=shard}open(callback){this.child.open(callback)}_convertKey(key){const s=key.toString();return s===shardKey.toString()||s===shardReadmeKey.toString()?key:new Key(this.shard.fun(s)).child(key)}_invertKey(key){const s=key.toString();return s===shardKey.toString()||s===shardReadmeKey.toString()?key:Key.withNamespaces(key.list().slice(1))}static createOrOpen(store,shard,callback){ShardingDatastore.create(store,shard,err=>{if(err&&"datastore exists"!==err.message)return callback(err);ShardingDatastore.open(store,callback)})}static open(store,callback){waterfall([cb=>sh.readShardFun("/",store,cb),(shard,cb)=>{cb(null,new ShardingDatastore(store,shard))}],callback)}static create(store,shard,callback){store.has(shardKey,(err,exists)=>{if(err)return callback(err);if(!exists){const put="function"==typeof store.putRaw?store.putRaw.bind(store):store.put.bind(store);return parallel([cb=>put(shardKey,new Buffer(shard.toString()+"\n"),cb),cb=>put(shardReadmeKey,new Buffer(sh.readme),cb)],err=>callback(err))}sh.readShardFun("/",store,(err,diskShard)=>{if(err)return callback(err);const a=(diskShard||"").toString(),b=shard.toString();if(a!==b)return callback(new Error(`specified fun ${b} does not match repo shard fun ${a}`));callback(new Error("datastore exists"))})})}put(key,val,callback){this.child.put(key,val,callback)}get(key,callback){this.child.get(key,callback)}has(key,callback){this.child.has(key,callback)}delete(key,callback){this.child.delete(key,callback)}batch(){return this.child.batch()}query(q){const tq={keysOnly:q.keysOnly};return null!=q.prefix&&(tq.prefix=q.prefix),null!=q.filters&&(tq.filters=q.filters.map(f=>(e,cb)=>{f(Object.assign({},e,{key:this._invertKey(e.key)}),cb)})),null!=q.orders&&(tq.orders=q.orders.map(o=>(res,cb)=>{o(res.map(e=>{return Object.assign({},e,{key:this._invertKey(e.key)})}),cb)})),null!=q.offset&&(tq.offset=q.offset+2),null!=q.limit&&(tq.limit=q.limit+2),pull(this.child.query(tq),pull.filter(e=>{return e.key.toString()!==shardKey.toString()&&e.key.toString()!==shardReadmeKey.toString()}))}close(callback){this.child.close(callback)}}module.exports=ShardingDatastore}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const each=__webpack_require__(19),whilst=__webpack_require__(74);class TieredDatastore{constructor(stores){this.stores=stores.slice()}open(callback){each(this.stores,(store,cb)=>{store.open(cb)},callback)}put(key,value,callback){each(this.stores,(store,cb)=>{store.put(key,value,cb)},callback)}get(key,callback){const storeLength=this.stores.length;let done=!1,i=0;whilst(()=>!done&&i{this.stores[i++].get(key,(err,res)=>{if(null==err)return done=!0,cb(null,res);cb()})},callback)}has(key,callback){const storeLength=this.stores.length;let done=!1,i=0;whilst(()=>!done&&i{this.stores[i++].has(key,(err,exists)=>{if(null==err)return done=!0,cb(null,exists);cb()})},callback)}delete(key,callback){each(this.stores,(store,cb)=>{store.delete(key,cb)},callback)}close(callback){each(this.stores,(store,cb)=>{store.close(cb)},callback)}batch(){const batches=this.stores.map(store=>store.batch());return{put:(key,value)=>{batches.forEach(b=>b.put(key,value))},delete:key=>{batches.forEach(b=>b.delete(key))},commit:callback=>{each(batches,(b,cb)=>{b.commit(cb)},callback)}}}query(q){return this.stores[this.stores.length-1].query(q)}}module.exports=TieredDatastore},function(module,exports,__webpack_require__){function selectColor(namespace){var i,hash=0;for(i in namespace)hash=(hash<<5)-hash+namespace.charCodeAt(i),hash|=0;return exports.colors[Math.abs(hash)%exports.colors.length]}function createDebug(namespace){function debug(){if(debug.enabled){var self=debug,curr=+new Date,ms=curr-(prevTime||curr);self.diff=ms,self.prev=prevTime,self.curr=curr,prevTime=curr;for(var args=new Array(arguments.length),i=0;ithis._reseedInterval)throw new Error("Reseed is required");add&&0===add.length&&(add=void 0),add&&this._update(add);for(var temp=new Buffer(0);temp.length0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function BasePoint(curve,type){this.curve=curve,this.type=type,this.precomputed=null}var BN=__webpack_require__(14),elliptic=__webpack_require__(20),utils=elliptic.utils,getNAF=utils.getNAF,getJSF=utils.getJSF,assert=utils.assert;module.exports=BaseCurve,BaseCurve.prototype.point=function(){throw new Error("Not implemented")},BaseCurve.prototype.validate=function(){throw new Error("Not implemented")},BaseCurve.prototype._fixedNafMul=function(p,k){assert(p.precomputed);var doubles=p._getDoubles(),naf=getNAF(k,1),I=(1<=j;k--)nafW=(nafW<<1)+naf[k];repr.push(nafW)}for(var a=this.jpoint(null,null,null),b=this.jpoint(null,null,null),i=I;i>0;i--){for(var j=0;j=0;i--){for(var k=0;i>=0&&0===naf[i];i--)k++;if(i>=0&&k++,acc=acc.dblp(k),i<0)break;var z=naf[i];assert(0!==z),acc="affine"===p.type?z>0?acc.mixedAdd(wnd[z-1>>1]):acc.mixedAdd(wnd[-z-1>>1].neg()):z>0?acc.add(wnd[z-1>>1]):acc.add(wnd[-z-1>>1].neg())}return"affine"===p.type?acc.toP():acc},BaseCurve.prototype._wnafMulAdd=function(defW,points,coeffs,len,jacobianResult){for(var wndWidth=this._wnafT1,wnd=this._wnafT2,naf=this._wnafT3,max=0,i=0;i=1;i-=2){var a=i-1,b=i;if(1===wndWidth[a]&&1===wndWidth[b]){var comb=[points[a],null,null,points[b]];0===points[a].y.cmp(points[b].y)?(comb[1]=points[a].add(points[b]),comb[2]=points[a].toJ().mixedAdd(points[b].neg())):0===points[a].y.cmp(points[b].y.redNeg())?(comb[1]=points[a].toJ().mixedAdd(points[b]),comb[2]=points[a].add(points[b].neg())):(comb[1]=points[a].toJ().mixedAdd(points[b]),comb[2]=points[a].toJ().mixedAdd(points[b].neg()));var index=[-3,-1,-5,-7,0,7,5,1,3],jsf=getJSF(coeffs[a],coeffs[b]);max=Math.max(jsf[0].length,max),naf[a]=new Array(max),naf[b]=new Array(max);for(var j=0;j=0;i--){for(var k=0;i>=0;){for(var zero=!0,j=0;j=0&&k++,acc=acc.dblp(k),i<0)break;for(var j=0;j0?p=wnd[j][z-1>>1]:z<0&&(p=wnd[j][-z-1>>1].neg()),acc="affine"===p.type?acc.mixedAdd(p):acc.add(p))}}for(var i=0;i=Math.ceil((k.bitLength()+1)/doubles.step)},BasePoint.prototype._getDoubles=function(step,power){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var doubles=[this],acc=this,i=0;i":""},Point.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},Point.prototype._extDbl=function(){var a=this.x.redSqr(),b=this.y.redSqr(),c=this.z.redSqr();c=c.redIAdd(c);var d=this.curve._mulA(a),e=this.x.redAdd(this.y).redSqr().redISub(a).redISub(b),g=d.redAdd(b),f=g.redSub(c),h=d.redSub(b),nx=e.redMul(f),ny=g.redMul(h),nt=e.redMul(h),nz=f.redMul(g);return this.curve.point(nx,ny,nz,nt)},Point.prototype._projDbl=function(){var nx,ny,nz,b=this.x.redAdd(this.y).redSqr(),c=this.x.redSqr(),d=this.y.redSqr();if(this.curve.twisted){var e=this.curve._mulA(c),f=e.redAdd(d);if(this.zOne)nx=b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two)),ny=f.redMul(e.redSub(d)),nz=f.redSqr().redSub(f).redSub(f);else{var h=this.z.redSqr(),j=f.redSub(h).redISub(h);nx=b.redSub(c).redISub(d).redMul(j),ny=f.redMul(e.redSub(d)),nz=f.redMul(j)}}else{var e=c.redAdd(d),h=this.curve._mulC(this.c.redMul(this.z)).redSqr(),j=e.redSub(h).redSub(h);nx=this.curve._mulC(b.redISub(e)).redMul(j),ny=this.curve._mulC(e).redMul(c.redISub(d)),nz=e.redMul(j)}return this.curve.point(nx,ny,nz)},Point.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Point.prototype._extAdd=function(p){var a=this.y.redSub(this.x).redMul(p.y.redSub(p.x)),b=this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)),c=this.t.redMul(this.curve.dd).redMul(p.t),d=this.z.redMul(p.z.redAdd(p.z)),e=b.redSub(a),f=d.redSub(c),g=d.redAdd(c),h=b.redAdd(a),nx=e.redMul(f),ny=g.redMul(h),nt=e.redMul(h),nz=f.redMul(g);return this.curve.point(nx,ny,nz,nt)},Point.prototype._projAdd=function(p){var ny,nz,a=this.z.redMul(p.z),b=a.redSqr(),c=this.x.redMul(p.x),d=this.y.redMul(p.y),e=this.curve.d.redMul(c).redMul(d),f=b.redSub(e),g=b.redAdd(e),tmp=this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d),nx=a.redMul(f).redMul(tmp);return this.curve.twisted?(ny=a.redMul(g).redMul(d.redSub(this.curve._mulA(c))),nz=f.redMul(g)):(ny=a.redMul(g).redMul(d.redSub(c)),nz=this.curve._mulC(f).redMul(g)),this.curve.point(nx,ny,nz)},Point.prototype.add=function(p){return this.isInfinity()?p:p.isInfinity()?this:this.curve.extended?this._extAdd(p):this._projAdd(p)},Point.prototype.mul=function(k){return this._hasDoubles(k)?this.curve._fixedNafMul(this,k):this.curve._wnafMul(this,k)},Point.prototype.mulAdd=function(k1,p,k2){return this.curve._wnafMulAdd(1,[this,p],[k1,k2],2,!1)},Point.prototype.jmulAdd=function(k1,p,k2){return this.curve._wnafMulAdd(1,[this,p],[k1,k2],2,!0)},Point.prototype.normalize=function(){if(this.zOne)return this;var zi=this.z.redInvm();return this.x=this.x.redMul(zi),this.y=this.y.redMul(zi),this.t&&(this.t=this.t.redMul(zi)),this.z=this.curve.one,this.zOne=!0,this},Point.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Point.prototype.getY=function(){return this.normalize(),this.y.fromRed()},Point.prototype.eq=function(other){return this===other||0===this.getX().cmp(other.getX())&&0===this.getY().cmp(other.getY())},Point.prototype.eqXToP=function(x){var rx=x.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(rx))return!0;for(var xc=x.clone(),t=this.curve.redN.redMul(this.z);;){if(xc.iadd(this.curve.n),xc.cmp(this.curve.p)>=0)return!1;if(rx.redIAdd(t),0===this.x.cmp(rx))return!0}return!1},Point.prototype.toP=Point.prototype.normalize,Point.prototype.mixedAdd=Point.prototype.add},function(module,exports,__webpack_require__){"use strict";function MontCurve(conf){Base.call(this,"mont",conf),this.a=new BN(conf.a,16).toRed(this.red),this.b=new BN(conf.b,16).toRed(this.red),this.i4=new BN(4).toRed(this.red).redInvm(),this.two=new BN(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function Point(curve,x,z){Base.BasePoint.call(this,curve,"projective"),null===x&&null===z?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new BN(x,16),this.z=new BN(z,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var curve=__webpack_require__(82),BN=__webpack_require__(14),inherits=__webpack_require__(1),Base=curve.base,elliptic=__webpack_require__(20),utils=elliptic.utils;inherits(MontCurve,Base),module.exports=MontCurve,MontCurve.prototype.validate=function(point){var x=point.normalize().x,x2=x.redSqr(),rhs=x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);return 0===rhs.redSqrt().redSqr().cmp(rhs)},inherits(Point,Base.BasePoint),MontCurve.prototype.decodePoint=function(bytes,enc){return this.point(utils.toArray(bytes,enc),1)},MontCurve.prototype.point=function(x,z){return new Point(this,x,z)},MontCurve.prototype.pointFromJSON=function(obj){return Point.fromJSON(this,obj)},Point.prototype.precompute=function(){},Point.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Point.fromJSON=function(curve,obj){return new Point(curve,obj[0],obj[1]||curve.one)},Point.prototype.inspect=function(){return this.isInfinity()?"":""},Point.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Point.prototype.dbl=function(){var a=this.x.redAdd(this.z),aa=a.redSqr(),b=this.x.redSub(this.z),bb=b.redSqr(),c=aa.redSub(bb),nx=aa.redMul(bb),nz=c.redMul(bb.redAdd(this.curve.a24.redMul(c)));return this.curve.point(nx,nz)},Point.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.diffAdd=function(p,diff){var a=this.x.redAdd(this.z),b=this.x.redSub(this.z),c=p.x.redAdd(p.z),d=p.x.redSub(p.z),da=d.redMul(a),cb=c.redMul(b),nx=diff.z.redMul(da.redAdd(cb).redSqr()),nz=diff.x.redMul(da.redISub(cb).redSqr());return this.curve.point(nx,nz)}, -Point.prototype.mul=function(k){for(var t=k.clone(),a=this,b=this.curve.point(null,null),c=this,bits=[];0!==t.cmpn(0);t.iushrn(1))bits.push(t.andln(1));for(var i=bits.length-1;i>=0;i--)0===bits[i]?(a=a.diffAdd(b,c),b=b.dbl()):(b=a.diffAdd(b,c),a=a.dbl());return b},Point.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.eq=function(other){return 0===this.getX().cmp(other.getX())},Point.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(module,exports,__webpack_require__){"use strict";function ShortCurve(conf){Base.call(this,"short",conf),this.a=new BN(conf.a,16).toRed(this.red),this.b=new BN(conf.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(conf),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function Point(curve,x,y,isRed){Base.BasePoint.call(this,curve,"affine"),null===x&&null===y?(this.x=null,this.y=null,this.inf=!0):(this.x=new BN(x,16),this.y=new BN(y,16),isRed&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function JPoint(curve,x,y,z){Base.BasePoint.call(this,curve,"jacobian"),null===x&&null===y&&null===z?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN(0)):(this.x=new BN(x,16),this.y=new BN(y,16),this.z=new BN(z,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}var curve=__webpack_require__(82),elliptic=__webpack_require__(20),BN=__webpack_require__(14),inherits=__webpack_require__(1),Base=curve.base,assert=elliptic.utils.assert;inherits(ShortCurve,Base),module.exports=ShortCurve,ShortCurve.prototype._getEndomorphism=function(conf){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var beta,lambda;if(conf.beta)beta=new BN(conf.beta,16).toRed(this.red);else{var betas=this._getEndoRoots(this.p);beta=betas[0].cmp(betas[1])<0?betas[0]:betas[1],beta=beta.toRed(this.red)}if(conf.lambda)lambda=new BN(conf.lambda,16);else{var lambdas=this._getEndoRoots(this.n);0===this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta))?lambda=lambdas[0]:(lambda=lambdas[1],assert(0===this.g.mul(lambda).x.cmp(this.g.x.redMul(beta))))}var basis;return basis=conf.basis?conf.basis.map(function(vec){return{a:new BN(vec.a,16),b:new BN(vec.b,16)}}):this._getEndoBasis(lambda),{beta:beta,lambda:lambda,basis:basis}}},ShortCurve.prototype._getEndoRoots=function(num){var red=num===this.p?this.red:BN.mont(num),tinv=new BN(2).toRed(red).redInvm(),ntinv=tinv.redNeg(),s=new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);return[ntinv.redAdd(s).fromRed(),ntinv.redSub(s).fromRed()]},ShortCurve.prototype._getEndoBasis=function(lambda){for(var a0,b0,a1,b1,a2,b2,prevR,r,x,aprxSqrt=this.n.ushrn(Math.floor(this.n.bitLength()/2)),u=lambda,v=this.n.clone(),x1=new BN(1),y1=new BN(0),x2=new BN(0),y2=new BN(1),i=0;0!==u.cmpn(0);){var q=v.div(u);r=v.sub(q.mul(u)),x=x2.sub(q.mul(x1));var y=y2.sub(q.mul(y1));if(!a1&&r.cmp(aprxSqrt)<0)a0=prevR.neg(),b0=x1,a1=r.neg(),b1=x;else if(a1&&2==++i)break;prevR=r,v=u,u=r,x2=x1,x1=x,y2=y1,y1=y}a2=r.neg(),b2=x;var len1=a1.sqr().add(b1.sqr());return a2.sqr().add(b2.sqr()).cmp(len1)>=0&&(a2=a0,b2=b0),a1.negative&&(a1=a1.neg(),b1=b1.neg()),a2.negative&&(a2=a2.neg(),b2=b2.neg()),[{a:a1,b:b1},{a:a2,b:b2}]},ShortCurve.prototype._endoSplit=function(k){var basis=this.endo.basis,v1=basis[0],v2=basis[1],c1=v2.b.mul(k).divRound(this.n),c2=v1.b.neg().mul(k).divRound(this.n),p1=c1.mul(v1.a),p2=c2.mul(v2.a),q1=c1.mul(v1.b),q2=c2.mul(v2.b);return{k1:k.sub(p1).sub(p2),k2:q1.add(q2).neg()}},ShortCurve.prototype.pointFromX=function(x,odd){x=new BN(x,16),x.red||(x=x.toRed(this.red));var y2=x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b),y=y2.redSqrt();if(0!==y.redSqr().redSub(y2).cmp(this.zero))throw new Error("invalid point");var isOdd=y.fromRed().isOdd();return(odd&&!isOdd||!odd&&isOdd)&&(y=y.redNeg()),this.point(x,y)},ShortCurve.prototype.validate=function(point){if(point.inf)return!0;var x=point.x,y=point.y,ax=this.a.redMul(x),rhs=x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);return 0===y.redSqr().redISub(rhs).cmpn(0)},ShortCurve.prototype._endoWnafMulAdd=function(points,coeffs,jacobianResult){for(var npoints=this._endoWnafT1,ncoeffs=this._endoWnafT2,i=0;i":""},Point.prototype.isInfinity=function(){return this.inf},Point.prototype.add=function(p){if(this.inf)return p;if(p.inf)return this;if(this.eq(p))return this.dbl();if(this.neg().eq(p))return this.curve.point(null,null);if(0===this.x.cmp(p.x))return this.curve.point(null,null);var c=this.y.redSub(p.y);0!==c.cmpn(0)&&(c=c.redMul(this.x.redSub(p.x).redInvm()));var nx=c.redSqr().redISub(this.x).redISub(p.x),ny=c.redMul(this.x.redSub(nx)).redISub(this.y);return this.curve.point(nx,ny)},Point.prototype.dbl=function(){if(this.inf)return this;var ys1=this.y.redAdd(this.y);if(0===ys1.cmpn(0))return this.curve.point(null,null);var a=this.curve.a,x2=this.x.redSqr(),dyinv=ys1.redInvm(),c=x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv),nx=c.redSqr().redISub(this.x.redAdd(this.x)),ny=c.redMul(this.x.redSub(nx)).redISub(this.y);return this.curve.point(nx,ny)},Point.prototype.getX=function(){return this.x.fromRed()},Point.prototype.getY=function(){return this.y.fromRed()},Point.prototype.mul=function(k){return k=new BN(k,16),this._hasDoubles(k)?this.curve._fixedNafMul(this,k):this.curve.endo?this.curve._endoWnafMulAdd([this],[k]):this.curve._wnafMul(this,k)},Point.prototype.mulAdd=function(k1,p2,k2){var points=[this,p2],coeffs=[k1,k2];return this.curve.endo?this.curve._endoWnafMulAdd(points,coeffs):this.curve._wnafMulAdd(1,points,coeffs,2)},Point.prototype.jmulAdd=function(k1,p2,k2){var points=[this,p2],coeffs=[k1,k2];return this.curve.endo?this.curve._endoWnafMulAdd(points,coeffs,!0):this.curve._wnafMulAdd(1,points,coeffs,2,!0)},Point.prototype.eq=function(p){return this===p||this.inf===p.inf&&(this.inf||0===this.x.cmp(p.x)&&0===this.y.cmp(p.y))},Point.prototype.neg=function(_precompute){if(this.inf)return this;var res=this.curve.point(this.x,this.y.redNeg());if(_precompute&&this.precomputed){var pre=this.precomputed,negate=function(p){return p.neg()};res.precomputed={naf:pre.naf&&{wnd:pre.naf.wnd,points:pre.naf.points.map(negate)},doubles:pre.doubles&&{step:pre.doubles.step,points:pre.doubles.points.map(negate)}}}return res},Point.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},inherits(JPoint,Base.BasePoint),ShortCurve.prototype.jpoint=function(x,y,z){return new JPoint(this,x,y,z)},JPoint.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var zinv=this.z.redInvm(),zinv2=zinv.redSqr(),ax=this.x.redMul(zinv2),ay=this.y.redMul(zinv2).redMul(zinv);return this.curve.point(ax,ay)},JPoint.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},JPoint.prototype.add=function(p){if(this.isInfinity())return p;if(p.isInfinity())return this;var pz2=p.z.redSqr(),z2=this.z.redSqr(),u1=this.x.redMul(pz2),u2=p.x.redMul(z2),s1=this.y.redMul(pz2.redMul(p.z)),s2=p.y.redMul(z2.redMul(this.z)),h=u1.redSub(u2),r=s1.redSub(s2);if(0===h.cmpn(0))return 0!==r.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h2=h.redSqr(),h3=h2.redMul(h),v=u1.redMul(h2),nx=r.redSqr().redIAdd(h3).redISub(v).redISub(v),ny=r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)),nz=this.z.redMul(p.z).redMul(h);return this.curve.jpoint(nx,ny,nz)},JPoint.prototype.mixedAdd=function(p){if(this.isInfinity())return p.toJ();if(p.isInfinity())return this;var z2=this.z.redSqr(),u1=this.x,u2=p.x.redMul(z2),s1=this.y,s2=p.y.redMul(z2).redMul(this.z),h=u1.redSub(u2),r=s1.redSub(s2);if(0===h.cmpn(0))return 0!==r.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h2=h.redSqr(),h3=h2.redMul(h),v=u1.redMul(h2),nx=r.redSqr().redIAdd(h3).redISub(v).redISub(v),ny=r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)),nz=this.z.redMul(h);return this.curve.jpoint(nx,ny,nz)},JPoint.prototype.dblp=function(pow){if(0===pow)return this;if(this.isInfinity())return this;if(!pow)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var r=this,i=0;i=0)return!1;if(rx.redIAdd(t),0===this.x.cmp(rx))return!0}return!1},JPoint.prototype.inspect=function(){return this.isInfinity()?"":""},JPoint.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(module,exports,__webpack_require__){"use strict";function PresetCurve(options){"short"===options.type?this.curve=new elliptic.curve.short(options):"edwards"===options.type?this.curve=new elliptic.curve.edwards(options):this.curve=new elliptic.curve.mont(options),this.g=this.curve.g,this.n=this.curve.n,this.hash=options.hash,assert(this.g.validate(),"Invalid curve"),assert(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function defineCurve(name,options){Object.defineProperty(curves,name,{configurable:!0,enumerable:!0,get:function(){var curve=new PresetCurve(options);return Object.defineProperty(curves,name,{configurable:!0,enumerable:!0,value:curve}),curve}})}var curves=exports,hash=__webpack_require__(113),elliptic=__webpack_require__(20),assert=elliptic.utils.assert;curves.PresetCurve=PresetCurve,defineCurve("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:hash.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),defineCurve("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:hash.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),defineCurve("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:hash.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),defineCurve("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:hash.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),defineCurve("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:hash.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),defineCurve("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hash.sha256,gRed:!1,g:["9"]}),defineCurve("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hash.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var pre;try{pre=__webpack_require__(351)}catch(e){pre=void 0}defineCurve("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:hash.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",pre]})},function(module,exports,__webpack_require__){"use strict";function EC(options){if(!(this instanceof EC))return new EC(options);"string"==typeof options&&(assert(elliptic.curves.hasOwnProperty(options),"Unknown curve "+options),options=elliptic.curves[options]),options instanceof elliptic.curves.PresetCurve&&(options={curve:options}),this.curve=options.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=options.curve.g,this.g.precompute(options.curve.n.bitLength()+1),this.hash=options.hash||options.curve.hash}var BN=__webpack_require__(14),HmacDRBG=__webpack_require__(383),elliptic=__webpack_require__(20),utils=elliptic.utils,assert=utils.assert,KeyPair=__webpack_require__(346),Signature=__webpack_require__(347);module.exports=EC,EC.prototype.keyPair=function(options){return new KeyPair(this,options)},EC.prototype.keyFromPrivate=function(priv,enc){return KeyPair.fromPrivate(this,priv,enc)},EC.prototype.keyFromPublic=function(pub,enc){return KeyPair.fromPublic(this,pub,enc)},EC.prototype.genKeyPair=function(options){options||(options={});for(var drbg=new HmacDRBG({hash:this.hash,pers:options.pers,persEnc:options.persEnc||"utf8",entropy:options.entropy||elliptic.rand(this.hash.hmacStrength),entropyEnc:options.entropy&&options.entropyEnc||"utf8",nonce:this.n.toArray()}),bytes=this.n.byteLength(),ns2=this.n.sub(new BN(2));;){var priv=new BN(drbg.generate(bytes));if(!(priv.cmp(ns2)>0))return priv.iaddn(1),this.keyFromPrivate(priv)}},EC.prototype._truncateToN=function(msg,truncOnly){var delta=8*msg.byteLength()-this.n.bitLength();return delta>0&&(msg=msg.ushrn(delta)),!truncOnly&&msg.cmp(this.n)>=0?msg.sub(this.n):msg},EC.prototype.sign=function(msg,key,enc,options){"object"==typeof enc&&(options=enc,enc=null),options||(options={}),key=this.keyFromPrivate(key,enc),msg=this._truncateToN(new BN(msg,16));for(var bytes=this.n.byteLength(),bkey=key.getPrivate().toArray("be",bytes),nonce=msg.toArray("be",bytes),drbg=new HmacDRBG({hash:this.hash,entropy:bkey,nonce:nonce,pers:options.pers,persEnc:options.persEnc||"utf8"}),ns1=this.n.sub(new BN(1)),iter=0;!0;iter++){var k=options.k?options.k(iter):new BN(drbg.generate(this.n.byteLength()));if(k=this._truncateToN(k,!0),!(k.cmpn(1)<=0||k.cmp(ns1)>=0)){var kp=this.g.mul(k);if(!kp.isInfinity()){var kpX=kp.getX(),r=kpX.umod(this.n);if(0!==r.cmpn(0)){var s=k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));if(s=s.umod(this.n),0!==s.cmpn(0)){var recoveryParam=(kp.getY().isOdd()?1:0)|(0!==kpX.cmp(r)?2:0);return options.canonical&&s.cmp(this.nh)>0&&(s=this.n.sub(s),recoveryParam^=1),new Signature({r:r,s:s,recoveryParam:recoveryParam})}}}}}},EC.prototype.verify=function(msg,signature,key,enc){msg=this._truncateToN(new BN(msg,16)),key=this.keyFromPublic(key,enc),signature=new Signature(signature,"hex");var r=signature.r,s=signature.s;if(r.cmpn(1)<0||r.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var sinv=s.invm(this.n),u1=sinv.mul(msg).umod(this.n),u2=sinv.mul(r).umod(this.n);if(!this.curve._maxwellTrick){var p=this.g.mulAdd(u1,key.getPublic(),u2);return!p.isInfinity()&&0===p.getX().umod(this.n).cmp(r)}var p=this.g.jmulAdd(u1,key.getPublic(),u2);return!p.isInfinity()&&p.eqXToP(r)},EC.prototype.recoverPubKey=function(msg,signature,j,enc){assert((3&j)===j,"The recovery param is more than two bits"),signature=new Signature(signature,enc);var n=this.n,e=new BN(msg),r=signature.r,s=signature.s,isYOdd=1&j,isSecondKey=j>>1;if(r.cmp(this.curve.p.umod(this.curve.n))>=0&&isSecondKey)throw new Error("Unable to find sencond key candinate");r=isSecondKey?this.curve.pointFromX(r.add(this.curve.n),isYOdd):this.curve.pointFromX(r,isYOdd);var rInv=signature.r.invm(n),s1=n.sub(e).mul(rInv).umod(n),s2=s.mul(rInv).umod(n);return this.g.mulAdd(s1,r,s2)},EC.prototype.getKeyRecoveryParam=function(e,signature,Q,enc){if(signature=new Signature(signature,enc),null!==signature.recoveryParam)return signature.recoveryParam;for(var i=0;i<4;i++){var Qprime;try{Qprime=this.recoverPubKey(e,signature,i)}catch(e){continue}if(Qprime.eq(Q))return i}throw new Error("Unable to find valid recovery factor")}},function(module,exports,__webpack_require__){"use strict";function KeyPair(ec,options){this.ec=ec,this.priv=null,this.pub=null,options.priv&&this._importPrivate(options.priv,options.privEnc),options.pub&&this._importPublic(options.pub,options.pubEnc)}var BN=__webpack_require__(14),elliptic=__webpack_require__(20),utils=elliptic.utils,assert=utils.assert;module.exports=KeyPair,KeyPair.fromPublic=function(ec,pub,enc){return pub instanceof KeyPair?pub:new KeyPair(ec,{pub:pub,pubEnc:enc})},KeyPair.fromPrivate=function(ec,priv,enc){return priv instanceof KeyPair?priv:new KeyPair(ec,{priv:priv,privEnc:enc})},KeyPair.prototype.validate=function(){var pub=this.getPublic();return pub.isInfinity()?{result:!1,reason:"Invalid public key"}:pub.validate()?pub.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},KeyPair.prototype.getPublic=function(compact,enc){return"string"==typeof compact&&(enc=compact,compact=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),enc?this.pub.encode(enc,compact):this.pub},KeyPair.prototype.getPrivate=function(enc){return"hex"===enc?this.priv.toString(16,2):this.priv},KeyPair.prototype._importPrivate=function(key,enc){this.priv=new BN(key,enc||16),this.priv=this.priv.umod(this.ec.curve.n)},KeyPair.prototype._importPublic=function(key,enc){if(key.x||key.y)return"mont"===this.ec.curve.type?assert(key.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||assert(key.x&&key.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(key.x,key.y));this.pub=this.ec.curve.decodePoint(key,enc)},KeyPair.prototype.derive=function(pub){return pub.mul(this.priv).getX()},KeyPair.prototype.sign=function(msg,enc,options){return this.ec.sign(msg,this,enc,options)},KeyPair.prototype.verify=function(msg,signature){return this.ec.verify(msg,signature,this)},KeyPair.prototype.inspect=function(){return""}},function(module,exports,__webpack_require__){"use strict";function Signature(options,enc){if(options instanceof Signature)return options;this._importDER(options,enc)||(assert(options.r&&options.s,"Signature without r or s"),this.r=new BN(options.r,16),this.s=new BN(options.s,16),void 0===options.recoveryParam?this.recoveryParam=null:this.recoveryParam=options.recoveryParam)}function Position(){this.place=0}function getLength(buf,p){var initial=buf[p.place++];if(!(128&initial))return initial;for(var octetLen=15&initial,val=0,i=0,off=p.place;i>>3);for(arr.push(128|octets);--octets;)arr.push(len>>>(octets<<3)&255);arr.push(len)}var BN=__webpack_require__(14),elliptic=__webpack_require__(20),utils=elliptic.utils,assert=utils.assert;module.exports=Signature,Signature.prototype._importDER=function(data,enc){data=utils.toArray(data,enc);var p=new Position;if(48!==data[p.place++])return!1;if(getLength(data,p)+p.place!==data.length)return!1;if(2!==data[p.place++])return!1;var rlen=getLength(data,p),r=data.slice(p.place,rlen+p.place);if(p.place+=rlen,2!==data[p.place++])return!1;var slen=getLength(data,p);if(data.length!==slen+p.place)return!1;var s=data.slice(p.place,slen+p.place);return 0===r[0]&&128&r[1]&&(r=r.slice(1)),0===s[0]&&128&s[1]&&(s=s.slice(1)),this.r=new BN(r),this.s=new BN(s),this.recoveryParam=null,!0},Signature.prototype.toDER=function(enc){var r=this.r.toArray(),s=this.s.toArray();for(128&r[0]&&(r=[0].concat(r)),128&s[0]&&(s=[0].concat(s)),r=rmPadding(r),s=rmPadding(s);!(s[0]||128&s[1]);)s=s.slice(1);var arr=[2];constructLength(arr,r.length),arr=arr.concat(r),arr.push(2),constructLength(arr,s.length);var backHalf=arr.concat(s),res=[48];return constructLength(res,backHalf.length),res=res.concat(backHalf),utils.encode(res,enc)}},function(module,exports,__webpack_require__){"use strict";function EDDSA(curve){if(assert("ed25519"===curve,"only tested with ed25519 so far"),!(this instanceof EDDSA))return new EDDSA(curve);var curve=elliptic.curves[curve].curve;this.curve=curve,this.g=curve.g,this.g.precompute(curve.n.bitLength()+1),this.pointClass=curve.point().constructor,this.encodingLength=Math.ceil(curve.n.bitLength()/8),this.hash=hash.sha512}var hash=__webpack_require__(113),elliptic=__webpack_require__(20),utils=elliptic.utils,assert=utils.assert,parseBytes=utils.parseBytes,KeyPair=__webpack_require__(349),Signature=__webpack_require__(350);module.exports=EDDSA,EDDSA.prototype.sign=function(message,secret){message=parseBytes(message);var key=this.keyFromSecret(secret),r=this.hashInt(key.messagePrefix(),message),R=this.g.mul(r),Rencoded=this.encodePoint(R),s_=this.hashInt(Rencoded,key.pubBytes(),message).mul(key.priv()),S=r.add(s_).umod(this.curve.n);return this.makeSignature({R:R,S:S,Rencoded:Rencoded})},EDDSA.prototype.verify=function(message,sig,pub){message=parseBytes(message),sig=this.makeSignature(sig);var key=this.keyFromPublic(pub),h=this.hashInt(sig.Rencoded(),key.pubBytes(),message),SG=this.g.mul(sig.S());return sig.R().add(key.pub().mul(h)).eq(SG)},EDDSA.prototype.hashInt=function(){for(var hash=this.hash(),i=0;i=0;){var z;if(k.isOdd()){var mod=k.andln(ws-1);z=mod>(ws>>1)-1?(ws>>1)-mod:mod,k.isubn(z)}else z=0;naf.push(z);for(var shift=0!==k.cmpn(0)&&0===k.andln(ws-1)?w+1:1,i=1;i0||k2.cmpn(-d2)>0;){var m14=k1.andln(3)+d1&3,m24=k2.andln(3)+d2&3;3===m14&&(m14=-1),3===m24&&(m24=-1);var u1;if(0==(1&m14))u1=0;else{var m8=k1.andln(7)+d1&7;u1=3!==m8&&5!==m8||2!==m24?m14:-m14}jsf[0].push(u1);var u2;if(0==(1&m24))u2=0;else{var m8=k2.andln(7)+d2&7;u2=3!==m8&&5!==m8||2!==m14?m24:-m24}jsf[1].push(u2),2*d1===u1+1&&(d1=1-d1),2*d2===u2+1&&(d2=1-d2),k1.iushrn(1),k2.iushrn(1)}return jsf}function cachedProperty(obj,name,computer){var key="_"+name;obj.prototype[name]=function(){return void 0!==this[key]?this[key]:this[key]=computer.call(this)}}function parseBytes(bytes){return"string"==typeof bytes?utils.toArray(bytes,"hex"):bytes}function intFromLE(bytes){return new BN(bytes,"hex","le")}var utils=exports,BN=__webpack_require__(14),minAssert=__webpack_require__(34),minUtils=__webpack_require__(236);utils.assert=minAssert,utils.toArray=minUtils.toArray,utils.zero2=minUtils.zero2,utils.toHex=minUtils.toHex,utils.encode=minUtils.encode,utils.getNAF=getNAF,utils.getJSF=getJSF,utils.cachedProperty=cachedProperty,utils.parseBytes=parseBytes,utils.intFromLE=intFromLE},function(module,exports,__webpack_require__){var once=__webpack_require__(67),noop=function(){},isRequest=function(stream){return stream.setHeader&&"function"==typeof stream.abort},isChildProcess=function(stream){return stream.stdio&&Array.isArray(stream.stdio)&&3===stream.stdio.length},eos=function(stream,opts,callback){if("function"==typeof opts)return eos(stream,null,opts);opts||(opts={}),callback=once(callback||noop);var ws=stream._writableState,rs=stream._readableState,readable=opts.readable||opts.readable!==!1&&stream.readable,writable=opts.writable||opts.writable!==!1&&stream.writable,onlegacyfinish=function(){stream.writable||onfinish()},onfinish=function(){writable=!1,readable||callback.call(stream)},onend=function(){readable=!1,writable||callback.call(stream)},onexit=function(exitCode){callback.call(stream,exitCode?new Error("exited with error code: "+exitCode):null)},onclose=function(){return(!readable||rs&&rs.ended)&&(!writable||ws&&ws.ended)?void 0:callback.call(stream,new Error("premature close"))},onrequest=function(){stream.req.on("finish",onfinish)};return isRequest(stream)?(stream.on("complete",onfinish),stream.on("abort",onclose),stream.req?onrequest():stream.on("request",onrequest)):writable&&!ws&&(stream.on("end",onlegacyfinish),stream.on("close",onlegacyfinish)),isChildProcess(stream)&&stream.on("exit",onexit),stream.on("end",onend),stream.on("finish",onfinish),opts.error!==!1&&stream.on("error",callback),stream.on("close",onclose),function(){stream.removeListener("complete",onfinish),stream.removeListener("abort",onclose),stream.removeListener("request",onrequest),stream.req&&stream.req.removeListener("finish",onfinish),stream.removeListener("end",onlegacyfinish),stream.removeListener("close",onlegacyfinish),stream.removeListener("finish",onfinish),stream.removeListener("exit",onexit), -stream.removeListener("end",onend),stream.removeListener("error",callback),stream.removeListener("close",onclose)}};module.exports=eos},function(module,exports,__webpack_require__){module.exports=__webpack_require__(355)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(356),module.exports.parser=__webpack_require__(50)},function(module,exports,__webpack_require__){(function(global){function Socket(uri,opts){if(!(this instanceof Socket))return new Socket(uri,opts);opts=opts||{},uri&&"object"==typeof uri&&(opts=uri,uri=null),uri?(uri=parseuri(uri),opts.hostname=uri.host,opts.secure="https"===uri.protocol||"wss"===uri.protocol,opts.port=uri.port,uri.query&&(opts.query=uri.query)):opts.host&&(opts.hostname=parseuri(opts.host).host),this.secure=null!=opts.secure?opts.secure:global.location&&"https:"===location.protocol,opts.hostname&&!opts.port&&(opts.port=this.secure?"443":"80"),this.agent=opts.agent||!1,this.hostname=opts.hostname||(global.location?location.hostname:"localhost"),this.port=opts.port||(global.location&&location.port?location.port:this.secure?443:80),this.query=opts.query||{},"string"==typeof this.query&&(this.query=parseqs.decode(this.query)),this.upgrade=!1!==opts.upgrade,this.path=(opts.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!opts.forceJSONP,this.jsonp=!1!==opts.jsonp,this.forceBase64=!!opts.forceBase64,this.enablesXDR=!!opts.enablesXDR,this.timestampParam=opts.timestampParam||"t",this.timestampRequests=opts.timestampRequests,this.transports=opts.transports||["polling","websocket"],this.transportOptions=opts.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=opts.policyPort||843,this.rememberUpgrade=opts.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=opts.onlyBinaryUpgrades,this.perMessageDeflate=!1!==opts.perMessageDeflate&&(opts.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=opts.pfx||null,this.key=opts.key||null,this.passphrase=opts.passphrase||null,this.cert=opts.cert||null,this.ca=opts.ca||null,this.ciphers=opts.ciphers||null,this.rejectUnauthorized=void 0===opts.rejectUnauthorized||opts.rejectUnauthorized,this.forceNode=!!opts.forceNode;var freeGlobal="object"==typeof global&&global;freeGlobal.global===freeGlobal&&(opts.extraHeaders&&Object.keys(opts.extraHeaders).length>0&&(this.extraHeaders=opts.extraHeaders),opts.localAddress&&(this.localAddress=opts.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}function clone(obj){var o={};for(var i in obj)obj.hasOwnProperty(i)&&(o[i]=obj[i]);return o}var transports=__webpack_require__(180),Emitter=__webpack_require__(49),debug=__webpack_require__(3)("engine.io-client:socket"),index=__webpack_require__(114),parser=__webpack_require__(50),parseuri=__webpack_require__(244),parsejson=__webpack_require__(584),parseqs=__webpack_require__(93);module.exports=Socket,Socket.priorWebsocketSuccess=!1,Emitter(Socket.prototype),Socket.protocol=parser.protocol,Socket.Socket=Socket,Socket.Transport=__webpack_require__(111),Socket.transports=__webpack_require__(180),Socket.parser=__webpack_require__(50),Socket.prototype.createTransport=function(name){debug('creating transport "%s"',name);var query=clone(this.query);query.EIO=parser.protocol,query.transport=name;var options=this.transportOptions[name]||{};return this.id&&(query.sid=this.id),new transports[name]({query:query,socket:this,agent:options.agent||this.agent,hostname:options.hostname||this.hostname,port:options.port||this.port,secure:options.secure||this.secure,path:options.path||this.path,forceJSONP:options.forceJSONP||this.forceJSONP,jsonp:options.jsonp||this.jsonp,forceBase64:options.forceBase64||this.forceBase64,enablesXDR:options.enablesXDR||this.enablesXDR,timestampRequests:options.timestampRequests||this.timestampRequests,timestampParam:options.timestampParam||this.timestampParam,policyPort:options.policyPort||this.policyPort,pfx:options.pfx||this.pfx,key:options.key||this.key,passphrase:options.passphrase||this.passphrase,cert:options.cert||this.cert,ca:options.ca||this.ca,ciphers:options.ciphers||this.ciphers,rejectUnauthorized:options.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:options.perMessageDeflate||this.perMessageDeflate,extraHeaders:options.extraHeaders||this.extraHeaders,forceNode:options.forceNode||this.forceNode,localAddress:options.localAddress||this.localAddress,requestTimeout:options.requestTimeout||this.requestTimeout,protocols:options.protocols||void 0})},Socket.prototype.open=function(){var transport;if(this.rememberUpgrade&&Socket.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)transport="websocket";else{if(0===this.transports.length){var self=this;return void setTimeout(function(){self.emit("error","No transports available")},0)}transport=this.transports[0]}this.readyState="opening";try{transport=this.createTransport(transport)}catch(e){return this.transports.shift(),void this.open()}transport.open(),this.setTransport(transport)},Socket.prototype.setTransport=function(transport){debug("setting transport %s",transport.name);var self=this;this.transport&&(debug("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=transport,transport.on("drain",function(){self.onDrain()}).on("packet",function(packet){self.onPacket(packet)}).on("error",function(e){self.onError(e)}).on("close",function(){self.onClose("transport close")})},Socket.prototype.probe=function(name){function onTransportOpen(){if(self.onlyBinaryUpgrades){var upgradeLosesBinary=!this.supportsBinary&&self.transport.supportsBinary;failed=failed||upgradeLosesBinary}failed||(debug('probe transport "%s" opened',name),transport.send([{type:"ping",data:"probe"}]),transport.once("packet",function(msg){if(!failed)if("pong"===msg.type&&"probe"===msg.data){if(debug('probe transport "%s" pong',name),self.upgrading=!0,self.emit("upgrading",transport),!transport)return;Socket.priorWebsocketSuccess="websocket"===transport.name,debug('pausing current transport "%s"',self.transport.name),self.transport.pause(function(){failed||"closed"!==self.readyState&&(debug("changing transport and sending upgrade packet"),cleanup(),self.setTransport(transport),transport.send([{type:"upgrade"}]),self.emit("upgrade",transport),transport=null,self.upgrading=!1,self.flush())})}else{debug('probe transport "%s" failed',name);var err=new Error("probe error");err.transport=transport.name,self.emit("upgradeError",err)}}))}function freezeTransport(){failed||(failed=!0,cleanup(),transport.close(),transport=null)}function onerror(err){var error=new Error("probe error: "+err);error.transport=transport.name,freezeTransport(),debug('probe transport "%s" failed because of error: %s',name,err),self.emit("upgradeError",error)}function onTransportClose(){onerror("transport closed")}function onclose(){onerror("socket closed")}function onupgrade(to){transport&&to.name!==transport.name&&(debug('"%s" works - aborting "%s"',to.name,transport.name),freezeTransport())}function cleanup(){transport.removeListener("open",onTransportOpen),transport.removeListener("error",onerror),transport.removeListener("close",onTransportClose),self.removeListener("close",onclose),self.removeListener("upgrading",onupgrade)}debug('probing transport "%s"',name);var transport=this.createTransport(name,{probe:1}),failed=!1,self=this;Socket.priorWebsocketSuccess=!1,transport.once("open",onTransportOpen),transport.once("error",onerror),transport.once("close",onTransportClose),this.once("close",onclose),this.once("upgrading",onupgrade),transport.open()},Socket.prototype.onOpen=function(){if(debug("socket open"),this.readyState="open",Socket.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){debug("starting upgrade probes");for(var i=0,l=this.upgrades.length;i';iframe=document.createElement(html)}catch(e){iframe=document.createElement("iframe"),iframe.name=self.iframeId,iframe.src="javascript:0"}iframe.id=self.iframeId,self.form.appendChild(iframe),self.iframe=iframe}var self=this;if(!this.form){var iframe,form=document.createElement("form"),area=document.createElement("textarea"),id=this.iframeId="eio_iframe_"+this.index;form.className="socketio",form.style.position="absolute",form.style.top="-1000px",form.style.left="-1000px",form.target=id,form.method="POST",form.setAttribute("accept-charset","utf-8"),area.name="d",form.appendChild(area),document.body.appendChild(form),this.form=form,this.area=area}this.form.action=this.uri(),initIframe(),data=data.replace(/\\n/g,"\\\n"),this.area.value=data.replace(/\n/g,"\\n");try{this.form.submit()}catch(e){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===self.iframe.readyState&&complete()}:this.iframe.onload=complete}}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(global){function empty(){}function XHR(opts){if(Polling.call(this,opts),this.requestTimeout=opts.requestTimeout,this.extraHeaders=opts.extraHeaders,global.location){var isSSL="https:"===location.protocol,port=location.port;port||(port=isSSL?443:80),this.xd=opts.hostname!==global.location.hostname||port!==opts.port,this.xs=opts.secure!==isSSL}}function Request(opts){this.method=opts.method||"GET",this.uri=opts.uri,this.xd=!!opts.xd,this.xs=!!opts.xs,this.async=!1!==opts.async,this.data=void 0!==opts.data?opts.data:null,this.agent=opts.agent,this.isBinary=opts.isBinary,this.supportsBinary=opts.supportsBinary,this.enablesXDR=opts.enablesXDR,this.requestTimeout=opts.requestTimeout,this.pfx=opts.pfx,this.key=opts.key,this.passphrase=opts.passphrase,this.cert=opts.cert,this.ca=opts.ca,this.ciphers=opts.ciphers,this.rejectUnauthorized=opts.rejectUnauthorized,this.extraHeaders=opts.extraHeaders,this.create()}function unloadHandler(){for(var i in Request.requests)Request.requests.hasOwnProperty(i)&&Request.requests[i].abort()}var XMLHttpRequest=__webpack_require__(112),Polling=__webpack_require__(181),Emitter=__webpack_require__(49),inherit=__webpack_require__(80),debug=__webpack_require__(3)("engine.io-client:polling-xhr");module.exports=XHR,module.exports.Request=Request,inherit(XHR,Polling),XHR.prototype.supportsBinary=!0,XHR.prototype.request=function(opts){return opts=opts||{},opts.uri=this.uri(),opts.xd=this.xd,opts.xs=this.xs,opts.agent=this.agent||!1,opts.supportsBinary=this.supportsBinary,opts.enablesXDR=this.enablesXDR,opts.pfx=this.pfx,opts.key=this.key,opts.passphrase=this.passphrase,opts.cert=this.cert,opts.ca=this.ca,opts.ciphers=this.ciphers,opts.rejectUnauthorized=this.rejectUnauthorized,opts.requestTimeout=this.requestTimeout,opts.extraHeaders=this.extraHeaders,new Request(opts)},XHR.prototype.doWrite=function(data,fn){var isBinary="string"!=typeof data&&void 0!==data,req=this.request({method:"POST",data:data,isBinary:isBinary}),self=this;req.on("success",fn),req.on("error",function(err){self.onError("xhr post error",err)}),this.sendXhr=req},XHR.prototype.doPoll=function(){debug("xhr poll");var req=this.request(),self=this;req.on("data",function(data){self.onData(data)}),req.on("error",function(err){self.onError("xhr poll error",err)}),this.pollXhr=req},Emitter(Request.prototype),Request.prototype.create=function(){var opts={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};opts.pfx=this.pfx,opts.key=this.key,opts.passphrase=this.passphrase,opts.cert=this.cert,opts.ca=this.ca,opts.ciphers=this.ciphers,opts.rejectUnauthorized=this.rejectUnauthorized;var xhr=this.xhr=new XMLHttpRequest(opts),self=this;try{debug("xhr open %s: %s",this.method,this.uri),xhr.open(this.method,this.uri,this.async);try{if(this.extraHeaders){xhr.setDisableHeaderCheck&&xhr.setDisableHeaderCheck(!0);for(var i in this.extraHeaders)this.extraHeaders.hasOwnProperty(i)&&xhr.setRequestHeader(i,this.extraHeaders[i])}}catch(e){}if("POST"===this.method)try{this.isBinary?xhr.setRequestHeader("Content-type","application/octet-stream"):xhr.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{xhr.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in xhr&&(xhr.withCredentials=!0),this.requestTimeout&&(xhr.timeout=this.requestTimeout),this.hasXDR()?(xhr.onload=function(){self.onLoad()},xhr.onerror=function(){self.onError(xhr.responseText)}):xhr.onreadystatechange=function(){if(2===xhr.readyState){var contentType;try{contentType=xhr.getResponseHeader("Content-Type")}catch(e){}"application/octet-stream"===contentType&&(xhr.responseType="arraybuffer")}4===xhr.readyState&&(200===xhr.status||1223===xhr.status?self.onLoad():setTimeout(function(){self.onError(xhr.status)},0))},debug("xhr data %s",this.data),xhr.send(this.data)}catch(e){return void setTimeout(function(){self.onError(e)},0)}global.document&&(this.index=Request.requestsCount++,Request.requests[this.index]=this)},Request.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},Request.prototype.onData=function(data){this.emit("data",data),this.onSuccess()},Request.prototype.onError=function(err){this.emit("error",err),this.cleanup(!0)},Request.prototype.cleanup=function(fromError){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=empty:this.xhr.onreadystatechange=empty,fromError)try{this.xhr.abort()}catch(e){}global.document&&delete Request.requests[this.index],this.xhr=null}},Request.prototype.onLoad=function(){var data;try{var contentType;try{contentType=this.xhr.getResponseHeader("Content-Type")}catch(e){}data="application/octet-stream"===contentType?this.xhr.response||this.xhr.responseText:this.xhr.responseText}catch(e){this.onError(e)}null!=data&&this.onData(data)},Request.prototype.hasXDR=function(){return void 0!==global.XDomainRequest&&!this.xs&&this.enablesXDR},Request.prototype.abort=function(){this.cleanup()},Request.requestsCount=0,Request.requests={},global.document&&(global.attachEvent?global.attachEvent("onunload",unloadHandler):global.addEventListener&&global.addEventListener("beforeunload",unloadHandler,!1))}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(global){function WS(opts){opts&&opts.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=opts.perMessageDeflate,this.usingBrowserWebSocket=BrowserWebSocket&&!opts.forceNode,this.protocols=opts.protocols,this.usingBrowserWebSocket||(WebSocket=NodeWebSocket),Transport.call(this,opts)}var NodeWebSocket,Transport=__webpack_require__(111),parser=__webpack_require__(50),parseqs=__webpack_require__(93),inherit=__webpack_require__(80),yeast=__webpack_require__(275),debug=__webpack_require__(3)("engine.io-client:websocket"),BrowserWebSocket=global.WebSocket||global.MozWebSocket;if("undefined"==typeof window)try{NodeWebSocket=__webpack_require__(711)}catch(e){}var WebSocket=BrowserWebSocket;WebSocket||"undefined"!=typeof window||(WebSocket=NodeWebSocket),module.exports=WS,inherit(WS,Transport),WS.prototype.name="websocket",WS.prototype.supportsBinary=!0,WS.prototype.doOpen=function(){if(this.check()){var uri=this.uri(),protocols=this.protocols,opts={agent:this.agent,perMessageDeflate:this.perMessageDeflate};opts.pfx=this.pfx,opts.key=this.key,opts.passphrase=this.passphrase,opts.cert=this.cert,opts.ca=this.ca,opts.ciphers=this.ciphers,opts.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(opts.headers=this.extraHeaders),this.localAddress&&(opts.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket?protocols?new WebSocket(uri,protocols):new WebSocket(uri):new WebSocket(uri,protocols,opts)}catch(err){return this.emit("error",err)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},WS.prototype.addEventListeners=function(){var self=this;this.ws.onopen=function(){self.onOpen()},this.ws.onclose=function(){self.onClose()},this.ws.onmessage=function(ev){self.onData(ev.data)},this.ws.onerror=function(e){self.onError("websocket error",e)}},WS.prototype.write=function(packets){function done(){self.emit("flush"),setTimeout(function(){self.writable=!0,self.emit("drain")},0)}var self=this;this.writable=!1;for(var total=packets.length,i=0,l=total;i=55296&&value<=56319&&counter65535&&(value-=65536,output+=stringFromCharCode(value>>>10&1023|55296),value=56320|1023&value),output+=stringFromCharCode(value);return output}function checkScalarValue(codePoint,strict){if(codePoint>=55296&&codePoint<=57343){if(strict)throw Error("Lone surrogate U+"+codePoint.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function createByte(codePoint,shift){return stringFromCharCode(codePoint>>shift&63|128)}function encodeCodePoint(codePoint,strict){if(0==(4294967168&codePoint))return stringFromCharCode(codePoint);var symbol="";return 0==(4294965248&codePoint)?symbol=stringFromCharCode(codePoint>>6&31|192):0==(4294901760&codePoint)?(checkScalarValue(codePoint,strict)||(codePoint=65533),symbol=stringFromCharCode(codePoint>>12&15|224),symbol+=createByte(codePoint,6)):0==(4292870144&codePoint)&&(symbol=stringFromCharCode(codePoint>>18&7|240),symbol+=createByte(codePoint,12),symbol+=createByte(codePoint,6)),symbol+=stringFromCharCode(63&codePoint|128)}function utf8encode(string,opts){opts=opts||{};for(var codePoint,strict=!1!==opts.strict,codePoints=ucs2decode(string),length=codePoints.length,index=-1,byteString="";++index=byteCount)throw Error("Invalid byte index");var continuationByte=255&byteArray[byteIndex];if(byteIndex++,128==(192&continuationByte))return 63&continuationByte;throw Error("Invalid continuation byte")}function decodeSymbol(strict){var byte1,byte2,byte3,byte4,codePoint;if(byteIndex>byteCount)throw Error("Invalid byte index");if(byteIndex==byteCount)return!1;if(byte1=255&byteArray[byteIndex],byteIndex++,0==(128&byte1))return byte1;if(192==(224&byte1)){if(byte2=readContinuationByte(),(codePoint=(31&byte1)<<6|byte2)>=128)return codePoint;throw Error("Invalid continuation byte")}if(224==(240&byte1)){if(byte2=readContinuationByte(),byte3=readContinuationByte(),(codePoint=(15&byte1)<<12|byte2<<6|byte3)>=2048)return checkScalarValue(codePoint,strict)?codePoint:65533;throw Error("Invalid continuation byte")}if(240==(248&byte1)&&(byte2=readContinuationByte(),byte3=readContinuationByte(),byte4=readContinuationByte(),(codePoint=(7&byte1)<<18|byte2<<12|byte3<<6|byte4)>=65536&&codePoint<=1114111))return codePoint;throw Error("Invalid UTF-8 detected")}function utf8decode(byteString,opts){opts=opts||{};var strict=!1!==opts.strict;byteArray=ucs2decode(byteString),byteCount=byteArray.length,byteIndex=0;for(var tmp,codePoints=[];(tmp=decodeSymbol(strict))!==!1;)codePoints.push(tmp);return ucs2encode(codePoints)}var freeExports="object"==typeof exports&&exports,freeGlobal=("object"==typeof module&&module&&module.exports,"object"==typeof global&&global);freeGlobal.global!==freeGlobal&&freeGlobal.window;var byteArray,byteCount,byteIndex,stringFromCharCode=String.fromCharCode,utf8={version:"2.1.2",encode:utf8encode,decode:utf8decode};void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(){return utf8}.call(exports,__webpack_require__,exports,module))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)}()}).call(exports,__webpack_require__(18)(module),__webpack_require__(2))},function(module,exports,__webpack_require__){function init(type,message,cause){prr(this,{type:type,name:type,cause:"string"!=typeof message?message:cause,message:message&&"string"!=typeof message?message.message:message},"ewr")}function CustomError(message,cause){Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,arguments.callee),init.call(this,"CustomError",message,cause)}function createError(errno,type,proto){var err=function(message,cause){init.call(this,type,message,cause),"FilesystemError"==type&&(this.code=this.cause.code,this.path=this.cause.path,this.errno=this.cause.errno,this.message=(errno.errno[this.cause.errno]?errno.errno[this.cause.errno].description:this.cause.message)+(this.cause.path?" ["+this.cause.path+"]":"")),Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,arguments.callee)};return err.prototype=proto?new proto:new CustomError,err}var prr=__webpack_require__(364);CustomError.prototype=new Error,module.exports=function(errno){var ce=function(type,proto){return createError(errno,type,proto)};return{CustomError:CustomError,FilesystemError:ce("FilesystemError"),createError:ce}}},function(module,exports,__webpack_require__){var all=module.exports.all=[{errno:-2,code:"ENOENT",description:"no such file or directory"},{errno:-1,code:"UNKNOWN",description:"unknown error"},{errno:0,code:"OK",description:"success"},{errno:1,code:"EOF",description:"end of file"},{errno:2,code:"EADDRINFO",description:"getaddrinfo error"},{errno:3,code:"EACCES",description:"permission denied"},{errno:4,code:"EAGAIN",description:"resource temporarily unavailable"},{errno:5,code:"EADDRINUSE",description:"address already in use"},{errno:6,code:"EADDRNOTAVAIL",description:"address not available"},{errno:7,code:"EAFNOSUPPORT",description:"address family not supported"},{errno:8,code:"EALREADY",description:"connection already in progress"},{errno:9,code:"EBADF",description:"bad file descriptor"},{errno:10,code:"EBUSY",description:"resource busy or locked"},{errno:11,code:"ECONNABORTED",description:"software caused connection abort"},{errno:12,code:"ECONNREFUSED",description:"connection refused"},{errno:13,code:"ECONNRESET",description:"connection reset by peer"},{errno:14,code:"EDESTADDRREQ",description:"destination address required"},{errno:15,code:"EFAULT",description:"bad address in system call argument"},{errno:16,code:"EHOSTUNREACH",description:"host is unreachable"},{errno:17,code:"EINTR",description:"interrupted system call"},{errno:18,code:"EINVAL",description:"invalid argument"},{errno:19,code:"EISCONN",description:"socket is already connected"},{errno:20,code:"EMFILE",description:"too many open files"},{errno:21,code:"EMSGSIZE",description:"message too long"},{errno:22,code:"ENETDOWN",description:"network is down"},{errno:23,code:"ENETUNREACH",description:"network is unreachable"},{errno:24,code:"ENFILE",description:"file table overflow"},{errno:25,code:"ENOBUFS",description:"no buffer space available"},{errno:26,code:"ENOMEM",description:"not enough memory"},{errno:27,code:"ENOTDIR",description:"not a directory"},{errno:28,code:"EISDIR",description:"illegal operation on a directory"},{errno:29,code:"ENONET",description:"machine is not on the network"},{errno:31,code:"ENOTCONN",description:"socket is not connected"},{errno:32,code:"ENOTSOCK",description:"socket operation on non-socket"},{errno:33,code:"ENOTSUP",description:"operation not supported on socket"},{errno:34,code:"ENOENT",description:"no such file or directory"},{errno:35,code:"ENOSYS",description:"function not implemented"},{errno:36,code:"EPIPE",description:"broken pipe"},{errno:37,code:"EPROTO",description:"protocol error"},{errno:38,code:"EPROTONOSUPPORT",description:"protocol not supported"},{errno:39,code:"EPROTOTYPE",description:"protocol wrong type for socket"},{errno:40,code:"ETIMEDOUT",description:"connection timed out"},{errno:41,code:"ECHARSET",description:"invalid Unicode character"},{errno:42,code:"EAIFAMNOSUPPORT",description:"address family for hostname not supported"},{errno:44,code:"EAISERVICE", -description:"servname not supported for ai_socktype"},{errno:45,code:"EAISOCKTYPE",description:"ai_socktype not supported"},{errno:46,code:"ESHUTDOWN",description:"cannot send after transport endpoint shutdown"},{errno:47,code:"EEXIST",description:"file already exists"},{errno:48,code:"ESRCH",description:"no such process"},{errno:49,code:"ENAMETOOLONG",description:"name too long"},{errno:50,code:"EPERM",description:"operation not permitted"},{errno:51,code:"ELOOP",description:"too many symbolic links encountered"},{errno:52,code:"EXDEV",description:"cross-device link not permitted"},{errno:53,code:"ENOTEMPTY",description:"directory not empty"},{errno:54,code:"ENOSPC",description:"no space left on device"},{errno:55,code:"EIO",description:"i/o error"},{errno:56,code:"EROFS",description:"read-only file system"},{errno:57,code:"ENODEV",description:"no such device"},{errno:58,code:"ESPIPE",description:"invalid seek"},{errno:59,code:"ECANCELED",description:"operation canceled"}];module.exports.errno={},module.exports.code={},all.forEach(function(error){module.exports.errno[error.errno]=error,module.exports.code[error.code]=error}),module.exports.custom=__webpack_require__(362)(module.exports),module.exports.create=module.exports.custom.createError},function(module,exports){!function(name,context,definition){void 0!==module&&module.exports?module.exports=definition():context.prr=definition()}(0,this,function(){var setProperty="function"==typeof Object.defineProperty?function(obj,key,options){return Object.defineProperty(obj,key,options),obj}:function(obj,key,options){return obj[key]=options.value,obj},makeOptions=function(value,options){var oo="object"==typeof options,os=!oo&&"string"==typeof options,op=function(p){return oo?!!options[p]:!!os&&options.indexOf(p[0])>-1};return{enumerable:op("enumerable"),configurable:op("configurable"),writable:op("writable"),value:value}};return function(obj,key,value,options){var k;if(options=makeOptions(value,options),"object"==typeof key){for(k in key)Object.hasOwnProperty.call(key,k)&&(options.value=key[k],setProperty(obj,k,options));return obj}return setProperty(obj,key,options)}})},function(module,exports,__webpack_require__){(function(Buffer){const ethUtil=__webpack_require__(183),rlp=__webpack_require__(45);var Account=module.exports=function(data){var fields=[{name:"nonce",default:new Buffer([])},{name:"balance",default:new Buffer([])},{name:"stateRoot",length:32,default:ethUtil.SHA3_RLP},{name:"codeHash",length:32,default:ethUtil.SHA3_NULL}];ethUtil.defineProperties(this,fields,data)};Account.prototype.serialize=function(){return rlp.encode(this.raw)},Account.prototype.isContract=function(){return this.codeHash.toString("hex")!==ethUtil.SHA3_NULL_S},Account.prototype.getCode=function(state,cb){if(!this.isContract())return void cb(null,new Buffer([]));state.getRaw(this.codeHash,cb)},Account.prototype.setCode=function(trie,code,cb){var self=this;if(this.codeHash=ethUtil.sha3(code),this.codeHash.toString("hex")===ethUtil.SHA3_NULL_S)return void cb(null,new Buffer([]));trie.putRaw(this.codeHash,code,function(err){cb(err,self.codeHash)})},Account.prototype.getStorage=function(trie,key,cb){var t=trie.copy();t.root=this.stateRoot,t.get(key,cb)},Account.prototype.setStorage=function(trie,key,val,cb){var self=this,t=trie.copy();t.root=self.stateRoot,t.put(key,val,function(err){if(err)return cb();self.stateRoot=t.root,cb()})},Account.prototype.isEmpty=function(){return""===this.balance.toString("hex")&&""===this.nonce.toString("hex")&&this.stateRoot.toString("hex")===ethUtil.SHA3_RLP_S&&this.codeHash.toString("hex")===ethUtil.SHA3_NULL_S}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){const createKeccakHash=__webpack_require__(208),secp256k1=__webpack_require__(144),assert=__webpack_require__(9),rlp=__webpack_require__(45),BN=__webpack_require__(14),createHash=__webpack_require__(59);Object.assign(exports,__webpack_require__(184)),exports.MAX_INTEGER=new BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),exports.TWO_POW256=new BN("10000000000000000000000000000000000000000000000000000000000000000",16),exports.SHA3_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",exports.SHA3_NULL=Buffer.from(exports.SHA3_NULL_S,"hex"),exports.SHA3_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",exports.SHA3_RLP_ARRAY=Buffer.from(exports.SHA3_RLP_ARRAY_S,"hex"),exports.SHA3_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",exports.SHA3_RLP=Buffer.from(exports.SHA3_RLP_S,"hex"),exports.BN=BN,exports.rlp=rlp,exports.secp256k1=secp256k1,exports.zeros=function(bytes){return Buffer.allocUnsafe(bytes).fill(0)},exports.setLengthLeft=exports.setLength=function(msg,length,right){var buf=exports.zeros(length);return msg=exports.toBuffer(msg),right?msg.length0&&"0"===first.toString();)a=a.slice(1),first=a[0];return a},exports.toBuffer=function(v){if(!Buffer.isBuffer(v))if(Array.isArray(v))v=Buffer.from(v);else if("string"==typeof v)v=exports.isHexString(v)?Buffer.from(exports.padToEven(exports.stripHexPrefix(v)),"hex"):Buffer.from(v);else if("number"==typeof v)v=exports.intToBuffer(v);else if(null===v||void 0===v)v=Buffer.allocUnsafe(0);else{if(!v.toArray)throw new Error("invalid type");v=Buffer.from(v.toArray())}return v},exports.bufferToInt=function(buf){return new BN(exports.toBuffer(buf)).toNumber()},exports.bufferToHex=function(buf){return buf=exports.toBuffer(buf),"0x"+buf.toString("hex")},exports.fromSigned=function(num){return new BN(num).fromTwos(256)},exports.toUnsigned=function(num){return Buffer.from(num.toTwos(256).toArray())},exports.sha3=function(a,bits){return a=exports.toBuffer(a),bits||(bits=256),createKeccakHash("keccak"+bits).update(a).digest()},exports.sha256=function(a){return a=exports.toBuffer(a),createHash("sha256").update(a).digest()},exports.ripemd160=function(a,padded){a=exports.toBuffer(a);var hash=createHash("rmd160").update(a).digest();return padded===!0?exports.setLength(hash,32):hash},exports.rlphash=function(a){return exports.sha3(rlp.encode(a))},exports.isValidPrivate=function(privateKey){return secp256k1.privateKeyVerify(privateKey)},exports.isValidPublic=function(publicKey,sanitize){return 64===publicKey.length?secp256k1.publicKeyVerify(Buffer.concat([Buffer.from([4]),publicKey])):!!sanitize&&secp256k1.publicKeyVerify(publicKey)},exports.pubToAddress=exports.publicToAddress=function(pubKey,sanitize){return pubKey=exports.toBuffer(pubKey),sanitize&&64!==pubKey.length&&(pubKey=secp256k1.publicKeyConvert(pubKey,!1).slice(1)),assert(64===pubKey.length),exports.sha3(pubKey).slice(-20)};var privateToPublic=exports.privateToPublic=function(privateKey){return privateKey=exports.toBuffer(privateKey),secp256k1.publicKeyCreate(privateKey,!1).slice(1)};exports.importPublic=function(publicKey){return publicKey=exports.toBuffer(publicKey),64!==publicKey.length&&(publicKey=secp256k1.publicKeyConvert(publicKey,!1).slice(1)),publicKey},exports.ecsign=function(msgHash,privateKey){var sig=secp256k1.sign(msgHash,privateKey),ret={};return ret.r=sig.signature.slice(0,32),ret.s=sig.signature.slice(32,64),ret.v=sig.recovery+27,ret},exports.hashPersonalMessage=function(message){var prefix=exports.toBuffer("Ethereum Signed Message:\n"+message.length.toString());return exports.sha3(Buffer.concat([prefix,message]))},exports.ecrecover=function(msgHash,v,r,s){var signature=Buffer.concat([exports.setLength(r,32),exports.setLength(s,32)],64),recovery=v-27;if(0!==recovery&&1!==recovery)throw new Error("Invalid signature v value");var senderPubKey=secp256k1.recover(msgHash,signature,recovery);return secp256k1.publicKeyConvert(senderPubKey,!1).slice(1)},exports.toRpcSig=function(v,r,s){if(27!==v&&28!==v)throw new Error("Invalid recovery id");return exports.bufferToHex(Buffer.concat([exports.setLengthLeft(r,32),exports.setLengthLeft(s,32),exports.toBuffer(v-27)]))},exports.fromRpcSig=function(sig){if(sig=exports.toBuffer(sig),65!==sig.length)throw new Error("Invalid signature length");var v=sig[64];return v<27&&(v+=27),{v:v,r:sig.slice(0,32),s:sig.slice(32,64)}},exports.privateToAddress=function(privateKey){return exports.publicToAddress(privateToPublic(privateKey))},exports.isValidAddress=function(address){return/^0x[0-9a-fA-F]{40}$/i.test(address)},exports.toChecksumAddress=function(address){address=exports.stripHexPrefix(address).toLowerCase();for(var hash=exports.sha3(address).toString("hex"),ret="0x",i=0;i=8?address[i].toUpperCase():address[i];return ret},exports.isValidChecksumAddress=function(address){return exports.isValidAddress(address)&&exports.toChecksumAddress(address)===address},exports.generateAddress=function(from,nonce){return from=exports.toBuffer(from),nonce=new BN(nonce),nonce=nonce.isZero()?null:Buffer.from(nonce.toArray()),exports.rlphash([from,nonce]).slice(-20)},exports.isPrecompiled=function(address){var a=exports.unpad(address);return 1===a.length&&a[0]>0&&a[0]<5},exports.addHexPrefix=function(str){return"string"!=typeof str?str:exports.isHexPrefixed(str)?str:"0x"+str},exports.isValidSignature=function(v,r,s,homestead){const SECP256K1_N_DIV_2=new BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),SECP256K1_N=new BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===r.length&&32===s.length&&((27===v||28===v)&&(r=new BN(r),s=new BN(s),!(r.isZero()||r.gt(SECP256K1_N)||s.isZero()||s.gt(SECP256K1_N))&&(homestead!==!1||1!==new BN(s).cmp(SECP256K1_N_DIV_2))))},exports.baToJSON=function(ba){if(Buffer.isBuffer(ba))return"0x"+ba.toString("hex");if(ba instanceof Array){for(var array=[],i=0;i=v.length,"The field "+field.name+" must not have more "+field.length+" bytes")):field.allowZero&&0===v.length||!field.length||assert(field.length===v.length,"The field "+field.name+" must have byte length of "+field.length),self.raw[i]=v}self._fields.push(field.name),Object.defineProperty(self,field.name,{enumerable:!0,configurable:!0,get:getter,set:setter}),field.default&&(self[field.name]=field.default),field.alias&&Object.defineProperty(self,field.alias,{enumerable:!1,configurable:!0,set:setter,get:getter})}),data)if("string"==typeof data&&(data=Buffer.from(exports.stripHexPrefix(data),"hex")),Buffer.isBuffer(data)&&(data=rlp.decode(data)),Array.isArray(data)){if(data.length>self._fields.length)throw new Error("wrong number of fields in data");data.forEach(function(d,i){self[self._fields[i]]=exports.toBuffer(d)})}else{if("object"!=typeof data)throw new Error("invalid data");{const keys=Object.keys(data);fields.forEach(function(field){keys.indexOf(field.name)!==-1&&(self[field.name]=data[field.name]),keys.indexOf(field.alias)!==-1&&(self[field.alias]=data[field.alias])})}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var ethUtil=__webpack_require__(368),fees=__webpack_require__(206),BN=ethUtil.BN,N_DIV_2=new BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),Transaction=function(){function Transaction(data){_classCallCheck(this,Transaction),data=data||{};var fields=[{name:"nonce",length:32,allowLess:!0,default:new Buffer([])},{name:"gasPrice",length:32,allowLess:!0,default:new Buffer([])},{name:"gasLimit",alias:"gas",length:32,allowLess:!0,default:new Buffer([])},{name:"to",allowZero:!0,length:20,default:new Buffer([])},{name:"value",length:32,allowLess:!0,default:new Buffer([])},{name:"data",alias:"input",allowZero:!0,default:new Buffer([])},{name:"v",allowZero:!0,default:new Buffer([28])},{name:"r",length:32,allowZero:!0,allowLess:!0,default:new Buffer([])},{name:"s",length:32,allowZero:!0,allowLess:!0,default:new Buffer([])}];ethUtil.defineProperties(this,fields,data),Object.defineProperty(this,"from",{enumerable:!0,configurable:!0,get:this.getSenderAddress.bind(this)});var sigV=ethUtil.bufferToInt(this.v),chainId=Math.floor((sigV-35)/2);chainId<0&&(chainId=0),this._chainId=chainId||data.chainId||0,this._homestead=!0}return Transaction.prototype.toCreationAddress=function(){return""===this.to.toString("hex")},Transaction.prototype.hash=function(includeSignature){void 0===includeSignature&&(includeSignature=!0);var items=void 0;if(includeSignature)items=this.raw;else if(this._chainId>0){var raw=this.raw.slice();this.v=this._chainId,this.r=0,this.s=0,items=this.raw,this.raw=raw}else items=this.raw.slice(0,6);return ethUtil.rlphash(items)},Transaction.prototype.getChainId=function(){return this._chainId},Transaction.prototype.getSenderAddress=function(){if(this._from)return this._from;var pubkey=this.getSenderPublicKey();return this._from=ethUtil.publicToAddress(pubkey),this._from},Transaction.prototype.getSenderPublicKey=function(){if(!(this._senderPubKey&&this._senderPubKey.length||this.verifySignature()))throw new Error("Invalid Signature");return this._senderPubKey},Transaction.prototype.verifySignature=function(){var msgHash=this.hash(!1);if(this._homestead&&1===new BN(this.s).cmp(N_DIV_2))return!1;try{var v=ethUtil.bufferToInt(this.v);this._chainId>0&&(v-=2*this._chainId+8),this._senderPubKey=ethUtil.ecrecover(msgHash,v,this.r,this.s)}catch(e){return!1}return!!this._senderPubKey},Transaction.prototype.sign=function(privateKey){var msgHash=this.hash(!1),sig=ethUtil.ecsign(msgHash,privateKey);this._chainId>0&&(sig.v+=2*this._chainId+8),Object.assign(this,sig)},Transaction.prototype.getDataFee=function(){for(var data=this.raw[5],cost=new BN(0),i=0;i0&&errors.push(["gas limit is too low. Need at least "+this.getBaseFee()]),void 0===stringError||stringError===!1?0===errors.length:errors.join(" ")},Transaction}();module.exports=Transaction}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){const createKeccakHash=__webpack_require__(208),secp256k1=__webpack_require__(144),assert=__webpack_require__(9),rlp=__webpack_require__(45),BN=__webpack_require__(14),createHash=__webpack_require__(59);Object.assign(exports,__webpack_require__(184)),exports.MAX_INTEGER=new BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),exports.TWO_POW256=new BN("10000000000000000000000000000000000000000000000000000000000000000",16),exports.SHA3_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",exports.SHA3_NULL=Buffer.from(exports.SHA3_NULL_S,"hex"),exports.SHA3_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",exports.SHA3_RLP_ARRAY=Buffer.from(exports.SHA3_RLP_ARRAY_S,"hex"),exports.SHA3_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",exports.SHA3_RLP=Buffer.from(exports.SHA3_RLP_S,"hex"),exports.BN=BN,exports.rlp=rlp,exports.secp256k1=secp256k1,exports.zeros=function(bytes){return Buffer.allocUnsafe(bytes).fill(0)},exports.setLengthLeft=exports.setLength=function(msg,length,right){var buf=exports.zeros(length);return msg=exports.toBuffer(msg),right?msg.length0&&"0"===first.toString();)a=a.slice(1),first=a[0];return a},exports.toBuffer=function(v){if(!Buffer.isBuffer(v))if(Array.isArray(v))v=Buffer.from(v);else if("string"==typeof v)v=exports.isHexString(v)?Buffer.from(exports.padToEven(exports.stripHexPrefix(v)),"hex"):Buffer.from(v);else if("number"==typeof v)v=exports.intToBuffer(v);else if(null===v||void 0===v)v=Buffer.allocUnsafe(0);else{if(!v.toArray)throw new Error("invalid type");v=Buffer.from(v.toArray())}return v},exports.bufferToInt=function(buf){return new BN(exports.toBuffer(buf)).toNumber()},exports.bufferToHex=function(buf){return buf=exports.toBuffer(buf),"0x"+buf.toString("hex")},exports.fromSigned=function(num){return new BN(num).fromTwos(256)},exports.toUnsigned=function(num){return Buffer.from(num.toTwos(256).toArray())},exports.sha3=function(a,bits){return a=exports.toBuffer(a),bits||(bits=256),createKeccakHash("keccak"+bits).update(a).digest()},exports.sha256=function(a){return a=exports.toBuffer(a),createHash("sha256").update(a).digest()},exports.ripemd160=function(a,padded){a=exports.toBuffer(a);var hash=createHash("rmd160").update(a).digest();return padded===!0?exports.setLength(hash,32):hash},exports.rlphash=function(a){return exports.sha3(rlp.encode(a))},exports.isValidPrivate=function(privateKey){return secp256k1.privateKeyVerify(privateKey)},exports.isValidPublic=function(publicKey,sanitize){return 64===publicKey.length?secp256k1.publicKeyVerify(Buffer.concat([Buffer.from([4]),publicKey])):!!sanitize&&secp256k1.publicKeyVerify(publicKey)},exports.pubToAddress=exports.publicToAddress=function(pubKey,sanitize){return pubKey=exports.toBuffer(pubKey),sanitize&&64!==pubKey.length&&(pubKey=secp256k1.publicKeyConvert(pubKey,!1).slice(1)),assert(64===pubKey.length),exports.sha3(pubKey).slice(-20)};var privateToPublic=exports.privateToPublic=function(privateKey){return privateKey=exports.toBuffer(privateKey),secp256k1.publicKeyCreate(privateKey,!1).slice(1)};exports.importPublic=function(publicKey){return publicKey=exports.toBuffer(publicKey),64!==publicKey.length&&(publicKey=secp256k1.publicKeyConvert(publicKey,!1).slice(1)),publicKey},exports.ecsign=function(msgHash,privateKey){var sig=secp256k1.sign(msgHash,privateKey),ret={};return ret.r=sig.signature.slice(0,32),ret.s=sig.signature.slice(32,64),ret.v=sig.recovery+27,ret},exports.hashPersonalMessage=function(message){var prefix=exports.toBuffer("Ethereum Signed Message:\n"+message.length.toString());return exports.sha3(Buffer.concat([prefix,message]))},exports.ecrecover=function(msgHash,v,r,s){var signature=Buffer.concat([exports.setLength(r,32),exports.setLength(s,32)],64),recovery=v-27;if(0!==recovery&&1!==recovery)throw new Error("Invalid signature v value");var senderPubKey=secp256k1.recover(msgHash,signature,recovery);return secp256k1.publicKeyConvert(senderPubKey,!1).slice(1)},exports.toRpcSig=function(v,r,s){if(27!==v&&28!==v)throw new Error("Invalid recovery id");return exports.bufferToHex(Buffer.concat([exports.setLengthLeft(r,32),exports.setLengthLeft(s,32),exports.toBuffer(v-27)]))},exports.fromRpcSig=function(sig){if(sig=exports.toBuffer(sig),65!==sig.length)throw new Error("Invalid signature length");var v=sig[64];return v<27&&(v+=27),{v:v,r:sig.slice(0,32),s:sig.slice(32,64)}},exports.privateToAddress=function(privateKey){return exports.publicToAddress(privateToPublic(privateKey))},exports.isValidAddress=function(address){return/^0x[0-9a-fA-F]{40}$/i.test(address)},exports.toChecksumAddress=function(address){address=exports.stripHexPrefix(address).toLowerCase();for(var hash=exports.sha3(address).toString("hex"),ret="0x",i=0;i=8?address[i].toUpperCase():address[i];return ret},exports.isValidChecksumAddress=function(address){return exports.isValidAddress(address)&&exports.toChecksumAddress(address)===address},exports.generateAddress=function(from,nonce){return from=exports.toBuffer(from),nonce=new BN(nonce),nonce=nonce.isZero()?null:Buffer.from(nonce.toArray()),exports.rlphash([from,nonce]).slice(-20)},exports.isPrecompiled=function(address){var a=exports.unpad(address);return 1===a.length&&a[0]>0&&a[0]<5},exports.addHexPrefix=function(str){return"string"!=typeof str?str:exports.isHexPrefixed(str)?str:"0x"+str},exports.isValidSignature=function(v,r,s,homestead){const SECP256K1_N_DIV_2=new BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),SECP256K1_N=new BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===r.length&&32===s.length&&((27===v||28===v)&&(r=new BN(r),s=new BN(s),!(r.isZero()||r.gt(SECP256K1_N)||s.isZero()||s.gt(SECP256K1_N))&&(homestead!==!1||1!==new BN(s).cmp(SECP256K1_N_DIV_2))))},exports.baToJSON=function(ba){if(Buffer.isBuffer(ba))return"0x"+ba.toString("hex");if(ba instanceof Array){for(var array=[],i=0;i=v.length,"The field "+field.name+" must not have more "+field.length+" bytes")):field.allowZero&&0===v.length||!field.length||assert(field.length===v.length,"The field "+field.name+" must have byte length of "+field.length),self.raw[i]=v}self._fields.push(field.name),Object.defineProperty(self,field.name,{enumerable:!0,configurable:!0,get:getter,set:setter}),field.default&&(self[field.name]=field.default),field.alias&&Object.defineProperty(self,field.alias,{enumerable:!1,configurable:!0,set:setter,get:getter})}),data)if("string"==typeof data&&(data=Buffer.from(exports.stripHexPrefix(data),"hex")),Buffer.isBuffer(data)&&(data=rlp.decode(data)),Array.isArray(data)){if(data.length>self._fields.length)throw new Error("wrong number of fields in data");data.forEach(function(d,i){self[self._fields[i]]=exports.toBuffer(d)})}else{if("object"!=typeof data)throw new Error("invalid data");{const keys=Object.keys(data);fields.forEach(function(field){keys.indexOf(field.name)!==-1&&(self[field.name]=data[field.name]),keys.indexOf(field.alias)!==-1&&(self[field.alias]=data[field.alias])})}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function fsmEvent(start,events){function on(event,cb){emitter.on(event,cb)}function emit(str){function enter(){emitter._events[enterEv]?emitter.emit(enterEv,done):done()}function done(){emit._state=nwState,emitter.emit(nwState),emitter.emit("done")}const nwState=emit._events[emit._state][str];if(!reach(emit._state,nwState,emit._graph)){const err="invalid transition: "+emit._state+" -> "+str;return emitter.emit("error",err)}const leaveEv=emit._state+":leave",enterEv=nwState+":enter";return emit._state?function(){emitter._events[leaveEv]?emitter.emit(leaveEv,enter):enter()}():enter()}"object"==typeof start&&(events=start,start="START"),assert.equal(typeof start,"string"),assert.equal(typeof events,"object"),assert.ok(events[start],"invalid starting state "+start),assert.ok(fsm.validate(events));const emitter=new EventEmitter;return emit._graph=fsm.reachable(events),emit._emitter=emitter,emit._events=events,emit._state=start,emit.emit=emit,emit.on=on,emit}function reach(curr,next,reachable){if(!next)return!1;if(!curr)return!0;const here=reachable[curr];return!(!here||!here[next])&&1===here[next].length}const EventEmitter=__webpack_require__(11).EventEmitter,assert=__webpack_require__(9),fsm=__webpack_require__(370);module.exports=fsmEvent},function(module,exports){function each(obj,iter){for(var key in obj){iter(obj[key],key,obj)}}function keys(obj){return Object.keys(obj).sort()}function contains(a,v){return~a.indexOf(v)}function union(a,b){return a.filter(function(v){return contains(b,v)})}function disunion(a,b){return a.filter(function(v){return!contains(b,v)}).concat(b.filter(function(v){return!contains(a,v)})).sort()}function empty(v){for(var k in v)return!1;return!0}function events(fsm){var events=[];return each(fsm,function(state,name){each(state,function(_state,event){contains(events,event)||events.push(event)})}),events.sort()}var reachable=(exports.validate=function(fsm){Object.keys(fsm);return each(fsm,function(state,name){each(state,function(_state,event){if(!fsm[_state])throw new Error("invalid transition from state:"+name+" to state:"+_state+" on event:"+event)})}),!0},exports.reachable=function(fsm){var reachable={},added=!1;do{added=!1,each(fsm,function(state,name){var reach=reachable[name]=reachable[name]||{};each(state,function(_name,event){reach[_name]||(reach[_name]=[event],added=!0)}),each(state,function(_name,event){each(reachable[_name],function(path,_name){reach[_name]||(reach[_name]=[event].concat(path),added=!0)})})})}while(added);return reachable});exports.terminal=exports.deadlock=function(fsm){var dead=[];return each(fsm,function(state,name){empty(state)&&dead.push(name)}),dead};exports.livelock=function(fsm,terminals){var reach=reachable(fsm),locked=[];return each(reach,function(reaches,name){contains(terminals,name)||each(terminals,function(_name){reaches[_name]||contains(locked,name)||locked.push(name)})}),locked.sort()},exports.combine=function(fsm1,fsm2,start1,start2){function expand(name1,name2){var state,cName=name1+"-"+name2;combined[cName]||(combined[cName]={}),state=combined[cName];var trans1=keys(fsm1[name1]),trans2=keys(fsm2[name2]);return union(trans1,trans2).forEach(function(event){state[event]=fsm1[name1][event]+"-"+fsm2[name2][event],combined[state[event]]||expand(fsm1[name1][event],fsm2[name2][event])}),union(independent,trans1).forEach(function(event){state[event]=fsm1[name1][event]+"-"+name2,combined[state[event]]||expand(fsm1[name1][event],name2)}),union(independent,trans2).forEach(function(event){state[event]=name1+"-"+fsm2[name2][event],combined[state[event]]||expand(name1,fsm2[name2][event])}),combined[cName]}var combined={},events1=events(fsm1),events2=events(fsm2),independent=disunion(events1,events2);return expand(start1,start2),combined}},function(module,exports,__webpack_require__){var util=__webpack_require__(32),INDENT_START=/[\{\[]/,INDENT_END=/[\}\]]/;module.exports=function(){var lines=[],indent=0,push=function(str){for(var spaces="";spaces.length<2*indent;)spaces+=" ";lines.push(spaces+str)},line=function(fmt){return fmt?INDENT_END.test(fmt.trim()[0])&&INDENT_START.test(fmt[fmt.length-1])?(indent--,push(util.format.apply(util,arguments)),indent++,line):INDENT_START.test(fmt[fmt.length-1])?(push(util.format.apply(util,arguments)),indent++,line):INDENT_END.test(fmt.trim()[0])?(indent--,push(util.format.apply(util,arguments)),line):(push(util.format.apply(util,arguments)),line):line};return line.toString=function(){return lines.join("\n")},line.toFunction=function(scope){var src="return ("+line.toString()+")",keys=Object.keys(scope||{}).map(function(key){return key}),vals=keys.map(function(key){return scope[key]});return Function.apply(null,keys.concat(src)).apply(null,vals)},arguments.length&&line.apply(null,arguments),line}},function(module,exports,__webpack_require__){var isProperty=__webpack_require__(449),gen=function(obj,prop){return isProperty(prop)?obj+"."+prop:obj+"["+JSON.stringify(prop)+"]"};gen.valid=isProperty,gen.property=function(prop){return isProperty(prop)?prop:JSON.stringify(prop)},module.exports=gen},function(module,exports){module.exports=function(){if("undefined"==typeof window)return null;var wrtc={RTCPeerConnection:window.RTCPeerConnection||window.mozRTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.RTCSessionDescription||window.mozRTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.RTCIceCandidate||window.mozRTCIceCandidate||window.webkitRTCIceCandidate};return wrtc.RTCPeerConnection?wrtc:null}},function(module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return"[object Array]"==toString.call(arr)}},function(module,exports){try{module.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(err){module.exports=!1}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function HashBase(blockSize){Transform.call(this),this._block=new Buffer(blockSize),this._blockSize=blockSize,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}var Transform=__webpack_require__(25).Transform;__webpack_require__(1)(HashBase,Transform),HashBase.prototype._transform=function(chunk,encoding,callback){var error=null;try{"buffer"!==encoding&&(chunk=new Buffer(chunk,encoding)),this.update(chunk)}catch(err){error=err}callback(error)},HashBase.prototype._flush=function(callback){var error=null;try{this.push(this._digest())}catch(err){error=err}callback(error)},HashBase.prototype.update=function(data,encoding){if(!Buffer.isBuffer(data)&&"string"!=typeof data)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");Buffer.isBuffer(data)||(data=new Buffer(data,encoding||"binary"));for(var block=this._block,offset=0;this._blockOffset+data.length-offset>=this._blockSize;){for(var i=this._blockOffset;i0;++j)this._length[j]+=carry,(carry=this._length[j]/4294967296|0)>0&&(this._length[j]-=4294967296*carry);return this},HashBase.prototype._update=function(data){throw new Error("_update is not implemented")},HashBase.prototype.digest=function(encoding){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var digest=this._digest();return void 0!==encoding&&(digest=digest.toString(encoding)),digest},HashBase.prototype._digest=function(){throw new Error("_digest is not implemented")},module.exports=HashBase}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function Hmac(hash,key,enc){if(!(this instanceof Hmac))return new Hmac(hash,key,enc);this.Hash=hash,this.blockSize=hash.blockSize/8,this.outSize=hash.outSize/8,this.inner=null,this.outer=null,this._init(utils.toArray(key,enc))}var utils=__webpack_require__(27),assert=__webpack_require__(34);module.exports=Hmac,Hmac.prototype._init=function(key){key.length>this.blockSize&&(key=(new this.Hash).update(key).digest()),assert(key.length<=this.blockSize);for(var i=key.length;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(entropy,nonce,pers)}var hash=__webpack_require__(113),utils=__webpack_require__(236),assert=__webpack_require__(34);module.exports=HmacDRBG,HmacDRBG.prototype._init=function(entropy,nonce,pers){var seed=entropy.concat(nonce).concat(pers);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(entropy.concat(add||[])),this._reseed=1},HmacDRBG.prototype.generate=function(len,enc,add,addEnc){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof enc&&(addEnc=add,add=enc,enc=null),add&&(add=utils.toArray(add,addEnc||"hex"),this._update(add));for(var temp=[];temp.length{return err?callback(err):exists?void callback(null,this.data[key.toString()]):callback(new Error("No value"))})}has(key,callback){setImmediate(()=>{callback(null,void 0!==this.data[key.toString()])})}delete(key,callback){delete this.data[key.toString()],setImmediate(()=>{callback()})}batch(){let puts=[],dels=[];return{put(key,value){puts.push([key,value])},delete(key){dels.push(key)},commit:callback=>{puts.forEach(v=>{this.data[v[0].toString()]=v[1]}),puts=[],dels.forEach(key=>{delete this.data[key.toString()]}),dels=[],setImmediate(callback)}}}query(q){let tasks=[pull.keys(this.data),pull.map(k=>({key:new Key(k),value:this.data[k]}))],filters=[];if(null!=q.prefix){const prefix=q.prefix;filters.push((e,cb)=>cb(null,e.key.toString().startsWith(prefix)))}if(null!=q.filters&&(filters=filters.concat(q.filters)),tasks=tasks.concat(filters.map(f=>asyncFilter(f))),null!=q.orders&&(tasks=tasks.concat(q.orders.map(o=>asyncSort(o)))),null!=q.offset){let i=0;tasks.push(pull.filter(()=>i++>=q.offset))}return null!=q.limit&&tasks.push(pull.take(q.limit)),q.keysOnly===!0&&tasks.push(pull.map(e=>({key:e.key}))),pull.apply(null,tasks)}close(callback){setImmediate(callback)}}module.exports=MemoryDatastore},function(module,exports,__webpack_require__){"use strict";function _normalizeFamily(family){return family?family.toLowerCase():"ipv4"}var ip=exports,Buffer=__webpack_require__(0).Buffer,os=__webpack_require__(243);ip.toBuffer=function(ip,buff,offset){offset=~~offset;var result;if(this.isV4Format(ip))result=buff||new Buffer(offset+4),ip.split(/\./g).map(function(byte){result[offset++]=255&parseInt(byte,10)});else if(this.isV6Format(ip)){var i,sections=ip.split(":",8);for(i=0;i0;i--)argv.push("0");sections.splice.apply(sections,argv)}for(result=buff||new Buffer(offset+16),i=0;i>8&255,result[offset++]=255&word}}if(!result)throw Error("Invalid ip address: "+ip);return result},ip.toString=function(buff,offset,length){offset=~~offset,length=length||buff.length-offset;var result=[];if(4===length){for(var i=0;i32?"ipv6":_normalizeFamily(family);var len=4;"ipv6"===family&&(len=16);for(var buff=new Buffer(len),i=0,n=buff.length;i>bits)}return ip.toString(buff)},ip.mask=function(addr,mask){addr=ip.toBuffer(addr),mask=ip.toBuffer(mask);var result=new Buffer(Math.max(addr.length,mask.length)),i=0;if(addr.length===mask.length)for(i=0;ia.length&&(buff=b,other=a);for(var offset=buff.length-other.length,i=offset;i>>0},ip.fromLong=function(ipl){return(ipl>>>24)+"."+(ipl>>16&255)+"."+(ipl>>8&255)+"."+(255&ipl)}},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),each=__webpack_require__(19),eachSeries=__webpack_require__(71),waterfall=__webpack_require__(7),map=__webpack_require__(73),debounce=__webpack_require__(227),uniqWith=__webpack_require__(532),find=__webpack_require__(521),values=__webpack_require__(129),groupBy=__webpack_require__(523),pullAllWith=__webpack_require__(527),log=debug("bitswap:engine");log.error=debug("bitswap:engine:error");const Message=__webpack_require__(83),Wantlist=__webpack_require__(84),Ledger=__webpack_require__(389);class DecisionEngine{constructor(blockstore,network){this.blockstore=blockstore,this.network=network,this.ledgerMap=new Map,this._running=!1,this._tasks=[],this._outbox=debounce(this._processTasks.bind(this),100)}_sendBlocks(env,cb){const blocks=env.blocks;if(blocks.reduce((acc,b)=>{return acc+b.data.byteLength},0)<524288)return this._sendSafeBlocks(env.peer,blocks,cb);let size=0,batch=[];eachSeries(blocks,(b,cb)=>{if(batch.push(b),(size+=b.data.byteLength)>=524288){const nextBatch=batch.slice();batch=[],this._sendSafeBlocks(env.peer,nextBatch,cb)}else cb()},cb)}_sendSafeBlocks(peer,blocks,cb){const msg=new Message(!1);blocks.forEach(b=>{msg.addBlock(b)}),this.network.sendMessage(peer,msg,err=>{err&&log("sendblock error: %s",err.message),cb()})}_processTasks(){if(this._running&&this._tasks.length){const tasks=this._tasks;this._tasks=[];const entries=tasks.map(t=>t.entry),cids=entries.map(e=>e.cid),uniqCids=uniqWith(cids,(a,b)=>a.equals(b)),groupedTasks=groupBy(tasks,task=>task.target.toB58String());waterfall([cb=>map(uniqCids,(cid,cb)=>{this.blockstore.get(cid,cb)},cb),(blocks,cb)=>each(values(groupedTasks),(tasks,cb)=>{const peer=tasks[0].target,blockList=cids.map(cid=>{return find(blocks,b=>b.cid.equals(cid))});this._sendBlocks({peer:peer,blocks:blockList},err=>{err&&log.error("failed to send",err),blockList.forEach(block=>{this.messageSent(peer,block)}),cb()})})],err=>{this._tasks=[],err&&log.error(err)})}}wantlistForPeer(peerId){const peerIdStr=peerId.toB58String();return this.ledgerMap.has(peerIdStr)?this.ledgerMap.get(peerIdStr).wantlist.sortedEntries():new Map}peers(){return Array.from(this.ledgerMap.values()).map(l=>l.partner)}receivedBlocks(cids){cids.length&&(this.ledgerMap.forEach(ledger=>{cids.map(cid=>ledger.wantlistContains(cid)).filter(Boolean).forEach(entry=>{this._tasks.push({entry:entry,target:ledger.partner})})}),this._outbox())}messageReceived(peerId,msg,cb){const ledger=this._findOrCreate(peerId);if(msg.empty)return cb();if(msg.full&&(ledger.wantlist=new Wantlist),this._processBlocks(msg.blocks,ledger),0===msg.wantlist.size)return cb();let cancels=[],wants=[];msg.wantlist.forEach(entry=>{entry.cancel?(ledger.cancelWant(entry.cid),cancels.push(entry)):(ledger.wants(entry.cid,entry.priority),wants.push(entry))}),this._cancelWants(ledger,peerId,cancels),this._addWants(ledger,peerId,wants,cb)}_cancelWants(ledger,peerId,entries){const id=peerId.toB58String();pullAllWith(this._tasks,entries,(t,e)=>{const sameTarget=t.target.toB58String()===id,sameCid=t.entry.cid.equals(e.cid);return sameTarget&&sameCid})}_addWants(ledger,peerId,entries,cb){each(entries,(entry,cb)=>{this.blockstore.has(entry.cid,(err,exists)=>{err?log.error("failed existence check"):exists&&this._tasks.push({entry:entry.entry,target:peerId}),cb()})},()=>{this._outbox(),cb()})}_processBlocks(blocks,ledger,callback){const cids=[];blocks.forEach((b,cidStr)=>{log("got block (%s bytes)",b.data.length),ledger.receivedBytes(b.data.length),cids.push(b.cid)}),this.receivedBlocks(cids)}messageSent(peerId,block){const ledger=this._findOrCreate(peerId);ledger.sentBytes(block?block.data.length:0),block&&block.cid&&ledger.wantlist.remove(block.cid)}numBytesSentTo(peerId){return this._findOrCreate(peerId).accounting.bytesSent}numBytesReceivedFrom(peerId){return this._findOrCreate(peerId).accounting.bytesRecv}peerDisconnected(peerId){}_findOrCreate(peerId){const peerIdStr=peerId.toB58String();if(this.ledgerMap.has(peerIdStr))return this.ledgerMap.get(peerIdStr);const l=new Ledger(peerId);return this.ledgerMap.set(peerIdStr,l),l}start(){this._running=!0}stop(){this._running=!1}}module.exports=DecisionEngine},function(module,exports,__webpack_require__){"use strict";const Wantlist=__webpack_require__(84);class Ledger{constructor(peerId){this.partner=peerId,this.wantlist=new Wantlist,this.exchangeCount=0,this.sentToPeer=new Map,this.accounting={bytesSent:0,bytesRecv:0}}sentBytes(n){this.exchangeCount++,this.lastExchange=(new Date).getTime(),this.accounting.bytesSent+=n}receivedBytes(n){this.exchangeCount++,this.lastExchange=(new Date).getTime(),this.accounting.bytesRecv+=n}wants(cid,priority){this.wantlist.add(cid,priority)}cancelWant(cid){this.wantlist.remove(cid)}wantlistContains(cid){return this.wantlist.contains(cid)}}module.exports=Ledger},function(module,exports,__webpack_require__){"use strict";function writeMessage(conn,msg,callback){pull(pull.values([msg]),lp.encode(),conn,pull.onEnd(callback))}const debug=__webpack_require__(3),lp=__webpack_require__(23),pull=__webpack_require__(4),setImmediate=__webpack_require__(10),Message=__webpack_require__(83),CONSTANTS=__webpack_require__(116),log=debug("bitswap:network");log.error=debug("bitswap:network:error");const BITSWAP100="/ipfs/bitswap/1.0.0",BITSWAP110="/ipfs/bitswap/1.1.0";class Network{constructor(libp2p,peerBook,bitswap,b100Only){this.libp2p=libp2p,this.peerBook=peerBook,this.bitswap=bitswap,this.b100Only=b100Only||!1,this._running=!1,this.libp2p.swarm.setMaxListeners(CONSTANTS.maxListeners)}start(){this._running=!0,this._onPeerConnect=this._onPeerConnect.bind(this),this._onPeerDisconnect=this._onPeerDisconnect.bind(this),this._onConnection=this._onConnection.bind(this),this.libp2p.handle(BITSWAP100,this._onConnection),this.b100Only||this.libp2p.handle(BITSWAP110,this._onConnection),this.libp2p.on("peer:connect",this._onPeerConnect),this.libp2p.on("peer:disconnect",this._onPeerDisconnect),Object.keys(this.peerBook.getAll()).forEach(k=>this._onPeerConnect(this.peerBook.get(k)))}stop(){this._running=!1,this.libp2p.unhandle(BITSWAP100),this.b100Only||this.libp2p.unhandle(BITSWAP110),this.libp2p.removeListener("peer:connect",this._onPeerConnect),this.libp2p.removeListener("peer:disconnect",this._onPeerDisconnect)}_onConnection(protocol,conn){this._running&&(log("incomming new bitswap connection: %s",protocol),pull(conn,lp.decode(),pull.asyncMap((data,cb)=>Message.deserialize(data,cb)),pull.asyncMap((msg,cb)=>{conn.getPeerInfo((err,peerInfo)=>{if(err)return cb(err);this.bitswap._receiveMessage(peerInfo.id,msg,cb)})}),pull.onEnd(err=>{if(log("ending connection"),err)return this.bitswap._receiveError(err)})))}_onPeerConnect(peerInfo){this._running&&this.bitswap._onPeerConnected(peerInfo.id)}_onPeerDisconnect(peerInfo){this._running&&this.bitswap._onPeerDisconnected(peerInfo.id)}connectTo(peerId,callback){const done=err=>setImmediate(()=>callback(err));if(!this._running)return done(new Error("No running network"));this.libp2p.swarm.muxedConns[peerId.toB58String()]?done():done(new Error("Could not connect to peer with peerId:",peerId.toB58String()))}sendMessage(peerId,msg,callback){if(!this._running)return callback(new Error("No running network"));const stringId=peerId.toB58String();log("sendMessage to %s",stringId,msg);let peerInfo;try{peerInfo=this.peerBook.get(stringId)}catch(err){return callback(err)}this._dialPeer(peerInfo,(err,conn,protocol)=>{if(err)return callback(err);let serialized;switch(protocol){case BITSWAP100:serialized=msg.serializeToBitswap100();break;case BITSWAP110:serialized=msg.serializeToBitswap110();break;default:return callback(new Error("Unkown protocol: "+protocol))}writeMessage(conn,serialized,err=>{err&&log(err)}),callback()})}_dialPeer(peerInfo,callback){try{this.libp2p.dial(peerInfo,BITSWAP110,(err,conn)=>{if(err)return void this.libp2p.dial(peerInfo,BITSWAP100,(err,conn)=>{if(err)return callback(err);callback(null,conn,BITSWAP100)});callback(null,conn,BITSWAP110)})}catch(err){return callback(err)}}}module.exports=Network},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),Message=__webpack_require__(83),Wantlist=__webpack_require__(84),CONSTANTS=__webpack_require__(116),MsgQueue=__webpack_require__(392),log=debug("bitswap:wantmanager");log.error=debug("bitswap:wantmanager:error"),module.exports=class WantManager{constructor(network){this.peers=new Map,this.wantlist=new Wantlist,this.network=network}_addEntries(cids,cancel,force){const entries=cids.map((cid,i)=>{return new Message.Entry(cid,CONSTANTS.kMaxPriority-i,cancel)});entries.forEach(e=>{e.cancel?force?this.wantlist.removeForce(e.cid):this.wantlist.remove(e.cid):(log("adding to wl"),this.wantlist.add(e.cid,e.priority))});for(let p of this.peers.values())p.addEntries(entries)}_startPeerHandler(peerId){let mq=this.peers.get(peerId.toB58String());if(mq)return void mq.refcnt++;mq=new MsgQueue(peerId,this.network);const fullwantlist=new Message(!0);for(let entry of this.wantlist.entries())fullwantlist.addEntry(entry[1].cid,entry[1].priority);return mq.addMessage(fullwantlist),this.peers.set(peerId.toB58String(),mq),mq}_stopPeerHandler(peerId){const mq=this.peers.get(peerId.toB58String());mq&&(--mq.refcnt>0||this.peers.delete(peerId.toB58String()))}wantBlocks(cids){this._addEntries(cids,!1)}unwantBlocks(cids){log("unwant blocks: %s",cids.length),this._addEntries(cids,!0,!0)}cancelWants(cids){log("cancel wants: %s",cids.length),this._addEntries(cids,!0)}connectedPeers(){return Array.from(this.peers.keys())}connected(peerId){this._startPeerHandler(peerId)}disconnected(peerId){this._stopPeerHandler(peerId)}run(){this.timer=setInterval(()=>{const fullwantlist=new Message(!0);for(let entry of this.wantlist.entries())fullwantlist.addEntry(entry[1].cid,entry[1].priority);this.peers.forEach(p=>{p.addMessage(fullwantlist)})},1e4)}stop(){for(let mq of this.peers.values())this.disconnected(mq.peerId);clearInterval(this.timer)}}},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),debounce=__webpack_require__(227),Message=__webpack_require__(83),log=debug("bitswap:wantmanager:queue");log.error=debug("bitswap:wantmanager:queue:error"),module.exports=class MsgQueue{constructor(peerId,network){this.peerId=peerId,this.network=network,this.refcnt=1,this._entries=[],this.sendEntries=debounce(this._sendEntries.bind(this),200)}addMessage(msg){msg.empty||this.send(msg)}addEntries(entries){this._entries=this._entries.concat(entries),this.sendEntries()}_sendEntries(){if(this._entries.length){const msg=new Message(!1);this._entries.forEach(entry=>{entry.cancel?msg.cancel(entry.cid):msg.addEntry(entry.cid,entry.priority)}),this._entries=[],this.addMessage(msg)}}send(msg){this.network.connectTo(this.peerId,err=>{if(err)return void log.error("cant connect to peer %s: %s",this.peerId.toB58String(),err.message);log("sending message"),this.network.sendMessage(this.peerId,msg,err=>{err&&log.error("send error: %s",err.message)})})}}},function(module,exports,__webpack_require__){"use strict";const waterfall=__webpack_require__(7),reject=__webpack_require__(160),each=__webpack_require__(19),EventEmitter=__webpack_require__(11).EventEmitter,debug=__webpack_require__(3),CONSTANTS=__webpack_require__(116),WantManager=__webpack_require__(391),Network=__webpack_require__(390),DecisionEngine=__webpack_require__(388),log=debug("bitswap");log.error=debug("bitswap:error");class Bitswap{constructor(libp2p,blockstore,peerBook){this.libp2p=libp2p,this.network=new Network(libp2p,peerBook,this),this.blockstore=blockstore,this.engine=new DecisionEngine(blockstore,this.network),this.wm=new WantManager(this.network),this.blocksRecvd=0,this.dupBlocksRecvd=0,this.dupDataRecvd=0,this.notifications=new EventEmitter,this.notifications.setMaxListeners(CONSTANTS.maxListeners)}_receiveMessage(peerId,incoming,callback){this.engine.messageReceived(peerId,incoming,err=>{if(err&&log("failed to receive message",incoming),0===incoming.blocks.size)return callback();const blocks=Array.from(incoming.blocks.values()),toCancel=blocks.filter(b=>this.wm.wantlist.contains(b.cid)).map(b=>b.cid);this.wm.cancelWants(toCancel),each(blocks,(b,cb)=>this._handleReceivedBlock(peerId,b,cb),callback)})}_handleReceivedBlock(peerId,block,callback){log("received block"),waterfall([cb=>this.blockstore.has(block.cid,cb),(has,cb)=>{if(this._updateReceiveCounters(block,has),has)return cb();this._putBlock(block,cb)}],callback)}_updateReceiveCounters(block,exists){this.blocksRecvd++,exists&&(this.dupBlocksRecvd++,this.dupDataRecvd+=block.data.length)}_receiveError(err){log.error("ReceiveError: %s",err.message)}_onPeerConnected(peerId){this.wm.connected(peerId)}_onPeerDisconnected(peerId){this.wm.disconnected(peerId),this.engine.peerDisconnected(peerId)}_putBlock(block,callback){this.blockstore.put(block,err=>{if(err)return callback(err);this.notifications.emit(`block:${block.cid.buffer.toString()}`,block),this.engine.receivedBlocks([block.cid]),callback()})}wantlistForPeer(peerId){return this.engine.wantlistForPeer(peerId)}get(cid,callback){const unwantListeners={},blockListeners={},cidStr=cid.buffer.toString(),unwantEvent=`unwant:${cidStr}`,blockEvent=`block:${cidStr}`;log("get: %s",cidStr);const cleanupListener=()=>{ -unwantListeners[cidStr]&&(this.notifications.removeListener(unwantEvent,unwantListeners[cidStr]),delete unwantListeners[cidStr]),blockListeners[cidStr]&&(this.notifications.removeListener(blockEvent,blockListeners[cidStr]),delete blockListeners[cidStr])},addListener=()=>{unwantListeners[cidStr]=(()=>{log(`manual unwant: ${cidStr}`),cleanupListener(),this.wm.cancelWants([cid]),callback()}),blockListeners[cidStr]=(block=>{this.wm.cancelWants([cid]),cleanupListener(cid),callback(null,block)}),this.notifications.once(unwantEvent,unwantListeners[cidStr]),this.notifications.once(blockEvent,blockListeners[cidStr])};this.blockstore.has(cid,(err,has)=>{return err?callback(err):has?(log("already have block: %s",cidStr),this.blockstore.get(cid,callback)):(addListener(),void this.wm.wantBlocks([cid]))})}unwant(cids){Array.isArray(cids)||(cids=[cids]),this.wm.unwantBlocks(cids),cids.forEach(cid=>{this.notifications.emit(`unwant:${cid.buffer.toString()}`)})}cancelWants(cids){Array.isArray(cids)||(cids=[cids]),this.wm.cancelWants(cids)}put(block,callback){log("putting block"),waterfall([cb=>this.blockstore.has(block.cid,cb),(has,cb)=>{if(has)return cb();this._putBlock(block,cb)}],callback)}putMany(blocks,callback){waterfall([cb=>reject(blocks,(b,cb)=>{this.blockstore.has(b.cid,cb)},cb),(newBlocks,cb)=>this.blockstore.putMany(newBlocks,err=>{if(err)return cb(err);newBlocks.forEach(block=>{this.notifications.emit(`block:${block.cid.buffer.toString()}`,block),this.engine.receivedBlocks([block.cid])}),cb()})],callback)}getWantlist(){return this.wm.wantlist.entries()}stat(){return{wantlist:this.getWantlist(),blocksReceived:this.blocksRecvd,dupBlksReceived:this.dupBlocksRecvd,dupDataReceived:this.dupDataRecvd,peers:this.engine.peers()}}start(){this.wm.run(),this.network.start(),this.engine.start()}stop(){this.wm.stop(this.libp2p.peerInfo.id),this.network.stop(),this.engine.stop()}}module.exports=Bitswap},function(module,exports,__webpack_require__){"use strict";const WantlistEntry=__webpack_require__(84).Entry,CID=__webpack_require__(8),assert=__webpack_require__(9);module.exports=class BitswapMessageEntry{constructor(cid,priority,cancel){assert(CID.isCID(cid),"needs valid cid"),this.entry=new WantlistEntry(cid,priority),this.cancel=Boolean(cancel)}get cid(){return this.entry.cid}set cid(cid){this.entry.cid=cid}get priority(){return this.entry.priority}set priority(val){this.entry.priority=val}get[Symbol.toStringTag](){return`BitswapMessageEntry ${this.cid.toBaseEncodedString()} `}equals(other){return this.cancel===other.cancel&&this.entry.equals(other.entry)}}},function(module,exports,__webpack_require__){"use strict";module.exports=` +`},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const waterfall=__webpack_require__(6),parallel=__webpack_require__(40),pull=__webpack_require__(4),Key=__webpack_require__(16).Key,sh=__webpack_require__(180),KeytransformStore=__webpack_require__(83),shardKey=new Key(sh.SHARDING_FN),shardReadmeKey=new Key(sh.README_FN);class ShardingDatastore{constructor(store,shard){this.child=new KeytransformStore(store,{convert:this._convertKey.bind(this),invert:this._invertKey.bind(this)}),this.shard=shard}open(callback){this.child.open(callback)}_convertKey(key){const s=key.toString();return s===shardKey.toString()||s===shardReadmeKey.toString()?key:new Key(this.shard.fun(s)).child(key)}_invertKey(key){const s=key.toString();return s===shardKey.toString()||s===shardReadmeKey.toString()?key:Key.withNamespaces(key.list().slice(1))}static createOrOpen(store,shard,callback){ShardingDatastore.create(store,shard,err=>{if(err&&"datastore exists"!==err.message)return callback(err);ShardingDatastore.open(store,callback)})}static open(store,callback){waterfall([cb=>sh.readShardFun("/",store,cb),(shard,cb)=>{cb(null,new ShardingDatastore(store,shard))}],callback)}static create(store,shard,callback){store.has(shardKey,(err,exists)=>{if(err)return callback(err);if(!exists){const put="function"==typeof store.putRaw?store.putRaw.bind(store):store.put.bind(store);return parallel([cb=>put(shardKey,new Buffer(shard.toString()+"\n"),cb),cb=>put(shardReadmeKey,new Buffer(sh.readme),cb)],err=>callback(err))}sh.readShardFun("/",store,(err,diskShard)=>{if(err)return callback(err);const a=(diskShard||"").toString(),b=shard.toString();if(a!==b)return callback(new Error(`specified fun ${b} does not match repo shard fun ${a}`));callback(new Error("datastore exists"))})})}put(key,val,callback){this.child.put(key,val,callback)}get(key,callback){this.child.get(key,callback)}has(key,callback){this.child.has(key,callback)}delete(key,callback){this.child.delete(key,callback)}batch(){return this.child.batch()}query(q){const tq={keysOnly:q.keysOnly};return null!=q.prefix&&(tq.prefix=q.prefix),null!=q.filters&&(tq.filters=q.filters.map(f=>(e,cb)=>{f(Object.assign({},e,{key:this._invertKey(e.key)}),cb)})),null!=q.orders&&(tq.orders=q.orders.map(o=>(res,cb)=>{o(res.map(e=>{return Object.assign({},e,{key:this._invertKey(e.key)})}),cb)})),null!=q.offset&&(tq.offset=q.offset+2),null!=q.limit&&(tq.limit=q.limit+2),pull(this.child.query(tq),pull.filter(e=>{return e.key.toString()!==shardKey.toString()&&e.key.toString()!==shardReadmeKey.toString()}))}close(callback){this.child.close(callback)}}module.exports=ShardingDatastore}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const each=__webpack_require__(15),whilst=__webpack_require__(76);class TieredDatastore{constructor(stores){this.stores=stores.slice()}open(callback){each(this.stores,(store,cb)=>{store.open(cb)},callback)}put(key,value,callback){each(this.stores,(store,cb)=>{store.put(key,value,cb)},callback)}get(key,callback){const storeLength=this.stores.length;let done=!1,i=0;whilst(()=>!done&&i{this.stores[i++].get(key,(err,res)=>{if(null==err)return done=!0,cb(null,res);cb()})},callback)}has(key,callback){const storeLength=this.stores.length;let done=!1,i=0;whilst(()=>!done&&i{this.stores[i++].has(key,(err,exists)=>{if(null==err)return done=!0,cb(null,exists);cb()})},callback)}delete(key,callback){each(this.stores,(store,cb)=>{store.delete(key,cb)},callback)}close(callback){each(this.stores,(store,cb)=>{store.close(cb)},callback)}batch(){const batches=this.stores.map(store=>store.batch());return{put:(key,value)=>{batches.forEach(b=>b.put(key,value))},delete:key=>{batches.forEach(b=>b.delete(key))},commit:callback=>{each(batches,(b,cb)=>{b.commit(cb)},callback)}}}query(q){return this.stores[this.stores.length-1].query(q)}}module.exports=TieredDatastore},function(module,exports,__webpack_require__){function selectColor(namespace){var i,hash=0;for(i in namespace)hash=(hash<<5)-hash+namespace.charCodeAt(i),hash|=0;return exports.colors[Math.abs(hash)%exports.colors.length]}function createDebug(namespace){function debug(){if(debug.enabled){var self=debug,curr=+new Date,ms=curr-(prevTime||curr);self.diff=ms,self.prev=prevTime,self.curr=curr,prevTime=curr;for(var args=new Array(arguments.length),i=0;ithis._reseedInterval)throw new Error("Reseed is required");add&&0===add.length&&(add=void 0),add&&this._update(add);for(var temp=new Buffer(0);temp.length0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function BasePoint(curve,type){this.curve=curve,this.type=type,this.precomputed=null}var BN=__webpack_require__(13),elliptic=__webpack_require__(20),utils=elliptic.utils,getNAF=utils.getNAF,getJSF=utils.getJSF,assert=utils.assert;module.exports=BaseCurve,BaseCurve.prototype.point=function(){throw new Error("Not implemented")},BaseCurve.prototype.validate=function(){throw new Error("Not implemented")},BaseCurve.prototype._fixedNafMul=function(p,k){assert(p.precomputed);var doubles=p._getDoubles(),naf=getNAF(k,1),I=(1<=j;k--)nafW=(nafW<<1)+naf[k];repr.push(nafW)}for(var a=this.jpoint(null,null,null),b=this.jpoint(null,null,null),i=I;i>0;i--){for(var j=0;j=0;i--){for(var k=0;i>=0&&0===naf[i];i--)k++;if(i>=0&&k++,acc=acc.dblp(k),i<0)break;var z=naf[i];assert(0!==z),acc="affine"===p.type?z>0?acc.mixedAdd(wnd[z-1>>1]):acc.mixedAdd(wnd[-z-1>>1].neg()):z>0?acc.add(wnd[z-1>>1]):acc.add(wnd[-z-1>>1].neg())}return"affine"===p.type?acc.toP():acc},BaseCurve.prototype._wnafMulAdd=function(defW,points,coeffs,len,jacobianResult){for(var wndWidth=this._wnafT1,wnd=this._wnafT2,naf=this._wnafT3,max=0,i=0;i=1;i-=2){var a=i-1,b=i;if(1===wndWidth[a]&&1===wndWidth[b]){var comb=[points[a],null,null,points[b]];0===points[a].y.cmp(points[b].y)?(comb[1]=points[a].add(points[b]),comb[2]=points[a].toJ().mixedAdd(points[b].neg())):0===points[a].y.cmp(points[b].y.redNeg())?(comb[1]=points[a].toJ().mixedAdd(points[b]),comb[2]=points[a].add(points[b].neg())):(comb[1]=points[a].toJ().mixedAdd(points[b]),comb[2]=points[a].toJ().mixedAdd(points[b].neg()));var index=[-3,-1,-5,-7,0,7,5,1,3],jsf=getJSF(coeffs[a],coeffs[b]);max=Math.max(jsf[0].length,max),naf[a]=new Array(max),naf[b]=new Array(max);for(var j=0;j=0;i--){for(var k=0;i>=0;){for(var zero=!0,j=0;j=0&&k++,acc=acc.dblp(k),i<0)break;for(var j=0;j0?p=wnd[j][z-1>>1]:z<0&&(p=wnd[j][-z-1>>1].neg()),acc="affine"===p.type?acc.mixedAdd(p):acc.add(p))}}for(var i=0;i=Math.ceil((k.bitLength()+1)/doubles.step)},BasePoint.prototype._getDoubles=function(step,power){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var doubles=[this],acc=this,i=0;i":""},Point.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},Point.prototype._extDbl=function(){var a=this.x.redSqr(),b=this.y.redSqr(),c=this.z.redSqr();c=c.redIAdd(c);var d=this.curve._mulA(a),e=this.x.redAdd(this.y).redSqr().redISub(a).redISub(b),g=d.redAdd(b),f=g.redSub(c),h=d.redSub(b),nx=e.redMul(f),ny=g.redMul(h),nt=e.redMul(h),nz=f.redMul(g);return this.curve.point(nx,ny,nz,nt)},Point.prototype._projDbl=function(){var nx,ny,nz,b=this.x.redAdd(this.y).redSqr(),c=this.x.redSqr(),d=this.y.redSqr();if(this.curve.twisted){var e=this.curve._mulA(c),f=e.redAdd(d);if(this.zOne)nx=b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two)),ny=f.redMul(e.redSub(d)),nz=f.redSqr().redSub(f).redSub(f);else{var h=this.z.redSqr(),j=f.redSub(h).redISub(h);nx=b.redSub(c).redISub(d).redMul(j),ny=f.redMul(e.redSub(d)),nz=f.redMul(j)}}else{var e=c.redAdd(d),h=this.curve._mulC(this.c.redMul(this.z)).redSqr(),j=e.redSub(h).redSub(h);nx=this.curve._mulC(b.redISub(e)).redMul(j),ny=this.curve._mulC(e).redMul(c.redISub(d)),nz=e.redMul(j)}return this.curve.point(nx,ny,nz)},Point.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Point.prototype._extAdd=function(p){var a=this.y.redSub(this.x).redMul(p.y.redSub(p.x)),b=this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)),c=this.t.redMul(this.curve.dd).redMul(p.t),d=this.z.redMul(p.z.redAdd(p.z)),e=b.redSub(a),f=d.redSub(c),g=d.redAdd(c),h=b.redAdd(a),nx=e.redMul(f),ny=g.redMul(h),nt=e.redMul(h),nz=f.redMul(g);return this.curve.point(nx,ny,nz,nt)},Point.prototype._projAdd=function(p){var ny,nz,a=this.z.redMul(p.z),b=a.redSqr(),c=this.x.redMul(p.x),d=this.y.redMul(p.y),e=this.curve.d.redMul(c).redMul(d),f=b.redSub(e),g=b.redAdd(e),tmp=this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d),nx=a.redMul(f).redMul(tmp);return this.curve.twisted?(ny=a.redMul(g).redMul(d.redSub(this.curve._mulA(c))),nz=f.redMul(g)):(ny=a.redMul(g).redMul(d.redSub(c)),nz=this.curve._mulC(f).redMul(g)),this.curve.point(nx,ny,nz)},Point.prototype.add=function(p){return this.isInfinity()?p:p.isInfinity()?this:this.curve.extended?this._extAdd(p):this._projAdd(p)},Point.prototype.mul=function(k){return this._hasDoubles(k)?this.curve._fixedNafMul(this,k):this.curve._wnafMul(this,k)},Point.prototype.mulAdd=function(k1,p,k2){return this.curve._wnafMulAdd(1,[this,p],[k1,k2],2,!1)},Point.prototype.jmulAdd=function(k1,p,k2){return this.curve._wnafMulAdd(1,[this,p],[k1,k2],2,!0)},Point.prototype.normalize=function(){if(this.zOne)return this;var zi=this.z.redInvm();return this.x=this.x.redMul(zi),this.y=this.y.redMul(zi),this.t&&(this.t=this.t.redMul(zi)),this.z=this.curve.one,this.zOne=!0,this},Point.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Point.prototype.getY=function(){return this.normalize(),this.y.fromRed()},Point.prototype.eq=function(other){return this===other||0===this.getX().cmp(other.getX())&&0===this.getY().cmp(other.getY())},Point.prototype.eqXToP=function(x){var rx=x.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(rx))return!0;for(var xc=x.clone(),t=this.curve.redN.redMul(this.z);;){if(xc.iadd(this.curve.n),xc.cmp(this.curve.p)>=0)return!1;if(rx.redIAdd(t),0===this.x.cmp(rx))return!0}return!1},Point.prototype.toP=Point.prototype.normalize,Point.prototype.mixedAdd=Point.prototype.add},function(module,exports,__webpack_require__){"use strict";function MontCurve(conf){Base.call(this,"mont",conf),this.a=new BN(conf.a,16).toRed(this.red),this.b=new BN(conf.b,16).toRed(this.red),this.i4=new BN(4).toRed(this.red).redInvm(),this.two=new BN(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function Point(curve,x,z){Base.BasePoint.call(this,curve,"projective"),null===x&&null===z?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new BN(x,16),this.z=new BN(z,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var curve=__webpack_require__(84),BN=__webpack_require__(13),inherits=__webpack_require__(2),Base=curve.base,elliptic=__webpack_require__(20),utils=elliptic.utils;inherits(MontCurve,Base),module.exports=MontCurve,MontCurve.prototype.validate=function(point){var x=point.normalize().x,x2=x.redSqr(),rhs=x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);return 0===rhs.redSqrt().redSqr().cmp(rhs)},inherits(Point,Base.BasePoint),MontCurve.prototype.decodePoint=function(bytes,enc){return this.point(utils.toArray(bytes,enc),1)},MontCurve.prototype.point=function(x,z){return new Point(this,x,z)},MontCurve.prototype.pointFromJSON=function(obj){return Point.fromJSON(this,obj)},Point.prototype.precompute=function(){},Point.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Point.fromJSON=function(curve,obj){return new Point(curve,obj[0],obj[1]||curve.one)},Point.prototype.inspect=function(){return this.isInfinity()?"":""},Point.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Point.prototype.dbl=function(){var a=this.x.redAdd(this.z),aa=a.redSqr(),b=this.x.redSub(this.z),bb=b.redSqr(),c=aa.redSub(bb),nx=aa.redMul(bb),nz=c.redMul(bb.redAdd(this.curve.a24.redMul(c)));return this.curve.point(nx,nz)},Point.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.diffAdd=function(p,diff){var a=this.x.redAdd(this.z),b=this.x.redSub(this.z),c=p.x.redAdd(p.z),d=p.x.redSub(p.z),da=d.redMul(a),cb=c.redMul(b),nx=diff.z.redMul(da.redAdd(cb).redSqr()),nz=diff.x.redMul(da.redISub(cb).redSqr());return this.curve.point(nx,nz)},Point.prototype.mul=function(k){for(var t=k.clone(),a=this,b=this.curve.point(null,null),c=this,bits=[];0!==t.cmpn(0);t.iushrn(1))bits.push(t.andln(1));for(var i=bits.length-1;i>=0;i--)0===bits[i]?(a=a.diffAdd(b,c),b=b.dbl()):(b=a.diffAdd(b,c),a=a.dbl());return b},Point.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.eq=function(other){return 0===this.getX().cmp(other.getX())},Point.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(module,exports,__webpack_require__){"use strict";function ShortCurve(conf){Base.call(this,"short",conf),this.a=new BN(conf.a,16).toRed(this.red),this.b=new BN(conf.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(conf),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function Point(curve,x,y,isRed){Base.BasePoint.call(this,curve,"affine"),null===x&&null===y?(this.x=null,this.y=null,this.inf=!0):(this.x=new BN(x,16),this.y=new BN(y,16),isRed&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function JPoint(curve,x,y,z){Base.BasePoint.call(this,curve,"jacobian"),null===x&&null===y&&null===z?(this.x=this.curve.one,this.y=this.curve.one, +this.z=new BN(0)):(this.x=new BN(x,16),this.y=new BN(y,16),this.z=new BN(z,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}var curve=__webpack_require__(84),elliptic=__webpack_require__(20),BN=__webpack_require__(13),inherits=__webpack_require__(2),Base=curve.base,assert=elliptic.utils.assert;inherits(ShortCurve,Base),module.exports=ShortCurve,ShortCurve.prototype._getEndomorphism=function(conf){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var beta,lambda;if(conf.beta)beta=new BN(conf.beta,16).toRed(this.red);else{var betas=this._getEndoRoots(this.p);beta=betas[0].cmp(betas[1])<0?betas[0]:betas[1],beta=beta.toRed(this.red)}if(conf.lambda)lambda=new BN(conf.lambda,16);else{var lambdas=this._getEndoRoots(this.n);0===this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta))?lambda=lambdas[0]:(lambda=lambdas[1],assert(0===this.g.mul(lambda).x.cmp(this.g.x.redMul(beta))))}var basis;return basis=conf.basis?conf.basis.map(function(vec){return{a:new BN(vec.a,16),b:new BN(vec.b,16)}}):this._getEndoBasis(lambda),{beta:beta,lambda:lambda,basis:basis}}},ShortCurve.prototype._getEndoRoots=function(num){var red=num===this.p?this.red:BN.mont(num),tinv=new BN(2).toRed(red).redInvm(),ntinv=tinv.redNeg(),s=new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);return[ntinv.redAdd(s).fromRed(),ntinv.redSub(s).fromRed()]},ShortCurve.prototype._getEndoBasis=function(lambda){for(var a0,b0,a1,b1,a2,b2,prevR,r,x,aprxSqrt=this.n.ushrn(Math.floor(this.n.bitLength()/2)),u=lambda,v=this.n.clone(),x1=new BN(1),y1=new BN(0),x2=new BN(0),y2=new BN(1),i=0;0!==u.cmpn(0);){var q=v.div(u);r=v.sub(q.mul(u)),x=x2.sub(q.mul(x1));var y=y2.sub(q.mul(y1));if(!a1&&r.cmp(aprxSqrt)<0)a0=prevR.neg(),b0=x1,a1=r.neg(),b1=x;else if(a1&&2==++i)break;prevR=r,v=u,u=r,x2=x1,x1=x,y2=y1,y1=y}a2=r.neg(),b2=x;var len1=a1.sqr().add(b1.sqr());return a2.sqr().add(b2.sqr()).cmp(len1)>=0&&(a2=a0,b2=b0),a1.negative&&(a1=a1.neg(),b1=b1.neg()),a2.negative&&(a2=a2.neg(),b2=b2.neg()),[{a:a1,b:b1},{a:a2,b:b2}]},ShortCurve.prototype._endoSplit=function(k){var basis=this.endo.basis,v1=basis[0],v2=basis[1],c1=v2.b.mul(k).divRound(this.n),c2=v1.b.neg().mul(k).divRound(this.n),p1=c1.mul(v1.a),p2=c2.mul(v2.a),q1=c1.mul(v1.b),q2=c2.mul(v2.b);return{k1:k.sub(p1).sub(p2),k2:q1.add(q2).neg()}},ShortCurve.prototype.pointFromX=function(x,odd){x=new BN(x,16),x.red||(x=x.toRed(this.red));var y2=x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b),y=y2.redSqrt();if(0!==y.redSqr().redSub(y2).cmp(this.zero))throw new Error("invalid point");var isOdd=y.fromRed().isOdd();return(odd&&!isOdd||!odd&&isOdd)&&(y=y.redNeg()),this.point(x,y)},ShortCurve.prototype.validate=function(point){if(point.inf)return!0;var x=point.x,y=point.y,ax=this.a.redMul(x),rhs=x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);return 0===y.redSqr().redISub(rhs).cmpn(0)},ShortCurve.prototype._endoWnafMulAdd=function(points,coeffs,jacobianResult){for(var npoints=this._endoWnafT1,ncoeffs=this._endoWnafT2,i=0;i":""},Point.prototype.isInfinity=function(){return this.inf},Point.prototype.add=function(p){if(this.inf)return p;if(p.inf)return this;if(this.eq(p))return this.dbl();if(this.neg().eq(p))return this.curve.point(null,null);if(0===this.x.cmp(p.x))return this.curve.point(null,null);var c=this.y.redSub(p.y);0!==c.cmpn(0)&&(c=c.redMul(this.x.redSub(p.x).redInvm()));var nx=c.redSqr().redISub(this.x).redISub(p.x),ny=c.redMul(this.x.redSub(nx)).redISub(this.y);return this.curve.point(nx,ny)},Point.prototype.dbl=function(){if(this.inf)return this;var ys1=this.y.redAdd(this.y);if(0===ys1.cmpn(0))return this.curve.point(null,null);var a=this.curve.a,x2=this.x.redSqr(),dyinv=ys1.redInvm(),c=x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv),nx=c.redSqr().redISub(this.x.redAdd(this.x)),ny=c.redMul(this.x.redSub(nx)).redISub(this.y);return this.curve.point(nx,ny)},Point.prototype.getX=function(){return this.x.fromRed()},Point.prototype.getY=function(){return this.y.fromRed()},Point.prototype.mul=function(k){return k=new BN(k,16),this._hasDoubles(k)?this.curve._fixedNafMul(this,k):this.curve.endo?this.curve._endoWnafMulAdd([this],[k]):this.curve._wnafMul(this,k)},Point.prototype.mulAdd=function(k1,p2,k2){var points=[this,p2],coeffs=[k1,k2];return this.curve.endo?this.curve._endoWnafMulAdd(points,coeffs):this.curve._wnafMulAdd(1,points,coeffs,2)},Point.prototype.jmulAdd=function(k1,p2,k2){var points=[this,p2],coeffs=[k1,k2];return this.curve.endo?this.curve._endoWnafMulAdd(points,coeffs,!0):this.curve._wnafMulAdd(1,points,coeffs,2,!0)},Point.prototype.eq=function(p){return this===p||this.inf===p.inf&&(this.inf||0===this.x.cmp(p.x)&&0===this.y.cmp(p.y))},Point.prototype.neg=function(_precompute){if(this.inf)return this;var res=this.curve.point(this.x,this.y.redNeg());if(_precompute&&this.precomputed){var pre=this.precomputed,negate=function(p){return p.neg()};res.precomputed={naf:pre.naf&&{wnd:pre.naf.wnd,points:pre.naf.points.map(negate)},doubles:pre.doubles&&{step:pre.doubles.step,points:pre.doubles.points.map(negate)}}}return res},Point.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},inherits(JPoint,Base.BasePoint),ShortCurve.prototype.jpoint=function(x,y,z){return new JPoint(this,x,y,z)},JPoint.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var zinv=this.z.redInvm(),zinv2=zinv.redSqr(),ax=this.x.redMul(zinv2),ay=this.y.redMul(zinv2).redMul(zinv);return this.curve.point(ax,ay)},JPoint.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},JPoint.prototype.add=function(p){if(this.isInfinity())return p;if(p.isInfinity())return this;var pz2=p.z.redSqr(),z2=this.z.redSqr(),u1=this.x.redMul(pz2),u2=p.x.redMul(z2),s1=this.y.redMul(pz2.redMul(p.z)),s2=p.y.redMul(z2.redMul(this.z)),h=u1.redSub(u2),r=s1.redSub(s2);if(0===h.cmpn(0))return 0!==r.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h2=h.redSqr(),h3=h2.redMul(h),v=u1.redMul(h2),nx=r.redSqr().redIAdd(h3).redISub(v).redISub(v),ny=r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)),nz=this.z.redMul(p.z).redMul(h);return this.curve.jpoint(nx,ny,nz)},JPoint.prototype.mixedAdd=function(p){if(this.isInfinity())return p.toJ();if(p.isInfinity())return this;var z2=this.z.redSqr(),u1=this.x,u2=p.x.redMul(z2),s1=this.y,s2=p.y.redMul(z2).redMul(this.z),h=u1.redSub(u2),r=s1.redSub(s2);if(0===h.cmpn(0))return 0!==r.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h2=h.redSqr(),h3=h2.redMul(h),v=u1.redMul(h2),nx=r.redSqr().redIAdd(h3).redISub(v).redISub(v),ny=r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)),nz=this.z.redMul(h);return this.curve.jpoint(nx,ny,nz)},JPoint.prototype.dblp=function(pow){if(0===pow)return this;if(this.isInfinity())return this;if(!pow)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var r=this,i=0;i=0)return!1;if(rx.redIAdd(t),0===this.x.cmp(rx))return!0}return!1},JPoint.prototype.inspect=function(){return this.isInfinity()?"":""},JPoint.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(module,exports,__webpack_require__){"use strict";function PresetCurve(options){"short"===options.type?this.curve=new elliptic.curve.short(options):"edwards"===options.type?this.curve=new elliptic.curve.edwards(options):this.curve=new elliptic.curve.mont(options),this.g=this.curve.g,this.n=this.curve.n,this.hash=options.hash,assert(this.g.validate(),"Invalid curve"),assert(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function defineCurve(name,options){Object.defineProperty(curves,name,{configurable:!0,enumerable:!0,get:function(){var curve=new PresetCurve(options);return Object.defineProperty(curves,name,{configurable:!0,enumerable:!0,value:curve}),curve}})}var curves=exports,hash=__webpack_require__(117),elliptic=__webpack_require__(20),assert=elliptic.utils.assert;curves.PresetCurve=PresetCurve,defineCurve("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:hash.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),defineCurve("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:hash.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),defineCurve("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:hash.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),defineCurve("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:hash.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),defineCurve("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:hash.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),defineCurve("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hash.sha256,gRed:!1,g:["9"]}),defineCurve("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hash.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var pre;try{pre=__webpack_require__(356)}catch(e){pre=void 0}defineCurve("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:hash.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",pre]})},function(module,exports,__webpack_require__){"use strict";function EC(options){if(!(this instanceof EC))return new EC(options);"string"==typeof options&&(assert(elliptic.curves.hasOwnProperty(options),"Unknown curve "+options),options=elliptic.curves[options]),options instanceof elliptic.curves.PresetCurve&&(options={curve:options}),this.curve=options.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=options.curve.g,this.g.precompute(options.curve.n.bitLength()+1),this.hash=options.hash||options.curve.hash}var BN=__webpack_require__(13),HmacDRBG=__webpack_require__(388),elliptic=__webpack_require__(20),utils=elliptic.utils,assert=utils.assert,KeyPair=__webpack_require__(351),Signature=__webpack_require__(352);module.exports=EC,EC.prototype.keyPair=function(options){return new KeyPair(this,options)},EC.prototype.keyFromPrivate=function(priv,enc){return KeyPair.fromPrivate(this,priv,enc)},EC.prototype.keyFromPublic=function(pub,enc){return KeyPair.fromPublic(this,pub,enc)},EC.prototype.genKeyPair=function(options){options||(options={});for(var drbg=new HmacDRBG({hash:this.hash,pers:options.pers,persEnc:options.persEnc||"utf8",entropy:options.entropy||elliptic.rand(this.hash.hmacStrength),entropyEnc:options.entropy&&options.entropyEnc||"utf8",nonce:this.n.toArray()}),bytes=this.n.byteLength(),ns2=this.n.sub(new BN(2));;){var priv=new BN(drbg.generate(bytes));if(!(priv.cmp(ns2)>0))return priv.iaddn(1),this.keyFromPrivate(priv)}},EC.prototype._truncateToN=function(msg,truncOnly){var delta=8*msg.byteLength()-this.n.bitLength();return delta>0&&(msg=msg.ushrn(delta)),!truncOnly&&msg.cmp(this.n)>=0?msg.sub(this.n):msg},EC.prototype.sign=function(msg,key,enc,options){"object"==typeof enc&&(options=enc,enc=null),options||(options={}),key=this.keyFromPrivate(key,enc),msg=this._truncateToN(new BN(msg,16));for(var bytes=this.n.byteLength(),bkey=key.getPrivate().toArray("be",bytes),nonce=msg.toArray("be",bytes),drbg=new HmacDRBG({hash:this.hash,entropy:bkey,nonce:nonce,pers:options.pers,persEnc:options.persEnc||"utf8"}),ns1=this.n.sub(new BN(1)),iter=0;!0;iter++){var k=options.k?options.k(iter):new BN(drbg.generate(this.n.byteLength()));if(k=this._truncateToN(k,!0),!(k.cmpn(1)<=0||k.cmp(ns1)>=0)){var kp=this.g.mul(k);if(!kp.isInfinity()){var kpX=kp.getX(),r=kpX.umod(this.n);if(0!==r.cmpn(0)){var s=k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));if(s=s.umod(this.n),0!==s.cmpn(0)){var recoveryParam=(kp.getY().isOdd()?1:0)|(0!==kpX.cmp(r)?2:0);return options.canonical&&s.cmp(this.nh)>0&&(s=this.n.sub(s),recoveryParam^=1),new Signature({r:r,s:s,recoveryParam:recoveryParam})}}}}}},EC.prototype.verify=function(msg,signature,key,enc){msg=this._truncateToN(new BN(msg,16)),key=this.keyFromPublic(key,enc),signature=new Signature(signature,"hex");var r=signature.r,s=signature.s;if(r.cmpn(1)<0||r.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var sinv=s.invm(this.n),u1=sinv.mul(msg).umod(this.n),u2=sinv.mul(r).umod(this.n);if(!this.curve._maxwellTrick){var p=this.g.mulAdd(u1,key.getPublic(),u2);return!p.isInfinity()&&0===p.getX().umod(this.n).cmp(r)}var p=this.g.jmulAdd(u1,key.getPublic(),u2);return!p.isInfinity()&&p.eqXToP(r)},EC.prototype.recoverPubKey=function(msg,signature,j,enc){assert((3&j)===j,"The recovery param is more than two bits"),signature=new Signature(signature,enc);var n=this.n,e=new BN(msg),r=signature.r,s=signature.s,isYOdd=1&j,isSecondKey=j>>1;if(r.cmp(this.curve.p.umod(this.curve.n))>=0&&isSecondKey)throw new Error("Unable to find sencond key candinate");r=isSecondKey?this.curve.pointFromX(r.add(this.curve.n),isYOdd):this.curve.pointFromX(r,isYOdd);var rInv=signature.r.invm(n),s1=n.sub(e).mul(rInv).umod(n),s2=s.mul(rInv).umod(n);return this.g.mulAdd(s1,r,s2)},EC.prototype.getKeyRecoveryParam=function(e,signature,Q,enc){if(signature=new Signature(signature,enc),null!==signature.recoveryParam)return signature.recoveryParam;for(var i=0;i<4;i++){var Qprime;try{Qprime=this.recoverPubKey(e,signature,i)}catch(e){continue}if(Qprime.eq(Q))return i}throw new Error("Unable to find valid recovery factor")}},function(module,exports,__webpack_require__){"use strict";function KeyPair(ec,options){this.ec=ec,this.priv=null,this.pub=null,options.priv&&this._importPrivate(options.priv,options.privEnc),options.pub&&this._importPublic(options.pub,options.pubEnc)}var BN=__webpack_require__(13),elliptic=__webpack_require__(20),utils=elliptic.utils,assert=utils.assert;module.exports=KeyPair,KeyPair.fromPublic=function(ec,pub,enc){return pub instanceof KeyPair?pub:new KeyPair(ec,{pub:pub,pubEnc:enc})},KeyPair.fromPrivate=function(ec,priv,enc){return priv instanceof KeyPair?priv:new KeyPair(ec,{priv:priv,privEnc:enc})},KeyPair.prototype.validate=function(){var pub=this.getPublic();return pub.isInfinity()?{result:!1,reason:"Invalid public key"}:pub.validate()?pub.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},KeyPair.prototype.getPublic=function(compact,enc){return"string"==typeof compact&&(enc=compact,compact=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),enc?this.pub.encode(enc,compact):this.pub},KeyPair.prototype.getPrivate=function(enc){return"hex"===enc?this.priv.toString(16,2):this.priv},KeyPair.prototype._importPrivate=function(key,enc){this.priv=new BN(key,enc||16),this.priv=this.priv.umod(this.ec.curve.n)},KeyPair.prototype._importPublic=function(key,enc){if(key.x||key.y)return"mont"===this.ec.curve.type?assert(key.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||assert(key.x&&key.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(key.x,key.y));this.pub=this.ec.curve.decodePoint(key,enc)},KeyPair.prototype.derive=function(pub){return pub.mul(this.priv).getX()},KeyPair.prototype.sign=function(msg,enc,options){return this.ec.sign(msg,this,enc,options)},KeyPair.prototype.verify=function(msg,signature){return this.ec.verify(msg,signature,this)},KeyPair.prototype.inspect=function(){return""}},function(module,exports,__webpack_require__){"use strict";function Signature(options,enc){if(options instanceof Signature)return options;this._importDER(options,enc)||(assert(options.r&&options.s,"Signature without r or s"),this.r=new BN(options.r,16),this.s=new BN(options.s,16),void 0===options.recoveryParam?this.recoveryParam=null:this.recoveryParam=options.recoveryParam)}function Position(){this.place=0}function getLength(buf,p){var initial=buf[p.place++];if(!(128&initial))return initial;for(var octetLen=15&initial,val=0,i=0,off=p.place;i>>3);for(arr.push(128|octets);--octets;)arr.push(len>>>(octets<<3)&255);arr.push(len)}var BN=__webpack_require__(13),elliptic=__webpack_require__(20),utils=elliptic.utils,assert=utils.assert;module.exports=Signature,Signature.prototype._importDER=function(data,enc){data=utils.toArray(data,enc);var p=new Position;if(48!==data[p.place++])return!1;if(getLength(data,p)+p.place!==data.length)return!1;if(2!==data[p.place++])return!1;var rlen=getLength(data,p),r=data.slice(p.place,rlen+p.place);if(p.place+=rlen,2!==data[p.place++])return!1;var slen=getLength(data,p);if(data.length!==slen+p.place)return!1;var s=data.slice(p.place,slen+p.place);return 0===r[0]&&128&r[1]&&(r=r.slice(1)),0===s[0]&&128&s[1]&&(s=s.slice(1)),this.r=new BN(r),this.s=new BN(s),this.recoveryParam=null,!0},Signature.prototype.toDER=function(enc){var r=this.r.toArray(),s=this.s.toArray();for(128&r[0]&&(r=[0].concat(r)),128&s[0]&&(s=[0].concat(s)),r=rmPadding(r),s=rmPadding(s);!(s[0]||128&s[1]);)s=s.slice(1);var arr=[2];constructLength(arr,r.length),arr=arr.concat(r),arr.push(2),constructLength(arr,s.length);var backHalf=arr.concat(s),res=[48];return constructLength(res,backHalf.length),res=res.concat(backHalf),utils.encode(res,enc)}},function(module,exports,__webpack_require__){"use strict";function EDDSA(curve){if(assert("ed25519"===curve,"only tested with ed25519 so far"),!(this instanceof EDDSA))return new EDDSA(curve);var curve=elliptic.curves[curve].curve;this.curve=curve,this.g=curve.g,this.g.precompute(curve.n.bitLength()+1),this.pointClass=curve.point().constructor,this.encodingLength=Math.ceil(curve.n.bitLength()/8),this.hash=hash.sha512}var hash=__webpack_require__(117),elliptic=__webpack_require__(20),utils=elliptic.utils,assert=utils.assert,parseBytes=utils.parseBytes,KeyPair=__webpack_require__(354),Signature=__webpack_require__(355);module.exports=EDDSA,EDDSA.prototype.sign=function(message,secret){message=parseBytes(message);var key=this.keyFromSecret(secret),r=this.hashInt(key.messagePrefix(),message),R=this.g.mul(r),Rencoded=this.encodePoint(R),s_=this.hashInt(Rencoded,key.pubBytes(),message).mul(key.priv()),S=r.add(s_).umod(this.curve.n);return this.makeSignature({R:R,S:S,Rencoded:Rencoded})},EDDSA.prototype.verify=function(message,sig,pub){message=parseBytes(message),sig=this.makeSignature(sig);var key=this.keyFromPublic(pub),h=this.hashInt(sig.Rencoded(),key.pubBytes(),message),SG=this.g.mul(sig.S());return sig.R().add(key.pub().mul(h)).eq(SG)},EDDSA.prototype.hashInt=function(){for(var hash=this.hash(),i=0;i=0;){var z;if(k.isOdd()){var mod=k.andln(ws-1);z=mod>(ws>>1)-1?(ws>>1)-mod:mod,k.isubn(z)}else z=0;naf.push(z);for(var shift=0!==k.cmpn(0)&&0===k.andln(ws-1)?w+1:1,i=1;i0||k2.cmpn(-d2)>0;){var m14=k1.andln(3)+d1&3,m24=k2.andln(3)+d2&3;3===m14&&(m14=-1),3===m24&&(m24=-1);var u1;if(0==(1&m14))u1=0;else{var m8=k1.andln(7)+d1&7;u1=3!==m8&&5!==m8||2!==m24?m14:-m14}jsf[0].push(u1);var u2;if(0==(1&m24))u2=0;else{var m8=k2.andln(7)+d2&7;u2=3!==m8&&5!==m8||2!==m14?m24:-m24}jsf[1].push(u2),2*d1===u1+1&&(d1=1-d1),2*d2===u2+1&&(d2=1-d2),k1.iushrn(1),k2.iushrn(1)}return jsf}function cachedProperty(obj,name,computer){var key="_"+name;obj.prototype[name]=function(){return void 0!==this[key]?this[key]:this[key]=computer.call(this)}}function parseBytes(bytes){return"string"==typeof bytes?utils.toArray(bytes,"hex"):bytes}function intFromLE(bytes){return new BN(bytes,"hex","le")}var utils=exports,BN=__webpack_require__(13),minAssert=__webpack_require__(35),minUtils=__webpack_require__(243);utils.assert=minAssert,utils.toArray=minUtils.toArray,utils.zero2=minUtils.zero2,utils.toHex=minUtils.toHex,utils.encode=minUtils.encode,utils.getNAF=getNAF,utils.getJSF=getJSF,utils.cachedProperty=cachedProperty,utils.parseBytes=parseBytes,utils.intFromLE=intFromLE},function(module,exports,__webpack_require__){module.exports=__webpack_require__(359)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(360),module.exports.parser=__webpack_require__(51)},function(module,exports,__webpack_require__){(function(global){function Socket(uri,opts){if(!(this instanceof Socket))return new Socket(uri,opts);opts=opts||{},uri&&"object"==typeof uri&&(opts=uri,uri=null),uri?(uri=parseuri(uri),opts.hostname=uri.host,opts.secure="https"===uri.protocol||"wss"===uri.protocol,opts.port=uri.port,uri.query&&(opts.query=uri.query)):opts.host&&(opts.hostname=parseuri(opts.host).host),this.secure=null!=opts.secure?opts.secure:global.location&&"https:"===location.protocol,opts.hostname&&!opts.port&&(opts.port=this.secure?"443":"80"),this.agent=opts.agent||!1,this.hostname=opts.hostname||(global.location?location.hostname:"localhost"),this.port=opts.port||(global.location&&location.port?location.port:this.secure?443:80),this.query=opts.query||{},"string"==typeof this.query&&(this.query=parseqs.decode(this.query)),this.upgrade=!1!==opts.upgrade,this.path=(opts.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!opts.forceJSONP,this.jsonp=!1!==opts.jsonp,this.forceBase64=!!opts.forceBase64,this.enablesXDR=!!opts.enablesXDR,this.timestampParam=opts.timestampParam||"t",this.timestampRequests=opts.timestampRequests,this.transports=opts.transports||["polling","websocket"],this.transportOptions=opts.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=opts.policyPort||843,this.rememberUpgrade=opts.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=opts.onlyBinaryUpgrades,this.perMessageDeflate=!1!==opts.perMessageDeflate&&(opts.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=opts.pfx||null,this.key=opts.key||null,this.passphrase=opts.passphrase||null,this.cert=opts.cert||null,this.ca=opts.ca||null,this.ciphers=opts.ciphers||null,this.rejectUnauthorized=void 0===opts.rejectUnauthorized||opts.rejectUnauthorized,this.forceNode=!!opts.forceNode;var freeGlobal="object"==typeof global&&global;freeGlobal.global===freeGlobal&&(opts.extraHeaders&&Object.keys(opts.extraHeaders).length>0&&(this.extraHeaders=opts.extraHeaders),opts.localAddress&&(this.localAddress=opts.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}function clone(obj){var o={};for(var i in obj)obj.hasOwnProperty(i)&&(o[i]=obj[i]);return o}var transports=__webpack_require__(187),Emitter=__webpack_require__(50),debug=__webpack_require__(85)("engine.io-client:socket"),index=__webpack_require__(118),parser=__webpack_require__(51),parseuri=__webpack_require__(252),parsejson=__webpack_require__(602),parseqs=__webpack_require__(97);module.exports=Socket,Socket.priorWebsocketSuccess=!1,Emitter(Socket.prototype),Socket.protocol=parser.protocol,Socket.Socket=Socket,Socket.Transport=__webpack_require__(115),Socket.transports=__webpack_require__(187),Socket.parser=__webpack_require__(51),Socket.prototype.createTransport=function(name){debug('creating transport "%s"',name);var query=clone(this.query);query.EIO=parser.protocol,query.transport=name;var options=this.transportOptions[name]||{} +;return this.id&&(query.sid=this.id),new transports[name]({query:query,socket:this,agent:options.agent||this.agent,hostname:options.hostname||this.hostname,port:options.port||this.port,secure:options.secure||this.secure,path:options.path||this.path,forceJSONP:options.forceJSONP||this.forceJSONP,jsonp:options.jsonp||this.jsonp,forceBase64:options.forceBase64||this.forceBase64,enablesXDR:options.enablesXDR||this.enablesXDR,timestampRequests:options.timestampRequests||this.timestampRequests,timestampParam:options.timestampParam||this.timestampParam,policyPort:options.policyPort||this.policyPort,pfx:options.pfx||this.pfx,key:options.key||this.key,passphrase:options.passphrase||this.passphrase,cert:options.cert||this.cert,ca:options.ca||this.ca,ciphers:options.ciphers||this.ciphers,rejectUnauthorized:options.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:options.perMessageDeflate||this.perMessageDeflate,extraHeaders:options.extraHeaders||this.extraHeaders,forceNode:options.forceNode||this.forceNode,localAddress:options.localAddress||this.localAddress,requestTimeout:options.requestTimeout||this.requestTimeout,protocols:options.protocols||void 0})},Socket.prototype.open=function(){var transport;if(this.rememberUpgrade&&Socket.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)transport="websocket";else{if(0===this.transports.length){var self=this;return void setTimeout(function(){self.emit("error","No transports available")},0)}transport=this.transports[0]}this.readyState="opening";try{transport=this.createTransport(transport)}catch(e){return this.transports.shift(),void this.open()}transport.open(),this.setTransport(transport)},Socket.prototype.setTransport=function(transport){debug("setting transport %s",transport.name);var self=this;this.transport&&(debug("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=transport,transport.on("drain",function(){self.onDrain()}).on("packet",function(packet){self.onPacket(packet)}).on("error",function(e){self.onError(e)}).on("close",function(){self.onClose("transport close")})},Socket.prototype.probe=function(name){function onTransportOpen(){if(self.onlyBinaryUpgrades){var upgradeLosesBinary=!this.supportsBinary&&self.transport.supportsBinary;failed=failed||upgradeLosesBinary}failed||(debug('probe transport "%s" opened',name),transport.send([{type:"ping",data:"probe"}]),transport.once("packet",function(msg){if(!failed)if("pong"===msg.type&&"probe"===msg.data){if(debug('probe transport "%s" pong',name),self.upgrading=!0,self.emit("upgrading",transport),!transport)return;Socket.priorWebsocketSuccess="websocket"===transport.name,debug('pausing current transport "%s"',self.transport.name),self.transport.pause(function(){failed||"closed"!==self.readyState&&(debug("changing transport and sending upgrade packet"),cleanup(),self.setTransport(transport),transport.send([{type:"upgrade"}]),self.emit("upgrade",transport),transport=null,self.upgrading=!1,self.flush())})}else{debug('probe transport "%s" failed',name);var err=new Error("probe error");err.transport=transport.name,self.emit("upgradeError",err)}}))}function freezeTransport(){failed||(failed=!0,cleanup(),transport.close(),transport=null)}function onerror(err){var error=new Error("probe error: "+err);error.transport=transport.name,freezeTransport(),debug('probe transport "%s" failed because of error: %s',name,err),self.emit("upgradeError",error)}function onTransportClose(){onerror("transport closed")}function onclose(){onerror("socket closed")}function onupgrade(to){transport&&to.name!==transport.name&&(debug('"%s" works - aborting "%s"',to.name,transport.name),freezeTransport())}function cleanup(){transport.removeListener("open",onTransportOpen),transport.removeListener("error",onerror),transport.removeListener("close",onTransportClose),self.removeListener("close",onclose),self.removeListener("upgrading",onupgrade)}debug('probing transport "%s"',name);var transport=this.createTransport(name,{probe:1}),failed=!1,self=this;Socket.priorWebsocketSuccess=!1,transport.once("open",onTransportOpen),transport.once("error",onerror),transport.once("close",onTransportClose),this.once("close",onclose),this.once("upgrading",onupgrade),transport.open()},Socket.prototype.onOpen=function(){if(debug("socket open"),this.readyState="open",Socket.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){debug("starting upgrade probes");for(var i=0,l=this.upgrades.length;i';iframe=document.createElement(html)}catch(e){iframe=document.createElement("iframe"),iframe.name=self.iframeId,iframe.src="javascript:0"}iframe.id=self.iframeId,self.form.appendChild(iframe),self.iframe=iframe}var self=this;if(!this.form){var iframe,form=document.createElement("form"),area=document.createElement("textarea"),id=this.iframeId="eio_iframe_"+this.index;form.className="socketio",form.style.position="absolute",form.style.top="-1000px",form.style.left="-1000px",form.target=id,form.method="POST",form.setAttribute("accept-charset","utf-8"),area.name="d",form.appendChild(area),document.body.appendChild(form),this.form=form,this.area=area}this.form.action=this.uri(),initIframe(),data=data.replace(/\\n/g,"\\\n"),this.area.value=data.replace(/\n/g,"\\n");try{this.form.submit()}catch(e){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===self.iframe.readyState&&complete()}:this.iframe.onload=complete}}).call(exports,__webpack_require__(3))},function(module,exports,__webpack_require__){(function(global){function empty(){}function XHR(opts){if(Polling.call(this,opts),this.requestTimeout=opts.requestTimeout,this.extraHeaders=opts.extraHeaders,global.location){var isSSL="https:"===location.protocol,port=location.port;port||(port=isSSL?443:80),this.xd=opts.hostname!==global.location.hostname||port!==opts.port,this.xs=opts.secure!==isSSL}}function Request(opts){this.method=opts.method||"GET",this.uri=opts.uri,this.xd=!!opts.xd,this.xs=!!opts.xs,this.async=!1!==opts.async,this.data=void 0!==opts.data?opts.data:null,this.agent=opts.agent,this.isBinary=opts.isBinary,this.supportsBinary=opts.supportsBinary,this.enablesXDR=opts.enablesXDR,this.requestTimeout=opts.requestTimeout,this.pfx=opts.pfx,this.key=opts.key,this.passphrase=opts.passphrase,this.cert=opts.cert,this.ca=opts.ca,this.ciphers=opts.ciphers,this.rejectUnauthorized=opts.rejectUnauthorized,this.extraHeaders=opts.extraHeaders,this.create()}function unloadHandler(){for(var i in Request.requests)Request.requests.hasOwnProperty(i)&&Request.requests[i].abort()}var XMLHttpRequest=__webpack_require__(116),Polling=__webpack_require__(188),Emitter=__webpack_require__(50),inherit=__webpack_require__(82),debug=__webpack_require__(85)("engine.io-client:polling-xhr");module.exports=XHR,module.exports.Request=Request,inherit(XHR,Polling),XHR.prototype.supportsBinary=!0,XHR.prototype.request=function(opts){return opts=opts||{},opts.uri=this.uri(),opts.xd=this.xd,opts.xs=this.xs,opts.agent=this.agent||!1,opts.supportsBinary=this.supportsBinary,opts.enablesXDR=this.enablesXDR,opts.pfx=this.pfx,opts.key=this.key,opts.passphrase=this.passphrase,opts.cert=this.cert,opts.ca=this.ca,opts.ciphers=this.ciphers,opts.rejectUnauthorized=this.rejectUnauthorized,opts.requestTimeout=this.requestTimeout,opts.extraHeaders=this.extraHeaders,new Request(opts)},XHR.prototype.doWrite=function(data,fn){var isBinary="string"!=typeof data&&void 0!==data,req=this.request({method:"POST",data:data,isBinary:isBinary}),self=this;req.on("success",fn),req.on("error",function(err){self.onError("xhr post error",err)}),this.sendXhr=req},XHR.prototype.doPoll=function(){debug("xhr poll");var req=this.request(),self=this;req.on("data",function(data){self.onData(data)}),req.on("error",function(err){self.onError("xhr poll error",err)}),this.pollXhr=req},Emitter(Request.prototype),Request.prototype.create=function(){var opts={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};opts.pfx=this.pfx,opts.key=this.key,opts.passphrase=this.passphrase,opts.cert=this.cert,opts.ca=this.ca,opts.ciphers=this.ciphers,opts.rejectUnauthorized=this.rejectUnauthorized;var xhr=this.xhr=new XMLHttpRequest(opts),self=this;try{debug("xhr open %s: %s",this.method,this.uri),xhr.open(this.method,this.uri,this.async);try{if(this.extraHeaders){xhr.setDisableHeaderCheck&&xhr.setDisableHeaderCheck(!0);for(var i in this.extraHeaders)this.extraHeaders.hasOwnProperty(i)&&xhr.setRequestHeader(i,this.extraHeaders[i])}}catch(e){}if("POST"===this.method)try{this.isBinary?xhr.setRequestHeader("Content-type","application/octet-stream"):xhr.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{xhr.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in xhr&&(xhr.withCredentials=!0),this.requestTimeout&&(xhr.timeout=this.requestTimeout),this.hasXDR()?(xhr.onload=function(){self.onLoad()},xhr.onerror=function(){self.onError(xhr.responseText)}):xhr.onreadystatechange=function(){if(2===xhr.readyState){var contentType;try{contentType=xhr.getResponseHeader("Content-Type")}catch(e){}"application/octet-stream"===contentType&&(xhr.responseType="arraybuffer")}4===xhr.readyState&&(200===xhr.status||1223===xhr.status?self.onLoad():setTimeout(function(){self.onError(xhr.status)},0))},debug("xhr data %s",this.data),xhr.send(this.data)}catch(e){return void setTimeout(function(){self.onError(e)},0)}global.document&&(this.index=Request.requestsCount++,Request.requests[this.index]=this)},Request.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},Request.prototype.onData=function(data){this.emit("data",data),this.onSuccess()},Request.prototype.onError=function(err){this.emit("error",err),this.cleanup(!0)},Request.prototype.cleanup=function(fromError){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=empty:this.xhr.onreadystatechange=empty,fromError)try{this.xhr.abort()}catch(e){}global.document&&delete Request.requests[this.index],this.xhr=null}},Request.prototype.onLoad=function(){var data;try{var contentType;try{contentType=this.xhr.getResponseHeader("Content-Type")}catch(e){}data="application/octet-stream"===contentType?this.xhr.response||this.xhr.responseText:this.xhr.responseText}catch(e){this.onError(e)}null!=data&&this.onData(data)},Request.prototype.hasXDR=function(){return void 0!==global.XDomainRequest&&!this.xs&&this.enablesXDR},Request.prototype.abort=function(){this.cleanup()},Request.requestsCount=0,Request.requests={},global.document&&(global.attachEvent?global.attachEvent("onunload",unloadHandler):global.addEventListener&&global.addEventListener("beforeunload",unloadHandler,!1))}).call(exports,__webpack_require__(3))},function(module,exports,__webpack_require__){(function(global){function WS(opts){opts&&opts.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=opts.perMessageDeflate,this.usingBrowserWebSocket=BrowserWebSocket&&!opts.forceNode,this.protocols=opts.protocols,this.usingBrowserWebSocket||(WebSocket=NodeWebSocket),Transport.call(this,opts)}var NodeWebSocket,Transport=__webpack_require__(115),parser=__webpack_require__(51),parseqs=__webpack_require__(97),inherit=__webpack_require__(82),yeast=__webpack_require__(282),debug=__webpack_require__(85)("engine.io-client:websocket"),BrowserWebSocket=global.WebSocket||global.MozWebSocket;if("undefined"==typeof window)try{NodeWebSocket=__webpack_require__(736)}catch(e){}var WebSocket=BrowserWebSocket;WebSocket||"undefined"!=typeof window||(WebSocket=NodeWebSocket),module.exports=WS,inherit(WS,Transport),WS.prototype.name="websocket",WS.prototype.supportsBinary=!0,WS.prototype.doOpen=function(){if(this.check()){var uri=this.uri(),protocols=this.protocols,opts={agent:this.agent,perMessageDeflate:this.perMessageDeflate};opts.pfx=this.pfx,opts.key=this.key,opts.passphrase=this.passphrase,opts.cert=this.cert,opts.ca=this.ca,opts.ciphers=this.ciphers,opts.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(opts.headers=this.extraHeaders),this.localAddress&&(opts.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket?protocols?new WebSocket(uri,protocols):new WebSocket(uri):new WebSocket(uri,protocols,opts)}catch(err){return this.emit("error",err)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},WS.prototype.addEventListeners=function(){var self=this;this.ws.onopen=function(){self.onOpen()},this.ws.onclose=function(){self.onClose()},this.ws.onmessage=function(ev){self.onData(ev.data)},this.ws.onerror=function(e){self.onError("websocket error",e)}},WS.prototype.write=function(packets){function done(){self.emit("flush"),setTimeout(function(){self.writable=!0,self.emit("drain")},0)}var self=this;this.writable=!1;for(var total=packets.length,i=0,l=total;i=55296&&value<=56319&&counter65535&&(value-=65536,output+=stringFromCharCode(value>>>10&1023|55296),value=56320|1023&value),output+=stringFromCharCode(value);return output}function checkScalarValue(codePoint,strict){if(codePoint>=55296&&codePoint<=57343){if(strict)throw Error("Lone surrogate U+"+codePoint.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function createByte(codePoint,shift){return stringFromCharCode(codePoint>>shift&63|128)}function encodeCodePoint(codePoint,strict){if(0==(4294967168&codePoint))return stringFromCharCode(codePoint);var symbol="";return 0==(4294965248&codePoint)?symbol=stringFromCharCode(codePoint>>6&31|192):0==(4294901760&codePoint)?(checkScalarValue(codePoint,strict)||(codePoint=65533),symbol=stringFromCharCode(codePoint>>12&15|224),symbol+=createByte(codePoint,6)):0==(4292870144&codePoint)&&(symbol=stringFromCharCode(codePoint>>18&7|240),symbol+=createByte(codePoint,12),symbol+=createByte(codePoint,6)),symbol+=stringFromCharCode(63&codePoint|128)}function utf8encode(string,opts){opts=opts||{};for(var codePoint,strict=!1!==opts.strict,codePoints=ucs2decode(string),length=codePoints.length,index=-1,byteString="";++index=byteCount)throw Error("Invalid byte index");var continuationByte=255&byteArray[byteIndex];if(byteIndex++,128==(192&continuationByte))return 63&continuationByte;throw Error("Invalid continuation byte")}function decodeSymbol(strict){var byte1,byte2,byte3,byte4,codePoint;if(byteIndex>byteCount)throw Error("Invalid byte index");if(byteIndex==byteCount)return!1;if(byte1=255&byteArray[byteIndex],byteIndex++,0==(128&byte1))return byte1;if(192==(224&byte1)){if(byte2=readContinuationByte(),(codePoint=(31&byte1)<<6|byte2)>=128)return codePoint;throw Error("Invalid continuation byte")}if(224==(240&byte1)){if(byte2=readContinuationByte(),byte3=readContinuationByte(),(codePoint=(15&byte1)<<12|byte2<<6|byte3)>=2048)return checkScalarValue(codePoint,strict)?codePoint:65533;throw Error("Invalid continuation byte")}if(240==(248&byte1)&&(byte2=readContinuationByte(),byte3=readContinuationByte(),byte4=readContinuationByte(),(codePoint=(7&byte1)<<18|byte2<<12|byte3<<6|byte4)>=65536&&codePoint<=1114111))return codePoint;throw Error("Invalid UTF-8 detected")}function utf8decode(byteString,opts){opts=opts||{};var strict=!1!==opts.strict;byteArray=ucs2decode(byteString),byteCount=byteArray.length,byteIndex=0;for(var tmp,codePoints=[];(tmp=decodeSymbol(strict))!==!1;)codePoints.push(tmp);return ucs2encode(codePoints)}var freeExports="object"==typeof exports&&exports,freeGlobal=("object"==typeof module&&module&&module.exports,"object"==typeof global&&global);freeGlobal.global!==freeGlobal&&freeGlobal.window;var byteArray,byteCount,byteIndex,stringFromCharCode=String.fromCharCode,utf8={version:"2.1.2",encode:utf8encode,decode:utf8decode};void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(){return utf8}.call(exports,__webpack_require__,exports,module))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)}()}).call(exports,__webpack_require__(18)(module),__webpack_require__(3))},function(module,exports,__webpack_require__){function init(type,message,cause){prr(this,{type:type,name:type,cause:"string"!=typeof message?message:cause,message:message&&"string"!=typeof message?message.message:message},"ewr")}function CustomError(message,cause){Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,arguments.callee),init.call(this,"CustomError",message,cause)}function createError(errno,type,proto){var err=function(message,cause){init.call(this,type,message,cause),"FilesystemError"==type&&(this.code=this.cause.code,this.path=this.cause.path,this.errno=this.cause.errno,this.message=(errno.errno[this.cause.errno]?errno.errno[this.cause.errno].description:this.cause.message)+(this.cause.path?" ["+this.cause.path+"]":"")),Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,arguments.callee)};return err.prototype=proto?new proto:new CustomError,err}var prr=__webpack_require__(369);CustomError.prototype=new Error,module.exports=function(errno){var ce=function(type,proto){return createError(errno,type,proto)};return{CustomError:CustomError,FilesystemError:ce("FilesystemError"),createError:ce}}},function(module,exports,__webpack_require__){var all=module.exports.all=[{errno:-2,code:"ENOENT",description:"no such file or directory"},{errno:-1,code:"UNKNOWN",description:"unknown error"},{errno:0,code:"OK",description:"success"},{errno:1,code:"EOF",description:"end of file"},{errno:2,code:"EADDRINFO",description:"getaddrinfo error"},{errno:3,code:"EACCES",description:"permission denied"},{errno:4,code:"EAGAIN",description:"resource temporarily unavailable"},{errno:5,code:"EADDRINUSE",description:"address already in use"},{errno:6,code:"EADDRNOTAVAIL",description:"address not available"},{errno:7,code:"EAFNOSUPPORT",description:"address family not supported"},{errno:8,code:"EALREADY",description:"connection already in progress"},{errno:9,code:"EBADF",description:"bad file descriptor"},{errno:10,code:"EBUSY",description:"resource busy or locked"},{errno:11,code:"ECONNABORTED",description:"software caused connection abort"},{errno:12,code:"ECONNREFUSED",description:"connection refused"},{errno:13,code:"ECONNRESET",description:"connection reset by peer"},{errno:14,code:"EDESTADDRREQ",description:"destination address required"},{errno:15,code:"EFAULT",description:"bad address in system call argument"},{errno:16,code:"EHOSTUNREACH",description:"host is unreachable"},{errno:17,code:"EINTR",description:"interrupted system call"},{errno:18,code:"EINVAL",description:"invalid argument"},{errno:19,code:"EISCONN",description:"socket is already connected"},{errno:20,code:"EMFILE",description:"too many open files"},{errno:21,code:"EMSGSIZE",description:"message too long"},{errno:22,code:"ENETDOWN",description:"network is down"},{errno:23,code:"ENETUNREACH",description:"network is unreachable"},{errno:24,code:"ENFILE",description:"file table overflow"},{errno:25,code:"ENOBUFS",description:"no buffer space available"},{errno:26,code:"ENOMEM",description:"not enough memory"},{errno:27,code:"ENOTDIR",description:"not a directory"},{errno:28,code:"EISDIR",description:"illegal operation on a directory"},{errno:29,code:"ENONET",description:"machine is not on the network"},{errno:31,code:"ENOTCONN",description:"socket is not connected"},{errno:32,code:"ENOTSOCK",description:"socket operation on non-socket"},{errno:33,code:"ENOTSUP",description:"operation not supported on socket"},{errno:34,code:"ENOENT",description:"no such file or directory"},{errno:35,code:"ENOSYS",description:"function not implemented"},{errno:36,code:"EPIPE",description:"broken pipe"},{errno:37,code:"EPROTO",description:"protocol error"},{errno:38,code:"EPROTONOSUPPORT",description:"protocol not supported"},{errno:39,code:"EPROTOTYPE",description:"protocol wrong type for socket"},{errno:40,code:"ETIMEDOUT",description:"connection timed out"},{errno:41,code:"ECHARSET",description:"invalid Unicode character"},{errno:42,code:"EAIFAMNOSUPPORT",description:"address family for hostname not supported"},{errno:44,code:"EAISERVICE",description:"servname not supported for ai_socktype"},{errno:45,code:"EAISOCKTYPE",description:"ai_socktype not supported"},{errno:46,code:"ESHUTDOWN",description:"cannot send after transport endpoint shutdown"},{errno:47,code:"EEXIST",description:"file already exists"},{errno:48,code:"ESRCH",description:"no such process"},{errno:49,code:"ENAMETOOLONG",description:"name too long"},{errno:50,code:"EPERM",description:"operation not permitted"},{errno:51,code:"ELOOP",description:"too many symbolic links encountered"},{errno:52,code:"EXDEV",description:"cross-device link not permitted"},{errno:53,code:"ENOTEMPTY",description:"directory not empty"},{errno:54,code:"ENOSPC",description:"no space left on device"},{errno:55,code:"EIO",description:"i/o error"},{errno:56,code:"EROFS",description:"read-only file system"},{errno:57,code:"ENODEV",description:"no such device"},{errno:58,code:"ESPIPE",description:"invalid seek"},{errno:59,code:"ECANCELED",description:"operation canceled"}];module.exports.errno={},module.exports.code={},all.forEach(function(error){module.exports.errno[error.errno]=error,module.exports.code[error.code]=error}),module.exports.custom=__webpack_require__(367)(module.exports),module.exports.create=module.exports.custom.createError},function(module,exports){!function(name,context,definition){void 0!==module&&module.exports?module.exports=definition():context.prr=definition()}(0,this,function(){ +var setProperty="function"==typeof Object.defineProperty?function(obj,key,options){return Object.defineProperty(obj,key,options),obj}:function(obj,key,options){return obj[key]=options.value,obj},makeOptions=function(value,options){var oo="object"==typeof options,os=!oo&&"string"==typeof options,op=function(p){return oo?!!options[p]:!!os&&options.indexOf(p[0])>-1};return{enumerable:op("enumerable"),configurable:op("configurable"),writable:op("writable"),value:value}};return function(obj,key,value,options){var k;if(options=makeOptions(value,options),"object"==typeof key){for(k in key)Object.hasOwnProperty.call(key,k)&&(options.value=key[k],setProperty(obj,k,options));return obj}return setProperty(obj,key,options)}})},function(module,exports,__webpack_require__){(function(Buffer){const ethUtil=__webpack_require__(190),rlp=__webpack_require__(46);var Account=module.exports=function(data){var fields=[{name:"nonce",default:new Buffer([])},{name:"balance",default:new Buffer([])},{name:"stateRoot",length:32,default:ethUtil.SHA3_RLP},{name:"codeHash",length:32,default:ethUtil.SHA3_NULL}];ethUtil.defineProperties(this,fields,data)};Account.prototype.serialize=function(){return rlp.encode(this.raw)},Account.prototype.isContract=function(){return this.codeHash.toString("hex")!==ethUtil.SHA3_NULL_S},Account.prototype.getCode=function(state,cb){if(!this.isContract())return void cb(null,new Buffer([]));state.getRaw(this.codeHash,cb)},Account.prototype.setCode=function(trie,code,cb){var self=this;if(this.codeHash=ethUtil.sha3(code),this.codeHash.toString("hex")===ethUtil.SHA3_NULL_S)return void cb(null,new Buffer([]));trie.putRaw(this.codeHash,code,function(err){cb(err,self.codeHash)})},Account.prototype.getStorage=function(trie,key,cb){var t=trie.copy();t.root=this.stateRoot,t.get(key,cb)},Account.prototype.setStorage=function(trie,key,val,cb){var self=this,t=trie.copy();t.root=self.stateRoot,t.put(key,val,function(err){if(err)return cb();self.stateRoot=t.root,cb()})},Account.prototype.isEmpty=function(){return""===this.balance.toString("hex")&&""===this.nonce.toString("hex")&&this.stateRoot.toString("hex")===ethUtil.SHA3_RLP_S&&this.codeHash.toString("hex")===ethUtil.SHA3_NULL_S}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){const createKeccakHash=__webpack_require__(215),secp256k1=__webpack_require__(149),assert=__webpack_require__(9),rlp=__webpack_require__(46),BN=__webpack_require__(13),createHash=__webpack_require__(63);Object.assign(exports,__webpack_require__(191)),exports.MAX_INTEGER=new BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),exports.TWO_POW256=new BN("10000000000000000000000000000000000000000000000000000000000000000",16),exports.SHA3_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",exports.SHA3_NULL=Buffer.from(exports.SHA3_NULL_S,"hex"),exports.SHA3_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",exports.SHA3_RLP_ARRAY=Buffer.from(exports.SHA3_RLP_ARRAY_S,"hex"),exports.SHA3_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",exports.SHA3_RLP=Buffer.from(exports.SHA3_RLP_S,"hex"),exports.BN=BN,exports.rlp=rlp,exports.secp256k1=secp256k1,exports.zeros=function(bytes){return Buffer.allocUnsafe(bytes).fill(0)},exports.setLengthLeft=exports.setLength=function(msg,length,right){var buf=exports.zeros(length);return msg=exports.toBuffer(msg),right?msg.length0&&"0"===first.toString();)a=a.slice(1),first=a[0];return a},exports.toBuffer=function(v){if(!Buffer.isBuffer(v))if(Array.isArray(v))v=Buffer.from(v);else if("string"==typeof v)v=exports.isHexString(v)?Buffer.from(exports.padToEven(exports.stripHexPrefix(v)),"hex"):Buffer.from(v);else if("number"==typeof v)v=exports.intToBuffer(v);else if(null===v||void 0===v)v=Buffer.allocUnsafe(0);else{if(!v.toArray)throw new Error("invalid type");v=Buffer.from(v.toArray())}return v},exports.bufferToInt=function(buf){return new BN(exports.toBuffer(buf)).toNumber()},exports.bufferToHex=function(buf){return buf=exports.toBuffer(buf),"0x"+buf.toString("hex")},exports.fromSigned=function(num){return new BN(num).fromTwos(256)},exports.toUnsigned=function(num){return Buffer.from(num.toTwos(256).toArray())},exports.sha3=function(a,bits){return a=exports.toBuffer(a),bits||(bits=256),createKeccakHash("keccak"+bits).update(a).digest()},exports.sha256=function(a){return a=exports.toBuffer(a),createHash("sha256").update(a).digest()},exports.ripemd160=function(a,padded){a=exports.toBuffer(a);var hash=createHash("rmd160").update(a).digest();return padded===!0?exports.setLength(hash,32):hash},exports.rlphash=function(a){return exports.sha3(rlp.encode(a))},exports.isValidPrivate=function(privateKey){return secp256k1.privateKeyVerify(privateKey)},exports.isValidPublic=function(publicKey,sanitize){return 64===publicKey.length?secp256k1.publicKeyVerify(Buffer.concat([Buffer.from([4]),publicKey])):!!sanitize&&secp256k1.publicKeyVerify(publicKey)},exports.pubToAddress=exports.publicToAddress=function(pubKey,sanitize){return pubKey=exports.toBuffer(pubKey),sanitize&&64!==pubKey.length&&(pubKey=secp256k1.publicKeyConvert(pubKey,!1).slice(1)),assert(64===pubKey.length),exports.sha3(pubKey).slice(-20)};var privateToPublic=exports.privateToPublic=function(privateKey){return privateKey=exports.toBuffer(privateKey),secp256k1.publicKeyCreate(privateKey,!1).slice(1)};exports.importPublic=function(publicKey){return publicKey=exports.toBuffer(publicKey),64!==publicKey.length&&(publicKey=secp256k1.publicKeyConvert(publicKey,!1).slice(1)),publicKey},exports.ecsign=function(msgHash,privateKey){var sig=secp256k1.sign(msgHash,privateKey),ret={};return ret.r=sig.signature.slice(0,32),ret.s=sig.signature.slice(32,64),ret.v=sig.recovery+27,ret},exports.hashPersonalMessage=function(message){var prefix=exports.toBuffer("Ethereum Signed Message:\n"+message.length.toString());return exports.sha3(Buffer.concat([prefix,message]))},exports.ecrecover=function(msgHash,v,r,s){var signature=Buffer.concat([exports.setLength(r,32),exports.setLength(s,32)],64),recovery=v-27;if(0!==recovery&&1!==recovery)throw new Error("Invalid signature v value");var senderPubKey=secp256k1.recover(msgHash,signature,recovery);return secp256k1.publicKeyConvert(senderPubKey,!1).slice(1)},exports.toRpcSig=function(v,r,s){if(27!==v&&28!==v)throw new Error("Invalid recovery id");return exports.bufferToHex(Buffer.concat([exports.setLengthLeft(r,32),exports.setLengthLeft(s,32),exports.toBuffer(v-27)]))},exports.fromRpcSig=function(sig){if(sig=exports.toBuffer(sig),65!==sig.length)throw new Error("Invalid signature length");var v=sig[64];return v<27&&(v+=27),{v:v,r:sig.slice(0,32),s:sig.slice(32,64)}},exports.privateToAddress=function(privateKey){return exports.publicToAddress(privateToPublic(privateKey))},exports.isValidAddress=function(address){return/^0x[0-9a-fA-F]{40}$/i.test(address)},exports.toChecksumAddress=function(address){address=exports.stripHexPrefix(address).toLowerCase();for(var hash=exports.sha3(address).toString("hex"),ret="0x",i=0;i=8?address[i].toUpperCase():address[i];return ret},exports.isValidChecksumAddress=function(address){return exports.isValidAddress(address)&&exports.toChecksumAddress(address)===address},exports.generateAddress=function(from,nonce){return from=exports.toBuffer(from),nonce=new BN(nonce),nonce=nonce.isZero()?null:Buffer.from(nonce.toArray()),exports.rlphash([from,nonce]).slice(-20)},exports.isPrecompiled=function(address){var a=exports.unpad(address);return 1===a.length&&a[0]>0&&a[0]<5},exports.addHexPrefix=function(str){return"string"!=typeof str?str:exports.isHexPrefixed(str)?str:"0x"+str},exports.isValidSignature=function(v,r,s,homestead){const SECP256K1_N_DIV_2=new BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),SECP256K1_N=new BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===r.length&&32===s.length&&((27===v||28===v)&&(r=new BN(r),s=new BN(s),!(r.isZero()||r.gt(SECP256K1_N)||s.isZero()||s.gt(SECP256K1_N))&&(homestead!==!1||1!==new BN(s).cmp(SECP256K1_N_DIV_2))))},exports.baToJSON=function(ba){if(Buffer.isBuffer(ba))return"0x"+ba.toString("hex");if(ba instanceof Array){for(var array=[],i=0;i=v.length,"The field "+field.name+" must not have more "+field.length+" bytes")):field.allowZero&&0===v.length||!field.length||assert(field.length===v.length,"The field "+field.name+" must have byte length of "+field.length),self.raw[i]=v}self._fields.push(field.name),Object.defineProperty(self,field.name,{enumerable:!0,configurable:!0,get:getter,set:setter}),field.default&&(self[field.name]=field.default),field.alias&&Object.defineProperty(self,field.alias,{enumerable:!1,configurable:!0,set:setter,get:getter})}),data)if("string"==typeof data&&(data=Buffer.from(exports.stripHexPrefix(data),"hex")),Buffer.isBuffer(data)&&(data=rlp.decode(data)),Array.isArray(data)){if(data.length>self._fields.length)throw new Error("wrong number of fields in data");data.forEach(function(d,i){self[self._fields[i]]=exports.toBuffer(d)})}else{if("object"!=typeof data)throw new Error("invalid data");{const keys=Object.keys(data);fields.forEach(function(field){keys.indexOf(field.name)!==-1&&(self[field.name]=data[field.name]),keys.indexOf(field.alias)!==-1&&(self[field.alias]=data[field.alias])})}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var ethUtil=__webpack_require__(373),fees=__webpack_require__(213),BN=ethUtil.BN,N_DIV_2=new BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),Transaction=function(){function Transaction(data){_classCallCheck(this,Transaction),data=data||{};var fields=[{name:"nonce",length:32,allowLess:!0,default:new Buffer([])},{name:"gasPrice",length:32,allowLess:!0,default:new Buffer([])},{name:"gasLimit",alias:"gas",length:32,allowLess:!0,default:new Buffer([])},{name:"to",allowZero:!0,length:20,default:new Buffer([])},{name:"value",length:32,allowLess:!0,default:new Buffer([])},{name:"data",alias:"input",allowZero:!0,default:new Buffer([])},{name:"v",allowZero:!0,default:new Buffer([28])},{name:"r",length:32,allowZero:!0,allowLess:!0,default:new Buffer([])},{name:"s",length:32,allowZero:!0,allowLess:!0,default:new Buffer([])}];ethUtil.defineProperties(this,fields,data),Object.defineProperty(this,"from",{enumerable:!0,configurable:!0,get:this.getSenderAddress.bind(this)});var sigV=ethUtil.bufferToInt(this.v),chainId=Math.floor((sigV-35)/2);chainId<0&&(chainId=0),this._chainId=chainId||data.chainId||0,this._homestead=!0}return Transaction.prototype.toCreationAddress=function(){return""===this.to.toString("hex")},Transaction.prototype.hash=function(includeSignature){void 0===includeSignature&&(includeSignature=!0);var items=void 0;if(includeSignature)items=this.raw;else if(this._chainId>0){var raw=this.raw.slice();this.v=this._chainId,this.r=0,this.s=0,items=this.raw,this.raw=raw}else items=this.raw.slice(0,6);return ethUtil.rlphash(items)},Transaction.prototype.getChainId=function(){return this._chainId},Transaction.prototype.getSenderAddress=function(){if(this._from)return this._from;var pubkey=this.getSenderPublicKey();return this._from=ethUtil.publicToAddress(pubkey),this._from},Transaction.prototype.getSenderPublicKey=function(){if(!(this._senderPubKey&&this._senderPubKey.length||this.verifySignature()))throw new Error("Invalid Signature");return this._senderPubKey},Transaction.prototype.verifySignature=function(){var msgHash=this.hash(!1);if(this._homestead&&1===new BN(this.s).cmp(N_DIV_2))return!1;try{var v=ethUtil.bufferToInt(this.v);this._chainId>0&&(v-=2*this._chainId+8),this._senderPubKey=ethUtil.ecrecover(msgHash,v,this.r,this.s)}catch(e){return!1}return!!this._senderPubKey},Transaction.prototype.sign=function(privateKey){var msgHash=this.hash(!1),sig=ethUtil.ecsign(msgHash,privateKey);this._chainId>0&&(sig.v+=2*this._chainId+8),Object.assign(this,sig)},Transaction.prototype.getDataFee=function(){for(var data=this.raw[5],cost=new BN(0),i=0;i0&&errors.push(["gas limit is too low. Need at least "+this.getBaseFee()]),void 0===stringError||stringError===!1?0===errors.length:errors.join(" ")},Transaction}();module.exports=Transaction}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){const createKeccakHash=__webpack_require__(215),secp256k1=__webpack_require__(149),assert=__webpack_require__(9),rlp=__webpack_require__(46),BN=__webpack_require__(13),createHash=__webpack_require__(63);Object.assign(exports,__webpack_require__(191)),exports.MAX_INTEGER=new BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),exports.TWO_POW256=new BN("10000000000000000000000000000000000000000000000000000000000000000",16),exports.SHA3_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",exports.SHA3_NULL=Buffer.from(exports.SHA3_NULL_S,"hex"),exports.SHA3_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",exports.SHA3_RLP_ARRAY=Buffer.from(exports.SHA3_RLP_ARRAY_S,"hex"),exports.SHA3_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",exports.SHA3_RLP=Buffer.from(exports.SHA3_RLP_S,"hex"),exports.BN=BN,exports.rlp=rlp,exports.secp256k1=secp256k1,exports.zeros=function(bytes){return Buffer.allocUnsafe(bytes).fill(0)},exports.setLengthLeft=exports.setLength=function(msg,length,right){var buf=exports.zeros(length);return msg=exports.toBuffer(msg),right?msg.length0&&"0"===first.toString();)a=a.slice(1),first=a[0];return a},exports.toBuffer=function(v){if(!Buffer.isBuffer(v))if(Array.isArray(v))v=Buffer.from(v);else if("string"==typeof v)v=exports.isHexString(v)?Buffer.from(exports.padToEven(exports.stripHexPrefix(v)),"hex"):Buffer.from(v);else if("number"==typeof v)v=exports.intToBuffer(v);else if(null===v||void 0===v)v=Buffer.allocUnsafe(0);else{if(!v.toArray)throw new Error("invalid type");v=Buffer.from(v.toArray())}return v},exports.bufferToInt=function(buf){return new BN(exports.toBuffer(buf)).toNumber()},exports.bufferToHex=function(buf){return buf=exports.toBuffer(buf),"0x"+buf.toString("hex")},exports.fromSigned=function(num){return new BN(num).fromTwos(256)},exports.toUnsigned=function(num){return Buffer.from(num.toTwos(256).toArray())},exports.sha3=function(a,bits){return a=exports.toBuffer(a),bits||(bits=256),createKeccakHash("keccak"+bits).update(a).digest()},exports.sha256=function(a){return a=exports.toBuffer(a),createHash("sha256").update(a).digest()},exports.ripemd160=function(a,padded){a=exports.toBuffer(a);var hash=createHash("rmd160").update(a).digest();return padded===!0?exports.setLength(hash,32):hash},exports.rlphash=function(a){return exports.sha3(rlp.encode(a))},exports.isValidPrivate=function(privateKey){return secp256k1.privateKeyVerify(privateKey)},exports.isValidPublic=function(publicKey,sanitize){return 64===publicKey.length?secp256k1.publicKeyVerify(Buffer.concat([Buffer.from([4]),publicKey])):!!sanitize&&secp256k1.publicKeyVerify(publicKey)},exports.pubToAddress=exports.publicToAddress=function(pubKey,sanitize){return pubKey=exports.toBuffer(pubKey),sanitize&&64!==pubKey.length&&(pubKey=secp256k1.publicKeyConvert(pubKey,!1).slice(1)),assert(64===pubKey.length),exports.sha3(pubKey).slice(-20)};var privateToPublic=exports.privateToPublic=function(privateKey){return privateKey=exports.toBuffer(privateKey),secp256k1.publicKeyCreate(privateKey,!1).slice(1)};exports.importPublic=function(publicKey){return publicKey=exports.toBuffer(publicKey),64!==publicKey.length&&(publicKey=secp256k1.publicKeyConvert(publicKey,!1).slice(1)),publicKey},exports.ecsign=function(msgHash,privateKey){var sig=secp256k1.sign(msgHash,privateKey),ret={};return ret.r=sig.signature.slice(0,32),ret.s=sig.signature.slice(32,64),ret.v=sig.recovery+27,ret},exports.hashPersonalMessage=function(message){var prefix=exports.toBuffer("Ethereum Signed Message:\n"+message.length.toString());return exports.sha3(Buffer.concat([prefix,message]))},exports.ecrecover=function(msgHash,v,r,s){var signature=Buffer.concat([exports.setLength(r,32),exports.setLength(s,32)],64),recovery=v-27;if(0!==recovery&&1!==recovery)throw new Error("Invalid signature v value");var senderPubKey=secp256k1.recover(msgHash,signature,recovery);return secp256k1.publicKeyConvert(senderPubKey,!1).slice(1)},exports.toRpcSig=function(v,r,s){if(27!==v&&28!==v)throw new Error("Invalid recovery id");return exports.bufferToHex(Buffer.concat([exports.setLengthLeft(r,32),exports.setLengthLeft(s,32),exports.toBuffer(v-27)]))},exports.fromRpcSig=function(sig){if(sig=exports.toBuffer(sig),65!==sig.length)throw new Error("Invalid signature length");var v=sig[64];return v<27&&(v+=27),{v:v,r:sig.slice(0,32),s:sig.slice(32,64)}},exports.privateToAddress=function(privateKey){return exports.publicToAddress(privateToPublic(privateKey))},exports.isValidAddress=function(address){return/^0x[0-9a-fA-F]{40}$/i.test(address)},exports.toChecksumAddress=function(address){address=exports.stripHexPrefix(address).toLowerCase();for(var hash=exports.sha3(address).toString("hex"),ret="0x",i=0;i=8?address[i].toUpperCase():address[i];return ret},exports.isValidChecksumAddress=function(address){return exports.isValidAddress(address)&&exports.toChecksumAddress(address)===address},exports.generateAddress=function(from,nonce){return from=exports.toBuffer(from),nonce=new BN(nonce),nonce=nonce.isZero()?null:Buffer.from(nonce.toArray()),exports.rlphash([from,nonce]).slice(-20)},exports.isPrecompiled=function(address){var a=exports.unpad(address);return 1===a.length&&a[0]>0&&a[0]<5},exports.addHexPrefix=function(str){return"string"!=typeof str?str:exports.isHexPrefixed(str)?str:"0x"+str},exports.isValidSignature=function(v,r,s,homestead){const SECP256K1_N_DIV_2=new BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),SECP256K1_N=new BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===r.length&&32===s.length&&((27===v||28===v)&&(r=new BN(r),s=new BN(s),!(r.isZero()||r.gt(SECP256K1_N)||s.isZero()||s.gt(SECP256K1_N))&&(homestead!==!1||1!==new BN(s).cmp(SECP256K1_N_DIV_2))))},exports.baToJSON=function(ba){if(Buffer.isBuffer(ba))return"0x"+ba.toString("hex");if(ba instanceof Array){for(var array=[],i=0;i=v.length,"The field "+field.name+" must not have more "+field.length+" bytes")):field.allowZero&&0===v.length||!field.length||assert(field.length===v.length,"The field "+field.name+" must have byte length of "+field.length),self.raw[i]=v}self._fields.push(field.name),Object.defineProperty(self,field.name,{enumerable:!0,configurable:!0,get:getter,set:setter}),field.default&&(self[field.name]=field.default),field.alias&&Object.defineProperty(self,field.alias,{enumerable:!1,configurable:!0,set:setter,get:getter})}),data)if("string"==typeof data&&(data=Buffer.from(exports.stripHexPrefix(data),"hex")),Buffer.isBuffer(data)&&(data=rlp.decode(data)),Array.isArray(data)){if(data.length>self._fields.length)throw new Error("wrong number of fields in data");data.forEach(function(d,i){self[self._fields[i]]=exports.toBuffer(d)})}else{if("object"!=typeof data)throw new Error("invalid data");{const keys=Object.keys(data);fields.forEach(function(field){keys.indexOf(field.name)!==-1&&(self[field.name]=data[field.name]),keys.indexOf(field.alias)!==-1&&(self[field.alias]=data[field.alias])})}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function fsmEvent(start,events){function on(event,cb){emitter.on(event,cb)}function emit(str){function enter(){emitter._events[enterEv]?emitter.emit(enterEv,done):done()}function done(){emit._state=nwState,emitter.emit(nwState),emitter.emit("done")}const nwState=emit._events[emit._state][str];if(!reach(emit._state,nwState,emit._graph)){const err="invalid transition: "+emit._state+" -> "+str;return emitter.emit("error",err)}const leaveEv=emit._state+":leave",enterEv=nwState+":enter";return emit._state?function(){emitter._events[leaveEv]?emitter.emit(leaveEv,enter):enter()}():enter()}"object"==typeof start&&(events=start,start="START"),assert.equal(typeof start,"string"),assert.equal(typeof events,"object"),assert.ok(events[start],"invalid starting state "+start),assert.ok(fsm.validate(events));const emitter=new EventEmitter;return emit._graph=fsm.reachable(events),emit._emitter=emitter,emit._events=events,emit._state=start,emit.emit=emit,emit.on=on,emit}function reach(curr,next,reachable){if(!next)return!1;if(!curr)return!0;const here=reachable[curr];return!(!here||!here[next])&&1===here[next].length}const EventEmitter=__webpack_require__(10).EventEmitter,assert=__webpack_require__(9),fsm=__webpack_require__(375);module.exports=fsmEvent},function(module,exports){function each(obj,iter){for(var key in obj){iter(obj[key],key,obj)}}function keys(obj){return Object.keys(obj).sort()}function contains(a,v){return~a.indexOf(v)}function union(a,b){return a.filter(function(v){return contains(b,v)})}function disunion(a,b){return a.filter(function(v){return!contains(b,v)}).concat(b.filter(function(v){return!contains(a,v)})).sort()}function empty(v){for(var k in v)return!1;return!0}function events(fsm){var events=[];return each(fsm,function(state,name){each(state,function(_state,event){contains(events,event)||events.push(event)})}),events.sort()}var reachable=(exports.validate=function(fsm){Object.keys(fsm);return each(fsm,function(state,name){each(state,function(_state,event){if(!fsm[_state])throw new Error("invalid transition from state:"+name+" to state:"+_state+" on event:"+event)})}),!0},exports.reachable=function(fsm){var reachable={},added=!1;do{added=!1,each(fsm,function(state,name){var reach=reachable[name]=reachable[name]||{};each(state,function(_name,event){reach[_name]||(reach[_name]=[event],added=!0)}),each(state,function(_name,event){each(reachable[_name],function(path,_name){reach[_name]||(reach[_name]=[event].concat(path),added=!0)})})})}while(added);return reachable});exports.terminal=exports.deadlock=function(fsm){var dead=[];return each(fsm,function(state,name){empty(state)&&dead.push(name)}),dead};exports.livelock=function(fsm,terminals){var reach=reachable(fsm),locked=[];return each(reach,function(reaches,name){contains(terminals,name)||each(terminals,function(_name){reaches[_name]||contains(locked,name)||locked.push(name)})}),locked.sort()},exports.combine=function(fsm1,fsm2,start1,start2){function expand(name1,name2){var state,cName=name1+"-"+name2;combined[cName]||(combined[cName]={}),state=combined[cName];var trans1=keys(fsm1[name1]),trans2=keys(fsm2[name2]);return union(trans1,trans2).forEach(function(event){state[event]=fsm1[name1][event]+"-"+fsm2[name2][event],combined[state[event]]||expand(fsm1[name1][event],fsm2[name2][event])}),union(independent,trans1).forEach(function(event){state[event]=fsm1[name1][event]+"-"+name2,combined[state[event]]||expand(fsm1[name1][event],name2)}),union(independent,trans2).forEach(function(event){state[event]=name1+"-"+fsm2[name2][event],combined[state[event]]||expand(name1,fsm2[name2][event])}),combined[cName]}var combined={},events1=events(fsm1),events2=events(fsm2),independent=disunion(events1,events2);return expand(start1,start2),combined}},function(module,exports,__webpack_require__){var util=__webpack_require__(34),INDENT_START=/[\{\[]/,INDENT_END=/[\}\]]/;module.exports=function(){var lines=[],indent=0,push=function(str){for(var spaces="";spaces.length<2*indent;)spaces+=" ";lines.push(spaces+str)},line=function(fmt){return fmt?INDENT_END.test(fmt.trim()[0])&&INDENT_START.test(fmt[fmt.length-1])?(indent--,push(util.format.apply(util,arguments)),indent++,line):INDENT_START.test(fmt[fmt.length-1])?(push(util.format.apply(util,arguments)),indent++,line):INDENT_END.test(fmt.trim()[0])?(indent--,push(util.format.apply(util,arguments)),line):(push(util.format.apply(util,arguments)),line):line};return line.toString=function(){return lines.join("\n")},line.toFunction=function(scope){var src="return ("+line.toString()+")",keys=Object.keys(scope||{}).map(function(key){return key}),vals=keys.map(function(key){return scope[key]});return Function.apply(null,keys.concat(src)).apply(null,vals)},arguments.length&&line.apply(null,arguments),line}},function(module,exports,__webpack_require__){var isProperty=__webpack_require__(456),gen=function(obj,prop){return isProperty(prop)?obj+"."+prop:obj+"["+JSON.stringify(prop)+"]"};gen.valid=isProperty,gen.property=function(prop){return isProperty(prop)?prop:JSON.stringify(prop)},module.exports=gen},function(module,exports){module.exports=function(){if("undefined"==typeof window)return null;var wrtc={RTCPeerConnection:window.RTCPeerConnection||window.mozRTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.RTCSessionDescription||window.mozRTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.RTCIceCandidate||window.mozRTCIceCandidate||window.webkitRTCIceCandidate};return wrtc.RTCPeerConnection?wrtc:null}},function(module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return"[object Array]"==toString.call(arr)}},function(module,exports){try{module.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(err){module.exports=!1}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function HashBase(blockSize){Transform.call(this),this._block=new Buffer(blockSize),this._blockSize=blockSize,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}var Transform=__webpack_require__(25).Transform;__webpack_require__(2)(HashBase,Transform),HashBase.prototype._transform=function(chunk,encoding,callback){var error=null;try{"buffer"!==encoding&&(chunk=new Buffer(chunk,encoding)),this.update(chunk)}catch(err){error=err}callback(error)},HashBase.prototype._flush=function(callback){var error=null;try{this.push(this._digest())}catch(err){error=err}callback(error)},HashBase.prototype.update=function(data,encoding){if(!Buffer.isBuffer(data)&&"string"!=typeof data)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");Buffer.isBuffer(data)||(data=new Buffer(data,encoding||"binary"));for(var block=this._block,offset=0;this._blockOffset+data.length-offset>=this._blockSize;){for(var i=this._blockOffset;i0;++j)this._length[j]+=carry,(carry=this._length[j]/4294967296|0)>0&&(this._length[j]-=4294967296*carry);return this},HashBase.prototype._update=function(data){throw new Error("_update is not implemented")},HashBase.prototype.digest=function(encoding){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var digest=this._digest();return void 0!==encoding&&(digest=digest.toString(encoding)),digest},HashBase.prototype._digest=function(){throw new Error("_digest is not implemented")},module.exports=HashBase}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function Hmac(hash,key,enc){if(!(this instanceof Hmac))return new Hmac(hash,key,enc);this.Hash=hash,this.blockSize=hash.blockSize/8,this.outSize=hash.outSize/8,this.inner=null,this.outer=null,this._init(utils.toArray(key,enc))}var utils=__webpack_require__(28),assert=__webpack_require__(35);module.exports=Hmac,Hmac.prototype._init=function(key){key.length>this.blockSize&&(key=(new this.Hash).update(key).digest()),assert(key.length<=this.blockSize);for(var i=key.length;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(entropy,nonce,pers)}var hash=__webpack_require__(117),utils=__webpack_require__(243),assert=__webpack_require__(35);module.exports=HmacDRBG,HmacDRBG.prototype._init=function(entropy,nonce,pers){var seed=entropy.concat(nonce).concat(pers);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(entropy.concat(add||[])),this._reseed=1},HmacDRBG.prototype.generate=function(len,enc,add,addEnc){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof enc&&(addEnc=add,add=enc,enc=null),add&&(add=utils.toArray(add,addEnc||"hex"),this._update(add));for(var temp=[];temp.length{return err?callback(err):exists?void callback(null,this.data[key.toString()]):callback(new Error("No value"))})}has(key,callback){setImmediate(()=>{callback(null,void 0!==this.data[key.toString()])})}delete(key,callback){delete this.data[key.toString()],setImmediate(()=>{callback()})}batch(){let puts=[],dels=[];return{put(key,value){puts.push([key,value])},delete(key){dels.push(key)},commit:callback=>{puts.forEach(v=>{this.data[v[0].toString()]=v[1]}),puts=[],dels.forEach(key=>{delete this.data[key.toString()]}),dels=[],setImmediate(callback)}}}query(q){let tasks=[pull.keys(this.data),pull.map(k=>({key:new Key(k),value:this.data[k]}))],filters=[];if(null!=q.prefix){const prefix=q.prefix;filters.push((e,cb)=>cb(null,e.key.toString().startsWith(prefix)))}if(null!=q.filters&&(filters=filters.concat(q.filters)),tasks=tasks.concat(filters.map(f=>asyncFilter(f))),null!=q.orders&&(tasks=tasks.concat(q.orders.map(o=>asyncSort(o)))),null!=q.offset){let i=0;tasks.push(pull.filter(()=>i++>=q.offset))}return null!=q.limit&&tasks.push(pull.take(q.limit)),q.keysOnly===!0&&tasks.push(pull.map(e=>({key:e.key}))),pull.apply(null,tasks)}close(callback){setImmediate(callback)}}module.exports=MemoryDatastore},function(module,exports,__webpack_require__){"use strict";function _normalizeFamily(family){return family?family.toLowerCase():"ipv4"}var ip=exports,Buffer=__webpack_require__(0).Buffer,os=__webpack_require__(251);ip.toBuffer=function(ip,buff,offset){offset=~~offset;var result;if(this.isV4Format(ip))result=buff||new Buffer(offset+4),ip.split(/\./g).map(function(byte){result[offset++]=255&parseInt(byte,10)});else if(this.isV6Format(ip)){var i,sections=ip.split(":",8);for(i=0;i0;i--)argv.push("0");sections.splice.apply(sections,argv)}for(result=buff||new Buffer(offset+16),i=0;i>8&255,result[offset++]=255&word}}if(!result)throw Error("Invalid ip address: "+ip);return result},ip.toString=function(buff,offset,length){offset=~~offset,length=length||buff.length-offset;var result=[];if(4===length){for(var i=0;i32?"ipv6":_normalizeFamily(family);var len=4;"ipv6"===family&&(len=16);for(var buff=new Buffer(len),i=0,n=buff.length;i>bits)}return ip.toString(buff)},ip.mask=function(addr,mask){addr=ip.toBuffer(addr),mask=ip.toBuffer(mask);var result=new Buffer(Math.max(addr.length,mask.length)),i=0;if(addr.length===mask.length)for(i=0;ia.length&&(buff=b,other=a);for(var offset=buff.length-other.length,i=offset;i>>0},ip.fromLong=function(ipl){return(ipl>>>24)+"."+(ipl>>16&255)+"."+(ipl>>8&255)+"."+(255&ipl)}},function(module,exports,__webpack_require__){"use strict";const each=__webpack_require__(15),eachSeries=__webpack_require__(74),waterfall=__webpack_require__(6),setImmediate=__webpack_require__(7),map=__webpack_require__(61),debounce=__webpack_require__(234),uniqWith=__webpack_require__(546),find=__webpack_require__(535),values=__webpack_require__(134),groupBy=__webpack_require__(537),pullAllWith=__webpack_require__(541),Message=__webpack_require__(86),Wantlist=__webpack_require__(87),Ledger=__webpack_require__(394),logger=__webpack_require__(52).logger;class DecisionEngine{constructor(peerId,blockstore,network){this._log=logger(peerId,"engine"),this.blockstore=blockstore,this.network=network,this.ledgerMap=new Map,this._running=!1,this._tasks=[],this._outbox=debounce(this._processTasks.bind(this),100)}_sendBlocks(peer,blocks,cb){if(blocks.reduce((acc,b)=>{return acc+b.data.byteLength},0)<524288)return this._sendSafeBlocks(peer,blocks,cb);let size=0,batch=[],outstanding=blocks.length;eachSeries(blocks,(b,cb)=>{if(outstanding--,batch.push(b),(size+=b.data.byteLength)>=524288||0===outstanding){const nextBatch=batch.slice();batch=[],this._sendSafeBlocks(peer,nextBatch,err=>{err&&this._log("sendblock error: %s",err.message),cb()})}else cb()},cb)}_sendSafeBlocks(peer,blocks,cb){const msg=new Message(!1);blocks.forEach(b=>msg.addBlock(b)),this.network.sendMessage(peer,msg,cb)}_processTasks(){if(this._running&&this._tasks.length){const tasks=this._tasks;this._tasks=[];const entries=tasks.map(t=>t.entry),cids=entries.map(e=>e.cid),uniqCids=uniqWith(cids,(a,b)=>a.equals(b)),groupedTasks=groupBy(tasks,task=>task.target.toB58String());waterfall([cb=>map(uniqCids,(cid,cb)=>{this.blockstore.get(cid,cb)},cb),(blocks,cb)=>each(values(groupedTasks),(tasks,cb)=>{const peer=tasks[0].target,blockList=cids.map(cid=>{return find(blocks,b=>b.cid.equals(cid))});this._sendBlocks(peer,blockList,err=>{err?this._log.error("should never happen: ",err):blockList.forEach(block=>this.messageSent(peer,block)),cb()})})],err=>{this._tasks=[],err&&this._log.error(err)})}}wantlistForPeer(peerId){const peerIdStr=peerId.toB58String();return this.ledgerMap.has(peerIdStr)?this.ledgerMap.get(peerIdStr).wantlist.sortedEntries():new Map}peers(){return Array.from(this.ledgerMap.values()).map(l=>l.partner)}receivedBlocks(cids){cids.length&&(this.ledgerMap.forEach(ledger=>{cids.map(cid=>ledger.wantlistContains(cid)).filter(Boolean).forEach(entry=>{this._tasks.push({entry:entry,target:ledger.partner})})}),this._outbox())}messageReceived(peerId,msg,cb){const ledger=this._findOrCreate(peerId);if(msg.empty)return cb();if(msg.full&&(ledger.wantlist=new Wantlist),this._processBlocks(msg.blocks,ledger),0===msg.wantlist.size)return cb();let cancels=[],wants=[];msg.wantlist.forEach(entry=>{entry.cancel?(ledger.cancelWant(entry.cid),cancels.push(entry)):(ledger.wants(entry.cid,entry.priority),wants.push(entry))}),this._cancelWants(ledger,peerId,cancels),this._addWants(ledger,peerId,wants,cb)}_cancelWants(ledger,peerId,entries){const id=peerId.toB58String();pullAllWith(this._tasks,entries,(t,e)=>{const sameTarget=t.target.toB58String()===id,sameCid=t.entry.cid.equals(e.cid);return sameTarget&&sameCid})}_addWants(ledger,peerId,entries,cb){each(entries,(entry,cb)=>{this.blockstore.has(entry.cid,(err,exists)=>{err?this._log.error("failed existence check"):exists&&this._tasks.push({entry:entry.entry,target:peerId}),cb()})},()=>{this._outbox(),cb()})}_processBlocks(blocks,ledger,callback){const cids=[];blocks.forEach((b,cidStr)=>{this._log("got block (%s bytes)",b.data.length),ledger.receivedBytes(b.data.length),cids.push(b.cid)}),this.receivedBlocks(cids)}messageSent(peerId,block){const ledger=this._findOrCreate(peerId);ledger.sentBytes(block?block.data.length:0),block&&block.cid&&ledger.wantlist.remove(block.cid)}numBytesSentTo(peerId){return this._findOrCreate(peerId).accounting.bytesSent}numBytesReceivedFrom(peerId){return this._findOrCreate(peerId).accounting.bytesRecv}peerDisconnected(peerId){}_findOrCreate(peerId){const peerIdStr=peerId.toB58String();if(this.ledgerMap.has(peerIdStr))return this.ledgerMap.get(peerIdStr);const l=new Ledger(peerId);return this.ledgerMap.set(peerIdStr,l),l}start(callback){this._running=!0,setImmediate(()=>callback())}stop(callback){this._running=!1,setImmediate(()=>callback())}}module.exports=DecisionEngine},function(module,exports,__webpack_require__){"use strict";const Wantlist=__webpack_require__(87);class Ledger{constructor(peerId){this.partner=peerId,this.wantlist=new Wantlist,this.exchangeCount=0,this.sentToPeer=new Map,this.accounting={bytesSent:0,bytesRecv:0}}sentBytes(n){this.exchangeCount++,this.lastExchange=(new Date).getTime(),this.accounting.bytesSent+=n}receivedBytes(n){this.exchangeCount++,this.lastExchange=(new Date).getTime(),this.accounting.bytesRecv+=n}wants(cid,priority){this.wantlist.add(cid,priority)}cancelWant(cid){this.wantlist.remove(cid)}wantlistContains(cid){return this.wantlist.contains(cid)}}module.exports=Ledger},function(module,exports,__webpack_require__){"use strict";const waterfall=__webpack_require__(6),reject=__webpack_require__(165),each=__webpack_require__(15),series=__webpack_require__(32),map=__webpack_require__(61),once=__webpack_require__(57),WantManager=__webpack_require__(401),Network=__webpack_require__(396),DecisionEngine=__webpack_require__(393),Notifications=__webpack_require__(397),logger=__webpack_require__(52).logger;class Bitswap{constructor(libp2p,blockstore){this._libp2p=libp2p,this._log=logger(this.peerInfo.id),this.network=new Network(libp2p,this),this.blockstore=blockstore,this.engine=new DecisionEngine(this.peerInfo.id,blockstore,this.network),this.wm=new WantManager(this.peerInfo.id,this.network),this.blocksRecvd=0,this.dupBlocksRecvd=0,this.dupDataRecvd=0,this.notifications=new Notifications(this.peerInfo.id)}get peerInfo(){return this._libp2p.peerInfo}_receiveMessage(peerId,incoming,callback){this.engine.messageReceived(peerId,incoming,err=>{if(err&&this._log("failed to receive message",incoming),0===incoming.blocks.size)return callback();const blocks=Array.from(incoming.blocks.values()),toCancel=blocks.filter(b=>this.wm.wantlist.contains(b.cid)).map(b=>b.cid);this.wm.cancelWants(toCancel),each(blocks,(b,cb)=>this._handleReceivedBlock(peerId,b,cb),callback)})}_handleReceivedBlock(peerId,block,callback){this._log("received block"),waterfall([cb=>this.blockstore.has(block.cid,cb),(has,cb)=>{if(this._updateReceiveCounters(block,has),has)return cb();this._putBlock(block,cb)}],callback)}_updateReceiveCounters(block,exists){this.blocksRecvd++,exists&&(this.dupBlocksRecvd++,this.dupDataRecvd+=block.data.length)}_receiveError(err){this._log.error("ReceiveError: %s",err.message)}_onPeerConnected(peerId){this.wm.connected(peerId)}_onPeerDisconnected(peerId){this.wm.disconnected(peerId),this.engine.peerDisconnected(peerId)}_putBlock(block,callback){this.blockstore.put(block,err=>{if(err)return callback(err);this.notifications.hasBlock(block),this.network.provide(block.cid,err=>{err&&this._log.error("Failed to provide: %s",err.message)}),this.engine.receivedBlocks([block.cid]),callback()})}wantlistForPeer(peerId){return this.engine.wantlistForPeer(peerId)}get(cid,callback){this.getMany([cid],(err,blocks)=>{if(err)return callback(err);blocks&&blocks.length>0?callback(null,blocks[0]):callback()})}getMany(cids,callback){const retrieved=[],locals=[],missing=[],canceled=[],finish=once(()=>{map(locals,(cid,cb)=>{this.blockstore.get(cid,cb)},(err,localBlocks)=>{if(err)return callback(err);callback(null,localBlocks.concat(retrieved))})});this._log("getMany",cids.length);const addListeners=cids=>{cids.forEach(cid=>{this.notifications.wantBlock(cid,block=>{this.wm.cancelWants([cid]),retrieved.push(block),retrieved.length===missing.length&&finish()},()=>{this.wm.cancelWants([cid]),canceled.push(cid),canceled.length+retrieved.length===missing.length&&finish()})})};each(cids,(cid,cb)=>{this.blockstore.has(cid,(err,has)=>{if(err)return cb(err);has?locals.push(cid):missing.push(cid),cb()})},()=>{0===missing.length&&finish(),addListeners(missing),this.wm.wantBlocks(missing),this.network.findAndConnect(cids[0],err=>{err&&this._log.error(err)})})}unwant(cids){Array.isArray(cids)||(cids=[cids]),this.wm.unwantBlocks(cids),cids.forEach(cid=>this.notifications.unwantBlock(cid))}cancelWants(cids){Array.isArray(cids)||(cids=[cids]),this.wm.cancelWants(cids)}put(block,callback){this._log("putting block"),waterfall([cb=>this.blockstore.has(block.cid,cb),(has,cb)=>{if(has)return cb();this._putBlock(block,cb)}],callback)}putMany(blocks,callback){waterfall([cb=>reject(blocks,(b,cb)=>{this.blockstore.has(b.cid,cb)},cb),(newBlocks,cb)=>this.blockstore.putMany(newBlocks,err=>{if(err)return cb(err);newBlocks.forEach(block=>{this.notifications.hasBlock(block),this.engine.receivedBlocks([block.cid]),this.network.provide(block.cid,err=>{err&&this._log.error("Failed to provide: %s",err.message)})}),cb()})],callback)}getWantlist(){return this.wm.wantlist.entries()}stat(){return{wantlist:this.getWantlist(),blocksReceived:this.blocksRecvd,dupBlksReceived:this.dupBlocksRecvd,dupDataReceived:this.dupDataRecvd,peers:this.engine.peers()}}start(callback){series([cb=>this.wm.start(cb),cb=>this.network.start(cb),cb=>this.engine.start(cb)],callback)}stop(callback){series([cb=>this.wm.stop(cb),cb=>this.network.stop(cb),cb=>this.engine.stop(cb)],callback)}}module.exports=Bitswap},function(module,exports,__webpack_require__){"use strict";function writeMessage(conn,msg,callback){pull(pull.values([msg]),lp.encode(),conn,pull.onEnd(callback))}const lp=__webpack_require__(24),pull=__webpack_require__(4),waterfall=__webpack_require__(6),each=__webpack_require__(15),setImmediate=__webpack_require__(7),Message=__webpack_require__(86),CONSTANTS=__webpack_require__(120),logger=__webpack_require__(52).logger,BITSWAP100="/ipfs/bitswap/1.0.0",BITSWAP110="/ipfs/bitswap/1.1.0";class Network{constructor(libp2p,bitswap,options){this._log=logger(libp2p.peerInfo.id,"network"),options=options||{},this.libp2p=libp2p,this.bitswap=bitswap,this.b100Only=options.b100Only||!1,this._running=!1}start(callback){this._running=!0,this._onPeerConnect=this._onPeerConnect.bind(this),this._onPeerDisconnect=this._onPeerDisconnect.bind(this),this._onConnection=this._onConnection.bind(this),this.libp2p.handle(BITSWAP100,this._onConnection),this.b100Only||this.libp2p.handle(BITSWAP110,this._onConnection),this.libp2p.on("peer:connect",this._onPeerConnect),this.libp2p.on("peer:disconnect",this._onPeerDisconnect),this.libp2p.peerBook.getAllArray().filter(peer=>peer.isConnected()).forEach(peer=>this._onPeerConnect(peer)),setImmediate(()=>callback())}stop(callback){this._running=!1,this.libp2p.unhandle(BITSWAP100),this.b100Only||this.libp2p.unhandle(BITSWAP110),this.libp2p.removeListener("peer:connect",this._onPeerConnect),this.libp2p.removeListener("peer:disconnect",this._onPeerDisconnect),setImmediate(()=>callback())}_onConnection(protocol,conn){this._running&&(this._log("incomming new bitswap connection: %s",protocol),pull(conn,lp.decode(),pull.asyncMap((data,cb)=>Message.deserialize(data,cb)),pull.asyncMap((msg,cb)=>{conn.getPeerInfo((err,peerInfo)=>{if(err)return cb(err);this.bitswap._receiveMessage(peerInfo.id,msg,cb)})}),pull.onEnd(err=>{this._log("ending connection"),err&&this.bitswap._receiveError(err)})))}_onPeerConnect(peerInfo){this._running&&this.bitswap._onPeerConnected(peerInfo.id)}_onPeerDisconnect(peerInfo){this._running&&this.bitswap._onPeerDisconnected(peerInfo.id)}findProviders(cid,maxProviders,callback){this.libp2p.contentRouting.findProviders(cid,CONSTANTS.providerRequestTimeout,callback)}findAndConnect(cid,callback){waterfall([cb=>this.findProviders(cid,CONSTANTS.maxProvidersPerRequest,cb),(provs,cb)=>{this._log("connecting to providers",provs.map(p=>p.id.toB58String())),each(provs,(p,cb)=>this.connectTo(p,cb))}],callback)}provide(cid,callback){this.libp2p.contentRouting.provide(cid,callback)}sendMessage(peer,msg,callback){if(!this._running)return callback(new Error(`network isn't running`));const stringId=peer.toB58String()?peer.toB58String():peer.id.toB58String();this._log("sendMessage to %s",stringId,msg),this._dialPeer(peer,(err,conn,protocol)=>{if(err)return callback(err);let serialized;switch(protocol){case BITSWAP100:serialized=msg.serializeToBitswap100();break;case BITSWAP110:serialized=msg.serializeToBitswap110();break;default:return callback(new Error("Unkown protocol: "+protocol))}writeMessage(conn,serialized,err=>{err&&this._log.error(err)}),callback()})}connectTo(peer,callback){if(!this._running)return callback(new Error(`network isn't running`));this.libp2p.dial(peer,callback)}_dialPeer(peer,callback){this.libp2p.dial(peer,BITSWAP110,(err,conn)=>{if(err)return void this.libp2p.dial(peer,BITSWAP100,(err,conn)=>{if(err)return callback(err);callback(null,conn,BITSWAP100)});callback(null,conn,BITSWAP110)})}}module.exports=Network},function(module,exports,__webpack_require__){"use strict";const EventEmitter=__webpack_require__(10).EventEmitter,CONSTANTS=__webpack_require__(120),logger=__webpack_require__(52).logger,unwantEvent=c=>`unwant:${c}`,blockEvent=c=>`block:${c}`;class Notifications extends EventEmitter{constructor(peerId){super(),this.setMaxListeners(CONSTANTS.maxListeners),this._log=logger(peerId,"notif"),this._unwantListeners={},this._blockListeners={}}hasBlock(block){const str=`block:${block.cid.buffer.toString()}`;this._log(str),this.emit(str,block)}wantBlock(cid,onBlock,onUnwant){const cidStr=cid.buffer.toString();this._log(`wantBlock:${cidStr}`),this._unwantListeners[cidStr]=(()=>{this._log(`manual unwant: ${cidStr}`),this._cleanup(cidStr),onUnwant()}),this._blockListeners[cidStr]=(block=>{this._cleanup(cidStr),onBlock(block)}),this.once(unwantEvent(cidStr),this._unwantListeners[cidStr]),this.once(blockEvent(cidStr),this._blockListeners[cidStr])}unwantBlock(cid){const str=`unwant:${cid.buffer.toString()}`;this._log(str),this.emit(str)}_cleanup(cidStr){this._unwantListeners[cidStr]&&(this.removeListener(unwantEvent(cidStr),this._unwantListeners[cidStr]),delete this._unwantListeners[cidStr]),this._blockListeners[cidStr]&&(this.removeListener(blockEvent(cidStr),this._blockListeners[cidStr]),delete this._blockListeners[cidStr])}}module.exports=Notifications},function(module,exports,__webpack_require__){"use strict";const WantlistEntry=__webpack_require__(87).Entry,CID=__webpack_require__(8),assert=__webpack_require__(9);module.exports=class BitswapMessageEntry{constructor(cid,priority,cancel){assert(CID.isCID(cid),"needs valid cid"),this.entry=new WantlistEntry(cid,priority),this.cancel=Boolean(cancel)}get cid(){return this.entry.cid}set cid(cid){this.entry.cid=cid}get priority(){return this.entry.priority} +set priority(val){this.entry.priority=val}get[Symbol.toStringTag](){return`BitswapMessageEntry ${this.cid.toBaseEncodedString()} `}equals(other){return this.cancel===other.cancel&&this.entry.equals(other.entry)}}},function(module,exports,__webpack_require__){"use strict";module.exports=` message Message { message Wantlist { message Entry { @@ -107,8 +107,8 @@ unwantListeners[cidStr]&&(this.notifications.removeListener(unwantEvent,unwantLi repeated bytes blocks = 2; // used to send Blocks in bitswap 1.0.0 repeated Block payload = 3; // used to send Blocks in bitswap 1.1.0 } -`},function(module,exports,__webpack_require__){"use strict";const assert=__webpack_require__(9),CID=__webpack_require__(8);class WantListEntry{constructor(cid,priority){assert(CID.isCID(cid),"must be valid CID"),this._refCounter=1,this.cid=cid,this.priority=priority||1}inc(){this._refCounter+=1}dec(){this._refCounter=Math.max(0,this._refCounter-1)}hasRefs(){return this._refCounter>0}get[Symbol.toStringTag](){return`WantlistEntry `}equals(other){return this._refCounter===other._refCounter&&this.cid.equals(other.cid)&&this.priority===other.priority}}module.exports=WantListEntry},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(12),multibase=__webpack_require__(134),multicodec=__webpack_require__(135),codecs=__webpack_require__(65),codecVarints=__webpack_require__(90),multihash=__webpack_require__(12);class CID{constructor(version,codec,multihash){if("string"==typeof version)if(multibase.isEncoded(version)){const cid=multibase.decode(version);this.version=parseInt(cid.slice(0,1).toString("hex"),16),this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=mh.fromB58String(version),this.version=0;else if(Buffer.isBuffer(version)){const firstByte=version.slice(0,1),v=parseInt(firstByte.toString("hex"),16);if(0===v||1===v){const cid=version;this.version=v,this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=version,this.version=0}else if("number"==typeof version){if("string"!=typeof codec)throw new Error("codec must be string");if(0!==version&&1!==version)throw new Error("version must be a number equal to 0 or 1");mh.validate(multihash),this.codec=codec,this.version=version,this.multihash=multihash}}get buffer(){switch(this.version){case 0:return this.multihash;case 1:return Buffer.concat([Buffer("01","hex"),Buffer(codecVarints[this.codec]),this.multihash]);default:throw new Error("unsupported version")}}get prefix(){return Buffer.concat([new Buffer(`0${this.version}`,"hex"),codecVarints[this.codec],multihash.prefix(this.multihash)])}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");return new CID(0,this.codec,this.multihash)}toV1(){return new CID(1,this.codec,this.multihash)}toBaseEncodedString(base){switch(base=base||"base58btc",this.version){case 0:if("base58btc"!==base)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");return mh.toB58String(this.multihash);case 1:return multibase.encode(base,this.buffer).toString();default:throw new Error("Unsupported version")}}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(other){return this.codec===other.codec&&this.version===other.version&&this.multihash.equals(other.multihash)}}CID.codecs=codecs,CID.isCID=(other=>{return"CID"===other.constructor.name}),module.exports=CID}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const Key=__webpack_require__(16).Key,Buffer=__webpack_require__(6).Buffer,apiFile=new Key("api");module.exports=(store=>{return{get(callback){store.get(apiFile,(err,value)=>callback(err,value&&value.toString()))},set(value,callback){store.put(apiFile,Buffer.from(value.toString()),callback)},delete(callback){store.delete(apiFile,callback)}}})},function(module,exports,__webpack_require__){"use strict";exports.create=function(name,path,options){return new(0,options.storageBackends[name])(path,Object.assign({},options.storageBackendOptions[name]||{}))}},function(module,exports,__webpack_require__){"use strict";function maybeWithSharding(filestore,options,callback){if(options.sharding){const shard=new core.shard.NextToLast(2);ShardingStore.createOrOpen(filestore,shard,callback)}else setImmediate(()=>callback(null,filestore))}function createBaseStore(store){return{get(cid,callback){if(!CID.isCID(cid))return setImmediate(()=>{callback(new Error("Not a valid cid"))});const k=cidToDsKey(cid);store.get(k,(err,blockData)=>{if(err)return callback(err);callback(null,new Block(blockData,cid))})},put(block,callback){if(!Block.isBlock(block))return setImmediate(()=>{callback(new Error("invalid block"))});const k=cidToDsKey(block.cid);store.has(k,(err,exists)=>{return err?callback(err):exists?callback():void store.put(k,block.data,callback)})},putMany(blocks,callback){const keys=blocks.map(b=>({key:cidToDsKey(b.cid),block:b})),batch=store.batch();reject(keys,(k,cb)=>store.has(k.key,cb),(err,newKeys)=>{if(err)return callback(err);newKeys.forEach(k=>{batch.put(k.key,k.block.data)}),batch.commit(callback)})},has(cid,callback){if(!CID.isCID(cid))return setImmediate(()=>{callback(new Error("Not a valid cid"))});store.has(cidToDsKey(cid),callback)},delete(cid,callback){if(!CID.isCID(cid))return setImmediate(()=>{callback(new Error("Not a valid cid"))});store.delete(cidToDsKey(cid),callback)},close(callback){store.close(callback)}}}const core=__webpack_require__(326),ShardingStore=core.ShardingDatastore,Key=__webpack_require__(16).Key,base32=__webpack_require__(303),Block=__webpack_require__(61),setImmediate=__webpack_require__(10),reject=__webpack_require__(160),CID=__webpack_require__(8),keyFromBuffer=rawKey=>{return new Key("/"+(new base32.Encoder).write(rawKey).finalize(),!1)},cidToDsKey=cid=>{return keyFromBuffer(cid.buffer)};module.exports=((filestore,options,callback)=>{maybeWithSharding(filestore,options,(err,store)=>{if(err)return callback(err);callback(null,createBaseStore(store))})})},function(module,exports,__webpack_require__){"use strict";const Key=__webpack_require__(16).Key,queue=__webpack_require__(106),waterfall=__webpack_require__(7),_get=__webpack_require__(228),_set=__webpack_require__(528),_has=__webpack_require__(524),Buffer=__webpack_require__(6).Buffer,configKey=new Key("config");module.exports=(store=>{function _doSet(m,callback){const key=m.key,value=m.value;key?waterfall([cb=>configStore.get(cb),(config,cb)=>cb(null,_set(config,key,value)),_saveAll],callback):_saveAll(value,callback)}function _saveAll(config,callback){const buf=Buffer.from(JSON.stringify(config,null,2));store.put(configKey,buf,callback)}const setQueue=queue(_doSet,1),configStore={get(key,callback){"function"==typeof key&&(callback=key,key=void 0),key||(key=void 0),store.get(configKey,(err,encodedValue)=>{if(err)return callback(err);let config;try{config=JSON.parse(encodedValue.toString())}catch(err){return callback(err)}if(void 0!==key&&!_has(config,key))return callback(new Error("Key "+key+" does not exist in config"));callback(null,void 0!==key?_get(config,key):config)})},set(key,value,callback){if("function"==typeof value)callback=value,value=key,key=void 0;else if(!key||"string"!=typeof key)return callback(new Error("Invalid key type"));if(void 0===value||Buffer.isBuffer(value))return callback(new Error("Invalid value type"));setQueue.push({key:key,value:value},callback)},exists(callback){store.has(configKey,callback)}};return configStore})},function(module,exports,__webpack_require__){"use strict";module.exports={lock:"memory",storageBackends:{root:__webpack_require__(110),blocks:__webpack_require__(110),datastore:__webpack_require__(110)},storageBackendOptions:{root:{db:__webpack_require__(122),extension:""},blocks:{sharding:!1,db:__webpack_require__(122)},datastore:{db:__webpack_require__(122)}}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const Key=__webpack_require__(16).Key,debug=__webpack_require__(3),log=debug("repo:version"),versionKey=new Key("version");module.exports=(store=>{return{exists(callback){store.has(versionKey,callback)},get(callback){store.get(versionKey,(err,buf)=>{if(err)return callback(err);callback(null,parseInt(buf.toString().trim(),10))})},set(version,callback){store.put(versionKey,new Buffer(String(version)),callback)},check(expected,callback){this.get((err,version)=>{return err?callback(err):(log("comparing version: %s and %s",version,expected),version!==expected?callback(new Error(`version mismatch: expected v${expected}, found v${version}`)):void callback())})}}})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function isSpecificValue(val){return val instanceof Buffer||val instanceof Date||val instanceof RegExp}function cloneSpecificValue(val){if(val instanceof Buffer){var x=new Buffer(val.length);return val.copy(x),x}if(val instanceof Date)return new Date(val.getTime());if(val instanceof RegExp)return new RegExp(val);throw new Error("Unexpected situation")}function deepCloneArray(arr){var clone=[];return arr.forEach(function(item,index){"object"==typeof item&&null!==item?Array.isArray(item)?clone[index]=deepCloneArray(item):isSpecificValue(item)?clone[index]=cloneSpecificValue(item):clone[index]=deepExtend({},item):clone[index]=item}),clone}var deepExtend=module.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var val,src,target=arguments[0],args=Array.prototype.slice.call(arguments,1);return args.forEach(function(obj){"object"!=typeof obj||null===obj||Array.isArray(obj)||Object.keys(obj).forEach(function(key){return src=target[key],val=obj[key],val===target?void 0:"object"!=typeof val||null===val?void(target[key]=val):Array.isArray(val)?void(target[key]=deepCloneArray(val)):isSpecificValue(val)?void(target[key]=cloneSpecificValue(val)):"object"!=typeof src||null===src||Array.isArray(src)?void(target[key]=deepExtend({},val)):void(target[key]=deepExtend(src,val))})}),target}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(4),pushable=__webpack_require__(30),pullPair=__webpack_require__(97),batch=__webpack_require__(137);module.exports=function(reduce,options){function reduceToParents(_chunks,callback){function reduced(err,roots){err?callback(err):roots.length>1?reduceToParents(roots,callback):callback(null,roots)}let chunks=_chunks;Array.isArray(chunks)&&(chunks=pull.values(chunks)),pull(chunks,batch(options.maxChildrenPerNode),pull.asyncMap(reduce),pull.collect(reduced))}const pair=pullPair(),source=pair.source,result=pushable();return reduceToParents(source,(err,roots)=>{if(err)return void result.end(err);1===roots.length?(result.push(roots[0]),result.end()):roots.length>1?result.end(new Error("expected a maximum of 1 roots and got "+roots.length)):result.end()}),{sink:pair.sink,source:result}}},function(module,exports,__webpack_require__){"use strict";const balancedReducer=__webpack_require__(405),defaultOptions={maxChildrenPerNode:174};module.exports=function(reduce,_options){return balancedReducer(reduce,Object.assign({},defaultOptions,_options))}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const extend=__webpack_require__(404),UnixFS=__webpack_require__(41),pull=__webpack_require__(4),through=__webpack_require__(98),parallel=__webpack_require__(39),waterfall=__webpack_require__(7),dagPB=__webpack_require__(52),CID=__webpack_require__(8),reduce=__webpack_require__(411),DAGNode=dagPB.DAGNode,defaultOptions={chunkerOptions:{maxChunkSize:262144}};module.exports=function(createChunker,ipldResolver,createReducer,_options){function createAndStoreDir(item,callback){const d=new UnixFS("directory");waterfall([cb=>DAGNode.create(d.marshal(),cb),(node,cb)=>{ipldResolver.put(node,{cid:new CID(node.multihash)},err=>cb(err,node))}],(err,node)=>{if(err)return callback(err);callback(null,{path:item.path,multihash:node.multihash,size:node.size})})}function createAndStoreFile(file,callback){if(Buffer.isBuffer(file.content)&&(file.content=pull.values([file.content])),"function"!=typeof file.content)return callback(new Error("invalid content"));const reducer=createReducer(reduce(file,ipldResolver,options),options);let previous,count=0;pull(file.content,createChunker(options.chunkerOptions),pull.map(chunk=>new Buffer(chunk)),pull.map(buffer=>new UnixFS("file",buffer)),pull.asyncMap((fileNode,callback)=>{DAGNode.create(fileNode.marshal(),(err,node)=>{callback(err,{DAGNode:node,fileNode:fileNode})})}),pull.asyncMap((leaf,callback)=>{ipldResolver.put(leaf.DAGNode,{cid:new CID(leaf.DAGNode.multihash)},err=>callback(err,leaf))}),pull.map(leaf=>{return{path:file.path,multihash:leaf.DAGNode.multihash,size:leaf.DAGNode.size,leafSize:leaf.fileNode.fileSize(),name:""}}),through(function(data){count++,previous&&this.queue(previous),previous=data},function(){previous&&(1===count&&(previous.single=!0),this.queue(previous)),this.queue(null)}),reducer,pull.collect((err,roots)=>{err?callback(err):callback(null,roots[0])}))}const options=extend({},defaultOptions,_options);return function(source){return function(items,cb){parallel(items.map(item=>cb=>{if(!item.content)return createAndStoreDir(item,(err,node)=>{if(err)return cb(err);node&&source.push(node),cb()});createAndStoreFile(item,(err,node)=>{if(err)return cb(err);node&&source.push(node),cb()})}),cb)}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const pullPushable=__webpack_require__(30),pullWrite=__webpack_require__(99);module.exports=function(createStrategy,ipldResolver,options){const source=pullPushable();return{source:source,sink:pullWrite(createStrategy(source),null,options.highWaterMark,err=>source.end(err))}}},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(4),pushable=__webpack_require__(30),pullPair=__webpack_require__(97),batch=__webpack_require__(137);module.exports=function(reduce,options){const pair=pullPair(),source=pair.source,result=pushable();return pull(source,batch(1/0),pull.asyncMap(reduce),pull.collect((err,roots)=>{if(err)return void result.end(err);1===roots.length?(result.push(roots[0]),result.end()):roots.length>1?result.end(new Error("expected a maximum of 1 roots and got "+roots.length)):result.end()})),{sink:pair.sink,source:result}}},function(module,exports,__webpack_require__){"use strict";const assert=__webpack_require__(9),createBuildStream=__webpack_require__(408),Builder=__webpack_require__(407),reducers={flat:__webpack_require__(409),balanced:__webpack_require__(406),trickle:__webpack_require__(412)},defaultOptions={strategy:"balanced",highWaterMark:100,reduceSingleLeafToSelf:!1};module.exports=function(Chunker,ipldResolver,_options){assert(Chunker,"Missing chunker creator function"),assert(ipldResolver,"Missing IPLD Resolver");const options=Object.assign({},defaultOptions,_options),strategyName=options.strategy,reducer=reducers[strategyName];return assert(reducer,"Unknown importer build strategy name: "+strategyName),createBuildStream(Builder(Chunker,ipldResolver,reducer,options),ipldResolver,options)}},function(module,exports,__webpack_require__){"use strict";const waterfall=__webpack_require__(7),dagPB=__webpack_require__(52),UnixFS=__webpack_require__(41),CID=__webpack_require__(8),DAGLink=dagPB.DAGLink,DAGNode=dagPB.DAGNode;module.exports=function(file,ipldResolver,options){return function(leaves,callback){if(1===leaves.length&&(leaves[0].single||options.reduceSingleLeafToSelf)){const leave=leaves[0];return void callback(null,{path:file.path,multihash:leave.multihash,size:leave.size,leafSize:leave.leafSize,name:leave.name})}const f=new UnixFS("file"),links=leaves.map(leaf=>{return f.addBlockSize(leaf.leafSize),new DAGLink(leaf.name,leaf.size,leaf.multihash)});waterfall([cb=>DAGNode.create(f.marshal(),links,cb),(node,cb)=>{ipldResolver.put(node,{cid:new CID(node.multihash)},err=>cb(err,node))}],(err,node)=>{if(err)return void callback(err);callback(null,{name:"",path:file.path,multihash:node.multihash,size:node.size,leafSize:f.fileSize()})})}}},function(module,exports,__webpack_require__){"use strict";const trickleReducer=__webpack_require__(413),defaultOptions={maxChildrenPerNode:174,layerRepeat:4};module.exports=function(reduce,_options){return trickleReducer(reduce,Object.assign({},defaultOptions,_options))}},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(4),pushable=__webpack_require__(30),batch=__webpack_require__(137),pullPair=__webpack_require__(97),through=__webpack_require__(98),pullWrite=__webpack_require__(99),pause=__webpack_require__(249);module.exports=function(reduce,options){function trickle(indent,maxDepth){function write(nodes,callback){let ended=!1;const node=nodes[0];depth&&!deeper&&(deeper=pushable(),pull(deeper,trickle(indent+1,depth-1),through(function(d){this.queue(d)},function(err){if(err)return void this.emit("error",err);ended||(ended=!0,pendingResumes++,pausable.pause()),this.queue(null)}),batch(1/0),pull.asyncMap(reduce),pull.collect((err,nodes)=>{if(pendingResumes--,err)return void result.end(err);nodes.forEach(node=>{result.push(node)}),iterate()}))),deeper?deeper.push(node):(result.push(node),iterate()),callback()}function iterate(){deeper=null,iteration++,(0===depth&&iteration===options.maxChildrenPerNode||depth>0&&iteration===options.layerRepeat)&&(iteration=0,depth++),(!aborting&&maxDepth>=0&&depth>maxDepth||aborting&&!pendingResumes)&&(aborting=!0,result.end()),pendingResumes||pausable.resume()}function end(err){if(err)return void result.end(err);deeper?aborting||(aborting=!0,deeper.end()):result.end()}let deeper,iteration=0,depth=0,aborting=!1;const result=pushable();return{source:result,sink:pullWrite(write,null,1,end)}}const pair=pullPair(),result=pushable(),pausable=pause(()=>{});let pendingResumes=0;return pull(pair.source,pausable,trickle(0,-1),batch(1/0),pull.asyncMap(reduce),pull.collect((err,roots)=>{err?result.end(err):1===roots.length?(result.push(roots[0]),result.end()):roots.length>1?result.end(new Error("expected a maximum of 1 roots and got "+roots.length)):result.end()})),{sink:pair.sink,source:result}}},function(module,exports,__webpack_require__){"use strict";const pullBlock=__webpack_require__(594);module.exports=(options=>{return pullBlock("number"==typeof options?options:options.maxChunkSize,{zeroPadding:!1,emitEmpty:!0})})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(12);module.exports=(multihash=>{return Buffer.isBuffer(multihash)?mh.toB58String(multihash):multihash})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function dirExporter(node,name,pathRest,ipldResolver,resolve,parent){const accepts=pathRest[0],dir={path:name,hash:node.multihash},streams=[pull(pull.values(node.links),pull.map(link=>({linkName:link.name,path:path.join(name,link.name),hash:link.multihash})),pull.filter(item=>void 0===accepts||item.linkName===accepts),paramap((item,cb)=>ipldResolver.get(new CID(item.hash),(err,n)=>{if(err)return cb(err);cb(null,resolve(n.value,accepts||item.path,pathRest,ipldResolver,name,parent))})),pull.flatten())];return pathRest.length||streams.unshift(pull.values([dir])),pathRest.shift(),cat(streams)}const path=__webpack_require__(43),pull=__webpack_require__(4),paramap=__webpack_require__(139),CID=__webpack_require__(8),cat=__webpack_require__(138);module.exports=dirExporter},function(module,exports,__webpack_require__){"use strict";function shardedDirExporter(node,name,pathRest,ipldResolver,resolve,parent){let dir;parent&&parent.path===name||(dir=[{path:name,hash:cleanHash(node.multihash)}]);const streams=[pull(pull.values(node.links),pull.map(link=>{const p=link.name.substring(2),pp=p?path.join(name,p):name;let accept=!0,fromPathRest=!1;return p&&pathRest.length&&(fromPathRest=!0,accept=p===pathRest[0]),accept?{fromPathRest:fromPathRest,name:p,path:pp,hash:link.multihash,pathRest:p?pathRest.slice(1):pathRest}:""}),pull.filter(Boolean),paramap((item,cb)=>ipldResolver.get(new CID(item.hash),(err,n)=>{if(err)return cb(err);cb(null,resolve(n.value,item.fromPathRest?item.name:item.path,item.pathRest,ipldResolver,dir&&dir[0]||parent))})),pull.flatten())];return pathRest.length||streams.unshift(pull.values(dir)),cat(streams)}const path=__webpack_require__(43),pull=__webpack_require__(4),paramap=__webpack_require__(139),CID=__webpack_require__(8),cat=__webpack_require__(138),cleanHash=__webpack_require__(415);module.exports=shardedDirExporter},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const traverse=__webpack_require__(257),UnixFS=__webpack_require__(41),CID=__webpack_require__(8),pull=__webpack_require__(4),paramap=__webpack_require__(139);module.exports=((node,name,pathRest,ipldResolver)=>{function getData(node){try{const file=UnixFS.unmarshal(node.data);return file.data||new Buffer(0)}catch(err){throw new Error("Failed to unmarshal node")}}function visitor(node){return pull(pull.values(node.links),paramap((link,cb)=>ipldResolver.get(new CID(link.multihash),cb)),pull.map(result=>result.value))}const accepts=pathRest.shift();if(void 0!==accepts&&accepts!==name)return pull.empty();let content=pull(traverse.depthFirst(node,visitor),pull.map(getData));const file=UnixFS.unmarshal(node.data);return pull.values([{content:content,path:name,size:file.fileSize()}])})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function pathBaseAndRest(path){let pathBase=path,pathRest="/";if(Buffer.isBuffer(path)&&(pathBase=new CID(path).toBaseEncodedString()),"string"==typeof path){0===path.indexOf("/ipfs/")&&(path=pathBase=path.substring(6));const subtreeStart=path.indexOf("/");subtreeStart>0&&(pathBase=path.substring(0,subtreeStart),pathRest=path.substring(subtreeStart))}else CID.isCID(pathBase)&&(pathBase=pathBase.toBaseEncodedString());return pathBase=new CID(pathBase).toBaseEncodedString(),{base:pathBase,rest:pathRest.split("/").filter(Boolean)}}const pull=__webpack_require__(4),CID=__webpack_require__(8),pullDefer=__webpack_require__(95),resolve=__webpack_require__(421).resolve;module.exports=((path,dag)=>{try{path=pathBaseAndRest(path)}catch(err){return pull.error(err)}const d=pullDefer.source(),cid=new CID(path.base);return dag.get(cid,(err,node)=>{if(err)return pull.error(err);d.resolve(pull.values([node]))}),pull(d,pull.map(result=>result.value),pull.map(node=>resolve(node,path.base,path.rest,dag)),pull.flatten())})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function sanitizeCID(cid){return new CID(cid.version,cid.codec,cid.multihash)}const path=__webpack_require__(43),CID=__webpack_require__(8),pull=__webpack_require__(4),pullDefer=__webpack_require__(95);module.exports=((node,name,pathRest,ipldResolver,resolve)=>{let newNode;if(pathRest.length){const pathElem=pathRest.shift();newNode=node[pathElem];const newName=path.join(name,pathElem);if(CID.isCID(newNode)){const d=pullDefer.source();return ipldResolver.get(sanitizeCID(newNode),(err,newNode)=>{err?d.resolve(pull.error(err)):d.resolve(resolve(newNode.value,newName,pathRest,ipldResolver,node))}),d}return void 0!==newNode?resolve(newNode,newName,pathRest,ipldResolver,node):pull.error("not found")}return pull.error(new Error("invalid node type"))})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function resolve(node,hash,pathRest,ipldResolver,parentNode){const type=typeOf(node),resolver=resolvers[type];return resolver?resolver(node,hash,pathRest,ipldResolver,resolve,parentNode):pull.error(new Error("Unkown node type "+type))}function typeOf(node){return Buffer.isBuffer(node.data)?UnixFS.unmarshal(node.data).type:"object"}const UnixFS=__webpack_require__(41),pull=__webpack_require__(4),resolvers={directory:__webpack_require__(416),"hamt-sharded-directory":__webpack_require__(417),file:__webpack_require__(418),object:__webpack_require__(420)};module.exports=Object.assign({resolve:resolve,typeOf:typeOf},resolvers)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(process){function exists(o){return Boolean(o)}function mapNode(node,index){return node.key}function reduceNodes(nodes){return nodes}function asyncTransformBucket(bucket,asyncMap,asyncReduce,callback){map(bucket._children.compactArray(),(child,callback)=>{child instanceof Bucket?asyncTransformBucket(child,asyncMap,asyncReduce,callback):asyncMap(child,(err,mappedChildren)=>{err?callback(err):callback(null,{bitField:bucket._children.bitField(),children:mappedChildren})})},(err,mappedChildren)=>{err?callback(err):asyncReduce(mappedChildren,callback)})}const SparseArray=__webpack_require__(663),map=__webpack_require__(73),eachSeries=__webpack_require__(71),wrapHash=__webpack_require__(424),defaultOptions={bits:8};class Bucket{constructor(options,parent,posAtParent){if(this._options=Object.assign({},defaultOptions,options),this._popCount=0,this._parent=parent,this._posAtParent=posAtParent,!this._options.hashFn)throw new Error("please define an options.hashFn");this._options.hash||(this._options.hash=wrapHash(this._options.hashFn)),this._children=new SparseArray}static isBucket(o){return o instanceof Bucket}put(key,value,callback){this._findNewBucketAndPos(key,(err,place)=>{if(err)return void callback(err);place.bucket._putAt(place,key,value),callback()})}get(key,callback){this._findChild(key,(err,child)=>{err?callback(err):callback(null,child&&child.value)})}del(key,callback){this._findPlace(key,(err,place)=>{if(err)return void callback(err);const child=place.bucket._at(place.pos);child&&child.key===key&&place.bucket._delAt(place.pos),callback(null)})}leafCount(){this._children.reduce((acc,child)=>{return child instanceof Bucket?acc+child.leafCount():acc+1},0)}childrenCount(){return this._children.length}onlyChild(callback){process.nextTick(()=>callback(null,this._children.get(0)))}eachLeafSeries(iterator,callback){eachSeries(this._children.compactArray(),(child,cb)=>{child instanceof Bucket?child.eachLeafSeries(iterator,cb):iterator(child.key,child.value,cb)},callback)}serialize(map,reduce){return reduce(this._children.reduce((acc,child,index)=>{return child&&(child instanceof Bucket?acc.push(child.serialize(map,reduce)):acc.push(map(child,index))),acc},[]))}asyncTransform(asyncMap,asyncReduce,callback){asyncTransformBucket(this,asyncMap,asyncReduce,callback)}toJSON(){return this.serialize(mapNode,reduceNodes)}prettyPrint(){return JSON.stringify(this.toJSON(),null," ")}tableSize(){return Math.pow(2,this._options.bits)}_findChild(key,callback){this._findPlace(key,(err,result)=>{if(err)return void callback(err);const child=result.bucket._at(result.pos);child&&child.key===key?callback(null,child):callback(null,void 0)})}_findPlace(key,callback){const hashValue=this._options.hash(key);hashValue.take(this._options.bits,(err,index)=>{if(err)return void callback(err);const child=this._children.get(index);if(child instanceof Bucket)child._findPlace(hashValue,callback);else{const place={bucket:this,pos:index,hash:hashValue};callback(null,place)}})}_findNewBucketAndPos(key,callback){this._findPlace(key,(err,place)=>{if(err)return void callback(err);const child=place.bucket._at(place.pos);if(child&&child.key!==key){const bucket=new Bucket(this._options,place.bucket,place.pos);place.bucket._putObjectAt(place.pos,bucket),bucket._findPlace(child.hash,(err,newPlace)=>{if(err)return void callback(err);newPlace.bucket._putAt(newPlace,child.key,child.value),bucket._findNewBucketAndPos(place.hash,callback)})}else callback(null,place)})}_putAt(place,key,value){this._putObjectAt(place.pos,{key:key,value:value,hash:place.hash})}_putObjectAt(pos,object){this._children.get(pos)||this._popCount++,this._children.set(pos,object)}_delAt(pos){this._children.get(pos)&&this._popCount--,this._children.unset(pos),this._level()}_level(){if(this._parent&&this._popCount<=1)if(1===this._popCount){const onlyChild=this._children.find(exists);if(!(onlyChild instanceof Bucket)){const hash=onlyChild.hash;hash.untake(this._options.bits);const place={pos:this._posAtParent,hash:hash};this._parent._putAt(place,onlyChild.key,onlyChild.value)}}else this._parent._delAt(this._posAtParent)}_at(index){return this._children.get(index)}}module.exports=Bucket}).call(exports,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";function byteBitsToInt(byte,start,length){return(byte&maskFor(start,length))>>>start}function maskFor(start,length){return START_MASKS[start]&STOP_MASKS[Math.min(length+start-1,7)]}const START_MASKS=[255,254,252,248,240,224,192,128],STOP_MASKS=[1,3,7,15,31,63,127,255];module.exports=class ConsumableBuffer{constructor(value){this._value=value,this._currentBytePos=value.length-1,this._currentBitPos=7}availableBits(){return this._currentBitPos+1+8*this._currentBytePos}totalBits(){return 8*this._value.length}take(bits){let pendingBits=bits,result=0;for(;pendingBits&&this._haveBits();){const byte=this._value[this._currentBytePos],availableBits=this._currentBitPos+1,taking=Math.min(availableBits,pendingBits),value=byteBitsToInt(byte,availableBits-taking,taking);result=(result<7;)this._currentBitPos-=8,this._currentBytePos+=1}_haveBits(){return this._currentBytePos>=0}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer,process){const whilst=__webpack_require__(74),ConsumableBuffer=__webpack_require__(423);module.exports=function(hashFn){return function(value){return value instanceof InfiniteHash?value:new InfiniteHash(value,hashFn)}};class InfiniteHash{constructor(value,hashFn){if("string"!=typeof value&&!Buffer.isBuffer(value))throw new Error("can only hash strings or buffers");this._value=value,this._hashFn=hashFn,this._depth=-1,this._availableBits=0,this._currentBufferIndex=0,this._buffers=[]}take(bits,callback){let pendingBits=bits;whilst(()=>this._availableBits{this._produceMoreBits(callback)},err=>{if(err)return void callback(err);let result=0;whilst(()=>pendingBits>0,callback=>{const hash=this._buffers[this._currentBufferIndex],available=Math.min(hash.availableBits(),pendingBits);result=(result<{if(err)return void callback(err);process.nextTick(()=>callback(null,result))})})}untake(bits){let pendingBits=bits;for(;pendingBits>0;){const hash=this._buffers[this._currentBufferIndex],availableForUntake=Math.min(hash.totalBits()-hash.availableBits(),pendingBits);hash.untake(availableForUntake),pendingBits-=availableForUntake,this._availableBits+=availableForUntake,this._currentBufferIndex>0&&hash.totalBits()===hash.availableBits()&&(this._depth--,this._currentBufferIndex--)}}_produceMoreBits(callback){this._depth++;const value=this._depth?this._value+this._depth:this._value;this._hashFn(value,(err,hashValue)=>{if(err)return void callback(err);const buffer=new ConsumableBuffer(hashValue);this._buffers.push(buffer),this._availableBits+=buffer.availableBits(),callback()})}}}).call(exports,__webpack_require__(0).Buffer,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";const Bucket=__webpack_require__(422);module.exports=function(options){return new Bucket(options)},module.exports.isBucket=Bucket.isBucket},function(module,exports,__webpack_require__){"use strict";(function(process){function createDirFlat(props){return new DirFlat(props)} -const asyncEachSeries=__webpack_require__(71),waterfall=__webpack_require__(7),CID=__webpack_require__(8),dagPB=__webpack_require__(52),UnixFS=__webpack_require__(41),DAGLink=dagPB.DAGLink,DAGNode=dagPB.DAGNode,Dir=__webpack_require__(117);class DirFlat extends Dir{constructor(props){super(),this._children={},Object.assign(this,props)}put(name,value,callback){this.multihash=void 0,this.size=void 0,this._children[name]=value,process.nextTick(callback)}get(name,callback){process.nextTick(()=>callback(null,this._children[name]))}childCount(){return Object.keys(this._children).length}directChildrenCount(){return this.childCount()}onlyChild(callback){process.nextTick(()=>callback(null,this._children[Object.keys(this._children)[0]]))}eachChildSeries(iterator,callback){asyncEachSeries(Object.keys(this._children),(key,callback)=>{iterator(key,this._children[key],callback)},callback)}flush(path,ipldResolver,source,callback){const links=Object.keys(this._children).map(key=>{const child=this._children[key];return new DAGLink(key,child.size,child.multihash)}),dir=new UnixFS("directory");waterfall([callback=>DAGNode.create(dir.marshal(),links,callback),(node,callback)=>{ipldResolver.put(node,{cid:new CID(node.multihash)},err=>callback(err,node))},(node,callback)=>{this.multihash=node.multihash,this.size=node.size;const pushable={path:path,multihash:node.multihash,size:node.size};source.push(pushable),callback(null,node)}],callback)}}module.exports=createDirFlat}).call(exports,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function createDirSharded(props){return new DirSharded(props)}function flush(options,bucket,path,ipldResolver,source,callback){function collectChild(child,index,callback){const labelPrefix=leftPad(index.toString(16).toUpperCase(),2,"0");if(Bucket.isBucket(child))flush(options,child,path,ipldResolver,null,(err,node)=>{if(err)return void callback(err);links.push(new DAGLink(labelPrefix,node.size,node.multihash)),callback()});else{const value=child.value,label=labelPrefix+child.key;links.push(new DAGLink(label,value.size,value.multihash)),callback()}}function haveLinks(links){const data=new Buffer(children.bitField().reverse()),dir=new UnixFS("hamt-sharded-directory",data);dir.fanout=bucket.tableSize(),dir.hashType=options.hashFn.code,waterfall([callback=>DAGNode.create(dir.marshal(),links,callback),(node,callback)=>{ipldResolver.put(node,{cid:new CID(node.multihash)},err=>callback(err,node))},(node,callback)=>{const pushable={path:path,multihash:node.multihash,size:node.size};source&&source.push(pushable),callback(null,node)}],callback)}const children=bucket._children;let index=0;const links=[];whilst(()=>index{const child=children.get(index);child?collectChild(child,index,err=>{index++,callback(err)}):(index++,callback())},err=>{if(err)return void callback(err);haveLinks(links)})}const leftPad=__webpack_require__(209),whilst=__webpack_require__(74),waterfall=__webpack_require__(7),CID=__webpack_require__(8),dagPB=__webpack_require__(52),UnixFS=__webpack_require__(41),DAGLink=dagPB.DAGLink,DAGNode=dagPB.DAGNode,multihashing=__webpack_require__(21),Dir=__webpack_require__(117),Bucket=__webpack_require__(425),hashFn=function(value,callback){multihashing(value,"murmur3-128",(err,hash)=>{if(err)callback(err);else{const justHash=hash.slice(2,10),length=justHash.length,result=new Buffer(length);for(let i=0;i{err?callback(err):(this.multihash=node.multihash,this.size=node.size),callback(null,node)})}}module.exports=createDirSharded}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function flatToShard(child,dir,threshold,callback){maybeFlatToShardOne(dir,threshold,(err,newDir)=>{if(err)return void callback(err);const parent=newDir.parent;parent?waterfall([callback=>{newDir!==dir?(child&&(child.parent=newDir),parent.put(newDir.parentKey,newDir,callback)):callback()},callback=>{parent?flatToShard(newDir,parent,threshold,callback):callback(null,newDir)}],callback):callback(null,newDir)})}function maybeFlatToShardOne(dir,threshold,callback){dir.flat&&dir.directChildrenCount()>=threshold?definitelyShardOne(dir,callback):callback(null,dir)}function definitelyShardOne(oldDir,callback){const newDir=DirSharded({root:oldDir.root,dir:!0,parent:oldDir.parent,parentKey:oldDir.parentKey,path:oldDir.path,dirty:oldDir.dirty,flat:!1});oldDir.eachChildSeries((key,value,callback)=>{newDir.put(key,value,callback)},err=>{err?callback(err):callback(err,newDir)})}const waterfall=__webpack_require__(7),DirSharded=__webpack_require__(427);module.exports=flatToShard},function(module,exports,__webpack_require__){"use strict";(function(process){const pause=__webpack_require__(249),pull=__webpack_require__(4),writable=__webpack_require__(99),pushable=__webpack_require__(30),assert=__webpack_require__(9),setImmediate=__webpack_require__(10),DAGBuilder=__webpack_require__(410),createTreeBuilder=__webpack_require__(430),chunkers={fixed:__webpack_require__(414)},defaultOptions={chunker:"fixed"};module.exports=function(ipldResolver,_options){function flush(callback){function proceed(){treeBuilder.flush((err,hash)=>{if(err)return treeBuilderStream.source.end(err),void callback(err);pausable.resume(),callback(null,hash)})}pausable.pause(),pending?waitingPending.push(proceed):proceed()}const options=Object.assign({},defaultOptions,_options),Chunker=chunkers[options.chunker];assert(Chunker,"Unknkown chunker named "+options.chunker);let pending=0;const waitingPending=[],entry={sink:writable((nodes,callback)=>{pending+=nodes.length,nodes.forEach(node=>entry.source.push(node)),setImmediate(callback)},null,1,err=>entry.source.end(err)),source:pushable()},dagStream=DAGBuilder(Chunker,ipldResolver,options),treeBuilder=createTreeBuilder(ipldResolver,options),treeBuilderStream=treeBuilder.stream(),pausable=pause(()=>{});return pull(entry,pausable,dagStream,pull.map(node=>{return pending--,pending||process.nextTick(()=>{for(;waitingPending.length;)waitingPending.shift()()}),node}),treeBuilderStream),{sink:entry.sink,source:treeBuilderStream.source,flush:flush}}}).call(exports,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";(function(process){function createTreeBuilder(ipldResolver,_options){function consumeQueue(action,callback){const args=action.args.concat(function(){action.cb.apply(null,arguments),callback()});action.fn.apply(null,args)}function getStream(){return stream}function addToTree(elem,callback){const pathElems=elem.path.split("/").filter(notEmpty);let parent=tree;const lastIndex=pathElems.length-1;let currentPath="";eachOfSeries(pathElems,(pathElem,index,callback)=>{currentPath&&(currentPath+="/"),currentPath+=pathElem;const last=index===lastIndex;parent.dirty=!0,parent.multihash=null,parent.size=null,last?waterfall([callback=>parent.put(pathElem,elem,callback),callback=>flatToShard(null,parent,options.shardSplitThreshold,callback),(newRoot,callback)=>{tree=newRoot,callback()}],callback):parent.get(pathElem,(err,treeNode)=>{if(err)return void callback(err);let dir=treeNode;dir&&dir instanceof Dir||(dir=DirFlat({dir:!0,parent:parent,parentKey:pathElem,path:currentPath,dirty:!0,flat:!0}));const parentDir=parent;parent=dir,parentDir.put(pathElem,dir,callback)})},callback)}function flushRoot(callback){queue.push({fn:flush,args:["",tree],cb:(err,node)=>{err?callback(err):callback(null,node&&node.multihash)}})}function flush(path,tree,callback){if(tree.dir){if(tree.root&&tree.childCount()>1&&!options.wrap)return void callback(new Error("detected more than one root"));tree.eachChildSeries((key,child,callback)=>{flush(path?path+"/"+key:key,child,callback)},err=>{if(err)return void callback(err);flushDir(path,tree,callback)})}else process.nextTick(callback)}function flushDir(path,tree,callback){return tree.root&&!options.wrap?void tree.onlyChild((err,onlyChild)=>{if(err)return void callback(err);callback(null,onlyChild)}):tree.dirty?(tree.dirty=!1,void tree.flush(path,ipldResolver,stream.source,(err,node)=>{err?callback(err):callback(null,node)})):void callback(null,tree.multihash)}const options=Object.assign({},defaultOptions,_options),queue=createQueue(consumeQueue,1);let stream=function(){function write(elems,callback){eachSeries(elems,(elem,callback)=>{queue.push({fn:addToTree,args:[elem],cb:err=>{err?callback(err):(source.push(elem),callback())}})},callback)}function ended(err){flushRoot(flushErr=>{source.end(flushErr||err)})}const sink=writable(write,null,1,ended),source=pushable();return{sink:sink,source:source}}(),tree=DirFlat({path:"",root:!0,dir:!0,dirty:!1,flat:!0});return{flush:flushRoot,stream:getStream}}function notEmpty(str){return Boolean(str)}const eachSeries=__webpack_require__(71),eachOfSeries=__webpack_require__(154),waterfall=__webpack_require__(7),createQueue=__webpack_require__(106),writable=__webpack_require__(99),pushable=__webpack_require__(30),DirFlat=__webpack_require__(426),flatToShard=__webpack_require__(428),Dir=__webpack_require__(117);module.exports=createTreeBuilder;const defaultOptions={wrap:!1,shardSplitThreshold:1e3}}).call(exports,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";exports.importer=exports.Importer=__webpack_require__(429),exports.exporter=exports.Exporter=__webpack_require__(419)},function(module,exports,__webpack_require__){"use strict";module.exports=`message Data { +`},function(module,exports,__webpack_require__){"use strict";const assert=__webpack_require__(9),CID=__webpack_require__(8);class WantListEntry{constructor(cid,priority){assert(CID.isCID(cid),"must be valid CID"),this._refCounter=1,this.cid=cid,this.priority=priority||1}inc(){this._refCounter+=1}dec(){this._refCounter=Math.max(0,this._refCounter-1)}hasRefs(){return this._refCounter>0}get[Symbol.toStringTag](){return`WantlistEntry `}equals(other){return this._refCounter===other._refCounter&&this.cid.equals(other.cid)&&this.priority===other.priority}}module.exports=WantListEntry},function(module,exports,__webpack_require__){"use strict";const setImmediate=__webpack_require__(7),Message=__webpack_require__(86),Wantlist=__webpack_require__(87),CONSTANTS=__webpack_require__(120),MsgQueue=__webpack_require__(402),logger=__webpack_require__(52).logger;module.exports=class WantManager{constructor(peerId,network){this.peers=new Map,this.wantlist=new Wantlist,this.network=network,this._peerId=peerId,this._log=logger(peerId,"want")}_addEntries(cids,cancel,force){const entries=cids.map((cid,i)=>{return new Message.Entry(cid,CONSTANTS.kMaxPriority-i,cancel)});entries.forEach(e=>{e.cancel?force?this.wantlist.removeForce(e.cid):this.wantlist.remove(e.cid):(this._log("adding to wl"),this.wantlist.add(e.cid,e.priority))});for(let p of this.peers.values())p.addEntries(entries)}_startPeerHandler(peerId){let mq=this.peers.get(peerId.toB58String());if(mq)return void mq.refcnt++;mq=new MsgQueue(this._peerId,peerId,this.network);const fullwantlist=new Message(!0);for(let entry of this.wantlist.entries())fullwantlist.addEntry(entry[1].cid,entry[1].priority);return mq.addMessage(fullwantlist),this.peers.set(peerId.toB58String(),mq),mq}_stopPeerHandler(peerId){const mq=this.peers.get(peerId.toB58String());mq&&(--mq.refcnt>0||this.peers.delete(peerId.toB58String()))}wantBlocks(cids){this._addEntries(cids,!1)}unwantBlocks(cids){this._log("unwant blocks: %s",cids.length),this._addEntries(cids,!0,!0)}cancelWants(cids){this._log("cancel wants: %s",cids.length),this._addEntries(cids,!0)}connectedPeers(){return Array.from(this.peers.keys())}connected(peerId){this._startPeerHandler(peerId)}disconnected(peerId){this._stopPeerHandler(peerId)}start(callback){this.timer=setInterval(()=>{this._log("resend full-wantlist");const fullwantlist=new Message(!0);this.wantlist.forEach(entry=>{fullwantlist.addEntry(entry.cid,entry.priority)}),this.peers.forEach(p=>p.addMessage(fullwantlist))},6e4),setImmediate(()=>callback())}stop(callback){this.peers.forEach(mq=>this.disconnected(mq.peerId)),clearInterval(this.timer),setImmediate(()=>callback())}}},function(module,exports,__webpack_require__){"use strict";const debounce=__webpack_require__(234),Message=__webpack_require__(86),logger=__webpack_require__(52).logger;module.exports=class MsgQueue{constructor(selfPeerId,otherPeerId,network){this.peerId=otherPeerId,this.network=network,this.refcnt=1,this._entries=[],this._log=logger(selfPeerId,"msgqueue",otherPeerId.toB58String().slice(0,8)),this.sendEntries=debounce(this._sendEntries.bind(this),200)}addMessage(msg){msg.empty||this.send(msg)}addEntries(entries){this._entries=this._entries.concat(entries),this.sendEntries()}_sendEntries(){if(this._entries.length){const msg=new Message(!1);this._entries.forEach(entry=>{entry.cancel?msg.cancel(entry.cid):msg.addEntry(entry.cid,entry.priority)}),this._entries=[],this.addMessage(msg)}}send(msg){this.network.connectTo(this.peerId,err=>{if(err)return void this._log.error("cant connect to peer %s: %s",this.peerId.toB58String(),err.message);this._log("sending message"),this.network.sendMessage(this.peerId,msg,err=>{err&&this._log.error("send error: %s",err.message)})})}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(11),multibase=__webpack_require__(139),multicodec=__webpack_require__(140),codecs=__webpack_require__(69),codecVarints=__webpack_require__(94),multihash=__webpack_require__(11);class CID{constructor(version,codec,multihash){if("string"==typeof version)if(multibase.isEncoded(version)){const cid=multibase.decode(version);this.version=parseInt(cid.slice(0,1).toString("hex"),16),this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=mh.fromB58String(version),this.version=0;else if(Buffer.isBuffer(version)){const firstByte=version.slice(0,1),v=parseInt(firstByte.toString("hex"),16);if(0===v||1===v){const cid=version;this.version=v,this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=version,this.version=0}else if("number"==typeof version){if("string"!=typeof codec)throw new Error("codec must be string");if(0!==version&&1!==version)throw new Error("version must be a number equal to 0 or 1");mh.validate(multihash),this.codec=codec,this.version=version,this.multihash=multihash}}get buffer(){switch(this.version){case 0:return this.multihash;case 1:return Buffer.concat([Buffer("01","hex"),Buffer(codecVarints[this.codec]),this.multihash]);default:throw new Error("unsupported version")}}get prefix(){return Buffer.concat([new Buffer(`0${this.version}`,"hex"),codecVarints[this.codec],multihash.prefix(this.multihash)])}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");return new CID(0,this.codec,this.multihash)}toV1(){return new CID(1,this.codec,this.multihash)}toBaseEncodedString(base){switch(base=base||"base58btc",this.version){case 0:if("base58btc"!==base)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");return mh.toB58String(this.multihash);case 1:return multibase.encode(base,this.buffer).toString();default:throw new Error("Unsupported version")}}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(other){return this.codec===other.codec&&this.version===other.version&&this.multihash.equals(other.multihash)}}CID.codecs=codecs,CID.isCID=(other=>{return"CID"===other.constructor.name}),module.exports=CID}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function selectColor(namespace){var i,hash=0;for(i in namespace)hash=(hash<<5)-hash+namespace.charCodeAt(i),hash|=0;return exports.colors[Math.abs(hash)%exports.colors.length]}function createDebug(namespace){function debug(){if(debug.enabled){var self=debug,curr=+new Date,ms=curr-(prevTime||curr);self.diff=ms,self.prev=prevTime,self.curr=curr,prevTime=curr;for(var args=new Array(arguments.length),i=0;i{return{get(callback){store.get(apiFile,(err,value)=>callback(err,value&&value.toString()))},set(value,callback){store.put(apiFile,Buffer.from(value.toString()),callback)},delete(callback){store.delete(apiFile,callback)}}})},function(module,exports,__webpack_require__){"use strict";exports.create=function(name,path,options){return new(0,options.storageBackends[name])(path,Object.assign({},options.storageBackendOptions[name]||{}))}},function(module,exports,__webpack_require__){"use strict";function maybeWithSharding(filestore,options,callback){if(options.sharding){const shard=new core.shard.NextToLast(2);ShardingStore.createOrOpen(filestore,shard,callback)}else setImmediate(()=>callback(null,filestore))}function createBaseStore(store){return{get(cid,callback){if(!CID.isCID(cid))return setImmediate(()=>{callback(new Error("Not a valid cid"))});const k=cidToDsKey(cid);store.get(k,(err,blockData)=>{if(err)return callback(err);callback(null,new Block(blockData,cid))})},put(block,callback){if(!Block.isBlock(block))return setImmediate(()=>{callback(new Error("invalid block"))});const k=cidToDsKey(block.cid);store.has(k,(err,exists)=>{return err?callback(err):exists?callback():void store.put(k,block.data,callback)})},putMany(blocks,callback){const keys=blocks.map(b=>({key:cidToDsKey(b.cid),block:b})),batch=store.batch();reject(keys,(k,cb)=>store.has(k.key,cb),(err,newKeys)=>{if(err)return callback(err);newKeys.forEach(k=>{batch.put(k.key,k.block.data)}),batch.commit(callback)})},has(cid,callback){if(!CID.isCID(cid))return setImmediate(()=>{callback(new Error("Not a valid cid"))});store.has(cidToDsKey(cid),callback)},delete(cid,callback){if(!CID.isCID(cid))return setImmediate(()=>{callback(new Error("Not a valid cid"))});store.delete(cidToDsKey(cid),callback)},close(callback){store.close(callback)}}}const core=__webpack_require__(333),ShardingStore=core.ShardingDatastore,Key=__webpack_require__(16).Key,base32=__webpack_require__(310),Block=__webpack_require__(65),setImmediate=__webpack_require__(7),reject=__webpack_require__(165),CID=__webpack_require__(8),keyFromBuffer=rawKey=>{return new Key("/"+(new base32.Encoder).write(rawKey).finalize(),!1)},cidToDsKey=cid=>{return keyFromBuffer(cid.buffer)};module.exports=((filestore,options,callback)=>{maybeWithSharding(filestore,options,(err,store)=>{if(err)return callback(err);callback(null,createBaseStore(store))})})},function(module,exports,__webpack_require__){"use strict";const Key=__webpack_require__(16).Key,queue=__webpack_require__(111),waterfall=__webpack_require__(6),_get=__webpack_require__(235),_set=__webpack_require__(542),_has=__webpack_require__(538),Buffer=__webpack_require__(5).Buffer,configKey=new Key("config");module.exports=(store=>{function _doSet(m,callback){const key=m.key,value=m.value;key?waterfall([cb=>configStore.get(cb),(config,cb)=>cb(null,_set(config,key,value)),_saveAll],callback):_saveAll(value,callback)}function _saveAll(config,callback){const buf=Buffer.from(JSON.stringify(config,null,2));store.put(configKey,buf,callback)}const setQueue=queue(_doSet,1),configStore={get(key,callback){"function"==typeof key&&(callback=key,key=void 0),key||(key=void 0),store.get(configKey,(err,encodedValue)=>{if(err)return callback(err);let config;try{config=JSON.parse(encodedValue.toString())}catch(err){return callback(err)}if(void 0!==key&&!_has(config,key))return callback(new Error("Key "+key+" does not exist in config"));callback(null,void 0!==key?_get(config,key):config)})},set(key,value,callback){if("function"==typeof value)callback=value,value=key,key=void 0;else if(!key||"string"!=typeof key)return callback(new Error("Invalid key type"));if(void 0===value||Buffer.isBuffer(value))return callback(new Error("Invalid value type"));setQueue.push({key:key,value:value},callback)},exists(callback){store.has(configKey,callback)}};return configStore})},function(module,exports,__webpack_require__){"use strict";module.exports={lock:"memory",storageBackends:{root:__webpack_require__(114),blocks:__webpack_require__(114),datastore:__webpack_require__(114)},storageBackendOptions:{root:{db:__webpack_require__(127),extension:""},blocks:{sharding:!1,db:__webpack_require__(127)},datastore:{db:__webpack_require__(127)}}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const Key=__webpack_require__(16).Key,debug=__webpack_require__(121),log=debug("repo:version"),versionKey=new Key("version");module.exports=(store=>{return{exists(callback){store.has(versionKey,callback)},get(callback){store.get(versionKey,(err,buf)=>{if(err)return callback(err);callback(null,parseInt(buf.toString().trim(),10))})},set(version,callback){store.put(versionKey,new Buffer(String(version)),callback)},check(expected,callback){this.get((err,version)=>{return err?callback(err):(log("comparing version: %s and %s",version,expected),version!==expected?callback(new Error(`version mismatch: expected v${expected}, found v${version}`)):void callback())})}}})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function isSpecificValue(val){return val instanceof Buffer||val instanceof Date||val instanceof RegExp}function cloneSpecificValue(val){if(val instanceof Buffer){var x=new Buffer(val.length);return val.copy(x),x}if(val instanceof Date)return new Date(val.getTime());if(val instanceof RegExp)return new RegExp(val);throw new Error("Unexpected situation")}function deepCloneArray(arr){var clone=[];return arr.forEach(function(item,index){"object"==typeof item&&null!==item?Array.isArray(item)?clone[index]=deepCloneArray(item):isSpecificValue(item)?clone[index]=cloneSpecificValue(item):clone[index]=deepExtend({},item):clone[index]=item}),clone}var deepExtend=module.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var val,src,target=arguments[0],args=Array.prototype.slice.call(arguments,1);return args.forEach(function(obj){"object"!=typeof obj||null===obj||Array.isArray(obj)||Object.keys(obj).forEach(function(key){return src=target[key],val=obj[key],val===target?void 0:"object"!=typeof val||null===val?void(target[key]=val):Array.isArray(val)?void(target[key]=deepCloneArray(val)):isSpecificValue(val)?void(target[key]=cloneSpecificValue(val)):"object"!=typeof src||null===src||Array.isArray(src)?void(target[key]=deepExtend({},val)):void(target[key]=deepExtend(src,val))})}),target}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(4),pushable=__webpack_require__(31),pullPair=__webpack_require__(101),batch=__webpack_require__(142);module.exports=function(reduce,options){function reduceToParents(_chunks,callback){function reduced(err,roots){err?callback(err):roots.length>1?reduceToParents(roots,callback):callback(null,roots)}let chunks=_chunks;Array.isArray(chunks)&&(chunks=pull.values(chunks)),pull(chunks,batch(options.maxChildrenPerNode),pull.asyncMap(reduce),pull.collect(reduced))}const pair=pullPair(),source=pair.source,result=pushable();return reduceToParents(source,(err,roots)=>{if(err)return void result.end(err);1===roots.length?(result.push(roots[0]),result.end()):roots.length>1?result.end(new Error("expected a maximum of 1 roots and got "+roots.length)):result.end()}),{sink:pair.sink,source:result}}},function(module,exports,__webpack_require__){"use strict";const balancedReducer=__webpack_require__(412),defaultOptions={maxChildrenPerNode:174};module.exports=function(reduce,_options){return balancedReducer(reduce,Object.assign({},defaultOptions,_options))}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const extend=__webpack_require__(411),UnixFS=__webpack_require__(42),pull=__webpack_require__(4),through=__webpack_require__(102),parallel=__webpack_require__(40),waterfall=__webpack_require__(6),dagPB=__webpack_require__(54),CID=__webpack_require__(8),reduce=__webpack_require__(418),DAGNode=dagPB.DAGNode,defaultOptions={chunkerOptions:{maxChunkSize:262144}};module.exports=function(createChunker,ipldResolver,createReducer,_options){function createAndStoreDir(item,callback){const d=new UnixFS("directory");waterfall([cb=>DAGNode.create(d.marshal(),cb),(node,cb)=>{ipldResolver.put(node,{cid:new CID(node.multihash)},err=>cb(err,node))}],(err,node)=>{if(err)return callback(err);callback(null,{path:item.path,multihash:node.multihash,size:node.size})})}function createAndStoreFile(file,callback){if(Buffer.isBuffer(file.content)&&(file.content=pull.values([file.content])),"function"!=typeof file.content)return callback(new Error("invalid content"));const reducer=createReducer(reduce(file,ipldResolver,options),options);let previous,count=0;pull(file.content,createChunker(options.chunkerOptions),pull.map(chunk=>new Buffer(chunk)),pull.map(buffer=>new UnixFS("file",buffer)),pull.asyncMap((fileNode,callback)=>{DAGNode.create(fileNode.marshal(),(err,node)=>{callback(err,{DAGNode:node,fileNode:fileNode})})}),pull.asyncMap((leaf,callback)=>{ipldResolver.put(leaf.DAGNode,{cid:new CID(leaf.DAGNode.multihash)},err=>callback(err,leaf))}),pull.map(leaf=>{return{path:file.path,multihash:leaf.DAGNode.multihash,size:leaf.DAGNode.size,leafSize:leaf.fileNode.fileSize(),name:""}}),through(function(data){count++,previous&&this.queue(previous),previous=data},function(){previous&&(1===count&&(previous.single=!0),this.queue(previous)),this.queue(null)}),reducer,pull.collect((err,roots)=>{err?callback(err):callback(null,roots[0])}))}const options=extend({},defaultOptions,_options);return function(source){return function(items,cb){parallel(items.map(item=>cb=>{if(!item.content)return createAndStoreDir(item,(err,node)=>{if(err)return cb(err);node&&source.push(node),cb()});createAndStoreFile(item,(err,node)=>{if(err)return cb(err);node&&source.push(node),cb()})}),cb)}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const pullPushable=__webpack_require__(31),pullWrite=__webpack_require__(103);module.exports=function(createStrategy,ipldResolver,options){const source=pullPushable();return{source:source,sink:pullWrite(createStrategy(source),null,options.highWaterMark,err=>source.end(err))}}},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(4),pushable=__webpack_require__(31),pullPair=__webpack_require__(101),batch=__webpack_require__(142);module.exports=function(reduce,options){const pair=pullPair(),source=pair.source,result=pushable();return pull(source,batch(1/0),pull.asyncMap(reduce),pull.collect((err,roots)=>{if(err)return void result.end(err);1===roots.length?(result.push(roots[0]),result.end()):roots.length>1?result.end(new Error("expected a maximum of 1 roots and got "+roots.length)):result.end()})),{sink:pair.sink,source:result}}},function(module,exports,__webpack_require__){"use strict";const assert=__webpack_require__(9),createBuildStream=__webpack_require__(415),Builder=__webpack_require__(414),reducers={flat:__webpack_require__(416),balanced:__webpack_require__(413),trickle:__webpack_require__(419)},defaultOptions={strategy:"balanced",highWaterMark:100,reduceSingleLeafToSelf:!1};module.exports=function(Chunker,ipldResolver,_options){assert(Chunker,"Missing chunker creator function"),assert(ipldResolver,"Missing IPLD Resolver");const options=Object.assign({},defaultOptions,_options),strategyName=options.strategy,reducer=reducers[strategyName];return assert(reducer,"Unknown importer build strategy name: "+strategyName),createBuildStream(Builder(Chunker,ipldResolver,reducer,options),ipldResolver,options)}},function(module,exports,__webpack_require__){"use strict";const waterfall=__webpack_require__(6),dagPB=__webpack_require__(54),UnixFS=__webpack_require__(42),CID=__webpack_require__(8),DAGLink=dagPB.DAGLink,DAGNode=dagPB.DAGNode;module.exports=function(file,ipldResolver,options){return function(leaves,callback){if(1===leaves.length&&(leaves[0].single||options.reduceSingleLeafToSelf)){const leave=leaves[0];return void callback(null,{path:file.path,multihash:leave.multihash,size:leave.size,leafSize:leave.leafSize,name:leave.name})}const f=new UnixFS("file"),links=leaves.map(leaf=>{return f.addBlockSize(leaf.leafSize),new DAGLink(leaf.name,leaf.size,leaf.multihash)});waterfall([cb=>DAGNode.create(f.marshal(),links,cb),(node,cb)=>{ipldResolver.put(node,{cid:new CID(node.multihash)},err=>cb(err,node))}],(err,node)=>{if(err)return void callback(err);callback(null,{name:"",path:file.path,multihash:node.multihash,size:node.size,leafSize:f.fileSize()})})}}},function(module,exports,__webpack_require__){"use strict";const trickleReducer=__webpack_require__(420),defaultOptions={maxChildrenPerNode:174,layerRepeat:4};module.exports=function(reduce,_options){return trickleReducer(reduce,Object.assign({},defaultOptions,_options))}},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(4),pushable=__webpack_require__(31),batch=__webpack_require__(142),pullPair=__webpack_require__(101),through=__webpack_require__(102),pullWrite=__webpack_require__(103),pause=__webpack_require__(257);module.exports=function(reduce,options){function trickle(indent,maxDepth){function write(nodes,callback){let ended=!1;const node=nodes[0];depth&&!deeper&&(deeper=pushable(),pull(deeper,trickle(indent+1,depth-1),through(function(d){this.queue(d)},function(err){if(err)return void this.emit("error",err);ended||(ended=!0,pendingResumes++,pausable.pause()),this.queue(null)}),batch(1/0),pull.asyncMap(reduce),pull.collect((err,nodes)=>{if(pendingResumes--,err)return void result.end(err);nodes.forEach(node=>{result.push(node)}),iterate()}))),deeper?deeper.push(node):(result.push(node),iterate()),callback()}function iterate(){deeper=null,iteration++,(0===depth&&iteration===options.maxChildrenPerNode||depth>0&&iteration===options.layerRepeat)&&(iteration=0,depth++),(!aborting&&maxDepth>=0&&depth>maxDepth||aborting&&!pendingResumes)&&(aborting=!0,result.end()),pendingResumes||pausable.resume()}function end(err){if(err)return void result.end(err);deeper?aborting||(aborting=!0,deeper.end()):result.end()}let deeper,iteration=0,depth=0,aborting=!1;const result=pushable();return{source:result,sink:pullWrite(write,null,1,end)}}const pair=pullPair(),result=pushable(),pausable=pause(()=>{});let pendingResumes=0;return pull(pair.source,pausable,trickle(0,-1),batch(1/0),pull.asyncMap(reduce),pull.collect((err,roots)=>{err?result.end(err):1===roots.length?(result.push(roots[0]),result.end()):roots.length>1?result.end(new Error("expected a maximum of 1 roots and got "+roots.length)):result.end()})),{sink:pair.sink,source:result}}},function(module,exports,__webpack_require__){"use strict";const pullBlock=__webpack_require__(612);module.exports=(options=>{return pullBlock("number"==typeof options?options:options.maxChunkSize,{zeroPadding:!1,emitEmpty:!0})})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(11);module.exports=(multihash=>{return Buffer.isBuffer(multihash)?mh.toB58String(multihash):multihash})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function dirExporter(node,name,pathRest,ipldResolver,resolve,parent){const accepts=pathRest[0],dir={path:name,hash:node.multihash},streams=[pull(pull.values(node.links),pull.map(link=>({linkName:link.name,path:path.join(name,link.name),hash:link.multihash})),pull.filter(item=>void 0===accepts||item.linkName===accepts),paramap((item,cb)=>ipldResolver.get(new CID(item.hash),(err,n)=>{if(err)return cb(err);cb(null,resolve(n.value,accepts||item.path,pathRest,ipldResolver,name,parent))})),pull.flatten())];return pathRest.length||streams.unshift(pull.values([dir])),pathRest.shift(),cat(streams)}const path=__webpack_require__(44),pull=__webpack_require__(4),paramap=__webpack_require__(144),CID=__webpack_require__(8),cat=__webpack_require__(143);module.exports=dirExporter},function(module,exports,__webpack_require__){"use strict";function shardedDirExporter(node,name,pathRest,ipldResolver,resolve,parent){let dir;parent&&parent.path===name||(dir=[{path:name,hash:cleanHash(node.multihash)}]);const streams=[pull(pull.values(node.links),pull.map(link=>{const p=link.name.substring(2),pp=p?path.join(name,p):name;let accept=!0,fromPathRest=!1;return p&&pathRest.length&&(fromPathRest=!0,accept=p===pathRest[0]),accept?{fromPathRest:fromPathRest,name:p,path:pp,hash:link.multihash,pathRest:p?pathRest.slice(1):pathRest}:""}),pull.filter(Boolean),paramap((item,cb)=>ipldResolver.get(new CID(item.hash),(err,n)=>{if(err)return cb(err);cb(null,resolve(n.value,item.fromPathRest?item.name:item.path,item.pathRest,ipldResolver,dir&&dir[0]||parent))})),pull.flatten())];return pathRest.length||streams.unshift(pull.values(dir)),cat(streams)}const path=__webpack_require__(44),pull=__webpack_require__(4),paramap=__webpack_require__(144),CID=__webpack_require__(8),cat=__webpack_require__(143),cleanHash=__webpack_require__(422);module.exports=shardedDirExporter},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const traverse=__webpack_require__(265),UnixFS=__webpack_require__(42),CID=__webpack_require__(8),pull=__webpack_require__(4),paramap=__webpack_require__(144);module.exports=((node,name,pathRest,ipldResolver)=>{function getData(node){try{const file=UnixFS.unmarshal(node.data);return file.data||new Buffer(0)}catch(err){throw new Error("Failed to unmarshal node")}}function visitor(node){return pull(pull.values(node.links),paramap((link,cb)=>ipldResolver.get(new CID(link.multihash),cb)),pull.map(result=>result.value))}const accepts=pathRest.shift();if(void 0!==accepts&&accepts!==name)return pull.empty();let content=pull(traverse.depthFirst(node,visitor),pull.map(getData));const file=UnixFS.unmarshal(node.data);return pull.values([{content:content,path:name,size:file.fileSize()}])})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function pathBaseAndRest(path){let pathBase=path,pathRest="/";if(Buffer.isBuffer(path)&&(pathBase=new CID(path).toBaseEncodedString()),"string"==typeof path){0===path.indexOf("/ipfs/")&&(path=pathBase=path.substring(6));const subtreeStart=path.indexOf("/");subtreeStart>0&&(pathBase=path.substring(0,subtreeStart),pathRest=path.substring(subtreeStart))}else CID.isCID(pathBase)&&(pathBase=pathBase.toBaseEncodedString());return pathBase=new CID(pathBase).toBaseEncodedString(),{base:pathBase,rest:pathRest.split("/").filter(Boolean)}}const pull=__webpack_require__(4),CID=__webpack_require__(8),pullDefer=__webpack_require__(99),resolve=__webpack_require__(428).resolve;module.exports=((path,dag)=>{try{path=pathBaseAndRest(path)}catch(err){return pull.error(err)}const d=pullDefer.source(),cid=new CID(path.base);return dag.get(cid,(err,node)=>{if(err)return pull.error(err);d.resolve(pull.values([node]))}),pull(d,pull.map(result=>result.value),pull.map(node=>resolve(node,path.base,path.rest,dag)),pull.flatten())})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function sanitizeCID(cid){return new CID(cid.version,cid.codec,cid.multihash)}const path=__webpack_require__(44),CID=__webpack_require__(8),pull=__webpack_require__(4),pullDefer=__webpack_require__(99);module.exports=((node,name,pathRest,ipldResolver,resolve)=>{let newNode;if(pathRest.length){const pathElem=pathRest.shift();newNode=node[pathElem];const newName=path.join(name,pathElem);if(CID.isCID(newNode)){const d=pullDefer.source();return ipldResolver.get(sanitizeCID(newNode),(err,newNode)=>{err?d.resolve(pull.error(err)):d.resolve(resolve(newNode.value,newName,pathRest,ipldResolver,node))}),d}return void 0!==newNode?resolve(newNode,newName,pathRest,ipldResolver,node):pull.error("not found")}return pull.error(new Error("invalid node type"))})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function resolve(node,hash,pathRest,ipldResolver,parentNode){const type=typeOf(node),resolver=resolvers[type];return resolver?resolver(node,hash,pathRest,ipldResolver,resolve,parentNode):pull.error(new Error("Unkown node type "+type))}function typeOf(node){return Buffer.isBuffer(node.data)?UnixFS.unmarshal(node.data).type:"object"}const UnixFS=__webpack_require__(42),pull=__webpack_require__(4),resolvers={directory:__webpack_require__(423),"hamt-sharded-directory":__webpack_require__(424),file:__webpack_require__(425),object:__webpack_require__(427)};module.exports=Object.assign({resolve:resolve,typeOf:typeOf},resolvers)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(process){function exists(o){return Boolean(o)}function mapNode(node,index){return node.key}function reduceNodes(nodes){return nodes}function asyncTransformBucket(bucket,asyncMap,asyncReduce,callback){map(bucket._children.compactArray(),(child,callback)=>{child instanceof Bucket?asyncTransformBucket(child,asyncMap,asyncReduce,callback):asyncMap(child,(err,mappedChildren)=>{err?callback(err):callback(null,{bitField:bucket._children.bitField(),children:mappedChildren})})},(err,mappedChildren)=>{err?callback(err):asyncReduce(mappedChildren,callback)})}const SparseArray=__webpack_require__(686),map=__webpack_require__(61),eachSeries=__webpack_require__(74),wrapHash=__webpack_require__(431),defaultOptions={bits:8};class Bucket{constructor(options,parent,posAtParent){if(this._options=Object.assign({},defaultOptions,options),this._popCount=0,this._parent=parent,this._posAtParent=posAtParent,!this._options.hashFn)throw new Error("please define an options.hashFn");this._options.hash||(this._options.hash=wrapHash(this._options.hashFn)),this._children=new SparseArray}static isBucket(o){return o instanceof Bucket}put(key,value,callback){this._findNewBucketAndPos(key,(err,place)=>{if(err)return void callback(err);place.bucket._putAt(place,key,value),callback()})}get(key,callback){this._findChild(key,(err,child)=>{err?callback(err):callback(null,child&&child.value)})}del(key,callback){this._findPlace(key,(err,place)=>{if(err)return void callback(err);const child=place.bucket._at(place.pos);child&&child.key===key&&place.bucket._delAt(place.pos),callback(null)})}leafCount(){this._children.reduce((acc,child)=>{return child instanceof Bucket?acc+child.leafCount():acc+1},0)}childrenCount(){return this._children.length}onlyChild(callback){process.nextTick(()=>callback(null,this._children.get(0)))}eachLeafSeries(iterator,callback){eachSeries(this._children.compactArray(),(child,cb)=>{child instanceof Bucket?child.eachLeafSeries(iterator,cb):iterator(child.key,child.value,cb)},callback)}serialize(map,reduce){return reduce(this._children.reduce((acc,child,index)=>{return child&&(child instanceof Bucket?acc.push(child.serialize(map,reduce)):acc.push(map(child,index))),acc},[]))}asyncTransform(asyncMap,asyncReduce,callback){asyncTransformBucket(this,asyncMap,asyncReduce,callback)}toJSON(){return this.serialize(mapNode,reduceNodes)}prettyPrint(){return JSON.stringify(this.toJSON(),null," ")}tableSize(){return Math.pow(2,this._options.bits)}_findChild(key,callback){this._findPlace(key,(err,result)=>{ +if(err)return void callback(err);const child=result.bucket._at(result.pos);child&&child.key===key?callback(null,child):callback(null,void 0)})}_findPlace(key,callback){const hashValue=this._options.hash(key);hashValue.take(this._options.bits,(err,index)=>{if(err)return void callback(err);const child=this._children.get(index);if(child instanceof Bucket)child._findPlace(hashValue,callback);else{const place={bucket:this,pos:index,hash:hashValue};callback(null,place)}})}_findNewBucketAndPos(key,callback){this._findPlace(key,(err,place)=>{if(err)return void callback(err);const child=place.bucket._at(place.pos);if(child&&child.key!==key){const bucket=new Bucket(this._options,place.bucket,place.pos);place.bucket._putObjectAt(place.pos,bucket),bucket._findPlace(child.hash,(err,newPlace)=>{if(err)return void callback(err);newPlace.bucket._putAt(newPlace,child.key,child.value),bucket._findNewBucketAndPos(place.hash,callback)})}else callback(null,place)})}_putAt(place,key,value){this._putObjectAt(place.pos,{key:key,value:value,hash:place.hash})}_putObjectAt(pos,object){this._children.get(pos)||this._popCount++,this._children.set(pos,object)}_delAt(pos){this._children.get(pos)&&this._popCount--,this._children.unset(pos),this._level()}_level(){if(this._parent&&this._popCount<=1)if(1===this._popCount){const onlyChild=this._children.find(exists);if(!(onlyChild instanceof Bucket)){const hash=onlyChild.hash;hash.untake(this._options.bits);const place={pos:this._posAtParent,hash:hash};this._parent._putAt(place,onlyChild.key,onlyChild.value)}}else this._parent._delAt(this._posAtParent)}_at(index){return this._children.get(index)}}module.exports=Bucket}).call(exports,__webpack_require__(1))},function(module,exports,__webpack_require__){"use strict";function byteBitsToInt(byte,start,length){return(byte&maskFor(start,length))>>>start}function maskFor(start,length){return START_MASKS[start]&STOP_MASKS[Math.min(length+start-1,7)]}const START_MASKS=[255,254,252,248,240,224,192,128],STOP_MASKS=[1,3,7,15,31,63,127,255];module.exports=class ConsumableBuffer{constructor(value){this._value=value,this._currentBytePos=value.length-1,this._currentBitPos=7}availableBits(){return this._currentBitPos+1+8*this._currentBytePos}totalBits(){return 8*this._value.length}take(bits){let pendingBits=bits,result=0;for(;pendingBits&&this._haveBits();){const byte=this._value[this._currentBytePos],availableBits=this._currentBitPos+1,taking=Math.min(availableBits,pendingBits),value=byteBitsToInt(byte,availableBits-taking,taking);result=(result<7;)this._currentBitPos-=8,this._currentBytePos+=1}_haveBits(){return this._currentBytePos>=0}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer,process){const whilst=__webpack_require__(76),ConsumableBuffer=__webpack_require__(430);module.exports=function(hashFn){return function(value){return value instanceof InfiniteHash?value:new InfiniteHash(value,hashFn)}};class InfiniteHash{constructor(value,hashFn){if("string"!=typeof value&&!Buffer.isBuffer(value))throw new Error("can only hash strings or buffers");this._value=value,this._hashFn=hashFn,this._depth=-1,this._availableBits=0,this._currentBufferIndex=0,this._buffers=[]}take(bits,callback){let pendingBits=bits;whilst(()=>this._availableBits{this._produceMoreBits(callback)},err=>{if(err)return void callback(err);let result=0;whilst(()=>pendingBits>0,callback=>{const hash=this._buffers[this._currentBufferIndex],available=Math.min(hash.availableBits(),pendingBits);result=(result<{if(err)return void callback(err);process.nextTick(()=>callback(null,result))})})}untake(bits){let pendingBits=bits;for(;pendingBits>0;){const hash=this._buffers[this._currentBufferIndex],availableForUntake=Math.min(hash.totalBits()-hash.availableBits(),pendingBits);hash.untake(availableForUntake),pendingBits-=availableForUntake,this._availableBits+=availableForUntake,this._currentBufferIndex>0&&hash.totalBits()===hash.availableBits()&&(this._depth--,this._currentBufferIndex--)}}_produceMoreBits(callback){this._depth++;const value=this._depth?this._value+this._depth:this._value;this._hashFn(value,(err,hashValue)=>{if(err)return void callback(err);const buffer=new ConsumableBuffer(hashValue);this._buffers.push(buffer),this._availableBits+=buffer.availableBits(),callback()})}}}).call(exports,__webpack_require__(0).Buffer,__webpack_require__(1))},function(module,exports,__webpack_require__){"use strict";const Bucket=__webpack_require__(429);module.exports=function(options){return new Bucket(options)},module.exports.isBucket=Bucket.isBucket},function(module,exports,__webpack_require__){"use strict";(function(process){function createDirFlat(props){return new DirFlat(props)}const asyncEachSeries=__webpack_require__(74),waterfall=__webpack_require__(6),CID=__webpack_require__(8),dagPB=__webpack_require__(54),UnixFS=__webpack_require__(42),DAGLink=dagPB.DAGLink,DAGNode=dagPB.DAGNode,Dir=__webpack_require__(122);class DirFlat extends Dir{constructor(props){super(),this._children={},Object.assign(this,props)}put(name,value,callback){this.multihash=void 0,this.size=void 0,this._children[name]=value,process.nextTick(callback)}get(name,callback){process.nextTick(()=>callback(null,this._children[name]))}childCount(){return Object.keys(this._children).length}directChildrenCount(){return this.childCount()}onlyChild(callback){process.nextTick(()=>callback(null,this._children[Object.keys(this._children)[0]]))}eachChildSeries(iterator,callback){asyncEachSeries(Object.keys(this._children),(key,callback)=>{iterator(key,this._children[key],callback)},callback)}flush(path,ipldResolver,source,callback){const links=Object.keys(this._children).map(key=>{const child=this._children[key];return new DAGLink(key,child.size,child.multihash)}),dir=new UnixFS("directory");waterfall([callback=>DAGNode.create(dir.marshal(),links,callback),(node,callback)=>{ipldResolver.put(node,{cid:new CID(node.multihash)},err=>callback(err,node))},(node,callback)=>{this.multihash=node.multihash,this.size=node.size;const pushable={path:path,multihash:node.multihash,size:node.size};source.push(pushable),callback(null,node)}],callback)}}module.exports=createDirFlat}).call(exports,__webpack_require__(1))},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function createDirSharded(props){return new DirSharded(props)}function flush(options,bucket,path,ipldResolver,source,callback){function collectChild(child,index,callback){const labelPrefix=leftPad(index.toString(16).toUpperCase(),2,"0");if(Bucket.isBucket(child))flush(options,child,path,ipldResolver,null,(err,node)=>{if(err)return void callback(err);links.push(new DAGLink(labelPrefix,node.size,node.multihash)),callback()});else{const value=child.value,label=labelPrefix+child.key;links.push(new DAGLink(label,value.size,value.multihash)),callback()}}function haveLinks(links){const data=new Buffer(children.bitField().reverse()),dir=new UnixFS("hamt-sharded-directory",data);dir.fanout=bucket.tableSize(),dir.hashType=options.hashFn.code,waterfall([callback=>DAGNode.create(dir.marshal(),links,callback),(node,callback)=>{ipldResolver.put(node,{cid:new CID(node.multihash)},err=>callback(err,node))},(node,callback)=>{const pushable={path:path,multihash:node.multihash,size:node.size};source&&source.push(pushable),callback(null,node)}],callback)}const children=bucket._children;let index=0;const links=[];whilst(()=>index{const child=children.get(index);child?collectChild(child,index,err=>{index++,callback(err)}):(index++,callback())},err=>{if(err)return void callback(err);haveLinks(links)})}const leftPad=__webpack_require__(216),whilst=__webpack_require__(76),waterfall=__webpack_require__(6),CID=__webpack_require__(8),dagPB=__webpack_require__(54),UnixFS=__webpack_require__(42),DAGLink=dagPB.DAGLink,DAGNode=dagPB.DAGNode,multihashing=__webpack_require__(22),Dir=__webpack_require__(122),Bucket=__webpack_require__(432),hashFn=function(value,callback){multihashing(value,"murmur3-128",(err,hash)=>{if(err)callback(err);else{const justHash=hash.slice(2,10),length=justHash.length,result=new Buffer(length);for(let i=0;i{err?callback(err):(this.multihash=node.multihash,this.size=node.size),callback(null,node)})}}module.exports=createDirSharded}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function flatToShard(child,dir,threshold,callback){maybeFlatToShardOne(dir,threshold,(err,newDir)=>{if(err)return void callback(err);const parent=newDir.parent;parent?waterfall([callback=>{newDir!==dir?(child&&(child.parent=newDir),parent.put(newDir.parentKey,newDir,callback)):callback()},callback=>{parent?flatToShard(newDir,parent,threshold,callback):callback(null,newDir)}],callback):callback(null,newDir)})}function maybeFlatToShardOne(dir,threshold,callback){dir.flat&&dir.directChildrenCount()>=threshold?definitelyShardOne(dir,callback):callback(null,dir)}function definitelyShardOne(oldDir,callback){const newDir=DirSharded({root:oldDir.root,dir:!0,parent:oldDir.parent,parentKey:oldDir.parentKey,path:oldDir.path,dirty:oldDir.dirty,flat:!1});oldDir.eachChildSeries((key,value,callback)=>{newDir.put(key,value,callback)},err=>{err?callback(err):callback(err,newDir)})}const waterfall=__webpack_require__(6),DirSharded=__webpack_require__(434);module.exports=flatToShard},function(module,exports,__webpack_require__){"use strict";(function(process){const pause=__webpack_require__(257),pull=__webpack_require__(4),writable=__webpack_require__(103),pushable=__webpack_require__(31),assert=__webpack_require__(9),setImmediate=__webpack_require__(7),DAGBuilder=__webpack_require__(417),createTreeBuilder=__webpack_require__(437),chunkers={fixed:__webpack_require__(421)},defaultOptions={chunker:"fixed"};module.exports=function(ipldResolver,_options){function flush(callback){function proceed(){treeBuilder.flush((err,hash)=>{if(err)return treeBuilderStream.source.end(err),void callback(err);pausable.resume(),callback(null,hash)})}pausable.pause(),pending?waitingPending.push(proceed):proceed()}const options=Object.assign({},defaultOptions,_options),Chunker=chunkers[options.chunker];assert(Chunker,"Unknkown chunker named "+options.chunker);let pending=0;const waitingPending=[],entry={sink:writable((nodes,callback)=>{pending+=nodes.length,nodes.forEach(node=>entry.source.push(node)),setImmediate(callback)},null,1,err=>entry.source.end(err)),source:pushable()},dagStream=DAGBuilder(Chunker,ipldResolver,options),treeBuilder=createTreeBuilder(ipldResolver,options),treeBuilderStream=treeBuilder.stream(),pausable=pause(()=>{});return pull(entry,pausable,dagStream,pull.map(node=>{return pending--,pending||process.nextTick(()=>{for(;waitingPending.length;)waitingPending.shift()()}),node}),treeBuilderStream),{sink:entry.sink,source:treeBuilderStream.source,flush:flush}}}).call(exports,__webpack_require__(1))},function(module,exports,__webpack_require__){"use strict";(function(process){function createTreeBuilder(ipldResolver,_options){function consumeQueue(action,callback){const args=action.args.concat(function(){action.cb.apply(null,arguments),callback()});action.fn.apply(null,args)}function getStream(){return stream}function addToTree(elem,callback){const pathElems=elem.path.split("/").filter(notEmpty);let parent=tree;const lastIndex=pathElems.length-1;let currentPath="";eachOfSeries(pathElems,(pathElem,index,callback)=>{currentPath&&(currentPath+="/"),currentPath+=pathElem;const last=index===lastIndex;parent.dirty=!0,parent.multihash=null,parent.size=null,last?waterfall([callback=>parent.put(pathElem,elem,callback),callback=>flatToShard(null,parent,options.shardSplitThreshold,callback),(newRoot,callback)=>{tree=newRoot,callback()}],callback):parent.get(pathElem,(err,treeNode)=>{if(err)return void callback(err);let dir=treeNode;dir&&dir instanceof Dir||(dir=DirFlat({dir:!0,parent:parent,parentKey:pathElem,path:currentPath,dirty:!0,flat:!0}));const parentDir=parent;parent=dir,parentDir.put(pathElem,dir,callback)})},callback)}function flushRoot(callback){queue.push({fn:flush,args:["",tree],cb:(err,node)=>{err?callback(err):callback(null,node&&node.multihash)}})}function flush(path,tree,callback){if(tree.dir){if(tree.root&&tree.childCount()>1&&!options.wrap)return void callback(new Error("detected more than one root"));tree.eachChildSeries((key,child,callback)=>{flush(path?path+"/"+key:key,child,callback)},err=>{if(err)return void callback(err);flushDir(path,tree,callback)})}else process.nextTick(callback)}function flushDir(path,tree,callback){return tree.root&&!options.wrap?void tree.onlyChild((err,onlyChild)=>{if(err)return void callback(err);callback(null,onlyChild)}):tree.dirty?(tree.dirty=!1,void tree.flush(path,ipldResolver,stream.source,(err,node)=>{err?callback(err):callback(null,node)})):void callback(null,tree.multihash)}const options=Object.assign({},defaultOptions,_options),queue=createQueue(consumeQueue,1);let stream=function(){function write(elems,callback){eachSeries(elems,(elem,callback)=>{queue.push({fn:addToTree,args:[elem],cb:err=>{err?callback(err):(source.push(elem),callback())}})},callback)}function ended(err){flushRoot(flushErr=>{source.end(flushErr||err)})}const sink=writable(write,null,1,ended),source=pushable();return{sink:sink,source:source}}(),tree=DirFlat({path:"",root:!0,dir:!0,dirty:!1,flat:!0});return{flush:flushRoot,stream:getStream}}function notEmpty(str){return Boolean(str)}const eachSeries=__webpack_require__(74),eachOfSeries=__webpack_require__(159),waterfall=__webpack_require__(6),createQueue=__webpack_require__(111),writable=__webpack_require__(103),pushable=__webpack_require__(31),DirFlat=__webpack_require__(433),flatToShard=__webpack_require__(435),Dir=__webpack_require__(122);module.exports=createTreeBuilder;const defaultOptions={wrap:!1,shardSplitThreshold:1e3}}).call(exports,__webpack_require__(1))},function(module,exports,__webpack_require__){"use strict";exports.importer=exports.Importer=__webpack_require__(436),exports.exporter=exports.Exporter=__webpack_require__(426)},function(module,exports,__webpack_require__){"use strict";module.exports=`message Data { enum DataType { Raw = 0; Directory = 1; @@ -129,7 +129,7 @@ const asyncEachSeries=__webpack_require__(71),waterfall=__webpack_require__(7),C message Metadata { required string MimeType = 1; -}`},function(module,exports,__webpack_require__){"use strict";exports.util=__webpack_require__(196),exports.resolver=__webpack_require__(195)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(12),multibase=__webpack_require__(134),multicodec=__webpack_require__(135),codecs=__webpack_require__(65),codecVarints=__webpack_require__(90),multihash=__webpack_require__(12);class CID{constructor(version,codec,multihash){if("string"==typeof version)if(multibase.isEncoded(version)){const cid=multibase.decode(version);this.version=parseInt(cid.slice(0,1).toString("hex"),16),this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=mh.fromB58String(version),this.version=0;else if(Buffer.isBuffer(version)){const firstByte=version.slice(0,1),v=parseInt(firstByte.toString("hex"),16);if(0===v||1===v){const cid=version;this.version=v,this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=version,this.version=0}else if("number"==typeof version){if("string"!=typeof codec)throw new Error("codec must be string");if(0!==version&&1!==version)throw new Error("version must be a number equal to 0 or 1");mh.validate(multihash),this.codec=codec,this.version=version,this.multihash=multihash}}get buffer(){switch(this.version){case 0:return this.multihash;case 1:return Buffer.concat([Buffer("01","hex"),Buffer(codecVarints[this.codec]),this.multihash]);default:throw new Error("unsupported version")}}get prefix(){return Buffer.concat([new Buffer(`0${this.version}`,"hex"),codecVarints[this.codec],multihash.prefix(this.multihash)])}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");return new CID(0,this.codec,this.multihash)}toV1(){return new CID(1,this.codec,this.multihash)}toBaseEncodedString(base){switch(base=base||"base58btc",this.version){case 0:if("base58btc"!==base)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");return mh.toB58String(this.multihash);case 1:return multibase.encode(base,this.buffer).toString();default:throw new Error("Unsupported version")}}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(other){return this.codec===other.codec&&this.version===other.version&&this.multihash.equals(other.multihash)}}CID.codecs=codecs,CID.isCID=(other=>{return"CID"===other.constructor.name}),module.exports=CID}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function create(name,size,multihash,callback){callback(null,new DAGLink(name,size,multihash))}const DAGLink=__webpack_require__(51);module.exports=create},function(module,exports,__webpack_require__){"use strict";function addLink(node,link,callback){const links=cloneLinks(node),data=cloneData(node);if(link.constructor&&"DAGLink"===link.constructor.name);else if(link.constructor&&"DAGNode"===link.constructor.name)link=toDAGLink(link);else{link.multihash=link.multihash||link.hash;try{link=new DAGLink(link.name,link.size,link.multihash)}catch(err){return callback(err)}}links.push(link),create(data,links,callback)}const dagNodeUtil=__webpack_require__(86),cloneLinks=dagNodeUtil.cloneLinks,cloneData=dagNodeUtil.cloneData,toDAGLink=dagNodeUtil.toDAGLink,DAGLink=__webpack_require__(51),create=__webpack_require__(85);module.exports=addLink},function(module,exports,__webpack_require__){"use strict";function clone(dagNode,callback){create(cloneData(dagNode),cloneLinks(dagNode),callback)}const dagNodeUtil=__webpack_require__(86),cloneLinks=dagNodeUtil.cloneLinks,cloneData=dagNodeUtil.cloneData,create=__webpack_require__(85);module.exports=clone},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function rmLink(dagNode,nameOrMultihash,callback){const data=cloneData(dagNode);let links=cloneLinks(dagNode);if("string"==typeof nameOrMultihash)links=links.filter(link=>link.name!==nameOrMultihash);else{if(!Buffer.isBuffer(nameOrMultihash))return callback(new Error("second arg needs to be a name or multihash"),null);links=links.filter(link=>!link.multihash.equals(nameOrMultihash))}create(data,links,callback)}const dagNodeUtil=__webpack_require__(86),cloneLinks=dagNodeUtil.cloneLinks,cloneData=dagNodeUtil.cloneData,create=__webpack_require__(85);module.exports=rmLink}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";module.exports=`// An IPFS MerkleDAG Link +}`},function(module,exports,__webpack_require__){"use strict";exports.util=__webpack_require__(203),exports.resolver=__webpack_require__(202)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(11),multibase=__webpack_require__(139),multicodec=__webpack_require__(140),codecs=__webpack_require__(69),codecVarints=__webpack_require__(94),multihash=__webpack_require__(11);class CID{constructor(version,codec,multihash){if("string"==typeof version)if(multibase.isEncoded(version)){const cid=multibase.decode(version);this.version=parseInt(cid.slice(0,1).toString("hex"),16),this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=mh.fromB58String(version),this.version=0;else if(Buffer.isBuffer(version)){const firstByte=version.slice(0,1),v=parseInt(firstByte.toString("hex"),16);if(0===v||1===v){const cid=version;this.version=v,this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=version,this.version=0}else if("number"==typeof version){if("string"!=typeof codec)throw new Error("codec must be string");if(0!==version&&1!==version)throw new Error("version must be a number equal to 0 or 1");mh.validate(multihash),this.codec=codec,this.version=version,this.multihash=multihash}}get buffer(){switch(this.version){case 0:return this.multihash;case 1:return Buffer.concat([Buffer("01","hex"),Buffer(codecVarints[this.codec]),this.multihash]);default:throw new Error("unsupported version")}}get prefix(){return Buffer.concat([new Buffer(`0${this.version}`,"hex"),codecVarints[this.codec],multihash.prefix(this.multihash)])}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");return new CID(0,this.codec,this.multihash)}toV1(){return new CID(1,this.codec,this.multihash)}toBaseEncodedString(base){switch(base=base||"base58btc",this.version){case 0:if("base58btc"!==base)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");return mh.toB58String(this.multihash);case 1:return multibase.encode(base,this.buffer).toString();default:throw new Error("Unsupported version")}}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(other){return this.codec===other.codec&&this.version===other.version&&this.multihash.equals(other.multihash)}}CID.codecs=codecs,CID.isCID=(other=>{return"CID"===other.constructor.name}),module.exports=CID}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function create(name,size,multihash,callback){callback(null,new DAGLink(name,size,multihash))}const DAGLink=__webpack_require__(53);module.exports=create},function(module,exports,__webpack_require__){"use strict";function addLink(node,link,callback){const links=cloneLinks(node),data=cloneData(node);if(link.constructor&&"DAGLink"===link.constructor.name);else if(link.constructor&&"DAGNode"===link.constructor.name)link=toDAGLink(link);else{link.multihash=link.multihash||link.hash;try{link=new DAGLink(link.name,link.size,link.multihash)}catch(err){return callback(err)}}links.push(link),create(data,links,callback)}const dagNodeUtil=__webpack_require__(89),cloneLinks=dagNodeUtil.cloneLinks,cloneData=dagNodeUtil.cloneData,toDAGLink=dagNodeUtil.toDAGLink,DAGLink=__webpack_require__(53),create=__webpack_require__(88);module.exports=addLink},function(module,exports,__webpack_require__){"use strict";function clone(dagNode,callback){create(cloneData(dagNode),cloneLinks(dagNode),callback)}const dagNodeUtil=__webpack_require__(89),cloneLinks=dagNodeUtil.cloneLinks,cloneData=dagNodeUtil.cloneData,create=__webpack_require__(88);module.exports=clone},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function rmLink(dagNode,nameOrMultihash,callback){const data=cloneData(dagNode);let links=cloneLinks(dagNode);if("string"==typeof nameOrMultihash)links=links.filter(link=>link.name!==nameOrMultihash);else{if(!Buffer.isBuffer(nameOrMultihash))return callback(new Error("second arg needs to be a name or multihash"),null);links=links.filter(link=>!link.multihash.equals(nameOrMultihash))}create(data,links,callback)}const dagNodeUtil=__webpack_require__(89),cloneLinks=dagNodeUtil.cloneLinks,cloneData=dagNodeUtil.cloneData,create=__webpack_require__(88);module.exports=rmLink}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";module.exports=`// An IPFS MerkleDAG Link message PBLink { // multihash of the target object @@ -150,10 +150,10 @@ message PBNode { // opaque user data optional bytes Data = 1; -}`},function(module,exports,__webpack_require__){"use strict";const waterfall=__webpack_require__(7),util=__webpack_require__(119);exports=module.exports,exports.multicodec="dag-pb",exports.resolve=((block,path,callback)=>{waterfall([cb=>util.deserialize(block.data,cb),(node,cb)=>{const split=path.split("/");if("Links"===split[0]){let remainderPath="";if(!split[1])return cb(null,{value:node.links.map(l=>l.toJSON()),remainderPath:""});const values={};node.links.forEach((l,i)=>{const link=l.toJSON();values[i]={hash:link.multihash,name:link.name,size:link.size},values[link.name]=link.multihash});let value=values[split[1]];"Hash"===split[2]?value={"/":value.hash}:"Tsize"===split[2]?value={"/":value.size}:"Name"===split[2]&&(value={"/":value.name}),remainderPath=split.slice(3).join("/"),cb(null,{value:value,remainderPath:remainderPath})}else"Data"===split[0]?cb(null,{value:node.data,remainderPath:""}):cb(new Error("path not available"))}],callback)}),exports.tree=((block,options,callback)=>{"function"==typeof options&&(callback=options,options={}),options=options||{},util.deserialize(block.data,(err,node)=>{if(err)return callback(err);const paths=[];paths.push("Links"),node.links.forEach((link,i)=>{paths.push(`Links/${i}/Name`),paths.push(`Links/${i}/Tsize`),paths.push(`Links/${i}/Hash`)}),paths.push("Data"),callback(null,paths)})}),exports.isLink=((block,path,callback)=>{exports.resolve(block,path,(err,result)=>{return err?callback(err):result.remainderPath.length>0?callback(new Error("path out of scope")):void("object"==typeof result.value&&result.value["/"]?callback(null,result.value):callback(null,!1))})})},function(module,exports,__webpack_require__){"use strict";function mapFromEthObj(ethBlockList,options,callback){let paths=[];paths.push({path:"count",value:ethBlockList.length}),each(ethBlockList,(ethBlock,next)=>{const index=ethBlockList.indexOf(ethBlock),blockPath=index.toString();paths.push({path:blockPath,value:ethBlock}),ethBlockResolver._mapFromEthObject(ethBlock,{},(err,subpaths)=>{if(err)return next(err);subpaths.forEach(path=>path.path=blockPath+"/"+path.path),paths=paths.concat(subpaths),next()})},err=>{if(err)return callback(err);callback(null,paths)})}const waterfall=__webpack_require__(7),each=__webpack_require__(19),asyncify=__webpack_require__(70),RLP=__webpack_require__(45),EthBlockHead=__webpack_require__(182),multihash=__webpack_require__(21),ethBlockResolver=__webpack_require__(198).resolver,createResolver=__webpack_require__(62),cidFromHash=__webpack_require__(53),ethBlockListResolver=createResolver("eth-block-list",void 0,mapFromEthObj),util=ethBlockListResolver.util;util.serialize=asyncify(ethBlockList=>{const rawOmmers=ethBlockList.map(ethBlock=>ethBlock.raw);return RLP.encode(rawOmmers)}),util.deserialize=asyncify(serialized=>{return RLP.decode(serialized).map(rawBlock=>new EthBlockHead(rawBlock))}),util.cid=((blockList,callback)=>{waterfall([cb=>util.serialize(blockList,cb),(data,cb)=>multihash.digest(data,"keccak-256",cb),asyncify(mhash=>cidFromHash("eth-block-list",mhash))],callback)}),module.exports=ethBlockListResolver},function(module,exports,__webpack_require__){"use strict";const ethAccountSnapshotResolver=__webpack_require__(197),createTrieResolver=__webpack_require__(120),ethStateTrieResolver=createTrieResolver("eth-state-trie",ethAccountSnapshotResolver);module.exports=ethStateTrieResolver},function(module,exports,__webpack_require__){"use strict";const createTrieResolver=__webpack_require__(120),ethStorageTrieResolver=createTrieResolver("eth-storage-trie");module.exports=ethStorageTrieResolver},function(module,exports,__webpack_require__){"use strict";const ethTxResolver=__webpack_require__(199),createTrieResolver=__webpack_require__(120),ethTxTrieResolver=createTrieResolver("eth-tx-trie",ethTxResolver);module.exports=ethTxTrieResolver},function(module,exports){function isExternalLink(obj){return Boolean(obj["/"])}module.exports=isExternalLink},function(module,exports,__webpack_require__){function toIpfsBlock(multicodec,value,callback){multihashing(value,"keccak-256",(err,hash)=>{if(err)return callback(err);callback(null,new IpfsBlock(value,new CID(1,multicodec,hash)))})}const IpfsBlock=__webpack_require__(61),CID=__webpack_require__(8),multihashing=__webpack_require__(21);module.exports=toIpfsBlock},function(module,exports,__webpack_require__){"use strict";(function(setImmediate){function noop(){}const Block=__webpack_require__(61),pull=__webpack_require__(4),CID=__webpack_require__(8),doUntil=__webpack_require__(287),IPFSRepo=__webpack_require__(193),BlockService=__webpack_require__(192),joinPath=__webpack_require__(43).join,pullDeferSource=__webpack_require__(95).source,pullTraverse=__webpack_require__(257),map=__webpack_require__(73),series=__webpack_require__(33),waterfall=__webpack_require__(7),MemoryStore=__webpack_require__(16).MemoryDatastore,dagPB=__webpack_require__(52),dagCBOR=__webpack_require__(433),ipldEthAccountSnapshot=__webpack_require__(42).ethAccountSnapshot,ipldEthBlock=__webpack_require__(42).ethBlock,ipldEthBlockList=__webpack_require__(42).ethBlockList,ipldEthStateTrie=__webpack_require__(42).ethStateTrie,ipldEthStorageTrie=__webpack_require__(42).ethStorageTrie,ipldEthTx=__webpack_require__(42).ethTx,ipldEthTxTrie=__webpack_require__(42).ethTxTrie;class IPLDResolver{constructor(blockService){if(!blockService)throw new Error("Missing blockservice");this.bs=blockService,this.resolvers={},this.support={},this.support.add=((multicodec,resolver,util)=>{if(this.resolvers[multicodec])throw new Error(multicodec+"already supported");this.resolvers[multicodec]={resolver:resolver,util:util}}),this.support.rm=(multicodec=>{this.resolvers[multicodec]&&delete this.resolvers[multicodec]}),this.support.add(dagPB.resolver.multicodec,dagPB.resolver,dagPB.util),this.support.add(dagCBOR.resolver.multicodec,dagCBOR.resolver,dagCBOR.util),this.support.add(ipldEthAccountSnapshot.resolver.multicodec,ipldEthAccountSnapshot.resolver,ipldEthAccountSnapshot.util),this.support.add(ipldEthBlock.resolver.multicodec,ipldEthBlock.resolver,ipldEthBlock.util),this.support.add(ipldEthBlockList.resolver.multicodec,ipldEthBlockList.resolver,ipldEthBlockList.util),this.support.add(ipldEthStateTrie.resolver.multicodec,ipldEthStateTrie.resolver,ipldEthStateTrie.util),this.support.add(ipldEthStorageTrie.resolver.multicodec,ipldEthStorageTrie.resolver,ipldEthStorageTrie.util),this.support.add(ipldEthTx.resolver.multicodec,ipldEthTx.resolver,ipldEthTx.util),this.support.add(ipldEthTxTrie.resolver.multicodec,ipldEthTxTrie.resolver,ipldEthTxTrie.util)}get(cid,path,options,callback){if("function"==typeof path&&(callback=path,path=void 0),"function"==typeof options&&(callback=options,options={}),"string"==typeof path&&(path=joinPath("/",path).substr(1)),""===path||!path)return this._get(cid,(err,node)=>{if(err)return callback(err);callback(null,{value:node,remainderPath:""})});let value;doUntil(cb=>{this.bs.get(cid,(err,block)=>{if(err)return cb(err);this.resolvers[cid.codec].resolver.resolve(block,path,(err,result)=>{if(err)return cb(err);value=result.value,path=result.remainderPath,cb()})})},()=>{const endReached=!path||""===path||"/"===path,isTerminal=value&&!value["/"];return!!(endReached&&isTerminal||options.localResolve)||(value&&(cid=new CID(value["/"])),!1)},(err,results)=>{return err?callback(err):callback(null,{value:value,remainderPath:path})})}getStream(cid,path,options){const deferred=pullDeferSource();return this.get(cid,path,options,(err,result)=>{if(err)return deferred.resolve(pull.error(err));deferred.resolve(pull.values([result]))}),deferred}put(node,options,callback){return"function"==typeof options?setImmediate(()=>callback(new Error("no options were passed"))):(callback=callback||noop,options.cid&&CID.isCID(options.cid)?this._put(options.cid,node,callback):(options.hashAlg=options.hashAlg||"sha2-256",void this.resolvers[options.format].util.cid(node,(err,cid)=>{if(err)return callback(err);this._put(cid,node,callback)})))}treeStream(cid,path,options){"object"==typeof path&&(options=path,path=void 0),options=options||{};let p;if(!options.recursive){p=pullDeferSource();const r=this.resolvers[cid.codec];waterfall([cb=>this.bs.get(cid,cb),(block,cb)=>r.resolver.tree(block,cb)],(err,paths)=>{if(err)return p.abort(err);p.resolve(pull.values(paths))})}return options.recursive&&(p=pull(pullTraverse.widthFirst({basePath:null,cid:cid},el=>{if("string"==typeof el)return pull.empty();const deferred=pullDeferSource(),r=this.resolvers[el.cid.codec];return waterfall([cb=>this.bs.get(el.cid,cb),(block,cb)=>r.resolver.tree(block,(err,paths)=>{if(err)return cb(err);map(paths,(p,cb)=>{r.resolver.isLink(block,p,(err,link)=>{if(err)return cb(err);cb(null,{path:p,link:link})})},cb)})],(err,paths)=>{if(err)return deferred.abort(err);deferred.resolve(pull.values(paths.map(p=>{const base=el.basePath?el.basePath+"/"+p.path:p.path;return p.link?{basePath:base,cid:new CID(p.link["/"])}:base})))}),deferred}),pull.map(e=>{return"string"==typeof e?e:e.basePath}),pull.filter(Boolean))),path?pull(p,pull.map(el=>{if(0===el.indexOf(path))return el=el.slice(path.length+1)}),pull.filter(Boolean)):p}remove(cids,callback){this.bs.delete(cids,callback)}_get(cid,callback){const r=this.resolvers[cid.codec];waterfall([cb=>this.bs.get(cid,cb),(block,cb)=>{r?r.util.deserialize(block.data,(err,deserialized)=>{if(err)return cb(err);cb(null,deserialized)}):cb(null,block.data)}],callback)}_put(cid,node,callback){callback=callback||noop;const r=this.resolvers[cid.codec];waterfall([cb=>r.util.serialize(node,cb),(buf,cb)=>this.bs.put(new Block(buf,cid),cb)],err=>{if(err)return callback(err);callback(null,cid)})}}IPLDResolver.inMemory=function(callback){const repo=new IPFSRepo("in-memory",{storageBackends:{root:MemoryStore,blocks:MemoryStore,datastore:MemoryStore},lock:"memory"}),blockService=new BlockService(repo);series([cb=>repo.init({},cb),cb=>repo.open(cb)],err=>{if(err)return callback(err);callback(null,new IPLDResolver(blockService))})},module.exports=IPLDResolver}).call(exports,__webpack_require__(37).setImmediate)},function(module,exports){function isCircular(obj){return new CircularChecker(obj).isCircular()}function CircularChecker(obj){this.obj=obj}module.exports=isCircular,CircularChecker.prototype.isCircular=function(obj,seen){if(obj=obj||this.obj,seen=seen||[],!(obj instanceof Object))throw new TypeError('"obj" must be an object (or inherit from it)');var self=this;seen.push(obj);for(var key in obj){var val=obj[key];if(val instanceof Object&&(~seen.indexOf(val)||self.isCircular(val,seen.slice())))return!0}return!1}},function(module,exports,__webpack_require__){"use strict";function isProperty(str){return/^[$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(str)}module.exports=isProperty},function(module,exports,__webpack_require__){"use strict";var isStream=module.exports=function(stream){return null!==stream&&"object"==typeof stream&&"function"==typeof stream.pipe};isStream.writable=function(stream){return isStream(stream)&&stream.writable!==!1&&"function"==typeof stream._write&&"object"==typeof stream._writableState},isStream.readable=function(stream){return isStream(stream)&&stream.readable!==!1&&"function"==typeof stream._read&&"object"==typeof stream._readableState},isStream.duplex=function(stream){return isStream.writable(stream)&&isStream.readable(stream)},isStream.transform=function(stream){return isStream.duplex(stream)&&"function"==typeof stream._transform&&"object"==typeof stream._transformState}},function(module,exports,__webpack_require__){(function(process,global){!function(){"use strict";function Keccak(bits,padding,outputBits){this.blocks=[],this.s=[],this.padding=padding,this.outputBits=outputBits,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(bits<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=outputBits>>5,this.extraBytes=(31&outputBits)>>3;for(var i=0;i<50;++i)this.s[i]=0}function Kmac(bits,padding,outputBits){Keccak.call(this,bits,padding,outputBits)}var root="object"==typeof window?window:{};!root.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(root=global);var COMMON_JS=!root.JS_SHA3_NO_COMMON_JS&&"object"==typeof module&&module.exports,ARRAY_BUFFER=!root.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),SHAKE_PADDING=[31,7936,2031616,520093696],CSHAKE_PADDING=[4,1024,262144,67108864],KECCAK_PADDING=[1,256,65536,16777216],PADDING=[6,1536,393216,100663296],SHIFT=[0,8,16,24],RC=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],BITS=[224,256,384,512],SHAKE_BITS=[128,256],OUTPUT_TYPES=["hex","buffer","arrayBuffer","array"],CSHAKE_BYTEPAD={128:168,256:136};!root.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(obj){return"[object Array]"===Object.prototype.toString.call(obj)});for(var createOutputMethod=function(bits,padding,outputType){return function(message){return new Keccak(bits,padding,bits).update(message)[outputType]()}},createShakeOutputMethod=function(bits,padding,outputType){return function(message,outputBits){return new Keccak(bits,padding,outputBits).update(message)[outputType]()}},createCshakeOutputMethod=function(bits,padding,outputType){return function(message,outputBits,n,s){return methods["cshake"+bits].update(message,outputBits,n,s)[outputType]()}},createKmacOutputMethod=function(bits,padding,outputType){return function(key,message,outputBits,s){return methods["kmac"+bits].update(key,message,outputBits,s)[outputType]()}},createOutputMethods=function(method,createMethod,bits,padding){for(var i=0;i>2]|=message[index]<>2]|=code<>2]|=(192|code>>6)<>2]|=(128|63&code)<=57344?(blocks[i>>2]|=(224|code>>12)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<>2]|=(240|code>>18)<>2]|=(128|code>>12&63)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<=byteCount){for(this.start=i-byteCount,this.block=blocks[blockCount],i=0;i>=8,o=255&x;o>0;)bytes.unshift(o),x>>=8,o=255&x,++n;return right?bytes.push(n):bytes.unshift(n),this.update(bytes),bytes.length},Keccak.prototype.encodeString=function(str){str=str||"";var notString="string"!=typeof str;notString&&str.constructor===root.ArrayBuffer&&(str=new Uint8Array(str));var length=str.length;if(notString&&("number"!=typeof length||!Array.isArray(str)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(str))))throw"input is invalid type";var bytes=0;if(notString)bytes=length;else for(var i=0;i=57344?bytes+=3:(code=65536+((1023&code)<<10|1023&str.charCodeAt(++i)),bytes+=4)}return bytes+=this.encode(8*bytes),this.update(str),bytes},Keccak.prototype.bytepad=function(strs,w){for(var bytes=this.encode(w),i=0;i>2]|=this.padding[3&i],this.lastByteIndex===this.byteCount)for(blocks[0]=blocks[blockCount],i=1;i>4&15]+HEX_CHARS[15&block]+HEX_CHARS[block>>12&15]+HEX_CHARS[block>>8&15]+HEX_CHARS[block>>20&15]+HEX_CHARS[block>>16&15]+HEX_CHARS[block>>28&15]+HEX_CHARS[block>>24&15];j%blockCount==0&&(f(s),i=0)}return extraBytes&&(block=s[i],extraBytes>0&&(hex+=HEX_CHARS[block>>4&15]+HEX_CHARS[15&block]),extraBytes>1&&(hex+=HEX_CHARS[block>>12&15]+HEX_CHARS[block>>8&15]),extraBytes>2&&(hex+=HEX_CHARS[block>>20&15]+HEX_CHARS[block>>16&15])),hex},Keccak.prototype.arrayBuffer=function(){this.finalize();var buffer,blockCount=this.blockCount,s=this.s,outputBlocks=this.outputBlocks,extraBytes=this.extraBytes,i=0,j=0,bytes=this.outputBits>>3;buffer=extraBytes?new ArrayBuffer(outputBlocks+1<<2):new ArrayBuffer(bytes);for(var array=new Uint32Array(buffer);j>8&255,array[offset+2]=block>>16&255,array[offset+3]=block>>24&255;j%blockCount==0&&f(s)}return extraBytes&&(offset=j<<2,block=s[i],extraBytes>0&&(array[offset]=255&block),extraBytes>1&&(array[offset+1]=block>>8&255),extraBytes>2&&(array[offset+2]=block>>16&255)),array},Kmac.prototype=new Keccak,Kmac.prototype.finalize=function(){return this.encode(this.outputBits,!0), -Keccak.prototype.finalize.call(this)};var f=function(s){var h,l,n,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49;for(n=0;n<48;n+=2)c0=s[0]^s[10]^s[20]^s[30]^s[40],c1=s[1]^s[11]^s[21]^s[31]^s[41],c2=s[2]^s[12]^s[22]^s[32]^s[42],c3=s[3]^s[13]^s[23]^s[33]^s[43],c4=s[4]^s[14]^s[24]^s[34]^s[44],c5=s[5]^s[15]^s[25]^s[35]^s[45],c6=s[6]^s[16]^s[26]^s[36]^s[46],c7=s[7]^s[17]^s[27]^s[37]^s[47],c8=s[8]^s[18]^s[28]^s[38]^s[48],c9=s[9]^s[19]^s[29]^s[39]^s[49],h=c8^(c2<<1|c3>>>31),l=c9^(c3<<1|c2>>>31),s[0]^=h,s[1]^=l,s[10]^=h,s[11]^=l,s[20]^=h,s[21]^=l,s[30]^=h,s[31]^=l,s[40]^=h,s[41]^=l,h=c0^(c4<<1|c5>>>31),l=c1^(c5<<1|c4>>>31),s[2]^=h,s[3]^=l,s[12]^=h,s[13]^=l,s[22]^=h,s[23]^=l,s[32]^=h,s[33]^=l,s[42]^=h,s[43]^=l,h=c2^(c6<<1|c7>>>31),l=c3^(c7<<1|c6>>>31),s[4]^=h,s[5]^=l,s[14]^=h,s[15]^=l,s[24]^=h,s[25]^=l,s[34]^=h,s[35]^=l,s[44]^=h,s[45]^=l,h=c4^(c8<<1|c9>>>31),l=c5^(c9<<1|c8>>>31),s[6]^=h,s[7]^=l,s[16]^=h,s[17]^=l,s[26]^=h,s[27]^=l,s[36]^=h,s[37]^=l,s[46]^=h,s[47]^=l,h=c6^(c0<<1|c1>>>31),l=c7^(c1<<1|c0>>>31),s[8]^=h,s[9]^=l,s[18]^=h,s[19]^=l,s[28]^=h,s[29]^=l,s[38]^=h,s[39]^=l,s[48]^=h,s[49]^=l,b0=s[0],b1=s[1],b32=s[11]<<4|s[10]>>>28,b33=s[10]<<4|s[11]>>>28,b14=s[20]<<3|s[21]>>>29,b15=s[21]<<3|s[20]>>>29,b46=s[31]<<9|s[30]>>>23,b47=s[30]<<9|s[31]>>>23,b28=s[40]<<18|s[41]>>>14,b29=s[41]<<18|s[40]>>>14,b20=s[2]<<1|s[3]>>>31,b21=s[3]<<1|s[2]>>>31,b2=s[13]<<12|s[12]>>>20,b3=s[12]<<12|s[13]>>>20,b34=s[22]<<10|s[23]>>>22,b35=s[23]<<10|s[22]>>>22,b16=s[33]<<13|s[32]>>>19,b17=s[32]<<13|s[33]>>>19,b48=s[42]<<2|s[43]>>>30,b49=s[43]<<2|s[42]>>>30,b40=s[5]<<30|s[4]>>>2,b41=s[4]<<30|s[5]>>>2,b22=s[14]<<6|s[15]>>>26,b23=s[15]<<6|s[14]>>>26,b4=s[25]<<11|s[24]>>>21,b5=s[24]<<11|s[25]>>>21,b36=s[34]<<15|s[35]>>>17,b37=s[35]<<15|s[34]>>>17,b18=s[45]<<29|s[44]>>>3,b19=s[44]<<29|s[45]>>>3,b10=s[6]<<28|s[7]>>>4,b11=s[7]<<28|s[6]>>>4,b42=s[17]<<23|s[16]>>>9,b43=s[16]<<23|s[17]>>>9,b24=s[26]<<25|s[27]>>>7,b25=s[27]<<25|s[26]>>>7,b6=s[36]<<21|s[37]>>>11,b7=s[37]<<21|s[36]>>>11,b38=s[47]<<24|s[46]>>>8,b39=s[46]<<24|s[47]>>>8,b30=s[8]<<27|s[9]>>>5,b31=s[9]<<27|s[8]>>>5,b12=s[18]<<20|s[19]>>>12,b13=s[19]<<20|s[18]>>>12,b44=s[29]<<7|s[28]>>>25,b45=s[28]<<7|s[29]>>>25,b26=s[38]<<8|s[39]>>>24,b27=s[39]<<8|s[38]>>>24,b8=s[48]<<14|s[49]>>>18,b9=s[49]<<14|s[48]>>>18,s[0]=b0^~b2&b4,s[1]=b1^~b3&b5,s[10]=b10^~b12&b14,s[11]=b11^~b13&b15,s[20]=b20^~b22&b24,s[21]=b21^~b23&b25,s[30]=b30^~b32&b34,s[31]=b31^~b33&b35,s[40]=b40^~b42&b44,s[41]=b41^~b43&b45,s[2]=b2^~b4&b6,s[3]=b3^~b5&b7,s[12]=b12^~b14&b16,s[13]=b13^~b15&b17,s[22]=b22^~b24&b26,s[23]=b23^~b25&b27,s[32]=b32^~b34&b36,s[33]=b33^~b35&b37,s[42]=b42^~b44&b46,s[43]=b43^~b45&b47,s[4]=b4^~b6&b8,s[5]=b5^~b7&b9,s[14]=b14^~b16&b18,s[15]=b15^~b17&b19,s[24]=b24^~b26&b28,s[25]=b25^~b27&b29,s[34]=b34^~b36&b38,s[35]=b35^~b37&b39,s[44]=b44^~b46&b48,s[45]=b45^~b47&b49,s[6]=b6^~b8&b0,s[7]=b7^~b9&b1,s[16]=b16^~b18&b10,s[17]=b17^~b19&b11,s[26]=b26^~b28&b20,s[27]=b27^~b29&b21,s[36]=b36^~b38&b30,s[37]=b37^~b39&b31,s[46]=b46^~b48&b40,s[47]=b47^~b49&b41,s[8]=b8^~b0&b2,s[9]=b9^~b1&b3,s[18]=b18^~b10&b12,s[19]=b19^~b11&b13,s[28]=b28^~b20&b22,s[29]=b29^~b21&b23,s[38]=b38^~b30&b32,s[39]=b39^~b31&b33,s[48]=b48^~b40&b42,s[49]=b49^~b41&b43,s[0]^=RC[n],s[1]^=RC[n+1]};if(COMMON_JS)module.exports=methods;else for(var i=0;i=6.2.3 <7.0.0",type:"range"},"/Users/koruza/code/js-ipfs/node_modules/secp256k1"]],_from:"elliptic@>=6.2.3 <7.0.0",_id:"elliptic@6.4.0",_inCache:!0,_location:"/elliptic",_nodeVersion:"7.0.0",_npmOperationalInternal:{host:"packages-18-east.internal.npmjs.com",tmp:"tmp/elliptic-6.4.0.tgz_1487798866428_0.30510620190761983"},_npmUser:{name:"indutny",email:"fedor@indutny.com"},_npmVersion:"3.10.8",_phantomChildren:{},_requested:{raw:"elliptic@^6.2.3",scope:null,escapedName:"elliptic",name:"elliptic",rawSpec:"^6.2.3",spec:">=6.2.3 <7.0.0",type:"range"},_requiredBy:["/browserify-sign","/create-ecdh","/secp256k1"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz",_shasum:"cac9af8762c85836187003c8dfe193e5e2eae5df",_shrinkwrap:null,_spec:"elliptic@^6.2.3",_where:"/Users/koruza/code/js-ipfs/node_modules/secp256k1",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},directories:{},dist:{shasum:"cac9af8762c85836187003c8dfe193e5e2eae5df",tarball:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz"},files:["lib"],gitHead:"6b0d2b76caae91471649c8e21f0b1d3ba0f96090",homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",maintainers:[{name:"indutny",email:"fedor@indutny.com"}],name:"elliptic",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.0"}},function(module,exports){module.exports={name:"ipfs",version:"0.25.0",description:"JavaScript implementation of the IPFS specification",bin:{jsipfs:"src/cli/bin.js"},main:"src/core/index.js",browser:{"./src/core/components/init-assets.js":!1,"./src/core/runtime/config-nodejs.json":"./src/core/runtime/config-browser.json","./src/core/runtime/libp2p-nodejs.js":"./src/core/runtime/libp2p-browser.js","./src/core/runtime/repo-nodejs.js":"./src/core/runtime/repo-browser.js","./test/utils/create-repo-nodejs.js":"./test/utils/create-repo-browser.js",stream:"readable-stream"},engines:{node:">=6.0.0",npm:">=3.0.0"},scripts:{lint:"aegir-lint",coverage:"gulp coverage",test:"gulp test --dom","test:node":"npm run test:unit:node","test:browser":"npm run test:unit:browser","test:unit:node":"gulp test:node","test:unit:node:core":"TEST=core npm run test:unit:node","test:unit:node:http":"TEST=http npm run test:unit:node","test:unit:node:cli":"TEST=cli npm run test:unit:node","test:unit:browser":"gulp test:browser","test:interop":"npm run test:interop:node","test:interop:node":"mocha -t 60000 test/interop/node.js","test:interop:browser":"mocha -t 60000 test/interop/browser.js","test:benchmark":'echo "Error: no benchmarks yet" && exit 1',"test:benchmark:node":'echo "Error: no benchmarks yet" && exit 1',"test:benchmark:node:core":'echo "Error: no benchmarks yet" && exit 1',"test:benchmark:node:http":'echo "Error: no benchmarks yet" && exit 1',"test:benchmark:browser":'echo "Error: no benchmarks yet" && exit 1',build:"gulp build",release:"gulp release","release-minor":"gulp release --type minor","release-major":"gulp release --type major","coverage-publish":"aegir-coverage publish"},"pre-commit":["lint","test"],repository:{type:"git",url:"git+https://github.com/ipfs/js-ipfs.git"},keywords:["IPFS"],author:"David Dias ",license:"MIT",bugs:{url:"https://github.com/ipfs/js-ipfs/issues"},homepage:"https://github.com/ipfs/js-ipfs#readme",devDependencies:{aegir:"^11.0.2","buffer-loader":"0.0.1",chai:"^4.1.0",delay:"^2.0.0","detect-node":"^2.0.3","dir-compare":"^1.4.0","dirty-chai":"^2.0.1","eslint-plugin-react":"^7.1.0",execa:"^0.7.0","expose-loader":"^0.7.3","form-data":"^2.2.0",gulp:"^3.9.1","interface-ipfs-core":"~0.30.1","ipfsd-ctl":"~0.21.0","left-pad":"^1.1.3",lodash:"^4.17.4",mocha:"^3.4.2",ncp:"^2.0.0",nexpect:"^0.5.0","pre-commit":"^1.2.2","pretty-bytes":"^4.0.2",qs:"^6.5.0","random-fs":"^1.0.3",rimraf:"^2.6.1","stream-to-promise":"^2.2.0","transform-loader":"^0.2.4"},dependencies:{async:"^2.5.0",bl:"^1.2.1",boom:"^5.2.0",cids:"^0.5.1",debug:"^2.6.8","fsm-event":"^2.1.0",glob:"^7.1.2",hapi:"^16.5.0","hapi-set-header":"^1.0.2",hoek:"^4.2.0","ipfs-api":"^14.1.1","ipfs-bitswap":"~0.15.0","ipfs-block":"~0.6.0","ipfs-block-service":"~0.12.0","ipfs-multipart":"~0.1.0","ipfs-repo":"~0.17.0","ipfs-unixfs":"~0.1.12","ipfs-unixfs-engine":"~0.22.0","ipld-resolver":"~0.13.0","is-ipfs":"^0.3.0","is-stream":"^1.1.0",joi:"^10.6.0",libp2p:"^0.11.0","libp2p-floodsub":"~0.11.0","libp2p-kad-dht":"^0.4.1","libp2p-mdns":"^0.8.0","libp2p-multiplex":"^0.4.4","libp2p-railing":"^0.6.1","libp2p-secio":"^0.7.1","libp2p-swarm":"^0.31.0","libp2p-tcp":"^0.10.2","libp2p-webrtc-star":"^0.12.0","libp2p-websockets":"^0.10.1","lodash.flatmap":"^4.5.0","lodash.get":"^4.4.2","lodash.sortby":"^4.7.0","lodash.values":"^4.3.0",mafmt:"^2.1.8",mkdirp:"^0.5.1",multiaddr:"^2.3.0",multihashes:"~0.4.5",once:"^1.4.0","path-exists":"^3.0.0","peer-book":"^0.5.0","peer-id":"^0.9.0","peer-info":"^0.10.0","promisify-es6":"^1.0.3","pull-file":"^1.0.0","pull-paramap":"^1.2.2","pull-pushable":"^2.1.1","pull-sort":"^1.0.1","pull-stream":"^3.6.0","pull-stream-to-stream":"^1.3.4","pull-zip":"^2.0.1","read-pkg-up":"^2.0.0","readable-stream":"2.3.3","safe-buffer":"^5.1.1","stream-to-pull-stream":"^1.7.2","tar-stream":"^1.5.4",temp:"^0.8.3",through2:"^2.0.3","update-notifier":"^2.2.0",yargs:"8.0.2"},contributors:["Andrew de Andrade ","CHEVALAY JOSSELIN ","Caio Gondim ","Christian Couder ","Daniel J. O'Quinn ","Daniela Borges Matos de Carvalho ","David Dias ","Enrico Marino ","Felix Yan ","Francisco Baio Dias ","Francisco Baio Dias ","Friedel Ziegelmayer ","Georgios Rassias ","Greenkeeper ","Haad ","Harsh Vakharia ","Jon Schlinkert ","João Antunes ","Kevin Wang ","Lars Gierth ","Marius Darila ","Michelle Lee ","Mikeal Rogers ","Mithgol ","Nuno Nogueira ","Oskar Nyberg ","Pau Ramon Revilla ","Pedro Teixeira ","Richard Littauer ","Rod Keys ","Sid Harder ","SidHarder ","Stephen Whitmore ","Stephen Whitmore ","Terence Pae ","Xiao Liang ","haad ","jbenet ","kumavis ","nginnever ","npmcdn-to-unpkg-bot ","tcme ","ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ "]}},function(module,exports,__webpack_require__){"use strict";var createKeccak=__webpack_require__(456),createShake=__webpack_require__(457);module.exports=function(KeccakState){var Keccak=createKeccak(KeccakState),Shake=createShake(KeccakState);return function(algorithm,options){switch("string"==typeof algorithm?algorithm.toLowerCase():algorithm){case"keccak224":return new Keccak(1152,448,null,224,options);case"keccak256":return new Keccak(1088,512,null,256,options);case"keccak384":return new Keccak(832,768,null,384,options);case"keccak512":return new Keccak(576,1024,null,512,options);case"sha3-224":return new Keccak(1152,448,6,224,options);case"sha3-256":return new Keccak(1088,512,6,256,options);case"sha3-384":return new Keccak(832,768,6,384,options);case"sha3-512":return new Keccak(576,1024,6,512,options);case"shake128":return new Shake(1344,256,31,options);case"shake256":return new Shake(1088,512,31,options);default:throw new Error("Invald algorithm: "+algorithm)}}}},function(module,exports,__webpack_require__){"use strict";var Buffer=__webpack_require__(6).Buffer,Transform=__webpack_require__(25).Transform,inherits=__webpack_require__(1);module.exports=function(KeccakState){function Keccak(rate,capacity,delimitedSuffix,hashBitLength,options){Transform.call(this,options),this._rate=rate,this._capacity=capacity,this._delimitedSuffix=delimitedSuffix,this._hashBitLength=hashBitLength,this._options=options,this._state=new KeccakState,this._state.initialize(rate,capacity),this._finalized=!1}return inherits(Keccak,Transform),Keccak.prototype._transform=function(chunk,encoding,callback){var error=null;try{this.update(chunk,encoding)}catch(err){error=err}callback(error)},Keccak.prototype._flush=function(callback){var error=null;try{this.push(this.digest())}catch(err){error=err}callback(error)},Keccak.prototype.update=function(data,encoding){if(!Buffer.isBuffer(data)&&"string"!=typeof data)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(data)||(data=Buffer.from(data,encoding)),this._state.absorb(data),this},Keccak.prototype.digest=function(encoding){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var digest=this._state.squeeze(this._hashBitLength/8);return void 0!==encoding&&(digest=digest.toString(encoding)),this._resetState(),digest},Keccak.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},Keccak.prototype._clone=function(){var clone=new Keccak(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(clone._state),clone._finalized=this._finalized,clone},Keccak}},function(module,exports,__webpack_require__){"use strict";var Buffer=__webpack_require__(6).Buffer,Transform=__webpack_require__(25).Transform,inherits=__webpack_require__(1);module.exports=function(KeccakState){function Shake(rate,capacity,delimitedSuffix,options){Transform.call(this,options),this._rate=rate,this._capacity=capacity,this._delimitedSuffix=delimitedSuffix,this._options=options,this._state=new KeccakState,this._state.initialize(rate,capacity),this._finalized=!1}return inherits(Shake,Transform),Shake.prototype._transform=function(chunk,encoding,callback){var error=null;try{this.update(chunk,encoding)}catch(err){error=err}callback(error)},Shake.prototype._flush=function(){},Shake.prototype._read=function(size){this.push(this.squeeze(size))},Shake.prototype.update=function(data,encoding){if(!Buffer.isBuffer(data)&&"string"!=typeof data)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(data)||(data=Buffer.from(data,encoding)),this._state.absorb(data),this},Shake.prototype.squeeze=function(dataByteLength,encoding){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var data=this._state.squeeze(dataByteLength);return void 0!==encoding&&(data=data.toString(encoding)),data},Shake.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},Shake.prototype._clone=function(){var clone=new Shake(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(clone._state),clone._finalized=this._finalized,clone},Shake}},function(module,exports,__webpack_require__){"use strict";var P1600_ROUND_CONSTANTS=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];exports.p1600=function(s){for(var round=0;round<24;++round){var lo0=s[0]^s[10]^s[20]^s[30]^s[40],hi0=s[1]^s[11]^s[21]^s[31]^s[41],lo1=s[2]^s[12]^s[22]^s[32]^s[42],hi1=s[3]^s[13]^s[23]^s[33]^s[43],lo2=s[4]^s[14]^s[24]^s[34]^s[44],hi2=s[5]^s[15]^s[25]^s[35]^s[45],lo3=s[6]^s[16]^s[26]^s[36]^s[46],hi3=s[7]^s[17]^s[27]^s[37]^s[47],lo4=s[8]^s[18]^s[28]^s[38]^s[48],hi4=s[9]^s[19]^s[29]^s[39]^s[49],lo=lo4^(lo1<<1|hi1>>>31),hi=hi4^(hi1<<1|lo1>>>31),t1slo0=s[0]^lo,t1shi0=s[1]^hi,t1slo5=s[10]^lo,t1shi5=s[11]^hi,t1slo10=s[20]^lo,t1shi10=s[21]^hi,t1slo15=s[30]^lo,t1shi15=s[31]^hi,t1slo20=s[40]^lo,t1shi20=s[41]^hi;lo=lo0^(lo2<<1|hi2>>>31),hi=hi0^(hi2<<1|lo2>>>31);var t1slo1=s[2]^lo,t1shi1=s[3]^hi,t1slo6=s[12]^lo,t1shi6=s[13]^hi,t1slo11=s[22]^lo,t1shi11=s[23]^hi,t1slo16=s[32]^lo,t1shi16=s[33]^hi,t1slo21=s[42]^lo,t1shi21=s[43]^hi;lo=lo1^(lo3<<1|hi3>>>31),hi=hi1^(hi3<<1|lo3>>>31);var t1slo2=s[4]^lo,t1shi2=s[5]^hi,t1slo7=s[14]^lo,t1shi7=s[15]^hi,t1slo12=s[24]^lo,t1shi12=s[25]^hi,t1slo17=s[34]^lo,t1shi17=s[35]^hi,t1slo22=s[44]^lo,t1shi22=s[45]^hi;lo=lo2^(lo4<<1|hi4>>>31),hi=hi2^(hi4<<1|lo4>>>31);var t1slo3=s[6]^lo,t1shi3=s[7]^hi,t1slo8=s[16]^lo,t1shi8=s[17]^hi,t1slo13=s[26]^lo,t1shi13=s[27]^hi,t1slo18=s[36]^lo,t1shi18=s[37]^hi,t1slo23=s[46]^lo,t1shi23=s[47]^hi;lo=lo3^(lo0<<1|hi0>>>31),hi=hi3^(hi0<<1|lo0>>>31);var t1slo4=s[8]^lo,t1shi4=s[9]^hi,t1slo9=s[18]^lo,t1shi9=s[19]^hi,t1slo14=s[28]^lo,t1shi14=s[29]^hi,t1slo19=s[38]^lo,t1shi19=s[39]^hi,t1slo24=s[48]^lo,t1shi24=s[49]^hi,t2slo0=t1slo0,t2shi0=t1shi0,t2slo16=t1shi5<<4|t1slo5>>>28,t2shi16=t1slo5<<4|t1shi5>>>28,t2slo7=t1slo10<<3|t1shi10>>>29,t2shi7=t1shi10<<3|t1slo10>>>29,t2slo23=t1shi15<<9|t1slo15>>>23,t2shi23=t1slo15<<9|t1shi15>>>23,t2slo14=t1slo20<<18|t1shi20>>>14,t2shi14=t1shi20<<18|t1slo20>>>14,t2slo10=t1slo1<<1|t1shi1>>>31,t2shi10=t1shi1<<1|t1slo1>>>31,t2slo1=t1shi6<<12|t1slo6>>>20,t2shi1=t1slo6<<12|t1shi6>>>20,t2slo17=t1slo11<<10|t1shi11>>>22,t2shi17=t1shi11<<10|t1slo11>>>22,t2slo8=t1shi16<<13|t1slo16>>>19,t2shi8=t1slo16<<13|t1shi16>>>19,t2slo24=t1slo21<<2|t1shi21>>>30,t2shi24=t1shi21<<2|t1slo21>>>30,t2slo20=t1shi2<<30|t1slo2>>>2,t2shi20=t1slo2<<30|t1shi2>>>2,t2slo11=t1slo7<<6|t1shi7>>>26,t2shi11=t1shi7<<6|t1slo7>>>26,t2slo2=t1shi12<<11|t1slo12>>>21,t2shi2=t1slo12<<11|t1shi12>>>21,t2slo18=t1slo17<<15|t1shi17>>>17,t2shi18=t1shi17<<15|t1slo17>>>17,t2slo9=t1shi22<<29|t1slo22>>>3,t2shi9=t1slo22<<29|t1shi22>>>3,t2slo5=t1slo3<<28|t1shi3>>>4,t2shi5=t1shi3<<28|t1slo3>>>4,t2slo21=t1shi8<<23|t1slo8>>>9,t2shi21=t1slo8<<23|t1shi8>>>9,t2slo12=t1slo13<<25|t1shi13>>>7,t2shi12=t1shi13<<25|t1slo13>>>7,t2slo3=t1slo18<<21|t1shi18>>>11,t2shi3=t1shi18<<21|t1slo18>>>11,t2slo19=t1shi23<<24|t1slo23>>>8,t2shi19=t1slo23<<24|t1shi23>>>8,t2slo15=t1slo4<<27|t1shi4>>>5,t2shi15=t1shi4<<27|t1slo4>>>5,t2slo6=t1slo9<<20|t1shi9>>>12,t2shi6=t1shi9<<20|t1slo9>>>12,t2slo22=t1shi14<<7|t1slo14>>>25,t2shi22=t1slo14<<7|t1shi14>>>25,t2slo13=t1slo19<<8|t1shi19>>>24,t2shi13=t1shi19<<8|t1slo19>>>24,t2slo4=t1slo24<<14|t1shi24>>>18,t2shi4=t1shi24<<14|t1slo24>>>18;s[0]=t2slo0^~t2slo1&t2slo2,s[1]=t2shi0^~t2shi1&t2shi2,s[10]=t2slo5^~t2slo6&t2slo7,s[11]=t2shi5^~t2shi6&t2shi7,s[20]=t2slo10^~t2slo11&t2slo12,s[21]=t2shi10^~t2shi11&t2shi12,s[30]=t2slo15^~t2slo16&t2slo17,s[31]=t2shi15^~t2shi16&t2shi17,s[40]=t2slo20^~t2slo21&t2slo22,s[41]=t2shi20^~t2shi21&t2shi22,s[2]=t2slo1^~t2slo2&t2slo3,s[3]=t2shi1^~t2shi2&t2shi3,s[12]=t2slo6^~t2slo7&t2slo8,s[13]=t2shi6^~t2shi7&t2shi8,s[22]=t2slo11^~t2slo12&t2slo13,s[23]=t2shi11^~t2shi12&t2shi13,s[32]=t2slo16^~t2slo17&t2slo18,s[33]=t2shi16^~t2shi17&t2shi18,s[42]=t2slo21^~t2slo22&t2slo23,s[43]=t2shi21^~t2shi22&t2shi23,s[4]=t2slo2^~t2slo3&t2slo4,s[5]=t2shi2^~t2shi3&t2shi4,s[14]=t2slo7^~t2slo8&t2slo9,s[15]=t2shi7^~t2shi8&t2shi9,s[24]=t2slo12^~t2slo13&t2slo14,s[25]=t2shi12^~t2shi13&t2shi14,s[34]=t2slo17^~t2slo18&t2slo19,s[35]=t2shi17^~t2shi18&t2shi19,s[44]=t2slo22^~t2slo23&t2slo24,s[45]=t2shi22^~t2shi23&t2shi24,s[6]=t2slo3^~t2slo4&t2slo0,s[7]=t2shi3^~t2shi4&t2shi0,s[16]=t2slo8^~t2slo9&t2slo5,s[17]=t2shi8^~t2shi9&t2shi5,s[26]=t2slo13^~t2slo14&t2slo10,s[27]=t2shi13^~t2shi14&t2shi10,s[36]=t2slo18^~t2slo19&t2slo15,s[37]=t2shi18^~t2shi19&t2shi15,s[46]=t2slo23^~t2slo24&t2slo20,s[47]=t2shi23^~t2shi24&t2shi20,s[8]=t2slo4^~t2slo0&t2slo1,s[9]=t2shi4^~t2shi0&t2shi1,s[18]=t2slo9^~t2slo5&t2slo6,s[19]=t2shi9^~t2shi5&t2shi6,s[28]=t2slo14^~t2slo10&t2slo11,s[29]=t2shi14^~t2shi10&t2shi11,s[38]=t2slo19^~t2slo15&t2slo16,s[39]=t2shi19^~t2shi15&t2shi16,s[48]=t2slo24^~t2slo20&t2slo21,s[49]=t2shi24^~t2shi20&t2shi21,s[0]^=P1600_ROUND_CONSTANTS[2*round],s[1]^=P1600_ROUND_CONSTANTS[2*round+1]}}},function(module,exports,__webpack_require__){"use strict";function Keccak(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}var Buffer=__webpack_require__(6).Buffer,keccakState=__webpack_require__(458);Keccak.prototype.initialize=function(rate,capacity){for(var i=0;i<50;++i)this.state[i]=0;this.blockSize=rate/8,this.count=0,this.squeezing=!1},Keccak.prototype.absorb=function(data){for(var i=0;i>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(keccakState.p1600(this.state),this.count=0);return output},Keccak.prototype.copy=function(dest){for(var i=0;i<50;++i)dest.state[i]=this.state[i];dest.blockSize=this.blockSize,dest.count=this.count,dest.squeezing=this.squeezing},module.exports=Keccak},function(module,exports,__webpack_require__){module.exports=__webpack_require__(320).SHA3Hash},function(module,exports,__webpack_require__){function Codec(opts){this.opts=opts||{},this.encodings=encodings}var encodings=__webpack_require__(462);module.exports=Codec,Codec.prototype._encoding=function(encoding){return"string"==typeof encoding&&(encoding=encodings[encoding]),encoding||(encoding=encodings.id),encoding},Codec.prototype._keyEncoding=function(opts,batchOpts){return this._encoding(batchOpts&&batchOpts.keyEncoding||opts&&opts.keyEncoding||this.opts.keyEncoding)},Codec.prototype._valueEncoding=function(opts,batchOpts){return this._encoding(batchOpts&&(batchOpts.valueEncoding||batchOpts.encoding)||opts&&(opts.valueEncoding||opts.encoding)||this.opts.valueEncoding||this.opts.encoding)},Codec.prototype.encodeKey=function(key,opts,batchOpts){return this._keyEncoding(opts,batchOpts).encode(key)},Codec.prototype.encodeValue=function(value,opts,batchOpts){return this._valueEncoding(opts,batchOpts).encode(value)},Codec.prototype.decodeKey=function(key,opts){return this._keyEncoding(opts).decode(key)},Codec.prototype.decodeValue=function(value,opts){return this._valueEncoding(opts).decode(value)},Codec.prototype.encodeBatch=function(ops,opts){var self=this;return ops.map(function(_op){var op={type:_op.type,key:self.encodeKey(_op.key,opts,_op)};return self.keyAsBuffer(opts,_op)&&(op.keyEncoding="binary"),_op.prefix&&(op.prefix=_op.prefix),"value"in _op&&(op.value=self.encodeValue(_op.value,opts,_op),self.valueAsBuffer(opts,_op)&&(op.valueEncoding="binary")),op})};var ltgtKeys=["lt","gt","lte","gte","start","end"];Codec.prototype.encodeLtgt=function(ltgt){var self=this,ret={};return Object.keys(ltgt).forEach(function(key){ret[key]=ltgtKeys.indexOf(key)>-1?self.encodeKey(ltgt[key],ltgt):ltgt[key]}),ret},Codec.prototype.createStreamDecoder=function(opts){var self=this;return opts.keys&&opts.values?function(key,value){return{key:self.decodeKey(key,opts),value:self.decodeValue(value,opts)}}:opts.keys?function(key){return self.decodeKey(key,opts)}:opts.values?function(_,value){return self.decodeValue(value,opts)}:function(){}},Codec.prototype.keyAsBuffer=function(opts){return this._keyEncoding(opts).buffer},Codec.prototype.valueAsBuffer=function(opts){return this._valueEncoding(opts).buffer}},function(module,exports,__webpack_require__){(function(Buffer){function identity(value){return value}function isBinary(data){return void 0===data||null===data||Buffer.isBuffer(data)}exports.utf8=exports["utf-8"]={encode:function(data){return isBinary(data)?data:String(data)},decode:function(data){return"string"==typeof data?data:String(data)},buffer:!1,type:"utf8"},exports.json={encode:JSON.stringify,decode:JSON.parse,buffer:!1,type:"json"},exports.binary={encode:function(data){return isBinary(data)?data:new Buffer(data)},decode:identity,buffer:!0,type:"binary"},exports.none={encode:function(data){return data},decode:function(data){return data},buffer:!1,type:"id"},exports.id=exports.none,["hex","ascii","base64","ucs2","ucs-2","utf16le","utf-16le"].forEach(function(type){exports[type]={encode:function(data){return isBinary(data)?data:new Buffer(data,type)},decode:function(buffer){return buffer.toString(type)},buffer:!0,type:type}})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function ReadStream(iterator,options){if(!(this instanceof ReadStream))return new ReadStream(iterator,options);Readable.call(this,extend(options,{objectMode:!0})),this._iterator=iterator,this._destroyed=!1,this._decoder=null,options&&options.decoder&&(this._decoder=options.decoder),this.on("end",this._cleanup.bind(this))}var inherits=__webpack_require__(1),Readable=__webpack_require__(466).Readable,extend=__webpack_require__(38),EncodingError=__webpack_require__(87).EncodingError;module.exports=ReadStream,inherits(ReadStream,Readable),ReadStream.prototype._read=function(){var self=this;this._destroyed||this._iterator.next(function(err,key,value){if(!self._destroyed){if(err)return self.emit("error",err);if(void 0===key&&void 0===value)self.push(null);else{if(!self._decoder)return self.push({key:key,value:value});try{var value=self._decoder(key,value)}catch(err){return self.emit("error",new EncodingError(err)),void self.push(null)}self.push(value)}}})},ReadStream.prototype.destroy=ReadStream.prototype._cleanup=function(){var self=this;this._destroyed||(this._destroyed=!0,this._iterator.end(function(err){if(err)return self.emit("error",err);self.emit("close")}))}},function(module,exports){module.exports=Array.isArray||function(arr){return"[object Array]"==Object.prototype.toString.call(arr)}},function(module,exports,__webpack_require__){function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}module.exports=PassThrough;var Transform=__webpack_require__(211),util=__webpack_require__(26);util.inherits=__webpack_require__(1),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},function(module,exports,__webpack_require__){(function(process){exports=module.exports=__webpack_require__(210),exports.Stream=__webpack_require__(25),exports.Readable=exports,exports.Writable=__webpack_require__(212),exports.Duplex=__webpack_require__(54),exports.Transform=__webpack_require__(211),exports.PassThrough=__webpack_require__(465),process.browser||"disable"!==process.env.READABLE_STREAM||(module.exports=__webpack_require__(25))}).call(exports,__webpack_require__(5))},function(module,exports,__webpack_require__){(function(Buffer,process){function Iterator(db,options){if(this._db=db._db,this._idbOpts=db._idbOpts,AbstractIterator.call(this,db),this._options=xtend({snapshot:!0},this._idbOpts,options),this._limit=this._options.limit,null!=this._limit&&this._limit!==-1||(this._limit=1/0),"number"!=typeof this._limit)throw new TypeError("options.limit must be a number");0!==this._limit&&(this._count=0,this._startCursor(this._options))}var util=__webpack_require__(32),AbstractIterator=__webpack_require__(216).AbstractIterator,ltgt=__webpack_require__(559),idbReadableStream=__webpack_require__(384),stream=__webpack_require__(25),xtend=__webpack_require__(38),Writable=stream.Writable;module.exports=Iterator,util.inherits(Iterator,AbstractIterator),Iterator.prototype._startCursor=function(options){options=xtend(this._options,options);var self=this,keyRange=null,lower=ltgt.lowerBound(options),upper=ltgt.upperBound(options),lowerOpen=ltgt.lowerBoundExclusive(options),upperOpen=ltgt.upperBoundExclusive(options),direction=options.reverse?"prev":"next";if(lower&&("binary"!==options.keyEncoding||Array.isArray(lower)||(lower=Array.prototype.slice.call(lower))),upper&&("binary"!==options.keyEncoding||Array.isArray(upper)||(upper=Array.prototype.slice.call(upper))),lower&&upper)try{keyRange=IDBKeyRange.bound(lower,upper,lowerOpen,upperOpen)}catch(err){return void(this._keyRangeError=!0)}else lower?keyRange=IDBKeyRange.lowerBound(lower,lowerOpen):upper&&(keyRange=IDBKeyRange.upperBound(upper,upperOpen));this._reader=idbReadableStream(this._db,this._idbOpts.storeName,xtend(options,{range:keyRange,direction:direction})),this._reader.on("error",function(err){var cb=self._callback;self._callback=!1,cb?cb(err):self._readNext=function(cb){cb(err)}}),this._reader.pipe(new Writable({objectMode:!0,write:function(item,enc,cb){if(self._count++>=self._limit)return self._reader.pause(),self._reader.unpipe(this),cb(),void this.end();var cb2=self._callback;self._callback=!1,cb2?self._processItem(item,function(err,key,value){cb(err),cb2(err,key,value)}):self._readNext=function(cb2){self._processItem(item,function(err,key,value){cb(err),cb2(err,key,value)})}}})).on("finish",function(){var cb=self._callback;self._callback=!1,cb?cb():self._readNext=function(cb){cb()}})},Iterator.prototype._processItem=function(item,cb){if("function"!=typeof cb)throw new TypeError("cb must be a function");var key=item.key,value=item.value;if(value instanceof Uint8Array&&(value=new Buffer(value)),"binary"===this._options.keyEncoding&&Array.isArray(key)&&(key=new Buffer(key)),"binary"!==this._options.valueEncoding||Buffer.isBuffer(value)||(value=new Buffer(value)),this._options.keyAsBuffer&&!Buffer.isBuffer(key))if(null==key)key=new Buffer(0);else if("string"==typeof key)key=new Buffer(key);else if("boolean"==typeof key)key=new Buffer(String(key));else if("number"==typeof key)key=new Buffer(String(key));else if(Array.isArray(key))key=new Buffer(String(key));else{if(!(key instanceof Uint8Array))throw new TypeError("can't coerce `"+key.constructor.name+"` into a Buffer");key=new Buffer(key)} -if(this._options.valueAsBuffer&&!Buffer.isBuffer(value))if(null==value)value=new Buffer(0);else if("string"==typeof value)value=new Buffer(value);else if("boolean"==typeof value)value=new Buffer(String(value));else if("number"==typeof value)value=new Buffer(String(value));else if(Array.isArray(value))value=new Buffer(String(value));else{if(!(value instanceof Uint8Array))throw new TypeError("can't coerce `"+value.constructor.name+"` into a Buffer");value=new Buffer(value)}cb(null,key,value)},Iterator.prototype._next=function(callback){if(this._callback)throw new Error("callback already exists");if(this._keyRangeError||0===this._limit)return void callback();var readNext=this._readNext;this._readNext=!1,readNext?process.nextTick(function(){readNext(callback)}):this._callback=callback}}).call(exports,__webpack_require__(0).Buffer,__webpack_require__(5))},function(module,exports,__webpack_require__){function isLevelDOWN(db){return!(!db||"object"!=typeof db)&&Object.keys(AbstractLevelDOWN.prototype).filter(function(name){return"_"!=name[0]&&"approximateSize"!=name}).every(function(name){return"function"==typeof db[name]})}var AbstractLevelDOWN=__webpack_require__(215);module.exports=isLevelDOWN},function(module,exports,__webpack_require__){function Batch(levelup,codec){this._levelup=levelup,this._codec=codec,this.batch=levelup.db.batch(),this.ops=[],this.length=0}var util=__webpack_require__(217),WriteError=__webpack_require__(87).WriteError,getOptions=util.getOptions,dispatchError=util.dispatchError;Batch.prototype.put=function(key_,value_,options){options=getOptions(options);var key=this._codec.encodeKey(key_,options),value=this._codec.encodeValue(value_,options);try{this.batch.put(key,value)}catch(e){throw new WriteError(e)}return this.ops.push({type:"put",key:key,value:value}),this.length++,this},Batch.prototype.del=function(key_,options){options=getOptions(options);var key=this._codec.encodeKey(key_,options);try{this.batch.del(key)}catch(err){throw new WriteError(err)}return this.ops.push({type:"del",key:key}),this.length++,this},Batch.prototype.clear=function(){try{this.batch.clear()}catch(err){throw new WriteError(err)}return this.ops=[],this.length=0,this},Batch.prototype.write=function(callback){var levelup=this._levelup,ops=this.ops;try{this.batch.write(function(err){if(err)return dispatchError(levelup,new WriteError(err),callback);levelup.emit("batch",ops),callback&&callback()})}catch(err){throw new WriteError(err)}},module.exports=Batch},function(module,exports,__webpack_require__){(function(process){function getCallback(options,callback){return"function"==typeof options?options:callback}function LevelUP(location,options,callback){if(!(this instanceof LevelUP))return new LevelUP(location,options,callback);var error;if(EventEmitter.call(this),this.setMaxListeners(1/0),"function"==typeof location?(options="object"==typeof options?options:{},options.db=location,location=null):"object"==typeof location&&"function"==typeof location.db&&(options=location,location=null),"function"==typeof options&&(callback=options,options={}),(!options||"function"!=typeof options.db)&&"string"!=typeof location){if(error=new InitializationError("Must provide a location for the database"),callback)return process.nextTick(function(){callback(error)});throw error}options=getOptions(options),this.options=extend(defaultOptions,options),this._codec=new Codec(this.options),this._status="new",prr(this,"location",location,"e"),this.open(callback)}function maybeError(db,options,callback){if(!db._isOpening()&&!db.isOpen())return dispatchError(db,new ReadError("Database is not open"),callback),!0}function writeError(db,message,callback){dispatchError(db,new WriteError(message),callback)}function readError(db,message,callback){dispatchError(db,new ReadError(message),callback)}function utilStatic(name){return function(location,callback){getLevelDOWN()[name](location,callback||function(){})}}var EventEmitter=__webpack_require__(11).EventEmitter,inherits=__webpack_require__(32).inherits,deprecate=__webpack_require__(32).deprecate,extend=__webpack_require__(38),prr=__webpack_require__(593),DeferredLevelDOWN=__webpack_require__(334),IteratorStream=__webpack_require__(463),Batch=__webpack_require__(469),Codec=__webpack_require__(461),getLevelDOWN=__webpack_require__(713),errors=__webpack_require__(87),util=__webpack_require__(217),WriteError=errors.WriteError,ReadError=errors.ReadError,NotFoundError=errors.NotFoundError,OpenError=errors.OpenError,EncodingError=errors.EncodingError,InitializationError=errors.InitializationError,LevelUPError=errors.LevelUPError,getOptions=util.getOptions,defaultOptions=util.defaultOptions,dispatchError=util.dispatchError;inherits(LevelUP,EventEmitter),LevelUP.prototype.open=function(callback){var dbFactory,db,self=this;if(this.isOpen())return callback&&process.nextTick(function(){callback(null,self)}),this;if(this._isOpening())return callback&&this.once("open",function(){callback(null,self)});if(this.emit("opening"),this._status="opening",this.db=new DeferredLevelDOWN(this.location),"function"!=typeof this.options.db&&"function"!=typeof getLevelDOWN)throw new LevelUPError("missing db factory, you need to set options.db");dbFactory=this.options.db||getLevelDOWN(),db=dbFactory(this.location),db.open(this.options,function(err){if(err)return dispatchError(self,new OpenError(err),callback);self.db.setDb(db),self.db=db,self._status="open",callback&&callback(null,self),self.emit("open"),self.emit("ready")})},LevelUP.prototype.close=function(callback){var self=this;if(this.isOpen())this._status="closing",this.db.close(function(){self._status="closed",self.emit("closed"),callback&&callback.apply(null,arguments)}),this.emit("closing"),this.db=new DeferredLevelDOWN(this.location);else{if("closed"===this._status&&callback)return process.nextTick(callback);"closing"===this._status&&callback?this.once("closed",callback):this._isOpening()&&this.once("open",function(){self.close(callback)})}},LevelUP.prototype.isOpen=function(){return"open"===this._status},LevelUP.prototype._isOpening=function(){return"opening"===this._status},LevelUP.prototype.isClosed=function(){return/^clos/.test(this._status)},LevelUP.prototype.get=function(key_,options,callback){var key,self=this;if(callback=getCallback(options,callback),!maybeError(this,options,callback)){if(null===key_||void 0===key_||"function"!=typeof callback)return readError(this,"get() requires key and callback arguments",callback);options=util.getOptions(options),key=this._codec.encodeKey(key_,options),options.asBuffer=this._codec.valueAsBuffer(options),this.db.get(key,options,function(err,value){if(err)return err=/notfound/i.test(err)||err.notFound?new NotFoundError("Key not found in database ["+key_+"]",err):new ReadError(err),dispatchError(self,err,callback);if(callback){try{value=self._codec.decodeValue(value,options)}catch(e){return callback(new EncodingError(e))}callback(null,value)}})}},LevelUP.prototype.put=function(key_,value_,options,callback){var key,value,self=this;if(callback=getCallback(options,callback),null===key_||void 0===key_)return writeError(this,"put() requires a key argument",callback);maybeError(this,options,callback)||(options=getOptions(options),key=this._codec.encodeKey(key_,options),value=this._codec.encodeValue(value_,options),this.db.put(key,value,options,function(err){if(err)return dispatchError(self,new WriteError(err),callback);self.emit("put",key_,value_),callback&&callback()}))},LevelUP.prototype.del=function(key_,options,callback){var key,self=this;if(callback=getCallback(options,callback),null===key_||void 0===key_)return writeError(this,"del() requires a key argument",callback);maybeError(this,options,callback)||(options=getOptions(options),key=this._codec.encodeKey(key_,options),this.db.del(key,options,function(err){if(err)return dispatchError(self,new WriteError(err),callback);self.emit("del",key_),callback&&callback()}))},LevelUP.prototype.batch=function(arr_,options,callback){var arr,self=this;return arguments.length?(callback=getCallback(options,callback),Array.isArray(arr_)?void(maybeError(this,options,callback)||(options=getOptions(options),arr=self._codec.encodeBatch(arr_,options),arr=arr.map(function(op){return op.type||void 0===op.key||void 0===op.value||(op.type="put"),op}),this.db.batch(arr,options,function(err){if(err)return dispatchError(self,new WriteError(err),callback);self.emit("batch",arr_),callback&&callback()}))):writeError(this,"batch() requires an array argument",callback)):new Batch(this,this._codec)},LevelUP.prototype.approximateSize=deprecate(function(start_,end_,options,callback){var start,end,self=this;if(callback=getCallback(options,callback),options=getOptions(options),null===start_||void 0===start_||null===end_||void 0===end_||"function"!=typeof callback)return readError(this,"approximateSize() requires start, end and callback arguments",callback);start=this._codec.encodeKey(start_,options),end=this._codec.encodeKey(end_,options),this.db.approximateSize(start,end,function(err,size){if(err)return dispatchError(self,new OpenError(err),callback);callback&&callback(null,size)})},"db.approximateSize() is deprecated. Use db.db.approximateSize() instead"),LevelUP.prototype.readStream=LevelUP.prototype.createReadStream=function(options){return options=extend({keys:!0,values:!0},this.options,options),options.keyEncoding=options.keyEncoding,options.valueEncoding=options.valueEncoding,options=this._codec.encodeLtgt(options),options.keyAsBuffer=this._codec.keyAsBuffer(options),options.valueAsBuffer=this._codec.valueAsBuffer(options),"number"!=typeof options.limit&&(options.limit=-1),new IteratorStream(this.db.iterator(options),extend(options,{decoder:this._codec.createStreamDecoder(options)}))},LevelUP.prototype.keyStream=LevelUP.prototype.createKeyStream=function(options){return this.createReadStream(extend(options,{keys:!0,values:!1}))},LevelUP.prototype.valueStream=LevelUP.prototype.createValueStream=function(options){return this.createReadStream(extend(options,{keys:!1,values:!0}))},LevelUP.prototype.toString=function(){return"LevelUP"},module.exports=LevelUP,module.exports.errors=__webpack_require__(87),module.exports.destroy=deprecate(utilStatic("destroy"),"levelup.destroy() is deprecated. Use leveldown.destroy() instead"),module.exports.repair=deprecate(utilStatic("repair"),"levelup.repair() is deprecated. Use leveldown.repair() instead")}).call(exports,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";const secp256k1=__webpack_require__(644),multihashing=__webpack_require__(21),setImmediate=__webpack_require__(10),HASH_ALGORITHM="sha2-256";module.exports=(randomBytes=>{function generateKey(callback){const done=(err,res)=>setImmediate(()=>callback(err,res));let privateKey;do{privateKey=randomBytes(32)}while(!secp256k1.privateKeyVerify(privateKey));done(null,privateKey)}function hashAndSign(key,msg,callback){const done=(err,res)=>setImmediate(()=>callback(err,res));multihashing.digest(msg,HASH_ALGORITHM,(err,digest)=>{if(err)return done(err);try{const sig=secp256k1.sign(digest,key),sigDER=secp256k1.signatureExport(sig.signature);return done(null,sigDER)}catch(err){done(err)}})}function hashAndVerify(key,sig,msg,callback){const done=(err,res)=>setImmediate(()=>callback(err,res));multihashing.digest(msg,HASH_ALGORITHM,(err,digest)=>{if(err)return done(err);try{sig=secp256k1.signatureImport(sig);const valid=secp256k1.verify(digest,sig,key);return done(null,valid)}catch(err){done(err)}})}function compressPublicKey(key){if(!secp256k1.publicKeyVerify(key))throw new Error("Invalid public key");return secp256k1.publicKeyConvert(key,!0)}function decompressPublicKey(key){return secp256k1.publicKeyConvert(key,!1)}function validatePrivateKey(key){if(!secp256k1.privateKeyVerify(key))throw new Error("Invalid private key")}function validatePublicKey(key){if(!secp256k1.publicKeyVerify(key))throw new Error("Invalid public key")}function computePublicKey(privateKey){return validatePrivateKey(privateKey),secp256k1.publicKeyCreate(privateKey)}return{generateKey:generateKey,privateKeyLength:32,hashAndSign:hashAndSign,hashAndVerify:hashAndVerify,compressPublicKey:compressPublicKey,decompressPublicKey:decompressPublicKey,validatePrivateKey:validatePrivateKey,validatePublicKey:validatePublicKey,computePublicKey:computePublicKey}})},function(module,exports,__webpack_require__){"use strict";const multihashing=__webpack_require__(21);module.exports=((keysProtobuf,randomBytes,crypto)=>{function unmarshalSecp256k1PrivateKey(bytes,callback){callback(null,new Secp256k1PrivateKey(bytes),null)}function unmarshalSecp256k1PublicKey(bytes){return new Secp256k1PublicKey(bytes)}function generateKeyPair(_bits,callback){void 0===callback&&"function"==typeof _bits&&(callback=_bits),ensure(callback),crypto.generateKey((err,privateKeyBytes)=>{if(err)return callback(err);let privkey;try{privkey=new Secp256k1PrivateKey(privateKeyBytes)}catch(err){return callback(err)}callback(null,privkey)})}function ensure(callback){if("function"!=typeof callback)throw new Error("callback is required")}crypto=crypto||__webpack_require__(471)(randomBytes);class Secp256k1PublicKey{constructor(key){crypto.validatePublicKey(key),this._key=key}verify(data,sig,callback){ensure(callback),crypto.hashAndVerify(this._key,sig,data,callback)}marshal(){return crypto.compressPublicKey(this._key)}get bytes(){return keysProtobuf.PublicKey.encode({Type:keysProtobuf.KeyType.Secp256k1,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}class Secp256k1PrivateKey{constructor(key,publicKey){this._key=key,this._publicKey=publicKey||crypto.computePublicKey(key),crypto.validatePrivateKey(this._key),crypto.validatePublicKey(this._publicKey)}sign(message,callback){ensure(callback),crypto.hashAndSign(this._key,message,callback)}get public(){return new Secp256k1PublicKey(this._publicKey)}marshal(){return this._key}get bytes(){return keysProtobuf.PrivateKey.encode({Type:keysProtobuf.KeyType.Secp256k1,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}return{Secp256k1PublicKey:Secp256k1PublicKey,Secp256k1PrivateKey:Secp256k1PrivateKey,unmarshalSecp256k1PrivateKey:unmarshalSecp256k1PrivateKey,unmarshalSecp256k1PublicKey:unmarshalSecp256k1PublicKey,generateKeyPair:generateKeyPair}})},function(module,exports,__webpack_require__){"use strict";const crypto=__webpack_require__(316);module.exports={createCipheriv:crypto.createCipheriv,createDecipheriv:crypto.createDecipheriv}},function(module,exports,__webpack_require__){"use strict";const ciphers=__webpack_require__(473),CIPHER_MODES={16:"aes-128-ctr",32:"aes-256-ctr"};exports.create=function(key,iv,callback){const mode=CIPHER_MODES[key.length];if(!mode)return callback(new Error("Invalid key length"));const cipher=ciphers.createCipheriv(mode,key,iv),decipher=ciphers.createDecipheriv(mode,key,iv);callback(null,{encrypt(data,cb){cb(null,cipher.update(data))},decrypt(data,cb){cb(null,decipher.update(data))}})}},function(module,exports,__webpack_require__){"use strict";module.exports={SHA1:20,SHA256:32,SHA512:64}},function(module,exports,__webpack_require__){"use strict";function marshalPublicKey(jwk){const byteLen=curveLengths[jwk.crv];return Buffer.concat([Buffer.from([4]),toBn(jwk.x).toArrayLike(Buffer,"be",byteLen),toBn(jwk.y).toArrayLike(Buffer,"be",byteLen)],1+2*byteLen)}function unmarshalPublicKey(curve,key){const byteLen=curveLengths[curve];if(!key.slice(0,1).equals(Buffer.from([4])))throw new Error("Invalid key format");const x=new BN(key.slice(1,byteLen+1)),y=new BN(key.slice(1+byteLen));return{kty:"EC",crv:curve,x:toBase64(x,byteLen),y:toBase64(y,byteLen),ext:!0}}function unmarshalPrivateKey(curve,key){const result=unmarshalPublicKey(curve,key.public);return result.d=toBase64(new BN(key.private)),result}const webcrypto=__webpack_require__(124)(),nodeify=__webpack_require__(92),BN=__webpack_require__(46).bignum,Buffer=__webpack_require__(6).Buffer,util=__webpack_require__(221),toBase64=util.toBase64,toBn=util.toBn,bits={"P-256":256,"P-384":384,"P-521":521};exports.generateEphmeralKeyPair=function(curve,callback){nodeify(webcrypto.subtle.generateKey({name:"ECDH",namedCurve:curve},!0,["deriveBits"]).then(pair=>{const genSharedKey=(theirPub,forcePrivate,cb)=>{"function"==typeof forcePrivate&&(cb=forcePrivate,forcePrivate=void 0);let privateKey;privateKey=forcePrivate?webcrypto.subtle.importKey("jwk",unmarshalPrivateKey(curve,forcePrivate),{name:"ECDH",namedCurve:curve},!1,["deriveBits"]):Promise.resolve(pair.privateKey),nodeify(Promise.all([webcrypto.subtle.importKey("jwk",unmarshalPublicKey(curve,theirPub),{name:"ECDH",namedCurve:curve},!1,[]),privateKey]).then(keys=>webcrypto.subtle.deriveBits({name:"ECDH",namedCurve:curve,public:keys[0]},keys[1],bits[curve])).then(bits=>Buffer.from(bits)),cb)};return webcrypto.subtle.exportKey("jwk",pair.publicKey).then(publicKey=>{return{key:marshalPublicKey(publicKey),genSharedKey:genSharedKey}})}),callback)};const curveLengths={"P-256":32,"P-384":48,"P-521":66}},function(module,exports,__webpack_require__){"use strict";function unmarshalEd25519PrivateKey(bytes,callback){try{bytes=ensureKey(bytes,crypto.privateKeyLength+crypto.publicKeyLength)}catch(err){return callback(err)}callback(null,new Ed25519PrivateKey(bytes.slice(0,crypto.privateKeyLength),bytes.slice(crypto.privateKeyLength,bytes.length)))}function unmarshalEd25519PublicKey(bytes){return bytes=ensureKey(bytes,crypto.publicKeyLength),new Ed25519PublicKey(bytes)}function generateKeyPair(_bits,cb){void 0===cb&&"function"==typeof _bits&&(cb=_bits),crypto.generateKey((err,keys)=>{if(err)return cb(err);let privkey;try{privkey=new Ed25519PrivateKey(keys.secretKey,keys.publicKey)}catch(err){return void cb(err)}cb(null,privkey)})}function generateKeyPairFromSeed(seed,_bits,cb){void 0===cb&&"function"==typeof _bits&&(cb=_bits),crypto.generateKeyFromSeed(seed,(err,keys)=>{if(err)return cb(err);let privkey;try{privkey=new Ed25519PrivateKey(keys.secretKey,keys.publicKey)}catch(err){return void cb(err)}cb(null,privkey)})}function ensure(cb){if("function"!=typeof cb)throw new Error("callback is required")}function ensureKey(key,length){if(Buffer.isBuffer(key)&&(key=new Uint8Array(key)),!(key instanceof Uint8Array)||key.length!==length)throw new Error("Key must be a Uint8Array or Buffer of length "+length);return key}const multihashing=__webpack_require__(21),protobuf=__webpack_require__(31),Buffer=__webpack_require__(6).Buffer,crypto=__webpack_require__(478),pbm=protobuf(__webpack_require__(123));class Ed25519PublicKey{constructor(key){this._key=ensureKey(key,crypto.publicKeyLength)}verify(data,sig,callback){ensure(callback),crypto.hashAndVerify(this._key,sig,data,callback)}marshal(){return Buffer.from(this._key)}get bytes(){return pbm.PublicKey.encode({Type:pbm.KeyType.Ed25519,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}class Ed25519PrivateKey{constructor(key,publicKey){this._key=ensureKey(key,crypto.privateKeyLength),this._publicKey=ensureKey(publicKey,crypto.publicKeyLength)}sign(message,callback){ensure(callback),crypto.hashAndSign(this._key,message,callback)}get public(){if(!this._publicKey)throw new Error("public key not provided");return new Ed25519PublicKey(this._publicKey)}marshal(){return Buffer.concat([Buffer.from(this._key),Buffer.from(this._publicKey)])}get bytes(){return pbm.PrivateKey.encode({Type:pbm.KeyType.Ed25519,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}module.exports={Ed25519PublicKey:Ed25519PublicKey,Ed25519PrivateKey:Ed25519PrivateKey,unmarshalEd25519PrivateKey:unmarshalEd25519PrivateKey,unmarshalEd25519PublicKey:unmarshalEd25519PublicKey,generateKeyPair:generateKeyPair,generateKeyPairFromSeed:generateKeyPairFromSeed}},function(module,exports,__webpack_require__){"use strict";const nacl=__webpack_require__(670),setImmediate=__webpack_require__(10),Buffer=__webpack_require__(6).Buffer;exports.publicKeyLength=nacl.sign.publicKeyLength,exports.privateKeyLength=nacl.sign.secretKeyLength,exports.generateKey=function(callback){const done=(err,res)=>setImmediate(()=>{callback(err,res)});let keys;try{keys=nacl.sign.keyPair()}catch(err){return done(err)}done(null,keys)},exports.generateKeyFromSeed=function(seed,callback){const done=(err,res)=>setImmediate(()=>callback(err,res));let keys;try{keys=nacl.sign.keyPair.fromSeed(seed)}catch(err){return done(err)}done(null,keys)},exports.hashAndSign=function(key,msg,callback){setImmediate(()=>{callback(null,Buffer.from(nacl.sign.detached(msg,key)))})},exports.hashAndVerify=function(key,sig,msg,callback){setImmediate(()=>{callback(null,nacl.sign.detached.verify(msg,sig,key))})}},function(module,exports,__webpack_require__){"use strict";const ecdh=__webpack_require__(476);module.exports=((curve,callback)=>{ecdh.generateEphmeralKeyPair(curve,callback)})},function(module,exports,__webpack_require__){"use strict";function isValidKeyType(keyType){return void 0!==supportedKeys[keyType.toLowerCase()]}const protobuf=__webpack_require__(31),keysPBM=protobuf(__webpack_require__(123));exports=module.exports;const supportedKeys={rsa:__webpack_require__(482),ed25519:__webpack_require__(477),secp256k1:__webpack_require__(472)(keysPBM,__webpack_require__(220))};exports.supportedKeys=supportedKeys,exports.keysPBM=keysPBM,exports.keyStretcher=__webpack_require__(481),exports.generateEphemeralKeyPair=__webpack_require__(479),exports.generateKeyPair=((type,bits,cb)=>{let key=supportedKeys[type.toLowerCase()];if(!key)return cb(new Error("invalid or unsupported key type"));key.generateKeyPair(bits,cb)}),exports.generateKeyPairFromSeed=((type,seed,bits,cb)=>{let key=supportedKeys[type.toLowerCase()];return key?"ed25519"!==type.toLowerCase()?cb(new Error("Seed key derivation is unimplemented for RSA or secp256k1")):void key.generateKeyPairFromSeed(seed,bits,cb):cb(new Error("invalid or unsupported key type"))}),exports.unmarshalPublicKey=(buf=>{const decoded=keysPBM.PublicKey.decode(buf);switch(decoded.Type){case keysPBM.KeyType.RSA:return supportedKeys.rsa.unmarshalRsaPublicKey(decoded.Data);case keysPBM.KeyType.Ed25519:return supportedKeys.ed25519.unmarshalEd25519PublicKey(decoded.Data);case keysPBM.KeyType.Secp256k1:if(supportedKeys.secp256k1)return supportedKeys.secp256k1.unmarshalSecp256k1PublicKey(decoded.Data);throw new Error("secp256k1 support requires libp2p-crypto-secp256k1 package");default:throw new Error("invalid or unsupported key type")}}),exports.marshalPublicKey=((key,type)=>{if(type=(type||"rsa").toLowerCase(),!isValidKeyType(type))throw new Error("invalid or unsupported key type");return key.bytes}),exports.unmarshalPrivateKey=((buf,callback)=>{const decoded=keysPBM.PrivateKey.decode(buf);switch(decoded.Type){case keysPBM.KeyType.RSA:return supportedKeys.rsa.unmarshalRsaPrivateKey(decoded.Data,callback);case keysPBM.KeyType.Ed25519:return supportedKeys.ed25519.unmarshalEd25519PrivateKey(decoded.Data,callback);case keysPBM.KeyType.Secp256k1:return supportedKeys.secp256k1?supportedKeys.secp256k1.unmarshalSecp256k1PrivateKey(decoded.Data,callback):callback(new Error("secp256k1 support requires libp2p-crypto-secp256k1 package"));default:callback(new Error("invalid or unsupported key type"))}}),exports.marshalPrivateKey=((key,type)=>{if(type=(type||"rsa").toLowerCase(),!isValidKeyType(type))throw new Error("invalid or unsupported key type");return key.bytes})},function(module,exports,__webpack_require__){"use strict";const whilst=__webpack_require__(74),Buffer=__webpack_require__(6).Buffer,hmac=__webpack_require__(218),cipherMap={"AES-128":{ivSize:16,keySize:16},"AES-256":{ivSize:16,keySize:32},Blowfish:{ivSize:8,cipherKeySize:32}};module.exports=((cipherType,hash,secret,callback)=>{const cipher=cipherMap[cipherType];if(!cipher)return callback(new Error("unkown cipherType passed"));if(!hash)return callback(new Error("unkown hashType passed"));const cipherKeySize=cipher.keySize,ivSize=cipher.ivSize,seed=Buffer.from("key expansion"),resultLength=2*(ivSize+cipherKeySize+20);hmac.create(hash,secret,(err,m)=>{if(err)return callback(err);m.digest(seed,(err,a)=>{function stretch(cb){m.digest(Buffer.concat([a,seed]),(err,b)=>{if(err)return cb(err);let todo=b.length;j+todo>resultLength&&(todo=resultLength-j),result.push(b),j+=todo,m.digest(a,(err,_a)=>{if(err)return cb(err);a=_a,cb()})})}function finish(err){if(err)return callback(err);const half=resultLength/2,resultBuffer=Buffer.concat(result),r1=resultBuffer.slice(0,half),r2=resultBuffer.slice(half,resultLength),createKey=res=>({iv:res.slice(0,ivSize),cipherKey:res.slice(ivSize,ivSize+cipherKeySize),macKey:res.slice(ivSize+cipherKeySize)});callback(null,{k1:createKey(r1),k2:createKey(r2)})}if(err)return callback(err);let result=[],j=0;whilst(()=>j{if(err)return callback(err);callback(null,new RsaPrivateKey(keys.privateKey,keys.publicKey))})}function unmarshalRsaPublicKey(bytes){return new RsaPublicKey(crypto.utils.pkixToJwk(bytes))}function generateKeyPair(bits,cb){crypto.generateKey(bits,(err,keys)=>{if(err)return cb(err);cb(null,new RsaPrivateKey(keys.privateKey,keys.publicKey))})}function ensure(cb){if("function"!=typeof cb)throw new Error("callback is required")}const multihashing=__webpack_require__(21),protobuf=__webpack_require__(31),crypto=__webpack_require__(219),pbm=protobuf(__webpack_require__(123));class RsaPublicKey{constructor(key){this._key=key}verify(data,sig,callback){ensure(callback),crypto.hashAndVerify(this._key,sig,data,callback)}marshal(){return crypto.utils.jwkToPkix(this._key)}get bytes(){return pbm.PublicKey.encode({Type:pbm.KeyType.RSA,Data:this.marshal()})}encrypt(bytes){return this._key.encrypt(bytes,"RSAES-PKCS1-V1_5")}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}class RsaPrivateKey{constructor(key,publicKey){this._key=key,this._publicKey=publicKey}genSecret(){return crypto.getRandomValues(new Uint8Array(16))}sign(message,callback){ensure(callback),crypto.hashAndSign(this._key,message,callback)}get public(){if(!this._publicKey)throw new Error("public key not provided");return new RsaPublicKey(this._publicKey)}decrypt(msg,callback){crypto.decrypt(this._key,msg,callback)}marshal(){return crypto.utils.jwkToPkcs1(this._key)}get bytes(){return pbm.PrivateKey.encode({Type:pbm.KeyType.RSA,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}module.exports={RsaPublicKey:RsaPublicKey,RsaPrivateKey:RsaPrivateKey,unmarshalRsaPublicKey:unmarshalRsaPublicKey,unmarshalRsaPrivateKey:unmarshalRsaPrivateKey,generateKeyPair:generateKeyPair}},function(module,exports,__webpack_require__){"use strict";const asn1=__webpack_require__(46),util=__webpack_require__(221),toBase64=util.toBase64,toBn=util.toBn,RSAPrivateKey=asn1.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}),AlgorithmIdentifier=asn1.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid({"1.2.840.113549.1.1.1":"rsa"}),this.key("none").optional().null_(),this.key("curve").optional().objid(),this.key("params").optional().seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()))}),PublicKey=asn1.define("RSAPublicKey",function(){this.seq().obj(this.key("algorithm").use(AlgorithmIdentifier),this.key("subjectPublicKey").bitstr())}),RSAPublicKey=asn1.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});exports.pkcs1ToJwk=function(bytes){const asn1=RSAPrivateKey.decode(bytes,"der");return{kty:"RSA",n:toBase64(asn1.modulus),e:toBase64(asn1.publicExponent),d:toBase64(asn1.privateExponent),p:toBase64(asn1.prime1),q:toBase64(asn1.prime2),dp:toBase64(asn1.exponent1),dq:toBase64(asn1.exponent2),qi:toBase64(asn1.coefficient),alg:"RS256",kid:"2011-04-29"}},exports.jwkToPkcs1=function(jwk){return RSAPrivateKey.encode({version:0,modulus:toBn(jwk.n),publicExponent:toBn(jwk.e),privateExponent:toBn(jwk.d),prime1:toBn(jwk.p),prime2:toBn(jwk.q),exponent1:toBn(jwk.dp),exponent2:toBn(jwk.dq),coefficient:toBn(jwk.qi)},"der")},exports.pkixToJwk=function(bytes){const ndata=PublicKey.decode(bytes,"der"),asn1=RSAPublicKey.decode(ndata.subjectPublicKey.data,"der");return{kty:"RSA",n:toBase64(asn1.modulus),e:toBase64(asn1.publicExponent),alg:"RS256",kid:"2011-04-29"}},exports.jwkToPkix=function(jwk){return PublicKey.encode({algorithm:{algorithm:"rsa",none:null},subjectPublicKey:{data:RSAPublicKey.encode({modulus:toBn(jwk.n),publicExponent:toBn(jwk.e)},"der")}},"der")}},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),log=debug("libp2p:floodsub");log.err=debug("libp2p:floodsub:error"),module.exports={log:log,multicodec:"/floodsub/1.0.0"}},function(module,exports,__webpack_require__){"use strict";const EventEmitter=__webpack_require__(11),TimeCache=__webpack_require__(667),values=__webpack_require__(129),pull=__webpack_require__(4),lp=__webpack_require__(23),assert=__webpack_require__(9),asyncEach=__webpack_require__(19),Peer=__webpack_require__(488),utils=__webpack_require__(489),pb=__webpack_require__(222),config=__webpack_require__(484),Buffer=__webpack_require__(6).Buffer,log=config.log,multicodec=config.multicodec,ensureArray=utils.ensureArray,setImmediate=__webpack_require__(10);class FloodSub extends EventEmitter{constructor(libp2p){super(),this.libp2p=libp2p,this.started=!1,this.cache=new TimeCache,this.peers=new Map,this.subscriptions=new Set,this._onConnection=this._onConnection.bind(this),this._dialPeer=this._dialPeer.bind(this)}_dialPeer(peerInfo,callback){callback=callback||function(){};const idB58Str=peerInfo.id.toB58String();log("dialing %s",idB58Str);const peer=this.peers.get(idB58Str);if(peer&&peer.isConnected)return setImmediate(()=>callback());this.libp2p.dial(peerInfo,multicodec,(err,conn)=>{if(err)return log.err(err),callback();this._onDial(peerInfo,conn,callback)})}_onDial(peerInfo,conn,callback){const idB58Str=peerInfo.id.toB58String();this.peers.has(idB58Str)||this.peers.set(idB58Str,new Peer(peerInfo));const peer=this.peers.get(idB58Str);peer.attachConnection(conn),peer.sendSubscriptions(this.subscriptions),setImmediate(()=>callback())}_onConnection(protocol,conn){conn.getPeerInfo((err,peerInfo)=>{if(err)return log.err("Failed to identify incomming conn",err),pull(pull.empty(),conn);const idB58Str=peerInfo.id.toB58String();this.peers.has(idB58Str)||(log("new peer",idB58Str),this.peers.set(idB58Str,new Peer(peerInfo))),this._processConnection(idB58Str,conn)})}_processConnection(idB58Str,conn){pull(conn,lp.decode(),pull.map(data=>pb.rpc.RPC.decode(data)),pull.drain(rpc=>this._onRpc(idB58Str,rpc),err=>this._onConnectionEnd(idB58Str,err)))}_onRpc(idB58Str,rpc){if(rpc){const subs=rpc.subscriptions,msgs=rpc.msgs;if(msgs&&msgs.length&&this._processRpcMessages(rpc.msgs),subs&&subs.length){const peer=this.peers.get(idB58Str);peer&&peer.updateSubscriptions(subs)}}}_processRpcMessages(msgs){msgs.forEach(msg=>{const seqno=utils.msgId(msg.from,msg.seqno.toString());this.cache.has(seqno)||(this.cache.put(seqno),this._emitMessages(msg.topicCIDs,[msg]),this._forwardMessages(msg.topicCIDs,[msg]))})} -_onConnectionEnd(idB58Str,err){err&&"socket hang up"!==err.message&&log.err(err),this.peers.delete(idB58Str)}_emitMessages(topics,messages){topics.forEach(topic=>{this.subscriptions.has(topic)&&messages.forEach(message=>{this.emit(topic,message)})})}_forwardMessages(topics,messages){this.peers.forEach(peer=>{peer.isWritable&&utils.anyMatch(peer.topics,topics)&&(peer.sendMessages(messages),log("publish msgs on topics",topics,peer.info.id.toB58String()))})}start(callback){if(this.started)return setImmediate(()=>callback(new Error("already started")));this.libp2p.handle(multicodec,this._onConnection),this.libp2p.on("peer:connect",this._dialPeer),asyncEach(values(this.libp2p.peerBook.getAll()),(peer,cb)=>this._dialPeer(peer,cb),err=>{setImmediate(()=>{this.started=!0,callback(err)})})}stop(callback){if(!this.started)return setImmediate(()=>callback(new Error("not started yet")));this.libp2p.unhandle(multicodec),this.libp2p.removeListener("peer:connect",this._dialPeer),asyncEach(this.peers.values(),(peer,cb)=>peer.close(cb),err=>{if(err)return callback(err);this.peers=new Map,this.started=!1,callback()})}publish(topics,messages){assert(this.started,"FloodSub is not started"),log("publish",topics,messages),topics=ensureArray(topics),messages=ensureArray(messages);const from=this.libp2p.peerInfo.id.toB58String(),buildMessage=msg=>{const seqno=utils.randomSeqno();return this.cache.put(utils.msgId(from,seqno)),{from:from,data:msg,seqno:new Buffer(seqno),topicCIDs:topics}},msgObjects=messages.map(buildMessage);this._emitMessages(topics,msgObjects),this._forwardMessages(topics,messages.map(buildMessage))}subscribe(topics){function checkIfReady(peer){peer&&peer.isWritable?peer.sendSubscriptions(topics):setImmediate(checkIfReady.bind(peer))}assert(this.started,"FloodSub is not started"),topics=ensureArray(topics),topics.forEach(topic=>this.subscriptions.add(topic)),this.peers.forEach(peer=>checkIfReady(peer))}unsubscribe(topics){function checkIfReady(peer){peer&&peer.isWritable?peer.sendUnsubscriptions(topics):setImmediate(checkIfReady.bind(peer))}assert(this.started,"FloodSub is not started"),topics=ensureArray(topics),topics.forEach(topic=>this.subscriptions.delete(topic)),this.peers.forEach(peer=>checkIfReady(peer))}}module.exports=FloodSub},function(module,exports,__webpack_require__){"use strict";module.exports=` +}`},function(module,exports,__webpack_require__){"use strict";const waterfall=__webpack_require__(6),util=__webpack_require__(124);exports=module.exports,exports.multicodec="dag-pb",exports.resolve=((block,path,callback)=>{waterfall([cb=>util.deserialize(block.data,cb),(node,cb)=>{const split=path.split("/");if("Links"===split[0]){let remainderPath="";if(!split[1])return cb(null,{value:node.links.map(l=>l.toJSON()),remainderPath:""});const values={};node.links.forEach((l,i)=>{const link=l.toJSON();values[i]={hash:link.multihash,name:link.name,size:link.size},values[link.name]=link.multihash});let value=values[split[1]];"Hash"===split[2]?value={"/":value.hash}:"Tsize"===split[2]?value={"/":value.size}:"Name"===split[2]&&(value={"/":value.name}),remainderPath=split.slice(3).join("/"),cb(null,{value:value,remainderPath:remainderPath})}else"Data"===split[0]?cb(null,{value:node.data,remainderPath:""}):cb(new Error("path not available"))}],callback)}),exports.tree=((block,options,callback)=>{"function"==typeof options&&(callback=options,options={}),options=options||{},util.deserialize(block.data,(err,node)=>{if(err)return callback(err);const paths=[];paths.push("Links"),node.links.forEach((link,i)=>{paths.push(`Links/${i}/Name`),paths.push(`Links/${i}/Tsize`),paths.push(`Links/${i}/Hash`)}),paths.push("Data"),callback(null,paths)})}),exports.isLink=((block,path,callback)=>{exports.resolve(block,path,(err,result)=>{return err?callback(err):result.remainderPath.length>0?callback(new Error("path out of scope")):void("object"==typeof result.value&&result.value["/"]?callback(null,result.value):callback(null,!1))})})},function(module,exports,__webpack_require__){"use strict";function mapFromEthObj(ethBlockList,options,callback){let paths=[];paths.push({path:"count",value:ethBlockList.length}),each(ethBlockList,(ethBlock,next)=>{const index=ethBlockList.indexOf(ethBlock),blockPath=index.toString();paths.push({path:blockPath,value:ethBlock}),ethBlockResolver._mapFromEthObject(ethBlock,{},(err,subpaths)=>{if(err)return next(err);subpaths.forEach(path=>path.path=blockPath+"/"+path.path),paths=paths.concat(subpaths),next()})},err=>{if(err)return callback(err);callback(null,paths)})}const waterfall=__webpack_require__(6),each=__webpack_require__(15),asyncify=__webpack_require__(73),RLP=__webpack_require__(46),EthBlockHead=__webpack_require__(189),multihash=__webpack_require__(22),ethBlockResolver=__webpack_require__(205).resolver,createResolver=__webpack_require__(66),cidFromHash=__webpack_require__(55),ethBlockListResolver=createResolver("eth-block-list",void 0,mapFromEthObj),util=ethBlockListResolver.util;util.serialize=asyncify(ethBlockList=>{const rawOmmers=ethBlockList.map(ethBlock=>ethBlock.raw);return RLP.encode(rawOmmers)}),util.deserialize=asyncify(serialized=>{return RLP.decode(serialized).map(rawBlock=>new EthBlockHead(rawBlock))}),util.cid=((blockList,callback)=>{waterfall([cb=>util.serialize(blockList,cb),(data,cb)=>multihash.digest(data,"keccak-256",cb),asyncify(mhash=>cidFromHash("eth-block-list",mhash))],callback)}),module.exports=ethBlockListResolver},function(module,exports,__webpack_require__){"use strict";const ethAccountSnapshotResolver=__webpack_require__(204),createTrieResolver=__webpack_require__(125),ethStateTrieResolver=createTrieResolver("eth-state-trie",ethAccountSnapshotResolver);module.exports=ethStateTrieResolver},function(module,exports,__webpack_require__){"use strict";const createTrieResolver=__webpack_require__(125),ethStorageTrieResolver=createTrieResolver("eth-storage-trie");module.exports=ethStorageTrieResolver},function(module,exports,__webpack_require__){"use strict";const ethTxResolver=__webpack_require__(206),createTrieResolver=__webpack_require__(125),ethTxTrieResolver=createTrieResolver("eth-tx-trie",ethTxResolver);module.exports=ethTxTrieResolver},function(module,exports){function isExternalLink(obj){return Boolean(obj["/"])}module.exports=isExternalLink},function(module,exports,__webpack_require__){function toIpfsBlock(multicodec,value,callback){multihashing(value,"keccak-256",(err,hash)=>{if(err)return callback(err);callback(null,new IpfsBlock(value,new CID(1,multicodec,hash)))})}const IpfsBlock=__webpack_require__(65),CID=__webpack_require__(8),multihashing=__webpack_require__(22);module.exports=toIpfsBlock},function(module,exports,__webpack_require__){"use strict";(function(setImmediate){function noop(){}const Block=__webpack_require__(65),pull=__webpack_require__(4),CID=__webpack_require__(8),doUntil=__webpack_require__(294),IPFSRepo=__webpack_require__(200),BlockService=__webpack_require__(199),joinPath=__webpack_require__(44).join,pullDeferSource=__webpack_require__(99).source,pullTraverse=__webpack_require__(265),map=__webpack_require__(61),series=__webpack_require__(32),waterfall=__webpack_require__(6),MemoryStore=__webpack_require__(16).MemoryDatastore,dagPB=__webpack_require__(54),dagCBOR=__webpack_require__(440),ipldEthAccountSnapshot=__webpack_require__(43).ethAccountSnapshot,ipldEthBlock=__webpack_require__(43).ethBlock,ipldEthBlockList=__webpack_require__(43).ethBlockList,ipldEthStateTrie=__webpack_require__(43).ethStateTrie,ipldEthStorageTrie=__webpack_require__(43).ethStorageTrie,ipldEthTx=__webpack_require__(43).ethTx,ipldEthTxTrie=__webpack_require__(43).ethTxTrie;class IPLDResolver{constructor(blockService){if(!blockService)throw new Error("Missing blockservice");this.bs=blockService,this.resolvers={},this.support={},this.support.add=((multicodec,resolver,util)=>{if(this.resolvers[multicodec])throw new Error(multicodec+"already supported");this.resolvers[multicodec]={resolver:resolver,util:util}}),this.support.rm=(multicodec=>{this.resolvers[multicodec]&&delete this.resolvers[multicodec]}),this.support.add(dagPB.resolver.multicodec,dagPB.resolver,dagPB.util),this.support.add(dagCBOR.resolver.multicodec,dagCBOR.resolver,dagCBOR.util),this.support.add(ipldEthAccountSnapshot.resolver.multicodec,ipldEthAccountSnapshot.resolver,ipldEthAccountSnapshot.util),this.support.add(ipldEthBlock.resolver.multicodec,ipldEthBlock.resolver,ipldEthBlock.util),this.support.add(ipldEthBlockList.resolver.multicodec,ipldEthBlockList.resolver,ipldEthBlockList.util),this.support.add(ipldEthStateTrie.resolver.multicodec,ipldEthStateTrie.resolver,ipldEthStateTrie.util),this.support.add(ipldEthStorageTrie.resolver.multicodec,ipldEthStorageTrie.resolver,ipldEthStorageTrie.util),this.support.add(ipldEthTx.resolver.multicodec,ipldEthTx.resolver,ipldEthTx.util),this.support.add(ipldEthTxTrie.resolver.multicodec,ipldEthTxTrie.resolver,ipldEthTxTrie.util)}get(cid,path,options,callback){if("function"==typeof path&&(callback=path,path=void 0),"function"==typeof options&&(callback=options,options={}),"string"==typeof path&&(path=joinPath("/",path).substr(1)),""===path||!path)return this._get(cid,(err,node)=>{if(err)return callback(err);callback(null,{value:node,remainderPath:""})});let value;doUntil(cb=>{this.bs.get(cid,(err,block)=>{if(err)return cb(err);this.resolvers[cid.codec].resolver.resolve(block,path,(err,result)=>{if(err)return cb(err);value=result.value,path=result.remainderPath,cb()})})},()=>{const endReached=!path||""===path||"/"===path,isTerminal=value&&!value["/"];return!!(endReached&&isTerminal||options.localResolve)||(value&&(cid=new CID(value["/"])),!1)},(err,results)=>{return err?callback(err):callback(null,{value:value,remainderPath:path})})}getStream(cid,path,options){const deferred=pullDeferSource();return this.get(cid,path,options,(err,result)=>{if(err)return deferred.resolve(pull.error(err));deferred.resolve(pull.values([result]))}),deferred}put(node,options,callback){return"function"==typeof options?setImmediate(()=>callback(new Error("no options were passed"))):(callback=callback||noop,options.cid&&CID.isCID(options.cid)?this._put(options.cid,node,callback):(options.hashAlg=options.hashAlg||"sha2-256",void this.resolvers[options.format].util.cid(node,(err,cid)=>{if(err)return callback(err);this._put(cid,node,callback)})))}treeStream(cid,path,options){"object"==typeof path&&(options=path,path=void 0),options=options||{};let p;if(!options.recursive){p=pullDeferSource();const r=this.resolvers[cid.codec];waterfall([cb=>this.bs.get(cid,cb),(block,cb)=>r.resolver.tree(block,cb)],(err,paths)=>{if(err)return p.abort(err);p.resolve(pull.values(paths))})}return options.recursive&&(p=pull(pullTraverse.widthFirst({basePath:null,cid:cid},el=>{if("string"==typeof el)return pull.empty();const deferred=pullDeferSource(),r=this.resolvers[el.cid.codec];return waterfall([cb=>this.bs.get(el.cid,cb),(block,cb)=>r.resolver.tree(block,(err,paths)=>{if(err)return cb(err);map(paths,(p,cb)=>{r.resolver.isLink(block,p,(err,link)=>{if(err)return cb(err);cb(null,{path:p,link:link})})},cb)})],(err,paths)=>{if(err)return deferred.abort(err);deferred.resolve(pull.values(paths.map(p=>{const base=el.basePath?el.basePath+"/"+p.path:p.path;return p.link?{basePath:base,cid:new CID(p.link["/"])}:base})))}),deferred}),pull.map(e=>{return"string"==typeof e?e:e.basePath}),pull.filter(Boolean))),path?pull(p,pull.map(el=>{if(0===el.indexOf(path))return el=el.slice(path.length+1)}),pull.filter(Boolean)):p}remove(cids,callback){this.bs.delete(cids,callback)}_get(cid,callback){const r=this.resolvers[cid.codec];waterfall([cb=>this.bs.get(cid,cb),(block,cb)=>{r?r.util.deserialize(block.data,(err,deserialized)=>{if(err)return cb(err);cb(null,deserialized)}):cb(null,block.data)}],callback)}_put(cid,node,callback){callback=callback||noop;const r=this.resolvers[cid.codec];waterfall([cb=>r.util.serialize(node,cb),(buf,cb)=>this.bs.put(new Block(buf,cid),cb)],err=>{if(err)return callback(err);callback(null,cid)})}}IPLDResolver.inMemory=function(callback){const repo=new IPFSRepo("in-memory",{storageBackends:{root:MemoryStore,blocks:MemoryStore,datastore:MemoryStore},lock:"memory"}),blockService=new BlockService(repo);series([cb=>repo.init({},cb),cb=>repo.open(cb)],err=>{if(err)return callback(err);callback(null,new IPLDResolver(blockService))})},module.exports=IPLDResolver}).call(exports,__webpack_require__(38).setImmediate)},function(module,exports){function isCircular(obj){return new CircularChecker(obj).isCircular()}function CircularChecker(obj){this.obj=obj}module.exports=isCircular,CircularChecker.prototype.isCircular=function(obj,seen){if(obj=obj||this.obj,seen=seen||[],!(obj instanceof Object))throw new TypeError('"obj" must be an object (or inherit from it)');var self=this;seen.push(obj);for(var key in obj){var val=obj[key];if(val instanceof Object&&(~seen.indexOf(val)||self.isCircular(val,seen.slice())))return!0}return!1}},function(module,exports,__webpack_require__){"use strict";function isProperty(str){return/^[$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(str)}module.exports=isProperty},function(module,exports,__webpack_require__){"use strict";var isStream=module.exports=function(stream){return null!==stream&&"object"==typeof stream&&"function"==typeof stream.pipe};isStream.writable=function(stream){return isStream(stream)&&stream.writable!==!1&&"function"==typeof stream._write&&"object"==typeof stream._writableState},isStream.readable=function(stream){return isStream(stream)&&stream.readable!==!1&&"function"==typeof stream._read&&"object"==typeof stream._readableState},isStream.duplex=function(stream){return isStream.writable(stream)&&isStream.readable(stream)},isStream.transform=function(stream){return isStream.duplex(stream)&&"function"==typeof stream._transform&&"object"==typeof stream._transformState}},function(module,exports,__webpack_require__){(function(process,global){!function(){"use strict";function Keccak(bits,padding,outputBits){this.blocks=[],this.s=[],this.padding=padding,this.outputBits=outputBits,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(bits<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=outputBits>>5,this.extraBytes=(31&outputBits)>>3;for(var i=0;i<50;++i)this.s[i]=0}function Kmac(bits,padding,outputBits){Keccak.call(this,bits,padding,outputBits)}var root="object"==typeof window?window:{};!root.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(root=global);var COMMON_JS=!root.JS_SHA3_NO_COMMON_JS&&"object"==typeof module&&module.exports,ARRAY_BUFFER=!root.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),SHAKE_PADDING=[31,7936,2031616,520093696],CSHAKE_PADDING=[4,1024,262144,67108864],KECCAK_PADDING=[1,256,65536,16777216],PADDING=[6,1536,393216,100663296],SHIFT=[0,8,16,24],RC=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],BITS=[224,256,384,512],SHAKE_BITS=[128,256],OUTPUT_TYPES=["hex","buffer","arrayBuffer","array"],CSHAKE_BYTEPAD={128:168,256:136};!root.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(obj){return"[object Array]"===Object.prototype.toString.call(obj)});for(var createOutputMethod=function(bits,padding,outputType){return function(message){return new Keccak(bits,padding,bits).update(message)[outputType]()}},createShakeOutputMethod=function(bits,padding,outputType){return function(message,outputBits){return new Keccak(bits,padding,outputBits).update(message)[outputType]()}},createCshakeOutputMethod=function(bits,padding,outputType){return function(message,outputBits,n,s){return methods["cshake"+bits].update(message,outputBits,n,s)[outputType]()}},createKmacOutputMethod=function(bits,padding,outputType){return function(key,message,outputBits,s){return methods["kmac"+bits].update(key,message,outputBits,s)[outputType]()}},createOutputMethods=function(method,createMethod,bits,padding){for(var i=0;i>2]|=message[index]<>2]|=code<>2]|=(192|code>>6)<>2]|=(128|63&code)<=57344?(blocks[i>>2]|=(224|code>>12)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<>2]|=(240|code>>18)<>2]|=(128|code>>12&63)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<=byteCount){for(this.start=i-byteCount,this.block=blocks[blockCount],i=0;i>=8,o=255&x;o>0;)bytes.unshift(o),x>>=8,o=255&x,++n;return right?bytes.push(n):bytes.unshift(n),this.update(bytes),bytes.length},Keccak.prototype.encodeString=function(str){str=str||"";var notString="string"!=typeof str;notString&&str.constructor===root.ArrayBuffer&&(str=new Uint8Array(str));var length=str.length;if(notString&&("number"!=typeof length||!Array.isArray(str)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(str))))throw"input is invalid type";var bytes=0;if(notString)bytes=length;else for(var i=0;i=57344?bytes+=3:(code=65536+((1023&code)<<10|1023&str.charCodeAt(++i)),bytes+=4)}return bytes+=this.encode(8*bytes),this.update(str),bytes},Keccak.prototype.bytepad=function(strs,w){for(var bytes=this.encode(w),i=0;i>2]|=this.padding[3&i],this.lastByteIndex===this.byteCount)for(blocks[0]=blocks[blockCount],i=1;i>4&15]+HEX_CHARS[15&block]+HEX_CHARS[block>>12&15]+HEX_CHARS[block>>8&15]+HEX_CHARS[block>>20&15]+HEX_CHARS[block>>16&15]+HEX_CHARS[block>>28&15]+HEX_CHARS[block>>24&15];j%blockCount==0&&(f(s),i=0)}return extraBytes&&(block=s[i],extraBytes>0&&(hex+=HEX_CHARS[block>>4&15]+HEX_CHARS[15&block]),extraBytes>1&&(hex+=HEX_CHARS[block>>12&15]+HEX_CHARS[block>>8&15]),extraBytes>2&&(hex+=HEX_CHARS[block>>20&15]+HEX_CHARS[block>>16&15])),hex},Keccak.prototype.arrayBuffer=function(){this.finalize();var buffer,blockCount=this.blockCount,s=this.s,outputBlocks=this.outputBlocks,extraBytes=this.extraBytes,i=0,j=0,bytes=this.outputBits>>3;buffer=extraBytes?new ArrayBuffer(outputBlocks+1<<2):new ArrayBuffer(bytes);for(var array=new Uint32Array(buffer);j>8&255,array[offset+2]=block>>16&255,array[offset+3]=block>>24&255;j%blockCount==0&&f(s)}return extraBytes&&(offset=j<<2,block=s[i],extraBytes>0&&(array[offset]=255&block),extraBytes>1&&(array[offset+1]=block>>8&255),extraBytes>2&&(array[offset+2]=block>>16&255)),array},Kmac.prototype=new Keccak,Kmac.prototype.finalize=function(){return this.encode(this.outputBits,!0), +Keccak.prototype.finalize.call(this)};var f=function(s){var h,l,n,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49;for(n=0;n<48;n+=2)c0=s[0]^s[10]^s[20]^s[30]^s[40],c1=s[1]^s[11]^s[21]^s[31]^s[41],c2=s[2]^s[12]^s[22]^s[32]^s[42],c3=s[3]^s[13]^s[23]^s[33]^s[43],c4=s[4]^s[14]^s[24]^s[34]^s[44],c5=s[5]^s[15]^s[25]^s[35]^s[45],c6=s[6]^s[16]^s[26]^s[36]^s[46],c7=s[7]^s[17]^s[27]^s[37]^s[47],c8=s[8]^s[18]^s[28]^s[38]^s[48],c9=s[9]^s[19]^s[29]^s[39]^s[49],h=c8^(c2<<1|c3>>>31),l=c9^(c3<<1|c2>>>31),s[0]^=h,s[1]^=l,s[10]^=h,s[11]^=l,s[20]^=h,s[21]^=l,s[30]^=h,s[31]^=l,s[40]^=h,s[41]^=l,h=c0^(c4<<1|c5>>>31),l=c1^(c5<<1|c4>>>31),s[2]^=h,s[3]^=l,s[12]^=h,s[13]^=l,s[22]^=h,s[23]^=l,s[32]^=h,s[33]^=l,s[42]^=h,s[43]^=l,h=c2^(c6<<1|c7>>>31),l=c3^(c7<<1|c6>>>31),s[4]^=h,s[5]^=l,s[14]^=h,s[15]^=l,s[24]^=h,s[25]^=l,s[34]^=h,s[35]^=l,s[44]^=h,s[45]^=l,h=c4^(c8<<1|c9>>>31),l=c5^(c9<<1|c8>>>31),s[6]^=h,s[7]^=l,s[16]^=h,s[17]^=l,s[26]^=h,s[27]^=l,s[36]^=h,s[37]^=l,s[46]^=h,s[47]^=l,h=c6^(c0<<1|c1>>>31),l=c7^(c1<<1|c0>>>31),s[8]^=h,s[9]^=l,s[18]^=h,s[19]^=l,s[28]^=h,s[29]^=l,s[38]^=h,s[39]^=l,s[48]^=h,s[49]^=l,b0=s[0],b1=s[1],b32=s[11]<<4|s[10]>>>28,b33=s[10]<<4|s[11]>>>28,b14=s[20]<<3|s[21]>>>29,b15=s[21]<<3|s[20]>>>29,b46=s[31]<<9|s[30]>>>23,b47=s[30]<<9|s[31]>>>23,b28=s[40]<<18|s[41]>>>14,b29=s[41]<<18|s[40]>>>14,b20=s[2]<<1|s[3]>>>31,b21=s[3]<<1|s[2]>>>31,b2=s[13]<<12|s[12]>>>20,b3=s[12]<<12|s[13]>>>20,b34=s[22]<<10|s[23]>>>22,b35=s[23]<<10|s[22]>>>22,b16=s[33]<<13|s[32]>>>19,b17=s[32]<<13|s[33]>>>19,b48=s[42]<<2|s[43]>>>30,b49=s[43]<<2|s[42]>>>30,b40=s[5]<<30|s[4]>>>2,b41=s[4]<<30|s[5]>>>2,b22=s[14]<<6|s[15]>>>26,b23=s[15]<<6|s[14]>>>26,b4=s[25]<<11|s[24]>>>21,b5=s[24]<<11|s[25]>>>21,b36=s[34]<<15|s[35]>>>17,b37=s[35]<<15|s[34]>>>17,b18=s[45]<<29|s[44]>>>3,b19=s[44]<<29|s[45]>>>3,b10=s[6]<<28|s[7]>>>4,b11=s[7]<<28|s[6]>>>4,b42=s[17]<<23|s[16]>>>9,b43=s[16]<<23|s[17]>>>9,b24=s[26]<<25|s[27]>>>7,b25=s[27]<<25|s[26]>>>7,b6=s[36]<<21|s[37]>>>11,b7=s[37]<<21|s[36]>>>11,b38=s[47]<<24|s[46]>>>8,b39=s[46]<<24|s[47]>>>8,b30=s[8]<<27|s[9]>>>5,b31=s[9]<<27|s[8]>>>5,b12=s[18]<<20|s[19]>>>12,b13=s[19]<<20|s[18]>>>12,b44=s[29]<<7|s[28]>>>25,b45=s[28]<<7|s[29]>>>25,b26=s[38]<<8|s[39]>>>24,b27=s[39]<<8|s[38]>>>24,b8=s[48]<<14|s[49]>>>18,b9=s[49]<<14|s[48]>>>18,s[0]=b0^~b2&b4,s[1]=b1^~b3&b5,s[10]=b10^~b12&b14,s[11]=b11^~b13&b15,s[20]=b20^~b22&b24,s[21]=b21^~b23&b25,s[30]=b30^~b32&b34,s[31]=b31^~b33&b35,s[40]=b40^~b42&b44,s[41]=b41^~b43&b45,s[2]=b2^~b4&b6,s[3]=b3^~b5&b7,s[12]=b12^~b14&b16,s[13]=b13^~b15&b17,s[22]=b22^~b24&b26,s[23]=b23^~b25&b27,s[32]=b32^~b34&b36,s[33]=b33^~b35&b37,s[42]=b42^~b44&b46,s[43]=b43^~b45&b47,s[4]=b4^~b6&b8,s[5]=b5^~b7&b9,s[14]=b14^~b16&b18,s[15]=b15^~b17&b19,s[24]=b24^~b26&b28,s[25]=b25^~b27&b29,s[34]=b34^~b36&b38,s[35]=b35^~b37&b39,s[44]=b44^~b46&b48,s[45]=b45^~b47&b49,s[6]=b6^~b8&b0,s[7]=b7^~b9&b1,s[16]=b16^~b18&b10,s[17]=b17^~b19&b11,s[26]=b26^~b28&b20,s[27]=b27^~b29&b21,s[36]=b36^~b38&b30,s[37]=b37^~b39&b31,s[46]=b46^~b48&b40,s[47]=b47^~b49&b41,s[8]=b8^~b0&b2,s[9]=b9^~b1&b3,s[18]=b18^~b10&b12,s[19]=b19^~b11&b13,s[28]=b28^~b20&b22,s[29]=b29^~b21&b23,s[38]=b38^~b30&b32,s[39]=b39^~b31&b33,s[48]=b48^~b40&b42,s[49]=b49^~b41&b43,s[0]^=RC[n],s[1]^=RC[n+1]};if(COMMON_JS)module.exports=methods;else for(var i=0;i=6.0.0",npm:">=3.0.0"},scripts:{lint:"aegir-lint",coverage:"gulp coverage",test:"gulp test --dom","test:node":"npm run test:unit:node","test:browser":"npm run test:unit:browser","test:unit:node":"gulp test:node","test:unit:node:core":"TEST=core npm run test:unit:node","test:unit:node:http":"TEST=http npm run test:unit:node","test:unit:node:cli":"TEST=cli npm run test:unit:node","test:unit:browser":"gulp test:browser","test:interop":"npm run test:interop:node","test:interop:node":"mocha -t 60000 test/interop/node.js","test:interop:browser":"mocha -t 60000 test/interop/browser.js","test:benchmark":'echo "Error: no benchmarks yet" && exit 1',"test:benchmark:node":'echo "Error: no benchmarks yet" && exit 1',"test:benchmark:node:core":'echo "Error: no benchmarks yet" && exit 1',"test:benchmark:node:http":'echo "Error: no benchmarks yet" && exit 1',"test:benchmark:browser":'echo "Error: no benchmarks yet" && exit 1',build:"gulp build",release:"gulp release","release-minor":"gulp release --type minor","release-major":"gulp release --type major","coverage-publish":"aegir-coverage publish"},"pre-commit":["lint","test"],repository:{type:"git",url:"git+https://github.com/ipfs/js-ipfs.git"},keywords:["IPFS"],author:"David Dias ",license:"MIT",bugs:{url:"https://github.com/ipfs/js-ipfs/issues"},homepage:"https://github.com/ipfs/js-ipfs#readme",devDependencies:{aegir:"^11.0.2","buffer-loader":"0.0.1",chai:"^4.1.1",delay:"^2.0.0","detect-node":"^2.0.3","dir-compare":"^1.4.0","dirty-chai":"^2.0.1","eslint-plugin-react":"^7.2.1",execa:"^0.8.0","expose-loader":"^0.7.3","form-data":"^2.2.0",gulp:"^3.9.1","interface-ipfs-core":"~0.30.1","ipfsd-ctl":"~0.21.0","left-pad":"^1.1.3",lodash:"^4.17.4",mocha:"^3.5.0",ncp:"^2.0.0",nexpect:"^0.5.0","pre-commit":"^1.2.2","pretty-bytes":"^4.0.2",qs:"^6.5.0","random-fs":"^1.0.3",rimraf:"^2.6.1","stream-to-promise":"^2.2.0","transform-loader":"^0.2.4"},dependencies:{async:"^2.5.0",bl:"^1.2.1",boom:"^5.2.0",cids:"^0.5.1",debug:"^3.0.0","fsm-event":"^2.1.0",glob:"^7.1.2",hapi:"^16.5.2","hapi-set-header":"^1.0.2",hoek:"^4.2.0","ipfs-api":"^14.1.2","ipfs-bitswap":"~0.16.1","ipfs-block":"~0.6.0","ipfs-block-service":"~0.12.0","ipfs-multipart":"~0.1.0","ipfs-repo":"~0.17.0","ipfs-unixfs":"~0.1.12","ipfs-unixfs-engine":"~0.22.0","ipld-resolver":"~0.13.0","is-ipfs":"^0.3.0","is-stream":"^1.1.0",joi:"^10.6.0",libp2p:"^0.11.0","libp2p-floodsub":"~0.11.0","libp2p-kad-dht":"^0.4.1","libp2p-mdns":"^0.8.0","libp2p-multiplex":"^0.4.4","libp2p-railing":"^0.6.1","libp2p-secio":"^0.7.1","libp2p-swarm":"^0.31.0","libp2p-tcp":"^0.10.2","libp2p-webrtc-star":"^0.12.0","libp2p-websockets":"^0.10.1","lodash.flatmap":"^4.5.0","lodash.get":"^4.4.2","lodash.sortby":"^4.7.0","lodash.values":"^4.3.0",mafmt:"^2.1.8",mkdirp:"^0.5.1",multiaddr:"^2.3.0",multihashes:"~0.4.5",once:"^1.4.0","path-exists":"^3.0.0","peer-book":"^0.5.0","peer-id":"^0.9.0","peer-info":"^0.10.0","promisify-es6":"^1.0.3","pull-file":"^1.0.0","pull-paramap":"^1.2.2","pull-pushable":"^2.1.1","pull-sort":"^1.0.1","pull-stream":"^3.6.0","pull-stream-to-stream":"^1.3.4","pull-zip":"^2.0.1","read-pkg-up":"^2.0.0","readable-stream":"2.3.3","safe-buffer":"^5.1.1","stream-to-pull-stream":"^1.7.2","tar-stream":"^1.5.4",temp:"^0.8.3",through2:"^2.0.3","update-notifier":"^2.2.0",yargs:"8.0.2"},contributors:["Andrew de Andrade ","CHEVALAY JOSSELIN ","Caio Gondim ","Christian Couder ","Daniel J. O'Quinn ","Daniela Borges Matos de Carvalho ","David Dias ","Dzmitry Das ","Enrico Marino ","Felix Yan ","Francisco Baio Dias ","Francisco Baio Dias ","Friedel Ziegelmayer ","Georgios Rassias ","Greenkeeper ","Haad ","Harsh Vakharia ","Johannes Wikner ","Jon Schlinkert ","João Antunes ","Kevin Wang ","Lars Gierth ","Marius Darila ","Michelle Lee ","Mikeal Rogers ","Mithgol ","Nuno Nogueira ","Oskar Nyberg ","Pau Ramon Revilla ","Pedro Teixeira ","RasmusErik Voel Jensen ","Richard Littauer ","Rod Keys ","Sid Harder ","SidHarder ","Stephen Whitmore ","Stephen Whitmore ","Terence Pae ","Xiao Liang ","bitspill ","haad ","jbenet ","kumavis ","nginnever ","npmcdn-to-unpkg-bot ","tcme ","ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ "]}},function(module,exports,__webpack_require__){"use strict";var createKeccak=__webpack_require__(463),createShake=__webpack_require__(464);module.exports=function(KeccakState){var Keccak=createKeccak(KeccakState),Shake=createShake(KeccakState);return function(algorithm,options){switch("string"==typeof algorithm?algorithm.toLowerCase():algorithm){case"keccak224":return new Keccak(1152,448,null,224,options);case"keccak256":return new Keccak(1088,512,null,256,options);case"keccak384":return new Keccak(832,768,null,384,options);case"keccak512":return new Keccak(576,1024,null,512,options);case"sha3-224":return new Keccak(1152,448,6,224,options);case"sha3-256":return new Keccak(1088,512,6,256,options);case"sha3-384":return new Keccak(832,768,6,384,options);case"sha3-512":return new Keccak(576,1024,6,512,options);case"shake128":return new Shake(1344,256,31,options);case"shake256":return new Shake(1088,512,31,options);default:throw new Error("Invald algorithm: "+algorithm)}}}},function(module,exports,__webpack_require__){"use strict";var Buffer=__webpack_require__(5).Buffer,Transform=__webpack_require__(25).Transform,inherits=__webpack_require__(2);module.exports=function(KeccakState){function Keccak(rate,capacity,delimitedSuffix,hashBitLength,options){Transform.call(this,options),this._rate=rate,this._capacity=capacity,this._delimitedSuffix=delimitedSuffix,this._hashBitLength=hashBitLength,this._options=options,this._state=new KeccakState,this._state.initialize(rate,capacity),this._finalized=!1}return inherits(Keccak,Transform),Keccak.prototype._transform=function(chunk,encoding,callback){var error=null;try{this.update(chunk,encoding)}catch(err){error=err}callback(error)},Keccak.prototype._flush=function(callback){var error=null;try{this.push(this.digest())}catch(err){error=err}callback(error)},Keccak.prototype.update=function(data,encoding){if(!Buffer.isBuffer(data)&&"string"!=typeof data)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(data)||(data=Buffer.from(data,encoding)),this._state.absorb(data),this},Keccak.prototype.digest=function(encoding){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var digest=this._state.squeeze(this._hashBitLength/8);return void 0!==encoding&&(digest=digest.toString(encoding)),this._resetState(),digest},Keccak.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},Keccak.prototype._clone=function(){var clone=new Keccak(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(clone._state),clone._finalized=this._finalized,clone},Keccak}},function(module,exports,__webpack_require__){"use strict";var Buffer=__webpack_require__(5).Buffer,Transform=__webpack_require__(25).Transform,inherits=__webpack_require__(2);module.exports=function(KeccakState){function Shake(rate,capacity,delimitedSuffix,options){Transform.call(this,options),this._rate=rate,this._capacity=capacity,this._delimitedSuffix=delimitedSuffix,this._options=options,this._state=new KeccakState,this._state.initialize(rate,capacity),this._finalized=!1}return inherits(Shake,Transform),Shake.prototype._transform=function(chunk,encoding,callback){var error=null;try{this.update(chunk,encoding)}catch(err){error=err}callback(error)},Shake.prototype._flush=function(){},Shake.prototype._read=function(size){this.push(this.squeeze(size))},Shake.prototype.update=function(data,encoding){if(!Buffer.isBuffer(data)&&"string"!=typeof data)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(data)||(data=Buffer.from(data,encoding)),this._state.absorb(data),this},Shake.prototype.squeeze=function(dataByteLength,encoding){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var data=this._state.squeeze(dataByteLength);return void 0!==encoding&&(data=data.toString(encoding)),data},Shake.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},Shake.prototype._clone=function(){var clone=new Shake(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(clone._state),clone._finalized=this._finalized,clone},Shake}},function(module,exports,__webpack_require__){"use strict";var P1600_ROUND_CONSTANTS=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];exports.p1600=function(s){for(var round=0;round<24;++round){var lo0=s[0]^s[10]^s[20]^s[30]^s[40],hi0=s[1]^s[11]^s[21]^s[31]^s[41],lo1=s[2]^s[12]^s[22]^s[32]^s[42],hi1=s[3]^s[13]^s[23]^s[33]^s[43],lo2=s[4]^s[14]^s[24]^s[34]^s[44],hi2=s[5]^s[15]^s[25]^s[35]^s[45],lo3=s[6]^s[16]^s[26]^s[36]^s[46],hi3=s[7]^s[17]^s[27]^s[37]^s[47],lo4=s[8]^s[18]^s[28]^s[38]^s[48],hi4=s[9]^s[19]^s[29]^s[39]^s[49],lo=lo4^(lo1<<1|hi1>>>31),hi=hi4^(hi1<<1|lo1>>>31),t1slo0=s[0]^lo,t1shi0=s[1]^hi,t1slo5=s[10]^lo,t1shi5=s[11]^hi,t1slo10=s[20]^lo,t1shi10=s[21]^hi,t1slo15=s[30]^lo,t1shi15=s[31]^hi,t1slo20=s[40]^lo,t1shi20=s[41]^hi;lo=lo0^(lo2<<1|hi2>>>31),hi=hi0^(hi2<<1|lo2>>>31);var t1slo1=s[2]^lo,t1shi1=s[3]^hi,t1slo6=s[12]^lo,t1shi6=s[13]^hi,t1slo11=s[22]^lo,t1shi11=s[23]^hi,t1slo16=s[32]^lo,t1shi16=s[33]^hi,t1slo21=s[42]^lo,t1shi21=s[43]^hi;lo=lo1^(lo3<<1|hi3>>>31),hi=hi1^(hi3<<1|lo3>>>31);var t1slo2=s[4]^lo,t1shi2=s[5]^hi,t1slo7=s[14]^lo,t1shi7=s[15]^hi,t1slo12=s[24]^lo,t1shi12=s[25]^hi,t1slo17=s[34]^lo,t1shi17=s[35]^hi,t1slo22=s[44]^lo,t1shi22=s[45]^hi;lo=lo2^(lo4<<1|hi4>>>31),hi=hi2^(hi4<<1|lo4>>>31);var t1slo3=s[6]^lo,t1shi3=s[7]^hi,t1slo8=s[16]^lo,t1shi8=s[17]^hi,t1slo13=s[26]^lo,t1shi13=s[27]^hi,t1slo18=s[36]^lo,t1shi18=s[37]^hi,t1slo23=s[46]^lo,t1shi23=s[47]^hi;lo=lo3^(lo0<<1|hi0>>>31),hi=hi3^(hi0<<1|lo0>>>31);var t1slo4=s[8]^lo,t1shi4=s[9]^hi,t1slo9=s[18]^lo,t1shi9=s[19]^hi,t1slo14=s[28]^lo,t1shi14=s[29]^hi,t1slo19=s[38]^lo,t1shi19=s[39]^hi,t1slo24=s[48]^lo,t1shi24=s[49]^hi,t2slo0=t1slo0,t2shi0=t1shi0,t2slo16=t1shi5<<4|t1slo5>>>28,t2shi16=t1slo5<<4|t1shi5>>>28,t2slo7=t1slo10<<3|t1shi10>>>29,t2shi7=t1shi10<<3|t1slo10>>>29,t2slo23=t1shi15<<9|t1slo15>>>23,t2shi23=t1slo15<<9|t1shi15>>>23,t2slo14=t1slo20<<18|t1shi20>>>14,t2shi14=t1shi20<<18|t1slo20>>>14,t2slo10=t1slo1<<1|t1shi1>>>31,t2shi10=t1shi1<<1|t1slo1>>>31,t2slo1=t1shi6<<12|t1slo6>>>20,t2shi1=t1slo6<<12|t1shi6>>>20,t2slo17=t1slo11<<10|t1shi11>>>22,t2shi17=t1shi11<<10|t1slo11>>>22,t2slo8=t1shi16<<13|t1slo16>>>19,t2shi8=t1slo16<<13|t1shi16>>>19,t2slo24=t1slo21<<2|t1shi21>>>30,t2shi24=t1shi21<<2|t1slo21>>>30,t2slo20=t1shi2<<30|t1slo2>>>2,t2shi20=t1slo2<<30|t1shi2>>>2,t2slo11=t1slo7<<6|t1shi7>>>26,t2shi11=t1shi7<<6|t1slo7>>>26,t2slo2=t1shi12<<11|t1slo12>>>21,t2shi2=t1slo12<<11|t1shi12>>>21,t2slo18=t1slo17<<15|t1shi17>>>17,t2shi18=t1shi17<<15|t1slo17>>>17,t2slo9=t1shi22<<29|t1slo22>>>3,t2shi9=t1slo22<<29|t1shi22>>>3,t2slo5=t1slo3<<28|t1shi3>>>4,t2shi5=t1shi3<<28|t1slo3>>>4,t2slo21=t1shi8<<23|t1slo8>>>9,t2shi21=t1slo8<<23|t1shi8>>>9,t2slo12=t1slo13<<25|t1shi13>>>7,t2shi12=t1shi13<<25|t1slo13>>>7,t2slo3=t1slo18<<21|t1shi18>>>11,t2shi3=t1shi18<<21|t1slo18>>>11,t2slo19=t1shi23<<24|t1slo23>>>8,t2shi19=t1slo23<<24|t1shi23>>>8,t2slo15=t1slo4<<27|t1shi4>>>5,t2shi15=t1shi4<<27|t1slo4>>>5,t2slo6=t1slo9<<20|t1shi9>>>12,t2shi6=t1shi9<<20|t1slo9>>>12,t2slo22=t1shi14<<7|t1slo14>>>25,t2shi22=t1slo14<<7|t1shi14>>>25,t2slo13=t1slo19<<8|t1shi19>>>24,t2shi13=t1shi19<<8|t1slo19>>>24,t2slo4=t1slo24<<14|t1shi24>>>18,t2shi4=t1shi24<<14|t1slo24>>>18;s[0]=t2slo0^~t2slo1&t2slo2,s[1]=t2shi0^~t2shi1&t2shi2,s[10]=t2slo5^~t2slo6&t2slo7,s[11]=t2shi5^~t2shi6&t2shi7,s[20]=t2slo10^~t2slo11&t2slo12,s[21]=t2shi10^~t2shi11&t2shi12,s[30]=t2slo15^~t2slo16&t2slo17,s[31]=t2shi15^~t2shi16&t2shi17,s[40]=t2slo20^~t2slo21&t2slo22,s[41]=t2shi20^~t2shi21&t2shi22,s[2]=t2slo1^~t2slo2&t2slo3,s[3]=t2shi1^~t2shi2&t2shi3,s[12]=t2slo6^~t2slo7&t2slo8,s[13]=t2shi6^~t2shi7&t2shi8,s[22]=t2slo11^~t2slo12&t2slo13,s[23]=t2shi11^~t2shi12&t2shi13,s[32]=t2slo16^~t2slo17&t2slo18,s[33]=t2shi16^~t2shi17&t2shi18,s[42]=t2slo21^~t2slo22&t2slo23,s[43]=t2shi21^~t2shi22&t2shi23,s[4]=t2slo2^~t2slo3&t2slo4,s[5]=t2shi2^~t2shi3&t2shi4,s[14]=t2slo7^~t2slo8&t2slo9,s[15]=t2shi7^~t2shi8&t2shi9,s[24]=t2slo12^~t2slo13&t2slo14,s[25]=t2shi12^~t2shi13&t2shi14,s[34]=t2slo17^~t2slo18&t2slo19,s[35]=t2shi17^~t2shi18&t2shi19,s[44]=t2slo22^~t2slo23&t2slo24,s[45]=t2shi22^~t2shi23&t2shi24,s[6]=t2slo3^~t2slo4&t2slo0,s[7]=t2shi3^~t2shi4&t2shi0,s[16]=t2slo8^~t2slo9&t2slo5,s[17]=t2shi8^~t2shi9&t2shi5,s[26]=t2slo13^~t2slo14&t2slo10,s[27]=t2shi13^~t2shi14&t2shi10,s[36]=t2slo18^~t2slo19&t2slo15,s[37]=t2shi18^~t2shi19&t2shi15,s[46]=t2slo23^~t2slo24&t2slo20,s[47]=t2shi23^~t2shi24&t2shi20,s[8]=t2slo4^~t2slo0&t2slo1,s[9]=t2shi4^~t2shi0&t2shi1,s[18]=t2slo9^~t2slo5&t2slo6,s[19]=t2shi9^~t2shi5&t2shi6,s[28]=t2slo14^~t2slo10&t2slo11,s[29]=t2shi14^~t2shi10&t2shi11,s[38]=t2slo19^~t2slo15&t2slo16,s[39]=t2shi19^~t2shi15&t2shi16,s[48]=t2slo24^~t2slo20&t2slo21,s[49]=t2shi24^~t2shi20&t2shi21,s[0]^=P1600_ROUND_CONSTANTS[2*round],s[1]^=P1600_ROUND_CONSTANTS[2*round+1]}}},function(module,exports,__webpack_require__){"use strict";function Keccak(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}var Buffer=__webpack_require__(5).Buffer,keccakState=__webpack_require__(465);Keccak.prototype.initialize=function(rate,capacity){for(var i=0;i<50;++i)this.state[i]=0;this.blockSize=rate/8,this.count=0,this.squeezing=!1},Keccak.prototype.absorb=function(data){for(var i=0;i>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(keccakState.p1600(this.state),this.count=0);return output},Keccak.prototype.copy=function(dest){for(var i=0;i<50;++i)dest.state[i]=this.state[i];dest.blockSize=this.blockSize,dest.count=this.count,dest.squeezing=this.squeezing},module.exports=Keccak},function(module,exports,__webpack_require__){module.exports=__webpack_require__(327).SHA3Hash},function(module,exports,__webpack_require__){function Codec(opts){this.opts=opts||{},this.encodings=encodings}var encodings=__webpack_require__(469);module.exports=Codec,Codec.prototype._encoding=function(encoding){return"string"==typeof encoding&&(encoding=encodings[encoding]),encoding||(encoding=encodings.id),encoding},Codec.prototype._keyEncoding=function(opts,batchOpts){return this._encoding(batchOpts&&batchOpts.keyEncoding||opts&&opts.keyEncoding||this.opts.keyEncoding)},Codec.prototype._valueEncoding=function(opts,batchOpts){return this._encoding(batchOpts&&(batchOpts.valueEncoding||batchOpts.encoding)||opts&&(opts.valueEncoding||opts.encoding)||this.opts.valueEncoding||this.opts.encoding)},Codec.prototype.encodeKey=function(key,opts,batchOpts){return this._keyEncoding(opts,batchOpts).encode(key)},Codec.prototype.encodeValue=function(value,opts,batchOpts){return this._valueEncoding(opts,batchOpts).encode(value)},Codec.prototype.decodeKey=function(key,opts){return this._keyEncoding(opts).decode(key)},Codec.prototype.decodeValue=function(value,opts){return this._valueEncoding(opts).decode(value)},Codec.prototype.encodeBatch=function(ops,opts){var self=this;return ops.map(function(_op){var op={type:_op.type,key:self.encodeKey(_op.key,opts,_op)};return self.keyAsBuffer(opts,_op)&&(op.keyEncoding="binary"),_op.prefix&&(op.prefix=_op.prefix),"value"in _op&&(op.value=self.encodeValue(_op.value,opts,_op),self.valueAsBuffer(opts,_op)&&(op.valueEncoding="binary")),op})};var ltgtKeys=["lt","gt","lte","gte","start","end"];Codec.prototype.encodeLtgt=function(ltgt){var self=this,ret={};return Object.keys(ltgt).forEach(function(key){ret[key]=ltgtKeys.indexOf(key)>-1?self.encodeKey(ltgt[key],ltgt):ltgt[key]}),ret},Codec.prototype.createStreamDecoder=function(opts){var self=this;return opts.keys&&opts.values?function(key,value){return{key:self.decodeKey(key,opts),value:self.decodeValue(value,opts)}}:opts.keys?function(key){return self.decodeKey(key,opts)}:opts.values?function(_,value){return self.decodeValue(value,opts)}:function(){}},Codec.prototype.keyAsBuffer=function(opts){return this._keyEncoding(opts).buffer},Codec.prototype.valueAsBuffer=function(opts){return this._valueEncoding(opts).buffer}},function(module,exports,__webpack_require__){(function(Buffer){function identity(value){return value}function isBinary(data){return void 0===data||null===data||Buffer.isBuffer(data)}exports.utf8=exports["utf-8"]={encode:function(data){return isBinary(data)?data:String(data)},decode:function(data){return"string"==typeof data?data:String(data)},buffer:!1,type:"utf8"},exports.json={encode:JSON.stringify,decode:JSON.parse,buffer:!1,type:"json"},exports.binary={encode:function(data){return isBinary(data)?data:new Buffer(data)},decode:identity,buffer:!0,type:"binary"},exports.none={encode:identity,decode:identity,buffer:!1,type:"id"},exports.id=exports.none,["hex","ascii","base64","ucs2","ucs-2","utf16le","utf-16le"].forEach(function(type){exports[type]={encode:function(data){return isBinary(data)?data:new Buffer(data,type)},decode:function(buffer){return buffer.toString(type)},buffer:!0,type:type}})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function ReadStream(iterator,options){if(!(this instanceof ReadStream))return new ReadStream(iterator,options);Readable.call(this,extend(options,{objectMode:!0})),this._iterator=iterator,this._destroyed=!1,this._decoder=null,options&&options.decoder&&(this._decoder=options.decoder),this.on("end",this._cleanup.bind(this))}var inherits=__webpack_require__(2),Readable=__webpack_require__(473).Readable,extend=__webpack_require__(39),EncodingError=__webpack_require__(90).EncodingError;module.exports=ReadStream,inherits(ReadStream,Readable),ReadStream.prototype._read=function(){var self=this;this._destroyed||this._iterator.next(function(err,key,value){if(!self._destroyed){if(err)return self.emit("error",err);if(void 0===key&&void 0===value)self.push(null);else{if(!self._decoder)return self.push({key:key,value:value});try{var value=self._decoder(key,value)}catch(err){return self.emit("error",new EncodingError(err)),void self.push(null)}self.push(value)}}})},ReadStream.prototype.destroy=ReadStream.prototype._cleanup=function(){var self=this;this._destroyed||(this._destroyed=!0,this._iterator.end(function(err){if(err)return self.emit("error",err);self.emit("close")}))}},function(module,exports){module.exports=Array.isArray||function(arr){return"[object Array]"==Object.prototype.toString.call(arr)}},function(module,exports,__webpack_require__){function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}module.exports=PassThrough;var Transform=__webpack_require__(218),util=__webpack_require__(27);util.inherits=__webpack_require__(2),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},function(module,exports,__webpack_require__){(function(process){exports=module.exports=__webpack_require__(217),exports.Stream=__webpack_require__(25),exports.Readable=exports,exports.Writable=__webpack_require__(219),exports.Duplex=__webpack_require__(56),exports.Transform=__webpack_require__(218),exports.PassThrough=__webpack_require__(472),process.browser||"disable"!==process.env.READABLE_STREAM||(module.exports=__webpack_require__(25))}).call(exports,__webpack_require__(1))},function(module,exports,__webpack_require__){(function(Buffer,process){function Iterator(db,options){if(this._db=db._db,this._idbOpts=db._idbOpts,AbstractIterator.call(this,db),this._options=xtend({snapshot:!0},this._idbOpts,options),this._limit=this._options.limit,null!=this._limit&&this._limit!==-1||(this._limit=1/0),"number"!=typeof this._limit)throw new TypeError("options.limit must be a number");0!==this._limit&&(this._count=0,this._startCursor(this._options))}var util=__webpack_require__(34),AbstractIterator=__webpack_require__(223).AbstractIterator,ltgt=__webpack_require__(573),idbReadableStream=__webpack_require__(389),stream=__webpack_require__(25),xtend=__webpack_require__(39),Writable=stream.Writable;module.exports=Iterator,util.inherits(Iterator,AbstractIterator),Iterator.prototype._startCursor=function(options){options=xtend(this._options,options);var self=this,keyRange=null,lower=ltgt.lowerBound(options),upper=ltgt.upperBound(options),lowerOpen=ltgt.lowerBoundExclusive(options),upperOpen=ltgt.upperBoundExclusive(options),direction=options.reverse?"prev":"next";if(lower&&("binary"!==options.keyEncoding||Array.isArray(lower)||(lower=Array.prototype.slice.call(lower))),upper&&("binary"!==options.keyEncoding||Array.isArray(upper)||(upper=Array.prototype.slice.call(upper))),lower&&upper)try{keyRange=IDBKeyRange.bound(lower,upper,lowerOpen,upperOpen)}catch(err){return void(this._keyRangeError=!0)}else lower?keyRange=IDBKeyRange.lowerBound(lower,lowerOpen):upper&&(keyRange=IDBKeyRange.upperBound(upper,upperOpen));this._reader=idbReadableStream(this._db,this._idbOpts.storeName,xtend(options,{range:keyRange,direction:direction})),this._reader.on("error",function(err){var cb=self._callback;self._callback=!1,cb?cb(err):self._readNext=function(cb){cb(err)}}),this._reader.pipe(new Writable({objectMode:!0,write:function(item,enc,cb){if(self._count++>=self._limit)return self._reader.pause(),self._reader.unpipe(this),cb(),void this.end();var cb2=self._callback;self._callback=!1,cb2?self._processItem(item,function(err,key,value){cb(err),cb2(err,key,value)}):self._readNext=function(cb2){self._processItem(item,function(err,key,value){cb(err),cb2(err,key,value)})}}})).on("finish",function(){var cb=self._callback;self._callback=!1,cb?cb():self._readNext=function(cb){cb()}})},Iterator.prototype._processItem=function(item,cb){if("function"!=typeof cb)throw new TypeError("cb must be a function");var key=item.key,value=item.value;if(value instanceof Uint8Array&&(value=new Buffer(value)),"binary"===this._options.keyEncoding&&Array.isArray(key)&&(key=new Buffer(key)),"binary"!==this._options.valueEncoding||Buffer.isBuffer(value)||(value=new Buffer(value)),this._options.keyAsBuffer&&!Buffer.isBuffer(key))if(null==key)key=new Buffer(0);else if("string"==typeof key)key=new Buffer(key);else if("boolean"==typeof key)key=new Buffer(String(key));else if("number"==typeof key)key=new Buffer(String(key));else if(Array.isArray(key))key=new Buffer(String(key));else{if(!(key instanceof Uint8Array))throw new TypeError("can't coerce `"+key.constructor.name+"` into a Buffer");key=new Buffer(key)}if(this._options.valueAsBuffer&&!Buffer.isBuffer(value))if(null==value)value=new Buffer(0);else if("string"==typeof value)value=new Buffer(value);else if("boolean"==typeof value)value=new Buffer(String(value));else if("number"==typeof value)value=new Buffer(String(value));else if(Array.isArray(value))value=new Buffer(String(value));else{if(!(value instanceof Uint8Array))throw new TypeError("can't coerce `"+value.constructor.name+"` into a Buffer");value=new Buffer(value)}cb(null,key,value)},Iterator.prototype._next=function(callback){if(this._callback)throw new Error("callback already exists");if(this._keyRangeError||0===this._limit)return void callback();var readNext=this._readNext;this._readNext=!1,readNext?process.nextTick(function(){readNext(callback)}):this._callback=callback}}).call(exports,__webpack_require__(0).Buffer,__webpack_require__(1)) +},function(module,exports,__webpack_require__){function isLevelDOWN(db){return!(!db||"object"!=typeof db)&&Object.keys(AbstractLevelDOWN.prototype).filter(function(name){return"_"!=name[0]&&"approximateSize"!=name}).every(function(name){return"function"==typeof db[name]})}var AbstractLevelDOWN=__webpack_require__(222);module.exports=isLevelDOWN},function(module,exports,__webpack_require__){function Batch(levelup,codec){this._levelup=levelup,this._codec=codec,this.batch=levelup.db.batch(),this.ops=[],this.length=0}var util=__webpack_require__(224),WriteError=__webpack_require__(90).WriteError,getOptions=util.getOptions,dispatchError=util.dispatchError;Batch.prototype.put=function(key_,value_,options){options=getOptions(options);var key=this._codec.encodeKey(key_,options),value=this._codec.encodeValue(value_,options);try{this.batch.put(key,value)}catch(e){throw new WriteError(e)}return this.ops.push({type:"put",key:key,value:value}),this.length++,this},Batch.prototype.del=function(key_,options){options=getOptions(options);var key=this._codec.encodeKey(key_,options);try{this.batch.del(key)}catch(err){throw new WriteError(err)}return this.ops.push({type:"del",key:key}),this.length++,this},Batch.prototype.clear=function(){try{this.batch.clear()}catch(err){throw new WriteError(err)}return this.ops=[],this.length=0,this},Batch.prototype.write=function(callback){var levelup=this._levelup,ops=this.ops;try{this.batch.write(function(err){if(err)return dispatchError(levelup,new WriteError(err),callback);levelup.emit("batch",ops),callback&&callback()})}catch(err){throw new WriteError(err)}},module.exports=Batch},function(module,exports,__webpack_require__){(function(process){function getCallback(options,callback){return"function"==typeof options?options:callback}function LevelUP(location,options,callback){if(!(this instanceof LevelUP))return new LevelUP(location,options,callback);var error;if(EventEmitter.call(this),this.setMaxListeners(1/0),"function"==typeof location?(options="object"==typeof options?options:{},options.db=location,location=null):"object"==typeof location&&"function"==typeof location.db&&(options=location,location=null),"function"==typeof options&&(callback=options,options={}),(!options||"function"!=typeof options.db)&&"string"!=typeof location){if(error=new InitializationError("Must provide a location for the database"),callback)return process.nextTick(function(){callback(error)});throw error}options=getOptions(options),this.options=extend(defaultOptions,options),this._codec=new Codec(this.options),this._status="new",prr(this,"location",location,"e"),this.open(callback)}function maybeError(db,options,callback){if(!db._isOpening()&&!db.isOpen())return dispatchError(db,new ReadError("Database is not open"),callback),!0}function writeError(db,message,callback){dispatchError(db,new WriteError(message),callback)}function readError(db,message,callback){dispatchError(db,new ReadError(message),callback)}function utilStatic(name){return function(location,callback){getLevelDOWN()[name](location,callback||function(){})}}var EventEmitter=__webpack_require__(10).EventEmitter,inherits=__webpack_require__(34).inherits,deprecate=__webpack_require__(34).deprecate,extend=__webpack_require__(39),prr=__webpack_require__(611),DeferredLevelDOWN=__webpack_require__(341),IteratorStream=__webpack_require__(470),Batch=__webpack_require__(476),Codec=__webpack_require__(468),getLevelDOWN=__webpack_require__(738),errors=__webpack_require__(90),util=__webpack_require__(224),WriteError=errors.WriteError,ReadError=errors.ReadError,NotFoundError=errors.NotFoundError,OpenError=errors.OpenError,EncodingError=errors.EncodingError,InitializationError=errors.InitializationError,LevelUPError=errors.LevelUPError,getOptions=util.getOptions,defaultOptions=util.defaultOptions,dispatchError=util.dispatchError;inherits(LevelUP,EventEmitter),LevelUP.prototype.open=function(callback){var dbFactory,db,self=this;if(this.isOpen())return callback&&process.nextTick(function(){callback(null,self)}),this;if(this._isOpening())return callback&&this.once("open",function(){callback(null,self)});if(this.emit("opening"),this._status="opening",this.db=new DeferredLevelDOWN(this.location),"function"!=typeof this.options.db&&"function"!=typeof getLevelDOWN)throw new LevelUPError("missing db factory, you need to set options.db");dbFactory=this.options.db||getLevelDOWN(),db=dbFactory(this.location),db.open(this.options,function(err){if(err)return dispatchError(self,new OpenError(err),callback);self.db.setDb(db),self.db=db,self._status="open",callback&&callback(null,self),self.emit("open"),self.emit("ready")})},LevelUP.prototype.close=function(callback){var self=this;if(this.isOpen())this._status="closing",this.db.close(function(){self._status="closed",self.emit("closed"),callback&&callback.apply(null,arguments)}),this.emit("closing"),this.db=new DeferredLevelDOWN(this.location);else{if("closed"===this._status&&callback)return process.nextTick(callback);"closing"===this._status&&callback?this.once("closed",callback):this._isOpening()&&this.once("open",function(){self.close(callback)})}},LevelUP.prototype.isOpen=function(){return"open"===this._status},LevelUP.prototype._isOpening=function(){return"opening"===this._status},LevelUP.prototype.isClosed=function(){return/^clos/.test(this._status)},LevelUP.prototype.get=function(key_,options,callback){var key,self=this;if(callback=getCallback(options,callback),!maybeError(this,options,callback)){if(null===key_||void 0===key_||"function"!=typeof callback)return readError(this,"get() requires key and callback arguments",callback);options=util.getOptions(options),key=this._codec.encodeKey(key_,options),options.asBuffer=this._codec.valueAsBuffer(options),this.db.get(key,options,function(err,value){if(err)return err=/notfound/i.test(err)||err.notFound?new NotFoundError("Key not found in database ["+key_+"]",err):new ReadError(err),dispatchError(self,err,callback);if(callback){try{value=self._codec.decodeValue(value,options)}catch(e){return callback(new EncodingError(e))}callback(null,value)}})}},LevelUP.prototype.put=function(key_,value_,options,callback){var key,value,self=this;if(callback=getCallback(options,callback),null===key_||void 0===key_)return writeError(this,"put() requires a key argument",callback);maybeError(this,options,callback)||(options=getOptions(options),key=this._codec.encodeKey(key_,options),value=this._codec.encodeValue(value_,options),this.db.put(key,value,options,function(err){if(err)return dispatchError(self,new WriteError(err),callback);self.emit("put",key_,value_),callback&&callback()}))},LevelUP.prototype.del=function(key_,options,callback){var key,self=this;if(callback=getCallback(options,callback),null===key_||void 0===key_)return writeError(this,"del() requires a key argument",callback);maybeError(this,options,callback)||(options=getOptions(options),key=this._codec.encodeKey(key_,options),this.db.del(key,options,function(err){if(err)return dispatchError(self,new WriteError(err),callback);self.emit("del",key_),callback&&callback()}))},LevelUP.prototype.batch=function(arr_,options,callback){var arr,self=this;return arguments.length?(callback=getCallback(options,callback),Array.isArray(arr_)?void(maybeError(this,options,callback)||(options=getOptions(options),arr=self._codec.encodeBatch(arr_,options),arr=arr.map(function(op){return op.type||void 0===op.key||void 0===op.value||(op.type="put"),op}),this.db.batch(arr,options,function(err){if(err)return dispatchError(self,new WriteError(err),callback);self.emit("batch",arr_),callback&&callback()}))):writeError(this,"batch() requires an array argument",callback)):new Batch(this,this._codec)},LevelUP.prototype.approximateSize=deprecate(function(start_,end_,options,callback){var start,end,self=this;if(callback=getCallback(options,callback),options=getOptions(options),null===start_||void 0===start_||null===end_||void 0===end_||"function"!=typeof callback)return readError(this,"approximateSize() requires start, end and callback arguments",callback);start=this._codec.encodeKey(start_,options),end=this._codec.encodeKey(end_,options),this.db.approximateSize(start,end,function(err,size){if(err)return dispatchError(self,new OpenError(err),callback);callback&&callback(null,size)})},"db.approximateSize() is deprecated. Use db.db.approximateSize() instead"),LevelUP.prototype.readStream=LevelUP.prototype.createReadStream=function(options){return options=extend({keys:!0,values:!0},this.options,options),options.keyEncoding=options.keyEncoding,options.valueEncoding=options.valueEncoding,options=this._codec.encodeLtgt(options),options.keyAsBuffer=this._codec.keyAsBuffer(options),options.valueAsBuffer=this._codec.valueAsBuffer(options),"number"!=typeof options.limit&&(options.limit=-1),new IteratorStream(this.db.iterator(options),extend(options,{decoder:this._codec.createStreamDecoder(options)}))},LevelUP.prototype.keyStream=LevelUP.prototype.createKeyStream=function(options){return this.createReadStream(extend(options,{keys:!0,values:!1}))},LevelUP.prototype.valueStream=LevelUP.prototype.createValueStream=function(options){return this.createReadStream(extend(options,{keys:!1,values:!0}))},LevelUP.prototype.toString=function(){return"LevelUP"},module.exports=LevelUP,module.exports.errors=__webpack_require__(90),module.exports.destroy=deprecate(utilStatic("destroy"),"levelup.destroy() is deprecated. Use leveldown.destroy() instead"),module.exports.repair=deprecate(utilStatic("repair"),"levelup.repair() is deprecated. Use leveldown.repair() instead")}).call(exports,__webpack_require__(1))},function(module,exports,__webpack_require__){"use strict";const secp256k1=__webpack_require__(662),multihashing=__webpack_require__(22),setImmediate=__webpack_require__(7),HASH_ALGORITHM="sha2-256";module.exports=(randomBytes=>{function generateKey(callback){const done=(err,res)=>setImmediate(()=>callback(err,res));let privateKey;do{privateKey=randomBytes(32)}while(!secp256k1.privateKeyVerify(privateKey));done(null,privateKey)}function hashAndSign(key,msg,callback){const done=(err,res)=>setImmediate(()=>callback(err,res));multihashing.digest(msg,HASH_ALGORITHM,(err,digest)=>{if(err)return done(err);try{const sig=secp256k1.sign(digest,key),sigDER=secp256k1.signatureExport(sig.signature);return done(null,sigDER)}catch(err){done(err)}})}function hashAndVerify(key,sig,msg,callback){const done=(err,res)=>setImmediate(()=>callback(err,res));multihashing.digest(msg,HASH_ALGORITHM,(err,digest)=>{if(err)return done(err);try{sig=secp256k1.signatureImport(sig);const valid=secp256k1.verify(digest,sig,key);return done(null,valid)}catch(err){done(err)}})}function compressPublicKey(key){if(!secp256k1.publicKeyVerify(key))throw new Error("Invalid public key");return secp256k1.publicKeyConvert(key,!0)}function decompressPublicKey(key){return secp256k1.publicKeyConvert(key,!1)}function validatePrivateKey(key){if(!secp256k1.privateKeyVerify(key))throw new Error("Invalid private key")}function validatePublicKey(key){if(!secp256k1.publicKeyVerify(key))throw new Error("Invalid public key")}function computePublicKey(privateKey){return validatePrivateKey(privateKey),secp256k1.publicKeyCreate(privateKey)}return{generateKey:generateKey,privateKeyLength:32,hashAndSign:hashAndSign,hashAndVerify:hashAndVerify,compressPublicKey:compressPublicKey,decompressPublicKey:decompressPublicKey,validatePrivateKey:validatePrivateKey,validatePublicKey:validatePublicKey,computePublicKey:computePublicKey}})},function(module,exports,__webpack_require__){"use strict";const multihashing=__webpack_require__(22);module.exports=((keysProtobuf,randomBytes,crypto)=>{function unmarshalSecp256k1PrivateKey(bytes,callback){callback(null,new Secp256k1PrivateKey(bytes),null)}function unmarshalSecp256k1PublicKey(bytes){return new Secp256k1PublicKey(bytes)}function generateKeyPair(_bits,callback){void 0===callback&&"function"==typeof _bits&&(callback=_bits),ensure(callback),crypto.generateKey((err,privateKeyBytes)=>{if(err)return callback(err);let privkey;try{privkey=new Secp256k1PrivateKey(privateKeyBytes)}catch(err){return callback(err)}callback(null,privkey)})}function ensure(callback){if("function"!=typeof callback)throw new Error("callback is required")}crypto=crypto||__webpack_require__(478)(randomBytes);class Secp256k1PublicKey{constructor(key){crypto.validatePublicKey(key),this._key=key}verify(data,sig,callback){ensure(callback),crypto.hashAndVerify(this._key,sig,data,callback)}marshal(){return crypto.compressPublicKey(this._key)}get bytes(){return keysProtobuf.PublicKey.encode({Type:keysProtobuf.KeyType.Secp256k1,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}class Secp256k1PrivateKey{constructor(key,publicKey){this._key=key,this._publicKey=publicKey||crypto.computePublicKey(key),crypto.validatePrivateKey(this._key),crypto.validatePublicKey(this._publicKey)}sign(message,callback){ensure(callback),crypto.hashAndSign(this._key,message,callback)}get public(){return new Secp256k1PublicKey(this._publicKey)}marshal(){return this._key}get bytes(){return keysProtobuf.PrivateKey.encode({Type:keysProtobuf.KeyType.Secp256k1,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}return{Secp256k1PublicKey:Secp256k1PublicKey,Secp256k1PrivateKey:Secp256k1PrivateKey,unmarshalSecp256k1PrivateKey:unmarshalSecp256k1PrivateKey,unmarshalSecp256k1PublicKey:unmarshalSecp256k1PublicKey,generateKeyPair:generateKeyPair}})},function(module,exports,__webpack_require__){"use strict";const crypto=__webpack_require__(323);module.exports={createCipheriv:crypto.createCipheriv,createDecipheriv:crypto.createDecipheriv}},function(module,exports,__webpack_require__){"use strict";const ciphers=__webpack_require__(480),CIPHER_MODES={16:"aes-128-ctr",32:"aes-256-ctr"};exports.create=function(key,iv,callback){const mode=CIPHER_MODES[key.length];if(!mode)return callback(new Error("Invalid key length"));const cipher=ciphers.createCipheriv(mode,key,iv),decipher=ciphers.createDecipheriv(mode,key,iv);callback(null,{encrypt(data,cb){cb(null,cipher.update(data))},decrypt(data,cb){cb(null,decipher.update(data))}})}},function(module,exports,__webpack_require__){"use strict";module.exports={SHA1:20,SHA256:32,SHA512:64}},function(module,exports,__webpack_require__){"use strict";function marshalPublicKey(jwk){const byteLen=curveLengths[jwk.crv];return Buffer.concat([Buffer.from([4]),toBn(jwk.x).toArrayLike(Buffer,"be",byteLen),toBn(jwk.y).toArrayLike(Buffer,"be",byteLen)],1+2*byteLen)}function unmarshalPublicKey(curve,key){const byteLen=curveLengths[curve];if(!key.slice(0,1).equals(Buffer.from([4])))throw new Error("Invalid key format");const x=new BN(key.slice(1,byteLen+1)),y=new BN(key.slice(1+byteLen));return{kty:"EC",crv:curve,x:toBase64(x,byteLen),y:toBase64(y,byteLen),ext:!0}}function unmarshalPrivateKey(curve,key){const result=unmarshalPublicKey(curve,key.public);return result.d=toBase64(new BN(key.private)),result}const webcrypto=__webpack_require__(129)(),nodeify=__webpack_require__(96),BN=__webpack_require__(47).bignum,Buffer=__webpack_require__(5).Buffer,util=__webpack_require__(228),toBase64=util.toBase64,toBn=util.toBn,bits={"P-256":256,"P-384":384,"P-521":521};exports.generateEphmeralKeyPair=function(curve,callback){nodeify(webcrypto.subtle.generateKey({name:"ECDH",namedCurve:curve},!0,["deriveBits"]).then(pair=>{const genSharedKey=(theirPub,forcePrivate,cb)=>{"function"==typeof forcePrivate&&(cb=forcePrivate,forcePrivate=void 0);let privateKey;privateKey=forcePrivate?webcrypto.subtle.importKey("jwk",unmarshalPrivateKey(curve,forcePrivate),{name:"ECDH",namedCurve:curve},!1,["deriveBits"]):Promise.resolve(pair.privateKey),nodeify(Promise.all([webcrypto.subtle.importKey("jwk",unmarshalPublicKey(curve,theirPub),{name:"ECDH",namedCurve:curve},!1,[]),privateKey]).then(keys=>webcrypto.subtle.deriveBits({name:"ECDH",namedCurve:curve,public:keys[0]},keys[1],bits[curve])).then(bits=>Buffer.from(bits)),cb)};return webcrypto.subtle.exportKey("jwk",pair.publicKey).then(publicKey=>{return{key:marshalPublicKey(publicKey),genSharedKey:genSharedKey}})}),callback)};const curveLengths={"P-256":32,"P-384":48,"P-521":66}},function(module,exports,__webpack_require__){"use strict";function unmarshalEd25519PrivateKey(bytes,callback){try{bytes=ensureKey(bytes,crypto.privateKeyLength+crypto.publicKeyLength)}catch(err){return callback(err)}callback(null,new Ed25519PrivateKey(bytes.slice(0,crypto.privateKeyLength),bytes.slice(crypto.privateKeyLength,bytes.length)))}function unmarshalEd25519PublicKey(bytes){return bytes=ensureKey(bytes,crypto.publicKeyLength),new Ed25519PublicKey(bytes)}function generateKeyPair(_bits,cb){void 0===cb&&"function"==typeof _bits&&(cb=_bits),crypto.generateKey((err,keys)=>{if(err)return cb(err);let privkey;try{privkey=new Ed25519PrivateKey(keys.secretKey,keys.publicKey)}catch(err){return void cb(err)}cb(null,privkey)})}function generateKeyPairFromSeed(seed,_bits,cb){void 0===cb&&"function"==typeof _bits&&(cb=_bits),crypto.generateKeyFromSeed(seed,(err,keys)=>{if(err)return cb(err);let privkey;try{privkey=new Ed25519PrivateKey(keys.secretKey,keys.publicKey)}catch(err){return void cb(err)}cb(null,privkey)})}function ensure(cb){if("function"!=typeof cb)throw new Error("callback is required")}function ensureKey(key,length){if(Buffer.isBuffer(key)&&(key=new Uint8Array(key)),!(key instanceof Uint8Array)||key.length!==length)throw new Error("Key must be a Uint8Array or Buffer of length "+length);return key}const multihashing=__webpack_require__(22),protobuf=__webpack_require__(33),Buffer=__webpack_require__(5).Buffer,crypto=__webpack_require__(485),pbm=protobuf(__webpack_require__(128));class Ed25519PublicKey{constructor(key){this._key=ensureKey(key,crypto.publicKeyLength)}verify(data,sig,callback){ensure(callback),crypto.hashAndVerify(this._key,sig,data,callback)}marshal(){return Buffer.from(this._key)}get bytes(){return pbm.PublicKey.encode({Type:pbm.KeyType.Ed25519,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}class Ed25519PrivateKey{constructor(key,publicKey){this._key=ensureKey(key,crypto.privateKeyLength),this._publicKey=ensureKey(publicKey,crypto.publicKeyLength)}sign(message,callback){ensure(callback),crypto.hashAndSign(this._key,message,callback)}get public(){if(!this._publicKey)throw new Error("public key not provided");return new Ed25519PublicKey(this._publicKey)}marshal(){return Buffer.concat([Buffer.from(this._key),Buffer.from(this._publicKey)])}get bytes(){return pbm.PrivateKey.encode({Type:pbm.KeyType.Ed25519,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}module.exports={Ed25519PublicKey:Ed25519PublicKey,Ed25519PrivateKey:Ed25519PrivateKey,unmarshalEd25519PrivateKey:unmarshalEd25519PrivateKey,unmarshalEd25519PublicKey:unmarshalEd25519PublicKey,generateKeyPair:generateKeyPair,generateKeyPairFromSeed:generateKeyPairFromSeed}},function(module,exports,__webpack_require__){"use strict";const nacl=__webpack_require__(693),setImmediate=__webpack_require__(7),Buffer=__webpack_require__(5).Buffer;exports.publicKeyLength=nacl.sign.publicKeyLength,exports.privateKeyLength=nacl.sign.secretKeyLength,exports.generateKey=function(callback){const done=(err,res)=>setImmediate(()=>{callback(err,res)});let keys;try{keys=nacl.sign.keyPair()}catch(err){return done(err)}done(null,keys)},exports.generateKeyFromSeed=function(seed,callback){const done=(err,res)=>setImmediate(()=>callback(err,res));let keys;try{keys=nacl.sign.keyPair.fromSeed(seed)}catch(err){return done(err)}done(null,keys)},exports.hashAndSign=function(key,msg,callback){setImmediate(()=>{callback(null,Buffer.from(nacl.sign.detached(msg,key)))})},exports.hashAndVerify=function(key,sig,msg,callback){setImmediate(()=>{callback(null,nacl.sign.detached.verify(msg,sig,key))})}},function(module,exports,__webpack_require__){"use strict";const ecdh=__webpack_require__(483);module.exports=((curve,callback)=>{ecdh.generateEphmeralKeyPair(curve,callback)})},function(module,exports,__webpack_require__){"use strict";function isValidKeyType(keyType){return void 0!==supportedKeys[keyType.toLowerCase()]}const protobuf=__webpack_require__(33),keysPBM=protobuf(__webpack_require__(128));exports=module.exports;const supportedKeys={rsa:__webpack_require__(489),ed25519:__webpack_require__(484),secp256k1:__webpack_require__(479)(keysPBM,__webpack_require__(227))};exports.supportedKeys=supportedKeys,exports.keysPBM=keysPBM,exports.keyStretcher=__webpack_require__(488),exports.generateEphemeralKeyPair=__webpack_require__(486),exports.generateKeyPair=((type,bits,cb)=>{let key=supportedKeys[type.toLowerCase()];if(!key)return cb(new Error("invalid or unsupported key type"));key.generateKeyPair(bits,cb)}),exports.generateKeyPairFromSeed=((type,seed,bits,cb)=>{let key=supportedKeys[type.toLowerCase()];return key?"ed25519"!==type.toLowerCase()?cb(new Error("Seed key derivation is unimplemented for RSA or secp256k1")):void key.generateKeyPairFromSeed(seed,bits,cb):cb(new Error("invalid or unsupported key type"))}),exports.unmarshalPublicKey=(buf=>{const decoded=keysPBM.PublicKey.decode(buf);switch(decoded.Type){case keysPBM.KeyType.RSA:return supportedKeys.rsa.unmarshalRsaPublicKey(decoded.Data);case keysPBM.KeyType.Ed25519:return supportedKeys.ed25519.unmarshalEd25519PublicKey(decoded.Data);case keysPBM.KeyType.Secp256k1:if(supportedKeys.secp256k1)return supportedKeys.secp256k1.unmarshalSecp256k1PublicKey(decoded.Data);throw new Error("secp256k1 support requires libp2p-crypto-secp256k1 package");default:throw new Error("invalid or unsupported key type")}}),exports.marshalPublicKey=((key,type)=>{if(type=(type||"rsa").toLowerCase(),!isValidKeyType(type))throw new Error("invalid or unsupported key type");return key.bytes}),exports.unmarshalPrivateKey=((buf,callback)=>{const decoded=keysPBM.PrivateKey.decode(buf);switch(decoded.Type){case keysPBM.KeyType.RSA:return supportedKeys.rsa.unmarshalRsaPrivateKey(decoded.Data,callback);case keysPBM.KeyType.Ed25519:return supportedKeys.ed25519.unmarshalEd25519PrivateKey(decoded.Data,callback);case keysPBM.KeyType.Secp256k1:return supportedKeys.secp256k1?supportedKeys.secp256k1.unmarshalSecp256k1PrivateKey(decoded.Data,callback):callback(new Error("secp256k1 support requires libp2p-crypto-secp256k1 package"));default:callback(new Error("invalid or unsupported key type"))}}),exports.marshalPrivateKey=((key,type)=>{if(type=(type||"rsa").toLowerCase(),!isValidKeyType(type))throw new Error("invalid or unsupported key type");return key.bytes})},function(module,exports,__webpack_require__){"use strict";const whilst=__webpack_require__(76),Buffer=__webpack_require__(5).Buffer,hmac=__webpack_require__(225),cipherMap={"AES-128":{ivSize:16,keySize:16},"AES-256":{ivSize:16,keySize:32},Blowfish:{ivSize:8,cipherKeySize:32}};module.exports=((cipherType,hash,secret,callback)=>{const cipher=cipherMap[cipherType];if(!cipher)return callback(new Error("unkown cipherType passed"));if(!hash)return callback(new Error("unkown hashType passed"));const cipherKeySize=cipher.keySize,ivSize=cipher.ivSize,seed=Buffer.from("key expansion"),resultLength=2*(ivSize+cipherKeySize+20);hmac.create(hash,secret,(err,m)=>{if(err)return callback(err);m.digest(seed,(err,a)=>{function stretch(cb){m.digest(Buffer.concat([a,seed]),(err,b)=>{if(err)return cb(err);let todo=b.length;j+todo>resultLength&&(todo=resultLength-j),result.push(b),j+=todo,m.digest(a,(err,_a)=>{if(err)return cb(err);a=_a,cb()})})}function finish(err){if(err)return callback(err);const half=resultLength/2,resultBuffer=Buffer.concat(result),r1=resultBuffer.slice(0,half),r2=resultBuffer.slice(half,resultLength),createKey=res=>({iv:res.slice(0,ivSize),cipherKey:res.slice(ivSize,ivSize+cipherKeySize),macKey:res.slice(ivSize+cipherKeySize)});callback(null,{k1:createKey(r1),k2:createKey(r2)})}if(err)return callback(err);let result=[],j=0;whilst(()=>j{if(err)return callback(err);callback(null,new RsaPrivateKey(keys.privateKey,keys.publicKey))})}function unmarshalRsaPublicKey(bytes){return new RsaPublicKey(crypto.utils.pkixToJwk(bytes))}function generateKeyPair(bits,cb){crypto.generateKey(bits,(err,keys)=>{if(err)return cb(err);cb(null,new RsaPrivateKey(keys.privateKey,keys.publicKey))})}function ensure(cb){if("function"!=typeof cb)throw new Error("callback is required")}const multihashing=__webpack_require__(22),protobuf=__webpack_require__(33),crypto=__webpack_require__(226),pbm=protobuf(__webpack_require__(128));class RsaPublicKey{constructor(key){this._key=key}verify(data,sig,callback){ensure(callback),crypto.hashAndVerify(this._key,sig,data,callback)}marshal(){return crypto.utils.jwkToPkix(this._key)}get bytes(){return pbm.PublicKey.encode({Type:pbm.KeyType.RSA,Data:this.marshal()})}encrypt(bytes){return this._key.encrypt(bytes,"RSAES-PKCS1-V1_5")}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}class RsaPrivateKey{constructor(key,publicKey){this._key=key,this._publicKey=publicKey}genSecret(){return crypto.getRandomValues(new Uint8Array(16))}sign(message,callback){ensure(callback),crypto.hashAndSign(this._key,message,callback)}get public(){if(!this._publicKey)throw new Error("public key not provided");return new RsaPublicKey(this._publicKey)}decrypt(msg,callback){crypto.decrypt(this._key,msg,callback)}marshal(){return crypto.utils.jwkToPkcs1(this._key)}get bytes(){return pbm.PrivateKey.encode({Type:pbm.KeyType.RSA,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}module.exports={RsaPublicKey:RsaPublicKey,RsaPrivateKey:RsaPrivateKey,unmarshalRsaPublicKey:unmarshalRsaPublicKey,unmarshalRsaPrivateKey:unmarshalRsaPrivateKey,generateKeyPair:generateKeyPair}},function(module,exports,__webpack_require__){"use strict";const asn1=__webpack_require__(47),util=__webpack_require__(228),toBase64=util.toBase64,toBn=util.toBn,RSAPrivateKey=asn1.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}),AlgorithmIdentifier=asn1.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid({"1.2.840.113549.1.1.1":"rsa"}),this.key("none").optional().null_(),this.key("curve").optional().objid(),this.key("params").optional().seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()))}),PublicKey=asn1.define("RSAPublicKey",function(){this.seq().obj(this.key("algorithm").use(AlgorithmIdentifier),this.key("subjectPublicKey").bitstr())}),RSAPublicKey=asn1.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});exports.pkcs1ToJwk=function(bytes){const asn1=RSAPrivateKey.decode(bytes,"der");return{kty:"RSA",n:toBase64(asn1.modulus),e:toBase64(asn1.publicExponent),d:toBase64(asn1.privateExponent),p:toBase64(asn1.prime1),q:toBase64(asn1.prime2),dp:toBase64(asn1.exponent1),dq:toBase64(asn1.exponent2),qi:toBase64(asn1.coefficient),alg:"RS256",kid:"2011-04-29"}},exports.jwkToPkcs1=function(jwk){return RSAPrivateKey.encode({version:0,modulus:toBn(jwk.n),publicExponent:toBn(jwk.e),privateExponent:toBn(jwk.d),prime1:toBn(jwk.p),prime2:toBn(jwk.q),exponent1:toBn(jwk.dp),exponent2:toBn(jwk.dq),coefficient:toBn(jwk.qi)},"der")},exports.pkixToJwk=function(bytes){const ndata=PublicKey.decode(bytes,"der"),asn1=RSAPublicKey.decode(ndata.subjectPublicKey.data,"der");return{kty:"RSA",n:toBase64(asn1.modulus),e:toBase64(asn1.publicExponent),alg:"RS256",kid:"2011-04-29"}},exports.jwkToPkix=function(jwk){return PublicKey.encode({algorithm:{algorithm:"rsa",none:null},subjectPublicKey:{data:RSAPublicKey.encode({modulus:toBn(jwk.n),publicExponent:toBn(jwk.e)},"der")}},"der")}},function(module,exports,__webpack_require__){(function(process){function useColors(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(args){var useColors=this.useColors;if(args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff),useColors){var c="color: "+this.color;args.splice(1,0,c,"color: inherit");var index=0,lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){"%%"!==match&&(index++,"%c"===match&&(lastC=index))}),args.splice(lastC,0,c)}}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{null==namespaces?exports.storage.removeItem("debug"):exports.storage.debug=namespaces}catch(e){}}function load(){var r;try{r=exports.storage.debug}catch(e){}return!r&&void 0!==process&&"env"in process&&(r=process.env.DEBUG),r}exports=module.exports=__webpack_require__(492),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],exports.formatters.j=function(v){try{return JSON.stringify(v)}catch(err){return"[UnexpectedJSONParseError]: "+err.message}},exports.enable(load())}).call(exports,__webpack_require__(1))},function(module,exports,__webpack_require__){function selectColor(namespace){var i,hash=0;for(i in namespace)hash=(hash<<5)-hash+namespace.charCodeAt(i),hash|=0;return exports.colors[Math.abs(hash)%exports.colors.length]}function createDebug(namespace){function debug(){if(debug.enabled){var self=debug,curr=+new Date,ms=curr-(prevTime||curr);self.diff=ms,self.prev=prevTime,self.curr=curr,prevTime=curr;for(var args=new Array(arguments.length),i=0;icallback());this.libp2p.dial(peerInfo,multicodec,(err,conn)=>{if(err)return log.err(err),callback();this._onDial(peerInfo,conn,callback)})}_onDial(peerInfo,conn,callback){const idB58Str=peerInfo.id.toB58String();this.peers.has(idB58Str)||this.peers.set(idB58Str,new Peer(peerInfo));const peer=this.peers.get(idB58Str);peer.attachConnection(conn),peer.sendSubscriptions(this.subscriptions),setImmediate(()=>callback())}_onConnection(protocol,conn){conn.getPeerInfo((err,peerInfo)=>{if(err)return log.err("Failed to identify incomming conn",err),pull(pull.empty(),conn);const idB58Str=peerInfo.id.toB58String();this.peers.has(idB58Str)||(log("new peer",idB58Str),this.peers.set(idB58Str,new Peer(peerInfo))),this._processConnection(idB58Str,conn)})}_processConnection(idB58Str,conn){pull(conn,lp.decode(),pull.map(data=>pb.rpc.RPC.decode(data)),pull.drain(rpc=>this._onRpc(idB58Str,rpc),err=>this._onConnectionEnd(idB58Str,err)))}_onRpc(idB58Str,rpc){if(rpc){const subs=rpc.subscriptions,msgs=rpc.msgs;if(msgs&&msgs.length&&this._processRpcMessages(rpc.msgs),subs&&subs.length){const peer=this.peers.get(idB58Str);peer&&peer.updateSubscriptions(subs)}}}_processRpcMessages(msgs){msgs.forEach(msg=>{const seqno=utils.msgId(msg.from,msg.seqno.toString());this.cache.has(seqno)||(this.cache.put(seqno),this._emitMessages(msg.topicCIDs,[msg]),this._forwardMessages(msg.topicCIDs,[msg]))})}_onConnectionEnd(idB58Str,err){err&&"socket hang up"!==err.message&&log.err(err),this.peers.delete(idB58Str)}_emitMessages(topics,messages){topics.forEach(topic=>{this.subscriptions.has(topic)&&messages.forEach(message=>{this.emit(topic,message)})})}_forwardMessages(topics,messages){this.peers.forEach(peer=>{peer.isWritable&&utils.anyMatch(peer.topics,topics)&&(peer.sendMessages(messages),log("publish msgs on topics",topics,peer.info.id.toB58String()))})}start(callback){if(this.started)return setImmediate(()=>callback(new Error("already started")));this.libp2p.handle(multicodec,this._onConnection),this.libp2p.on("peer:connect",this._dialPeer),asyncEach(values(this.libp2p.peerBook.getAll()),(peer,cb)=>this._dialPeer(peer,cb),err=>{setImmediate(()=>{this.started=!0,callback(err)})})}stop(callback){if(!this.started)return setImmediate(()=>callback(new Error("not started yet")));this.libp2p.unhandle(multicodec),this.libp2p.removeListener("peer:connect",this._dialPeer),asyncEach(this.peers.values(),(peer,cb)=>peer.close(cb),err=>{if(err)return callback(err);this.peers=new Map,this.started=!1,callback()})}publish(topics,messages){assert(this.started,"FloodSub is not started"),log("publish",topics,messages),topics=ensureArray(topics),messages=ensureArray(messages);const from=this.libp2p.peerInfo.id.toB58String(),buildMessage=msg=>{const seqno=utils.randomSeqno();return this.cache.put(utils.msgId(from,seqno)),{from:from,data:msg,seqno:new Buffer(seqno),topicCIDs:topics}},msgObjects=messages.map(buildMessage);this._emitMessages(topics,msgObjects),this._forwardMessages(topics,messages.map(buildMessage))}subscribe(topics){function checkIfReady(peer){peer&&peer.isWritable?peer.sendSubscriptions(topics):setImmediate(checkIfReady.bind(peer))}assert(this.started,"FloodSub is not started"),topics=ensureArray(topics),topics.forEach(topic=>this.subscriptions.add(topic)),this.peers.forEach(peer=>checkIfReady(peer))}unsubscribe(topics){function checkIfReady(peer){peer&&peer.isWritable?peer.sendUnsubscriptions(topics):setImmediate(checkIfReady.bind(peer))}assert(this.started,"FloodSub is not started"),topics=ensureArray(topics),topics.forEach(topic=>this.subscriptions.delete(topic)),this.peers.forEach(peer=>checkIfReady(peer))}}module.exports=FloodSub},function(module,exports,__webpack_require__){"use strict";module.exports=` message RPC { repeated SubOpts subscriptions = 1; repeated Message msgs = 2; @@ -197,7 +197,7 @@ message TopicDescriptor { WOT = 2; // web of trust, certificates can allow publisher set to grow } } -}`},function(module,exports,__webpack_require__){"use strict";const lp=__webpack_require__(23),Pushable=__webpack_require__(30),pull=__webpack_require__(4),setImmediate=__webpack_require__(10),rpc=__webpack_require__(222).rpc.RPC;class Peer{constructor(info){this.info=info,this.conn=null,this.topics=new Set,this.stream=null}get isConnected(){return Boolean(this.conn)}get isWritable(){return Boolean(this.stream)}write(msg){if(!this.isWritable){const id=this.info.id.toB58String();throw new Error("No writable connection to "+id)}this.stream.push(msg)}attachConnection(conn){this.conn=conn,this.stream=new Pushable,pull(this.stream,lp.encode(),conn)}_sendRawSubscriptions(topics,subscribe){if(0!==topics.size){const subs=[];topics.forEach(topic=>{subs.push({subscribe:subscribe,topicCID:topic})}),this.write(rpc.encode({subscriptions:subs}))}}sendSubscriptions(topics){this._sendRawSubscriptions(topics,!0)}sendUnsubscriptions(topics){this._sendRawSubscriptions(topics,!1)}sendMessages(msgs){this.write(rpc.encode({msgs:msgs}))}updateSubscriptions(changes){changes.forEach(subopt=>{subopt.subscribe?this.topics.add(subopt.topicCID):this.topics.delete(subopt.topicCID)})}close(callback){!this.conn||this.stream,this.stream&&this.stream.end(),setImmediate(()=>{this.conn=null,this.stream=null,callback()})}}module.exports=Peer},function(module,exports,__webpack_require__){"use strict";const crypto=__webpack_require__(63);exports=module.exports,exports.randomSeqno=(()=>{return crypto.randomBytes(20).toString("hex")}),exports.msgId=((from,seqno)=>{return from+seqno}),exports.anyMatch=((a,b)=>{let bHas;bHas=Array.isArray(b)?val=>b.indexOf(val)>-1:val=>b.has(val);for(let val of a)if(bHas(val))return!0;return!1}),exports.ensureArray=(maybeArray=>{return Array.isArray(maybeArray)?maybeArray:[maybeArray]})},function(module,exports,__webpack_require__){"use strict";function getObservedAddrs(input){if(!hasObservedAddr(input))return[];let addrs=input.observedAddr;return Array.isArray(input.observedAddr)||(addrs=[addrs]),addrs.map(oa=>multiaddr(oa))}function hasObservedAddr(input){return input.observedAddr&&input.observedAddr.length>0}const PeerInfo=__webpack_require__(35),PeerId=__webpack_require__(22),multiaddr=__webpack_require__(24),pull=__webpack_require__(4),lp=__webpack_require__(23),msg=__webpack_require__(223);module.exports=((conn,callback)=>{pull(conn,lp.decode(),pull.take(1),pull.collect((err,data)=>{if(err)return callback(err);if(0===data.length)return callback(new Error("conn was closed, did not receive data"));const input=msg.decode(data[0]);PeerId.createFromPubKey(input.publicKey,(err,id)=>{if(err)return callback(err);const peerInfo=new PeerInfo(id);input.listenAddrs.map(multiaddr).forEach(ma=>peerInfo.multiaddrs.add(ma)),callback(null,peerInfo,getObservedAddrs(input))})}))})},function(module,exports,__webpack_require__){"use strict";exports=module.exports,exports.multicodec="/ipfs/id/1.0.0",exports.listener=__webpack_require__(492),exports.dialer=__webpack_require__(490)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const pull=__webpack_require__(4),lp=__webpack_require__(23),msg=__webpack_require__(223);module.exports=((conn,pInfoSelf)=>{conn.getObservedAddrs((err,observedAddrs)=>{if(!err){observedAddrs=observedAddrs[0];let publicKey=new Buffer(0);pInfoSelf.id.pubKey&&(publicKey=pInfoSelf.id.pubKey.bytes);const msgSend=msg.encode({protocolVersion:"ipfs/0.1.0",agentVersion:"na",publicKey:publicKey,listenAddrs:pInfoSelf.multiaddrs.toArray().map(ma=>ma.buffer),observedAddr:observedAddrs?observedAddrs.buffer:new Buffer("")});pull(pull.values([msgSend]),lp.encode(),conn)}})})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function create(rawConn,isListener){const stream=toStream(rawConn);stream.on("end",()=>stream.destroy());const mpx=new Multiplex({halfOpen:!0,initiator:!isListener});return pump(stream,mpx,stream),new Muxer(rawConn,mpx)}const Multiplex=__webpack_require__(576),toStream=__webpack_require__(251),MULTIPLEX_CODEC=__webpack_require__(224),Muxer=__webpack_require__(494),pump=__webpack_require__(631);exports=module.exports=create,exports.multicodec=MULTIPLEX_CODEC,exports.dialer=(conn=>create(conn,!1)),exports.listener=(conn=>create(conn,!0))},function(module,exports,__webpack_require__){"use strict";function noop(){}function catchError(stream){return{source:pull(stream.source,pullCatch(err=>{if("Channel destroyed"!==err.message)return!1})),sink:stream.sink}}const EventEmitter=__webpack_require__(11).EventEmitter,Connection=__webpack_require__(28).Connection,toPull=__webpack_require__(146),pull=__webpack_require__(4),pullCatch=__webpack_require__(595),setImmediate=__webpack_require__(10),MULTIPLEX_CODEC=__webpack_require__(224);module.exports=class MultiplexMuxer extends EventEmitter{constructor(conn,multiplex){super(),this.multiplex=multiplex,this.conn=conn,this.multicodec=MULTIPLEX_CODEC,multiplex.on("close",()=>this.emit("close")),multiplex.on("error",err=>this.emit("error",err)),multiplex.on("stream",(stream,id)=>{const muxedConn=new Connection(catchError(toPull.duplex(stream)),this.conn);this.emit("stream",muxedConn)})}newStream(callback){callback=callback||noop;let stream=this.multiplex.createStream();const conn=new Connection(catchError(toPull.duplex(stream)),this.conn);return setImmediate(()=>callback(null,conn)),conn}end(callback){callback=callback||noop,this.multiplex.once("close",callback),this.multiplex.destroy()}}},function(module,exports,__webpack_require__){"use strict";function mount(swarm){swarm.handle(PROTOCOL,(protocol,conn)=>{function next(){shake.read(PING_LENGTH,(err,buf)=>{if(err!==!0)return err?log.error(err):(shake.write(buf),next())})}const stream=handshake({timeout:0}),shake=stream.handshake;pull(conn,stream,conn),next()})}function unmount(swarm){swarm.unhandle(PROTOCOL)}const pull=__webpack_require__(4),handshake=__webpack_require__(55),constants=__webpack_require__(125),PROTOCOL=constants.PROTOCOL,PING_LENGTH=constants.PING_LENGTH,debug=__webpack_require__(3),log=debug("libp2p-ping");log.error=debug("libp2p-ping:error"),exports=module.exports,exports.mount=mount,exports.unmount=unmount},function(module,exports,__webpack_require__){"use strict";const handler=__webpack_require__(495);exports=module.exports=__webpack_require__(497),exports.mount=handler.mount,exports.unmount=handler.unmount},function(module,exports,__webpack_require__){"use strict";const EventEmitter=__webpack_require__(11).EventEmitter,pull=__webpack_require__(4),handshake=__webpack_require__(55),constants=__webpack_require__(125),util=__webpack_require__(498),rnd=util.rnd,debug=__webpack_require__(3),log=debug("libp2p-ping");log.error=debug("libp2p-ping:error");const PROTOCOL=constants.PROTOCOL,PING_LENGTH=constants.PING_LENGTH;class Ping extends EventEmitter{constructor(swarm,peer){super();let shake,stop=!1,self=this;log("dialing %s to %s",PROTOCOL,peer.id.toB58String()),swarm.dial(peer,PROTOCOL,(err,conn)=>{function next(){let start=new Date,buf=rnd(PING_LENGTH);shake.write(buf),shake.read(PING_LENGTH,(err,bufBack)=>{let end=new Date;if(err||!buf.equals(bufBack)){const err=new Error("Received wrong ping ack");return self.emit("error",err)}self.emit("ping",end-start),stop||next()})}if(err)return this.emit("error",err);const stream=handshake({timeout:0});shake=stream.handshake,pull(stream,conn,stream),next()}),this.stop=(()=>{!stop&&shake&&(stop=!0,pull(pull.empty(),shake.rest()))})}}module.exports=Ping},function(module,exports,__webpack_require__){"use strict";const crypto=__webpack_require__(63),constants=__webpack_require__(125);exports=module.exports,exports.rnd=(length=>{return length||(length=constants.PING_LENGTH),crypto.randomBytes(length)})},function(module,exports,__webpack_require__){"use strict";const PeerId=__webpack_require__(22),PeerInfo=__webpack_require__(35),multiaddr=__webpack_require__(24),EventEmitter=__webpack_require__(11).EventEmitter,debug=__webpack_require__(3),setImmediate=__webpack_require__(10),log=debug("libp2p:railing");log.error=debug("libp2p:railing:error");class Railing extends EventEmitter{constructor(bootstrapers){super(),this.bootstrapers=bootstrapers,this.interval=null}start(callback){setImmediate(()=>callback()),this.interval||(this.interval=setInterval(()=>{this.bootstrapers.forEach(candidate=>{const ma=multiaddr(candidate),peerId=PeerId.createFromB58String(ma.getPeerId());PeerInfo.create(peerId,(err,peerInfo)=>{if(err)return log.error("Invalid bootstrap peer id",err);peerInfo.multiaddrs.add(ma),this.emit("peer",peerInfo)})})},1e4))}stop(callback){setImmediate(callback),this.interval&&(clearInterval(this.interval),this.interval=null)}}module.exports=Railing},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function ensureBuffer(){return pull.map(c=>{return"string"==typeof c?new Buffer(c,"utf-8"):c})}const pull=__webpack_require__(4),lp=__webpack_require__(23),lpOpts={fixed:!0,bytes:4};exports.createBoxStream=((cipher,mac)=>{return pull(ensureBuffer(),pull.asyncMap((chunk,cb)=>{cipher.encrypt(chunk,(err,data)=>{if(err)return cb(err);mac.digest(data,(err,digest)=>{if(err)return cb(err);cb(null,Buffer.concat([data,digest]))})})}),lp.encode(lpOpts))}),exports.createUnboxStream=((decipher,mac)=>{return pull(ensureBuffer(),lp.decode(lpOpts),pull.asyncMap((chunk,cb)=>{const l=chunk.length,macSize=mac.length;if(l{return err?cb(err):macd.equals(expected)?void decipher.decrypt(data,(err,decrypted)=>{if(err)return cb(err);cb(null,decrypted)}):cb(new Error(`MAC Invalid: ${macd.toString("hex")} != ${expected.toString("hex")}`))})}))})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),waterfall=__webpack_require__(7),support=__webpack_require__(127),crypto=__webpack_require__(126),log=debug("libp2p:secio");log.error=debug("libp2p:secio:error"),module.exports=function(state,cb){log("2. exchange - start"),log("2. exchange - writing exchange"),waterfall([cb=>crypto.createExchange(state,cb),(ex,cb)=>{support.write(state,ex),support.read(state.shake,cb)},(msg,cb)=>{log("2. exchange - reading exchange"),crypto.verify(state,msg,cb)},cb=>crypto.generateKeys(state,cb)],err=>{if(err)return cb(err);log("2. exchange - finish"),cb()})}},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(4),handshake=__webpack_require__(55),debug=__webpack_require__(3),log=debug("libp2p:secio");log.error=debug("libp2p:secio:error");const etm=__webpack_require__(500),crypto=__webpack_require__(126);module.exports=function(state,cb){log("3. finish - start");const proto=state.protocols,stream=state.shake.rest(),shake=handshake({timeout:state.timeout},err=>{if(err)throw err});pull(stream,etm.createUnboxStream(proto.remote.cipher,proto.remote.mac),shake,etm.createBoxStream(proto.local.cipher,proto.local.mac),stream),shake.handshake.write(state.proposal.in.rand),shake.handshake.read(state.proposal.in.rand.length,(err,nonceBack)=>{const fail=err=>{log.error(err),state.secure.resolve({source:pull.error(err),sink(read){}}),cb(err)};if(err)return fail(err);try{crypto.verifyNonce(state,nonceBack)}catch(err){return fail(err)}log("3. finish - finish"),state.secure.resolve(shake.handshake.rest()),cb()})}},function(module,exports,__webpack_require__){"use strict";const series=__webpack_require__(33),propose=__webpack_require__(504),exchange=__webpack_require__(501),finish=__webpack_require__(502);module.exports=function(state){return series([cb=>propose(state,cb),cb=>exchange(state,cb),cb=>finish(state,cb)],err=>{state.cleanSecrets(),err&&(err===!0&&(err=new Error("Stream ended prematurely")),state.shake.abort(err))}),state.stream}},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),waterfall=__webpack_require__(7),support=__webpack_require__(127),crypto=__webpack_require__(126),log=debug("libp2p:secio");log.error=debug("libp2p:secio:error"),module.exports=function(state,cb){log("1. propose - start"),log("1. propose - writing proposal"),support.write(state,crypto.createProposal(state)),waterfall([cb=>support.read(state.shake,cb),(msg,cb)=>{log("1. propose - reading proposal",msg),crypto.identify(state,msg,cb)},cb=>crypto.selectProtocols(state,cb)],err=>{if(err)return cb(err);log("1. propose - finish"),cb()})}},function(module,exports,__webpack_require__){"use strict";module.exports=`message Propose { +}`},function(module,exports,__webpack_require__){"use strict";const lp=__webpack_require__(24),Pushable=__webpack_require__(31),pull=__webpack_require__(4),setImmediate=__webpack_require__(7),rpc=__webpack_require__(229).rpc.RPC;class Peer{constructor(info){this.info=info,this.conn=null,this.topics=new Set,this.stream=null}get isConnected(){return Boolean(this.conn)}get isWritable(){return Boolean(this.stream)}write(msg){if(!this.isWritable){const id=this.info.id.toB58String();throw new Error("No writable connection to "+id)}this.stream.push(msg)}attachConnection(conn){this.conn=conn,this.stream=new Pushable,pull(this.stream,lp.encode(),conn)}_sendRawSubscriptions(topics,subscribe){if(0!==topics.size){const subs=[];topics.forEach(topic=>{subs.push({subscribe:subscribe,topicCID:topic})}),this.write(rpc.encode({subscriptions:subs}))}}sendSubscriptions(topics){this._sendRawSubscriptions(topics,!0)}sendUnsubscriptions(topics){this._sendRawSubscriptions(topics,!1)}sendMessages(msgs){this.write(rpc.encode({msgs:msgs}))}updateSubscriptions(changes){changes.forEach(subopt=>{subopt.subscribe?this.topics.add(subopt.topicCID):this.topics.delete(subopt.topicCID)})}close(callback){!this.conn||this.stream,this.stream&&this.stream.end(),setImmediate(()=>{this.conn=null,this.stream=null,callback()})}}module.exports=Peer},function(module,exports,__webpack_require__){"use strict";const crypto=__webpack_require__(67);exports=module.exports,exports.randomSeqno=(()=>{return crypto.randomBytes(20).toString("hex")}),exports.msgId=((from,seqno)=>{return from+seqno}),exports.anyMatch=((a,b)=>{let bHas;bHas=Array.isArray(b)?val=>b.indexOf(val)>-1:val=>b.has(val);for(let val of a)if(bHas(val))return!0;return!1}),exports.ensureArray=(maybeArray=>{return Array.isArray(maybeArray)?maybeArray:[maybeArray]})},function(module,exports,__webpack_require__){"use strict";function getObservedAddrs(input){if(!hasObservedAddr(input))return[];let addrs=input.observedAddr;return Array.isArray(input.observedAddr)||(addrs=[addrs]),addrs.map(oa=>multiaddr(oa))}function hasObservedAddr(input){return input.observedAddr&&input.observedAddr.length>0}const PeerInfo=__webpack_require__(36),PeerId=__webpack_require__(23),multiaddr=__webpack_require__(26),pull=__webpack_require__(4),lp=__webpack_require__(24),msg=__webpack_require__(230);module.exports=((conn,callback)=>{pull(conn,lp.decode(),pull.take(1),pull.collect((err,data)=>{if(err)return callback(err);if(0===data.length)return callback(new Error("conn was closed, did not receive data"));const input=msg.decode(data[0]);PeerId.createFromPubKey(input.publicKey,(err,id)=>{if(err)return callback(err);const peerInfo=new PeerInfo(id);input.listenAddrs.map(multiaddr).forEach(ma=>peerInfo.multiaddrs.add(ma)),callback(null,peerInfo,getObservedAddrs(input))})}))})},function(module,exports,__webpack_require__){"use strict";exports=module.exports,exports.multicodec="/ipfs/id/1.0.0",exports.listener=__webpack_require__(501),exports.dialer=__webpack_require__(499)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const pull=__webpack_require__(4),lp=__webpack_require__(24),msg=__webpack_require__(230);module.exports=((conn,pInfoSelf)=>{conn.getObservedAddrs((err,observedAddrs)=>{if(!err){observedAddrs=observedAddrs[0];let publicKey=new Buffer(0);pInfoSelf.id.pubKey&&(publicKey=pInfoSelf.id.pubKey.bytes);const msgSend=msg.encode({protocolVersion:"ipfs/0.1.0",agentVersion:"na",publicKey:publicKey,listenAddrs:pInfoSelf.multiaddrs.toArray().map(ma=>ma.buffer),observedAddr:observedAddrs?observedAddrs.buffer:new Buffer("")});pull(pull.values([msgSend]),lp.encode(),conn)}})})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function create(rawConn,isListener){const stream=toStream(rawConn);stream.on("end",()=>stream.destroy());const mpx=new Multiplex({halfOpen:!0,initiator:!isListener});return pump(stream,mpx,stream),new Muxer(rawConn,mpx)}const Multiplex=__webpack_require__(592),toStream=__webpack_require__(259),MULTIPLEX_CODEC=__webpack_require__(231),Muxer=__webpack_require__(503),pump=__webpack_require__(649);exports=module.exports=create,exports.multicodec=MULTIPLEX_CODEC,exports.dialer=(conn=>create(conn,!1)),exports.listener=(conn=>create(conn,!0))},function(module,exports,__webpack_require__){"use strict";function noop(){}function catchError(stream){return{source:pull(stream.source,pullCatch(err=>{if("Channel destroyed"!==err.message)return!1})),sink:stream.sink}}const EventEmitter=__webpack_require__(10).EventEmitter,Connection=__webpack_require__(29).Connection,toPull=__webpack_require__(151),pull=__webpack_require__(4),pullCatch=__webpack_require__(613),setImmediate=__webpack_require__(7),MULTIPLEX_CODEC=__webpack_require__(231);module.exports=class MultiplexMuxer extends EventEmitter{constructor(conn,multiplex){super(),this.multiplex=multiplex,this.conn=conn,this.multicodec=MULTIPLEX_CODEC,multiplex.on("close",()=>this.emit("close")),multiplex.on("error",err=>this.emit("error",err)),multiplex.on("stream",(stream,id)=>{const muxedConn=new Connection(catchError(toPull.duplex(stream)),this.conn);this.emit("stream",muxedConn)})}newStream(callback){callback=callback||noop;let stream=this.multiplex.createStream();const conn=new Connection(catchError(toPull.duplex(stream)),this.conn);return setImmediate(()=>callback(null,conn)),conn}end(callback){callback=callback||noop,this.multiplex.once("close",callback),this.multiplex.destroy()}}},function(module,exports,__webpack_require__){"use strict";function mount(swarm){swarm.handle(PROTOCOL,(protocol,conn)=>{function next(){shake.read(PING_LENGTH,(err,buf)=>{if(err!==!0)return err?log.error(err):(shake.write(buf),next())})}const stream=handshake({timeout:0}),shake=stream.handshake;pull(conn,stream,conn),next()})}function unmount(swarm){swarm.unhandle(PROTOCOL)}const pull=__webpack_require__(4),handshake=__webpack_require__(58),constants=__webpack_require__(130),PROTOCOL=constants.PROTOCOL,PING_LENGTH=constants.PING_LENGTH,debug=__webpack_require__(19),log=debug("libp2p-ping");log.error=debug("libp2p-ping:error"),exports=module.exports,exports.mount=mount,exports.unmount=unmount},function(module,exports,__webpack_require__){"use strict";const handler=__webpack_require__(504);exports=module.exports=__webpack_require__(506),exports.mount=handler.mount,exports.unmount=handler.unmount},function(module,exports,__webpack_require__){"use strict";const EventEmitter=__webpack_require__(10).EventEmitter,pull=__webpack_require__(4),handshake=__webpack_require__(58),constants=__webpack_require__(130),util=__webpack_require__(507),rnd=util.rnd,debug=__webpack_require__(19),log=debug("libp2p-ping");log.error=debug("libp2p-ping:error");const PROTOCOL=constants.PROTOCOL,PING_LENGTH=constants.PING_LENGTH;class Ping extends EventEmitter{constructor(swarm,peer){super();let shake,stop=!1,self=this;log("dialing %s to %s",PROTOCOL,peer.id.toB58String()),swarm.dial(peer,PROTOCOL,(err,conn)=>{function next(){let start=new Date,buf=rnd(PING_LENGTH);shake.write(buf),shake.read(PING_LENGTH,(err,bufBack)=>{let end=new Date;if(err||!buf.equals(bufBack)){const err=new Error("Received wrong ping ack");return self.emit("error",err)}self.emit("ping",end-start),stop||next()})}if(err)return this.emit("error",err);const stream=handshake({timeout:0});shake=stream.handshake,pull(stream,conn,stream),next()}),this.stop=(()=>{!stop&&shake&&(stop=!0,pull(pull.empty(),shake.rest()))})}}module.exports=Ping},function(module,exports,__webpack_require__){"use strict";const crypto=__webpack_require__(67),constants=__webpack_require__(130);exports=module.exports,exports.rnd=(length=>{return length||(length=constants.PING_LENGTH),crypto.randomBytes(length)})},function(module,exports,__webpack_require__){(function(process){function useColors(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(args){var useColors=this.useColors;if(args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff),useColors){var c="color: "+this.color;args.splice(1,0,c,"color: inherit");var index=0,lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){"%%"!==match&&(index++,"%c"===match&&(lastC=index))}),args.splice(lastC,0,c)}}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{null==namespaces?exports.storage.removeItem("debug"):exports.storage.debug=namespaces}catch(e){}}function load(){var r;try{r=exports.storage.debug}catch(e){}return!r&&void 0!==process&&"env"in process&&(r=process.env.DEBUG),r}exports=module.exports=__webpack_require__(509),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],exports.formatters.j=function(v){try{return JSON.stringify(v)}catch(err){return"[UnexpectedJSONParseError]: "+err.message}},exports.enable(load())}).call(exports,__webpack_require__(1))},function(module,exports,__webpack_require__){function selectColor(namespace){var i,hash=0;for(i in namespace)hash=(hash<<5)-hash+namespace.charCodeAt(i),hash|=0;return exports.colors[Math.abs(hash)%exports.colors.length]}function createDebug(namespace){function debug(){if(debug.enabled){var self=debug,curr=+new Date,ms=curr-(prevTime||curr);self.diff=ms,self.prev=prevTime,self.curr=curr,prevTime=curr;for(var args=new Array(arguments.length),i=0;icallback()),this.interval||(this.interval=setInterval(()=>{this.bootstrapers.forEach(candidate=>{const ma=multiaddr(candidate),peerId=PeerId.createFromB58String(ma.getPeerId());PeerInfo.create(peerId,(err,peerInfo)=>{if(err)return log.error("Invalid bootstrap peer id",err);peerInfo.multiaddrs.add(ma),this.emit("peer",peerInfo)})})},1e4))}stop(callback){setImmediate(callback),this.interval&&(clearInterval(this.interval),this.interval=null)}}module.exports=Railing},function(module,exports,__webpack_require__){function selectColor(namespace){var i,hash=0;for(i in namespace)hash=(hash<<5)-hash+namespace.charCodeAt(i),hash|=0;return exports.colors[Math.abs(hash)%exports.colors.length]}function createDebug(namespace){function debug(){if(debug.enabled){var self=debug,curr=+new Date,ms=curr-(prevTime||curr);self.diff=ms,self.prev=prevTime,self.curr=curr,prevTime=curr;for(var args=new Array(arguments.length),i=0;i{return"string"==typeof c?new Buffer(c,"utf-8"):c})}const pull=__webpack_require__(4),lp=__webpack_require__(24),lpOpts={fixed:!0,bytes:4};exports.createBoxStream=((cipher,mac)=>{return pull(ensureBuffer(),pull.asyncMap((chunk,cb)=>{cipher.encrypt(chunk,(err,data)=>{if(err)return cb(err);mac.digest(data,(err,digest)=>{if(err)return cb(err);cb(null,Buffer.concat([data,digest]))})})}),lp.encode(lpOpts))}),exports.createUnboxStream=((decipher,mac)=>{return pull(ensureBuffer(),lp.decode(lpOpts),pull.asyncMap((chunk,cb)=>{const l=chunk.length,macSize=mac.length;if(l{return err?cb(err):macd.equals(expected)?void decipher.decrypt(data,(err,decrypted)=>{if(err)return cb(err);cb(null,decrypted)}):cb(new Error(`MAC Invalid: ${macd.toString("hex")} != ${expected.toString("hex")}`))})}))})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(91),waterfall=__webpack_require__(6),support=__webpack_require__(132),crypto=__webpack_require__(131),log=debug("libp2p:secio");log.error=debug("libp2p:secio:error"),module.exports=function(state,cb){log("2. exchange - start"),log("2. exchange - writing exchange"),waterfall([cb=>crypto.createExchange(state,cb),(ex,cb)=>{support.write(state,ex),support.read(state.shake,cb)},(msg,cb)=>{log("2. exchange - reading exchange"),crypto.verify(state,msg,cb)},cb=>crypto.generateKeys(state,cb)],err=>{if(err)return cb(err);log("2. exchange - finish"),cb()})}},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(4),handshake=__webpack_require__(58),debug=__webpack_require__(91),log=debug("libp2p:secio");log.error=debug("libp2p:secio:error");const etm=__webpack_require__(512),crypto=__webpack_require__(131);module.exports=function(state,cb){log("3. finish - start");const proto=state.protocols,stream=state.shake.rest(),shake=handshake({timeout:state.timeout},err=>{if(err)throw err});pull(stream,etm.createUnboxStream(proto.remote.cipher,proto.remote.mac),shake,etm.createBoxStream(proto.local.cipher,proto.local.mac),stream),shake.handshake.write(state.proposal.in.rand),shake.handshake.read(state.proposal.in.rand.length,(err,nonceBack)=>{const fail=err=>{log.error(err),state.secure.resolve({source:pull.error(err),sink(read){}}),cb(err)};if(err)return fail(err);try{crypto.verifyNonce(state,nonceBack)}catch(err){return fail(err)}log("3. finish - finish"),state.secure.resolve(shake.handshake.rest()),cb()})}},function(module,exports,__webpack_require__){"use strict";const series=__webpack_require__(32),propose=__webpack_require__(516),exchange=__webpack_require__(513),finish=__webpack_require__(514);module.exports=function(state){return series([cb=>propose(state,cb),cb=>exchange(state,cb),cb=>finish(state,cb)],err=>{state.cleanSecrets(),err&&(err===!0&&(err=new Error("Stream ended prematurely")),state.shake.abort(err))}),state.stream}},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(91),waterfall=__webpack_require__(6),support=__webpack_require__(132),crypto=__webpack_require__(131),log=debug("libp2p:secio");log.error=debug("libp2p:secio:error"),module.exports=function(state,cb){log("1. propose - start"),log("1. propose - writing proposal"),support.write(state,crypto.createProposal(state)),waterfall([cb=>support.read(state.shake,cb),(msg,cb)=>{log("1. propose - reading proposal",msg),crypto.identify(state,msg,cb)},cb=>crypto.selectProtocols(state,cb)],err=>{if(err)return cb(err);log("1. propose - finish"),cb()})}},function(module,exports,__webpack_require__){"use strict";module.exports=`message Propose { optional bytes rand = 1; optional bytes pubkey = 2; optional string exchanges = 3; @@ -208,20 +208,20 @@ message TopicDescriptor { message Exchange { optional bytes epubkey = 1; optional bytes signature = 2; -}`},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(4),Connection=__webpack_require__(28).Connection,handshake=__webpack_require__(503),State=__webpack_require__(507);module.exports={tag:"/secio/1.0.0",encrypt(local,key,insecure,callback){if(!local)throw new Error("no local id provided");if(!key)throw new Error("no local private key provided");if(!insecure)throw new Error("no insecure stream provided");callback||(callback=(err=>{err&&console.error(err)}));const state=new State(local,key,3e5,callback);return pull(insecure,handshake(state),insecure),new Connection(state.secure,insecure)}}},function(module,exports,__webpack_require__){"use strict";const handshake=__webpack_require__(55),deferred=__webpack_require__(95);class State{constructor(id,key,timeout,cb){"function"==typeof timeout&&(cb=timeout,timeout=void 0),this.setup(),this.id.local=id,this.key.local=key,this.timeout=timeout||6e4,cb=cb||(()=>{}),this.secure=deferred.duplex(),this.stream=handshake({timeout:this.timeout},cb),this.shake=this.stream.handshake,delete this.stream.handshake}setup(){this.id={local:null,remote:null},this.key={local:null,remote:null},this.shake=null,this.cleanSecrets()}cleanSecrets(){this.shared={},this.ephemeralKey={local:null,remote:null},this.proposal={in:null,out:null},this.proposalEncoded={in:null,out:null},this.protocols={local:null,remote:null},this.exchange={in:null,out:null}}}module.exports=State},function(module,exports,__webpack_require__){"use strict";const identify=__webpack_require__(491),multistream=__webpack_require__(136),waterfall=__webpack_require__(7),debug=__webpack_require__(3),log=debug("libp2p:swarm:connection"),setImmediate=__webpack_require__(10),protocolMuxer=__webpack_require__(88),plaintext=__webpack_require__(226);module.exports=function(swarm){return{addUpgrade(){},addStreamMuxer(muxer){swarm.muxers[muxer.multicodec]=muxer,swarm.handle(muxer.multicodec,(protocol,conn)=>{const muxedConn=muxer.listener(conn);return muxedConn.on("stream",conn=>{protocolMuxer(swarm.protocols,conn)}),swarm.identify&&(conn.getPeerInfo=(cb=>{const conn=muxedConn.newStream(),ms=new multistream.Dialer;waterfall([cb=>ms.handle(conn,cb),cb=>ms.select(identify.multicodec,cb),(conn,cb)=>identify.dialer(conn,cb),(peerInfo,observedAddrs,cb)=>{observedAddrs.forEach(oa=>{swarm._peerInfo.multiaddrs.addSafe(oa)}),cb(null,peerInfo)}],cb)}),conn.getPeerInfo((err,peerInfo)=>{if(err)return log("Identify not successful");const b58Str=peerInfo.id.toB58String();swarm.muxedConns[b58Str]={muxer:muxedConn},peerInfo.multiaddrs.size>0?peerInfo.connect(peerInfo.multiaddrs.toArray()[0]):peerInfo.connect(`/ipfs/${b58Str}`),peerInfo=swarm._peerBook.put(peerInfo),muxedConn.on("close",()=>{delete swarm.muxedConns[b58Str],peerInfo.disconnect(),peerInfo=swarm._peerBook.put(peerInfo),setImmediate(()=>swarm.emit("peer-mux-closed",peerInfo))}),setImmediate(()=>swarm.emit("peer-mux-established",peerInfo))})),conn})},reuse(){swarm.identify=!0,swarm.handle(identify.multicodec,(protocol,conn)=>{identify.listener(conn,swarm._peerInfo)})},crypto(tag,encrypt){tag||encrypt||(tag=plaintext.tag,encrypt=plaintext.encrypt),swarm.unhandle(swarm.crypto.tag),swarm.handle(tag,(protocol,conn)=>{const id=swarm._peerInfo.id,secure=encrypt(id,id.privKey,conn);protocolMuxer(swarm.protocols,secure)}),swarm.crypto={tag:tag,encrypt:encrypt}}}}},function(module,exports,__webpack_require__){"use strict";function dial(swarm){return(peer,protocol,callback)=>{function gotWarmedUpConn(conn){conn.setPeerInfo(pi),attemptMuxerUpgrade(conn,(err,muxer)=>{if(!protocol)return err&&(swarm.conns[b58Id]=conn),callback();err?protocolHandshake(conn,protocol,callback):gotMuxer(muxer)})}function gotMuxer(muxer){swarm.identify,openConnInMuxedConn(muxer,conn=>{protocolHandshake(conn,protocol,callback)})}function attemptMuxerUpgrade(conn,cb){function nextMuxer(key){log("selecting %s",key),ms.select(key,(err,conn)=>{if(err)return void(0===muxers.length?cb(new Error("could not upgrade to stream muxing")):nextMuxer(muxers.shift()));const muxedConn=swarm.muxers[key].dialer(conn);swarm.muxedConns[b58Id]={},swarm.muxedConns[b58Id].muxer=muxedConn,muxedConn.once("close",()=>{const b58Str=pi.id.toB58String();delete swarm.muxedConns[b58Str],pi.disconnect(),swarm._peerBook.get(b58Str).disconnect(),setImmediate(()=>swarm.emit("peer-mux-closed",pi))}),muxedConn.on("stream",conn=>{protocolMuxer(swarm.protocols,conn)}),setImmediate(()=>swarm.emit("peer-mux-established",pi)),cb(null,muxedConn)})}const muxers=Object.keys(swarm.muxers);if(0===muxers.length)return cb(new Error("no muxers available"));const ms=new multistream.Dialer;ms.handle(conn,err=>{if(err)return callback(new Error("multistream not supported"));nextMuxer(muxers.shift())})}function openConnInMuxedConn(muxer,cb){cb(muxer.newStream())}function protocolHandshake(conn,protocol,cb){const ms=new multistream.Dialer;ms.handle(conn,err=>{if(err)return callback(err);ms.select(protocol,(err,conn)=>{if(err)return callback(err);proxyConn.setInnerConn(conn),callback(null,proxyConn)})})}"function"==typeof protocol&&(callback=protocol,protocol=null),callback=callback||function(){};const pi=getPeerInfo(peer,swarm._peerBook),proxyConn=new Connection,b58Id=pi.id.toB58String();if(log("dialing %s",b58Id),swarm.muxedConns[b58Id]){if(!protocol)return callback();gotMuxer(swarm.muxedConns[b58Id].muxer)}else if(swarm.conns[b58Id]){const conn=swarm.conns[b58Id];swarm.conns[b58Id]=void 0,gotWarmedUpConn(conn)}else!function(pi,cb){function nextTransport(key){swarm.transport.dial(key,pi,(err,conn)=>{if(err)return 0===tKeys.length?cb(new Error("Could not dial in any of the transports")):nextTransport(tKeys.shift());!function(){const ms=new multistream.Dialer;ms.handle(conn,err=>{if(err)return cb(err);const id=swarm._peerInfo.id;log("selecting crypto: %s",swarm.crypto.tag),ms.select(swarm.crypto.tag,(err,conn)=>{if(err)return cb(err);cb(null,swarm.crypto.encrypt(id,id.privKey,conn))})})}()})}const tKeys=swarm.availableTransports(pi);if(0===tKeys.length)return cb(new Error("No available transport to dial to"));nextTransport(tKeys.shift())}(pi,(err,conn)=>{if(err)return callback(err);gotWarmedUpConn(conn)});return proxyConn}}const multistream=__webpack_require__(136),Connection=__webpack_require__(28).Connection,setImmediate=__webpack_require__(10),getPeerInfo=__webpack_require__(225),debug=__webpack_require__(3),log=debug("libp2p:swarm:dial"),protocolMuxer=__webpack_require__(88);module.exports=dial},function(module,exports,__webpack_require__){"use strict";function Swarm(peerInfo,peerBook){if(!(this instanceof Swarm))return new Swarm(peerInfo);assert(peerInfo,"You must provide a `peerInfo`"),assert(peerBook,"You must provide a `peerBook`"),this._peerInfo=peerInfo,this._peerBook=peerBook,this.transports={},this.conns={},this.muxedConns={},this.protocols={},this.muxers={},this.identify=!1,this.crypto=plaintext,this.transport=transport(this),this.connection=connection(this),this.availableTransports=(pi=>{const myAddrs=pi.multiaddrs.toArray();return Object.keys(this.transports).filter(ts=>this.transports[ts].filter(myAddrs).length>0)}),this.dial=dial(this),this.listen=(callback=>{each(this.availableTransports(peerInfo),(ts,cb)=>{this.transport.listen(ts,{},null,cb)},callback)}),this.handle=((protocol,handlerFunc,matchFunc)=>{this.protocols[protocol]={handlerFunc:handlerFunc,matchFunc:matchFunc}}),this.handle(this.crypto.tag,(protocol,conn)=>{const peerId=this._peerInfo.id,wrapped=this.crypto.encrypt(peerId,peerId.privKey,conn);return protocolMuxer(this.protocols,wrapped)}),this.unhandle=(protocol=>{this.protocols[protocol]&&delete this.protocols[protocol]}),this.hangUp=((peer,callback)=>{const peerInfo=getPeerInfo(peer,this.peerBook),key=peerInfo.id.toB58String();if(this.muxedConns[key]){const muxer=this.muxedConns[key].muxer;muxer.once("close",()=>{delete this.muxedConns[key],callback()}),muxer.end()}else callback()}),this.close=(callback=>{series([cb=>each(this.muxedConns,(conn,cb)=>{conn.muxer.end(err=>{if(err&&"Fatal error: OK"!==err.message)return cb(err);cb()})},cb),cb=>{each(this.transports,(transport,cb)=>{each(transport.listeners,(listener,cb)=>{listener.close(cb)},cb)},cb)}],callback)})}const util=__webpack_require__(32),EE=__webpack_require__(11).EventEmitter,each=__webpack_require__(19),series=__webpack_require__(33),transport=__webpack_require__(513),connection=__webpack_require__(508),getPeerInfo=__webpack_require__(225),dial=__webpack_require__(509),protocolMuxer=__webpack_require__(88),plaintext=__webpack_require__(226),assert=__webpack_require__(9);module.exports=Swarm,util.inherits(Swarm,EE)},function(module,exports,__webpack_require__){"use strict";const map=__webpack_require__(73),debug=__webpack_require__(3),log=debug("libp2p:swarm:dialer"),DialQueue=__webpack_require__(512);class LimitDialer{constructor(perPeerLimit,dialTimeout){log("create: %s peer limit, %s dial timeout",perPeerLimit,dialTimeout),this.perPeerLimit=perPeerLimit,this.dialTimeout=dialTimeout,this.queues=new Map}dialMany(peer,transport,addrs,callback){log("dialMany:start");const token={cancel:!1};map(addrs,(m,cb)=>{this.dialSingle(peer,transport,m,token,cb)},(err,results)=>{if(err)return callback(err);const success=results.filter(res=>res.conn);if(success.length>0)return log("dialMany:success"),callback(null,success[0]);log("dialMany:error");const error=new Error("Failed to dial any provided address");return error.errors=results.filter(res=>res.error).map(res=>res.error),callback(error)})}dialSingle(peer,transport,addr,token,callback){const ps=peer.toB58String();log("dialSingle: %s:%s",ps,addr.toString());let q;this.queues.has(ps)?q=this.queues.get(ps):(q=new DialQueue(this.perPeerLimit,this.dialTimeout),this.queues.set(ps,q)),q.push(transport,addr,token,callback)}}module.exports=LimitDialer},function(module,exports,__webpack_require__){"use strict";const Connection=__webpack_require__(28).Connection,pull=__webpack_require__(4),timeout=__webpack_require__(300),queue=__webpack_require__(106),debug=__webpack_require__(3),log=debug("libp2p:swarm:dialer:queue");class DialQueue{constructor(limit,dialTimeout){this.dialTimeout=dialTimeout,this.queue=queue((task,cb)=>{this._doWork(task.transport,task.addr,task.token,cb)},limit)}_doWork(transport,addr,token,callback){log("work"),this._dialWithTimeout(transport,addr,(err,conn)=>{return err?(log("work:error"),callback(null,{error:err})):token.cancel?(log("work:cancel"),pull(pull.empty(),conn),callback(null,{cancel:!0})):(token.cancel=!0,log("work:success"),(new Connection).setInnerConn(conn),void callback(null,{multiaddr:addr,conn:conn}))})}_dialWithTimeout(transport,addr,callback){timeout(cb=>{const conn=transport.dial(addr,err=>{if(err)return cb(err);cb(null,conn)})},this.dialTimeout)(callback)}push(transport,addr,token,callback){this.queue.push({transport:transport,addr:addr,token:token},callback)}}module.exports=DialQueue},function(module,exports,__webpack_require__){"use strict";function dialables(tp,multiaddrs){return tp.filter(multiaddrs)}function noop(){}const parallel=__webpack_require__(39),once=__webpack_require__(67),debug=__webpack_require__(3),log=debug("libp2p:swarm:transport"),protocolMuxer=__webpack_require__(88),LimitDialer=__webpack_require__(511);module.exports=function(swarm){const dialer=new LimitDialer(8,1e4);return{add(key,transport,options,callback){if("function"==typeof options&&(callback=options,options={}),callback=callback||noop,log("adding %s",key),swarm.transports[key])throw new Error("There is already a transport with this key");swarm.transports[key]=transport,swarm.transports[key].listeners||(swarm.transports[key].listeners=[]),callback()},dial(key,pi,callback){const t=swarm.transports[key];let multiaddrs=pi.multiaddrs.toArray();Array.isArray(multiaddrs)||(multiaddrs=[multiaddrs]),log("dialing %s",key,multiaddrs.map(m=>m.toString())),multiaddrs=dialables(t,multiaddrs),dialer.dialMany(pi.id,t,multiaddrs,(err,success)=>{if(err)return callback(err);pi.connect(success.multiaddr),swarm._peerBook.put(pi),callback(null,success.conn)})},listen(key,options,handler,callback){handler||(handler=protocolMuxer.bind(null,swarm.protocols));const multiaddrs=dialables(swarm.transports[key],swarm._peerInfo.multiaddrs.distinct()),transport=swarm.transports[key];transport.listeners||(transport.listeners=[]);let freshMultiaddrs=[];parallel(multiaddrs.map(ma=>{return cb=>{const done=once(cb),listener=transport.createListener(handler);listener.once("error",done),listener.listen(ma,err=>{if(err)return done(err);listener.removeListener("error",done),listener.getAddrs((err,addrs)=>{if(err)return done(err);freshMultiaddrs=freshMultiaddrs.concat(addrs),transport.listeners.push(listener),done()})})}}),err=>{if(err)return callback(err);swarm._peerInfo.multiaddrs.replace(multiaddrs,freshMultiaddrs),callback()})},close(key,callback){const transport=swarm.transports[key];if(!transport)return callback(new Error(`Trying to close non existing transport: ${key}`));parallel(transport.listeners.map(listener=>{return cb=>{listener.close(cb)}}),callback)}}}},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),log=debug("libp2p:webrtc-star"),multiaddr=__webpack_require__(24),mafmt=__webpack_require__(89),io=__webpack_require__(659),EE=__webpack_require__(11).EventEmitter,SimplePeer=__webpack_require__(658),PeerId=__webpack_require__(22),PeerInfo=__webpack_require__(35),Connection=__webpack_require__(28).Connection,toPull=__webpack_require__(146),once=__webpack_require__(67),setImmediate=__webpack_require__(10),webrtcSupport=__webpack_require__(683),utils=__webpack_require__(515),cleanUrlSIO=utils.cleanUrlSIO,noop=once(()=>{}),sioOptions={transports:["websocket"],"force new connection":!0};class WebRTCStar{constructor(options){options=options||{},this.maSelf=void 0,this.sioOptions={transports:["websocket"],"force new connection":!0},options.wrtc&&(this.wrtc=options.wrtc),this.discovery=new EE,this.discovery.start=(callback=>{setImmediate(callback)}),this.discovery.stop=(callback=>{setImmediate(callback)}),this.listenersRefs={},this._peerDiscovered=this._peerDiscovered.bind(this)}dial(ma,options,callback){"function"==typeof options&&(callback=options,options={}),callback=callback?once(callback):noop;const intentId=(~~(1e9*Math.random())).toString(36)+Date.now(),sioClient=this.listenersRefs[Object.keys(this.listenersRefs)[0]].io,spOptions={initiator:!0,trickle:!1};this.wrtc&&(spOptions.wrtc=this.wrtc);const channel=new SimplePeer(spOptions),conn=new Connection(toPull.duplex(channel));let connected=!1;return channel.on("signal",signal=>{sioClient.emit("ss-handshake",{intentId:intentId,srcMultiaddr:this.maSelf.toString(),dstMultiaddr:ma.toString(),signal:signal})}),channel.once("timeout",()=>callback(new Error("timeout"))),channel.once("error",err=>{connected||callback(err)}),sioClient.on("ws-handshake",offer=>{if(offer.intentId===intentId&&offer.err)return callback(new Error(offer.err));offer.intentId===intentId&&offer.answer&&(channel.once("connect",()=>{connected=!0,conn.destroy=channel.destroy.bind(channel),channel.once("close",()=>conn.destroy()),conn.getObservedAddrs=(callback=>callback(null,[ma])),callback(null,conn)}),channel.signal(offer.signal))}),conn}createListener(options,handler){"function"==typeof options&&(handler=options,options={});const listener=new EE;return listener.listen=((ma,callback)=>{function incommingDial(offer){if(!offer.answer&&!offer.err){const spOptions={trickle:!1};self.wrtc&&(spOptions.wrtc=self.wrtc);const channel=new SimplePeer(spOptions),conn=new Connection(toPull.duplex(channel));channel.once("connect",()=>{conn.getObservedAddrs=(callback=>{return callback(null,[offer.srcMultiaddr])}),listener.emit("connection",conn),handler(conn)}),channel.once("signal",signal=>{offer.signal=signal,offer.answer=!0,listener.io.emit("ss-handshake",offer)}),channel.signal(offer.signal)}}if(callback=callback?once(callback):noop,!webrtcSupport.support&&!this.wrtc)return setImmediate(()=>callback(new Error("no WebRTC support")));this.maSelf=ma;const sioUrl=cleanUrlSIO(ma);log("Dialing to Signalling Server on: "+sioUrl),listener.io=io.connect(sioUrl,sioOptions),listener.io.once("connect_error",callback),listener.io.once("error",err=>{listener.emit("error",err),listener.emit("close")}),listener.io.on("ws-handshake",incommingDial),listener.io.on("ws-peer",this._peerDiscovered),listener.io.on("connect",()=>{listener.io.emit("ss-join",ma.toString())}),listener.io.once("connect",()=>{listener.emit("listening"),callback()});const self=this}),listener.close=(callback=>{callback=callback?once(callback):noop,listener.io.emit("ss-leave"),setImmediate(()=>{listener.emit("close"),callback()})}),listener.getAddrs=(callback=>{setImmediate(()=>callback(null,[this.maSelf]))}),this.listenersRefs[multiaddr.toString()]=listener,listener}filter(multiaddrs){return Array.isArray(multiaddrs)||(multiaddrs=[multiaddrs]),multiaddrs.filter(ma=>mafmt.WebRTCStar.matches(ma))}_peerDiscovered(maStr){log("Peer Discovered:",maStr);const split=maStr.split("/ipfs/"),peerIdStr=split[split.length-1],peerId=PeerId.createFromB58String(peerIdStr),peerInfo=new PeerInfo(peerId);peerInfo.multiaddrs.add(multiaddr(maStr)),this.discovery.emit("peer",peerInfo)}}module.exports=WebRTCStar},function(module,exports,__webpack_require__){"use strict";function cleanUrlSIO(ma){const maStrSplit=ma.toString().split("/");if(multiaddr.isName(ma)){const wsProto=ma.protos()[2].name;if("ws"===wsProto)return"http://"+maStrSplit[3];if("wss"===wsProto)return"https://"+maStrSplit[3];throw new Error("invalid multiaddr"+ma.toString())}return"http://"+maStrSplit[3]+":"+maStrSplit[5]}const multiaddr=__webpack_require__(24);exports=module.exports,exports.cleanUrlSIO=cleanUrlSIO},function(module,exports,__webpack_require__){"use strict";const connect=__webpack_require__(624),mafmt=__webpack_require__(89),includes=__webpack_require__(229),Connection=__webpack_require__(28).Connection,maToUrl=__webpack_require__(518),debug=__webpack_require__(3),log=debug("libp2p:websockets:dialer"),createListener=__webpack_require__(517);class WebSockets{dial(ma,options,callback){"function"==typeof options&&(callback=options,options={}),callback=callback||function(){};const url=maToUrl(ma);log("dialing %s",url);const socket=connect(url,{binary:!0,onConnect:err=>callback(err)}),conn=new Connection(socket);return conn.getObservedAddrs=(callback=>callback(null,[ma])),conn.close=(callback=>socket.close(callback)),conn}createListener(options,handler){return"function"==typeof options&&(handler=options,options={}),createListener(options,handler)}filter(multiaddrs){return Array.isArray(multiaddrs)||(multiaddrs=[multiaddrs]),multiaddrs.filter(ma=>{return includes(ma.protoNames(),"ipfs")&&(ma=ma.decapsulate("ipfs")),mafmt.WebSockets.matches(ma)||mafmt.WebSocketsSecure.matches(ma)})}}module.exports=WebSockets},function(module,exports,__webpack_require__){"use strict";function noop(){}const Connection=__webpack_require__(28).Connection,includes=__webpack_require__(229),createServer=__webpack_require__(714)||noop;module.exports=((options,handler)=>{const listener=createServer(socket=>{socket.getObservedAddrs=(callback=>{return callback(null,[])}),handler(new Connection(socket))});let listeningMultiaddr;return listener._listen=listener.listen,listener.listen=((ma,callback)=>{callback=callback||noop,listeningMultiaddr=ma,includes(ma.protoNames(),"ipfs")&&(ma=ma.decapsulate("ipfs")),listener._listen(ma.toOptions(),callback)}),listener.getAddrs=(callback=>{callback(null,[listeningMultiaddr])}),listener})},function(module,exports,__webpack_require__){"use strict";function maToUrl(ma){const maStrSplit=ma.toString().split("/");let proto;try{proto=ma.protoNames().filter(proto=>{return"ws"===proto||"wss"===proto})[0]}catch(e){throw log(e),new Error("Not a valid websocket address",e)}let port;try{port=ma.stringTuples().filter(tuple=>{if(tuple[0]===ma.protos().filter(proto=>{return"tcp"===proto.name})[0].code)return!0})[0][1]}catch(e){log("No port, skipping")}return`${proto}://${maStrSplit[2]}${!port||80===port&&443===port?"":`:${port}`}`}const debug=__webpack_require__(3),log=debug("libp2p:websockets:dialer");module.exports=maToUrl},function(module,exports,__webpack_require__){"use strict";const EventEmitter=__webpack_require__(11).EventEmitter,assert=__webpack_require__(9),setImmediate=__webpack_require__(10),each=__webpack_require__(19),series=__webpack_require__(33),Ping=__webpack_require__(496),Swarm=__webpack_require__(510),PeerId=__webpack_require__(22),PeerInfo=__webpack_require__(35),PeerBook=__webpack_require__(245),mafmt=__webpack_require__(89),multiaddr=__webpack_require__(24);module.exports;class Node extends EventEmitter{constructor(_modules,_peerInfo,_peerBook,_options){if(super(),assert(_modules,"requires modules to equip libp2p with features"),assert(_peerInfo,"requires a PeerInfo instance"),this.modules=_modules,this.peerInfo=_peerInfo,this.peerBook=_peerBook||new PeerBook,_options=_options||{},this._isStarted=!1,this.swarm=new Swarm(this.peerInfo,this.peerBook),this.modules.connection&&this.modules.connection.muxer){let muxers=this.modules.connection.muxer;muxers=Array.isArray(muxers)?muxers:[muxers],muxers.forEach(muxer=>this.swarm.connection.addStreamMuxer(muxer)),this.swarm.connection.reuse(),this.swarm.on("peer-mux-established",peerInfo=>{this.emit("peer:connect",peerInfo),this.peerBook.put(peerInfo)}),this.swarm.on("peer-mux-closed",peerInfo=>{this.emit("peer:disconnect",peerInfo)})}if(this.modules.connection&&this.modules.connection.crypto){let cryptos=this.modules.connection.crypto;cryptos=Array.isArray(cryptos)?cryptos:[cryptos],cryptos.forEach(crypto=>{this.swarm.connection.crypto(crypto.tag,crypto.encrypt)})}if(this.modules.discovery){let discoveries=this.modules.discovery;discoveries=Array.isArray(discoveries)?discoveries:[discoveries],discoveries.forEach(discovery=>{discovery.on("peer",peerInfo=>this.emit("peer:discovery",peerInfo))})}Ping.mount(this.swarm),_modules.DHT&&(this._dht=new this.modules.DHT(this.swarm,{kBucketSize:20,datastoer:_options.DHT&&_options.DHT.datastore})),this.peerRouting={findPeer:(id,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.findPeer(id,callback)}},this.contentRouting={findProviders:(key,timeout,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.findProviders(key,timeout,callback)},provide:(key,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.provide(key,callback)}},this.dht={put:(key,value,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.put(key,value,callback)},get:(key,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.get(key,callback)},getMany(key,nVals,callback){if(!this._dht)return callback(new Error("DHT is not available"));this._dht.getMany(key,nVals,callback)}}}start(callback){if(!this.modules.transport)return callback(new Error("no transports were present"));let ws,transports=this.modules.transport;transports=Array.isArray(transports)?transports:[transports];const maOld=[],maNew=[];this.peerInfo.multiaddrs.forEach(ma=>{mafmt.IPFS.matches(ma)||(maOld.push(ma),maNew.push(ma.encapsulate("/ipfs/"+this.peerInfo.id.toB58String())))}),this.peerInfo.multiaddrs.replace(maOld,maNew);const multiaddrs=this.peerInfo.multiaddrs.toArray();transports.forEach(transport=>{transport.filter(multiaddrs).length>0?this.swarm.transport.add(transport.tag||transport.constructor.name,transport):transport.constructor&&"WebSockets"===transport.constructor.name&&(ws=transport)}),series([cb=>this.swarm.listen(cb),cb=>{if(ws&&this.swarm.transport.add(ws.tag||ws.constructor.name,ws),this.modules.discovery)return each(this.modules.discovery,(d,cb)=>d.start(cb),cb);cb()},cb=>{if(this._isStarted=!0,this._dht)return this._dht.start(cb);cb()},cb=>{this.emit("start"),cb()}],callback)}stop(callback){this._isStarted=!1,this.modules.discovery&&this.modules.discovery.forEach(discovery=>{setImmediate(()=>discovery.stop(()=>{}))}),series([cb=>{if(this._dht)return this._dht.stop(cb);cb()},cb=>this.swarm.close(cb),cb=>{this.emit("stop"),cb()}],callback)}isStarted(){return this._isStarted}ping(peer,callback){assert(this.isStarted(),"The libp2p node is not started yet"),this._getPeerInfo(peer,(err,peerInfo)=>{if(err)return callback(err);callback(null,new Ping(this.swarm,peerInfo))})}dial(peer,protocol,callback){assert(this.isStarted(),"The libp2p node is not started yet"),"function"==typeof protocol&&(callback=protocol,protocol=void 0),this._getPeerInfo(peer,(err,peerInfo)=>{if(err)return callback(err);this.swarm.dial(peerInfo,protocol,(err,conn)=>{if(err)return callback(err);this.peerBook.put(peerInfo),callback(null,conn)})})}hangUp(peer,callback){assert(this.isStarted(),"The libp2p node is not started yet"),this._getPeerInfo(peer,(err,peerInfo)=>{if(err)return callback(err);this.swarm.hangUp(peerInfo,callback)})}handle(protocol,handlerFunc,matchFunc){this.swarm.handle(protocol,handlerFunc,matchFunc)}unhandle(protocol){this.swarm.unhandle(protocol)}_getPeerInfo(peer,callback){let p;if(PeerInfo.isPeerInfo(peer))p=peer;else if(multiaddr.isMultiaddr(peer)){const peerIdB58Str=peer.getPeerId();try{p=this.peerBook.get(peerIdB58Str)}catch(err){p=new PeerInfo(PeerId.createFromB58String(peerIdB58Str))}p.multiaddrs.add(peer)}else{if(!PeerId.isPeerId(peer))return setImmediate(()=>callback(new Error("peer type not recognized")));{const peerIdB58Str=peer.toB58String();try{p=this.peerBook.get(peerIdB58Str)}catch(err){return this.peerRouting.findPeer(peer,callback)}}}setImmediate(()=>callback(null,p))}}module.exports=Node},function(module,exports,__webpack_require__){(function(global,module){function arrayFilter(array,predicate){for(var index=-1,length=array?array.length:0,resIndex=0,result=[];++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toFinite(value){if(!value)return 0===value?value:0;if((value=toNumber(value))===INFINITY||value===-INFINITY){return(value<0?-1:1)*MAX_INTEGER}return value===value?value:0}function toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value -;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,MAX_INTEGER=1.7976931348623157e308,NAN=NaN,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsOctal=/^0o[0-7]+$/i,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeParseInt=parseInt,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),nativeMax=Math.max,DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&"[object Promise]"!=getTag(Promise.resolve())||Set&&getTag(new Set)!=setTag||WeakMap&&"[object WeakMap]"!=getTag(new WeakMap))&&(getTag=function(value){var result=objectToString.call(value),Ctor=result==objectTag?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):void 0;if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return"[object Promise]";case setCtorString:return setTag;case weakMapCtorString:return"[object WeakMap]"}return result});var stringToPath=memoize(function(string){string=toString(string);var result=[];return reLeadingDot.test(string)&&result.push(""),string.replace(/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,function(match,number,quote,string){result.push(quote?string.replace(/\\(\\)?/g,"$1"):number||match)}),result}),find=function(findIndexFunc){return function(collection,predicate,fromIndex){var iterable=Object(collection);if(!isArrayLike(collection)){var iteratee=baseIteratee(predicate,3);collection=keys(collection),predicate=function(key){return iteratee(iterable[key],key,iterable)}}var index=findIndexFunc(collection,predicate,fromIndex);return index>-1?iterable[iteratee?collection[index]:index]:void 0}}(findIndex);memoize.Cache=MapCache;var isArray=Array.isArray,isTypedArray=nodeIsTypedArray?function(func){return function(value){return func(value)}}(nodeIsTypedArray):baseIsTypedArray;module.exports=find}).call(exports,__webpack_require__(2),__webpack_require__(18)(module))},function(module,exports,__webpack_require__){(function(global,module){function arrayMap(array,iteratee){for(var index=-1,length=array?array.length:0,result=Array(length);++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}function baseGet(object,path){path=isKey(path,object)?[path]:castPath(path);for(var index=0,length=path.length;null!=object&&indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,spreadableSymbol=Symbol?Symbol.isConcatSpreadable:void 0,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function has(object,path){return null!=object&&hasPath(object,path,baseHas)}var FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",symbolTag="[object Symbol]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,Map=getNative(root,"Map"),nativeCreate=getNative(Object,"create"),symbolProto=Symbol?Symbol.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var stringToPath=memoize(function(string){string=toString(string);var result=[];return reLeadingDot.test(string)&&result.push(""),string.replace(/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,function(match,number,quote,string){result.push(quote?string.replace(/\\(\\)?/g,"$1"):number||match)}),result});memoize.Cache=MapCache;var isArray=Array.isArray;module.exports=has}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(global,module){function arraySome(array,predicate){for(var index=-1,length=array?array.length:0;++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}var LARGE_ARRAY_SIZE=200,HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&"[object Promise]"!=getTag(Promise.resolve())||Set&&getTag(new Set)!=setTag||WeakMap&&"[object WeakMap]"!=getTag(new WeakMap))&&(getTag=function(value){var result=objectToString.call(value),Ctor=result==objectTag?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):void 0;if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return"[object Promise]";case setCtorString:return setTag;case weakMapCtorString:return"[object WeakMap]"}return result});var isArray=Array.isArray,isTypedArray=nodeIsTypedArray?function(func){return function(value){return func(value)}}(nodeIsTypedArray):baseIsTypedArray;module.exports=isEqualWith}).call(exports,__webpack_require__(2),__webpack_require__(18)(module))},function(module,exports){function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}var funcTag="[object Function]",genTag="[object GeneratorFunction]",objectProto=Object.prototype,objectToString=objectProto.toString;module.exports=isFunction},function(module,exports){function arrayMap(array,iteratee){for(var index=-1,length=array?array.length:0,result=Array(length);++index-1;)seen!==array&&splice.call(seen,fromIndex,1),splice.call(array,fromIndex,1);return array}function copyArray(source,array){var index=-1,length=source.length;for(array||(array=Array(length));++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index-1&&value%1==0&&value-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}function baseGet(object,path){path=isKey(path,object)?[path]:castPath(path);for(var index=0,length=path.length;null!=object&&indexother||valIsSymbol&&othIsDefined&&othIsReflexive&&!othIsNull&&!othIsSymbol||valIsNull&&othIsDefined&&othIsReflexive||!valIsDefined&&othIsReflexive||!valIsReflexive)return 1;if(!valIsNull&&!valIsSymbol&&!othIsSymbol&&value=ordersLength)return result;return result*("desc"==orders[index]?-1:1)}}return object.index-other.index}function equalArrays(array,other,equalFunc,customizer,bitmask,stack){var isPartial=bitmask&PARTIAL_COMPARE_FLAG,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,spreadableSymbol=Symbol?Symbol.isConcatSpreadable:void 0,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),nativeMax=Math.max,DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index1&&isIterateeCall(collection,iteratees[0],iteratees[1])?iteratees=[]:length>2&&isIterateeCall(iteratees[0],iteratees[1],iteratees[2])&&(iteratees=[iteratees[0]]),baseOrderBy(collection,baseFlatten(iteratees,1),[])});memoize.Cache=MapCache;var isArray=Array.isArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;module.exports=sortBy}).call(exports,__webpack_require__(2),__webpack_require__(18)(module))},function(module,exports,__webpack_require__){(function(global){function debounce(func,wait,options){function invokeFunc(time){var args=lastArgs,thisArg=lastThis;return lastArgs=lastThis=void 0,lastInvokeTime=time,result=func.apply(thisArg,args)}function leadingEdge(time){return lastInvokeTime=time,timerId=setTimeout(timerExpired,wait),leading?invokeFunc(time):result}function remainingWait(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime,result=wait-timeSinceLastCall;return maxing?nativeMin(result,maxWait-timeSinceLastInvoke):result}function shouldInvoke(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime;return void 0===lastCallTime||timeSinceLastCall>=wait||timeSinceLastCall<0||maxing&&timeSinceLastInvoke>=maxWait}function timerExpired(){var time=now();if(shouldInvoke(time))return trailingEdge(time);timerId=setTimeout(timerExpired,remainingWait(time))}function trailingEdge(time){return timerId=void 0,trailing&&lastArgs?invokeFunc(time):(lastArgs=lastThis=void 0,result)}function cancel(){void 0!==timerId&&clearTimeout(timerId),lastInvokeTime=0,lastArgs=lastCallTime=lastThis=timerId=void 0}function flush(){return void 0===timerId?result:trailingEdge(now())}function debounced(){var time=now(),isInvoking=shouldInvoke(time);if(lastArgs=arguments,lastThis=this,lastCallTime=time,isInvoking){if(void 0===timerId)return leadingEdge(lastCallTime);if(maxing)return timerId=setTimeout(timerExpired,wait),invokeFunc(lastCallTime)}return void 0===timerId&&(timerId=setTimeout(timerExpired,wait)),result}var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime=0,leading=!1,maxing=!1,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return wait=toNumber(wait)||0,isObject(options)&&(leading=!!options.leading,maxing="maxWait"in options,maxWait=maxing?nativeMax(toNumber(options.maxWait)||0,wait):maxWait,trailing="trailing"in options?!!options.trailing:trailing),debounced.cancel=cancel,debounced.flush=flush,debounced}function throttle(func,wait,options){var leading=!0,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return isObject(options)&&(leading="leading"in options?!!options.leading:leading,trailing="trailing"in options?!!options.trailing:trailing),debounce(func,wait,{leading:leading,maxWait:wait,trailing:trailing})}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}var FUNC_ERROR_TEXT="Expected a function",NAN=NaN,symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),objectProto=Object.prototype,objectToString=objectProto.toString,nativeMax=Math.max,nativeMin=Math.min,now=function(){return root.Date.now()};module.exports=throttle}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(global,module){function arrayIncludes(array,value){return!!(array?array.length:0)&&baseIndexOf(array,value,0)>-1}function arrayIncludesWith(array,value,comparator){for(var index=-1,length=array?array.length:0;++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function noop(){}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var createSet=Set&&1/setToArray(new Set([,-0]))[1]==INFINITY?function(values){return new Set(values)}:noop,getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&"[object Promise]"!=getTag(Promise.resolve())||Set&&getTag(new Set)!=setTag||WeakMap&&"[object WeakMap]"!=getTag(new WeakMap))&&(getTag=function(value){var result=objectToString.call(value),Ctor=result==objectTag?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):void 0;if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return"[object Promise]";case setCtorString:return setTag;case weakMapCtorString:return"[object WeakMap]"}return result});var stringToPath=memoize(function(string){string=toString(string);var result=[];return reLeadingDot.test(string)&&result.push(""),string.replace(/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,function(match,number,quote,string){result.push(quote?string.replace(/\\(\\)?/g,"$1"):number||match)}),result});memoize.Cache=MapCache;var isArray=Array.isArray,isTypedArray=nodeIsTypedArray?function(func){return function(value){return func(value)}}(nodeIsTypedArray):baseIsTypedArray;module.exports=uniqBy}).call(exports,__webpack_require__(2),__webpack_require__(18)(module))},function(module,exports,__webpack_require__){(function(global){function arrayIncludes(array,value){return!!(array?array.length:0)&&baseIndexOf(array,value,0)>-1}function arrayIncludesWith(array,value,comparator){for(var index=-1,length=array?array.length:0;++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++index-1&&value%1==0&&valueb?1:0};var lowerBoundKey=exports.lowerBoundKey=function(range){return hasKey(range,"gt")||hasKey(range,"gte")||hasKey(range,"min")||(range.reverse?hasKey(range,"end"):hasKey(range,"start"))||void 0},lowerBound=exports.lowerBound=function(range,def){var k=lowerBoundKey(range);return k?range[k]:def},lowerBoundInclusive=exports.lowerBoundInclusive=function(range){return!has(range,"gt")},upperBoundInclusive=exports.upperBoundInclusive=function(range){return!has(range,"lt")},lowerBoundExclusive=exports.lowerBoundExclusive=function(range){return!lowerBoundInclusive(range)},upperBoundExclusive=exports.upperBoundExclusive=function(range){return!upperBoundInclusive(range)},upperBoundKey=exports.upperBoundKey=function(range){return hasKey(range,"lt")||hasKey(range,"lte")||hasKey(range,"max")||(range.reverse?hasKey(range,"start"):hasKey(range,"end"))||void 0},upperBound=exports.upperBound=function(range,def){var k=upperBoundKey(range);return k?range[k]:def};exports.start=function(range,def){return range.reverse?upperBound(range,def):lowerBound(range,def)},exports.end=function(range,def){return range.reverse?lowerBound(range,def):upperBound(range,def)},exports.startInclusive=function(range){return range.reverse?upperBoundInclusive(range):lowerBoundInclusive(range)},exports.endInclusive=function(range){return range.reverse?lowerBoundInclusive(range):upperBoundInclusive(range)},exports.toLtgt=function(range,_range,map,lower,upper){_range=_range||{},map=map||id;var defaults=arguments.length>3,lb=exports.lowerBoundKey(range),ub=exports.upperBoundKey(range);return lb?"gt"===lb?_range.gt=map(range.gt,!1):_range.gte=map(range[lb],!1):defaults&&(_range.gte=map(lower,!1)),ub?"lt"===ub?_range.lt=map(range.lt,!0):_range.lte=map(range[ub],!0):defaults&&(_range.lte=map(upper,!0)),null!=range.reverse&&(_range.reverse=!!range.reverse),has(_range,"max")&&delete _range.max,has(_range,"min")&&delete _range.min,has(_range,"start")&&delete _range.start,has(_range,"end")&&delete _range.end,_range},exports.contains=function(range,key,compare){compare=compare||exports.compare;var lb=lowerBound(range);if(isDef(lb)){var cmp=compare(key,lb);if(cmp<0||0===cmp&&lowerBoundExclusive(range))return!1}var ub=upperBound(range);if(isDef(ub)){var cmp=compare(key,ub);if(cmp>0||0===cmp&&upperBoundExclusive(range))return!1}return!0},exports.filter=function(range,compare){return function(key){return exports.contains(range,key,compare)}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function TrieNode(type,key,value){if(Array.isArray(type))this.parseNode(type);else if(this.type=type,"branch"===type){var values=key;this.raw=Array.apply(null,Array(17)),values&&values.forEach(function(keyVal){this.set.apply(this,keyVal)})}else this.raw=Array(2),this.setValue(value),this.setKey(key)}function addHexPrefix(key,terminator){return key.length%2?key.unshift(1):(key.unshift(0),key.unshift(0)),terminator&&(key[0]+=2),key}function removeHexPrefix(val){return val=val[0]%2?val.slice(1):val.slice(2)}function isTerminator(key){return key[0]>1}function stringToNibbles(key){for(var bkey=new Buffer(key),nibbles=[],i=0;i>4,++q,nibbles[q]=bkey[i]%16}return nibbles}function nibblesToBuffer(arr){for(var buf=new Buffer(arr.length/2),i=0;i100)){var match=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);if(match){var n=parseFloat(match[1]);switch((match[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*y;case"days":case"day":case"d":return n*d;case"hours":case"hour":case"hrs":case"hr":case"h":return n*h;case"minutes":case"minute":case"mins":case"min":case"m":return n*m;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function fmtShort(ms){return ms>=d?Math.round(ms/d)+"d":ms>=h?Math.round(ms/h)+"h":ms>=m?Math.round(ms/m)+"m":ms>=s?Math.round(ms/s)+"s":ms+"ms"}function fmtLong(ms){return plural(ms,d,"day")||plural(ms,h,"hour")||plural(ms,m,"minute")||plural(ms,s,"second")||ms+" ms"}function plural(ms,n,name){if(!(ms0)return parse(val);if("number"===type&&isNaN(val)===!1)return options.long?fmtLong(val):fmtShort(val);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(val))}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function stringToStringTuples(str){const tuples=[],parts=str.split("/").slice(1);if(1===parts.length&&""===parts[0])return[];for(let p=0;p=parts.length)throw ParseError("invalid address: "+str);tuples.push([part,parts[p]])}else tuples.push([part])}return tuples}function stringTuplesToString(tuples){const parts=[];return map(tuples,function(tup){const proto=protoFromTuple(tup);parts.push(proto.name),tup.length>1&&parts.push(tup[1])}),"/"+parts.join("/")}function stringTuplesToTuples(tuples){return map(tuples,function(tup){Array.isArray(tup)||(tup=[tup]);const proto=protoFromTuple(tup);return tup.length>1?[proto.code,convert.toBuffer(proto.code,tup[1])]:[proto.code]})}function tuplesToStringTuples(tuples){return map(tuples,function(tup){const proto=protoFromTuple(tup);return tup.length>1?[proto.code,convert.toString(proto.code,tup[1])]:[proto.code]})}function tuplesToBuffer(tuples){return fromBuffer(Buffer.concat(map(tuples,function(tup){const proto=protoFromTuple(tup);let buf=new Buffer(varint.encode(proto.code));return tup.length>1&&(buf=Buffer.concat([buf,tup[1]])),buf})))}function sizeForAddr(p,addr){if(p.size>0)return p.size/8;if(0===p.size)return 0;{const size=varint.decode(addr);return size+varint.decode.bytes}}function bufferToTuples(buf){const tuples=[];let i=0;for(;ibuf.length)throw ParseError("Invalid address buffer: "+buf.toString("hex"));tuples.push([code,addr])}else tuples.push([code]),i+=n}return tuples}function bufferToString(buf){return stringTuplesToString(tuplesToStringTuples(bufferToTuples(buf)))}function stringToBuffer(str){return str=cleanPath(str),tuplesToBuffer(stringTuplesToTuples(stringToStringTuples(str)))}function fromString(str){return stringToBuffer(str)}function fromBuffer(buf){const err=validateBuffer(buf);if(err)throw err;return new Buffer(buf)}function validateBuffer(buf){try{bufferToTuples(buf)}catch(err){return err}}function isValidBuffer(buf){return void 0===validateBuffer(buf)}function cleanPath(str){return"/"+filter(str.trim().split("/")).join("/")}function ParseError(str){return new Error("Error parsing address: "+str)}function protoFromTuple(tup){return protocols(tup[0])}const map=__webpack_require__(128),filter=__webpack_require__(520),convert=__webpack_require__(563),protocols=__webpack_require__(133),varint=__webpack_require__(15);module.exports={stringToStringTuples:stringToStringTuples,stringTuplesToString:stringTuplesToString,tuplesToStringTuples:tuplesToStringTuples,stringTuplesToTuples:stringTuplesToTuples,bufferToTuples:bufferToTuples,tuplesToBuffer:tuplesToBuffer,bufferToString:bufferToString,stringToBuffer:stringToBuffer,fromString:fromString,fromBuffer:fromBuffer,validateBuffer:validateBuffer,isValidBuffer:isValidBuffer,cleanPath:cleanPath,ParseError:ParseError,protoFromTuple:protoFromTuple,sizeForAddr:sizeForAddr}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function Convert(proto,a){return a instanceof Buffer?Convert.toString(proto,a):Convert.toBuffer(proto,a)}function port2buf(port){const buf=new Buffer(2);return buf.writeUInt16BE(port,0),buf}function buf2port(buf){return buf.readUInt16BE(0)}function str2buf(str){const buf=new Buffer(str),size=new Buffer(varint.encode(buf.length));return Buffer.concat([size,buf])}function buf2str(buf){const size=varint.decode(buf);if(buf=buf.slice(varint.decode.bytes),buf.length!==size)throw new Error("inconsistent lengths");return buf.toString()}function mh2buf(hash){const mh=new Buffer(bs58.decode(hash)),size=new Buffer(varint.encode(mh.length));return Buffer.concat([size,mh])}function buf2mh(buf){const size=varint.decode(buf),address=buf.slice(varint.decode.bytes);if(address.length!==size)throw new Error("inconsistent lengths");return bs58.encode(address)}const ip=__webpack_require__(387),protocols=__webpack_require__(133),bs58=__webpack_require__(79),varint=__webpack_require__(15);module.exports=Convert,Convert.toString=function(proto,buf){switch(proto=protocols(proto),proto.code){case 4:case 41:return ip.toString(buf);case 6:case 17:case 33:case 132:return buf2port(buf);case 53:case 54:case 55:return buf2str(buf);case 421:return buf2mh(buf);default:return buf.toString("hex")}},Convert.toBuffer=function(proto,str){switch(proto=protocols(proto),proto.code){case 4:case 41:return ip.toBuffer(str);case 6:case 17:case 33:case 132:return port2buf(parseInt(str,10));case 53:case 54:case 55:return str2buf(str);case 421:return mh2buf(str);default:return new Buffer(str,"hex")}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";class Base{constructor(name,code,implementation,alphabet){this.name=name,this.code=code,this.alphabet=alphabet,implementation&&alphabet&&(this.engine=implementation(alphabet))}encode(stringOrBuffer){return this.engine.encode(stringOrBuffer)}decode(stringOrBuffer){return this.engine.decode(stringOrBuffer)}isImplemented(){return this.engine}}module.exports=Base},function(module,exports,__webpack_require__){"use strict";(function(Buffer){module.exports=function(alphabet){return{encode(input){return"string"==typeof input?new Buffer(input).toString("hex"):input.toString("hex")},decode(input){for(let char of input)if(alphabet.indexOf(char)<0)throw new Error("invalid base16 character");return new Buffer(input,"hex")}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const Base=__webpack_require__(564),baseX=__webpack_require__(302),base16=__webpack_require__(565),constants=[["base1","1","","1"],["base2","0",baseX,"01"],["base8","7",baseX,"01234567"],["base10","9",baseX,"0123456789"],["base16","f",base16,"0123456789abcdef"],["base32hex","v",baseX,"0123456789abcdefghijklmnopqrstuv"],["base32","b",baseX,"abcdefghijklmnopqrstuvwxyz234567"],["base32z","h",baseX,"ybndrfg8ejkmcpqxot1uwisza345h769"],["base58flickr","Z",baseX,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base58btc","z",baseX,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base64","m",baseX,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64url","u",baseX,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"]],names=constants.reduce((prev,tupple)=>{return prev[tupple[0]]=new Base(tupple[0],tupple[1],tupple[2],tupple[3]),prev},{}),codes=constants.reduce((prev,tupple)=>{return prev[tupple[1]]=names[tupple[0]],prev},{});module.exports={names:names,codes:codes}},function(module,exports,__webpack_require__){"use strict";exports.names={sha1:17,"sha2-256":18,"sha2-512":19,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,"murmur3-128":34,"murmur3-32":35,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664},exports.codes={17:"sha1",18:"sha2-256",19:"sha2-512",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384",29:"keccak-512",34:"murmur3-128",35:"murmur3-32",45569:"blake2b-8",45570:"blake2b-16",45571:"blake2b-24",45572:"blake2b-32",45573:"blake2b-40",45574:"blake2b-48",45575:"blake2b-56",45576:"blake2b-64",45577:"blake2b-72",45578:"blake2b-80",45579:"blake2b-88",45580:"blake2b-96",45581:"blake2b-104",45582:"blake2b-112",45583:"blake2b-120",45584:"blake2b-128",45585:"blake2b-136",45586:"blake2b-144",45587:"blake2b-152",45588:"blake2b-160",45589:"blake2b-168",45590:"blake2b-176",45591:"blake2b-184",45592:"blake2b-192",45593:"blake2b-200",45594:"blake2b-208",45595:"blake2b-216",45596:"blake2b-224",45597:"blake2b-232",45598:"blake2b-240",45599:"blake2b-248",45600:"blake2b-256",45601:"blake2b-264",45602:"blake2b-272",45603:"blake2b-280",45604:"blake2b-288",45605:"blake2b-296",45606:"blake2b-304",45607:"blake2b-312",45608:"blake2b-320",45609:"blake2b-328",45610:"blake2b-336",45611:"blake2b-344",45612:"blake2b-352",45613:"blake2b-360",45614:"blake2b-368",45615:"blake2b-376",45616:"blake2b-384",45617:"blake2b-392",45618:"blake2b-400",45619:"blake2b-408",45620:"blake2b-416",45621:"blake2b-424",45622:"blake2b-432",45623:"blake2b-440",45624:"blake2b-448",45625:"blake2b-456",45626:"blake2b-464",45627:"blake2b-472",45628:"blake2b-480",45629:"blake2b-488",45630:"blake2b-496",45631:"blake2b-504",45632:"blake2b-512",45633:"blake2s-8",45634:"blake2s-16",45635:"blake2s-24",45636:"blake2s-32",45637:"blake2s-40",45638:"blake2s-48",45639:"blake2s-56",45640:"blake2s-64",45641:"blake2s-72",45642:"blake2s-80",45643:"blake2s-88",45644:"blake2s-96",45645:"blake2s-104",45646:"blake2s-112",45647:"blake2s-120",45648:"blake2s-128",45649:"blake2s-136",45650:"blake2s-144",45651:"blake2s-152",45652:"blake2s-160",45653:"blake2s-168",45654:"blake2s-176",45655:"blake2s-184",45656:"blake2s-192",45657:"blake2s-200",45658:"blake2s-208",45659:"blake2s-216",45660:"blake2s-224",45661:"blake2s-232",45662:"blake2s-240",45663:"blake2s-248",45664:"blake2s-256"},exports.defaultLengths={17:20,18:32,19:64,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,45569:1,45570:2,45571:3,45572:4,45573:5,45574:6,45575:7,45576:8,45577:9,45578:10,45579:11,45580:12,45581:13,45582:14,45583:15,45584:16,45585:17,45586:18,45587:19,45588:20,45589:21,45590:22,45591:23,45592:24,45593:25,45594:26,45595:27,45596:28,45597:29,45598:30,45599:31,45600:32,45601:33,45602:34,45603:35,45604:36,45605:37,45606:38,45607:39,45608:40,45609:41,45610:42,45611:43,45612:44,45613:45,45614:46,45615:47,45616:48,45617:49,45618:50,45619:51,45620:52,45621:53,45622:54,45623:55,45624:56,45625:57,45626:58,45627:59,45628:60,45629:61,45630:62,45631:63,45632:64,45633:1,45634:2,45635:3,45636:4,45637:5,45638:6,45639:7,45640:8,45641:9,45642:10,45643:11,45644:12,45645:13,45646:14,45647:15,45648:16,45649:17,45650:18,45651:19,45652:20,45653:21,45654:22,45655:23,45656:24,45657:25,45658:26,45659:27,45660:28,45661:29,45662:30,45663:31,45664:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const blake=__webpack_require__(309),toCallback=__webpack_require__(239).toCallback,blake2b={init:blake.blake2bInit,update:blake.blake2bUpdate,digest:blake.blake2bFinal},blake2s={init:blake.blake2sInit,update:blake.blake2sUpdate,digest:blake.blake2sFinal},makeB2Hash=(size,hf)=>toCallback(buf=>{const ctx=hf.init(size,null);return hf.update(ctx,buf),new Buffer(hf.digest(ctx))});module.exports=(table=>{for(let i=0;i<64;i++)table[45569+i]=makeB2Hash(i+1,blake2b);for(let i=0;i<32;i++)table[45633+i]=makeB2Hash(i+1,blake2s)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function webCryptoHash(type){if(!webCrypto)throw new Error("Please use a browser with webcrypto support");return(data,callback)=>{const res=webCrypto.digest({name:type},data);if("function"!=typeof res.then)return res.onerror=(()=>{callback(`Error hashing data using ${type}`)}),void(res.oncomplete=(e=>{callback(null,e.target.result)}));nodeify(res.then(raw=>new Buffer(new Uint8Array(raw))),callback)}}function sha1(buf,callback){webCryptoHash("SHA-1")(buf,callback)}function sha2256(buf,callback){webCryptoHash("SHA-256")(buf,callback)}function sha2512(buf,callback){webCryptoHash("SHA-512")(buf,callback)}const nodeify=__webpack_require__(92),webCrypto=function(){return self.crypto?self.crypto.subtle||self.crypto.webkitSubtle:self.msCrypto?self.msCrypto.subtle:void 0}();module.exports={sha1:sha1,sha2256:sha2256,sha2512:sha2512}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const sha3=__webpack_require__(451),murmur3=__webpack_require__(582),utils=__webpack_require__(239),sha=__webpack_require__(569),toCallback=utils.toCallback,toBuf=utils.toBuf,fromString=utils.fromString,fromNumberTo32BitBuf=utils.fromNumberTo32BitBuf;module.exports={sha1:sha.sha1,sha2256:sha.sha2256,sha2512:sha.sha2512,sha3512:toCallback(toBuf(sha3.sha3_512)),sha3384:toCallback(toBuf(sha3.sha3_384)),sha3256:toCallback(toBuf(sha3.sha3_256)),sha3224:toCallback(toBuf(sha3.sha3_224)),shake128:toCallback(toBuf(sha3.shake_128,256)),shake256:toCallback(toBuf(sha3.shake_256,512)),keccak224:toCallback(toBuf(sha3.keccak_224)),keccak256:toCallback(toBuf(sha3.keccak_256)),keccak384:toCallback(toBuf(sha3.keccak_384)),keccak512:toCallback(toBuf(sha3.keccak_512)),murmur3128:toCallback(toBuf(fromString(murmur3.x64.hash128))),murmur332:toCallback(fromNumberTo32BitBuf(fromString(murmur3.x86.hash32))),addBlake:__webpack_require__(568)}},function(module,exports){function read(buf,offset){var b,res=0,offset=offset||0,shift=0,counter=offset,l=buf.length;do{if(counter>=l)return read.bytes=0,void(read.bytesRead=0);b=buf[counter++],res+=shift<28?(b&REST)<=MSB);return read.bytes=counter-offset,res}module.exports=read;var MSB=128,REST=127},function(module,exports){function encode(num,out,offset){out=out||[],offset=offset||0;for(var oldOffset=offset;num>=INT;)out[offset++]=255&num|MSB,num/=128;for(;num&MSBALL;)out[offset++]=255&num|MSB,num>>>=7;return out[offset]=0|num,encode.bytes=offset-oldOffset+1,out}module.exports=encode;var MSB=128,MSBALL=-128,INT=Math.pow(2,31)},function(module,exports,__webpack_require__){module.exports={encode:__webpack_require__(572),decode:__webpack_require__(571),encodingLength:__webpack_require__(574)}},function(module,exports){var N1=Math.pow(2,7),N2=Math.pow(2,14),N3=Math.pow(2,21),N4=Math.pow(2,28),N5=Math.pow(2,35),N6=Math.pow(2,42),N7=Math.pow(2,49),N8=Math.pow(2,56),N9=Math.pow(2,63);module.exports=function(value){return value{this.log("end"),this._read(),this.destroyed||(ended=!0,finished?this._finalize():this.halfOpen||this.end())}),this.once("finish",function onfinish(){if(!this.destroyed){if(!this._opened)return this.once("open",onfinish);this._lazy&&this.initiator&&this._open(),this._multiplex._send(this.channel<<3|(this.initiator?4:3),null),finished=!0,ended&&this._finalize()}})}destroy(err){this._destroy(err,!0)}_destroy(err,local){if(this.log("_destroy:"+(local?"local":"remote")),this.destroyed)return void this.log("already destroyed");this.destroyed=!0;const hasErrorListeners=EventEmitter.listenerCount(this,"error")>0;if(!err||local&&!hasErrorListeners||this.emit("error",err),this.emit("close"),local&&this._opened){this._lazy&&this.initiator&&this._open();const msg=err?new Buffer(err.message):null;try{this._multiplex._send(this.channel<<3|(this.initiator?6:5),msg)}catch(e){}}this._finalize()}_finalize(){this.finalized||(this.finalized=!0,this.emit("finalize"))}_write(data,enc,cb){return this.log("write: ",data.length),this._opened?this.destroyed?void cb():(this._lazy&&this.initiator&&this._open(),this._multiplex._send(this._dataHeader,data)?void cb():void this._multiplex._ondrain.push(cb)):void this.once("open",()=>{this._write(data,enc,cb)})}_read(){if(this._awaitDrain){const drained=this._awaitDrain;this._awaitDrain=0,this._multiplex._onchanneldrain(drained)}}_open(){let buf=null;Buffer.isBuffer(this.name)?buf=this.name:this.name!==this.channel.toString()&&(buf=new Buffer(this.name)),this._lazy=!1,this._multiplex._send(this.channel<<3|0,buf)}open(channel,initiator){this.log("open: "+channel),this.channel=channel,this.initiator=initiator,this._dataHeader=channel<<3|(initiator?2:1),this._opened=!0,!this._lazy&&this.initiator&&this._open(),this.emit("open")}}module.exports=Channel}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const stream=__webpack_require__(36),varint=__webpack_require__(573),duplexify=__webpack_require__(337),debug=__webpack_require__(3),Channel=__webpack_require__(575),SIGNAL_FLUSH=new Buffer([0]),empty=new Buffer(0);let pool=new Buffer(10240),used=0;class Multiplex extends stream.Duplex{constructor(opts,onchannel){super(),"function"==typeof opts&&(onchannel=opts,opts={}),opts||(opts={}),onchannel&&this.on("stream",onchannel),this.destroyed=!1,this.limit=opts.limit||0,null==opts.initiator&&(opts.initiator=!0),this.initiator=opts.initiator,this._corked=0,this._options=opts,this._binaryName=Boolean(opts.binaryName),this._local=[],this._remote=[],this._list=this._local,this._receiving=null,this._chunked=!1,this._state=0,this._type=0,this._channel=0,this._missing=0,this._message=null,this.log=debug("mplex:main:"+Math.floor(1e5*Math.random())),this.log("construction");let bufSize=100;this.limit&&(bufSize=varint.encodingLength(this.limit)),this._buf=new Buffer(bufSize),this._ptr=0,this._awaitChannelDrains=0,this._onwritedrain=null,this._ondrain=[],this._finished=!1,this.once("finish",this._clear),this._nextId=this.initiator?0:1}_nextStreamId(){let id=this._nextId;return this._nextId+=2,id}createStream(name,opts){if(this.destroyed)throw new Error("Multiplexer is destroyed");const id=this._nextStreamId();let channelName=this._name(name||id.toString());const options=Object.assign(this._options,opts);this.log("createStream: %s",id,channelName.toString(),options);const channel=new Channel(channelName,this,options);return this._addChannel(channel,id,this._local)}receiveStream(name,opts){if(this.destroyed)throw new Error("Multiplexer is destroyed");if(void 0===name||null===name)throw new Error("Name is needed when receiving a stream");const channelName=this._name(name);this.log("receiveStream: "+channelName.toString());const channel=new Channel(channelName,this,Object.assign(this._options,opts));if(this._receiving||(this._receiving={}),this._receiving[channel.name])throw new Error("You are already receiving this stream");return this._receiving[channel.name]=channel,channel}createSharedStream(name,opts){return this.log("createSharedStream"),duplexify(this.createStream(name,Object.assign(opts,{lazy:!0})),this.receiveStream(name,opts))}_name(name){return this._binaryName?Buffer.isBuffer(name)?name:new Buffer(name):name.toString()}_send(header,data){const len=data?data.length:0,oldUsed=used;let drained=!0;return this.log("_send",header,len),varint.encode(header,pool,used),used+=varint.encode.bytes,varint.encode(len,pool,used),used+=varint.encode.bytes,drained=this.push(pool.slice(oldUsed,used)),pool.length-used<100&&(pool=new Buffer(10240),used=0),data&&(drained=this.push(data)),drained}_addChannel(channel,id,list){return this.log("_addChannel",id),list[id]=channel,channel.on("finalize",()=>{this.log("_remove channel",id),list[id]=null}),channel.open(id,list===this._local),channel}_writeVarint(data,offset){for(offset;offset>3,this._list=1&this._type?this._local:this._remote;const chunked=this._list.length>this._channel&&this._list[this._channel]&&this._list[this._channel].chunked;this._chunked=!(1!==this._type&&2!==this._type)&&chunked}else if(this._missing=varint.decode(this._buf),this.limit&&this._missing>this.limit)return this._lengthError(data);return this._state++,this._ptr=0,offset+1}}return data.length}_lengthError(data){return this.destroy(new Error("Incoming message is too big")),data.length}_writeMessage(data,offset){const free=data.length-offset,missing=this._missing;if(!this._message){if(missing<=free)return this._missing=0,this._push(data.slice(offset,offset+missing)),offset+missing;if(this._chunked)return this._missing-=free,this._push(data.slice(offset,data.length)),data.length;this._message=new Buffer(missing)}return data.copy(this._message,this._ptr,offset,offset+missing),missing<=free?(this._missing=0,this._push(this._message),offset+missing):(this._missing-=free,this._ptr+=free,data.length)}_push(data){if(this.log("_push",data.length),this._missing||(this._ptr=0,this._state=0,this._message=null),0===this._type){if(this.log("open",this._channel),this.destroyed||this._finished)return;let name;name=this._binaryName?data:data.toString()||this._channel.toString(),this.log("open name",name);let channel;return void(this._receiving&&this._receiving[name]?(channel=this._receiving[name],delete this._receiving[name],this._addChannel(channel,this._channel,this._list)):(channel=new Channel(name,this,this._options),this.emit("stream",this._addChannel(channel,this._channel,this._list),channel.name)))}const stream=this._list[this._channel];if(stream)switch(this._type){case 5:case 6:const error=new Error(data.toString()||"Channel destroyed");return void stream._destroy(error,!1);case 3:case 4:return void stream.push(null);case 1:case 2:return void(stream.push(data)||(this._awaitChannelDrains++,stream._awaitDrain++))}}_onchanneldrain(drained){if(this._awaitChannelDrains-=drained,!this._awaitChannelDrains){const ondrain=this._onwritedrain;this._onwritedrain=null,ondrain&&ondrain()}}_write(data,enc,cb){if(this.log("_write",data.length),this._finished)return void cb();if(this._corked)return void this._onuncork(this._write.bind(this,data,enc,cb));if(data===SIGNAL_FLUSH)return void this._finish(cb);let offset=0;for(;offset{this._writableState.prefinished===!1&&(this._writableState.prefinished=!0),this.emit("prefinish"),this._onuncork(cb)})}cork(){1==++this._corked&&this.emit("cork")}uncork(){this._corked&&0==--this._corked&&this.emit("uncork")}end(data,enc,cb){return this.log("end"),"function"==typeof data&&(cb=data,data=void 0),"function"==typeof enc&&(cb=enc,enc=void 0),data&&this.write(data),this._writableState.ending||this.write(SIGNAL_FLUSH),stream.Writable.prototype.end.call(this,cb)}_onuncork(fn){if(this._corked)return void this.once("uncork",fn);fn()}_read(){for(;this._ondrain.length;)this._ondrain.shift()()}_clear(){if(this.log("_clear"),!this._finished){this._finished=!0;const list=this._local.concat(this._remote);this._local=[],this._remote=[],list.forEach(function(stream){stream&&stream._destroy(null,!1)}),this.push(null)}}finalize(){this._clear()}destroy(err){if(this.log("destroy"),this.destroyed)return void this.log("already destroyed");var list=this._local.concat(this._remote);this.destroyed=!0,err&&this.emit("error",err),this.emit("close"),list.forEach(function(stream){stream&&stream.emit("error",err||new Error("underlying socket has been closed"))}),this._clear()}}module.exports=Multiplex}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function stringify(buf){return buf.toString().slice(0,-1)}function collectLs(conn){let counter=0;return pull.take(msg=>{return varint.decode(msg),counter=varint.decode(msg,varint.decode.bytes),!0})}const varint=__webpack_require__(15),pull=__webpack_require__(4),pullLP=__webpack_require__(23),Connection=__webpack_require__(28).Connection,util=__webpack_require__(91),select=__webpack_require__(242),once=__webpack_require__(67),PROTOCOL_ID=__webpack_require__(240).PROTOCOL_ID;class Dialer{constructor(){this.conn=null,this.log=util.log.dialer()}handle(rawConn,callback){this.log("dialer handle conn"),callback=once(callback),pull(rawConn,select(PROTOCOL_ID,(err,conn)=>{if(err)return callback(err);this.log("handshake success"),this.conn=new Connection(conn,rawConn),callback()},this.log),rawConn)}select(protocol,callback){if(this.log("dialer select "+protocol),callback=once(callback),!this.conn)return callback(new Error("multistream handshake has not finalized yet"));const s=select(protocol,(err,conn)=>{if(err)return this.conn=new Connection(conn,this.conn),callback(err);callback(null,new Connection(conn,this.conn))},this.log);pull(this.conn,s,this.conn)}ls(callback){callback=once(callback);const lsStream=select("ls",(err,conn)=>{if(err)return callback(err);pull(conn,pullLP.decode(),collectLs(conn),pull.map(stringify),pull.collect((err,list)=>{if(err)return callback(err);callback(null,list.slice(1))}))},this.log);pull(this.conn,lsStream,this.conn)}}module.exports=Dialer},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(4),isFunction=__webpack_require__(526),assert=__webpack_require__(9),select=__webpack_require__(242),selectHandler=__webpack_require__(581),lsHandler=__webpack_require__(579),matchExact=__webpack_require__(241),util=__webpack_require__(91),Connection=__webpack_require__(28).Connection,PROTOCOL_ID=__webpack_require__(240).PROTOCOL_ID;class Listener{constructor(){this.handlers={ls:{handlerFunc:(protocol,conn)=>lsHandler(this,conn),matchFunc:matchExact}},this.log=util.log.listener()}handle(rawConn,callback){this.log("listener handle conn"),pull(rawConn,select(PROTOCOL_ID,(err,conn)=>{if(err)return callback(err);const shConn=new Connection(conn,rawConn);pull(shConn,selectHandler(shConn,this.handlers,this.log),shConn),callback()},this.log),rawConn)}addHandler(protocol,handlerFunc,matchFunc){this.log("adding handler: "+protocol),assert(isFunction(handlerFunc),"handler must be a function"),this.handlers[protocol]&&this.log("overwriting handler for "+protocol),matchFunc||(matchFunc=matchExact),this.handlers[protocol]={handlerFunc:handlerFunc,matchFunc:matchFunc}}}module.exports=Listener},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function lsHandler(self,conn){const protos=Object.keys(self.handlers).filter(key=>"ls"!==key),nProtos=protos.length,size=protos.reduce((size,proto)=>{const p=new Buffer(proto+"\n");return size+varint.encodingLength(p.length)},0),buf=Buffer.concat([new Buffer(varint.encode(nProtos)),new Buffer(varint.encode(size)),new Buffer("\n")]),encodedProtos=protos.map(proto=>{return new Buffer(proto+"\n")}),values=[buf].concat(encodedProtos);pull(pull.values(values),pullLP.encode(),conn)} -const pull=__webpack_require__(4),pullLP=__webpack_require__(23),varint=__webpack_require__(15);module.exports=lsHandler}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function matchSemver(myProtocol,senderProtocol,callback){const mps=myProtocol.split("/"),sps=senderProtocol.split("/"),myName=mps[1],myVersion=mps[2],senderName=sps[1],senderVersion=sps[2];if(myName!==senderName)return callback(null,!1);callback(null,semver.satisfies(myVersion,"~"+senderVersion))}const semver=__webpack_require__(651);module.exports=matchSemver},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function selectHandler(rawConn,handlersMap,log){function next(){lp.decodeFromReader(shake,(err,data)=>{if(err)return cb(err);log("received:",data.toString());const protocol=data.toString().slice(0,-1);matcher(protocol,handlersMap,(err,result)=>{if(err)return cb(err);const key=result;if(key){log("send ack back of: "+protocol),writeEncoded(shake,data,cb);const conn=new Connection(shake.rest(),rawConn);handlersMap[key].handlerFunc(protocol,conn)}else log("not supported protocol: "+protocol),writeEncoded(shake,new Buffer("na\n")),next()})})}const cb=err=>{log.error(err)},stream=handshake({timeout:6e4},cb),shake=stream.handshake;return next(),stream}function matcher(protocol,handlers,callback){const supportedProtocols=Object.keys(handlers);let supportedProtocol=!1;some(supportedProtocols,(sp,cb)=>{handlers[sp].matchFunc(sp,protocol,(err,result)=>{if(err)return cb(err);result&&(supportedProtocol=sp),cb()})},err=>{if(err)return callback(err);callback(null,supportedProtocol)})}const handshake=__webpack_require__(55),lp=__webpack_require__(23),Connection=__webpack_require__(28).Connection,writeEncoded=__webpack_require__(91).writeEncoded,some=__webpack_require__(299);module.exports=selectHandler}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(583)},function(module,exports,__webpack_require__){!function(root,undefined){"use strict";function _x86Multiply(m,n){return(65535&m)*n+(((m>>>16)*n&65535)<<16)}function _x86Rotl(m,n){return m<>>32-n}function _x86Fmix(h){return h^=h>>>16,h=_x86Multiply(h,2246822507),h^=h>>>13,h=_x86Multiply(h,3266489909),h^=h>>>16}function _x64Add(m,n){m=[m[0]>>>16,65535&m[0],m[1]>>>16,65535&m[1]],n=[n[0]>>>16,65535&n[0],n[1]>>>16,65535&n[1]];var o=[0,0,0,0];return o[3]+=m[3]+n[3],o[2]+=o[3]>>>16,o[3]&=65535,o[2]+=m[2]+n[2],o[1]+=o[2]>>>16,o[2]&=65535,o[1]+=m[1]+n[1],o[0]+=o[1]>>>16,o[1]&=65535,o[0]+=m[0]+n[0],o[0]&=65535,[o[0]<<16|o[1],o[2]<<16|o[3]]}function _x64Multiply(m,n){m=[m[0]>>>16,65535&m[0],m[1]>>>16,65535&m[1]],n=[n[0]>>>16,65535&n[0],n[1]>>>16,65535&n[1]];var o=[0,0,0,0];return o[3]+=m[3]*n[3],o[2]+=o[3]>>>16,o[3]&=65535,o[2]+=m[2]*n[3],o[1]+=o[2]>>>16,o[2]&=65535,o[2]+=m[3]*n[2],o[1]+=o[2]>>>16,o[2]&=65535,o[1]+=m[1]*n[3],o[0]+=o[1]>>>16,o[1]&=65535,o[1]+=m[2]*n[2],o[0]+=o[1]>>>16,o[1]&=65535,o[1]+=m[3]*n[1],o[0]+=o[1]>>>16,o[1]&=65535,o[0]+=m[0]*n[3]+m[1]*n[2]+m[2]*n[1]+m[3]*n[0],o[0]&=65535,[o[0]<<16|o[1],o[2]<<16|o[3]]}function _x64Rotl(m,n){return n%=64,32===n?[m[1],m[0]]:n<32?[m[0]<>>32-n,m[1]<>>32-n]:(n-=32,[m[1]<>>32-n,m[0]<>>32-n])}function _x64LeftShift(m,n){return n%=64,0===n?m:n<32?[m[0]<>>32-n,m[1]<>>1]),h=_x64Multiply(h,[4283543511,3981806797]),h=_x64Xor(h,[0,h[0]>>>1]),h=_x64Multiply(h,[3301882366,444984403]),h=_x64Xor(h,[0,h[0]>>>1])}var library={version:"3.0.1",x86:{},x64:{}};library.x86.hash32=function(key,seed){key=key||"",seed=seed||0;for(var remainder=key.length%4,bytes=key.length-remainder,h1=seed,k1=0,c1=3432918353,c2=461845907,i=0;i>>0},library.x86.hash128=function(key,seed){key=key||"",seed=seed||0;for(var remainder=key.length%16,bytes=key.length-remainder,h1=seed,h2=seed,h3=seed,h4=seed,k1=0,k2=0,k3=0,k4=0,c1=597399067,c2=2869860233,c3=951274213,c4=2716044179,i=0;i>>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)},library.x64.hash128=function(key,seed){key=key||"",seed=seed||0;for(var remainder=key.length%16,bytes=key.length-remainder,h1=[0,seed],h2=[0,seed],k1=[0,0],k2=[0,0],c1=[2277735313,289559509],c2=[1291169091,658871167],i=0;i>>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)},void 0!==module&&module.exports&&(exports=module.exports=library),exports.murmurHash3=library}()},function(module,exports,__webpack_require__){(function(global){var rvalidchars=/^[\],:{}\s]*$/;module.exports=function(data){return"string"==typeof data&&data?(data=data.replace(/^\s+/,"").replace(/\s+$/,""),global.JSON&&JSON.parse?JSON.parse(data):rvalidchars.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))?new Function("return "+data)():void 0):null}}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";const ensureMultiaddr=__webpack_require__(246).ensureMultiaddr,uniqBy=__webpack_require__(531);class MultiaddrSet{constructor(multiaddrs){this._multiaddrs=multiaddrs||[],this._observedMultiaddrs=[]}add(ma){ma=ensureMultiaddr(ma),this.has(ma)||this._multiaddrs.push(ma)}addSafe(ma){ma=ensureMultiaddr(ma),this._observedMultiaddrs.some((m,i)=>{if(m.equals(ma))return this.add(ma),this._observedMultiaddrs.splice(i,1),!0})||this._observedMultiaddrs.push(ma)}toArray(){return this._multiaddrs.slice()}get size(){return this._multiaddrs.length}forEach(fn){return this._multiaddrs.forEach(fn)}has(ma){return ma=ensureMultiaddr(ma),this._multiaddrs.some(m=>m.equals(ma))}delete(ma){ma=ensureMultiaddr(ma),this._multiaddrs.some((m,i)=>{if(m.equals(ma))return this._multiaddrs.splice(i,1),!0})}replace(existing,fresh){Array.isArray(existing)||(existing=[existing]),Array.isArray(fresh)||(fresh=[fresh]),existing.forEach(m=>this.delete(m)),fresh.forEach(m=>this.add(m))}clear(){this._multiaddrs=[]}distinct(){return uniqBy(this._multiaddrs,ma=>{return[ma.toOptions().port,ma.toOptions().transport].join()})}}module.exports=MultiaddrSet},function(module,exports,__webpack_require__){(function(process){function Promise(fn){function next(skipTimeout){waiting.length?(running=!0,waiting.shift()(skipTimeout||!1)):running=!1}function then(cb,eb){return new Promise(function(resolver){function done(skipTimeout){function timeoutDone(){var val;try{val=callback(value)}catch(ex){return resolver.reject(ex),next()}resolver.fulfill(val),next(!0)}var callback=isFulfilled?cb:eb;"function"==typeof callback?skipTimeout?timeoutDone():nextTick(timeoutDone):isFulfilled?(resolver.fulfill(value),next(skipTimeout)):(resolver.reject(value),next(skipTimeout))}waiting.push(done),isResolved&&!running&&next()})}if(!(this instanceof Promise))return"function"==typeof fn?new Promise(fn):defer();var value,isResolved=!1,isFulfilled=!1,waiting=[],running=!1;this.then=then,function(){function fulfill(val){isResolved||(isPromise(val)?val.then(fulfill,reject):(isResolved=isFulfilled=!0,value=val,next()))}function reject(err){isResolved||(isResolved=!0,isFulfilled=!1,value=err,next())}for(var resolver={fulfill:fulfill,reject:reject},i=0;i"!==tokens[0])throw new Error("Unexpected token in map type: "+tokens[0]);tokens.shift(),field.name=tokens.shift();break;case"repeated":case"required":case"optional":var t=tokens.shift();field.required="required"===t,field.repeated="repeated"===t,field.type=tokens.shift(),field.name=tokens.shift();break;case"[":field.options=onfieldoptions(tokens);break;case";":if(null===field.name)throw new Error("Missing field name");if(null===field.type)throw new Error("Missing type in message field: "+field.name);if(field.tag===-1)throw new Error("Missing tag number in message field: "+field.name);return tokens.shift(),field;default:throw new Error("Unexpected token in message field: "+tokens[0])}throw new Error("No ; found for message field")},onmessagebody=function(tokens){for(var body={enums:[],messages:[],fields:[],extends:[],extensions:null};tokens.length;)switch(tokens[0]){case"map":case"repeated":case"optional":case"required":body.fields.push(onfield(tokens));break;case"enum":body.enums.push(onenum(tokens));break;case"message":body.messages.push(onmessage(tokens));break;case"extensions":body.extensions=onextensions(tokens);break;case"oneof":tokens.shift();var name=tokens.shift();if("{"!==tokens[0])throw new Error("Unexpected token in oneof: "+tokens[0]);for(tokens.shift();"}"!==tokens[0];){tokens.unshift("optional");var field=onfield(tokens);field.oneof=name,body.fields.push(field)}tokens.shift();break;case"extend":body.extends.push(onextend(tokens));break;case";":tokens.shift();break;case"reserved":case"option":for(tokens.shift();";"!==tokens[0];)tokens.shift();break;default:tokens.unshift("optional"),body.fields.push(onfield(tokens))}return body},onextend=function(tokens){return{name:tokens[1],message:onmessage(tokens)}},onextensions=function(tokens){tokens.shift();var from=Number(tokens.shift());if(isNaN(from))throw new Error("Invalid from in extensions definition");if("to"!==tokens.shift())throw new Error("Expected keyword 'to' in extensions definition");var to=tokens.shift();if("max"===to&&(to=536870911),to=Number(to),isNaN(to))throw new Error("Invalid to in extensions definition");if(";"!==tokens.shift())throw new Error("Missing ; in extensions definition");return{from:from,to:to}},onmessage=function(tokens){tokens.shift();var lvl=1,body=[],msg={name:tokens.shift(),enums:[],extends:[],messages:[],fields:[]};if("{"!==tokens[0])throw new Error("Expected { but found "+tokens[0]);for(tokens.shift();tokens.length;){if("{"===tokens[0]?lvl++:"}"===tokens[0]&&lvl--,!lvl)return tokens.shift(),body=onmessagebody(body),msg.enums=body.enums,msg.messages=body.messages,msg.fields=body.fields,msg.extends=body.extends,msg.extensions=body.extensions,msg;body.push(tokens.shift())}if(lvl)throw new Error("No closing tag for message")},onpackagename=function(tokens){tokens.shift();var name=tokens.shift();if(";"!==tokens[0])throw new Error("Expected ; but found "+tokens[0]);return tokens.shift(),name},onsyntaxversion=function(tokens){if(tokens.shift(),"="!==tokens[0])throw new Error("Expected = but found "+tokens[0]);tokens.shift();var version=tokens.shift();switch(version){case'"proto2"':version=2;break;case'"proto3"':version=3;break;default:throw new Error("Expected protobuf syntax version but found "+version)}if(";"!==tokens[0])throw new Error("Expected ; but found "+tokens[0]);return tokens.shift(),version},onenumvalue=function(tokens){if(tokens.length<4)throw new Error("Invalid enum value: "+tokens.slice(0,3).join(" "));if("="!==tokens[1])throw new Error("Expected = but found "+tokens[1]);if(";"!==tokens[3]&&"["!==tokens[3])throw new Error("Expected ; or [ but found "+tokens[1]);var name=tokens.shift();tokens.shift();var val={value:null,options:{}};return val.value=Number(tokens.shift()),"["===tokens[0]&&(val.options=onfieldoptions(tokens)),tokens.shift(),{name:name,val:val}},onenum=function(tokens){tokens.shift();var options={},e={name:tokens.shift(),values:{},options:{}};if("{"!==tokens[0])throw new Error("Expected { but found "+tokens[0]);for(tokens.shift();tokens.length;){if("}"===tokens[0])return tokens.shift(),";"===tokens[0]&&tokens.shift(),e;if("option"!==tokens[0]){var val=onenumvalue(tokens);e.values[val.name]=val.val}else options=onoption(tokens),e.options[options.name]=options.value}throw new Error("No closing tag for enum")},onoption=function(tokens){for(var name=null,value=null;tokens.length;){if(";"===tokens[0])return tokens.shift(),{name:name,value:value};switch(tokens[0]){case"option":tokens.shift();var hasBracket="("===tokens[0];if(hasBracket&&tokens.shift(),name=tokens.shift(),hasBracket){if(")"!==tokens[0])throw new Error("Expected ) but found "+tokens[0]);tokens.shift()}"."===tokens[0][0]&&(name+=tokens.shift());break;case"=":if(tokens.shift(),null===name)throw new Error("Expected key for option with value: "+tokens[0]);if(value=function(value){return"true"===value||"false"!==value&&value.replace(/^"+|"+$/gm,"")}(tokens.shift()),"optimize_for"===name&&!/^(SPEED|CODE_SIZE|LITE_RUNTIME)$/.test(value))throw new Error("Unexpected value for option optimize_for: "+value);"{"===value&&(value=onoptionMap(tokens));break;default:throw new Error("Unexpected token in option: "+tokens[0])}}},onoptionMap=function(tokens){for(var map={};tokens.length;){if("}"===tokens[0])return tokens.shift(),map;var hasBracket="("===tokens[0];hasBracket&&tokens.shift();var key=tokens.shift();if(hasBracket){if(")"!==tokens[0])throw new Error("Expected ) but found "+tokens[0]);tokens.shift()}var value=null;switch(tokens[0]){case":":if(void 0!==map[key])throw new Error("Duplicate option map key "+key);tokens.shift(),value=function(value){return"true"===value||"false"!==value&&value.replace(/^"+|"+$/gm,"")}(tokens.shift()),"{"===value&&(value=onoptionMap(tokens)),map[key]=value;break;case"{":if(tokens.shift(),value=onoptionMap(tokens),void 0===map[key]&&(map[key]=[]),!Array.isArray(map[key]))throw new Error("Duplicate option map key "+key);map[key].push(value);break;default:throw new Error("Unexpected token in option map: "+tokens[0])}}throw new Error("No closing tag for option map")},onimport=function(tokens){tokens.shift();var file=tokens.shift().replace(/^"+|"+$/gm,"");if(";"!==tokens[0])throw new Error("Unexpected token: "+tokens[0]+'. Expected ";"');return tokens.shift(),file},onservice=function(tokens){tokens.shift();var service={name:tokens.shift(),methods:[],options:{}};if("{"!==tokens[0])throw new Error("Expected { but found "+tokens[0]);for(tokens.shift();tokens.length;){if("}"===tokens[0])return tokens.shift(),";"===tokens[0]&&tokens.shift(),service;switch(tokens[0]){case"option":var opt=onoption(tokens);if(void 0!==service.options[opt.name])throw new Error("Duplicate option "+opt.name);service.options[opt.name]=opt.value;break;case"rpc":service.methods.push(onrpc(tokens));break;default:throw new Error("Unexpected token in service: "+tokens[0])}}throw new Error("No closing tag for service")},onrpc=function(tokens){tokens.shift();var rpc={name:tokens.shift(),input_type:null,output_type:null,client_streaming:!1,server_streaming:!1,options:{}};if("("!==tokens[0])throw new Error("Expected ( but found "+tokens[0]);if(tokens.shift(),"stream"===tokens[0]&&(tokens.shift(),rpc.client_streaming=!0),rpc.input_type=tokens.shift(),")"!==tokens[0])throw new Error("Expected ) but found "+tokens[0]);if(tokens.shift(),"returns"!==tokens[0])throw new Error("Expected returns but found "+tokens[0]);if(tokens.shift(),"("!==tokens[0])throw new Error("Expected ( but found "+tokens[0]);if(tokens.shift(),"stream"===tokens[0]&&(tokens.shift(),rpc.server_streaming=!0),rpc.output_type=tokens.shift(),")"!==tokens[0])throw new Error("Expected ) but found "+tokens[0]);if(tokens.shift(),";"===tokens[0])return tokens.shift(),rpc;if("{"!==tokens[0])throw new Error("Expected { but found "+tokens[0]);for(tokens.shift();tokens.length;){if("}"===tokens[0])return tokens.shift(),";"===tokens[0]&&tokens.shift(),rpc;if("option"!==tokens[0])throw new Error("Unexpected token in rpc options: "+tokens[0]);var opt=onoption(tokens);if(void 0!==rpc.options[opt.name])throw new Error("Duplicate option "+opt.name);rpc.options[opt.name]=opt.value}throw new Error("No closing tag for rpc")},parse=function(buf){for(var tokens=tokenize(buf.toString()),i=0;imsg.extensions.to)throw new Error(msg.name+" does not declare "+field.tag+" as an extension number");msg.fields.push(field)})})}),schema.messages.forEach(function(msg){msg.fields.forEach(function(field){function enumNameIsFieldType(en){return en.name===field.type}function enumNameIsNestedEnumName(en){return en.name===nestedEnumName}var fieldSplit,messageName,nestedEnumName,message;if(field.options&&"true"===field.options.packed&&PACKABLE_TYPES.indexOf(field.type)===-1){if(field.type.indexOf(".")===-1){if(msg.enums&&msg.enums.some(enumNameIsFieldType))return}else{if(fieldSplit=field.type.split("."),fieldSplit.length>2)throw new Error("what is this?");if(messageName=fieldSplit[0],nestedEnumName=fieldSplit[1],schema.messages.some(function(msg){if(msg.name===messageName)return message=msg,msg}),message&&message.enums&&message.enums.some(enumNameIsNestedEnumName))return}throw new Error("Fields of type "+field.type+' cannot be declared [packed=true]. Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire types) can be declared "packed". See https://developers.google.com/protocol-buffers/docs/encoding#optional')}})}),schema};module.exports=parse},function(module,exports){var onfield=function(f,result){var prefix=f.repeated?"repeated":f.required?"required":"optional";"map"===f.type&&(prefix="map<"+f.map.from+","+f.map.to+">"),f.oneof&&(prefix="");var opts=Object.keys(f.options||{}).map(function(key){return key+" = "+f.options[key]}).join(",");return opts&&(opts=" ["+opts+"]"),result.push((prefix?prefix+" ":"")+("map"===f.map?"":f.type+" ")+f.name+" = "+f.tag+opts+";"),result},onmessage=function(m,result){result.push("message "+m.name+" {"),m.enums||(m.enums=[]),m.enums.forEach(function(e){result.push(onenum(e,[]))}),m.messages||(m.messages=[]),m.messages.forEach(function(m){result.push(onmessage(m,[]))});var oneofs={};return m.fields||(m.fields=[]),m.fields.forEach(function(f){f.oneof?(oneofs[f.oneof]||(oneofs[f.oneof]=[]),oneofs[f.oneof].push(onfield(f,[]))):result.push(onfield(f,[]))}),Object.keys(oneofs).forEach(function(n){oneofs[n].unshift("oneof "+n+" {"),oneofs[n].push("}"),result.push(oneofs[n])}),result.push("}",""),result},onenum=function(e,result){result.push("enum "+e.name+" {"),e.options||(e.options={});var options=onoption(e.options,[]);return options.length>1&&result.push(options.slice(0,-1)),Object.keys(e.values).map(function(v){var val=onenumvalue(e.values[v]);result.push([v+" = "+val+";"])}),result.push("}",""),result},onenumvalue=function(v,result){var opts=Object.keys(v.options||{}).map(function(key){return key+" = "+v.options[key]}).join(",");return opts&&(opts=" ["+opts+"]"),v.value+opts},onoption=function(o,result){var keys=Object.keys(o);return keys.forEach(function(option){var v=o[option];~option.indexOf(".")&&(option="("+option+")");var type=typeof v;"object"===type?(v=onoptionMap(v,[]),v.length&&result.push("option "+option+" = {",v,"};")):("string"===type&&"optimize_for"!==option&&(v='"'+v+'"'),result.push("option "+option+" = "+v+";"))}),keys.length>0&&result.push(""),result},onoptionMap=function(o,result){return Object.keys(o).forEach(function(k){var v=o[k],type=typeof v;"object"===type?Array.isArray(v)?v.forEach(function(v){v=onoptionMap(v,[]),v.length&&result.push(k+" {",v,"}")}):(v=onoptionMap(v,[]),v.length&&result.push(k+" {",v,"}")):("string"===type&&(v='"'+v+'"'),result.push(k+": "+v))}),result},onservices=function(s,result){return result.push("service "+s.name+" {"),s.options||(s.options={}),onoption(s.options,result),s.methods||(s.methods=[]),s.methods.forEach(function(m){result.push(onrpc(m,[]))}),result.push("}",""),result},onrpc=function(rpc,result){var def="rpc "+rpc.name+"(";rpc.client_streaming&&(def+="stream "),def+=rpc.input_type+") returns (",rpc.server_streaming&&(def+="stream "),def+=rpc.output_type+")",rpc.options||(rpc.options={});var options=onoption(rpc.options,[]);return options.length>1?result.push(def+" {",options.slice(0,-1),"}"):result.push(def+";"),result},indent=function(lvl){return function(line){return Array.isArray(line)?line.map(indent(lvl+" ")).join("\n"):lvl+line}};module.exports=function(schema){var result=[];return result.push('syntax = "proto'+schema.syntax+'";',""),schema.package&&result.push("package "+schema.package+";",""),schema.options||(schema.options={}),onoption(schema.options,result),schema.enums||(schema.enums=[]),schema.enums.forEach(function(e){onenum(e,result)}),schema.messages||(schema.messages=[]),schema.messages.forEach(function(m){onmessage(m,result)}),schema.services&&schema.services.forEach(function(s){onservices(s,result)}),result.map(indent("")).join("\n")}},function(module,exports){module.exports=function(sch){var noComments=function(line){var i=line.indexOf("//");return i>-1?line.slice(0,i):line},trim=function(line){return line.trim()};return sch.replace(/([;,{}\(\)=\:\[\]<>]|\/\*|\*\/)/g," $1 ").split(/\n/).map(trim).filter(Boolean).map(noComments).map(trim).filter(Boolean).join("\n").split(/\s+|\n+/gm).filter(function(){var inside=!1;return function(token){return"/*"===token?(inside=!0,!1):"*/"===token?(inside=!1,!1):!inside}}())}},function(module,exports,__webpack_require__){(function(Buffer){var encodings=__webpack_require__(592),varint=__webpack_require__(15),genobj=__webpack_require__(372),genfun=__webpack_require__(371),flatten=function(values){if(!values)return null;var result={};return Object.keys(values).forEach(function(k){result[k]=values[k].value}),result},skip=function(type,buffer,offset){switch(type){case 0:return varint.decode(buffer,offset),offset+varint.decode.bytes;case 1:return offset+8;case 2:var len=varint.decode(buffer,offset);return offset+varint.decode.bytes+len;case 3:case 4:throw new Error("Groups are not supported");case 5:return offset+4}throw new Error("Unknown wire type: "+type)},defined=function(val){return null!==val&&void 0!==val&&("number"!=typeof val||!isNaN(val))},isString=function(def){try{return!!def&&"string"==typeof JSON.parse(def)}catch(err){return!1}},defaultValue=function(f,def){if(f.map)return"{}";if(f.repeated)return"[]";switch(f.type){case"string":return isString(def)?def:'""';case"bool":return"true"===def?"true":"false";case"float":case"double":case"sfixed32":case"fixed32":case"varint":case"enum":case"uint64":case"uint32":case"int64":case"int32":case"sint64":case"sint32":return""+Number(def||0);default:return"null"}};module.exports=function(schema,extraEncodings){var messages={},enums={},cache={},visit=function(schema,prefix){schema.enums&&schema.enums.forEach(function(e){e.id=prefix+(prefix?".":"")+e.name,enums[e.id]=e,visit(e,e.id)}),schema.messages&&schema.messages.forEach(function(m){m.id=prefix+(prefix?".":"")+m.name,messages[m.id]=m,m.fields.forEach(function(f){if(f.map){var name="Map_"+f.map.from+"_"+f.map.to,map={name:name,enums:[],messages:[],fields:[{name:"key",type:f.map.from,tag:1,repeated:!1,required:!0},{name:"value",type:f.map.to,tag:2,repeated:!1,required:!1}],extensions:null,id:prefix+(prefix?".":"")+name};messages[map.id]||(messages[map.id]=map,schema.messages.push(map)),f.type=name,f.repeated=!0}}),visit(m,m.id)})};visit(schema,"");var compileEnum=function(e){var conditions=Object.keys(e.values).map(function(k){return"val !== "+parseInt(e.values[k].value,10)}).join(" && ");conditions||(conditions="true");var encode=genfun()("function encode (val, buf, offset) {")('if (%s) throw new Error("Invalid enum value: "+val)',conditions)("varint.encode(val, buf, offset)")("encode.bytes = varint.encode.bytes")("return buf")("}").toFunction({varint:varint}),decode=genfun()("function decode (buf, offset) {")("var val = varint.decode(buf, offset)")('if (%s) throw new Error("Invalid enum value: "+val)',conditions)("decode.bytes = varint.decode.bytes")("return val")("}").toFunction({varint:varint});return encodings.make(0,encode,decode,varint.encodingLength)},compileMessage=function(m,exports){m.messages.forEach(function(nested){exports[nested.name]=resolve(nested.name,m.id)}),m.enums.forEach(function(val){exports[val.name]=flatten(val.values)}), -exports.type=2,exports.message=!0,exports.name=m.name;var oneofs={};m.fields.forEach(function(f){f.oneof&&(oneofs[f.oneof]||(oneofs[f.oneof]=[]),oneofs[f.oneof].push(f.name))});var enc=m.fields.map(function(f){return resolve(f.type,m.id)}),forEach=function(fn){for(var i=0;i 1) throw new Error(%s)",oneofs[name].map(function(prop){return"+defined("+genobj("obj",prop)+")"}).join(" + "),msg)}),forEach(function(e,f,val,i){var packed=f.repeated&&f.options&&f.options.packed&&"false"!==f.options.packed,hl=varint.encodingLength(f.tag<<3|e.type);f.required?encodingLength("if (!defined(%s)) throw new Error(%s)",val,JSON.stringify(f.name+" is required")):encodingLength("if (defined(%s)) {",val),f.map&&(encodingLength()("var tmp = Object.keys(%s)",val)("for (var i = 0; i < tmp.length; i++) {")("tmp[i] = {key: tmp[i], value: %s[tmp[i]]}",val)("}"),val="tmp"),packed?(encodingLength()("var packedLen = 0")("for (var i = 0; i < %s.length; i++) {",val)("if (!defined(%s)) continue",val+"[i]")("var len = enc[%d].encodingLength(%s)",i,val+"[i]")("packedLen += len"),e.message&&encodingLength("packedLen += varint.encodingLength(len)"),encodingLength("}")("if (packedLen) {")("length += %d + packedLen + varint.encodingLength(packedLen)",hl)("}")):(f.repeated&&(encodingLength("for (var i = 0; i < %s.length; i++) {",val),val+="[i]",encodingLength("if (!defined(%s)) continue",val)),encodingLength("var len = enc[%d].encodingLength(%s)",i,val),e.message&&encodingLength("length += varint.encodingLength(len)"),encodingLength("length += %d + len",hl),f.repeated&&encodingLength("}")),f.required||encodingLength("}")}),encodingLength()("return length")("}"),encodingLength=encodingLength.toFunction({defined:defined,varint:varint,enc:enc});var encode=genfun()("function encode (obj, buf, offset) {")("if (!offset) offset = 0")("if (!buf) buf = new Buffer(encodingLength(obj))")("var oldOffset = offset");Object.keys(oneofs).forEach(function(name){var msg=JSON.stringify("only one of the properties defined in oneof "+name+" can be set");encode("if ((%s) > 1) throw new Error(%s)",oneofs[name].map(function(prop){return"+defined("+genobj("obj",prop)+")"}).join(" + "),msg)}),forEach(function(e,f,val,i){f.required?encode("if (!defined(%s)) throw new Error(%s)",val,JSON.stringify(f.name+" is required")):encode("if (defined(%s)) {",val);var j,packed=f.repeated&&f.options&&f.options.packed&&"false"!==f.options.packed,p=varint.encode(f.tag<<3|2),h=varint.encode(f.tag<<3|e.type);if(f.map&&(encode()("var tmp = Object.keys(%s)",val)("for (var i = 0; i < tmp.length; i++) {")("tmp[i] = {key: tmp[i], value: %s[tmp[i]]}",val)("}"),val="tmp"),packed){for(encode()("var packedLen = 0")("for (var i = 0; i < %s.length; i++) {",val)("if (!defined(%s)) continue",val+"[i]")("packedLen += enc[%d].encodingLength(%s)",i,val+"[i]")("}"),encode("if (packedLen) {"),j=0;j> 3")("switch (tag) {"),forEach(function(e,f,val,i){var packed=f.repeated&&f.options&&f.options.packed&&"false"!==f.options.packed;decode("case %d:",f.tag),f.oneof&&m.fields.forEach(function(otherField){otherField.oneof===f.oneof&&f.name!==otherField.name&&decode("delete %s",genobj("obj",otherField.name))}),packed&&decode()("var packedEnd = varint.decode(buf, offset)")("offset += varint.decode.bytes")("packedEnd += offset")("while (offset < packedEnd) {"),e.message?(decode("var len = varint.decode(buf, offset)"),decode("offset += varint.decode.bytes"),f.map?(decode("var tmp = enc[%d].decode(buf, offset, offset + len)",i),decode("%s[tmp.key] = tmp.value",val)):f.repeated?decode("%s.push(enc[%d].decode(buf, offset, offset + len))",val,i):decode("%s = enc[%d].decode(buf, offset, offset + len)",val,i)):f.repeated?decode("%s.push(enc[%d].decode(buf, offset))",val,i):decode("%s = enc[%d].decode(buf, offset)",val,i),decode("offset += enc[%d].decode.bytes",i),packed&&decode("}"),f.required&&decode("found%d = true",i),decode("break")}),decode()("default:")("offset = skip(prefix & 7, buf, offset)")("}")("}")("}"),decode=decode.toFunction({varint:varint,skip:skip,enc:enc}),encode.bytes=decode.bytes=0,exports.buffer=!0,exports.encode=encode,exports.decode=decode,exports.encodingLength=encodingLength,exports},resolve=function(name,from,compile){if(extraEncodings&&extraEncodings[name])return extraEncodings[name];if(encodings[name])return encodings[name];var m=(from?from+"."+name:name).split(".").map(function(part,i,list){return list.slice(0,i).concat(name).join(".")}).reverse().reduce(function(result,id){return result||messages[id]||enums[id]},null);if(compile===!1)return m;if(!m)throw new Error("Could not resolve "+name);return m.values?compileEnum(m):cache[m.id]||compileMessage(m,cache[m.id]={})};return(schema.enums||[]).concat((schema.messages||[]).map(function(message){return resolve(message.id)}))}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){var varint=__webpack_require__(15),svarint=__webpack_require__(657),encoder=function(type,encode,decode,encodingLength){return encode.bytes=decode.bytes=0,{type:type,encode:encode,decode:decode,encodingLength:encodingLength}};exports.make=encoder,exports.bytes=function(tag){var bufferLength=function(val){return Buffer.isBuffer(val)?val.length:Buffer.byteLength(val)},encodingLength=function(val){var len=bufferLength(val);return varint.encodingLength(len)+len},encode=function(val,buffer,offset){var oldOffset=offset,len=bufferLength(val);return varint.encode(len,buffer,offset),offset+=varint.encode.bytes,Buffer.isBuffer(val)?val.copy(buffer,offset):buffer.write(val,offset,len),offset+=len,encode.bytes=offset-oldOffset,buffer},decode=function(buffer,offset){var oldOffset=offset,len=varint.decode(buffer,offset);offset+=varint.decode.bytes;var val=buffer.slice(offset,offset+len);return offset+=val.length,decode.bytes=offset-oldOffset,val};return encoder(2,encode,decode,encodingLength)}(),exports.string=function(){var encodingLength=function(val){var len=Buffer.byteLength(val);return varint.encodingLength(len)+len},encode=function(val,buffer,offset){var oldOffset=offset,len=Buffer.byteLength(val);return varint.encode(len,buffer,offset,"utf-8"),offset+=varint.encode.bytes,buffer.write(val,offset,len),offset+=len,encode.bytes=offset-oldOffset,buffer},decode=function(buffer,offset){var oldOffset=offset,len=varint.decode(buffer,offset);offset+=varint.decode.bytes;var val=buffer.toString("utf-8",offset,offset+len);return offset+=len,decode.bytes=offset-oldOffset,val};return encoder(2,encode,decode,encodingLength)}(),exports.bool=function(){var encodingLength=function(val){return 1},encode=function(val,buffer,offset){return buffer[offset]=val?1:0,encode.bytes=1,buffer},decode=function(buffer,offset){var bool=buffer[offset]>0;return decode.bytes=1,bool};return encoder(0,encode,decode,encodingLength)}(),exports.int32=function(){var decode=function(buffer,offset){var val=varint.decode(buffer,offset);return decode.bytes=varint.decode.bytes,val>2147483647?val-4294967296:val},encodingLength=function(val){return varint.encodingLength(val<0?val+4294967296:val)};return encoder(0,varint.encode,decode,encodingLength)}(),exports.int64=function(){var decode=function(buffer,offset){var val=varint.decode(buffer,offset);if(val>=Math.pow(2,63)){for(var limit=9;255===buffer[offset+limit-1];)limit--;limit=limit||9;var subset=new Buffer(limit);buffer.copy(subset,0,offset,offset+limit),subset[limit-1]=127&subset[limit-1],val=-1*varint.decode(subset,0),decode.bytes=10}else decode.bytes=varint.decode.bytes;return val},encode=function(val,buffer,offset){if(val<0){var last=offset+9;for(varint.encode(val*-1,buffer,offset),offset+=varint.encode.bytes-1,buffer[offset]=128|buffer[offset];offset-1};return{enumerable:op("enumerable"),configurable:op("configurable"),writable:op("writable"),value:value}};return function(obj,key,value,options){var k;if(options=makeOptions(value,options),"object"==typeof key){for(k in key)Object.hasOwnProperty.call(key,k)&&(options.value=key[k],setProperty(obj,k,options));return obj}return setProperty(obj,key,options)}})},function(module,exports,__webpack_require__){"use strict";var through=__webpack_require__(98),Buffer=__webpack_require__(6).Buffer;module.exports=function(size,opts){opts||(opts={}),"object"==typeof size&&(opts=size,size=opts.size),size=size||512;var zeroPadding;zeroPadding=!opts.nopad&&(void 0===opts.zeroPadding||opts.zeroPadding);var buffered=[],bufferedBytes=0,emittedChunk=!1;return through(function(data){for("number"==typeof data&&(data=Buffer([data])),bufferedBytes+=data.length,buffered.push(data);bufferedBytes>=size;){var b=Buffer.concat(buffered);bufferedBytes-=size,this.queue(b.slice(0,size)),buffered=[b.slice(size,b.length)],emittedChunk=!0}},function(end){if(opts.emitEmpty&&!emittedChunk||bufferedBytes){if(zeroPadding){var zeroes=Buffer.alloc(size-bufferedBytes);zeroes.fill(0),buffered.push(zeroes)}buffered&&(this.queue(Buffer.concat(buffered)),buffered=null)}this.queue(null)})}},function(module,exports){module.exports=function(onError){onError=onError||function(){};var errd;return function(read){return function(abort,cb){read(abort,function(end,data){if(errd)return cb(!0);if(end&&end!==!0){var _end=onError(end);return _end===!1?cb(end):_end&&_end!==!0?(errd=!0,cb(null,_end)):cb(!0)}cb(end,data)})}}}},function(module,exports){module.exports=function(){function delayed(_read){return stream?stream(_read):(read=_read,function(_abort,_cb){reader?reader(_abort,_cb):(abort=_abort,cb=_cb)})}var read,reader,cb,abort,stream;return delayed.resolve=function(_stream){if(stream)throw new Error("already resolved");if(!(stream=_stream))throw new Error("resolve *must* be passed a transform stream");read&&(reader=stream(read),cb&&reader(abort,cb))},delayed}},function(module,exports,__webpack_require__){"use strict";function decode(opts){let reader=new Reader,p=pushable(err=>{reader.abort(err)});return read=>{function next(){decodeFromReader(reader,opts,(err,msg)=>{if(err)return p.end(err);p.push(msg),next()})}return reader(read),next(),p}}function decodeFromReader(reader,opts,cb){"function"==typeof opts&&(cb=opts,opts={}),opts=Object.assign({fixed:!1,bytes:4},opts||{}),opts.fixed?readFixedMessage(reader,opts.bytes,opts.maxLength,cb):readVarintMessage(reader,opts.maxLength,cb)}function readFixedMessage(reader,byteLength,maxLength,cb){"function"==typeof maxLength&&(cb=maxLength,maxLength=MAX_LENGTH),reader.read(byteLength,(err,bytes)=>{if(err)return cb(err);const msgSize=bytes.readInt32BE(0);if(msgSize>maxLength)return cb("size longer than max permitted length of "+maxLength+"!");readMessage(reader,msgSize,cb)})}function readVarintMessage(reader,maxLength,cb){function readByte(){reader.read(1,(err,byte)=>{if(err)return cb(err);if(rawMsgSize.push(byte),byte&&!isEndByte(byte[0]))return void readByte();const msgSize=varint.decode(Buffer.concat(rawMsgSize));if(msgSize>maxLength)return cb("size longer than max permitted length of "+maxLength+"!");readMessage(reader,msgSize,(err,msg)=>{if(err)return cb(err);rawMsgSize=[],cb(null,msg)})})}"function"==typeof maxLength&&(cb=maxLength,maxLength=MAX_LENGTH);let rawMsgSize=[];0===rawMsgSize.length&&readByte()}function readMessage(reader,size,cb){reader.read(size,(err,msg)=>{if(err)return cb(err);cb(null,msg)})}const varint=__webpack_require__(15),Reader=__webpack_require__(250),Buffer=__webpack_require__(6).Buffer,pushable=__webpack_require__(30);exports.decode=decode,exports.decodeFromReader=decodeFromReader;const isEndByte=byte=>!(128&byte),MAX_LENGTH=4194304},function(module,exports,__webpack_require__){"use strict";function encode(opts){opts=Object.assign({fixed:!1,bytes:4},opts||{});const varint=__webpack_require__(15);let pool=opts.fixed?null:createPool(),used=0,ended=!1;return read=>(end,cb)=>{if(end&&(ended=end),ended)return cb(ended);read(null,(end,data)=>{if(end&&(ended=end),ended)return cb(ended);if(!Buffer.isBuffer(data))return ended=new Error("data must be a buffer"),cb(ended);let encodedLength;opts.fixed?(encodedLength=Buffer.alloc(opts.bytes),encodedLength.writeInt32BE(data.length,0)):(varint.encode(data.length,pool,used),used+=varint.encode.bytes,encodedLength=pool.slice(used-varint.encode.bytes,used),pool.length-used<100&&(pool=createPool(),used=0)),cb(null,Buffer.concat([encodedLength,data]))})}}function createPool(){return Buffer.alloc(poolSize)}const Buffer=__webpack_require__(6).Buffer;module.exports=encode;const poolSize=10240},function(module,exports){module.exports=function(ary){function create(stream){return{ready:!1,reading:!1,ended:!1,read:stream,data:null}}function check(){if(cb){clean();var l=inputs.length,_cb=cb;if(0===l&&(abort||capped))return cb=null,void _cb(abort||!0);for(var j=0;jinputs.length)throw new Error("this should never happen");if(!(current.reading||current.ended||current.ready)){current.reading=!0;var sync=!0;current.read(abort,function next(end,data){current.data=data,current.ready=!0,current.reading=!1,end===!0||abort?current.ended=!0:end&&(abort=current.ended=end),abort&&!end&¤t.read(abort,next),sync||check()}),sync=!1}}(inputs[l]);check()}function read(_abort,_cb){abort=abort||_abort,cb=_cb,next()}var abort,cb,capped=!!ary,inputs=(ary||[]).map(create),i=0;return read.add=function(stream){if(!stream)return capped=!0,next();inputs.push(create(stream)),next()},read.cap=function(err){read.add(null)},read}},function(module,exports){module.exports=function(fn){var active=!1,called=0;return function(){if(called=!0,!active){for(active=!0;called;)called=!1,fn();active=!1}}}},function(module,exports,__webpack_require__){(function(Buffer){module.exports=function(){var buffers=[],length=0;return{length:length,data:this,add:function(data){if(!Buffer.isBuffer(data))throw new Error("data must be a buffer, was: "+JSON.stringify(data));return this.length=length+=data.length,buffers.push(data),this},has:function(n){return null==n?length>0:length>=n},get:function(n){var _length;if(null==n||n===length){length=0;var _buffers=buffers;return buffers=[],1==_buffers.length?_buffers[0]:Buffer.concat(_buffers)}if(buffers.length>1&&n<=(_length=buffers[0].length)){var buf=buffers[0].slice(0,n);return n===_length?buffers.shift():buffers[0]=buffers[0].slice(n,_length),length-=n,buf}if(nmax?cb(!0):void cb(null,i++)}}},function(module,exports,__webpack_require__){"use strict";module.exports=function(){return function(abort,cb){cb(!0)}}},function(module,exports,__webpack_require__){"use strict";module.exports=function(err){return function(abort,cb){cb(err)}}},function(module,exports,__webpack_require__){"use strict";module.exports={keys:__webpack_require__(614),once:__webpack_require__(253),values:__webpack_require__(141),count:__webpack_require__(609),infinite:__webpack_require__(613),empty:__webpack_require__(610),error:__webpack_require__(611)}},function(module,exports,__webpack_require__){"use strict";module.exports=function(generate){return generate=generate||Math.random,function(end,cb){return end?cb&&cb(end):cb(null,generate())}}},function(module,exports,__webpack_require__){"use strict";var values=__webpack_require__(141);module.exports=function(object){return values(Object.keys(object))}},function(module,exports,__webpack_require__){"use strict";function id(e){return e}var prop=__webpack_require__(69);module.exports=function(map){if(!map)return id;map=prop(map);var abortCb,aborted,busy=!1;return function(read){return function next(abort,cb){if(aborted)return cb(aborted);abort?(aborted=abort,busy?read(abort,function(){busy?abortCb=cb:cb(abort)}):read(abort,cb)):read(null,function(end,data){end?cb(end):aborted?cb(aborted):(busy=!0,map(data,function(err,data){busy=!1,aborted?(cb(aborted),abortCb(aborted)):err?next(err,cb):cb(null,data)}))})}}}},function(module,exports,__webpack_require__){"use strict";var tester=__webpack_require__(256),filter=__webpack_require__(142);module.exports=function(test){return test=tester(test),filter(function(data){return!test(data)})}},function(module,exports,__webpack_require__){"use strict";var values=__webpack_require__(141),once=__webpack_require__(253);module.exports=function(){return function(read){var _read;return function(abort,cb){function nextChunk(){_read(null,function(err,data){err===!0?nextStream():err?read(!0,function(abortErr){cb(err)}):cb(null,data)})}function nextStream(){_read=null,read(null,function(end,stream){if(end)return cb(end);Array.isArray(stream)||stream&&"object"==typeof stream?stream=values(stream):"function"!=typeof stream&&(stream=once(stream)),_read=stream,nextChunk()})}abort?_read?_read(abort,function(err){read(err||abort,cb)}):read(abort,cb):_read?nextChunk():nextStream()}}}},function(module,exports,__webpack_require__){"use strict";module.exports={map:__webpack_require__(619),asyncMap:__webpack_require__(615),filter:__webpack_require__(142),filterNot:__webpack_require__(616),through:__webpack_require__(622),take:__webpack_require__(621),unique:__webpack_require__(254),nonUnique:__webpack_require__(620),flatten:__webpack_require__(617)}},function(module,exports,__webpack_require__){"use strict";function id(e){return e}var prop=__webpack_require__(69);module.exports=function(mapper){return mapper?(mapper=prop(mapper),function(read){return function(abort,cb){read(abort,function(end,data){try{data=end?null:mapper(data)}catch(err){return read(err,function(){return cb(err)})}cb(end,data)})}}):id}},function(module,exports,__webpack_require__){"use strict";var unique=__webpack_require__(254);module.exports=function(field){return unique(field,!0)}},function(module,exports,__webpack_require__){"use strict";module.exports=function(test,opts){opts=opts||{};var last=opts.last||!1,ended=!1;if("number"==typeof test){last=!0;var n=test;test=function(){return--n}}return function(read){function terminate(cb){read(!0,function(err){last=!1,cb(err||!0)})}return function(end,cb){ended?last?terminate(cb):cb(ended):(ended=end)?read(ended,cb):read(null,function(end,data){(ended=ended||end)?cb(ended):test(data)?cb(null,data):(ended=!0,last?cb(null,data):terminate(cb))})}}}},function(module,exports,__webpack_require__){"use strict";module.exports=function(op,onEnd){function once(abort){!a&&onEnd&&(a=!0,onEnd(abort===!0?null:abort))}var a=!1;return function(read){return function(end,cb){return end&&once(end),read(end,function(end,data){end?once(end):op&&op(data),cb(end,data)})}}}},function(module,exports){module.exports=function(fn){var active=!1,called=0;return function(){if(called=!0,!active){for(active=!0;called;)called=!1,fn();active=!1}}}},function(module,exports,__webpack_require__){"use strict";function isFunction(f){return"function"==typeof f}var WebSocket=__webpack_require__(629),duplex=__webpack_require__(625),wsurl=__webpack_require__(630);module.exports=function(addr,opts){isFunction(opts)&&(opts={onConnect:opts});var location="undefined"==typeof window?{}:window.location,url=wsurl(addr,location),socket=new WebSocket(url),stream=duplex(socket,opts);return stream.remoteAddress=url,stream.close=function(cb){isFunction(cb)&&socket.addEventListener("close",cb),socket.close()},socket.addEventListener("open",function(e){opts&&isFunction(opts.onConnect)&&opts.onConnect(null,stream)}),stream},module.exports.connect=module.exports},function(module,exports,__webpack_require__){function duplex(ws,opts){var req=ws.upgradeReq||{};return opts&&opts.binaryType?ws.binaryType=opts.binaryType:opts&&opts.binary&&(ws.binaryType="arraybuffer"),{source:source(ws,opts&&opts.onConnect),sink:sink(ws,opts),headers:req.headers,url:req.url,upgrade:req.upgrade,method:req.method}}var source=__webpack_require__(628),sink=__webpack_require__(627);module.exports=duplex},function(module,exports){module.exports=function(socket,callback){function cleanup(){"function"==typeof remove&&(remove.call(socket,"open",handleOpen),remove.call(socket,"error",handleErr))}function handleOpen(evt){cleanup(),callback()}function handleErr(evt){cleanup(),callback(evt)}var remove=socket&&(socket.removeEventListener||socket.removeListener);return socket.readyState>=2?callback(!0):1===socket.readyState?callback():(socket.addEventListener("open",handleOpen),void socket.addEventListener("error",handleErr))}},function(module,exports,__webpack_require__){(function(setImmediate,process){var ready=__webpack_require__(626),nextTick=void 0!==setImmediate?setImmediate:process.nextTick;module.exports=function(socket,opts){return function(read){function next(end,data){if(end)return void(closeOnEnd&&socket.readyState<=1&&(onClose&&socket.addEventListener("close",function(ev){if(ev.wasClean||1006===ev.code)onClose();else{var err=new Error("ws error");err.event=ev,onClose(err)}}),socket.close()));ready(socket,function(end){if(end)return read(end,function(){});socket.send(data),nextTick(function(){read(null,next)})})}opts=opts||{};var closeOnEnd=opts.closeOnEnd!==!1,onClose="function"==typeof opts?opts:opts.onClose;read(null,next)}}}).call(exports,__webpack_require__(37).setImmediate,__webpack_require__(5))},function(module,exports,__webpack_require__){(function(Buffer){module.exports=function(socket,cb){function read(abort,cb){if(receiver=null,ended)return cb(ended);abort?(receiver=cb,socket.close()):buffer.length>0?cb(null,buffer.shift()):receiver=cb}var receiver,ended,buffer=[],started=!1;return socket.addEventListener("message",function(evt){var data=evt.data;if(data instanceof ArrayBuffer&&(data=new Buffer(data)),receiver)return receiver(null,data);buffer.push(data)}),socket.addEventListener("close",function(evt){ended||receiver&&receiver(ended=!0)}),socket.addEventListener("error",function(evt){ended||(ended=evt,started||(started=!0,cb&&cb(evt)),receiver&&receiver(ended))}),socket.addEventListener("open",function(evt){started||ended||(started=!0)}),read}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){module.exports="undefined"==typeof WebSocket?__webpack_require__(715):WebSocket},function(module,exports,__webpack_require__){var rurl=__webpack_require__(643),map={http:"ws",https:"wss"};module.exports=function(url,location){return rurl(url,location,map,"ws")}},function(module,exports,__webpack_require__){var once=__webpack_require__(67),eos=__webpack_require__(353),fs=__webpack_require__(716),noop=function(){},isFn=function(fn){return"function"==typeof fn},isFS=function(stream){return!!fs&&((stream instanceof(fs.ReadStream||noop)||stream instanceof(fs.WriteStream||noop))&&isFn(stream.close))},isRequest=function(stream){return stream.setHeader&&isFn(stream.abort)},destroyer=function(stream,reading,writing,callback){callback=once(callback);var closed=!1;stream.on("close",function(){closed=!0}),eos(stream,{readable:reading,writable:writing},function(err){if(err)return callback(err);closed=!0,callback()});var destroyed=!1;return function(err){if(!closed&&!destroyed)return destroyed=!0,isFS(stream)?stream.close():isRequest(stream)?stream.abort():isFn(stream.destroy)?stream.destroy():void callback(err||new Error("stream was destroyed"))}},call=function(fn){fn()},pipe=function(from,to){return from.pipe(to)},pump=function(){var streams=Array.prototype.slice.call(arguments),callback=isFn(streams[streams.length-1]||noop)&&streams.pop()||noop;if(Array.isArray(streams[0])&&(streams=streams[0]),streams.length<2)throw new Error("pump requires two streams per minimum");var error,destroys=streams.map(function(stream,i){var reading=i0,function(err){error||(error=err),err&&destroys.forEach(call),reading||(destroys.forEach(call),callback(error))})});return streams.reduce(pipe)};module.exports=pump},function(module,exports,__webpack_require__){(function(module,global){var __WEBPACK_AMD_DEFINE_RESULT__;!function(root){function error(type){throw new RangeError(errors[type])}function map(array,fn){for(var length=array.length,result=[];length--;)result[length]=fn(array[length]);return result}function mapDomain(string,fn){var parts=string.split("@"),result="";return parts.length>1&&(result=parts[0]+"@",string=parts[1]),string=string.replace(regexSeparators,"."),result+map(string.split("."),fn).join(".")}function ucs2decode(string){for(var value,extra,output=[],counter=0,length=string.length;counter=55296&&value<=56319&&counter65535&&(value-=65536, -output+=stringFromCharCode(value>>>10&1023|55296),value=56320|1023&value),output+=stringFromCharCode(value)}).join("")}function basicToDigit(codePoint){return codePoint-48<10?codePoint-22:codePoint-65<26?codePoint-65:codePoint-97<26?codePoint-97:base}function digitToBasic(digit,flag){return digit+22+75*(digit<26)-((0!=flag)<<5)}function adapt(delta,numPoints,firstTime){var k=0;for(delta=firstTime?floor(delta/damp):delta>>1,delta+=floor(delta/numPoints);delta>baseMinusTMin*tMax>>1;k+=base)delta=floor(delta/baseMinusTMin);return floor(k+(baseMinusTMin+1)*delta/(delta+skew))}function decode(input){var out,basic,j,index,oldi,w,k,digit,t,baseMinusT,output=[],inputLength=input.length,i=0,n=initialN,bias=initialBias;for(basic=input.lastIndexOf(delimiter),basic<0&&(basic=0),j=0;j=128&&error("not-basic"),output.push(input.charCodeAt(j));for(index=basic>0?basic+1:0;index=inputLength&&error("invalid-input"),digit=basicToDigit(input.charCodeAt(index++)),(digit>=base||digit>floor((maxInt-i)/w))&&error("overflow"),i+=digit*w,t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias,!(digitfloor(maxInt/baseMinusT)&&error("overflow"),w*=baseMinusT;out=output.length+1,bias=adapt(i-oldi,out,0==oldi),floor(i/out)>maxInt-n&&error("overflow"),n+=floor(i/out),i%=out,output.splice(i++,0,n)}return ucs2encode(output)}function encode(input){var n,delta,handledCPCount,basicLength,bias,j,m,q,k,t,currentValue,inputLength,handledCPCountPlusOne,baseMinusT,qMinusT,output=[];for(input=ucs2decode(input),inputLength=input.length,n=initialN,delta=0,bias=initialBias,j=0;j=n&¤tValuefloor((maxInt-delta)/handledCPCountPlusOne)&&error("overflow"),delta+=(m-n)*handledCPCountPlusOne,n=m,j=0;jmaxInt&&error("overflow"),currentValue==n){for(q=delta,k=base;t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias,!(q= 0x80 (not a basic code point)","invalid-input":"Invalid input"},baseMinusTMin=base-tMin,floor=Math.floor,stringFromCharCode=String.fromCharCode;punycode={version:"1.4.1",ucs2:{decode:ucs2decode,encode:ucs2encode},decode:decode,encode:encode,toASCII:toASCII,toUnicode:toUnicode},void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(){return punycode}.call(exports,__webpack_require__,exports,module))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)}()}).call(exports,__webpack_require__(18)(module),__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}module.exports=function(qs,sep,eq,options){sep=sep||"&",eq=eq||"=";var obj={};if("string"!=typeof qs||0===qs.length)return obj;qs=qs.split(sep);var maxKeys=1e3;options&&"number"==typeof options.maxKeys&&(maxKeys=options.maxKeys);var len=qs.length;maxKeys>0&&len>maxKeys&&(len=maxKeys);for(var i=0;i=0?(kstr=x.substr(0,idx),vstr=x.substr(idx+1)):(kstr=x,vstr=""),k=decodeURIComponent(kstr),v=decodeURIComponent(vstr),hasOwnProperty(obj,k)?isArray(obj[k])?obj[k].push(v):obj[k]=[obj[k],v]:obj[k]=v}return obj};var isArray=Array.isArray||function(xs){return"[object Array]"===Object.prototype.toString.call(xs)}},function(module,exports,__webpack_require__){"use strict";function map(xs,f){if(xs.map)return xs.map(f);for(var res=[],i=0;i65536)throw new Error("requested too many random bytes");var rawBytes=new global.Uint8Array(size);size>0&&crypto.getRandomValues(rawBytes);var bytes=Buffer.from(rawBytes.buffer);return"function"==typeof cb?process.nextTick(function(){cb(null,bytes)}):bytes}var Buffer=__webpack_require__(6).Buffer,crypto=global.crypto||global.msCrypto;crypto&&crypto.getRandomValues?module.exports=randomBytes:module.exports=oldBrowser}).call(exports,__webpack_require__(2),__webpack_require__(5))},function(module,exports,__webpack_require__){module.exports=__webpack_require__(44)},function(module,exports,__webpack_require__){"use strict";function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}module.exports=PassThrough;var Transform=__webpack_require__(259),util=__webpack_require__(26);util.inherits=__webpack_require__(1),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function copyBuffer(src,target,offset){src.copy(target,offset)}var Buffer=__webpack_require__(6).Buffer;module.exports=function(){function BufferList(){_classCallCheck(this,BufferList),this.head=null,this.tail=null,this.length=0}return BufferList.prototype.push=function(v){var entry={data:v,next:null};this.length>0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};0===this.length&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(0!==this.length){var ret=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s){if(0===this.length)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s+p.data;return ret},BufferList.prototype.concat=function(n){if(0===this.length)return Buffer.alloc(0);if(1===this.length)return this.head.data;for(var ret=Buffer.allocUnsafe(n>>>0),p=this.head,i=0;p;)copyBuffer(p.data,ret,i),i+=p.data.length,p=p.next;return ret},BufferList}()},function(module,exports,__webpack_require__){module.exports=__webpack_require__(36).PassThrough},function(module,exports,__webpack_require__){module.exports=__webpack_require__(36).Transform},function(module,exports,__webpack_require__){module.exports=__webpack_require__(143)},function(module,exports,__webpack_require__){var URL=__webpack_require__(147);module.exports=function(url,location,protocolMap,defaultProtocol){protocolMap=protocolMap||{};var proto,url=URL.parse(url,!1,!0);return url.protocol?proto=url.protocol:(proto=location.protocol?location.protocol.replace(/:$/,""):"http",proto=(protocolMap[proto]||defaultProtocol||proto)+":"),url.host&&":"===url.host[0]&&(url.host=null),url.hostname?URL.format({protocol:proto,slashes:!0,hostname:url.hostname,port:url.port,pathname:url.pathname,search:url.search}):(url.host=location.host,url.port?URL.format({protocol:proto,slashes:!0,host:location.hostname+":"+url.port,port:url.port,pathname:url.pathname,search:url.search}):url.pathname?URL.format({protocol:proto,slashes:!0,host:url.host,pathname:url.pathname,search:url.search}):(url.pathname=location.pathname,url.search?URL.format({protocol:proto,slashes:!0,host:url.host,pathname:url.pathname,search:url.search}):(url.search=location.search,url.format(url))))}},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(263)(__webpack_require__(650))},function(module,exports,__webpack_require__){"use strict";(function(Buffer){var toString=Object.prototype.toString;exports.isArray=function(value,message){if(!Array.isArray(value))throw TypeError(message)},exports.isBoolean=function(value,message){if("[object Boolean]"!==toString.call(value))throw TypeError(message)},exports.isBuffer=function(value,message){if(!Buffer.isBuffer(value))throw TypeError(message)},exports.isFunction=function(value,message){if("[object Function]"!==toString.call(value))throw TypeError(message)},exports.isNumber=function(value,message){if("[object Number]"!==toString.call(value))throw TypeError(message)},exports.isObject=function(value,message){if("[object Object]"!==toString.call(value))throw TypeError(message)},exports.isBufferLength=function(buffer,length,message){if(buffer.length!==length)throw RangeError(message)},exports.isBufferLength2=function(buffer,length1,length2,message){if(buffer.length!==length1&&buffer.length!==length2)throw RangeError(message)},exports.isLengthGTZero=function(value,message){if(0===value.length)throw RangeError(message)},exports.isNumberInInterval=function(number,x,y,message){if(number<=x||number>=y)throw RangeError(message)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";var Buffer=__webpack_require__(6).Buffer,bip66=__webpack_require__(306),EC_PRIVKEY_EXPORT_DER_COMPRESSED=Buffer.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),EC_PRIVKEY_EXPORT_DER_UNCOMPRESSED=Buffer.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),ZERO_BUFFER_32=Buffer.from([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);exports.privateKeyExport=function(privateKey,publicKey,compressed){var result=Buffer.from(compressed?EC_PRIVKEY_EXPORT_DER_COMPRESSED:EC_PRIVKEY_EXPORT_DER_UNCOMPRESSED);return privateKey.copy(result,compressed?8:9),publicKey.copy(result,compressed?181:214),result},exports.privateKeyImport=function(privateKey){var length=privateKey.length,index=0;if(!(length2||length1?privateKey[index+lenb-2]<<8:0);if(index+=lenb,!(length32||length1&&0===r[posR]&&!(128&r[posR+1]);--lenR,++posR);for(var s=Buffer.concat([Buffer.from([0]),sigObj.s]),lenS=33,posS=0;lenS>1&&0===s[posS]&&!(128&s[posS+1]);--lenS,++posS);return bip66.encode(r.slice(posR),s.slice(posS))},exports.signatureImport=function(sig){var r=Buffer.from(ZERO_BUFFER_32),s=Buffer.from(ZERO_BUFFER_32);try{var sigObj=bip66.decode(sig);if(33===sigObj.r.length&&0===sigObj.r[0]&&(sigObj.r=sigObj.r.slice(1)),sigObj.r.length>32)throw new Error("R length is too long");if(33===sigObj.s.length&&0===sigObj.s[0]&&(sigObj.s=sigObj.s.slice(1)),sigObj.s.length>32)throw new Error("S length is too long")}catch(err){return}return sigObj.r.copy(r,32-sigObj.r.length),sigObj.s.copy(s,32-sigObj.s.length),{r:r,s:s}},exports.signatureImportLax=function(sig){var r=Buffer.from(ZERO_BUFFER_32),s=Buffer.from(ZERO_BUFFER_32),length=sig.length,index=0;if(48===sig[index++]){var lenbyte=sig[index++];if(!(128&lenbyte&&(index+=lenbyte-128)>length)&&2===sig[index++]){var rlen=sig[index++];if(128&rlen){if(lenbyte=rlen-128,index+lenbyte>length)return;for(;lenbyte>0&&0===sig[index];index+=1,lenbyte-=1);for(rlen=0;lenbyte>0;index+=1,lenbyte-=1)rlen=(rlen<<8)+sig[index]}if(!(rlen>length-index)){var rindex=index;if(index+=rlen,2===sig[index++]){var slen=sig[index++];if(128&slen){if(lenbyte=slen-128,index+lenbyte>length)return;for(;lenbyte>0&&0===sig[index];index+=1,lenbyte-=1);for(slen=0;lenbyte>0;index+=1,lenbyte-=1)slen=(slen<<8)+sig[index]}if(!(slen>length-index)){var sindex=index;for(index+=slen;rlen>0&&0===sig[rindex];rlen-=1,rindex+=1);if(!(rlen>32)){var rvalue=sig.slice(rindex,rindex+rlen);for(rvalue.copy(r,32-rvalue.length);slen>0&&0===sig[sindex];slen-=1,sindex+=1);if(!(slen>32)){var svalue=sig.slice(sindex,sindex+slen);return svalue.copy(s,32-svalue.length),{r:r,s:s}}}}}}}}}},function(module,exports,__webpack_require__){"use strict";function loadCompressedPublicKey(first,xBuffer){var x=new BN(xBuffer);if(x.cmp(ecparams.p)>=0)return null;x=x.toRed(ecparams.red);var y=x.redSqr().redIMul(x).redIAdd(ecparams.b).redSqrt();return 3===first!==y.isOdd()&&(y=y.redNeg()),ec.keyPair({pub:{x:x,y:y}})}function loadUncompressedPublicKey(first,xBuffer,yBuffer){var x=new BN(xBuffer),y=new BN(yBuffer);if(x.cmp(ecparams.p)>=0||y.cmp(ecparams.p)>=0)return null;if(x=x.toRed(ecparams.red),y=y.toRed(ecparams.red),(6===first||7===first)&&y.isOdd()!==(7===first))return null;var x3=x.redSqr().redIMul(x);return y.redSqr().redISub(x3.redIAdd(ecparams.b)).isZero()?ec.keyPair({pub:{x:x,y:y}}):null}function loadPublicKey(publicKey){var first=publicKey[0];switch(first){case 2:case 3:return 33!==publicKey.length?null:loadCompressedPublicKey(first,publicKey.slice(1,33));case 4:case 6:case 7:return 65!==publicKey.length?null:loadUncompressedPublicKey(first,publicKey.slice(1,33),publicKey.slice(33,65));default:return null}}var Buffer=__webpack_require__(6).Buffer,createHash=__webpack_require__(59),BN=__webpack_require__(14),EC=__webpack_require__(20).ec,messages=__webpack_require__(121),ec=new EC("secp256k1"),ecparams=ec.curve;exports.privateKeyVerify=function(privateKey){var bn=new BN(privateKey);return bn.cmp(ecparams.n)<0&&!bn.isZero()},exports.privateKeyExport=function(privateKey,compressed){var d=new BN(privateKey);if(d.cmp(ecparams.n)>=0||d.isZero())throw new Error(messages.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return Buffer.from(ec.keyFromPrivate(privateKey).getPublic(compressed,!0))},exports.privateKeyTweakAdd=function(privateKey,tweak){var bn=new BN(tweak);if(bn.cmp(ecparams.n)>=0)throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(bn.iadd(new BN(privateKey)),bn.cmp(ecparams.n)>=0&&bn.isub(ecparams.n),bn.isZero())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return bn.toArrayLike(Buffer,"be",32)},exports.privateKeyTweakMul=function(privateKey,tweak){var bn=new BN(tweak);if(bn.cmp(ecparams.n)>=0||bn.isZero())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);return bn.imul(new BN(privateKey)),bn.cmp(ecparams.n)&&(bn=bn.umod(ecparams.n)),bn.toArrayLike(Buffer,"be",32)},exports.publicKeyCreate=function(privateKey,compressed){var d=new BN(privateKey);if(d.cmp(ecparams.n)>=0||d.isZero())throw new Error(messages.EC_PUBLIC_KEY_CREATE_FAIL);return Buffer.from(ec.keyFromPrivate(privateKey).getPublic(compressed,!0))},exports.publicKeyConvert=function(publicKey,compressed){var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);return Buffer.from(pair.getPublic(compressed,!0))},exports.publicKeyVerify=function(publicKey){return null!==loadPublicKey(publicKey)},exports.publicKeyTweakAdd=function(publicKey,tweak,compressed){var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);if(tweak=new BN(tweak),tweak.cmp(ecparams.n)>=0)throw new Error(messages.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return Buffer.from(ecparams.g.mul(tweak).add(pair.pub).encode(!0,compressed))},exports.publicKeyTweakMul=function(publicKey,tweak,compressed){var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);if(tweak=new BN(tweak),tweak.cmp(ecparams.n)>=0||tweak.isZero())throw new Error(messages.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return Buffer.from(pair.pub.mul(tweak).encode(!0,compressed))},exports.publicKeyCombine=function(publicKeys,compressed){for(var pairs=new Array(publicKeys.length),i=0;i=0||s.cmp(ecparams.n)>=0)throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);var result=Buffer.from(signature);return 1===s.cmp(ec.nh)&&ecparams.n.sub(s).toArrayLike(Buffer,"be",32).copy(result,32),result},exports.signatureExport=function(signature){var r=signature.slice(0,32),s=signature.slice(32,64);if(new BN(r).cmp(ecparams.n)>=0||new BN(s).cmp(ecparams.n)>=0)throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);return{r:r,s:s}},exports.signatureImport=function(sigObj){var r=new BN(sigObj.r);r.cmp(ecparams.n)>=0&&(r=new BN(0));var s=new BN(sigObj.s);return s.cmp(ecparams.n)>=0&&(s=new BN(0)),Buffer.concat([r.toArrayLike(Buffer,"be",32),s.toArrayLike(Buffer,"be",32)])},exports.sign=function(message,privateKey,noncefn,data){if("function"==typeof noncefn){var getNonce=noncefn;noncefn=function(counter){var nonce=getNonce(message,privateKey,null,data,counter);if(!Buffer.isBuffer(nonce)||32!==nonce.length)throw new Error(messages.ECDSA_SIGN_FAIL);return new BN(nonce)}}var d=new BN(privateKey);if(d.cmp(ecparams.n)>=0||d.isZero())throw new Error(messages.ECDSA_SIGN_FAIL);var result=ec.sign(message,privateKey,{canonical:!0,k:noncefn,pers:data});return{signature:Buffer.concat([result.r.toArrayLike(Buffer,"be",32),result.s.toArrayLike(Buffer,"be",32)]),recovery:result.recoveryParam}},exports.verify=function(message,signature,publicKey){var sigObj={r:signature.slice(0,32),s:signature.slice(32,64)},sigr=new BN(sigObj.r),sigs=new BN(sigObj.s);if(sigr.cmp(ecparams.n)>=0||sigs.cmp(ecparams.n)>=0)throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);if(1===sigs.cmp(ec.nh)||sigr.isZero()||sigs.isZero())return!1;var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);return ec.verify(message,sigObj,{x:pair.pub.x,y:pair.pub.y})},exports.recover=function(message,signature,recovery,compressed){var sigObj={r:signature.slice(0,32),s:signature.slice(32,64)},sigr=new BN(sigObj.r),sigs=new BN(sigObj.s);if(sigr.cmp(ecparams.n)>=0||sigs.cmp(ecparams.n)>=0)throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);try{if(sigr.isZero()||sigs.isZero())throw new Error;var point=ec.recoverPubKey(message,sigObj,recovery);return Buffer.from(point.encode(!0,compressed))}catch(err){throw new Error(messages.ECDSA_RECOVER_FAIL)}},exports.ecdh=function(publicKey,privateKey){var shared=exports.ecdhUnsafe(publicKey,privateKey,!0);return createHash("sha256").update(shared).digest()},exports.ecdhUnsafe=function(publicKey,privateKey,compressed){var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);var scalar=new BN(privateKey);if(scalar.cmp(ecparams.n)>=0||scalar.isZero())throw new Error(messages.ECDH_FAIL);return Buffer.from(pair.pub.mul(scalar).encode(!0,compressed))}},function(module,exports,__webpack_require__){"use strict";exports.umulTo10x10=function(num1,num2,out){var lo,mid,hi,a=num1.words,b=num2.words,o=out.words,c=0,a0=0|a[0],al0=8191&a0,ah0=a0>>>13,a1=0|a[1],al1=8191&a1,ah1=a1>>>13,a2=0|a[2],al2=8191&a2,ah2=a2>>>13,a3=0|a[3],al3=8191&a3,ah3=a3>>>13,a4=0|a[4],al4=8191&a4,ah4=a4>>>13,a5=0|a[5],al5=8191&a5,ah5=a5>>>13,a6=0|a[6],al6=8191&a6,ah6=a6>>>13,a7=0|a[7],al7=8191&a7,ah7=a7>>>13,a8=0|a[8],al8=8191&a8,ah8=a8>>>13,a9=0|a[9],al9=8191&a9,ah9=a9>>>13,b0=0|b[0],bl0=8191&b0,bh0=b0>>>13,b1=0|b[1],bl1=8191&b1,bh1=b1>>>13,b2=0|b[2],bl2=8191&b2,bh2=b2>>>13,b3=0|b[3],bl3=8191&b3,bh3=b3>>>13,b4=0|b[4],bl4=8191&b4,bh4=b4>>>13,b5=0|b[5],bl5=8191&b5,bh5=b5>>>13,b6=0|b[6],bl6=8191&b6,bh6=b6>>>13,b7=0|b[7],bl7=8191&b7,bh7=b7>>>13,b8=0|b[8],bl8=8191&b8,bh8=b8>>>13,b9=0|b[9],bl9=8191&b9,bh9=b9>>>13;out.length=19,lo=Math.imul(al0,bl0),mid=Math.imul(al0,bh0),mid+=Math.imul(ah0,bl0),hi=Math.imul(ah0,bh0);var w0=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w0>>>26),w0&=67108863,lo=Math.imul(al1,bl0),mid=Math.imul(al1,bh0),mid+=Math.imul(ah1,bl0),hi=Math.imul(ah1,bh0),lo+=Math.imul(al0,bl1),mid+=Math.imul(al0,bh1),mid+=Math.imul(ah0,bl1),hi+=Math.imul(ah0,bh1);var w1=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w1>>>26),w1&=67108863,lo=Math.imul(al2,bl0),mid=Math.imul(al2,bh0),mid+=Math.imul(ah2,bl0),hi=Math.imul(ah2,bh0),lo+=Math.imul(al1,bl1),mid+=Math.imul(al1,bh1),mid+=Math.imul(ah1,bl1),hi+=Math.imul(ah1,bh1),lo+=Math.imul(al0,bl2),mid+=Math.imul(al0,bh2),mid+=Math.imul(ah0,bl2),hi+=Math.imul(ah0,bh2);var w2=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w2>>>26),w2&=67108863,lo=Math.imul(al3,bl0),mid=Math.imul(al3,bh0),mid+=Math.imul(ah3,bl0),hi=Math.imul(ah3,bh0),lo+=Math.imul(al2,bl1),mid+=Math.imul(al2,bh1),mid+=Math.imul(ah2,bl1),hi+=Math.imul(ah2,bh1),lo+=Math.imul(al1,bl2),mid+=Math.imul(al1,bh2),mid+=Math.imul(ah1,bl2),hi+=Math.imul(ah1,bh2),lo+=Math.imul(al0,bl3),mid+=Math.imul(al0,bh3),mid+=Math.imul(ah0,bl3),hi+=Math.imul(ah0,bh3);var w3=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w3>>>26),w3&=67108863,lo=Math.imul(al4,bl0),mid=Math.imul(al4,bh0),mid+=Math.imul(ah4,bl0),hi=Math.imul(ah4,bh0),lo+=Math.imul(al3,bl1),mid+=Math.imul(al3,bh1),mid+=Math.imul(ah3,bl1),hi+=Math.imul(ah3,bh1),lo+=Math.imul(al2,bl2),mid+=Math.imul(al2,bh2),mid+=Math.imul(ah2,bl2),hi+=Math.imul(ah2,bh2),lo+=Math.imul(al1,bl3),mid+=Math.imul(al1,bh3),mid+=Math.imul(ah1,bl3),hi+=Math.imul(ah1,bh3),lo+=Math.imul(al0,bl4),mid+=Math.imul(al0,bh4),mid+=Math.imul(ah0,bl4),hi+=Math.imul(ah0,bh4);var w4=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w4>>>26),w4&=67108863,lo=Math.imul(al5,bl0),mid=Math.imul(al5,bh0),mid+=Math.imul(ah5,bl0),hi=Math.imul(ah5,bh0),lo+=Math.imul(al4,bl1),mid+=Math.imul(al4,bh1),mid+=Math.imul(ah4,bl1),hi+=Math.imul(ah4,bh1),lo+=Math.imul(al3,bl2),mid+=Math.imul(al3,bh2),mid+=Math.imul(ah3,bl2),hi+=Math.imul(ah3,bh2),lo+=Math.imul(al2,bl3),mid+=Math.imul(al2,bh3),mid+=Math.imul(ah2,bl3),hi+=Math.imul(ah2,bh3),lo+=Math.imul(al1,bl4),mid+=Math.imul(al1,bh4),mid+=Math.imul(ah1,bl4),hi+=Math.imul(ah1,bh4),lo+=Math.imul(al0,bl5),mid+=Math.imul(al0,bh5),mid+=Math.imul(ah0,bl5),hi+=Math.imul(ah0,bh5);var w5=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w5>>>26),w5&=67108863,lo=Math.imul(al6,bl0),mid=Math.imul(al6,bh0),mid+=Math.imul(ah6,bl0),hi=Math.imul(ah6,bh0),lo+=Math.imul(al5,bl1),mid+=Math.imul(al5,bh1),mid+=Math.imul(ah5,bl1),hi+=Math.imul(ah5,bh1),lo+=Math.imul(al4,bl2),mid+=Math.imul(al4,bh2),mid+=Math.imul(ah4,bl2),hi+=Math.imul(ah4,bh2),lo+=Math.imul(al3,bl3),mid+=Math.imul(al3,bh3),mid+=Math.imul(ah3,bl3),hi+=Math.imul(ah3,bh3),lo+=Math.imul(al2,bl4),mid+=Math.imul(al2,bh4),mid+=Math.imul(ah2,bl4),hi+=Math.imul(ah2,bh4),lo+=Math.imul(al1,bl5),mid+=Math.imul(al1,bh5),mid+=Math.imul(ah1,bl5),hi+=Math.imul(ah1,bh5),lo+=Math.imul(al0,bl6),mid+=Math.imul(al0,bh6),mid+=Math.imul(ah0,bl6),hi+=Math.imul(ah0,bh6);var w6=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w6>>>26),w6&=67108863,lo=Math.imul(al7,bl0),mid=Math.imul(al7,bh0),mid+=Math.imul(ah7,bl0),hi=Math.imul(ah7,bh0),lo+=Math.imul(al6,bl1),mid+=Math.imul(al6,bh1),mid+=Math.imul(ah6,bl1),hi+=Math.imul(ah6,bh1),lo+=Math.imul(al5,bl2),mid+=Math.imul(al5,bh2),mid+=Math.imul(ah5,bl2),hi+=Math.imul(ah5,bh2),lo+=Math.imul(al4,bl3),mid+=Math.imul(al4,bh3),mid+=Math.imul(ah4,bl3),hi+=Math.imul(ah4,bh3),lo+=Math.imul(al3,bl4),mid+=Math.imul(al3,bh4),mid+=Math.imul(ah3,bl4),hi+=Math.imul(ah3,bh4),lo+=Math.imul(al2,bl5),mid+=Math.imul(al2,bh5),mid+=Math.imul(ah2,bl5),hi+=Math.imul(ah2,bh5),lo+=Math.imul(al1,bl6),mid+=Math.imul(al1,bh6),mid+=Math.imul(ah1,bl6),hi+=Math.imul(ah1,bh6),lo+=Math.imul(al0,bl7),mid+=Math.imul(al0,bh7),mid+=Math.imul(ah0,bl7),hi+=Math.imul(ah0,bh7);var w7=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w7>>>26),w7&=67108863,lo=Math.imul(al8,bl0),mid=Math.imul(al8,bh0),mid+=Math.imul(ah8,bl0),hi=Math.imul(ah8,bh0),lo+=Math.imul(al7,bl1),mid+=Math.imul(al7,bh1),mid+=Math.imul(ah7,bl1),hi+=Math.imul(ah7,bh1),lo+=Math.imul(al6,bl2),mid+=Math.imul(al6,bh2),mid+=Math.imul(ah6,bl2),hi+=Math.imul(ah6,bh2),lo+=Math.imul(al5,bl3),mid+=Math.imul(al5,bh3),mid+=Math.imul(ah5,bl3),hi+=Math.imul(ah5,bh3),lo+=Math.imul(al4,bl4),mid+=Math.imul(al4,bh4),mid+=Math.imul(ah4,bl4),hi+=Math.imul(ah4,bh4),lo+=Math.imul(al3,bl5),mid+=Math.imul(al3,bh5),mid+=Math.imul(ah3,bl5),hi+=Math.imul(ah3,bh5),lo+=Math.imul(al2,bl6),mid+=Math.imul(al2,bh6),mid+=Math.imul(ah2,bl6),hi+=Math.imul(ah2,bh6),lo+=Math.imul(al1,bl7),mid+=Math.imul(al1,bh7),mid+=Math.imul(ah1,bl7),hi+=Math.imul(ah1,bh7),lo+=Math.imul(al0,bl8),mid+=Math.imul(al0,bh8),mid+=Math.imul(ah0,bl8),hi+=Math.imul(ah0,bh8);var w8=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w8>>>26),w8&=67108863,lo=Math.imul(al9,bl0),mid=Math.imul(al9,bh0),mid+=Math.imul(ah9,bl0),hi=Math.imul(ah9,bh0),lo+=Math.imul(al8,bl1),mid+=Math.imul(al8,bh1),mid+=Math.imul(ah8,bl1),hi+=Math.imul(ah8,bh1),lo+=Math.imul(al7,bl2),mid+=Math.imul(al7,bh2),mid+=Math.imul(ah7,bl2),hi+=Math.imul(ah7,bh2),lo+=Math.imul(al6,bl3),mid+=Math.imul(al6,bh3),mid+=Math.imul(ah6,bl3),hi+=Math.imul(ah6,bh3),lo+=Math.imul(al5,bl4),mid+=Math.imul(al5,bh4),mid+=Math.imul(ah5,bl4),hi+=Math.imul(ah5,bh4),lo+=Math.imul(al4,bl5),mid+=Math.imul(al4,bh5),mid+=Math.imul(ah4,bl5),hi+=Math.imul(ah4,bh5),lo+=Math.imul(al3,bl6),mid+=Math.imul(al3,bh6),mid+=Math.imul(ah3,bl6),hi+=Math.imul(ah3,bh6),lo+=Math.imul(al2,bl7),mid+=Math.imul(al2,bh7),mid+=Math.imul(ah2,bl7),hi+=Math.imul(ah2,bh7),lo+=Math.imul(al1,bl8),mid+=Math.imul(al1,bh8),mid+=Math.imul(ah1,bl8),hi+=Math.imul(ah1,bh8),lo+=Math.imul(al0,bl9),mid+=Math.imul(al0,bh9),mid+=Math.imul(ah0,bl9),hi+=Math.imul(ah0,bh9);var w9=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w9>>>26),w9&=67108863,lo=Math.imul(al9,bl1),mid=Math.imul(al9,bh1),mid+=Math.imul(ah9,bl1),hi=Math.imul(ah9,bh1),lo+=Math.imul(al8,bl2),mid+=Math.imul(al8,bh2),mid+=Math.imul(ah8,bl2),hi+=Math.imul(ah8,bh2),lo+=Math.imul(al7,bl3),mid+=Math.imul(al7,bh3),mid+=Math.imul(ah7,bl3),hi+=Math.imul(ah7,bh3),lo+=Math.imul(al6,bl4),mid+=Math.imul(al6,bh4),mid+=Math.imul(ah6,bl4),hi+=Math.imul(ah6,bh4),lo+=Math.imul(al5,bl5),mid+=Math.imul(al5,bh5),mid+=Math.imul(ah5,bl5),hi+=Math.imul(ah5,bh5),lo+=Math.imul(al4,bl6),mid+=Math.imul(al4,bh6),mid+=Math.imul(ah4,bl6),hi+=Math.imul(ah4,bh6),lo+=Math.imul(al3,bl7),mid+=Math.imul(al3,bh7),mid+=Math.imul(ah3,bl7),hi+=Math.imul(ah3,bh7),lo+=Math.imul(al2,bl8),mid+=Math.imul(al2,bh8),mid+=Math.imul(ah2,bl8),hi+=Math.imul(ah2,bh8),lo+=Math.imul(al1,bl9),mid+=Math.imul(al1,bh9),mid+=Math.imul(ah1,bl9),hi+=Math.imul(ah1,bh9);var w10=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w10>>>26),w10&=67108863,lo=Math.imul(al9,bl2),mid=Math.imul(al9,bh2),mid+=Math.imul(ah9,bl2),hi=Math.imul(ah9,bh2),lo+=Math.imul(al8,bl3),mid+=Math.imul(al8,bh3),mid+=Math.imul(ah8,bl3),hi+=Math.imul(ah8,bh3),lo+=Math.imul(al7,bl4),mid+=Math.imul(al7,bh4),mid+=Math.imul(ah7,bl4),hi+=Math.imul(ah7,bh4),lo+=Math.imul(al6,bl5),mid+=Math.imul(al6,bh5),mid+=Math.imul(ah6,bl5),hi+=Math.imul(ah6,bh5),lo+=Math.imul(al5,bl6),mid+=Math.imul(al5,bh6),mid+=Math.imul(ah5,bl6),hi+=Math.imul(ah5,bh6),lo+=Math.imul(al4,bl7),mid+=Math.imul(al4,bh7),mid+=Math.imul(ah4,bl7),hi+=Math.imul(ah4,bh7),lo+=Math.imul(al3,bl8),mid+=Math.imul(al3,bh8),mid+=Math.imul(ah3,bl8),hi+=Math.imul(ah3,bh8),lo+=Math.imul(al2,bl9),mid+=Math.imul(al2,bh9),mid+=Math.imul(ah2,bl9),hi+=Math.imul(ah2,bh9);var w11=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w11>>>26),w11&=67108863,lo=Math.imul(al9,bl3),mid=Math.imul(al9,bh3),mid+=Math.imul(ah9,bl3),hi=Math.imul(ah9,bh3),lo+=Math.imul(al8,bl4),mid+=Math.imul(al8,bh4),mid+=Math.imul(ah8,bl4),hi+=Math.imul(ah8,bh4),lo+=Math.imul(al7,bl5),mid+=Math.imul(al7,bh5),mid+=Math.imul(ah7,bl5),hi+=Math.imul(ah7,bh5),lo+=Math.imul(al6,bl6),mid+=Math.imul(al6,bh6),mid+=Math.imul(ah6,bl6),hi+=Math.imul(ah6,bh6),lo+=Math.imul(al5,bl7),mid+=Math.imul(al5,bh7),mid+=Math.imul(ah5,bl7),hi+=Math.imul(ah5,bh7),lo+=Math.imul(al4,bl8),mid+=Math.imul(al4,bh8),mid+=Math.imul(ah4,bl8),hi+=Math.imul(ah4,bh8),lo+=Math.imul(al3,bl9),mid+=Math.imul(al3,bh9),mid+=Math.imul(ah3,bl9),hi+=Math.imul(ah3,bh9);var w12=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w12>>>26),w12&=67108863,lo=Math.imul(al9,bl4),mid=Math.imul(al9,bh4),mid+=Math.imul(ah9,bl4),hi=Math.imul(ah9,bh4),lo+=Math.imul(al8,bl5),mid+=Math.imul(al8,bh5),mid+=Math.imul(ah8,bl5),hi+=Math.imul(ah8,bh5),lo+=Math.imul(al7,bl6), -mid+=Math.imul(al7,bh6),mid+=Math.imul(ah7,bl6),hi+=Math.imul(ah7,bh6),lo+=Math.imul(al6,bl7),mid+=Math.imul(al6,bh7),mid+=Math.imul(ah6,bl7),hi+=Math.imul(ah6,bh7),lo+=Math.imul(al5,bl8),mid+=Math.imul(al5,bh8),mid+=Math.imul(ah5,bl8),hi+=Math.imul(ah5,bh8),lo+=Math.imul(al4,bl9),mid+=Math.imul(al4,bh9),mid+=Math.imul(ah4,bl9),hi+=Math.imul(ah4,bh9);var w13=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w13>>>26),w13&=67108863,lo=Math.imul(al9,bl5),mid=Math.imul(al9,bh5),mid+=Math.imul(ah9,bl5),hi=Math.imul(ah9,bh5),lo+=Math.imul(al8,bl6),mid+=Math.imul(al8,bh6),mid+=Math.imul(ah8,bl6),hi+=Math.imul(ah8,bh6),lo+=Math.imul(al7,bl7),mid+=Math.imul(al7,bh7),mid+=Math.imul(ah7,bl7),hi+=Math.imul(ah7,bh7),lo+=Math.imul(al6,bl8),mid+=Math.imul(al6,bh8),mid+=Math.imul(ah6,bl8),hi+=Math.imul(ah6,bh8),lo+=Math.imul(al5,bl9),mid+=Math.imul(al5,bh9),mid+=Math.imul(ah5,bl9),hi+=Math.imul(ah5,bh9);var w14=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w14>>>26),w14&=67108863,lo=Math.imul(al9,bl6),mid=Math.imul(al9,bh6),mid+=Math.imul(ah9,bl6),hi=Math.imul(ah9,bh6),lo+=Math.imul(al8,bl7),mid+=Math.imul(al8,bh7),mid+=Math.imul(ah8,bl7),hi+=Math.imul(ah8,bh7),lo+=Math.imul(al7,bl8),mid+=Math.imul(al7,bh8),mid+=Math.imul(ah7,bl8),hi+=Math.imul(ah7,bh8),lo+=Math.imul(al6,bl9),mid+=Math.imul(al6,bh9),mid+=Math.imul(ah6,bl9),hi+=Math.imul(ah6,bh9);var w15=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w15>>>26),w15&=67108863,lo=Math.imul(al9,bl7),mid=Math.imul(al9,bh7),mid+=Math.imul(ah9,bl7),hi=Math.imul(ah9,bh7),lo+=Math.imul(al8,bl8),mid+=Math.imul(al8,bh8),mid+=Math.imul(ah8,bl8),hi+=Math.imul(ah8,bh8),lo+=Math.imul(al7,bl9),mid+=Math.imul(al7,bh9),mid+=Math.imul(ah7,bl9),hi+=Math.imul(ah7,bh9);var w16=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w16>>>26),w16&=67108863,lo=Math.imul(al9,bl8),mid=Math.imul(al9,bh8),mid+=Math.imul(ah9,bl8),hi=Math.imul(ah9,bh8),lo+=Math.imul(al8,bl9),mid+=Math.imul(al8,bh9),mid+=Math.imul(ah8,bl9),hi+=Math.imul(ah8,bh9);var w17=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w17>>>26),w17&=67108863,lo=Math.imul(al9,bl9),mid=Math.imul(al9,bh9),mid+=Math.imul(ah9,bl9),hi=Math.imul(ah9,bh9);var w18=c+lo+((8191&mid)<<13);return c=hi+(mid>>>13)+(w18>>>26),w18&=67108863,o[0]=w0,o[1]=w1,o[2]=w2,o[3]=w3,o[4]=w4,o[5]=w5,o[6]=w6,o[7]=w7,o[8]=w8,o[9]=w9,o[10]=w10,o[11]=w11,o[12]=w12,o[13]=w13,o[14]=w14,o[15]=w15,o[16]=w16,o[17]=w17,o[18]=w18,0!==c&&(o[19]=c,out.length++),out}},function(module,exports,__webpack_require__){"use strict";function ECPointG(){this.x=BN.fromBuffer(Buffer.from("79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","hex")),this.y=BN.fromBuffer(Buffer.from("483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8","hex")),this.inf=!1,this._precompute()}var Buffer=__webpack_require__(6).Buffer,BN=__webpack_require__(100),ECPoint=__webpack_require__(265),ECJPoint=__webpack_require__(264);ECPointG.prototype._precompute=function(){for(var ecpoint=new ECPoint(this.x,this.y),points=new Array(1+Math.ceil(64.25)),acc=points[0]=ecpoint,i=1;i=j;k--)nafW=(nafW<<1)+naf[k];repr.push(nafW)}for(var a=new ECJPoint(null,null,null),b=new ECJPoint(null,null,null),i=I;i>0;i--){for(var jj=0;jj=0;i--){for(var k=0;i>=0&&(tmp[0]=0|naf[0][i],tmp[1]=0|naf[1][i],0===tmp[0]&&0===tmp[1]);++k,--i);if(i>=0&&(k+=1),acc=acc.dblp(k),i<0)break;for(var jj=0;jj<2;jj++){var p,z=tmp[jj];0!==z&&(z>0?p=wnd[jj][z>>1]:z<0&&(p=wnd[jj][-z>>1].neg()),acc=void 0===p.z?acc.mixedAdd(p):acc.add(p))}}return acc},module.exports=new ECPointG},function(module,exports,__webpack_require__){"use strict";var Buffer=__webpack_require__(6).Buffer,createHash=__webpack_require__(59),HmacDRBG=__webpack_require__(336),messages=__webpack_require__(121),BN=__webpack_require__(100),ECPoint=__webpack_require__(265),g=__webpack_require__(649);exports.privateKeyVerify=function(privateKey){var bn=BN.fromBuffer(privateKey);return!(bn.isOverflow()||bn.isZero())},exports.privateKeyExport=function(privateKey,compressed){var d=BN.fromBuffer(privateKey);if(d.isOverflow()||d.isZero())throw new Error(messages.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return g.mul(d).toPublicKey(compressed)},exports.privateKeyTweakAdd=function(privateKey,tweak){var bn=BN.fromBuffer(tweak);if(bn.isOverflow())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(bn.iadd(BN.fromBuffer(privateKey)),bn.isOverflow()&&bn.isub(BN.n),bn.isZero())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return bn.toBuffer()},exports.privateKeyTweakMul=function(privateKey,tweak){var bn=BN.fromBuffer(tweak);if(bn.isOverflow()||bn.isZero())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);var d=BN.fromBuffer(privateKey);return bn.umul(d).ureduce().toBuffer()},exports.publicKeyCreate=function(privateKey,compressed){var d=BN.fromBuffer(privateKey);if(d.isOverflow()||d.isZero())throw new Error(messages.EC_PUBLIC_KEY_CREATE_FAIL);return g.mul(d).toPublicKey(compressed)},exports.publicKeyConvert=function(publicKey,compressed){var point=ECPoint.fromPublicKey(publicKey);if(null===point)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);return point.toPublicKey(compressed)},exports.publicKeyVerify=function(publicKey){return null!==ECPoint.fromPublicKey(publicKey)},exports.publicKeyTweakAdd=function(publicKey,tweak,compressed){var point=ECPoint.fromPublicKey(publicKey);if(null===point)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);if(tweak=BN.fromBuffer(tweak),tweak.isOverflow())throw new Error(messages.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return g.mul(tweak).add(point).toPublicKey(compressed)},exports.publicKeyTweakMul=function(publicKey,tweak,compressed){var point=ECPoint.fromPublicKey(publicKey);if(null===point)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);if(tweak=BN.fromBuffer(tweak),tweak.isOverflow()||tweak.isZero())throw new Error(messages.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return point.mul(tweak).toPublicKey(compressed)},exports.publicKeyCombine=function(publicKeys,compressed){for(var points=new Array(publicKeys.length),i=0;i=0)&&0===sigr.iadd(BN.psn).redMul(z2).ucmp(point.x)},exports.recover=function(message,signature,recovery,compressed){var sigr=BN.fromBuffer(signature.slice(0,32)),sigs=BN.fromBuffer(signature.slice(32,64));if(sigr.isOverflow()||sigs.isOverflow())throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);do{if(sigr.isZero()||sigs.isZero())break;var kpx=sigr;if(recovery>>1){if(kpx.ucmp(BN.psn)>=0)break;kpx=sigr.add(BN.n)}var kpPublicKey=Buffer.concat([Buffer.from([2+(1&recovery)]),kpx.toBuffer()]),kp=ECPoint.fromPublicKey(kpPublicKey);if(null===kp)break;var rInv=sigr.uinvm(),s1=BN.n.sub(BN.fromBuffer(message)).umul(rInv).ureduce(),s2=sigs.umul(rInv).ureduce();return ECPoint.fromECJPoint(g.mulAdd(s1,kp,s2)).toPublicKey(compressed)}while(!1);throw new Error(messages.ECDSA_RECOVER_FAIL)},exports.ecdh=function(publicKey,privateKey){var shared=exports.ecdhUnsafe(publicKey,privateKey,!0);return createHash("sha256").update(shared).digest()},exports.ecdhUnsafe=function(publicKey,privateKey,compressed){var point=ECPoint.fromPublicKey(publicKey);if(null===point)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);var scalar=BN.fromBuffer(privateKey);if(scalar.isOverflow()||scalar.isZero())throw new Error(messages.ECDH_FAIL);return point.mul(scalar).toPublicKey(compressed)}},function(module,exports,__webpack_require__){(function(process){function parse(version,loose){if(version instanceof SemVer)return version;if("string"!=typeof version)return null;if(version.length>MAX_LENGTH)return null;if(!(loose?re[LOOSE]:re[FULL]).test(version))return null;try{return new SemVer(version,loose)}catch(er){return null}}function valid(version,loose){var v=parse(version,loose);return v?v.version:null}function clean(version,loose){var s=parse(version.trim().replace(/^[=v]+/,""),loose);return s?s.version:null}function SemVer(version,loose){if(version instanceof SemVer){if(version.loose===loose)return version;version=version.version}else if("string"!=typeof version)throw new TypeError("Invalid Version: "+version);if(version.length>MAX_LENGTH)throw new TypeError("version is longer than "+MAX_LENGTH+" characters");if(!(this instanceof SemVer))return new SemVer(version,loose);debug("SemVer",version,loose),this.loose=loose;var m=version.trim().match(loose?re[LOOSE]:re[FULL]);if(!m)throw new TypeError("Invalid Version: "+version);if(this.raw=version,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>MAX_SAFE_INTEGER||this.major<0)throw new TypeError("Invalid major version");if(this.minor>MAX_SAFE_INTEGER||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>MAX_SAFE_INTEGER||this.patch<0)throw new TypeError("Invalid patch version");m[4]?this.prerelease=m[4].split(".").map(function(id){if(/^[0-9]+$/.test(id)){var num=+id;if(num>=0&&numb?1:0}function rcompareIdentifiers(a,b){return compareIdentifiers(b,a)}function major(a,loose){return new SemVer(a,loose).major}function minor(a,loose){return new SemVer(a,loose).minor}function patch(a,loose){return new SemVer(a,loose).patch}function compare(a,b,loose){return new SemVer(a,loose).compare(new SemVer(b,loose))}function compareLoose(a,b){return compare(a,b,!0)}function rcompare(a,b,loose){return compare(b,a,loose)}function sort(list,loose){return list.sort(function(a,b){return exports.compare(a,b,loose)})}function rsort(list,loose){return list.sort(function(a,b){return exports.rcompare(a,b,loose)})}function gt(a,b,loose){return compare(a,b,loose)>0}function lt(a,b,loose){return compare(a,b,loose)<0}function eq(a,b,loose){return 0===compare(a,b,loose)}function neq(a,b,loose){return 0!==compare(a,b,loose)}function gte(a,b,loose){return compare(a,b,loose)>=0}function lte(a,b,loose){return compare(a,b,loose)<=0}function cmp(a,op,b,loose){var ret;switch(op){case"===":"object"==typeof a&&(a=a.version),"object"==typeof b&&(b=b.version),ret=a===b;break;case"!==":"object"==typeof a&&(a=a.version),"object"==typeof b&&(b=b.version),ret=a!==b;break;case"":case"=":case"==":ret=eq(a,b,loose);break;case"!=":ret=neq(a,b,loose);break;case">":ret=gt(a,b,loose);break;case">=":ret=gte(a,b,loose);break;case"<":ret=lt(a,b,loose);break;case"<=":ret=lte(a,b,loose);break;default:throw new TypeError("Invalid operator: "+op)}return ret}function Comparator(comp,loose){if(comp instanceof Comparator){if(comp.loose===loose)return comp;comp=comp.value}if(!(this instanceof Comparator))return new Comparator(comp,loose);debug("comparator",comp,loose),this.loose=loose,this.parse(comp),this.semver===ANY?this.value="":this.value=this.operator+this.semver.version,debug("comp",this)}function Range(range,loose){if(range instanceof Range)return range.loose===loose?range:new Range(range.raw,loose);if(range instanceof Comparator)return new Range(range.value,loose);if(!(this instanceof Range))return new Range(range,loose);if(this.loose=loose,this.raw=range,this.set=range.split(/\s*\|\|\s*/).map(function(range){return this.parseRange(range.trim())},this).filter(function(c){return c.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+range);this.format()}function toComparators(range,loose){return new Range(range,loose).set.map(function(comp){return comp.map(function(c){return c.value}).join(" ").trim().split(" ")})}function parseComparator(comp,loose){return debug("comp",comp),comp=replaceCarets(comp,loose),debug("caret",comp),comp=replaceTildes(comp,loose),debug("tildes",comp),comp=replaceXRanges(comp,loose),debug("xrange",comp),comp=replaceStars(comp,loose),debug("stars",comp),comp}function isX(id){return!id||"x"===id.toLowerCase()||"*"===id}function replaceTildes(comp,loose){return comp.trim().split(/\s+/).map(function(comp){return replaceTilde(comp,loose)}).join(" ")}function replaceTilde(comp,loose){var r=loose?re[TILDELOOSE]:re[TILDE];return comp.replace(r,function(_,M,m,p,pr){debug("tilde",comp,_,M,m,p,pr);var ret;return isX(M)?ret="":isX(m)?ret=">="+M+".0.0 <"+(+M+1)+".0.0":isX(p)?ret=">="+M+"."+m+".0 <"+M+"."+(+m+1)+".0":pr?(debug("replaceTilde pr",pr),"-"!==pr.charAt(0)&&(pr="-"+pr),ret=">="+M+"."+m+"."+p+pr+" <"+M+"."+(+m+1)+".0"):ret=">="+M+"."+m+"."+p+" <"+M+"."+(+m+1)+".0",debug("tilde return",ret),ret})}function replaceCarets(comp,loose){return comp.trim().split(/\s+/).map(function(comp){return replaceCaret(comp,loose)}).join(" ")}function replaceCaret(comp,loose){debug("caret",comp,loose);var r=loose?re[CARETLOOSE]:re[CARET];return comp.replace(r,function(_,M,m,p,pr){debug("caret",comp,_,M,m,p,pr);var ret;return isX(M)?ret="":isX(m)?ret=">="+M+".0.0 <"+(+M+1)+".0.0":isX(p)?ret="0"===M?">="+M+"."+m+".0 <"+M+"."+(+m+1)+".0":">="+M+"."+m+".0 <"+(+M+1)+".0.0":pr?(debug("replaceCaret pr",pr),"-"!==pr.charAt(0)&&(pr="-"+pr),ret="0"===M?"0"===m?">="+M+"."+m+"."+p+pr+" <"+M+"."+m+"."+(+p+1):">="+M+"."+m+"."+p+pr+" <"+M+"."+(+m+1)+".0":">="+M+"."+m+"."+p+pr+" <"+(+M+1)+".0.0"):(debug("no pr"),ret="0"===M?"0"===m?">="+M+"."+m+"."+p+" <"+M+"."+m+"."+(+p+1):">="+M+"."+m+"."+p+" <"+M+"."+(+m+1)+".0":">="+M+"."+m+"."+p+" <"+(+M+1)+".0.0"),debug("caret return",ret),ret})}function replaceXRanges(comp,loose){return debug("replaceXRanges",comp,loose),comp.split(/\s+/).map(function(comp){return replaceXRange(comp,loose)}).join(" ")}function replaceXRange(comp,loose){comp=comp.trim();var r=loose?re[XRANGELOOSE]:re[XRANGE];return comp.replace(r,function(ret,gtlt,M,m,p,pr){debug("xRange",comp,ret,gtlt,M,m,p,pr);var xM=isX(M),xm=xM||isX(m),xp=xm||isX(p),anyX=xp;return"="===gtlt&&anyX&&(gtlt=""),xM?ret=">"===gtlt||"<"===gtlt?"<0.0.0":"*":gtlt&&anyX?(xm&&(m=0),xp&&(p=0),">"===gtlt?(gtlt=">=",xm?(M=+M+1,m=0,p=0):xp&&(m=+m+1,p=0)):"<="===gtlt&&(gtlt="<",xm?M=+M+1:m=+m+1),ret=gtlt+M+"."+m+"."+p):xm?ret=">="+M+".0.0 <"+(+M+1)+".0.0":xp&&(ret=">="+M+"."+m+".0 <"+M+"."+(+m+1)+".0"),debug("xRange return",ret),ret})}function replaceStars(comp,loose){return debug("replaceStars",comp,loose),comp.trim().replace(re[STAR],"")}function hyphenReplace($0,from,fM,fm,fp,fpr,fb,to,tM,tm,tp,tpr,tb){return from=isX(fM)?"":isX(fm)?">="+fM+".0.0":isX(fp)?">="+fM+"."+fm+".0":">="+from,to=isX(tM)?"":isX(tm)?"<"+(+tM+1)+".0.0":isX(tp)?"<"+tM+"."+(+tm+1)+".0":tpr?"<="+tM+"."+tm+"."+tp+"-"+tpr:"<="+to,(from+" "+to).trim()}function testSet(set,version){for(var i=0;i0){var allowed=set[i].semver;if(allowed.major===version.major&&allowed.minor===version.minor&&allowed.patch===version.patch)return!0}return!1}return!0}function satisfies(version,range,loose){try{range=new Range(range,loose)}catch(er){return!1}return range.test(version)}function maxSatisfying(versions,range,loose){var max=null,maxSV=null;try{var rangeObj=new Range(range,loose)}catch(er){return null}return versions.forEach(function(v){rangeObj.test(v)&&(max&&maxSV.compare(v)!==-1||(max=v,maxSV=new SemVer(max,loose)))}),max}function minSatisfying(versions,range,loose){var min=null,minSV=null;try{var rangeObj=new Range(range,loose)}catch(er){return null}return versions.forEach(function(v){rangeObj.test(v)&&(min&&1!==minSV.compare(v)||(min=v,minSV=new SemVer(min,loose)))}),min}function validRange(range,loose){try{return new Range(range,loose).range||"*"}catch(er){return null}}function ltr(version,range,loose){return outside(version,range,"<",loose)}function gtr(version,range,loose){return outside(version,range,">",loose)}function outside(version,range,hilo,loose){version=new SemVer(version,loose),range=new Range(range,loose);var gtfn,ltefn,ltfn,comp,ecomp;switch(hilo){case">":gtfn=gt,ltefn=lte,ltfn=lt,comp=">",ecomp=">=";break;case"<":gtfn=lt,ltefn=gte,ltfn=gt,comp="<",ecomp="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(satisfies(version,range,loose))return!1;for(var i=0;i=0.0.0")),high=high||comparator,low=low||comparator,gtfn(comparator.semver,high.semver,loose)?high=comparator:ltfn(comparator.semver,low.semver,loose)&&(low=comparator)}),high.operator===comp||high.operator===ecomp)return!1;if((!low.operator||low.operator===comp)&<efn(version,low.semver))return!1;if(low.operator===ecomp&<fn(version,low.semver))return!1}return!0}function prerelease(version,loose){var parsed=parse(version,loose);return parsed&&parsed.prerelease.length?parsed.prerelease:null}function intersects(r1,r2,loose){return r1=new Range(r1,loose),r2=new Range(r2,loose),r1.intersects(r2)}exports=module.exports=SemVer;var debug;debug="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var args=Array.prototype.slice.call(arguments,0);args.unshift("SEMVER"),console.log.apply(console,args)}:function(){},exports.SEMVER_SPEC_VERSION="2.0.0";var MAX_LENGTH=256,MAX_SAFE_INTEGER=Number.MAX_SAFE_INTEGER||9007199254740991,re=exports.re=[],src=exports.src=[],R=0,NUMERICIDENTIFIER=R++;src[NUMERICIDENTIFIER]="0|[1-9]\\d*";var NUMERICIDENTIFIERLOOSE=R++;src[NUMERICIDENTIFIERLOOSE]="[0-9]+";var NONNUMERICIDENTIFIER=R++;src[NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var MAINVERSION=R++;src[MAINVERSION]="("+src[NUMERICIDENTIFIER]+")\\.("+src[NUMERICIDENTIFIER]+")\\.("+src[NUMERICIDENTIFIER]+")";var MAINVERSIONLOOSE=R++;src[MAINVERSIONLOOSE]="("+src[NUMERICIDENTIFIERLOOSE]+")\\.("+src[NUMERICIDENTIFIERLOOSE]+")\\.("+src[NUMERICIDENTIFIERLOOSE]+")";var PRERELEASEIDENTIFIER=R++;src[PRERELEASEIDENTIFIER]="(?:"+src[NUMERICIDENTIFIER]+"|"+src[NONNUMERICIDENTIFIER]+")";var PRERELEASEIDENTIFIERLOOSE=R++;src[PRERELEASEIDENTIFIERLOOSE]="(?:"+src[NUMERICIDENTIFIERLOOSE]+"|"+src[NONNUMERICIDENTIFIER]+")";var PRERELEASE=R++;src[PRERELEASE]="(?:-("+src[PRERELEASEIDENTIFIER]+"(?:\\."+src[PRERELEASEIDENTIFIER]+")*))";var PRERELEASELOOSE=R++;src[PRERELEASELOOSE]="(?:-?("+src[PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+src[PRERELEASEIDENTIFIERLOOSE]+")*))";var BUILDIDENTIFIER=R++;src[BUILDIDENTIFIER]="[0-9A-Za-z-]+";var BUILD=R++;src[BUILD]="(?:\\+("+src[BUILDIDENTIFIER]+"(?:\\."+src[BUILDIDENTIFIER]+")*))";var FULL=R++,FULLPLAIN="v?"+src[MAINVERSION]+src[PRERELEASE]+"?"+src[BUILD]+"?";src[FULL]="^"+FULLPLAIN+"$";var LOOSEPLAIN="[v=\\s]*"+src[MAINVERSIONLOOSE]+src[PRERELEASELOOSE]+"?"+src[BUILD]+"?",LOOSE=R++;src[LOOSE]="^"+LOOSEPLAIN+"$";var GTLT=R++;src[GTLT]="((?:<|>)?=?)";var XRANGEIDENTIFIERLOOSE=R++;src[XRANGEIDENTIFIERLOOSE]=src[NUMERICIDENTIFIERLOOSE]+"|x|X|\\*";var XRANGEIDENTIFIER=R++;src[XRANGEIDENTIFIER]=src[NUMERICIDENTIFIER]+"|x|X|\\*";var XRANGEPLAIN=R++;src[XRANGEPLAIN]="[v=\\s]*("+src[XRANGEIDENTIFIER]+")(?:\\.("+src[XRANGEIDENTIFIER]+")(?:\\.("+src[XRANGEIDENTIFIER]+")(?:"+src[PRERELEASE]+")?"+src[BUILD]+"?)?)?";var XRANGEPLAINLOOSE=R++;src[XRANGEPLAINLOOSE]="[v=\\s]*("+src[XRANGEIDENTIFIERLOOSE]+")(?:\\.("+src[XRANGEIDENTIFIERLOOSE]+")(?:\\.("+src[XRANGEIDENTIFIERLOOSE]+")(?:"+src[PRERELEASELOOSE]+")?"+src[BUILD]+"?)?)?";var XRANGE=R++;src[XRANGE]="^"+src[GTLT]+"\\s*"+src[XRANGEPLAIN]+"$";var XRANGELOOSE=R++;src[XRANGELOOSE]="^"+src[GTLT]+"\\s*"+src[XRANGEPLAINLOOSE]+"$";var LONETILDE=R++;src[LONETILDE]="(?:~>?)";var TILDETRIM=R++;src[TILDETRIM]="(\\s*)"+src[LONETILDE]+"\\s+",re[TILDETRIM]=new RegExp(src[TILDETRIM],"g");var TILDE=R++;src[TILDE]="^"+src[LONETILDE]+src[XRANGEPLAIN]+"$";var TILDELOOSE=R++;src[TILDELOOSE]="^"+src[LONETILDE]+src[XRANGEPLAINLOOSE]+"$";var LONECARET=R++;src[LONECARET]="(?:\\^)";var CARETTRIM=R++;src[CARETTRIM]="(\\s*)"+src[LONECARET]+"\\s+",re[CARETTRIM]=new RegExp(src[CARETTRIM],"g");var CARET=R++;src[CARET]="^"+src[LONECARET]+src[XRANGEPLAIN]+"$";var CARETLOOSE=R++;src[CARETLOOSE]="^"+src[LONECARET]+src[XRANGEPLAINLOOSE]+"$";var COMPARATORLOOSE=R++;src[COMPARATORLOOSE]="^"+src[GTLT]+"\\s*("+LOOSEPLAIN+")$|^$";var COMPARATOR=R++;src[COMPARATOR]="^"+src[GTLT]+"\\s*("+FULLPLAIN+")$|^$";var COMPARATORTRIM=R++;src[COMPARATORTRIM]="(\\s*)"+src[GTLT]+"\\s*("+LOOSEPLAIN+"|"+src[XRANGEPLAIN]+")",re[COMPARATORTRIM]=new RegExp(src[COMPARATORTRIM],"g");var HYPHENRANGE=R++;src[HYPHENRANGE]="^\\s*("+src[XRANGEPLAIN]+")\\s+-\\s+("+src[XRANGEPLAIN]+")\\s*$";var HYPHENRANGELOOSE=R++;src[HYPHENRANGELOOSE]="^\\s*("+src[XRANGEPLAINLOOSE]+")\\s+-\\s+("+src[XRANGEPLAINLOOSE]+")\\s*$";var STAR=R++;src[STAR]="(<|>)?=?\\s*\\*";for(var i=0;i=0;)"number"==typeof this.prerelease[i]&&(this.prerelease[i]++,i=-2);i===-1&&this.prerelease.push(0)}identifier&&(this.prerelease[0]===identifier?isNaN(this.prerelease[1])&&(this.prerelease=[identifier,0]):this.prerelease=[identifier,0]);break;default:throw new Error("invalid increment argument: "+release)}return this.format(),this.raw=this.version,this},exports.inc=inc,exports.diff=diff,exports.compareIdentifiers=compareIdentifiers;var numeric=/^[0-9]+$/;exports.rcompareIdentifiers=rcompareIdentifiers,exports.major=major,exports.minor=minor,exports.patch=patch,exports.compare=compare,exports.compareLoose=compareLoose,exports.rcompare=rcompare,exports.sort=sort,exports.rsort=rsort,exports.gt=gt,exports.lt=lt,exports.eq=eq,exports.neq=neq,exports.gte=gte,exports.lte=lte,exports.cmp=cmp,exports.Comparator=Comparator;var ANY={};Comparator.prototype.parse=function(comp){var r=this.loose?re[COMPARATORLOOSE]:re[COMPARATOR],m=comp.match(r);if(!m)throw new TypeError("Invalid comparator: "+comp);this.operator=m[1],"="===this.operator&&(this.operator=""),m[2]?this.semver=new SemVer(m[2],this.loose):this.semver=ANY},Comparator.prototype.toString=function(){return this.value},Comparator.prototype.test=function(version){return debug("Comparator.test",version,this.loose),this.semver===ANY||("string"==typeof version&&(version=new SemVer(version,this.loose)),cmp(version,this.operator,this.semver,this.loose))},Comparator.prototype.intersects=function(comp,loose){if(!(comp instanceof Comparator))throw new TypeError("a Comparator is required");var rangeTmp;if(""===this.operator)return rangeTmp=new Range(comp.value,loose),satisfies(this.value,rangeTmp,loose);if(""===comp.operator)return rangeTmp=new Range(this.value,loose),satisfies(comp.semver,rangeTmp,loose);var sameDirectionIncreasing=!(">="!==this.operator&&">"!==this.operator||">="!==comp.operator&&">"!==comp.operator),sameDirectionDecreasing=!("<="!==this.operator&&"<"!==this.operator||"<="!==comp.operator&&"<"!==comp.operator),sameSemVer=this.semver.version===comp.semver.version,differentDirectionsInclusive=!(">="!==this.operator&&"<="!==this.operator||">="!==comp.operator&&"<="!==comp.operator),oppositeDirectionsLessThan=cmp(this.semver,"<",comp.semver,loose)&&(">="===this.operator||">"===this.operator)&&("<="===comp.operator||"<"===comp.operator),oppositeDirectionsGreaterThan=cmp(this.semver,">",comp.semver,loose)&&("<="===this.operator||"<"===this.operator)&&(">="===comp.operator||">"===comp.operator);return sameDirectionIncreasing||sameDirectionDecreasing||sameSemVer&&differentDirectionsInclusive||oppositeDirectionsLessThan||oppositeDirectionsGreaterThan},exports.Range=Range,Range.prototype.format=function(){return this.range=this.set.map(function(comps){return comps.join(" ").trim()}).join("||").trim(),this.range},Range.prototype.toString=function(){return this.range},Range.prototype.parseRange=function(range){var loose=this.loose;range=range.trim(),debug("range",range,loose);var hr=loose?re[HYPHENRANGELOOSE]:re[HYPHENRANGE];range=range.replace(hr,hyphenReplace),debug("hyphen replace",range),range=range.replace(re[COMPARATORTRIM],"$1$2$3"),debug("comparator trim",range,re[COMPARATORTRIM]),range=range.replace(re[TILDETRIM],"$1~"),range=range.replace(re[CARETTRIM],"$1^"),range=range.split(/\s+/).join(" ");var compRe=loose?re[COMPARATORLOOSE]:re[COMPARATOR],set=range.split(" ").map(function(comp){return parseComparator(comp,loose)}).join(" ").split(/\s+/);return this.loose&&(set=set.filter(function(comp){return!!comp.match(compRe)})),set=set.map(function(comp){return new Comparator(comp,loose)})},Range.prototype.intersects=function(range,loose){if(!(range instanceof Range))throw new TypeError("a Range is required");return this.set.some(function(thisComparators){return thisComparators.every(function(thisComparator){return range.set.some(function(rangeComparators){return rangeComparators.every(function(rangeComparator){return thisComparator.intersects(rangeComparator,loose)})})})})},exports.toComparators=toComparators,Range.prototype.test=function(version){if(!version)return!1;"string"==typeof version&&(version=new SemVer(version,this.loose));for(var i=0;i>>27}function rotl30(num){return num<<30|num>>>2}function ft(s,b,c,d){return 0===s?b&c|~b&d:2===s?b&c|b&d|c&d:b^c^d}var inherits=__webpack_require__(1),Hash=__webpack_require__(56),K=[1518500249,1859775393,-1894007588,-899497514],W=new Array(80);inherits(Sha,Hash),Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha.prototype._update=function(M){for(var W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<80;++i)W[i]=W[i-3]^W[i-8]^W[i-14]^W[i-16];for(var j=0;j<80;++j){var s=~~(j/20),t=rotl5(a)+ft(s,b,c,d)+e+W[j]+K[s]|0;e=d,d=c,c=rotl30(b),b=a,a=t}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0},Sha.prototype._hash=function(){var H=new Buffer(20);return H.writeInt32BE(0|this._a,0),H.writeInt32BE(0|this._b,4),H.writeInt32BE(0|this._c,8),H.writeInt32BE(0|this._d,12),H.writeInt32BE(0|this._e,16),H},module.exports=Sha}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Sha1(){this.init(),this._w=W,Hash.call(this,64,56)}function rotl1(num){return num<<1|num>>>31}function rotl5(num){return num<<5|num>>>27}function rotl30(num){return num<<30|num>>>2}function ft(s,b,c,d){return 0===s?b&c|~b&d:2===s?b&c|b&d|c&d:b^c^d}var inherits=__webpack_require__(1),Hash=__webpack_require__(56),K=[1518500249,1859775393,-1894007588,-899497514],W=new Array(80);inherits(Sha1,Hash),Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha1.prototype._update=function(M){for(var W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<80;++i)W[i]=rotl1(W[i-3]^W[i-8]^W[i-14]^W[i-16]);for(var j=0;j<80;++j){var s=~~(j/20),t=rotl5(a)+ft(s,b,c,d)+e+W[j]+K[s]|0;e=d,d=c,c=rotl30(b),b=a,a=t}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0},Sha1.prototype._hash=function(){var H=new Buffer(20);return H.writeInt32BE(0|this._a,0),H.writeInt32BE(0|this._b,4),H.writeInt32BE(0|this._c,8),H.writeInt32BE(0|this._d,12),H.writeInt32BE(0|this._e,16),H},module.exports=Sha1}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Sha224(){this.init(),this._w=W,Hash.call(this,64,56)}var inherits=__webpack_require__(1),Sha256=__webpack_require__(267),Hash=__webpack_require__(56),W=new Array(64);inherits(Sha224,Sha256),Sha224.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},Sha224.prototype._hash=function(){var H=new Buffer(28);return H.writeInt32BE(this._a,0),H.writeInt32BE(this._b,4),H.writeInt32BE(this._c,8),H.writeInt32BE(this._d,12),H.writeInt32BE(this._e,16),H.writeInt32BE(this._f,20),H.writeInt32BE(this._g,24),H},module.exports=Sha224}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Sha384(){this.init(),this._w=W,Hash.call(this,128,112)}var inherits=__webpack_require__(1),SHA512=__webpack_require__(268),Hash=__webpack_require__(56),W=new Array(160);inherits(Sha384,SHA512),Sha384.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},Sha384.prototype._hash=function(){function writeInt64BE(h,l,offset){H.writeInt32BE(h,offset),H.writeInt32BE(l,offset+4)}var H=new Buffer(48);return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),H},module.exports=Sha384}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){var varint=__webpack_require__(15);exports.encode=function encode(v,b,o){v=v>=0?2*v:v*-2-1;var r=varint.encode(v,b,o);return encode.bytes=varint.encode.bytes,r},exports.decode=function decode(b,o){var v=varint.decode(b,o);return decode.bytes=varint.decode.bytes,1&v?(v+1)/-2:v/2},exports.encodingLength=function(v){return varint.encodingLength(v>=0?2*v:v*-2-1)}},function(module,exports,__webpack_require__){(function(Buffer){function Peer(opts){var self=this;if(!(self instanceof Peer))return new Peer(opts);if(self._id=randombytes(4).toString("hex").slice(0,7),self._debug("new peer %o",opts),opts=Object.assign({allowHalfOpen:!1},opts),stream.Duplex.call(self,opts),self.channelName=opts.initiator?opts.channelName||randombytes(20).toString("hex"):null,self._isChromium="undefined"!=typeof window&&!!window.webkitRTCPeerConnection,self.initiator=opts.initiator||!1,self.channelConfig=opts.channelConfig||Peer.channelConfig,self.config=opts.config||Peer.config,self.constraints=self._transformConstraints(opts.constraints||Peer.constraints),self.offerConstraints=self._transformConstraints(opts.offerConstraints||{}),self.answerConstraints=self._transformConstraints(opts.answerConstraints||{}),self.reconnectTimer=opts.reconnectTimer||!1,self.sdpTransform=opts.sdpTransform||function(sdp){return sdp},self.stream=opts.stream||!1,self.trickle=void 0===opts.trickle||opts.trickle,self._earlyMessage=null,self.destroyed=!1,self.connected=!1,self.remoteAddress=void 0,self.remoteFamily=void 0,self.remotePort=void 0,self.localAddress=void 0,self.localPort=void 0,self._wrtc=opts.wrtc&&"object"==typeof opts.wrtc?opts.wrtc:getBrowserRTC(),!self._wrtc)throw"undefined"==typeof window?new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"):new Error("No WebRTC support: Not a supported browser");if(self._pcReady=!1,self._channelReady=!1,self._iceComplete=!1,self._channel=null,self._pendingCandidates=[],self._previousStreams=[],self._chunk=null,self._cb=null,self._interval=null,self._reconnectTimeout=null,self._pc=new self._wrtc.RTCPeerConnection(self.config,self.constraints),self._isWrtc=Array.isArray(self._pc.RTCIceConnectionStates),self._isReactNativeWebrtc="number"==typeof self._pc._peerConnectionId,self._pc.oniceconnectionstatechange=function(){self._onIceStateChange()},self._pc.onicegatheringstatechange=function(){self._onIceStateChange()},self._pc.onsignalingstatechange=function(){self._onSignalingStateChange()},self._pc.onicecandidate=function(event){self._onIceCandidate(event)},self.initiator){var createdOffer=!1;self._pc.onnegotiationneeded=function(){createdOffer||self._createOffer(),createdOffer=!0},self._setupData({channel:self._pc.createDataChannel(self.channelName,self.channelConfig)})}else self._pc.ondatachannel=function(event){self._setupData(event)};"addTrack"in self._pc?(self.stream&&self.stream.getTracks().forEach(function(track){self._pc.addTrack(track,self.stream)}),self._pc.ontrack=function(event){self._onTrack(event)}):(self.stream&&self._pc.addStream(self.stream),self._pc.onaddstream=function(event){self._onAddStream(event)}),self.initiator&&self._isWrtc&&self._pc.onnegotiationneeded(),self._onFinishBound=function(){self._onFinish()},self.once("finish",self._onFinishBound)}function noop(){}module.exports=Peer;var debug=__webpack_require__(3)("simple-peer"),getBrowserRTC=__webpack_require__(373),inherits=__webpack_require__(1),randombytes=__webpack_require__(636),stream=__webpack_require__(36);inherits(Peer,stream.Duplex),Peer.WEBRTC_SUPPORT=!!getBrowserRTC(),Peer.config={iceServers:[{urls:"stun:stun.l.google.com:19302"},{urls:"stun:global.stun.twilio.com:3478?transport=udp"}]},Peer.constraints={},Peer.channelConfig={},Object.defineProperty(Peer.prototype,"bufferSize",{get:function(){var self=this;return self._channel&&self._channel.bufferedAmount||0}}),Peer.prototype.address=function(){var self=this;return{port:self.localPort,family:"IPv4",address:self.localAddress}},Peer.prototype.signal=function(data){var self=this;if(self.destroyed)throw new Error("cannot signal after peer is destroyed");if("string"==typeof data)try{data=JSON.parse(data)}catch(err){data={}}self._debug("signal()"),data.candidate&&(self._pc.remoteDescription?self._addIceCandidate(data.candidate):self._pendingCandidates.push(data.candidate)),data.sdp&&self._pc.setRemoteDescription(new self._wrtc.RTCSessionDescription(data),function(){self.destroyed||(self._pendingCandidates.forEach(function(candidate){self._addIceCandidate(candidate)}),self._pendingCandidates=[],"offer"===self._pc.remoteDescription.type&&self._createAnswer())},function(err){self._destroy(err)}),data.sdp||data.candidate||self._destroy(new Error("signal() called with invalid signal data"))},Peer.prototype._addIceCandidate=function(candidate){var self=this;try{self._pc.addIceCandidate(new self._wrtc.RTCIceCandidate(candidate),noop,function(err){self._destroy(err)})}catch(err){self._destroy(new Error("error adding candidate: "+err.message))}},Peer.prototype.send=function(chunk){var self=this;self._isWrtc&&Buffer.isBuffer(chunk)&&(chunk=new Uint8Array(chunk)),self._channel.send(chunk)},Peer.prototype.destroy=function(onclose){this._destroy(null,onclose)},Peer.prototype._destroy=function(err,onclose){var self=this;if(!self.destroyed){if(onclose&&self.once("close",onclose),self._debug("destroy (error: %s)",err&&(err.message||err)),self.readable=self.writable=!1,self._readableState.ended||self.push(null),self._writableState.finished||self.end(),self.destroyed=!0,self.connected=!1,self._pcReady=!1,self._channelReady=!1,self._previousStreams=null,self._earlyMessage=null,clearInterval(self._interval),clearTimeout(self._reconnectTimeout),self._interval=null,self._reconnectTimeout=null,self._chunk=null,self._cb=null,self._onFinishBound&&self.removeListener("finish",self._onFinishBound),self._onFinishBound=null,self._pc){try{self._pc.close()}catch(err){}self._pc.oniceconnectionstatechange=null,self._pc.onicegatheringstatechange=null,self._pc.onsignalingstatechange=null,self._pc.onicecandidate=null,"addTrack"in self._pc?self._pc.ontrack=null:self._pc.onaddstream=null,self._pc.onnegotiationneeded=null,self._pc.ondatachannel=null}if(self._channel){try{self._channel.close()}catch(err){}self._channel.onmessage=null,self._channel.onopen=null,self._channel.onclose=null,self._channel.onerror=null}self._pc=null,self._channel=null,err&&self.emit("error",err),self.emit("close")}},Peer.prototype._setupData=function(event){var self=this;if(!event.channel)return self._destroy(new Error("Data channel event is missing `channel` property"));self._channel=event.channel,self._channel.binaryType="arraybuffer","number"==typeof self._channel.bufferedAmountLowThreshold&&(self._channel.bufferedAmountLowThreshold=65536),self.channelName=self._channel.label,self._channel.onmessage=function(event){self._channelReady?self._onChannelMessage(event):(self._earlyMessage=event,self._onChannelOpen())},self._channel.onbufferedamountlow=function(){self._onChannelBufferedAmountLow()},self._channel.onopen=function(){self._channelReady||self._onChannelOpen()},self._channel.onclose=function(){self._onChannelClose()},self._channel.onerror=function(err){self._destroy(err)}},Peer.prototype._read=function(){},Peer.prototype._write=function(chunk,encoding,cb){var self=this;if(self.destroyed)return cb(new Error("cannot write after peer is destroyed"));if(self.connected){try{self.send(chunk)}catch(err){return self._destroy(err)}self._channel.bufferedAmount>65536?(self._debug("start backpressure: bufferedAmount %d",self._channel.bufferedAmount),self._cb=cb):cb(null)}else self._debug("write before connect"),self._chunk=chunk,self._cb=cb},Peer.prototype._onFinish=function(){function destroySoon(){setTimeout(function(){self._destroy()},1e3)}var self=this;self.destroyed||(self.connected?destroySoon():self.once("connect",destroySoon))},Peer.prototype._createOffer=function(){var self=this;self.destroyed||self._pc.createOffer(function(offer){function onSuccess(){self.destroyed||(self.trickle||self._iceComplete?sendOffer():self.once("_iceComplete",sendOffer))}function onError(err){self._destroy(err)}function sendOffer(){var signal=self._pc.localDescription||offer;self._debug("signal"),self.emit("signal",{type:signal.type,sdp:signal.sdp})}self.destroyed||(offer.sdp=self.sdpTransform(offer.sdp),self._pc.setLocalDescription(offer,onSuccess,onError))},function(err){self._destroy(err)},self.offerConstraints)},Peer.prototype._createAnswer=function(){var self=this;self.destroyed||self._pc.createAnswer(function(answer){function onSuccess(){self.destroyed||(self.trickle||self._iceComplete?sendAnswer():self.once("_iceComplete",sendAnswer))}function onError(err){self._destroy(err)}function sendAnswer(){var signal=self._pc.localDescription||answer;self._debug("signal"),self.emit("signal",{type:signal.type,sdp:signal.sdp})}self.destroyed||(answer.sdp=self.sdpTransform(answer.sdp),self._pc.setLocalDescription(answer,onSuccess,onError))},function(err){self._destroy(err)},self.answerConstraints)},Peer.prototype._onIceStateChange=function(){var self=this;if(!self.destroyed){var iceConnectionState=self._pc.iceConnectionState,iceGatheringState=self._pc.iceGatheringState;self._debug("iceStateChange (connection: %s) (gathering: %s)",iceConnectionState,iceGatheringState),self.emit("iceStateChange",iceConnectionState,iceGatheringState),"connected"!==iceConnectionState&&"completed"!==iceConnectionState||(clearTimeout(self._reconnectTimeout),self._pcReady=!0,self._maybeReady()),"disconnected"===iceConnectionState&&(self.reconnectTimer?(clearTimeout(self._reconnectTimeout),self._reconnectTimeout=setTimeout(function(){self._destroy()},self.reconnectTimer)):self._destroy()),"failed"===iceConnectionState&&self._destroy(new Error("Ice connection failed.")),"closed"===iceConnectionState&&self._destroy()}},Peer.prototype.getStats=function(cb){var self=this;0===self._pc.getStats.length?self._pc.getStats().then(function(res){var reports=[];res.forEach(function(report){reports.push(report)}),cb(null,reports)},function(err){cb(err)}):self._isReactNativeWebrtc?self._pc.getStats(null,function(res){var reports=[];res.forEach(function(report){reports.push(report)}),cb(null,reports)},function(err){cb(err)}):self._pc.getStats.length>0?self._pc.getStats(function(res){var reports=[];res.result().forEach(function(result){var report={};result.names().forEach(function(name){report[name]=result.stat(name)}),report.id=result.id,report.type=result.type,report.timestamp=result.timestamp,reports.push(report)}),cb(null,reports)},function(err){cb(err)}):cb(null,[])},Peer.prototype._maybeReady=function(){var self=this;self._debug("maybeReady pc %s channel %s",self._pcReady,self._channelReady),!self.connected&&!self._connecting&&self._pcReady&&self._channelReady&&(self._connecting=!0,self.getStats(function(err,items){function setSelectedCandidatePair(selectedCandidatePair){var local=localCandidates[selectedCandidatePair.localCandidateId];local&&local.ip?(self.localAddress=local.ip,self.localPort=Number(local.port)):local&&local.ipAddress?(self.localAddress=local.ipAddress,self.localPort=Number(local.portNumber)):"string"==typeof selectedCandidatePair.googLocalAddress&&(local=selectedCandidatePair.googLocalAddress.split(":"),self.localAddress=local[0],self.localPort=Number(local[1]));var remote=remoteCandidates[selectedCandidatePair.remoteCandidateId];remote&&remote.ip?(self.remoteAddress=remote.ip,self.remotePort=Number(remote.port)):remote&&remote.ipAddress?(self.remoteAddress=remote.ipAddress,self.remotePort=Number(remote.portNumber)):"string"==typeof selectedCandidatePair.googRemoteAddress&&(remote=selectedCandidatePair.googRemoteAddress.split(":"),self.remoteAddress=remote[0],self.remotePort=Number(remote[1])),self.remoteFamily="IPv4",self._debug("connect local: %s:%s remote: %s:%s",self.localAddress,self.localPort,self.remoteAddress,self.remotePort)}if(!self.destroyed){err&&(items=[]),self._connecting=!1,self.connected=!0;var remoteCandidates={},localCandidates={},candidatePairs={};if(items.forEach(function(item){"remotecandidate"!==item.type&&"remote-candidate"!==item.type||(remoteCandidates[item.id]=item),"localcandidate"!==item.type&&"local-candidate"!==item.type||(localCandidates[item.id]=item),"candidatepair"!==item.type&&"candidate-pair"!==item.type||(candidatePairs[item.id]=item)}),items.forEach(function(item){"transport"===item.type&&setSelectedCandidatePair(candidatePairs[item.selectedCandidatePairId]),("googCandidatePair"===item.type&&"true"===item.googActiveConnection||("candidatepair"===item.type||"candidate-pair"===item.type)&&item.selected)&&setSelectedCandidatePair(item)}),self._chunk){try{self.send(self._chunk)}catch(err){return self._destroy(err)}self._chunk=null,self._debug('sent chunk from "write before connect"');var cb=self._cb;self._cb=null,cb(null)}"number"!=typeof self._channel.bufferedAmountLowThreshold&&(self._interval=setInterval(function(){self._onInterval()},150),self._interval.unref&&self._interval.unref()),self._debug("connect"),self.emit("connect"),self._earlyMessage&&(self._onChannelMessage(self._earlyMessage),self._earlyMessage=null)}}))},Peer.prototype._onInterval=function(){!this._cb||!this._channel||this._channel.bufferedAmount>65536||this._onChannelBufferedAmountLow()},Peer.prototype._onSignalingStateChange=function(){var self=this;self.destroyed||(self._debug("signalingStateChange %s",self._pc.signalingState),self.emit("signalingStateChange",self._pc.signalingState))},Peer.prototype._onIceCandidate=function(event){var self=this;self.destroyed||(event.candidate&&self.trickle?self.emit("signal",{candidate:{candidate:event.candidate.candidate,sdpMLineIndex:event.candidate.sdpMLineIndex,sdpMid:event.candidate.sdpMid}}):event.candidate||(self._iceComplete=!0,self.emit("_iceComplete")))},Peer.prototype._onChannelMessage=function(event){var self=this;if(!self.destroyed){var data=event.data;data instanceof ArrayBuffer&&(data=Buffer.from(data)),self.push(data)}},Peer.prototype._onChannelBufferedAmountLow=function(){var self=this;if(!self.destroyed&&self._cb){self._debug("ending backpressure: bufferedAmount %d",self._channel.bufferedAmount);var cb=self._cb;self._cb=null,cb(null)}},Peer.prototype._onChannelOpen=function(){var self=this;self.connected||self.destroyed||(self._debug("on channel open"),self._channelReady=!0,self._maybeReady())},Peer.prototype._onChannelClose=function(){var self=this;self.destroyed||(self._debug("on channel close"),self._destroy())},Peer.prototype._onAddStream=function(event){var self=this;self.destroyed||(self._debug("on add stream"),self.emit("stream",event.stream))},Peer.prototype._onTrack=function(event){var self=this;if(!self.destroyed){self._debug("on track");var id=event.streams[0].id;self._previousStreams.indexOf(id)===-1&&(self._previousStreams.push(id),self.emit("stream",event.streams[0]))}},Peer.prototype._debug=function(){var self=this,args=[].slice.call(arguments);args[0]="["+self._id+"] "+args[0],debug.apply(null,args)},Peer.prototype._transformConstraints=function(constraints){var self=this;if(0===Object.keys(constraints).length)return constraints;if((constraints.mandatory||constraints.optional)&&!self._isChromium){var newConstraints=Object.assign({},constraints.optional,constraints.mandatory);return void 0!==newConstraints.OfferToReceiveVideo&&(newConstraints.offerToReceiveVideo=newConstraints.OfferToReceiveVideo,delete newConstraints.OfferToReceiveVideo),void 0!==newConstraints.OfferToReceiveAudio&&(newConstraints.offerToReceiveAudio=newConstraints.OfferToReceiveAudio,delete newConstraints.OfferToReceiveAudio),newConstraints}return constraints.mandatory||constraints.optional||!self._isChromium?constraints:(void 0!==constraints.offerToReceiveVideo&&(constraints.OfferToReceiveVideo=constraints.offerToReceiveVideo,delete constraints.offerToReceiveVideo),void 0!==constraints.offerToReceiveAudio&&(constraints.OfferToReceiveAudio=constraints.offerToReceiveAudio,delete constraints.offerToReceiveAudio),{mandatory:constraints})}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function lookup(uri,opts){"object"==typeof uri&&(opts=uri,uri=void 0),opts=opts||{};var io,parsed=url(uri),source=parsed.source,id=parsed.id,path=parsed.path,sameNamespace=cache[id]&&path in cache[id].nsps,newConnection=opts.forceNew||opts["force new connection"]||!1===opts.multiplex||sameNamespace;return newConnection?(debug("ignoring socket cache for %s",source),io=Manager(source,opts)):(cache[id]||(debug("new io instance for %s",source),cache[id]=Manager(source,opts)),io=cache[id]),parsed.query&&!opts.query&&(opts.query=parsed.query),io.socket(parsed.path,opts)}var url=__webpack_require__(660),parser=__webpack_require__(145),Manager=__webpack_require__(269),debug=__webpack_require__(3)("socket.io-client");module.exports=exports=lookup;var cache=exports.managers={};exports.protocol=parser.protocol,exports.connect=lookup,exports.Manager=__webpack_require__(269),exports.Socket=__webpack_require__(271)},function(module,exports,__webpack_require__){(function(global){function url(uri,loc){var obj=uri;loc=loc||global.location,null==uri&&(uri=loc.protocol+"//"+loc.host),"string"==typeof uri&&("/"===uri.charAt(0)&&(uri="/"===uri.charAt(1)?loc.protocol+uri:loc.host+uri),/^(https?|wss?):\/\//.test(uri)||(debug("protocol-less url %s",uri),uri=void 0!==loc?loc.protocol+"//"+uri:"https://"+uri),debug("parse %s",uri),obj=parseuri(uri)),obj.port||(/^(http|ws)$/.test(obj.protocol)?obj.port="80":/^(http|ws)s$/.test(obj.protocol)&&(obj.port="443")),obj.path=obj.path||"/";var ipv6=obj.host.indexOf(":")!==-1,host=ipv6?"["+obj.host+"]":obj.host;return obj.id=obj.protocol+"://"+host+":"+obj.port,obj.href=obj.protocol+"://"+host+(loc&&loc.port===obj.port?"":":"+obj.port),obj}var parseuri=__webpack_require__(244),debug=__webpack_require__(3)("socket.io-client:url");module.exports=url}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){(function(global){function _deconstructPacket(data,buffers){if(!data)return data;if(isBuf(data)){var placeholder={_placeholder:!0,num:buffers.length};return buffers.push(data),placeholder}if(isArray(data)){for(var newData=new Array(data.length),i=0;i>1&1431655765,16843009*((v=(858993459&v)+(v>>2&858993459))+(v>>4)&252645135)>>24}function sortInternal(a,b){return a[0]-b[0]}function valueOnly(elem){return elem[1]}module.exports=class SparseArray{constructor(){this._bitArrays=[],this._data=[],this._length=0,this._changedLength=!1,this._changedData=!1}set(index,value){let pos=this._internalPositionFor(index,!1);if(void 0===value)pos!==-1&&(this._unsetInternalPos(pos),this._unsetBit(index),this._changedLength=!0,this._changedData=!0);else{let needsSort=!1;pos===-1?(pos=this._data.length,this._setBit(index),this._changedData=!0):needsSort=!0,this._setInternalPos(pos,index,value,needsSort),this._changedLength=!0}}unset(index){this.set(index,void 0)}get(index){this._sortData();const pos=this._internalPositionFor(index,!0);if(pos!==-1)return this._data[pos][1]}push(value){return this.set(this.length,value),this.length}get length(){if(this._sortData(),this._changedLength){const last=this._data[this._data.length-1];this._length=last?last[0]+1:0,this._changedLength=!1}return this._length}forEach(iterator){let i=0;for(;i=this._bitArrays.length)return-1;const byte=this._bitArrays[bytePos],bitPos=index-7*bytePos;return(byte&1<0?this._bitArrays.slice(0,bytePos).reduce(popCountReduce,0)+popCount(byte&~(4294967295<=index)data.push(elem);else if(data[0][0]<=index)data.unshift(elem);else{const randomIndex=Math.round(data.length/2);this._data=data.slice(0,randomIndex).concat(elem).concat(data.slice(randomIndex))}else this._data.push(elem);this._changedData=!0,this._changedLength=!0}}_unsetInternalPos(pos){this._data.splice(pos,1)}_sortData(){this._changedData&&this._data.sort(sortInternal)}bitField(){const bytes=[];let newByte,pendingBitsForResultingByte=8,pendingBitsForNewByte=0,resultingByte=0;const pending=this._bitArrays.slice();for(;pending.length||pendingBitsForNewByte;){0===pendingBitsForNewByte&&(newByte=pending.shift(),pendingBitsForNewByte=7);const usingBits=Math.min(pendingBitsForNewByte,pendingBitsForResultingByte),mask=~(255<>>=usingBits,pendingBitsForNewByte-=usingBits,pendingBitsForResultingByte-=usingBits,pendingBitsForResultingByte&&(pendingBitsForNewByte||pending.length)||(bytes.push(resultingByte),resultingByte=0,pendingBitsForResultingByte=8)}for(var i=bytes.length-1;i>0;i--){const value=bytes[i];if(0!==value)break;bytes.pop()}return bytes}compactArray(){return this._sortData(),this._data.map(valueOnly)}}},function(module,exports,__webpack_require__){!function(){function exec(arr,comp){"function"!=typeof comp&&(comp=function(a,b){return String(a).localeCompare(b)});var len=arr.length;if(len<=1)return arr;for(var buffer=new Array(len),chk=1;chklen&&(r=len),e>len&&(e=len),li=l,ri=r;;)if(li{entries.forEach((entry,key)=>{const v=entry.validity||validity;getTimeElapsed(entry.timestamp)>v&&entries.delete(key)})},200);this.put=((key,value,validity)=>{this.has(key)||entries.set(key,{value:value,timestamp:new Date,validity:validity}),sweep()}),this.get=(key=>{if(entries.has(key))return entries.get(key).value;throw new Error("key does not exist")}),this.has=(key=>{return entries.has(key)})}function getTimeElapsed(prevTime){const currentTime=new Date,a=currentTime.getTime()-prevTime.getTime();return Math.floor(a/1e3)}const throttle=__webpack_require__(530);module.exports=TimeCache},function(module,exports){function toArray(list,index){var array=[];index=index||0;for(var i=index||0;i>24&255,x[i+1]=h>>16&255,x[i+2]=h>>8&255,x[i+3]=255&h,x[i+4]=l>>24&255,x[i+5]=l>>16&255,x[i+6]=l>>8&255,x[i+7]=255&l}function vn(x,xi,y,yi,n){var i,d=0;for(i=0;i>>8)-1}function crypto_verify_16(x,xi,y,yi){return vn(x,xi,y,yi,16)}function crypto_verify_32(x,xi,y,yi){return vn(x,xi,y,yi,32)}function core_salsa20(o,p,k,c){for(var u,j0=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,j1=255&k[0]|(255&k[1])<<8|(255&k[2])<<16|(255&k[3])<<24,j2=255&k[4]|(255&k[5])<<8|(255&k[6])<<16|(255&k[7])<<24,j3=255&k[8]|(255&k[9])<<8|(255&k[10])<<16|(255&k[11])<<24,j4=255&k[12]|(255&k[13])<<8|(255&k[14])<<16|(255&k[15])<<24,j5=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,j6=255&p[0]|(255&p[1])<<8|(255&p[2])<<16|(255&p[3])<<24,j7=255&p[4]|(255&p[5])<<8|(255&p[6])<<16|(255&p[7])<<24,j8=255&p[8]|(255&p[9])<<8|(255&p[10])<<16|(255&p[11])<<24,j9=255&p[12]|(255&p[13])<<8|(255&p[14])<<16|(255&p[15])<<24,j10=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,j11=255&k[16]|(255&k[17])<<8|(255&k[18])<<16|(255&k[19])<<24,j12=255&k[20]|(255&k[21])<<8|(255&k[22])<<16|(255&k[23])<<24,j13=255&k[24]|(255&k[25])<<8|(255&k[26])<<16|(255&k[27])<<24,j14=255&k[28]|(255&k[29])<<8|(255&k[30])<<16|(255&k[31])<<24,j15=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,x0=j0,x1=j1,x2=j2,x3=j3,x4=j4,x5=j5,x6=j6,x7=j7,x8=j8,x9=j9,x10=j10,x11=j11,x12=j12,x13=j13,x14=j14,x15=j15,i=0;i<20;i+=2)u=x0+x12|0,x4^=u<<7|u>>>25,u=x4+x0|0,x8^=u<<9|u>>>23,u=x8+x4|0,x12^=u<<13|u>>>19,u=x12+x8|0,x0^=u<<18|u>>>14,u=x5+x1|0,x9^=u<<7|u>>>25,u=x9+x5|0,x13^=u<<9|u>>>23,u=x13+x9|0,x1^=u<<13|u>>>19,u=x1+x13|0,x5^=u<<18|u>>>14,u=x10+x6|0,x14^=u<<7|u>>>25,u=x14+x10|0,x2^=u<<9|u>>>23,u=x2+x14|0,x6^=u<<13|u>>>19,u=x6+x2|0,x10^=u<<18|u>>>14,u=x15+x11|0,x3^=u<<7|u>>>25,u=x3+x15|0,x7^=u<<9|u>>>23,u=x7+x3|0,x11^=u<<13|u>>>19,u=x11+x7|0,x15^=u<<18|u>>>14,u=x0+x3|0,x1^=u<<7|u>>>25,u=x1+x0|0,x2^=u<<9|u>>>23,u=x2+x1|0,x3^=u<<13|u>>>19,u=x3+x2|0,x0^=u<<18|u>>>14,u=x5+x4|0,x6^=u<<7|u>>>25,u=x6+x5|0,x7^=u<<9|u>>>23,u=x7+x6|0,x4^=u<<13|u>>>19,u=x4+x7|0,x5^=u<<18|u>>>14,u=x10+x9|0,x11^=u<<7|u>>>25,u=x11+x10|0,x8^=u<<9|u>>>23,u=x8+x11|0,x9^=u<<13|u>>>19,u=x9+x8|0,x10^=u<<18|u>>>14,u=x15+x14|0,x12^=u<<7|u>>>25,u=x12+x15|0,x13^=u<<9|u>>>23,u=x13+x12|0,x14^=u<<13|u>>>19,u=x14+x13|0,x15^=u<<18|u>>>14;x0=x0+j0|0,x1=x1+j1|0,x2=x2+j2|0,x3=x3+j3|0,x4=x4+j4|0,x5=x5+j5|0,x6=x6+j6|0,x7=x7+j7|0,x8=x8+j8|0,x9=x9+j9|0,x10=x10+j10|0,x11=x11+j11|0,x12=x12+j12|0,x13=x13+j13|0,x14=x14+j14|0,x15=x15+j15|0,o[0]=x0>>>0&255,o[1]=x0>>>8&255,o[2]=x0>>>16&255,o[3]=x0>>>24&255,o[4]=x1>>>0&255,o[5]=x1>>>8&255,o[6]=x1>>>16&255,o[7]=x1>>>24&255,o[8]=x2>>>0&255,o[9]=x2>>>8&255,o[10]=x2>>>16&255,o[11]=x2>>>24&255,o[12]=x3>>>0&255,o[13]=x3>>>8&255,o[14]=x3>>>16&255,o[15]=x3>>>24&255,o[16]=x4>>>0&255,o[17]=x4>>>8&255,o[18]=x4>>>16&255,o[19]=x4>>>24&255,o[20]=x5>>>0&255,o[21]=x5>>>8&255,o[22]=x5>>>16&255,o[23]=x5>>>24&255,o[24]=x6>>>0&255,o[25]=x6>>>8&255,o[26]=x6>>>16&255,o[27]=x6>>>24&255,o[28]=x7>>>0&255,o[29]=x7>>>8&255,o[30]=x7>>>16&255,o[31]=x7>>>24&255,o[32]=x8>>>0&255,o[33]=x8>>>8&255,o[34]=x8>>>16&255,o[35]=x8>>>24&255,o[36]=x9>>>0&255,o[37]=x9>>>8&255,o[38]=x9>>>16&255,o[39]=x9>>>24&255,o[40]=x10>>>0&255,o[41]=x10>>>8&255,o[42]=x10>>>16&255,o[43]=x10>>>24&255,o[44]=x11>>>0&255,o[45]=x11>>>8&255,o[46]=x11>>>16&255,o[47]=x11>>>24&255,o[48]=x12>>>0&255,o[49]=x12>>>8&255,o[50]=x12>>>16&255,o[51]=x12>>>24&255,o[52]=x13>>>0&255,o[53]=x13>>>8&255,o[54]=x13>>>16&255,o[55]=x13>>>24&255,o[56]=x14>>>0&255,o[57]=x14>>>8&255,o[58]=x14>>>16&255,o[59]=x14>>>24&255,o[60]=x15>>>0&255,o[61]=x15>>>8&255,o[62]=x15>>>16&255,o[63]=x15>>>24&255}function core_hsalsa20(o,p,k,c){for(var u,j0=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,j1=255&k[0]|(255&k[1])<<8|(255&k[2])<<16|(255&k[3])<<24,j2=255&k[4]|(255&k[5])<<8|(255&k[6])<<16|(255&k[7])<<24,j3=255&k[8]|(255&k[9])<<8|(255&k[10])<<16|(255&k[11])<<24,j4=255&k[12]|(255&k[13])<<8|(255&k[14])<<16|(255&k[15])<<24,j5=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,j6=255&p[0]|(255&p[1])<<8|(255&p[2])<<16|(255&p[3])<<24,j7=255&p[4]|(255&p[5])<<8|(255&p[6])<<16|(255&p[7])<<24,j8=255&p[8]|(255&p[9])<<8|(255&p[10])<<16|(255&p[11])<<24,j9=255&p[12]|(255&p[13])<<8|(255&p[14])<<16|(255&p[15])<<24,j10=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,j11=255&k[16]|(255&k[17])<<8|(255&k[18])<<16|(255&k[19])<<24,j12=255&k[20]|(255&k[21])<<8|(255&k[22])<<16|(255&k[23])<<24,j13=255&k[24]|(255&k[25])<<8|(255&k[26])<<16|(255&k[27])<<24,j14=255&k[28]|(255&k[29])<<8|(255&k[30])<<16|(255&k[31])<<24,j15=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,x0=j0,x1=j1,x2=j2,x3=j3,x4=j4,x5=j5,x6=j6,x7=j7,x8=j8,x9=j9,x10=j10,x11=j11,x12=j12,x13=j13,x14=j14,x15=j15,i=0;i<20;i+=2)u=x0+x12|0,x4^=u<<7|u>>>25,u=x4+x0|0,x8^=u<<9|u>>>23,u=x8+x4|0,x12^=u<<13|u>>>19,u=x12+x8|0,x0^=u<<18|u>>>14,u=x5+x1|0,x9^=u<<7|u>>>25,u=x9+x5|0,x13^=u<<9|u>>>23,u=x13+x9|0,x1^=u<<13|u>>>19,u=x1+x13|0,x5^=u<<18|u>>>14,u=x10+x6|0,x14^=u<<7|u>>>25,u=x14+x10|0,x2^=u<<9|u>>>23,u=x2+x14|0,x6^=u<<13|u>>>19,u=x6+x2|0,x10^=u<<18|u>>>14,u=x15+x11|0,x3^=u<<7|u>>>25,u=x3+x15|0,x7^=u<<9|u>>>23,u=x7+x3|0,x11^=u<<13|u>>>19,u=x11+x7|0,x15^=u<<18|u>>>14,u=x0+x3|0,x1^=u<<7|u>>>25,u=x1+x0|0,x2^=u<<9|u>>>23,u=x2+x1|0,x3^=u<<13|u>>>19,u=x3+x2|0,x0^=u<<18|u>>>14,u=x5+x4|0,x6^=u<<7|u>>>25,u=x6+x5|0,x7^=u<<9|u>>>23,u=x7+x6|0,x4^=u<<13|u>>>19,u=x4+x7|0,x5^=u<<18|u>>>14,u=x10+x9|0,x11^=u<<7|u>>>25,u=x11+x10|0,x8^=u<<9|u>>>23,u=x8+x11|0,x9^=u<<13|u>>>19,u=x9+x8|0,x10^=u<<18|u>>>14,u=x15+x14|0,x12^=u<<7|u>>>25,u=x12+x15|0,x13^=u<<9|u>>>23,u=x13+x12|0,x14^=u<<13|u>>>19,u=x14+x13|0,x15^=u<<18|u>>>14;o[0]=x0>>>0&255,o[1]=x0>>>8&255,o[2]=x0>>>16&255,o[3]=x0>>>24&255,o[4]=x5>>>0&255,o[5]=x5>>>8&255,o[6]=x5>>>16&255,o[7]=x5>>>24&255,o[8]=x10>>>0&255,o[9]=x10>>>8&255,o[10]=x10>>>16&255,o[11]=x10>>>24&255,o[12]=x15>>>0&255,o[13]=x15>>>8&255,o[14]=x15>>>16&255,o[15]=x15>>>24&255,o[16]=x6>>>0&255,o[17]=x6>>>8&255,o[18]=x6>>>16&255,o[19]=x6>>>24&255,o[20]=x7>>>0&255,o[21]=x7>>>8&255,o[22]=x7>>>16&255,o[23]=x7>>>24&255,o[24]=x8>>>0&255,o[25]=x8>>>8&255,o[26]=x8>>>16&255,o[27]=x8>>>24&255,o[28]=x9>>>0&255,o[29]=x9>>>8&255,o[30]=x9>>>16&255,o[31]=x9>>>24&255}function crypto_core_salsa20(out,inp,k,c){core_salsa20(out,inp,k,c)}function crypto_core_hsalsa20(out,inp,k,c){core_hsalsa20(out,inp,k,c)}function crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k){var u,i,z=new Uint8Array(16),x=new Uint8Array(64);for(i=0;i<16;i++)z[i]=0;for(i=0;i<8;i++)z[i]=n[i];for(;b>=64;){for(crypto_core_salsa20(x,z,k,sigma),i=0;i<64;i++)c[cpos+i]=m[mpos+i]^x[i];for(u=1,i=8;i<16;i++)u=u+(255&z[i])|0,z[i]=255&u,u>>>=8;b-=64,cpos+=64,mpos+=64}if(b>0)for(crypto_core_salsa20(x,z,k,sigma),i=0;i=64;){for(crypto_core_salsa20(x,z,k,sigma),i=0;i<64;i++)c[cpos+i]=x[i];for(u=1,i=8;i<16;i++)u=u+(255&z[i])|0,z[i]=255&u,u>>>=8;b-=64,cpos+=64}if(b>0)for(crypto_core_salsa20(x,z,k,sigma),i=0;i>16&1),m[i-1]&=65535;m[15]=t[15]-32767-(m[14]>>16&1),b=m[15]>>16&1,m[14]&=65535,sel25519(t,m,1-b)}for(i=0;i<16;i++)o[2*i]=255&t[i],o[2*i+1]=t[i]>>8}function neq25519(a,b){var c=new Uint8Array(32),d=new Uint8Array(32);return pack25519(c,a),pack25519(d,b),crypto_verify_32(c,0,d,0)}function par25519(a){var d=new Uint8Array(32);return pack25519(d,a),1&d[0]}function unpack25519(o,n){var i;for(i=0;i<16;i++)o[i]=n[2*i]+(n[2*i+1]<<8);o[15]&=32767}function A(o,a,b){for(var i=0;i<16;i++)o[i]=a[i]+b[i]}function Z(o,a,b){for(var i=0;i<16;i++)o[i]=a[i]-b[i]}function M(o,a,b){var v,c,t0=0,t1=0,t2=0,t3=0,t4=0,t5=0,t6=0,t7=0,t8=0,t9=0,t10=0,t11=0,t12=0,t13=0,t14=0,t15=0,t16=0,t17=0,t18=0,t19=0,t20=0,t21=0,t22=0,t23=0,t24=0,t25=0,t26=0,t27=0,t28=0,t29=0,t30=0,b0=b[0],b1=b[1],b2=b[2],b3=b[3],b4=b[4],b5=b[5],b6=b[6],b7=b[7],b8=b[8],b9=b[9],b10=b[10],b11=b[11],b12=b[12],b13=b[13],b14=b[14],b15=b[15];v=a[0],t0+=v*b0,t1+=v*b1,t2+=v*b2,t3+=v*b3,t4+=v*b4,t5+=v*b5,t6+=v*b6,t7+=v*b7,t8+=v*b8,t9+=v*b9,t10+=v*b10,t11+=v*b11,t12+=v*b12,t13+=v*b13,t14+=v*b14,t15+=v*b15,v=a[1],t1+=v*b0,t2+=v*b1,t3+=v*b2,t4+=v*b3,t5+=v*b4,t6+=v*b5,t7+=v*b6,t8+=v*b7,t9+=v*b8,t10+=v*b9,t11+=v*b10,t12+=v*b11,t13+=v*b12,t14+=v*b13,t15+=v*b14,t16+=v*b15,v=a[2],t2+=v*b0,t3+=v*b1,t4+=v*b2,t5+=v*b3,t6+=v*b4,t7+=v*b5,t8+=v*b6,t9+=v*b7,t10+=v*b8,t11+=v*b9,t12+=v*b10,t13+=v*b11,t14+=v*b12,t15+=v*b13,t16+=v*b14,t17+=v*b15,v=a[3],t3+=v*b0,t4+=v*b1,t5+=v*b2,t6+=v*b3,t7+=v*b4,t8+=v*b5,t9+=v*b6,t10+=v*b7,t11+=v*b8,t12+=v*b9,t13+=v*b10,t14+=v*b11,t15+=v*b12,t16+=v*b13,t17+=v*b14,t18+=v*b15,v=a[4],t4+=v*b0,t5+=v*b1,t6+=v*b2,t7+=v*b3,t8+=v*b4,t9+=v*b5,t10+=v*b6,t11+=v*b7,t12+=v*b8,t13+=v*b9,t14+=v*b10,t15+=v*b11,t16+=v*b12,t17+=v*b13,t18+=v*b14,t19+=v*b15,v=a[5],t5+=v*b0,t6+=v*b1,t7+=v*b2,t8+=v*b3,t9+=v*b4,t10+=v*b5,t11+=v*b6,t12+=v*b7,t13+=v*b8,t14+=v*b9,t15+=v*b10,t16+=v*b11,t17+=v*b12,t18+=v*b13,t19+=v*b14,t20+=v*b15,v=a[6],t6+=v*b0,t7+=v*b1,t8+=v*b2,t9+=v*b3,t10+=v*b4,t11+=v*b5,t12+=v*b6,t13+=v*b7,t14+=v*b8,t15+=v*b9,t16+=v*b10,t17+=v*b11,t18+=v*b12,t19+=v*b13,t20+=v*b14,t21+=v*b15,v=a[7],t7+=v*b0,t8+=v*b1,t9+=v*b2,t10+=v*b3,t11+=v*b4,t12+=v*b5,t13+=v*b6,t14+=v*b7,t15+=v*b8,t16+=v*b9,t17+=v*b10,t18+=v*b11,t19+=v*b12,t20+=v*b13,t21+=v*b14,t22+=v*b15,v=a[8],t8+=v*b0,t9+=v*b1,t10+=v*b2,t11+=v*b3,t12+=v*b4,t13+=v*b5,t14+=v*b6,t15+=v*b7,t16+=v*b8,t17+=v*b9,t18+=v*b10,t19+=v*b11,t20+=v*b12,t21+=v*b13,t22+=v*b14,t23+=v*b15,v=a[9],t9+=v*b0,t10+=v*b1,t11+=v*b2,t12+=v*b3,t13+=v*b4,t14+=v*b5,t15+=v*b6,t16+=v*b7,t17+=v*b8,t18+=v*b9,t19+=v*b10,t20+=v*b11,t21+=v*b12,t22+=v*b13,t23+=v*b14,t24+=v*b15,v=a[10],t10+=v*b0,t11+=v*b1,t12+=v*b2,t13+=v*b3,t14+=v*b4,t15+=v*b5,t16+=v*b6,t17+=v*b7,t18+=v*b8,t19+=v*b9,t20+=v*b10,t21+=v*b11,t22+=v*b12,t23+=v*b13,t24+=v*b14,t25+=v*b15,v=a[11],t11+=v*b0,t12+=v*b1,t13+=v*b2,t14+=v*b3,t15+=v*b4,t16+=v*b5,t17+=v*b6,t18+=v*b7,t19+=v*b8,t20+=v*b9,t21+=v*b10,t22+=v*b11;t23+=v*b12,t24+=v*b13,t25+=v*b14,t26+=v*b15,v=a[12],t12+=v*b0,t13+=v*b1,t14+=v*b2,t15+=v*b3,t16+=v*b4,t17+=v*b5,t18+=v*b6,t19+=v*b7,t20+=v*b8,t21+=v*b9,t22+=v*b10,t23+=v*b11,t24+=v*b12,t25+=v*b13,t26+=v*b14,t27+=v*b15,v=a[13],t13+=v*b0,t14+=v*b1,t15+=v*b2,t16+=v*b3,t17+=v*b4,t18+=v*b5,t19+=v*b6,t20+=v*b7,t21+=v*b8,t22+=v*b9,t23+=v*b10,t24+=v*b11,t25+=v*b12,t26+=v*b13,t27+=v*b14,t28+=v*b15,v=a[14],t14+=v*b0,t15+=v*b1,t16+=v*b2,t17+=v*b3,t18+=v*b4,t19+=v*b5,t20+=v*b6,t21+=v*b7,t22+=v*b8,t23+=v*b9,t24+=v*b10,t25+=v*b11,t26+=v*b12,t27+=v*b13,t28+=v*b14,t29+=v*b15,v=a[15],t15+=v*b0,t16+=v*b1,t17+=v*b2,t18+=v*b3,t19+=v*b4,t20+=v*b5,t21+=v*b6,t22+=v*b7,t23+=v*b8,t24+=v*b9,t25+=v*b10,t26+=v*b11,t27+=v*b12,t28+=v*b13,t29+=v*b14,t30+=v*b15,t0+=38*t16,t1+=38*t17,t2+=38*t18,t3+=38*t19,t4+=38*t20,t5+=38*t21,t6+=38*t22,t7+=38*t23,t8+=38*t24,t9+=38*t25,t10+=38*t26,t11+=38*t27,t12+=38*t28,t13+=38*t29,t14+=38*t30,c=1,v=t0+c+65535,c=Math.floor(v/65536),t0=v-65536*c,v=t1+c+65535,c=Math.floor(v/65536),t1=v-65536*c,v=t2+c+65535,c=Math.floor(v/65536),t2=v-65536*c,v=t3+c+65535,c=Math.floor(v/65536),t3=v-65536*c,v=t4+c+65535,c=Math.floor(v/65536),t4=v-65536*c,v=t5+c+65535,c=Math.floor(v/65536),t5=v-65536*c,v=t6+c+65535,c=Math.floor(v/65536),t6=v-65536*c,v=t7+c+65535,c=Math.floor(v/65536),t7=v-65536*c,v=t8+c+65535,c=Math.floor(v/65536),t8=v-65536*c,v=t9+c+65535,c=Math.floor(v/65536),t9=v-65536*c,v=t10+c+65535,c=Math.floor(v/65536),t10=v-65536*c,v=t11+c+65535,c=Math.floor(v/65536),t11=v-65536*c,v=t12+c+65535,c=Math.floor(v/65536),t12=v-65536*c,v=t13+c+65535,c=Math.floor(v/65536),t13=v-65536*c,v=t14+c+65535,c=Math.floor(v/65536),t14=v-65536*c,v=t15+c+65535,c=Math.floor(v/65536),t15=v-65536*c,t0+=c-1+37*(c-1),c=1,v=t0+c+65535,c=Math.floor(v/65536),t0=v-65536*c,v=t1+c+65535,c=Math.floor(v/65536),t1=v-65536*c,v=t2+c+65535,c=Math.floor(v/65536),t2=v-65536*c,v=t3+c+65535,c=Math.floor(v/65536),t3=v-65536*c,v=t4+c+65535,c=Math.floor(v/65536),t4=v-65536*c,v=t5+c+65535,c=Math.floor(v/65536),t5=v-65536*c,v=t6+c+65535,c=Math.floor(v/65536),t6=v-65536*c,v=t7+c+65535,c=Math.floor(v/65536),t7=v-65536*c,v=t8+c+65535,c=Math.floor(v/65536),t8=v-65536*c,v=t9+c+65535,c=Math.floor(v/65536),t9=v-65536*c,v=t10+c+65535,c=Math.floor(v/65536),t10=v-65536*c,v=t11+c+65535,c=Math.floor(v/65536),t11=v-65536*c,v=t12+c+65535,c=Math.floor(v/65536),t12=v-65536*c,v=t13+c+65535,c=Math.floor(v/65536),t13=v-65536*c,v=t14+c+65535,c=Math.floor(v/65536),t14=v-65536*c,v=t15+c+65535,c=Math.floor(v/65536),t15=v-65536*c,t0+=c-1+37*(c-1),o[0]=t0,o[1]=t1,o[2]=t2,o[3]=t3,o[4]=t4,o[5]=t5,o[6]=t6,o[7]=t7,o[8]=t8,o[9]=t9,o[10]=t10,o[11]=t11,o[12]=t12;o[13]=t13,o[14]=t14,o[15]=t15}function S(o,a){M(o,a,a)}function inv25519(o,i){var a,c=gf();for(a=0;a<16;a++)c[a]=i[a];for(a=253;a>=0;a--)S(c,c),2!==a&&4!==a&&M(c,c,i);for(a=0;a<16;a++)o[a]=c[a]}function pow2523(o,i){var a,c=gf();for(a=0;a<16;a++)c[a]=i[a];for(a=250;a>=0;a--)S(c,c),1!==a&&M(c,c,i);for(a=0;a<16;a++)o[a]=c[a]}function crypto_scalarmult(q,n,p){var r,i,z=new Uint8Array(32),x=new Float64Array(80),a=gf(),b=gf(),c=gf(),d=gf(),e=gf(),f=gf();for(i=0;i<31;i++)z[i]=n[i];for(z[31]=127&n[31]|64,z[0]&=248,unpack25519(x,p),i=0;i<16;i++)b[i]=x[i],d[i]=a[i]=c[i]=0;for(a[0]=d[0]=1,i=254;i>=0;--i)r=z[i>>>3]>>>(7&i)&1,sel25519(a,b,r),sel25519(c,d,r),A(e,a,c),Z(a,a,c),A(c,b,d),Z(b,b,d),S(d,e),S(f,a),M(a,c,a),M(c,b,e),A(e,a,c),Z(a,a,c),S(b,a),Z(c,d,f),M(a,c,_121665),A(a,a,d),M(c,c,a),M(a,d,f),M(d,b,x),S(b,e),sel25519(a,b,r),sel25519(c,d,r);for(i=0;i<16;i++)x[i+16]=a[i],x[i+32]=c[i],x[i+48]=b[i],x[i+64]=d[i];var x32=x.subarray(32),x16=x.subarray(16);return inv25519(x32,x32),M(x16,x16,x32),pack25519(q,x16),0}function crypto_scalarmult_base(q,n){return crypto_scalarmult(q,n,_9)}function crypto_box_keypair(y,x){return randombytes(x,32),crypto_scalarmult_base(y,x)}function crypto_box_beforenm(k,y,x){var s=new Uint8Array(32);return crypto_scalarmult(s,x,y),crypto_core_hsalsa20(k,_0,s,sigma)}function crypto_box(c,m,d,n,y,x){var k=new Uint8Array(32);return crypto_box_beforenm(k,y,x),crypto_box_afternm(c,m,d,n,k)}function crypto_box_open(m,c,d,n,y,x){var k=new Uint8Array(32);return crypto_box_beforenm(k,y,x),crypto_box_open_afternm(m,c,d,n,k)}function crypto_hashblocks_hl(hh,hl,m,n){for(var bh0,bh1,bh2,bh3,bh4,bh5,bh6,bh7,bl0,bl1,bl2,bl3,bl4,bl5,bl6,bl7,th,tl,i,j,h,l,a,b,c,d,wh=new Int32Array(16),wl=new Int32Array(16),ah0=hh[0],ah1=hh[1],ah2=hh[2],ah3=hh[3],ah4=hh[4],ah5=hh[5],ah6=hh[6],ah7=hh[7],al0=hl[0],al1=hl[1],al2=hl[2],al3=hl[3],al4=hl[4],al5=hl[5],al6=hl[6],al7=hl[7],pos=0;n>=128;){for(i=0;i<16;i++)j=8*i+pos,wh[i]=m[j+0]<<24|m[j+1]<<16|m[j+2]<<8|m[j+3],wl[i]=m[j+4]<<24|m[j+5]<<16|m[j+6]<<8|m[j+7];for(i=0;i<80;i++)if(bh0=ah0,bh1=ah1,bh2=ah2,bh3=ah3,bh4=ah4,bh5=ah5,bh6=ah6,bh7=ah7,bl0=al0,bl1=al1,bl2=al2,bl3=al3,bl4=al4,bl5=al5,bl6=al6,bl7=al7,h=ah7,l=al7,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=(ah4>>>14|al4<<18)^(ah4>>>18|al4<<14)^(al4>>>9|ah4<<23),l=(al4>>>14|ah4<<18)^(al4>>>18|ah4<<14)^(ah4>>>9|al4<<23),a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,h=ah4&ah5^~ah4&ah6,l=al4&al5^~al4&al6,a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,h=K[2*i],l=K[2*i+1],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,h=wh[i%16],l=wl[i%16],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,th=65535&c|d<<16,tl=65535&a|b<<16,h=th,l=tl,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=(ah0>>>28|al0<<4)^(al0>>>2|ah0<<30)^(al0>>>7|ah0<<25),l=(al0>>>28|ah0<<4)^(ah0>>>2|al0<<30)^(ah0>>>7|al0<<25),a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,h=ah0&ah1^ah0&ah2^ah1&ah2,l=al0&al1^al0&al2^al1&al2,a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,bh7=65535&c|d<<16,bl7=65535&a|b<<16,h=bh3,l=bl3,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=th,l=tl,a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,bh3=65535&c|d<<16,bl3=65535&a|b<<16,ah1=bh0,ah2=bh1,ah3=bh2,ah4=bh3,ah5=bh4,ah6=bh5,ah7=bh6,ah0=bh7,al1=bl0,al2=bl1,al3=bl2,al4=bl3,al5=bl4,al6=bl5,al7=bl6,al0=bl7,i%16==15)for(j=0;j<16;j++)h=wh[j],l=wl[j],a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=wh[(j+9)%16],l=wl[(j+9)%16],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,th=wh[(j+1)%16],tl=wl[(j+1)%16],h=(th>>>1|tl<<31)^(th>>>8|tl<<24)^th>>>7,l=(tl>>>1|th<<31)^(tl>>>8|th<<24)^(tl>>>7|th<<25),a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,th=wh[(j+14)%16],tl=wl[(j+14)%16],h=(th>>>19|tl<<13)^(tl>>>29|th<<3)^th>>>6,l=(tl>>>19|th<<13)^(th>>>29|tl<<3)^(tl>>>6|th<<26),a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,wh[j]=65535&c|d<<16,wl[j]=65535&a|b<<16;h=ah0,l=al0,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[0],l=hl[0],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[0]=ah0=65535&c|d<<16,hl[0]=al0=65535&a|b<<16,h=ah1,l=al1,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[1],l=hl[1],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[1]=ah1=65535&c|d<<16,hl[1]=al1=65535&a|b<<16,h=ah2,l=al2,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[2],l=hl[2],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[2]=ah2=65535&c|d<<16,hl[2]=al2=65535&a|b<<16,h=ah3,l=al3,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[3],l=hl[3],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[3]=ah3=65535&c|d<<16,hl[3]=al3=65535&a|b<<16,h=ah4,l=al4,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[4],l=hl[4],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[4]=ah4=65535&c|d<<16,hl[4]=al4=65535&a|b<<16,h=ah5,l=al5,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[5],l=hl[5],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[5]=ah5=65535&c|d<<16,hl[5]=al5=65535&a|b<<16,h=ah6,l=al6,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[6],l=hl[6],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[6]=ah6=65535&c|d<<16,hl[6]=al6=65535&a|b<<16,h=ah7,l=al7,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[7],l=hl[7],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[7]=ah7=65535&c|d<<16,hl[7]=al7=65535&a|b<<16,pos+=128,n-=128}return n}function crypto_hash(out,m,n){var i,hh=new Int32Array(8),hl=new Int32Array(8),x=new Uint8Array(256),b=n;for(hh[0]=1779033703,hh[1]=3144134277,hh[2]=1013904242,hh[3]=2773480762,hh[4]=1359893119,hh[5]=2600822924,hh[6]=528734635,hh[7]=1541459225,hl[0]=4089235720,hl[1]=2227873595,hl[2]=4271175723,hl[3]=1595750129,hl[4]=2917565137,hl[5]=725511199,hl[6]=4215389547,hl[7]=327033209,crypto_hashblocks_hl(hh,hl,m,n),n%=128,i=0;i=0;--i)b=s[i/8|0]>>(7&i)&1,cswap(p,q,b),add(q,p),add(p,p),cswap(p,q,b)}function scalarbase(p,s){var q=[gf(),gf(),gf(),gf()];set25519(q[0],X),set25519(q[1],Y),set25519(q[2],gf1),M(q[3],X,Y),scalarmult(p,q,s)}function crypto_sign_keypair(pk,sk,seeded){var i,d=new Uint8Array(64),p=[gf(),gf(),gf(),gf()];for(seeded||randombytes(sk,32),crypto_hash(d,sk,32),d[0]&=248,d[31]&=127,d[31]|=64,scalarbase(p,d),pack(pk,p),i=0;i<32;i++)sk[i+32]=pk[i];return 0}function modL(r,x){var carry,i,j,k;for(i=63;i>=32;--i){for(carry=0,j=i-32,k=i-12;j>8,x[j]-=256*carry;x[j]+=carry,x[i]=0}for(carry=0,j=0;j<32;j++)x[j]+=carry-(x[31]>>4)*L[j],carry=x[j]>>8,x[j]&=255;for(j=0;j<32;j++)x[j]-=carry*L[j];for(i=0;i<32;i++)x[i+1]+=x[i]>>8,r[i]=255&x[i]}function reduce(r){var i,x=new Float64Array(64);for(i=0;i<64;i++)x[i]=r[i];for(i=0;i<64;i++)r[i]=0;modL(r,x)}function crypto_sign(sm,m,n,sk){var i,j,d=new Uint8Array(64),h=new Uint8Array(64),r=new Uint8Array(64),x=new Float64Array(64),p=[gf(),gf(),gf(),gf()];crypto_hash(d,sk,32),d[0]&=248,d[31]&=127,d[31]|=64;var smlen=n+64;for(i=0;i>7&&Z(r[0],gf0,r[0]),M(r[3],r[0],r[1]),0)}function crypto_sign_open(m,sm,n,pk){var i,t=new Uint8Array(32),h=new Uint8Array(64),p=[gf(),gf(),gf(),gf()],q=[gf(),gf(),gf(),gf()];if(-1,n<64)return-1;if(unpackneg(q,pk))return-1;for(i=0;i>>13|t1<<3),t2=255&key[4]|(255&key[5])<<8,this.r[2]=7939&(t1>>>10|t2<<6),t3=255&key[6]|(255&key[7])<<8,this.r[3]=8191&(t2>>>7|t3<<9),t4=255&key[8]|(255&key[9])<<8,this.r[4]=255&(t3>>>4|t4<<12),this.r[5]=t4>>>1&8190,t5=255&key[10]|(255&key[11])<<8,this.r[6]=8191&(t4>>>14|t5<<2),t6=255&key[12]|(255&key[13])<<8,this.r[7]=8065&(t5>>>11|t6<<5),t7=255&key[14]|(255&key[15])<<8,this.r[8]=8191&(t6>>>8|t7<<8),this.r[9]=t7>>>5&127,this.pad[0]=255&key[16]|(255&key[17])<<8, -this.pad[1]=255&key[18]|(255&key[19])<<8,this.pad[2]=255&key[20]|(255&key[21])<<8,this.pad[3]=255&key[22]|(255&key[23])<<8,this.pad[4]=255&key[24]|(255&key[25])<<8,this.pad[5]=255&key[26]|(255&key[27])<<8,this.pad[6]=255&key[28]|(255&key[29])<<8,this.pad[7]=255&key[30]|(255&key[31])<<8};poly1305.prototype.blocks=function(m,mpos,bytes){for(var t0,t1,t2,t3,t4,t5,t6,t7,c,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,hibit=this.fin?0:2048,h0=this.h[0],h1=this.h[1],h2=this.h[2],h3=this.h[3],h4=this.h[4],h5=this.h[5],h6=this.h[6],h7=this.h[7],h8=this.h[8],h9=this.h[9],r0=this.r[0],r1=this.r[1],r2=this.r[2],r3=this.r[3],r4=this.r[4],r5=this.r[5],r6=this.r[6],r7=this.r[7],r8=this.r[8],r9=this.r[9];bytes>=16;)t0=255&m[mpos+0]|(255&m[mpos+1])<<8,h0+=8191&t0,t1=255&m[mpos+2]|(255&m[mpos+3])<<8,h1+=8191&(t0>>>13|t1<<3),t2=255&m[mpos+4]|(255&m[mpos+5])<<8,h2+=8191&(t1>>>10|t2<<6),t3=255&m[mpos+6]|(255&m[mpos+7])<<8,h3+=8191&(t2>>>7|t3<<9),t4=255&m[mpos+8]|(255&m[mpos+9])<<8,h4+=8191&(t3>>>4|t4<<12),h5+=t4>>>1&8191,t5=255&m[mpos+10]|(255&m[mpos+11])<<8,h6+=8191&(t4>>>14|t5<<2),t6=255&m[mpos+12]|(255&m[mpos+13])<<8,h7+=8191&(t5>>>11|t6<<5),t7=255&m[mpos+14]|(255&m[mpos+15])<<8,h8+=8191&(t6>>>8|t7<<8),h9+=t7>>>5|hibit,c=0,d0=c,d0+=h0*r0,d0+=h1*(5*r9),d0+=h2*(5*r8),d0+=h3*(5*r7),d0+=h4*(5*r6),c=d0>>>13,d0&=8191,d0+=h5*(5*r5),d0+=h6*(5*r4),d0+=h7*(5*r3),d0+=h8*(5*r2),d0+=h9*(5*r1),c+=d0>>>13,d0&=8191,d1=c,d1+=h0*r1,d1+=h1*r0,d1+=h2*(5*r9),d1+=h3*(5*r8),d1+=h4*(5*r7),c=d1>>>13,d1&=8191,d1+=h5*(5*r6),d1+=h6*(5*r5),d1+=h7*(5*r4),d1+=h8*(5*r3),d1+=h9*(5*r2),c+=d1>>>13,d1&=8191,d2=c,d2+=h0*r2,d2+=h1*r1,d2+=h2*r0,d2+=h3*(5*r9),d2+=h4*(5*r8),c=d2>>>13,d2&=8191,d2+=h5*(5*r7),d2+=h6*(5*r6),d2+=h7*(5*r5),d2+=h8*(5*r4),d2+=h9*(5*r3),c+=d2>>>13,d2&=8191,d3=c,d3+=h0*r3,d3+=h1*r2,d3+=h2*r1,d3+=h3*r0,d3+=h4*(5*r9),c=d3>>>13,d3&=8191,d3+=h5*(5*r8),d3+=h6*(5*r7),d3+=h7*(5*r6),d3+=h8*(5*r5),d3+=h9*(5*r4),c+=d3>>>13,d3&=8191,d4=c,d4+=h0*r4,d4+=h1*r3,d4+=h2*r2,d4+=h3*r1,d4+=h4*r0,c=d4>>>13,d4&=8191,d4+=h5*(5*r9),d4+=h6*(5*r8),d4+=h7*(5*r7),d4+=h8*(5*r6),d4+=h9*(5*r5),c+=d4>>>13,d4&=8191,d5=c,d5+=h0*r5,d5+=h1*r4,d5+=h2*r3,d5+=h3*r2,d5+=h4*r1,c=d5>>>13,d5&=8191,d5+=h5*r0,d5+=h6*(5*r9),d5+=h7*(5*r8),d5+=h8*(5*r7),d5+=h9*(5*r6),c+=d5>>>13,d5&=8191,d6=c,d6+=h0*r6,d6+=h1*r5,d6+=h2*r4,d6+=h3*r3,d6+=h4*r2,c=d6>>>13,d6&=8191,d6+=h5*r1,d6+=h6*r0,d6+=h7*(5*r9),d6+=h8*(5*r8),d6+=h9*(5*r7),c+=d6>>>13,d6&=8191,d7=c,d7+=h0*r7,d7+=h1*r6,d7+=h2*r5,d7+=h3*r4,d7+=h4*r3,c=d7>>>13,d7&=8191,d7+=h5*r2,d7+=h6*r1,d7+=h7*r0,d7+=h8*(5*r9),d7+=h9*(5*r8),c+=d7>>>13,d7&=8191,d8=c,d8+=h0*r8,d8+=h1*r7,d8+=h2*r6,d8+=h3*r5,d8+=h4*r4,c=d8>>>13,d8&=8191,d8+=h5*r3,d8+=h6*r2,d8+=h7*r1,d8+=h8*r0,d8+=h9*(5*r9),c+=d8>>>13,d8&=8191,d9=c,d9+=h0*r9,d9+=h1*r8,d9+=h2*r7,d9+=h3*r6,d9+=h4*r5,c=d9>>>13,d9&=8191,d9+=h5*r4,d9+=h6*r3,d9+=h7*r2,d9+=h8*r1,d9+=h9*r0,c+=d9>>>13,d9&=8191,c=(c<<2)+c|0,c=c+d0|0,d0=8191&c,c>>>=13,d1+=c,h0=d0,h1=d1,h2=d2,h3=d3,h4=d4,h5=d5,h6=d6,h7=d7,h8=d8,h9=d9,mpos+=16,bytes-=16;this.h[0]=h0,this.h[1]=h1,this.h[2]=h2,this.h[3]=h3,this.h[4]=h4,this.h[5]=h5,this.h[6]=h6,this.h[7]=h7,this.h[8]=h8,this.h[9]=h9},poly1305.prototype.finish=function(mac,macpos){var c,mask,f,i,g=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(c=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=c,c=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*c,c=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=c,c=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=c,g[0]=this.h[0]+5,c=g[0]>>>13,g[0]&=8191,i=1;i<10;i++)g[i]=this.h[i]+c,c=g[i]>>>13,g[i]&=8191;for(g[9]-=8192,mask=(1^c)-1,i=0;i<10;i++)g[i]&=mask;for(mask=~mask,i=0;i<10;i++)this.h[i]=this.h[i]&mask|g[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),f=this.h[0]+this.pad[0],this.h[0]=65535&f,i=1;i<8;i++)f=(this.h[i]+this.pad[i]|0)+(f>>>16)|0,this.h[i]=65535&f;mac[macpos+0]=this.h[0]>>>0&255,mac[macpos+1]=this.h[0]>>>8&255,mac[macpos+2]=this.h[1]>>>0&255,mac[macpos+3]=this.h[1]>>>8&255,mac[macpos+4]=this.h[2]>>>0&255,mac[macpos+5]=this.h[2]>>>8&255,mac[macpos+6]=this.h[3]>>>0&255,mac[macpos+7]=this.h[3]>>>8&255,mac[macpos+8]=this.h[4]>>>0&255,mac[macpos+9]=this.h[4]>>>8&255,mac[macpos+10]=this.h[5]>>>0&255,mac[macpos+11]=this.h[5]>>>8&255,mac[macpos+12]=this.h[6]>>>0&255,mac[macpos+13]=this.h[6]>>>8&255,mac[macpos+14]=this.h[7]>>>0&255,mac[macpos+15]=this.h[7]>>>8&255},poly1305.prototype.update=function(m,mpos,bytes){var i,want;if(this.leftover){for(want=16-this.leftover,want>bytes&&(want=bytes),i=0;i=16&&(want=bytes-bytes%16,this.blocks(m,mpos,want),mpos+=want,bytes-=want),bytes){for(i=0;i=0},nacl.sign.keyPair=function(){var pk=new Uint8Array(32),sk=new Uint8Array(64);return crypto_sign_keypair(pk,sk),{publicKey:pk,secretKey:sk}},nacl.sign.keyPair.fromSecretKey=function(secretKey){if(checkArrayTypes(),64!==secretKey.length)throw new Error("bad secret key size");for(var pk=new Uint8Array(32),i=0;i>>((3&i)<<3)&255;return rnds}}module.exports=rng}).call(exports,__webpack_require__(2))},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const varint=__webpack_require__(15);module.exports=(buf=>{if(!Buffer.isBuffer(buf))throw new Error("arg needs to be a buffer");let result=[];for(;buf.length>0;){const num=varint.decode(buf);result.push(num),buf=buf.slice(varint.decode.bytes)}return result})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports){function read(buf,offset){var b,res=0,offset=offset||0,shift=0,counter=offset,l=buf.length;do{if(counter>=l)throw read.bytes=0,new RangeError("Could not decode varint");b=buf[counter++],res+=shift<28?(b&REST)<=MSB);return read.bytes=counter-offset,res}module.exports=read;var MSB=128,REST=127},function(module,exports){function encode(num,out,offset){out=out||[],offset=offset||0;for(var oldOffset=offset;num>=INT;)out[offset++]=255&num|MSB,num/=128;for(;num&MSBALL;)out[offset++]=255&num|MSB,num>>>=7;return out[offset]=0|num,encode.bytes=offset-oldOffset+1,out}module.exports=encode;var MSB=128,MSBALL=-128,INT=Math.pow(2,31)},function(module,exports){var N1=Math.pow(2,7),N2=Math.pow(2,14),N3=Math.pow(2,21),N4=Math.pow(2,28),N5=Math.pow(2,35),N6=Math.pow(2,42),N7=Math.pow(2,49),N8=Math.pow(2,56),N9=Math.pow(2,63);module.exports=function(value){return value2&&(prv=!0,info.shift());var jwk={ext:!0};switch(info[0][0]){case"1.2.840.113549.1.1.1":var rsaComp=["n","e","d","p","q","dp","dq","qi"],rsaKey=b2der(info[1]);prv&&rsaKey.shift();for(var i=0;i2&&(prv=!0,rsaKey.unshift(new Uint8Array([0]))),info[0][0]="1.2.840.113549.1.1.1",key=rsaKey;break;default:throw new TypeError("Unsupported key type")}return info.push(new Uint8Array(der2b(key)).buffer),prv?info.unshift(new Uint8Array([0])):info[1]={tag:3,value:info[1]},new Uint8Array(der2b(info)).buffer}function b2der(buf,ctx){if(buf instanceof ArrayBuffer&&(buf=new Uint8Array(buf)),ctx||(ctx={pos:0,end:buf.length}),ctx.end-ctx.pos<2||ctx.end>buf.length)throw new RangeError("Malformed DER");var tag=buf[ctx.pos++],len=buf[ctx.pos++];if(len>=128){if(len&=127,ctx.end-ctx.pos=128){var xlen=len,len=4;for(buf.splice(pos,0,xlen>>24&255,xlen>>16&255,xlen>>8&255,255&xlen);len>1&&!(xlen>>24);)xlen<<=8,len--;len<4&&buf.splice(pos,4-len),len|=128}return buf.splice(pos-2,2,tag,len),buf}function CryptoKey(key,alg,ext,use){Object.defineProperties(this,{_key:{value:key},type:{value:key.type,enumerable:!0},extractable:{value:void 0===ext?key.extractable:ext,enumerable:!0},algorithm:{value:void 0===alg?key.algorithm:alg,enumerable:!0},usages:{value:void 0===use?key.usages:use,enumerable:!0}})}function isPubKeyUse(u){return"verify"===u||"encrypt"===u||"wrapKey"===u}function isPrvKeyUse(u){return"sign"===u||"decrypt"===u||"unwrapKey"===u}if("function"!=typeof Promise)throw"Promise support required";var _crypto=global.crypto||global.msCrypto;if(_crypto){var _subtle=_crypto.subtle||_crypto.webkitSubtle;if(_subtle){var _Crypto=global.Crypto||_crypto.constructor||Object,_SubtleCrypto=global.SubtleCrypto||_subtle.constructor||Object,isEdge=(global.CryptoKey||global.Key||Object,global.navigator.userAgent.indexOf("Edge/")>-1),isIE=!!global.msCrypto&&!isEdge,isWebkit=!!_crypto.webkitSubtle;if(isIE||isWebkit){var oid2str={KoZIhvcNAQEB:"1.2.840.113549.1.1.1"},str2oid={"1.2.840.113549.1.1.1":"KoZIhvcNAQEB"};if(["generateKey","importKey","unwrapKey"].forEach(function(m){var _fn=_subtle[m];_subtle[m]=function(a,b,c){var ka,kx,ku,args=[].slice.call(arguments);switch(m){case"generateKey":ka=alg(a),kx=b,ku=c;break;case"importKey":ka=alg(c),kx=args[3],ku=args[4],"jwk"===a&&(b=b2jwk(b),b.alg||(b.alg=jwkAlg(ka)),b.key_ops||(b.key_ops="oct"!==b.kty?"d"in b?ku.filter(isPrvKeyUse):ku.filter(isPubKeyUse):ku.slice()),args[1]=jwk2b(b));break;case"unwrapKey":ka=args[4],kx=args[5],ku=args[6],args[2]=c._key}if("generateKey"===m&&"HMAC"===ka.name&&ka.hash)return ka.length=ka.length||{"SHA-1":512,"SHA-256":512,"SHA-384":1024,"SHA-512":1024}[ka.hash.name],_subtle.importKey("raw",_crypto.getRandomValues(new Uint8Array(ka.length+7>>3)),ka,kx,ku);if(isWebkit&&"generateKey"===m&&"RSASSA-PKCS1-v1_5"===ka.name&&(!ka.modulusLength||ka.modulusLength>=2048))return a=alg(a),a.name="RSAES-PKCS1-v1_5",delete a.hash,_subtle.generateKey(a,!0,["encrypt","decrypt"]).then(function(k){return Promise.all([_subtle.exportKey("jwk",k.publicKey),_subtle.exportKey("jwk",k.privateKey)])}).then(function(keys){return keys[0].alg=keys[1].alg=jwkAlg(ka),keys[0].key_ops=ku.filter(isPubKeyUse),keys[1].key_ops=ku.filter(isPrvKeyUse),Promise.all([_subtle.importKey("jwk",keys[0],ka,!0,keys[0].key_ops),_subtle.importKey("jwk",keys[1],ka,kx,keys[1].key_ops)])}).then(function(keys){return{publicKey:keys[0],privateKey:keys[1]}});if((isWebkit||isIE&&"SHA-1"===(ka.hash||{}).name)&&"importKey"===m&&"jwk"===a&&"HMAC"===ka.name&&"oct"===b.kty)return _subtle.importKey("raw",s2b(a2s(b.k)),c,args[3],args[4]);if(isWebkit&&"importKey"===m&&("spki"===a||"pkcs8"===a))return _subtle.importKey("jwk",pkcs2jwk(b),c,args[3],args[4]);if(isIE&&"unwrapKey"===m)return _subtle.decrypt(args[3],c,b).then(function(k){return _subtle.importKey(a,k,args[4],args[5],args[6])});var op;try{op=_fn.apply(_subtle,args)}catch(e){return Promise.reject(e)}return isIE&&(op=new Promise(function(res,rej){op.onabort=op.onerror=function(e){rej(e)},op.oncomplete=function(r){res(r.target.result)}})),op=op.then(function(k){return"HMAC"===ka.name&&(ka.length||(ka.length=8*k.algorithm.length)),0==ka.name.search("RSA")&&(ka.modulusLength||(ka.modulusLength=(k.publicKey||k).algorithm.modulusLength),ka.publicExponent||(ka.publicExponent=(k.publicKey||k).algorithm.publicExponent)),k=k.publicKey&&k.privateKey?{publicKey:new CryptoKey(k.publicKey,ka,kx,ku.filter(isPubKeyUse)),privateKey:new CryptoKey(k.privateKey,ka,kx,ku.filter(isPrvKeyUse))}:new CryptoKey(k,ka,kx,ku)})}}),["exportKey","wrapKey"].forEach(function(m){var _fn=_subtle[m];_subtle[m]=function(a,b,c){var args=[].slice.call(arguments);switch(m){case"exportKey":args[1]=b._key;break;case"wrapKey":args[1]=b._key,args[2]=c._key}if((isWebkit||isIE&&"SHA-1"===(b.algorithm.hash||{}).name)&&"exportKey"===m&&"jwk"===a&&"HMAC"===b.algorithm.name&&(args[0]="raw"),!isWebkit||"exportKey"!==m||"spki"!==a&&"pkcs8"!==a||(args[0]="jwk"),isIE&&"wrapKey"===m)return _subtle.exportKey(a,b).then(function(k){return"jwk"===a&&(k=s2b(unescape(encodeURIComponent(JSON.stringify(b2jwk(k)))))),_subtle.encrypt(args[3],c,k)});var op;try{op=_fn.apply(_subtle,args)}catch(e){return Promise.reject(e)}return isIE&&(op=new Promise(function(res,rej){op.onabort=op.onerror=function(e){rej(e)},op.oncomplete=function(r){res(r.target.result)}})),"exportKey"===m&&"jwk"===a&&(op=op.then(function(k){return(isWebkit||isIE&&"SHA-1"===(b.algorithm.hash||{}).name)&&"HMAC"===b.algorithm.name?{kty:"oct",alg:jwkAlg(b.algorithm),key_ops:b.usages.slice(),ext:!0,k:s2a(b2s(k))}:(k=b2jwk(k),k.alg||(k.alg=jwkAlg(b.algorithm)),k.key_ops||(k.key_ops="public"===b.type?b.usages.filter(isPubKeyUse):"private"===b.type?b.usages.filter(isPrvKeyUse):b.usages.slice()),k)})),!isWebkit||"exportKey"!==m||"spki"!==a&&"pkcs8"!==a||(op=op.then(function(k){return k=jwk2pkcs(b2jwk(k))})),op}}),["encrypt","decrypt","sign","verify"].forEach(function(m){var _fn=_subtle[m];_subtle[m]=function(a,b,c,d){if(isIE&&(!c.byteLength||d&&!d.byteLength))throw new Error("Empy input is not allowed");var args=[].slice.call(arguments),ka=alg(a);if(isIE&&"decrypt"===m&&"AES-GCM"===ka.name){var tl=a.tagLength>>3;args[2]=(c.buffer||c).slice(0,c.byteLength-tl),a.tag=(c.buffer||c).slice(c.byteLength-tl)}args[1]=b._key;var op;try{op=_fn.apply(_subtle,args)}catch(e){return Promise.reject(e)}return isIE&&(op=new Promise(function(res,rej){op.onabort=op.onerror=function(e){rej(e)},op.oncomplete=function(r){var r=r.target.result;if("encrypt"===m&&r instanceof AesGcmEncryptResult){var c=r.ciphertext,t=r.tag;r=new Uint8Array(c.byteLength+t.byteLength),r.set(new Uint8Array(c),0),r.set(new Uint8Array(t),c.byteLength),r=r.buffer}res(r)}})),op}}),isIE){var _digest=_subtle.digest;_subtle.digest=function(a,b){if(!b.byteLength)throw new Error("Empy input is not allowed");var op;try{op=_digest.call(_subtle,a,b)}catch(e){return Promise.reject(e)}return op=new Promise(function(res,rej){op.onabort=op.onerror=function(e){rej(e)},op.oncomplete=function(r){res(r.target.result)}})},global.crypto=Object.create(_crypto,{getRandomValues:{value:function(a){return _crypto.getRandomValues(a)}},subtle:{value:_subtle}}),global.CryptoKey=CryptoKey}isWebkit&&(_crypto.subtle=_subtle,global.Crypto=_Crypto,global.SubtleCrypto=_SubtleCrypto,global.CryptoKey=CryptoKey)}}}}},function(module,exports){var prefix,version;self.mozRTCPeerConnection||navigator.mozGetUserMedia?(prefix="moz",version=parseInt(navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1],10)):(self.webkitRTCPeerConnection||navigator.webkitGetUserMedia)&&(prefix="webkit", -version=navigator.userAgent.match(/Chrom(e|ium)/)&&parseInt(navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)[2],10));var PC=self.RTCPeerConnection||self.mozRTCPeerConnection||self.webkitRTCPeerConnection,IceCandidate=self.mozRTCIceCandidate||self.RTCIceCandidate,SessionDescription=self.mozRTCSessionDescription||self.RTCSessionDescription,MediaStream=self.webkitMediaStream||self.MediaStream,screenSharing="https:"===self.location.protocol&&("webkit"===prefix&&version>=26||"moz"===prefix&&version>=33),AudioContext=self.AudioContext||self.webkitAudioContext,videoEl=self.document&&document.createElement("video"),supportVp8=videoEl&&videoEl.canPlayType&&"probably"===videoEl.canPlayType('video/webm; codecs="vp8", vorbis'),getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.msGetUserMedia||navigator.mozGetUserMedia;module.exports={prefix:prefix,browserVersion:version,support:!!PC&&!!getUserMedia,supportRTCPeerConnection:!!PC,supportVp8:supportVp8,supportGetUserMedia:!!getUserMedia,supportDataChannel:!!(PC&&PC.prototype&&PC.prototype.createDataChannel),supportWebAudio:!(!AudioContext||!AudioContext.prototype.createMediaStreamSource),supportMediaStream:!(!MediaStream||!MediaStream.prototype.removeTrack),supportScreenSharing:!!screenSharing,AudioContext:AudioContext,PeerConnection:PC,SessionDescription:SessionDescription,IceCandidate:IceCandidate,MediaStream:MediaStream,getUserMedia:getUserMedia}},function(module,exports,__webpack_require__){"use strict";const waterfall=__webpack_require__(7),series=__webpack_require__(33),extend=__webpack_require__(175);module.exports=(self=>{self.log("booting");const options=self._options,doInit=options.init,doStart=options.start,config=options.config,setConfig=config&&"object"==typeof config,repoOpen=!self._repo.closed,customInitOptions="object"==typeof options.init?options.init:{},initOptions=Object.assign({bits:2048},customInitOptions),maybeOpenRepo=cb=>{if(repoOpen)return cb(null,!0);series([cb=>self._repo.open(cb),cb=>self.preStart(cb),cb=>{self.state.initialized(),cb(null,!0)}],(err,res)=>{if(err)return err.message.match(/not found/)||err.message.match(/ENOENT/)||err.message.match(/No value/)?cb(null,!1):cb(err);cb(null,res)})},done=err=>{if(err)return self.emit("error",err);self.emit("ready"),self.log("boot:done",err)},tasks=[];maybeOpenRepo((err,hasRepo)=>{if(err)return done(err);if(doInit&&!hasRepo&&(tasks.push(cb=>self.init(initOptions,cb)),hasRepo=!0),setConfig&&(hasRepo?tasks.push(cb=>{waterfall([cb=>self.config.get(cb),(config,cb)=>{extend(config,options.config),self.config.replace(config,cb)}],cb)}):console.log('WARNING, trying to set config on uninitialized repo, maybe forgot to set "init: true"')),doStart){if(!hasRepo)return console.log('WARNING, trying to start ipfs node on uninitialized repo, maybe forgot to set "init: true"'),done(new Error("Uninitalized repo"));tasks.push(cb=>self.start(cb))}series(tasks,done)})})},function(module,exports,__webpack_require__){"use strict";function formatWantlist(list){return Array.from(list).map(e=>e[1])}const OFFLINE_ERROR=__webpack_require__(148).OFFLINE_ERROR;module.exports=function(self){return{wantlist:()=>{if(!self.isOnline())throw OFFLINE_ERROR;return formatWantlist(self._bitswap.getWantlist())},stat:()=>{if(!self.isOnline())throw OFFLINE_ERROR;const stats=self._bitswap.stat();return stats.wantlist=formatWantlist(stats.wantlist),stats.peers=stats.peers.map(id=>id.toB58String()),stats},unwant:key=>{if(!self.isOnline())throw OFFLINE_ERROR}}}},function(module,exports,__webpack_require__){"use strict";function cleanCid(cid){return CID.isCID(cid)?cid:new CID(cid)}const Block=__webpack_require__(61),multihash=__webpack_require__(12),multihashing=__webpack_require__(21),CID=__webpack_require__(8),waterfall=__webpack_require__(7);module.exports=function(self){return{get:(cid,callback)=>{cid=cleanCid(cid),self._blockService.get(cid,callback)},put:(block,options,callback)=>{if("function"==typeof options&&(callback=options,options={}),Array.isArray(block))return callback(new Error("Array is not supported"));waterfall([cb=>{if(Block.isBlock(block))return cb(null,block);if(options.cid&&CID.isCID(options.cid))return cb(null,new Block(block,options.cid));const mhtype=options.mhtype||"sha2-256",format=options.format||"dag-pb",cidVersion=options.version||0;multihashing(block,mhtype,(err,multihash)=>{if(err)return cb(err);cb(null,new Block(block,new CID(cidVersion,format,multihash)))})},(block,cb)=>self._blockService.put(block,err=>{if(err)return cb(err);cb(null,block)})],callback)},rm:(cid,callback)=>{cid=cleanCid(cid),self._blockService.delete(cid,callback)},stat:(cid,callback)=>{cid=cleanCid(cid),self._blockService.get(cid,(err,block)=>{if(err)return callback(err);callback(null,{key:multihash.toB58String(cid.multihash),size:block.data.length})})}}}},function(module,exports,__webpack_require__){"use strict";const defaultNodes=__webpack_require__(207).Bootstrap;module.exports=function(self){return{list:callback=>{self._repo.config.get((err,config)=>{if(err)return callback(err);callback(null,{Peers:config.Bootstrap})})},add:(multiaddr,args,callback)=>{"function"==typeof args&&(callback=args,args={default:!1}),self._repo.config.get((err,config)=>{if(err)return callback(err);args.default?config.Bootstrap=defaultNodes:multiaddr&&config.Bootstrap.indexOf(multiaddr)===-1&&config.Bootstrap.push(multiaddr),self._repo.config.set(config,err=>{if(err)return callback(err);callback(null,{Peers:args.default?defaultNodes:[multiaddr]})})})},rm:(multiaddr,args,callback)=>{"function"==typeof args&&(callback=args,args={all:!1}),self._repo.config.get((err,config)=>{if(err)return callback(err);args.all?config.Bootstrap=[]:config.Bootstrap=config.Bootstrap.filter(mh=>mh!==multiaddr),self._repo.config.set(config,err=>{if(err)return callback(err);const res=[];!args.all&&multiaddr&&res.push(multiaddr),callback(null,{Peers:res})})})}}}},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(17);module.exports=function(self){return{get:promisify((key,callback)=>{return"function"==typeof key&&(callback=key,key=void 0),self._repo.config.get(key,callback)}),set:promisify((key,value,callback)=>{self._repo.config.set(key,value,callback)}),replace:promisify((config,callback)=>{self._repo.config.set(config,callback)})}}},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(17),CID=__webpack_require__(8),pull=__webpack_require__(4);module.exports=function(self){return{put:promisify((dagNode,options,callback)=>{self._ipldResolver.put(dagNode,options,callback)}),get:promisify((cid,path,options,callback)=>{if("function"==typeof path&&(callback=path,path=void 0),"function"==typeof options&&(callback=options,options={}),options=options||{},"string"==typeof cid){const split=cid.split("/");cid=new CID(split[0]),split.shift(),path=split.length>0?split.join("/"):"/"}self._ipldResolver.get(cid,path,options,callback)}),tree:promisify((cid,path,options,callback)=>{if("object"==typeof path&&(callback=options,options=path,path=void 0),"function"==typeof path&&(callback=path,path=void 0),"function"==typeof options&&(callback=options,options={}),options=options||{},"string"==typeof cid){const split=cid.split("/");cid=new CID(split[0]),split.shift(),path=split.length>0?split.join("/"):void 0}pull(self._ipldResolver.treeStream(cid,path,options),pull.collect(callback))})}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const promisify=__webpack_require__(17),every=__webpack_require__(290),PeerId=__webpack_require__(22),CID=__webpack_require__(8),each=__webpack_require__(19);module.exports=(self=>{return{get:promisify((key,options,callback)=>{if(!Buffer.isBuffer(key))return callback(new Error("Not valid key"));"function"==typeof options&&(callback=options,options={}),self._libp2pNode.dht.get(key,options.timeout,callback)}),put:promisify((key,value,callback)=>{if(!Buffer.isBuffer(key))return callback(new Error("Not valid key"));self._libp2pNode.dht.put(key,value,callback)}),findprovs:promisify((key,callback)=>{"string"==typeof key&&(key=new CID(key)),self._libp2pNode.contentRouting.findProviders(key,callback)}),findpeer:promisify((peer,callback)=>{"string"==typeof peer&&(peer=PeerId.createFromB58String(peer)),self._libp2pNode.peerRouting.findPeer(peer,(err,info)=>{if(err)return callback(err);callback(null,[{Responses:[{ID:info.id.toB58String(),Addresses:info.multiaddrs.toArray().map(a=>a.toString())}]}])})}),provide:promisify((keys,options,callback)=>{Array.isArray(keys)||(keys=[keys]),"function"==typeof options&&(callback=options,options={}),every(keys,(key,cb)=>{self._repo.blocks.has(key,cb)},(err,has)=>{if(err)return callback(err);options.recursive||each(keys,(cid,cb)=>{self._libp2pNode.contentRouting.provide(cid,cb)},callback)})}),query:promisify((peerId,callback)=>{"string"==typeof peerId&&(peerId=PeerId.createFromB58String(peerId)),self._libp2pNode._dht.getClosestPeers(peerId.toBytes(),(err,peerIds)=>{if(err)return callback(err);callback(null,peerIds.map(id=>{return{ID:id.toB58String()}}))})})}})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function prepareFile(self,file,callback){const bs58mh=multihashes.toB58String(file.multihash);waterfall([cb=>self.object.get(file.multihash,cb),(node,cb)=>{cb(null,{path:file.path||bs58mh,hash:bs58mh,size:node.size})}],callback)}function normalizeContent(content){return Array.isArray(content)||(content=[content]),content.map(data=>{return Buffer.isBuffer(data)&&(data={path:"",content:pull.values([data])}),isStream.readable(data)&&(data={path:"",content:toPull.source(data)}),data&&data.content&&"function"!=typeof data.content&&(Buffer.isBuffer(data.content)&&(data.content=pull.values([data.content])),isStream.readable(data.content)&&(data.content=toPull.source(data.content))),data})}function noop(){}const unixfsEngine=__webpack_require__(431),importer=unixfsEngine.importer,exporter=unixfsEngine.exporter,promisify=__webpack_require__(17),multihashes=__webpack_require__(12),pull=__webpack_require__(4),sort=__webpack_require__(602),pushable=__webpack_require__(30),toStream=__webpack_require__(251),toPull=__webpack_require__(146),waterfall=__webpack_require__(7),isStream=__webpack_require__(450),Duplex=__webpack_require__(36).Duplex;module.exports=function(self){const createAddPullStream=options=>{const opts=Object.assign({},{shardSplitThreshold:self._options.EXPERIMENTAL.sharding?1e3:1/0},options);return pull(pull.map(normalizeContent),pull.flatten(),importer(self._ipldResolver,opts),pull.asyncMap(prepareFile.bind(null,self)))};return{createAddStream:(options,callback)=>{"function"==typeof options&&(callback=options,options=void 0);const addPullStream=createAddPullStream(options),p=pushable(),s=pull(p,addPullStream),retStream=new AddStreamDuplex(s,p);retStream.once("finish",()=>p.end()),callback(null,retStream)},createAddPullStream:createAddPullStream,add:promisify((data,options,callback)=>{if("function"==typeof options?(callback=options,options=void 0):callback&&"function"==typeof callback||(callback=noop),"object"!=typeof data&&!Buffer.isBuffer(data)&&!isStream(data))return callback(new Error("Invalid arguments, data must be an object, Buffer or readable stream"));pull(pull.values(normalizeContent(data)),importer(self._ipldResolver,options),pull.asyncMap(prepareFile.bind(null,self)),sort((a,b)=>{return a.pathb.path?-1:0}),pull.collect(callback))}),cat:promisify((ipfsPath,callback)=>{if("function"==typeof ipfsPath)return callback(new Error("You must supply a ipfsPath"));pull(exporter(ipfsPath,self._ipldResolver),pull.collect((err,files)=>{if(err)return callback(err);callback(null,toStream.source(files[files.length-1].content))}))}),get:promisify((ipfsPath,callback)=>{callback(null,toStream.source(pull(exporter(ipfsPath,self._ipldResolver),pull.map(file=>{return file.content&&(file.content=toStream.source(file.content),file.content.pause()),file}))))}),getPull:promisify((ipfsPath,callback)=>{callback(null,exporter(ipfsPath,self._ipldResolver))})}};class AddStreamDuplex extends Duplex{constructor(pullStream,push,options){super(Object.assign({objectMode:!0},options)),this._pullStream=pullStream,this._pushable=push,this._waitingPullFlush=[]}_read(){this._pullStream(null,(end,data)=>{for(;this._waitingPullFlush.length;){const cb=this._waitingPullFlush.shift();cb()}end?end instanceof Error&&this.emit("error",end):this.push(data)})}_write(chunk,encoding,callback){this._waitingPullFlush.push(callback),this._pushable.push(chunk)}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(17),setImmediate=__webpack_require__(10);module.exports=function(self){return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),setImmediate(()=>callback(null,{id:self._peerInfo.id.toB58String(),publicKey:self._peerInfo.id.pubKey.bytes.toString("base64"),addresses:self._peerInfo.multiaddrs.toArray().map(ma=>ma.toString()).filter(ma=>ma.indexOf("ipfs")>=0).sort(),agentVersion:"js-ipfs",protocolVersion:"9000"}))})}},function(module,exports,__webpack_require__){"use strict";exports.preStart=__webpack_require__(699),exports.start=__webpack_require__(702),exports.stop=__webpack_require__(703),exports.isOnline=__webpack_require__(695),exports.version=__webpack_require__(705),exports.id=__webpack_require__(692),exports.repo=__webpack_require__(701),exports.init=__webpack_require__(694),exports.bootstrap=__webpack_require__(687),exports.config=__webpack_require__(688),exports.block=__webpack_require__(686),exports.object=__webpack_require__(697),exports.dag=__webpack_require__(689),exports.libp2p=__webpack_require__(696),exports.swarm=__webpack_require__(704),exports.ping=__webpack_require__(698),exports.files=__webpack_require__(691),exports.bitswap=__webpack_require__(685),exports.pubsub=__webpack_require__(700),exports.dht=__webpack_require__(690)},function(module,exports,__webpack_require__){"use strict";const peerId=__webpack_require__(22),waterfall=__webpack_require__(7),parallel=__webpack_require__(39),promisify=__webpack_require__(17),config=__webpack_require__(207),addDefaultAssets=__webpack_require__(719);module.exports=function(self){return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={});const done=(err,res)=>{if(err)return self.emit("error",err),callback(err);self.state.initialized(),self.emit("init"),callback(null,res)};if("uninitalized"!==self.state.state())return done(new Error("Not able to init from state: "+self.state.state()));self.state.init(),self.log("init"),opts.emptyRepo=opts.emptyRepo||!1,opts.bits=Number(opts.bits)||2048,opts.log=opts.log||function(){},waterfall([cb=>self._repo.exists(cb),(exists,cb)=>{if(self.log("repo exists?",exists),exists===!0)return cb(new Error("repo already exists"));opts.log(`generating ${opts.bits}-bit RSA keypair...`,!1),self.log("generating peer id: %s bits",opts.bits),peerId.create({bits:opts.bits},cb)},(keys,cb)=>{self.log("identity generated"),config.Identity={PeerID:keys.toB58String(),PrivKey:keys.privKey.bytes.toString("base64")},opts.log("done"),opts.log("peer identity: "+config.Identity.PeerID),self._repo.init(config,cb)},(_,cb)=>self._repo.open(cb),cb=>{if(self.log("repo opened"),opts.emptyRepo)return cb(null,!0);const tasks=[cb=>self.object.new("unixfs-dir",cb)];"function"==typeof addDefaultAssets&&tasks.push(cb=>addDefaultAssets(self,opts.log,cb)),parallel(tasks,err=>{err?cb(err):cb(null,!0)})}],done)})}},function(module,exports,__webpack_require__){"use strict";module.exports=function(self){return()=>{return Boolean(self._bitswap&&self._libp2pNode&&self._libp2pNode.isStarted())}}},function(module,exports,__webpack_require__){"use strict";const Node=__webpack_require__(707),promisify=__webpack_require__(17),get=__webpack_require__(228);module.exports=function(self){return{start:promisify(callback=>{function gotConfig(err,config){if(err)return callback(err);const options={mdns:get(config,"Discovery.MDNS.Enabled"),webRTCStar:get(config,"Discovery.webRTCStar.Enabled"),bootstrap:get(config,"Bootstrap"),dht:get(self._options,"EXPERIMENTAL.dht"),modules:self._libp2pModules};self._libp2pNode=new Node(self._peerInfo,self._peerInfoBook,options),self._libp2pNode.on("peer:discovery",peerInfo=>{const dial=()=>{self._peerInfoBook.put(peerInfo),self._libp2pNode.dial(peerInfo,()=>{})};self.isOnline()?dial():self._libp2pNode.once("start",dial)}),self._libp2pNode.on("peer:connect",peerInfo=>{self._peerInfoBook.put(peerInfo)}),self._libp2pNode.start(err=>{if(err)return callback(err);self._libp2pNode.peerInfo.multiaddrs.forEach(ma=>{console.log("Swarm listening on",ma.toString())}),callback()})}self.config.get(gotConfig)}),stop:promisify(callback=>{self._libp2pNode.stop(callback)})}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function normalizeMultihash(multihash,enc){if("string"==typeof multihash)return"base58"!==enc&&enc?new Buffer(multihash,enc):multihash;if(Buffer.isBuffer(multihash))return multihash;throw new Error("unsupported multihash")}function parseBuffer(buf,encoding,callback){switch(encoding){case"json":return parseJSONBuffer(buf,callback);case"protobuf":return parseProtoBuffer(buf,callback);default:callback(new Error(`unkown encoding: ${encoding}`))}}function parseJSONBuffer(buf,callback){let data,links;try{const parsed=JSON.parse(buf.toString());links=(parsed.Links||[]).map(link=>{return new DAGLink(link.Name||link.name,link.Size||link.size,mh.fromB58String(link.Hash||link.hash||link.multihash))}),data=new Buffer(parsed.Data)}catch(err){return callback(new Error("failed to parse JSON: "+err))}DAGNode.create(data,links,callback)}function parseProtoBuffer(buf,callback){dagPB.util.deserialize(buf,callback)}const waterfall=__webpack_require__(7),promisify=__webpack_require__(17),dagPB=__webpack_require__(52),DAGNode=dagPB.DAGNode,DAGLink=dagPB.DAGLink,CID=__webpack_require__(8),mh=__webpack_require__(12),Unixfs=__webpack_require__(41),assert=__webpack_require__(9);module.exports=function(self){function editAndSave(edit){return(multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={}),waterfall([cb=>{self.object.get(multihash,options,cb)},(node,cb)=>{edit(node,(err,node)=>{if(err)return cb(err);self._ipldResolver.put(node,{cid:new CID(node.multihash)},err=>{cb(err,node)})})}],callback)}}return{new:promisify((template,callback)=>{"function"==typeof template&&(callback=template,template=void 0);let data;template?(assert("unixfs-dir"===template,"unkown template"),data=new Unixfs("directory").marshal()):data=new Buffer(0),DAGNode.create(data,(err,node)=>{if(err)return callback(err);self._ipldResolver.put(node,{cid:new CID(node.multihash)},err=>{if(err)return callback(err);callback(null,node)})})}),put:promisify((obj,options,callback)=>{function next(){self._ipldResolver.put(node,{cid:new CID(node.multihash)},err=>{if(err)return callback(err);self.object.get(node.multihash,callback)})}"function"==typeof options&&(callback=options,options={});const encoding=options.enc;let node;if(Buffer.isBuffer(obj))encoding?parseBuffer(obj,encoding,(err,_node)=>{if(err)return callback(err);node=_node,next()}):DAGNode.create(obj,(err,_node)=>{if(err)return callback(err);node=_node,next()});else if(obj.multihash)node=obj,next();else{if("object"!=typeof obj)return callback(new Error("obj not recognized"));DAGNode.create(obj.Data,obj.Links,(err,_node)=>{if(err)return callback(err);node=_node,next()})}}),get:promisify((multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={});let mh;try{mh=normalizeMultihash(multihash,options.enc)}catch(err){return callback(err)}const cid=new CID(mh);self._ipldResolver.get(cid,(err,result)=>{if(err)return callback(err);callback(null,result.value)})}),data:promisify((multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={}),self.object.get(multihash,options,(err,node)=>{if(err)return callback(err);callback(null,node.data)})}),links:promisify((multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={}),self.object.get(multihash,options,(err,node)=>{if(err)return callback(err);callback(null,node.links)})}),stat:promisify((multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={}),self.object.get(multihash,options,(err,node)=>{if(err)return callback(err);dagPB.util.serialize(node,(err,serialized)=>{if(err)return callback(err);const blockSize=serialized.length,linkLength=node.links.reduce((a,l)=>a+l.size,0);callback(null,{Hash:node.toJSON().multihash,NumLinks:node.links.length,BlockSize:blockSize,LinksSize:blockSize-node.data.length,DataSize:node.data.length,CumulativeSize:blockSize+linkLength})})})}),patch:promisify({addLink(multihash,link,options,callback){editAndSave((node,cb)=>{DAGNode.addLink(node,link,cb)})(multihash,options,callback)},rmLink(multihash,linkRef,options,callback){editAndSave((node,cb)=>{linkRef.constructor&&"DAGLink"===linkRef.constructor.name&&(linkRef=linkRef._name),DAGNode.rmLink(node,linkRef,cb)})(multihash,options,callback)},appendData(multihash,data,options,callback){editAndSave((node,cb)=>{const newData=Buffer.concat([node.data,data]);DAGNode.create(newData,node.links,cb)})(multihash,options,callback)},setData(multihash,data,options,callback){editAndSave((node,cb)=>{DAGNode.create(data,node.links,cb)})(multihash,options,callback)}})}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(17);module.exports=function(self){return promisify(callback=>{callback(new Error("Not implemented"))})}},function(module,exports,__webpack_require__){"use strict";const peerId=__webpack_require__(22),PeerInfo=__webpack_require__(35),multiaddr=__webpack_require__(24),waterfall=__webpack_require__(7),mafmt=__webpack_require__(89);module.exports=function(self){return callback=>{self.log("pre-start"),waterfall([cb=>self._repo.config.get(cb),(config,cb)=>{const privKey=config.Identity.PrivKey;peerId.createFromPrivKey(privKey,(err,id)=>cb(err,config,id))},(config,id,cb)=>{self._peerInfo=new PeerInfo(id),config.Addresses.Swarm.forEach(addr=>{let ma=multiaddr(addr);mafmt.IPFS.matches(ma)||(ma=ma.encapsulate("/ipfs/"+self._peerInfo.id.toB58String())),self._peerInfo.multiaddrs.add(ma)}),cb()}],callback)}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const promisify=__webpack_require__(17),setImmediate=__webpack_require__(10),OFFLINE_ERROR=__webpack_require__(148).OFFLINE_ERROR;module.exports=function(self){function subscribe(topic,options,handler,callback){const ps=self._pubsub;0===ps.listenerCount(topic)&&ps.subscribe(topic),ps.on(topic,handler),setImmediate(()=>callback())}return{subscribe:(topic,options,handler,callback)=>{if(!self.isOnline())throw OFFLINE_ERROR;if("function"==typeof options&&(callback=handler,handler=options,options={}),!callback)return new Promise((resolve,reject)=>{subscribe(topic,options,handler,err=>{if(err)return reject(err);resolve()})});subscribe(topic,options,handler,callback)},unsubscribe:(topic,handler)=>{const ps=self._pubsub;ps.removeListener(topic,handler),0===ps.listenerCount(topic)&&ps.unsubscribe(topic)},publish:promisify((topic,data,callback)=>{return self.isOnline()?Buffer.isBuffer(data)?(self._pubsub.publish(topic,data),void setImmediate(()=>callback())):setImmediate(()=>callback(new Error("data must be a Buffer"))):setImmediate(()=>callback(OFFLINE_ERROR))}),ls:promisify(callback=>{if(!self.isOnline())return setImmediate(()=>callback(OFFLINE_ERROR));const subscriptions=Array.from(self._pubsub.subscriptions);setImmediate(()=>callback(null,subscriptions))}),peers:promisify((topic,callback)=>{if(!self.isOnline())return setImmediate(()=>callback(OFFLINE_ERROR));const peers=Array.from(self._pubsub.peers.values()).filter(peer=>peer.topics.has(topic)).map(peer=>peer.info.id.toB58String());setImmediate(()=>callback(null,peers))}),setMaxListeners(n){return self._pubsub.setMaxListeners(n)}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";module.exports=function(self){return{init:(bits,empty,callback)=>{},version:callback=>{self._repo.version.get(callback)},gc:function(){},path:()=>self._repo.path}}},function(module,exports,__webpack_require__){"use strict";const series=__webpack_require__(33),Bitswap=__webpack_require__(393),FloodSub=__webpack_require__(485),setImmediate=__webpack_require__(10),promisify=__webpack_require__(17);module.exports=(self=>{return promisify(callback=>{callback=callback||function(){};const done=err=>{if(err)return setImmediate(()=>self.emit("error",err)),callback(err);self.state.started(),setImmediate(()=>self.emit("start")),callback()};if("stopped"!==self.state.state())return done(new Error("Not able to start from state: "+self.state.state()));self.log("starting"),self.state.start(),series([cb=>{self._repo.closed?self._repo.open(cb):cb()},cb=>self.preStart(cb),cb=>self.libp2p.start(cb)],err=>{if(err)return done(err);self._bitswap=new Bitswap(self._libp2pNode,self._repo.blocks,self._peerInfoBook),self._bitswap.start(),self._blockService.setExchange(self._bitswap),self._options.EXPERIMENTAL.pubsub?(self._pubsub=new FloodSub(self._libp2pNode),self._pubsub.start(done)):done()})})})},function(module,exports,__webpack_require__){"use strict";const series=__webpack_require__(33);module.exports=(self=>{return callback=>{if(callback=callback||function(){},self.log("stop"),"stopped"===self.state.state())return callback();const done=err=>{if(err)return self.emit("error",err),callback(err);self.state.stopped(),self.emit("stop"),callback()};if("running"!==self.state.state())return done(new Error("Not able to stop from state: "+self.state.state()));self.state.stop(),self._blockService.unsetExchange(),self._bitswap.stop(),series([cb=>{self._options.EXPERIMENTAL.pubsub?self._pubsub.stop(cb):cb()},cb=>self.libp2p.stop(cb),cb=>self._repo.close(cb)],done)}})},function(module,exports,__webpack_require__){"use strict";const multiaddr=__webpack_require__(24),promisify=__webpack_require__(17),flatMap=__webpack_require__(522),values=__webpack_require__(129),OFFLINE_ERROR=__webpack_require__(148).OFFLINE_ERROR;module.exports=function(self){return{peers:promisify((opts,callback)=>{if("function"==typeof opts&&(callback=opts,opts={}),!self.isOnline())return callback(OFFLINE_ERROR);const verbose=opts.v||opts.verbose;callback(null,flatMap(values(self._peerInfoBook.getAll()).filter(peer=>peer.isConnected()),peer=>{return peer.multiaddrs.toArray().map(addr=>{const res={addr:addr,peer:peer};return verbose&&(res.latency="unknown"),res})}))}),addrs:promisify(callback=>{if(!self.isOnline())return callback(OFFLINE_ERROR);callback(null,values(self._peerInfoBook.getAll()))}),localAddrs:promisify(callback=>{if(!self.isOnline())return callback(OFFLINE_ERROR);callback(null,self._libp2pNode.peerInfo.multiaddrs.toArray())}),connect:promisify((maddr,callback)=>{if(!self.isOnline())return callback(OFFLINE_ERROR);"string"==typeof maddr&&(maddr=multiaddr(maddr)),self._libp2pNode.dial(maddr,callback)}),disconnect:promisify((maddr,callback)=>{if(!self.isOnline())return callback(OFFLINE_ERROR);"string"==typeof maddr&&(maddr=multiaddr(maddr)),self._libp2pNode.hangUp(maddr,callback)}),filters:promisify(callback=>callback(new Error("Not implemented")))}}},function(module,exports,__webpack_require__){"use strict";const pkg=__webpack_require__(454),promisify=__webpack_require__(17);module.exports=function(self){return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),callback(null,{version:pkg.version,repo:"",commit:""})})}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const BlockService=__webpack_require__(192),IPLDResolver=__webpack_require__(447),PeerId=__webpack_require__(22),PeerInfo=__webpack_require__(35),multiaddr=__webpack_require__(24),multihash=__webpack_require__(12),PeerBook=__webpack_require__(245),CID=__webpack_require__(8),debug=__webpack_require__(3),extend=__webpack_require__(175),EventEmitter=__webpack_require__(11),boot=__webpack_require__(684),components=__webpack_require__(693),defaultRepo=__webpack_require__(708);class IPFS extends EventEmitter{constructor(options){super(),this._options={init:!0,start:!0,EXPERIMENTAL:{}},options=options||{},this._libp2pModules=options.libp2p&&options.libp2p.modules,extend(this._options,options),options.init===!1&&(this._options.init=!1),options.start!==!1&&(this._options.start=!0),"string"==typeof options.repo||void 0===options.repo?this._repo=defaultRepo(options.repo):this._repo=options.repo,this.log=debug("jsipfs"),this.log.err=debug("jsipfs:err"),this.on("error",err=>this.log(err)),this.types={Buffer:Buffer,PeerId:PeerId,PeerInfo:PeerInfo,multiaddr:multiaddr,multihash:multihash,CID:CID},this._peerInfoBook=new PeerBook,this._peerInfo=void 0,this._libp2pNode=void 0,this._bitswap=void 0,this._blockService=new BlockService(this._repo),this._ipldResolver=new IPLDResolver(this._blockService),this._pubsub=void 0,this.init=components.init(this),this.preStart=components.preStart(this),this.start=components.start(this),this.stop=components.stop(this),this.isOnline=components.isOnline(this),this.version=components.version(this),this.id=components.id(this),this.repo=components.repo(this),this.bootstrap=components.bootstrap(this),this.config=components.config(this),this.block=components.block(this),this.object=components.object(this),this.dag=components.dag(this),this.libp2p=components.libp2p(this),this.swarm=components.swarm(this),this.files=components.files(this),this.bitswap=components.bitswap(this),this.ping=components.ping(this),this.pubsub=components.pubsub(this),this.dht=components.dht(this),this._options.EXPERIMENTAL.pubsub&&this.log("EXPERIMENTAL pubsub is enabled"),this._options.EXPERIMENTAL.sharding&&this.log("EXPERIMENTAL sharding is enabled"),this._options.EXPERIMENTAL.dht&&this.log("EXPERIMENTAL Kademlia DHT is enabled"),this.state=__webpack_require__(709)(this),boot(this)}}exports=module.exports=IPFS,exports.createNode=(options=>{return new IPFS(options)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const WS=__webpack_require__(516),WebRTCStar=__webpack_require__(514),Multiplex=__webpack_require__(493),SECIO=__webpack_require__(506),Railing=__webpack_require__(499),libp2p=__webpack_require__(519);class Node extends libp2p{constructor(peerInfo,peerBook,options){options=options||{};const wstar=new WebRTCStar,modules={transport:[new WS,wstar],connection:{muxer:[Multiplex],crypto:[SECIO]},discovery:[wstar.discovery]};if(options.bootstrap){const r=new Railing(options.bootstrap);modules.discovery.push(r)}super(modules,peerInfo,peerBook,options)}}module.exports=Node},function(module,exports,__webpack_require__){"use strict";const IPFSRepo=__webpack_require__(193);module.exports=(dir=>{return new IPFSRepo(dir||"ipfs")})},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(3),log=debug("jsipfs:state");log.error=debug("jsipfs:state:error");const fsm=__webpack_require__(369);module.exports=(self=>{const s=fsm("uninitalized",{uninitalized:{init:"initializing",initialized:"stopped"},initializing:{initialized:"stopped"},stopped:{start:"starting"},starting:{started:"running"},running:{stop:"stopping"},stopping:{stopped:"stopped"}});return s.on("error",err=>log.error(err)),s.on("done",()=>log("-> "+s._state)),s.init=(()=>{s("init")}),s.initialized=(()=>{s("initialized")}),s.stop=(()=>{s("stop")}),s.stopped=(()=>{s("stopped")}),s.start=(()=>{s("start")}),s.started=(()=>{s("started")}),s.state=(()=>s._state),s}) -},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports,__webpack_require__){module.exports=__webpack_require__(276)}]); \ No newline at end of file +}`},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(4),Connection=__webpack_require__(29).Connection,handshake=__webpack_require__(515),State=__webpack_require__(519);module.exports={tag:"/secio/1.0.0",encrypt(local,key,insecure,callback){if(!local)throw new Error("no local id provided");if(!key)throw new Error("no local private key provided");if(!insecure)throw new Error("no insecure stream provided");callback||(callback=(err=>{err&&console.error(err)}));const state=new State(local,key,3e5,callback);return pull(insecure,handshake(state),insecure),new Connection(state.secure,insecure)}}},function(module,exports,__webpack_require__){"use strict";const handshake=__webpack_require__(58),deferred=__webpack_require__(99);class State{constructor(id,key,timeout,cb){"function"==typeof timeout&&(cb=timeout,timeout=void 0),this.setup(),this.id.local=id,this.key.local=key,this.timeout=timeout||6e4,cb=cb||(()=>{}),this.secure=deferred.duplex(),this.stream=handshake({timeout:this.timeout},cb),this.shake=this.stream.handshake,delete this.stream.handshake}setup(){this.id={local:null,remote:null},this.key={local:null,remote:null},this.shake=null,this.cleanSecrets()}cleanSecrets(){this.shared={},this.ephemeralKey={local:null,remote:null},this.proposal={in:null,out:null},this.proposalEncoded={in:null,out:null},this.protocols={local:null,remote:null},this.exchange={in:null,out:null}}}module.exports=State},function(module,exports,__webpack_require__){"use strict";const identify=__webpack_require__(500),multistream=__webpack_require__(141),waterfall=__webpack_require__(6),debug=__webpack_require__(19),log=debug("libp2p:swarm:connection"),setImmediate=__webpack_require__(7),protocolMuxer=__webpack_require__(92),plaintext=__webpack_require__(233);module.exports=function(swarm){return{addUpgrade(){},addStreamMuxer(muxer){swarm.muxers[muxer.multicodec]=muxer,swarm.handle(muxer.multicodec,(protocol,conn)=>{const muxedConn=muxer.listener(conn);return muxedConn.on("stream",conn=>{protocolMuxer(swarm.protocols,conn)}),swarm.identify&&(conn.getPeerInfo=(cb=>{const conn=muxedConn.newStream(),ms=new multistream.Dialer;waterfall([cb=>ms.handle(conn,cb),cb=>ms.select(identify.multicodec,cb),(conn,cb)=>identify.dialer(conn,cb),(peerInfo,observedAddrs,cb)=>{observedAddrs.forEach(oa=>{swarm._peerInfo.multiaddrs.addSafe(oa)}),cb(null,peerInfo)}],cb)}),conn.getPeerInfo((err,peerInfo)=>{if(err)return log("Identify not successful");const b58Str=peerInfo.id.toB58String();swarm.muxedConns[b58Str]={muxer:muxedConn},peerInfo.multiaddrs.size>0?peerInfo.connect(peerInfo.multiaddrs.toArray()[0]):peerInfo.connect(`/ipfs/${b58Str}`),peerInfo=swarm._peerBook.put(peerInfo),muxedConn.on("close",()=>{delete swarm.muxedConns[b58Str],peerInfo.disconnect(),peerInfo=swarm._peerBook.put(peerInfo),setImmediate(()=>swarm.emit("peer-mux-closed",peerInfo))}),setImmediate(()=>swarm.emit("peer-mux-established",peerInfo))})),conn})},reuse(){swarm.identify=!0,swarm.handle(identify.multicodec,(protocol,conn)=>{identify.listener(conn,swarm._peerInfo)})},crypto(tag,encrypt){tag||encrypt||(tag=plaintext.tag,encrypt=plaintext.encrypt),swarm.unhandle(swarm.crypto.tag),swarm.handle(tag,(protocol,conn)=>{const id=swarm._peerInfo.id,secure=encrypt(id,id.privKey,conn);protocolMuxer(swarm.protocols,secure)}),swarm.crypto={tag:tag,encrypt:encrypt}}}}},function(module,exports,__webpack_require__){"use strict";function dial(swarm){return(peer,protocol,callback)=>{function gotWarmedUpConn(conn){conn.setPeerInfo(pi),attemptMuxerUpgrade(conn,(err,muxer)=>{if(!protocol)return err&&(swarm.conns[b58Id]=conn),callback();err?protocolHandshake(conn,protocol,callback):gotMuxer(muxer)})}function gotMuxer(muxer){swarm.identify,openConnInMuxedConn(muxer,conn=>{protocolHandshake(conn,protocol,callback)})}function attemptMuxerUpgrade(conn,cb){function nextMuxer(key){log("selecting %s",key),ms.select(key,(err,conn)=>{if(err)return void(0===muxers.length?cb(new Error("could not upgrade to stream muxing")):nextMuxer(muxers.shift()));const muxedConn=swarm.muxers[key].dialer(conn);swarm.muxedConns[b58Id]={},swarm.muxedConns[b58Id].muxer=muxedConn,muxedConn.once("close",()=>{const b58Str=pi.id.toB58String();delete swarm.muxedConns[b58Str],pi.disconnect(),swarm._peerBook.get(b58Str).disconnect(),setImmediate(()=>swarm.emit("peer-mux-closed",pi))}),muxedConn.on("stream",conn=>{protocolMuxer(swarm.protocols,conn)}),setImmediate(()=>swarm.emit("peer-mux-established",pi)),cb(null,muxedConn)})}const muxers=Object.keys(swarm.muxers);if(0===muxers.length)return cb(new Error("no muxers available"));const ms=new multistream.Dialer;ms.handle(conn,err=>{if(err)return callback(new Error("multistream not supported"));nextMuxer(muxers.shift())})}function openConnInMuxedConn(muxer,cb){cb(muxer.newStream())}function protocolHandshake(conn,protocol,cb){const ms=new multistream.Dialer;ms.handle(conn,err=>{if(err)return cb(err);ms.select(protocol,(err,conn)=>{if(err)return cb(err);proxyConn.setInnerConn(conn),cb(null,proxyConn)})})}"function"==typeof protocol&&(callback=protocol,protocol=null),callback=callback||function(){};const pi=getPeerInfo(peer,swarm._peerBook),proxyConn=new Connection,b58Id=pi.id.toB58String();if(log("dialing %s",b58Id),swarm.muxedConns[b58Id]){if(!protocol)return callback();gotMuxer(swarm.muxedConns[b58Id].muxer)}else if(swarm.conns[b58Id]){const conn=swarm.conns[b58Id];swarm.conns[b58Id]=void 0,gotWarmedUpConn(conn)}else!function(pi,cb){function nextTransport(key){swarm.transport.dial(key,pi,(err,conn)=>{if(err)return 0===tKeys.length?cb(new Error("Could not dial in any of the transports")):nextTransport(tKeys.shift());!function(){const ms=new multistream.Dialer;ms.handle(conn,err=>{if(err)return cb(err);const id=swarm._peerInfo.id;log("selecting crypto: %s",swarm.crypto.tag),ms.select(swarm.crypto.tag,(err,conn)=>{if(err)return cb(err);cb(null,swarm.crypto.encrypt(id,id.privKey,conn))})})}()})}const tKeys=swarm.availableTransports(pi);if(0===tKeys.length)return cb(new Error("No available transport to dial to"));nextTransport(tKeys.shift())}(pi,(err,conn)=>{if(err)return callback(err);gotWarmedUpConn(conn)});return proxyConn}}const multistream=__webpack_require__(141),Connection=__webpack_require__(29).Connection,setImmediate=__webpack_require__(7),getPeerInfo=__webpack_require__(232),debug=__webpack_require__(19),log=debug("libp2p:swarm:dial"),protocolMuxer=__webpack_require__(92);module.exports=dial},function(module,exports,__webpack_require__){"use strict";function Swarm(peerInfo,peerBook){if(!(this instanceof Swarm))return new Swarm(peerInfo);assert(peerInfo,"You must provide a `peerInfo`"),assert(peerBook,"You must provide a `peerBook`"),this._peerInfo=peerInfo,this._peerBook=peerBook,this.setMaxListeners(1/0),this.transports={},this.conns={},this.muxedConns={},this.protocols={},this.muxers={},this.identify=!1,this.crypto=plaintext,this.transport=transport(this),this.connection=connection(this),this.availableTransports=(pi=>{const myAddrs=pi.multiaddrs.toArray();return Object.keys(this.transports).filter(ts=>this.transports[ts].filter(myAddrs).length>0)}),this.dial=dial(this),this.listen=(callback=>{each(this.availableTransports(peerInfo),(ts,cb)=>{this.transport.listen(ts,{},null,cb)},callback)}),this.handle=((protocol,handlerFunc,matchFunc)=>{this.protocols[protocol]={handlerFunc:handlerFunc,matchFunc:matchFunc}}),this.handle(this.crypto.tag,(protocol,conn)=>{const peerId=this._peerInfo.id,wrapped=this.crypto.encrypt(peerId,peerId.privKey,conn);return protocolMuxer(this.protocols,wrapped)}),this.unhandle=(protocol=>{this.protocols[protocol]&&delete this.protocols[protocol]}),this.hangUp=((peer,callback)=>{const peerInfo=getPeerInfo(peer,this.peerBook),key=peerInfo.id.toB58String();if(this.muxedConns[key]){const muxer=this.muxedConns[key].muxer;muxer.once("close",()=>{delete this.muxedConns[key],callback()}),muxer.end()}else callback()}),this.close=(callback=>{series([cb=>each(this.muxedConns,(conn,cb)=>{conn.muxer.end(err=>{if(err&&"Fatal error: OK"!==err.message)return cb(err);cb()})},cb),cb=>{each(this.transports,(transport,cb)=>{each(transport.listeners,(listener,cb)=>{listener.close(cb)},cb)},cb)}],callback)})}const util=__webpack_require__(34),EE=__webpack_require__(10).EventEmitter,each=__webpack_require__(15),series=__webpack_require__(32),transport=__webpack_require__(525),connection=__webpack_require__(520),getPeerInfo=__webpack_require__(232),dial=__webpack_require__(521),protocolMuxer=__webpack_require__(92),plaintext=__webpack_require__(233),assert=__webpack_require__(9);module.exports=Swarm,util.inherits(Swarm,EE)},function(module,exports,__webpack_require__){"use strict";const map=__webpack_require__(61),debug=__webpack_require__(19),log=debug("libp2p:swarm:dialer"),DialQueue=__webpack_require__(524);class LimitDialer{constructor(perPeerLimit,dialTimeout){log("create: %s peer limit, %s dial timeout",perPeerLimit,dialTimeout),this.perPeerLimit=perPeerLimit,this.dialTimeout=dialTimeout,this.queues=new Map}dialMany(peer,transport,addrs,callback){log("dialMany:start");const token={cancel:!1};map(addrs,(m,cb)=>{this.dialSingle(peer,transport,m,token,cb)},(err,results)=>{if(err)return callback(err);const success=results.filter(res=>res.conn);if(success.length>0)return log("dialMany:success"),callback(null,success[0]);log("dialMany:error");const error=new Error("Failed to dial any provided address");return error.errors=results.filter(res=>res.error).map(res=>res.error),callback(error)})}dialSingle(peer,transport,addr,token,callback){const ps=peer.toB58String();log("dialSingle: %s:%s",ps,addr.toString());let q;this.queues.has(ps)?q=this.queues.get(ps):(q=new DialQueue(this.perPeerLimit,this.dialTimeout),this.queues.set(ps,q)),q.push(transport,addr,token,callback)}}module.exports=LimitDialer},function(module,exports,__webpack_require__){"use strict";const Connection=__webpack_require__(29).Connection,pull=__webpack_require__(4),timeout=__webpack_require__(307),queue=__webpack_require__(111),debug=__webpack_require__(19),log=debug("libp2p:swarm:dialer:queue");class DialQueue{constructor(limit,dialTimeout){this.dialTimeout=dialTimeout,this.queue=queue((task,cb)=>{this._doWork(task.transport,task.addr,task.token,cb)},limit)}_doWork(transport,addr,token,callback){log("work"),this._dialWithTimeout(transport,addr,(err,conn)=>{return err?(log("work:error"),callback(null,{error:err})):token.cancel?(log("work:cancel"),pull(pull.empty(),conn),callback(null,{cancel:!0})):(token.cancel=!0,log("work:success"),(new Connection).setInnerConn(conn),void callback(null,{multiaddr:addr,conn:conn}))})}_dialWithTimeout(transport,addr,callback){timeout(cb=>{const conn=transport.dial(addr,err=>{if(err)return cb(err);cb(null,conn)})},this.dialTimeout)(callback)}push(transport,addr,token,callback){this.queue.push({transport:transport,addr:addr,token:token},callback)}}module.exports=DialQueue},function(module,exports,__webpack_require__){"use strict";function dialables(tp,multiaddrs){return tp.filter(multiaddrs)}function noop(){}const parallel=__webpack_require__(40),once=__webpack_require__(57),debug=__webpack_require__(19),log=debug("libp2p:swarm:transport"),protocolMuxer=__webpack_require__(92),LimitDialer=__webpack_require__(523);module.exports=function(swarm){const dialer=new LimitDialer(8,1e4);return{add(key,transport,options,callback){if("function"==typeof options&&(callback=options,options={}),callback=callback||noop,log("adding %s",key),swarm.transports[key])throw new Error("There is already a transport with this key");swarm.transports[key]=transport,swarm.transports[key].listeners||(swarm.transports[key].listeners=[]),callback()},dial(key,pi,callback){const t=swarm.transports[key];let multiaddrs=pi.multiaddrs.toArray();Array.isArray(multiaddrs)||(multiaddrs=[multiaddrs]),log("dialing %s",key,multiaddrs.map(m=>m.toString())),multiaddrs=dialables(t,multiaddrs),dialer.dialMany(pi.id,t,multiaddrs,(err,success)=>{if(err)return callback(err);pi.connect(success.multiaddr),swarm._peerBook.put(pi),callback(null,success.conn)})},listen(key,options,handler,callback){handler||(handler=protocolMuxer.bind(null,swarm.protocols));const multiaddrs=dialables(swarm.transports[key],swarm._peerInfo.multiaddrs.distinct()),transport=swarm.transports[key];transport.listeners||(transport.listeners=[]);let freshMultiaddrs=[];parallel(multiaddrs.map(ma=>{return cb=>{const done=once(cb),listener=transport.createListener(handler);listener.once("error",done),listener.listen(ma,err=>{if(err)return done(err);listener.removeListener("error",done),listener.getAddrs((err,addrs)=>{if(err)return done(err);freshMultiaddrs=freshMultiaddrs.concat(addrs),transport.listeners.push(listener),done()})})}}),err=>{if(err)return callback(err);swarm._peerInfo.multiaddrs.replace(multiaddrs,freshMultiaddrs),callback()})},close(key,callback){const transport=swarm.transports[key];if(!transport)return callback(new Error(`Trying to close non existing transport: ${key}`));parallel(transport.listeners.map(listener=>{return cb=>{listener.close(cb)}}),callback)}}}},function(module,exports,__webpack_require__){(function(process){function useColors(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(args){var useColors=this.useColors;if(args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff),useColors){var c="color: "+this.color;args.splice(1,0,c,"color: inherit");var index=0,lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){"%%"!==match&&(index++,"%c"===match&&(lastC=index))}),args.splice(lastC,0,c)}}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{null==namespaces?exports.storage.removeItem("debug"):exports.storage.debug=namespaces}catch(e){}}function load(){var r;try{r=exports.storage.debug}catch(e){}return!r&&void 0!==process&&"env"in process&&(r=process.env.DEBUG),r}exports=module.exports=__webpack_require__(527),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],exports.formatters.j=function(v){try{return JSON.stringify(v)}catch(err){return"[UnexpectedJSONParseError]: "+err.message}},exports.enable(load())}).call(exports,__webpack_require__(1))},function(module,exports,__webpack_require__){function selectColor(namespace){var i,hash=0;for(i in namespace)hash=(hash<<5)-hash+namespace.charCodeAt(i),hash|=0;return exports.colors[Math.abs(hash)%exports.colors.length]}function createDebug(namespace){function debug(){if(debug.enabled){var self=debug,curr=+new Date,ms=curr-(prevTime||curr);self.diff=ms,self.prev=prevTime,self.curr=curr,prevTime=curr;for(var args=new Array(arguments.length),i=0;i{}),sioOptions={transports:["websocket"],"force new connection":!0};class WebRTCStar{constructor(options){options=options||{},this.maSelf=void 0,this.sioOptions={transports:["websocket"],"force new connection":!0},options.wrtc&&(this.wrtc=options.wrtc),this.discovery=new EE,this.discovery.start=(callback=>{setImmediate(callback)}),this.discovery.stop=(callback=>{setImmediate(callback)}),this.listenersRefs={},this._peerDiscovered=this._peerDiscovered.bind(this)}dial(ma,options,callback){"function"==typeof options&&(callback=options,options={}),callback=callback?once(callback):noop;const intentId=(~~(1e9*Math.random())).toString(36)+Date.now(),sioClient=this.listenersRefs[Object.keys(this.listenersRefs)[0]].io,spOptions={initiator:!0,trickle:!1};this.wrtc&&(spOptions.wrtc=this.wrtc);const channel=new SimplePeer(spOptions),conn=new Connection(toPull.duplex(channel));let connected=!1;return channel.on("signal",signal=>{sioClient.emit("ss-handshake",{intentId:intentId,srcMultiaddr:this.maSelf.toString(),dstMultiaddr:ma.toString(),signal:signal})}),channel.once("timeout",()=>callback(new Error("timeout"))),channel.once("error",err=>{connected||callback(err)}),sioClient.on("ws-handshake",offer=>{if(offer.intentId===intentId&&offer.err)return callback(new Error(offer.err));offer.intentId===intentId&&offer.answer&&(channel.once("connect",()=>{connected=!0,conn.destroy=channel.destroy.bind(channel),channel.once("close",()=>conn.destroy()),conn.getObservedAddrs=(callback=>callback(null,[ma])),callback(null,conn)}),channel.signal(offer.signal))}),conn}createListener(options,handler){"function"==typeof options&&(handler=options,options={});const listener=new EE;return listener.listen=((ma,callback)=>{function incommingDial(offer){if(!offer.answer&&!offer.err){const spOptions={trickle:!1};self.wrtc&&(spOptions.wrtc=self.wrtc);const channel=new SimplePeer(spOptions),conn=new Connection(toPull.duplex(channel));channel.once("connect",()=>{conn.getObservedAddrs=(callback=>{return callback(null,[offer.srcMultiaddr])}),listener.emit("connection",conn),handler(conn)}),channel.once("signal",signal=>{offer.signal=signal,offer.answer=!0,listener.io.emit("ss-handshake",offer)}),channel.signal(offer.signal)}}if(callback=callback?once(callback):noop,!webrtcSupport.support&&!this.wrtc)return setImmediate(()=>callback(new Error("no WebRTC support")));this.maSelf=ma;const sioUrl=cleanUrlSIO(ma);log("Dialing to Signalling Server on: "+sioUrl),listener.io=io.connect(sioUrl,sioOptions),listener.io.once("connect_error",callback),listener.io.once("error",err=>{listener.emit("error",err),listener.emit("close")}),listener.io.on("ws-handshake",incommingDial),listener.io.on("ws-peer",this._peerDiscovered),listener.io.on("connect",()=>{listener.io.emit("ss-join",ma.toString())}),listener.io.once("connect",()=>{listener.emit("listening"),callback()});const self=this}),listener.close=(callback=>{callback=callback?once(callback):noop,listener.io.emit("ss-leave"),setImmediate(()=>{listener.emit("close"),callback()})}),listener.getAddrs=(callback=>{setImmediate(()=>callback(null,[this.maSelf]))}),this.listenersRefs[multiaddr.toString()]=listener,listener}filter(multiaddrs){return Array.isArray(multiaddrs)||(multiaddrs=[multiaddrs]),multiaddrs.filter(ma=>mafmt.WebRTCStar.matches(ma))}_peerDiscovered(maStr){log("Peer Discovered:",maStr);const split=maStr.split("/ipfs/"),peerIdStr=split[split.length-1],peerId=PeerId.createFromB58String(peerIdStr),peerInfo=new PeerInfo(peerId);peerInfo.multiaddrs.add(multiaddr(maStr)),this.discovery.emit("peer",peerInfo)}}module.exports=WebRTCStar},function(module,exports,__webpack_require__){"use strict";function cleanUrlSIO(ma){const maStrSplit=ma.toString().split("/");if(multiaddr.isName(ma)){const wsProto=ma.protos()[2].name;if("ws"===wsProto)return"http://"+maStrSplit[3];if("wss"===wsProto)return"https://"+maStrSplit[3];throw new Error("invalid multiaddr"+ma.toString())}return"http://"+maStrSplit[3]+":"+maStrSplit[5]}const multiaddr=__webpack_require__(26);exports=module.exports,exports.cleanUrlSIO=cleanUrlSIO},function(module,exports,__webpack_require__){"use strict";const connect=__webpack_require__(642),mafmt=__webpack_require__(93),includes=__webpack_require__(236),Connection=__webpack_require__(29).Connection,maToUrl=__webpack_require__(532),debug=__webpack_require__(19),log=debug("libp2p:websockets:dialer"),createListener=__webpack_require__(531);class WebSockets{dial(ma,options,callback){"function"==typeof options&&(callback=options,options={}),callback=callback||function(){};const url=maToUrl(ma);log("dialing %s",url);const socket=connect(url,{binary:!0,onConnect:err=>callback(err)}),conn=new Connection(socket);return conn.getObservedAddrs=(callback=>callback(null,[ma])),conn.close=(callback=>socket.close(callback)),conn}createListener(options,handler){return"function"==typeof options&&(handler=options,options={}),createListener(options,handler)}filter(multiaddrs){return Array.isArray(multiaddrs)||(multiaddrs=[multiaddrs]),multiaddrs.filter(ma=>{return includes(ma.protoNames(),"ipfs")&&(ma=ma.decapsulate("ipfs")),mafmt.WebSockets.matches(ma)||mafmt.WebSocketsSecure.matches(ma)})}}module.exports=WebSockets},function(module,exports,__webpack_require__){"use strict";function noop(){}const Connection=__webpack_require__(29).Connection,includes=__webpack_require__(236),createServer=__webpack_require__(739)||noop;module.exports=((options,handler)=>{const listener=createServer(socket=>{socket.getObservedAddrs=(callback=>{return callback(null,[])}),handler(new Connection(socket))});let listeningMultiaddr;return listener._listen=listener.listen,listener.listen=((ma,callback)=>{callback=callback||noop,listeningMultiaddr=ma,includes(ma.protoNames(),"ipfs")&&(ma=ma.decapsulate("ipfs")),listener._listen(ma.toOptions(),callback)}),listener.getAddrs=(callback=>{callback(null,[listeningMultiaddr])}),listener})},function(module,exports,__webpack_require__){"use strict";function maToUrl(ma){const maStrSplit=ma.toString().split("/");let proto;try{proto=ma.protoNames().filter(proto=>{return"ws"===proto||"wss"===proto})[0]}catch(e){throw log(e),new Error("Not a valid websocket address",e)}let port;try{port=ma.stringTuples().filter(tuple=>{if(tuple[0]===ma.protos().filter(proto=>{return"tcp"===proto.name})[0].code)return!0})[0][1]}catch(e){log("No port, skipping")}return`${proto}://${maStrSplit[2]}${!port||80===port&&443===port?"":`:${port}`}`}const debug=__webpack_require__(19),log=debug("libp2p:websockets:dialer");module.exports=maToUrl},function(module,exports,__webpack_require__){"use strict";const EventEmitter=__webpack_require__(10).EventEmitter,assert=__webpack_require__(9),setImmediate=__webpack_require__(7),each=__webpack_require__(15),series=__webpack_require__(32),Ping=__webpack_require__(505),Swarm=__webpack_require__(522),PeerId=__webpack_require__(23),PeerInfo=__webpack_require__(36),PeerBook=__webpack_require__(253),mafmt=__webpack_require__(93),multiaddr=__webpack_require__(26);module.exports;class Node extends EventEmitter{constructor(_modules,_peerInfo,_peerBook,_options){if(super(),assert(_modules,"requires modules to equip libp2p with features"),assert(_peerInfo,"requires a PeerInfo instance"),this.modules=_modules,this.peerInfo=_peerInfo,this.peerBook=_peerBook||new PeerBook,_options=_options||{},this._isStarted=!1,this.swarm=new Swarm(this.peerInfo,this.peerBook),this.modules.connection&&this.modules.connection.muxer){let muxers=this.modules.connection.muxer;muxers=Array.isArray(muxers)?muxers:[muxers],muxers.forEach(muxer=>this.swarm.connection.addStreamMuxer(muxer)),this.swarm.connection.reuse(),this.swarm.on("peer-mux-established",peerInfo=>{this.emit("peer:connect",peerInfo),this.peerBook.put(peerInfo)}),this.swarm.on("peer-mux-closed",peerInfo=>{this.emit("peer:disconnect",peerInfo)})}if(this.modules.connection&&this.modules.connection.crypto){let cryptos=this.modules.connection.crypto;cryptos=Array.isArray(cryptos)?cryptos:[cryptos],cryptos.forEach(crypto=>{this.swarm.connection.crypto(crypto.tag,crypto.encrypt)})}if(this.modules.discovery){let discoveries=this.modules.discovery;discoveries=Array.isArray(discoveries)?discoveries:[discoveries],discoveries.forEach(discovery=>{discovery.on("peer",peerInfo=>this.emit("peer:discovery",peerInfo))})}Ping.mount(this.swarm),_modules.DHT&&(this._dht=new this.modules.DHT(this.swarm,{kBucketSize:20,datastoer:_options.DHT&&_options.DHT.datastore})),this.peerRouting={findPeer:(id,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.findPeer(id,callback)}},this.contentRouting={findProviders:(key,timeout,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.findProviders(key,timeout,callback)},provide:(key,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.provide(key,callback)}},this.dht={put:(key,value,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.put(key,value,callback)},get:(key,callback)=>{if(!this._dht)return callback(new Error("DHT is not available"));this._dht.get(key,callback)},getMany(key,nVals,callback){if(!this._dht)return callback(new Error("DHT is not available"));this._dht.getMany(key,nVals,callback)}}}start(callback){if(!this.modules.transport)return callback(new Error("no transports were present"));let ws,transports=this.modules.transport;transports=Array.isArray(transports)?transports:[transports];const maOld=[],maNew=[];this.peerInfo.multiaddrs.forEach(ma=>{mafmt.IPFS.matches(ma)||(maOld.push(ma),maNew.push(ma.encapsulate("/ipfs/"+this.peerInfo.id.toB58String())))}),this.peerInfo.multiaddrs.replace(maOld,maNew);const multiaddrs=this.peerInfo.multiaddrs.toArray();transports.forEach(transport=>{transport.filter(multiaddrs).length>0?this.swarm.transport.add(transport.tag||transport.constructor.name,transport):transport.constructor&&"WebSockets"===transport.constructor.name&&(ws=transport)}),series([cb=>this.swarm.listen(cb),cb=>{if(ws&&this.swarm.transport.add(ws.tag||ws.constructor.name,ws),this.modules.discovery)return each(this.modules.discovery,(d,cb)=>d.start(cb),cb);cb()},cb=>{if(this._isStarted=!0,this._dht)return this._dht.start(cb);cb()},cb=>{this.emit("start"),cb()}],callback)}stop(callback){this._isStarted=!1,this.modules.discovery&&this.modules.discovery.forEach(discovery=>{setImmediate(()=>discovery.stop(()=>{}))}),series([cb=>{if(this._dht)return this._dht.stop(cb);cb()},cb=>this.swarm.close(cb),cb=>{this.emit("stop"),cb()}],callback)}isStarted(){return this._isStarted}ping(peer,callback){assert(this.isStarted(),"The libp2p node is not started yet"),this._getPeerInfo(peer,(err,peerInfo)=>{if(err)return callback(err);callback(null,new Ping(this.swarm,peerInfo))})}dial(peer,protocol,callback){assert(this.isStarted(),"The libp2p node is not started yet"),"function"==typeof protocol&&(callback=protocol,protocol=void 0),this._getPeerInfo(peer,(err,peerInfo)=>{if(err)return callback(err);this.swarm.dial(peerInfo,protocol,(err,conn)=>{if(err)return callback(err);this.peerBook.put(peerInfo),callback(null,conn)})})}hangUp(peer,callback){assert(this.isStarted(),"The libp2p node is not started yet"),this._getPeerInfo(peer,(err,peerInfo)=>{if(err)return callback(err);this.swarm.hangUp(peerInfo,callback)})}handle(protocol,handlerFunc,matchFunc){this.swarm.handle(protocol,handlerFunc,matchFunc)}unhandle(protocol){this.swarm.unhandle(protocol)}_getPeerInfo(peer,callback){let p;if(PeerInfo.isPeerInfo(peer))p=peer;else if(multiaddr.isMultiaddr(peer)){const peerIdB58Str=peer.getPeerId();try{p=this.peerBook.get(peerIdB58Str)}catch(err){p=new PeerInfo(PeerId.createFromB58String(peerIdB58Str))}p.multiaddrs.add(peer)}else{if(!PeerId.isPeerId(peer))return setImmediate(()=>callback(new Error("peer type not recognized")));{const peerIdB58Str=peer.toB58String();try{p=this.peerBook.get(peerIdB58Str)}catch(err){return this.peerRouting.findPeer(peer,callback)}}}setImmediate(()=>callback(null,p))}}module.exports=Node},function(module,exports,__webpack_require__){(function(global,module){function arrayFilter(array,predicate){for(var index=-1,length=array?array.length:0,resIndex=0,result=[];++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toFinite(value){if(!value)return 0===value?value:0;if((value=toNumber(value))===INFINITY||value===-INFINITY){return(value<0?-1:1)*MAX_INTEGER}return value===value?value:0}function toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,MAX_INTEGER=1.7976931348623157e308,NAN=NaN,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsOctal=/^0o[0-7]+$/i,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeParseInt=parseInt,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),nativeMax=Math.max,DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&"[object Promise]"!=getTag(Promise.resolve())||Set&&getTag(new Set)!=setTag||WeakMap&&"[object WeakMap]"!=getTag(new WeakMap))&&(getTag=function(value){var result=objectToString.call(value),Ctor=result==objectTag?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):void 0;if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return"[object Promise]";case setCtorString:return setTag;case weakMapCtorString:return"[object WeakMap]"}return result});var stringToPath=memoize(function(string){string=toString(string);var result=[];return reLeadingDot.test(string)&&result.push(""),string.replace(/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,function(match,number,quote,string){result.push(quote?string.replace(/\\(\\)?/g,"$1"):number||match)}),result}),find=function(findIndexFunc){return function(collection,predicate,fromIndex){var iterable=Object(collection);if(!isArrayLike(collection)){var iteratee=baseIteratee(predicate,3);collection=keys(collection),predicate=function(key){return iteratee(iterable[key],key,iterable)}}var index=findIndexFunc(collection,predicate,fromIndex);return index>-1?iterable[iteratee?collection[index]:index]:void 0}}(findIndex);memoize.Cache=MapCache;var isArray=Array.isArray,isTypedArray=nodeIsTypedArray?function(func){return function(value){return func(value)}}(nodeIsTypedArray):baseIsTypedArray;module.exports=find}).call(exports,__webpack_require__(3),__webpack_require__(18)(module))},function(module,exports,__webpack_require__){(function(global,module){function arrayMap(array,iteratee){for(var index=-1,length=array?array.length:0,result=Array(length);++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}function baseGet(object,path){path=isKey(path,object)?[path]:castPath(path);for(var index=0,length=path.length;null!=object&&indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,spreadableSymbol=Symbol?Symbol.isConcatSpreadable:void 0,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet, +SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function has(object,path){return null!=object&&hasPath(object,path,baseHas)}var FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",symbolTag="[object Symbol]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:"" +}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,Map=getNative(root,"Map"),nativeCreate=getNative(Object,"create"),symbolProto=Symbol?Symbol.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var stringToPath=memoize(function(string){string=toString(string);var result=[];return reLeadingDot.test(string)&&result.push(""),string.replace(/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,function(match,number,quote,string){result.push(quote?string.replace(/\\(\\)?/g,"$1"):number||match)}),result});memoize.Cache=MapCache;var isArray=Array.isArray;module.exports=has}).call(exports,__webpack_require__(3))},function(module,exports,__webpack_require__){(function(global,module){function arraySome(array,predicate){for(var index=-1,length=array?array.length:0;++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}var LARGE_ARRAY_SIZE=200,HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&"[object Promise]"!=getTag(Promise.resolve())||Set&&getTag(new Set)!=setTag||WeakMap&&"[object WeakMap]"!=getTag(new WeakMap))&&(getTag=function(value){var result=objectToString.call(value),Ctor=result==objectTag?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):void 0;if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return"[object Promise]";case setCtorString:return setTag;case weakMapCtorString:return"[object WeakMap]"}return result});var isArray=Array.isArray,isTypedArray=nodeIsTypedArray?function(func){return function(value){return func(value)}}(nodeIsTypedArray):baseIsTypedArray;module.exports=isEqualWith}).call(exports,__webpack_require__(3),__webpack_require__(18)(module))},function(module,exports){function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}var funcTag="[object Function]",genTag="[object GeneratorFunction]",objectProto=Object.prototype,objectToString=objectProto.toString;module.exports=isFunction},function(module,exports){function arrayMap(array,iteratee){for(var index=-1,length=array?array.length:0,result=Array(length);++index-1;)seen!==array&&splice.call(seen,fromIndex,1),splice.call(array,fromIndex,1);return array}function copyArray(source,array){var index=-1,length=source.length;for(array||(array=Array(length));++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index-1&&value%1==0&&value-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}function baseGet(object,path){path=isKey(path,object)?[path]:castPath(path);for(var index=0,length=path.length;null!=object&&indexother||valIsSymbol&&othIsDefined&&othIsReflexive&&!othIsNull&&!othIsSymbol||valIsNull&&othIsDefined&&othIsReflexive||!valIsDefined&&othIsReflexive||!valIsReflexive)return 1;if(!valIsNull&&!valIsSymbol&&!othIsSymbol&&value=ordersLength)return result;return result*("desc"==orders[index]?-1:1)}}return object.index-other.index}function equalArrays(array,other,equalFunc,customizer,bitmask,stack){var isPartial=bitmask&PARTIAL_COMPARE_FLAG,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,spreadableSymbol=Symbol?Symbol.isConcatSpreadable:void 0,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),nativeMax=Math.max,DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index1&&isIterateeCall(collection,iteratees[0],iteratees[1])?iteratees=[]:length>2&&isIterateeCall(iteratees[0],iteratees[1],iteratees[2])&&(iteratees=[iteratees[0]]),baseOrderBy(collection,baseFlatten(iteratees,1),[])});memoize.Cache=MapCache;var isArray=Array.isArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;module.exports=sortBy}).call(exports,__webpack_require__(3),__webpack_require__(18)(module))},function(module,exports,__webpack_require__){(function(global){function debounce(func,wait,options){function invokeFunc(time){var args=lastArgs,thisArg=lastThis;return lastArgs=lastThis=void 0,lastInvokeTime=time,result=func.apply(thisArg,args)}function leadingEdge(time){return lastInvokeTime=time,timerId=setTimeout(timerExpired,wait),leading?invokeFunc(time):result}function remainingWait(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime,result=wait-timeSinceLastCall;return maxing?nativeMin(result,maxWait-timeSinceLastInvoke):result}function shouldInvoke(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime;return void 0===lastCallTime||timeSinceLastCall>=wait||timeSinceLastCall<0||maxing&&timeSinceLastInvoke>=maxWait}function timerExpired(){var time=now();if(shouldInvoke(time))return trailingEdge(time);timerId=setTimeout(timerExpired,remainingWait(time))}function trailingEdge(time){return timerId=void 0,trailing&&lastArgs?invokeFunc(time):(lastArgs=lastThis=void 0,result)}function cancel(){void 0!==timerId&&clearTimeout(timerId),lastInvokeTime=0,lastArgs=lastCallTime=lastThis=timerId=void 0}function flush(){return void 0===timerId?result:trailingEdge(now())}function debounced(){var time=now(),isInvoking=shouldInvoke(time);if(lastArgs=arguments,lastThis=this,lastCallTime=time,isInvoking){if(void 0===timerId)return leadingEdge(lastCallTime);if(maxing)return timerId=setTimeout(timerExpired,wait),invokeFunc(lastCallTime)}return void 0===timerId&&(timerId=setTimeout(timerExpired,wait)),result}var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime=0,leading=!1,maxing=!1,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return wait=toNumber(wait)||0,isObject(options)&&(leading=!!options.leading,maxing="maxWait"in options,maxWait=maxing?nativeMax(toNumber(options.maxWait)||0,wait):maxWait,trailing="trailing"in options?!!options.trailing:trailing),debounced.cancel=cancel,debounced.flush=flush,debounced}function throttle(func,wait,options){var leading=!0,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return isObject(options)&&(leading="leading"in options?!!options.leading:leading,trailing="trailing"in options?!!options.trailing:trailing),debounce(func,wait,{leading:leading,maxWait:wait,trailing:trailing})}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}var FUNC_ERROR_TEXT="Expected a function",NAN=NaN,symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),objectProto=Object.prototype,objectToString=objectProto.toString,nativeMax=Math.max,nativeMin=Math.min,now=function(){return root.Date.now()};module.exports=throttle}).call(exports,__webpack_require__(3))},function(module,exports,__webpack_require__){(function(global,module){function arrayIncludes(array,value){return!!(array?array.length:0)&&baseIndexOf(array,value,0)>-1}function arrayIncludesWith(array,value,comparator){for(var index=-1,length=array?array.length:0;++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function noop(){}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var createSet=Set&&1/setToArray(new Set([,-0]))[1]==INFINITY?function(values){return new Set(values)}:noop,getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&"[object Promise]"!=getTag(Promise.resolve())||Set&&getTag(new Set)!=setTag||WeakMap&&"[object WeakMap]"!=getTag(new WeakMap))&&(getTag=function(value){var result=objectToString.call(value),Ctor=result==objectTag?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):void 0;if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return"[object Promise]";case setCtorString:return setTag;case weakMapCtorString:return"[object WeakMap]"}return result});var stringToPath=memoize(function(string){string=toString(string);var result=[];return reLeadingDot.test(string)&&result.push(""),string.replace(/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,function(match,number,quote,string){result.push(quote?string.replace(/\\(\\)?/g,"$1"):number||match)}),result});memoize.Cache=MapCache;var isArray=Array.isArray,isTypedArray=nodeIsTypedArray?function(func){return function(value){return func(value)}}(nodeIsTypedArray):baseIsTypedArray;module.exports=uniqBy}).call(exports,__webpack_require__(3),__webpack_require__(18)(module))},function(module,exports,__webpack_require__){(function(global){function arrayIncludes(array,value){return!!(array?array.length:0)&&baseIndexOf(array,value,0)>-1}function arrayIncludesWith(array,value,comparator){for(var index=-1,length=array?array.length:0;++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++index-1&&value%1==0&&valueb?1:0};var lowerBoundKey=exports.lowerBoundKey=function(range){return hasKey(range,"gt")||hasKey(range,"gte")||hasKey(range,"min")||(range.reverse?hasKey(range,"end"):hasKey(range,"start"))||void 0},lowerBound=exports.lowerBound=function(range,def){var k=lowerBoundKey(range);return k?range[k]:def},lowerBoundInclusive=exports.lowerBoundInclusive=function(range){return!has(range,"gt")},upperBoundInclusive=exports.upperBoundInclusive=function(range){return!has(range,"lt")},lowerBoundExclusive=exports.lowerBoundExclusive=function(range){return!lowerBoundInclusive(range)},upperBoundExclusive=exports.upperBoundExclusive=function(range){return!upperBoundInclusive(range)},upperBoundKey=exports.upperBoundKey=function(range){return hasKey(range,"lt")||hasKey(range,"lte")||hasKey(range,"max")||(range.reverse?hasKey(range,"start"):hasKey(range,"end"))||void 0},upperBound=exports.upperBound=function(range,def){var k=upperBoundKey(range);return k?range[k]:def};exports.start=function(range,def){return range.reverse?upperBound(range,def):lowerBound(range,def)},exports.end=function(range,def){return range.reverse?lowerBound(range,def):upperBound(range,def)},exports.startInclusive=function(range){return range.reverse?upperBoundInclusive(range):lowerBoundInclusive(range)},exports.endInclusive=function(range){return range.reverse?lowerBoundInclusive(range):upperBoundInclusive(range)},exports.toLtgt=function(range,_range,map,lower,upper){_range=_range||{},map=map||id;var defaults=arguments.length>3,lb=exports.lowerBoundKey(range),ub=exports.upperBoundKey(range);return lb?"gt"===lb?_range.gt=map(range.gt,!1):_range.gte=map(range[lb],!1):defaults&&(_range.gte=map(lower,!1)),ub?"lt"===ub?_range.lt=map(range.lt,!0):_range.lte=map(range[ub],!0):defaults&&(_range.lte=map(upper,!0)),null!=range.reverse&&(_range.reverse=!!range.reverse),has(_range,"max")&&delete _range.max,has(_range,"min")&&delete _range.min,has(_range,"start")&&delete _range.start,has(_range,"end")&&delete _range.end,_range},exports.contains=function(range,key,compare){compare=compare||exports.compare;var lb=lowerBound(range);if(isDef(lb)){var cmp=compare(key,lb);if(cmp<0||0===cmp&&lowerBoundExclusive(range))return!1}var ub=upperBound(range);if(isDef(ub)){var cmp=compare(key,ub);if(cmp>0||0===cmp&&upperBoundExclusive(range))return!1}return!0},exports.filter=function(range,compare){return function(key){return exports.contains(range,key,compare)}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function MD5(){HashBase.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function rotl(x,n){return x<>>32-n}function fnF(a,b,c,d,m,k,s){return rotl(a+(b&c|~b&d)+m+k|0,s)+b|0}function fnG(a,b,c,d,m,k,s){return rotl(a+(b&d|c&~d)+m+k|0,s)+b|0}function fnH(a,b,c,d,m,k,s){return rotl(a+(b^c^d)+m+k|0,s)+b|0}function fnI(a,b,c,d,m,k,s){return rotl(a+(c^(b|~d))+m+k|0,s)+b|0}var inherits=__webpack_require__(2),HashBase=__webpack_require__(575),ARRAY16=new Array(16);inherits(MD5,HashBase),MD5.prototype._update=function(){for(var M=ARRAY16,i=0;i<16;++i)M[i]=this._block.readInt32LE(4*i);var a=this._a,b=this._b,c=this._c,d=this._d;a=fnF(a,b,c,d,M[0],3614090360,7),d=fnF(d,a,b,c,M[1],3905402710,12),c=fnF(c,d,a,b,M[2],606105819,17),b=fnF(b,c,d,a,M[3],3250441966,22),a=fnF(a,b,c,d,M[4],4118548399,7),d=fnF(d,a,b,c,M[5],1200080426,12),c=fnF(c,d,a,b,M[6],2821735955,17),b=fnF(b,c,d,a,M[7],4249261313,22),a=fnF(a,b,c,d,M[8],1770035416,7),d=fnF(d,a,b,c,M[9],2336552879,12),c=fnF(c,d,a,b,M[10],4294925233,17),b=fnF(b,c,d,a,M[11],2304563134,22),a=fnF(a,b,c,d,M[12],1804603682,7),d=fnF(d,a,b,c,M[13],4254626195,12),c=fnF(c,d,a,b,M[14],2792965006,17),b=fnF(b,c,d,a,M[15],1236535329,22),a=fnG(a,b,c,d,M[1],4129170786,5),d=fnG(d,a,b,c,M[6],3225465664,9),c=fnG(c,d,a,b,M[11],643717713,14),b=fnG(b,c,d,a,M[0],3921069994,20),a=fnG(a,b,c,d,M[5],3593408605,5),d=fnG(d,a,b,c,M[10],38016083,9),c=fnG(c,d,a,b,M[15],3634488961,14),b=fnG(b,c,d,a,M[4],3889429448,20),a=fnG(a,b,c,d,M[9],568446438,5),d=fnG(d,a,b,c,M[14],3275163606,9),c=fnG(c,d,a,b,M[3],4107603335,14),b=fnG(b,c,d,a,M[8],1163531501,20),a=fnG(a,b,c,d,M[13],2850285829,5),d=fnG(d,a,b,c,M[2],4243563512,9),c=fnG(c,d,a,b,M[7],1735328473,14),b=fnG(b,c,d,a,M[12],2368359562,20),a=fnH(a,b,c,d,M[5],4294588738,4),d=fnH(d,a,b,c,M[8],2272392833,11),c=fnH(c,d,a,b,M[11],1839030562,16),b=fnH(b,c,d,a,M[14],4259657740,23),a=fnH(a,b,c,d,M[1],2763975236,4),d=fnH(d,a,b,c,M[4],1272893353,11),c=fnH(c,d,a,b,M[7],4139469664,16),b=fnH(b,c,d,a,M[10],3200236656,23),a=fnH(a,b,c,d,M[13],681279174,4),d=fnH(d,a,b,c,M[0],3936430074,11),c=fnH(c,d,a,b,M[3],3572445317,16),b=fnH(b,c,d,a,M[6],76029189,23),a=fnH(a,b,c,d,M[9],3654602809,4),d=fnH(d,a,b,c,M[12],3873151461,11),c=fnH(c,d,a,b,M[15],530742520,16),b=fnH(b,c,d,a,M[2],3299628645,23),a=fnI(a,b,c,d,M[0],4096336452,6),d=fnI(d,a,b,c,M[7],1126891415,10),c=fnI(c,d,a,b,M[14],2878612391,15),b=fnI(b,c,d,a,M[5],4237533241,21),a=fnI(a,b,c,d,M[12],1700485571,6),d=fnI(d,a,b,c,M[3],2399980690,10),c=fnI(c,d,a,b,M[10],4293915773,15),b=fnI(b,c,d,a,M[1],2240044497,21),a=fnI(a,b,c,d,M[8],1873313359,6),d=fnI(d,a,b,c,M[15],4264355552,10),c=fnI(c,d,a,b,M[6],2734768916,15),b=fnI(b,c,d,a,M[13],1309151649,21),a=fnI(a,b,c,d,M[4],4149444226,6),d=fnI(d,a,b,c,M[11],3174756917,10),c=fnI(c,d,a,b,M[2],718787259,15),b=fnI(b,c,d,a,M[9],3951481745,21),this._a=this._a+a|0,this._b=this._b+b|0,this._c=this._c+c|0,this._d=this._d+d|0},MD5.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var buffer=new Buffer(16);return buffer.writeInt32LE(this._a,0),buffer.writeInt32LE(this._b,4),buffer.writeInt32LE(this._c,8),buffer.writeInt32LE(this._d,12),buffer},module.exports=MD5}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function throwIfNotStringOrBuffer(val,prefix){if(!Buffer.isBuffer(val)&&"string"!=typeof val)throw new TypeError(prefix+" must be a string or a buffer")}function HashBase(blockSize){Transform.call(this),this._block=Buffer.allocUnsafe(blockSize),this._blockSize=blockSize,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}var Buffer=__webpack_require__(5).Buffer,Transform=__webpack_require__(25).Transform;__webpack_require__(2)(HashBase,Transform),HashBase.prototype._transform=function(chunk,encoding,callback){var error=null;try{this.update(chunk,encoding)}catch(err){error=err}callback(error)},HashBase.prototype._flush=function(callback){var error=null;try{this.push(this.digest())}catch(err){error=err}callback(error)},HashBase.prototype.update=function(data,encoding){if(throwIfNotStringOrBuffer(data,"Data"),this._finalized)throw new Error("Digest already called");Buffer.isBuffer(data)||(data=Buffer.from(data,encoding));for(var block=this._block,offset=0;this._blockOffset+data.length-offset>=this._blockSize;){for(var i=this._blockOffset;i0;++j)this._length[j]+=carry,(carry=this._length[j]/4294967296|0)>0&&(this._length[j]-=4294967296*carry);return this},HashBase.prototype._update=function(){throw new Error("_update is not implemented")},HashBase.prototype.digest=function(encoding){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var digest=this._digest();void 0!==encoding&&(digest=digest.toString(encoding)),this._block.fill(0),this._blockOffset=0;for(var i=0;i<4;++i)this._length[i]=0;return digest},HashBase.prototype._digest=function(){throw new Error("_digest is not implemented")},module.exports=HashBase},function(module,exports,__webpack_require__){(function(Buffer){function TrieNode(type,key,value){if(Array.isArray(type))this.parseNode(type);else if(this.type=type,"branch"===type){var values=key;this.raw=Array.apply(null,Array(17)),values&&values.forEach(function(keyVal){this.set.apply(this,keyVal)})}else this.raw=Array(2),this.setValue(value),this.setKey(key)}function addHexPrefix(key,terminator){return key.length%2?key.unshift(1):(key.unshift(0),key.unshift(0)),terminator&&(key[0]+=2),key}function removeHexPrefix(val){return val=val[0]%2?val.slice(1):val.slice(2)}function isTerminator(key){return key[0]>1}function stringToNibbles(key){for(var bkey=new Buffer(key),nibbles=[],i=0;i>4,++q,nibbles[q]=bkey[i]%16}return nibbles}function nibblesToBuffer(arr){for(var buf=new Buffer(arr.length/2),i=0;i=parts.length)throw ParseError("invalid address: "+str);tuples.push([part,parts[p]])}else tuples.push([part])}return tuples}function stringTuplesToString(tuples){const parts=[];return map(tuples,function(tup){const proto=protoFromTuple(tup);parts.push(proto.name),tup.length>1&&parts.push(tup[1])}),"/"+parts.join("/")}function stringTuplesToTuples(tuples){return map(tuples,function(tup){Array.isArray(tup)||(tup=[tup]);const proto=protoFromTuple(tup);return tup.length>1?[proto.code,convert.toBuffer(proto.code,tup[1])]:[proto.code]})}function tuplesToStringTuples(tuples){return map(tuples,function(tup){const proto=protoFromTuple(tup);return tup.length>1?[proto.code,convert.toString(proto.code,tup[1])]:[proto.code]})}function tuplesToBuffer(tuples){return fromBuffer(Buffer.concat(map(tuples,function(tup){const proto=protoFromTuple(tup);let buf=new Buffer(varint.encode(proto.code));return tup.length>1&&(buf=Buffer.concat([buf,tup[1]])),buf})))}function sizeForAddr(p,addr){if(p.size>0)return p.size/8;if(0===p.size)return 0;{const size=varint.decode(addr);return size+varint.decode.bytes}}function bufferToTuples(buf){const tuples=[];let i=0;for(;ibuf.length)throw ParseError("Invalid address buffer: "+buf.toString("hex"));tuples.push([code,addr])}else tuples.push([code]),i+=n}return tuples}function bufferToString(buf){return stringTuplesToString(tuplesToStringTuples(bufferToTuples(buf)))}function stringToBuffer(str){return str=cleanPath(str),tuplesToBuffer(stringTuplesToTuples(stringToStringTuples(str)))}function fromString(str){return stringToBuffer(str)}function fromBuffer(buf){const err=validateBuffer(buf);if(err)throw err;return new Buffer(buf)}function validateBuffer(buf){try{bufferToTuples(buf)}catch(err){return err}}function isValidBuffer(buf){return void 0===validateBuffer(buf)}function cleanPath(str){return"/"+filter(str.trim().split("/")).join("/")}function ParseError(str){return new Error("Error parsing address: "+str)}function protoFromTuple(tup){return protocols(tup[0])}const map=__webpack_require__(133),filter=__webpack_require__(534),convert=__webpack_require__(578),protocols=__webpack_require__(138),varint=__webpack_require__(14);module.exports={stringToStringTuples:stringToStringTuples,stringTuplesToString:stringTuplesToString,tuplesToStringTuples:tuplesToStringTuples,stringTuplesToTuples:stringTuplesToTuples,bufferToTuples:bufferToTuples,tuplesToBuffer:tuplesToBuffer,bufferToString:bufferToString,stringToBuffer:stringToBuffer,fromString:fromString,fromBuffer:fromBuffer,validateBuffer:validateBuffer,isValidBuffer:isValidBuffer,cleanPath:cleanPath,ParseError:ParseError,protoFromTuple:protoFromTuple,sizeForAddr:sizeForAddr}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function Convert(proto,a){return a instanceof Buffer?Convert.toString(proto,a):Convert.toBuffer(proto,a)}function port2buf(port){const buf=new Buffer(2);return buf.writeUInt16BE(port,0),buf}function buf2port(buf){return buf.readUInt16BE(0)}function str2buf(str){const buf=new Buffer(str),size=new Buffer(varint.encode(buf.length));return Buffer.concat([size,buf])}function buf2str(buf){const size=varint.decode(buf);if(buf=buf.slice(varint.decode.bytes),buf.length!==size)throw new Error("inconsistent lengths");return buf.toString()}function mh2buf(hash){const mh=new Buffer(bs58.decode(hash)),size=new Buffer(varint.encode(mh.length));return Buffer.concat([size,mh])}function buf2mh(buf){const size=varint.decode(buf),address=buf.slice(varint.decode.bytes);if(address.length!==size)throw new Error("inconsistent lengths");return bs58.encode(address)}const ip=__webpack_require__(392),protocols=__webpack_require__(138),bs58=__webpack_require__(81),varint=__webpack_require__(14);module.exports=Convert,Convert.toString=function(proto,buf){switch(proto=protocols(proto),proto.code){case 4:case 41:return ip.toString(buf);case 6:case 17:case 33:case 132:return buf2port(buf);case 53:case 54:case 55:return buf2str(buf);case 421:return buf2mh(buf);default:return buf.toString("hex")}},Convert.toBuffer=function(proto,str){switch(proto=protocols(proto),proto.code){case 4:case 41:return ip.toBuffer(str);case 6:case 17:case 33:case 132:return port2buf(parseInt(str,10));case 53:case 54:case 55:return str2buf(str);case 421:return mh2buf(str);default:return new Buffer(str,"hex")}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";class Base{constructor(name,code,implementation,alphabet){this.name=name,this.code=code,this.alphabet=alphabet,implementation&&alphabet&&(this.engine=implementation(alphabet))}encode(stringOrBuffer){return this.engine.encode(stringOrBuffer)}decode(stringOrBuffer){return this.engine.decode(stringOrBuffer)}isImplemented(){return this.engine}}module.exports=Base},function(module,exports,__webpack_require__){"use strict";(function(Buffer){module.exports=function(alphabet){return{encode(input){return"string"==typeof input?new Buffer(input).toString("hex"):input.toString("hex")},decode(input){for(let char of input)if(alphabet.indexOf(char)<0)throw new Error("invalid base16 character");return new Buffer(input,"hex")}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const Base=__webpack_require__(579),baseX=__webpack_require__(309),base16=__webpack_require__(580),constants=[["base1","1","","1"],["base2","0",baseX,"01"],["base8","7",baseX,"01234567"],["base10","9",baseX,"0123456789"],["base16","f",base16,"0123456789abcdef"],["base32hex","v",baseX,"0123456789abcdefghijklmnopqrstuv"],["base32","b",baseX,"abcdefghijklmnopqrstuvwxyz234567"],["base32z","h",baseX,"ybndrfg8ejkmcpqxot1uwisza345h769"],["base58flickr","Z",baseX,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base58btc","z",baseX,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base64","m",baseX,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64url","u",baseX,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"]],names=constants.reduce((prev,tupple)=>{return prev[tupple[0]]=new Base(tupple[0],tupple[1],tupple[2],tupple[3]),prev},{}),codes=constants.reduce((prev,tupple)=>{return prev[tupple[1]]=names[tupple[0]],prev},{});module.exports={names:names,codes:codes}},function(module,exports,__webpack_require__){"use strict";exports.names={sha1:17,"sha2-256":18,"sha2-512":19,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,"murmur3-128":34,"murmur3-32":35,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664},exports.codes={17:"sha1",18:"sha2-256",19:"sha2-512",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384",29:"keccak-512",34:"murmur3-128",35:"murmur3-32",45569:"blake2b-8",45570:"blake2b-16",45571:"blake2b-24",45572:"blake2b-32",45573:"blake2b-40",45574:"blake2b-48",45575:"blake2b-56",45576:"blake2b-64",45577:"blake2b-72",45578:"blake2b-80",45579:"blake2b-88",45580:"blake2b-96",45581:"blake2b-104",45582:"blake2b-112",45583:"blake2b-120",45584:"blake2b-128",45585:"blake2b-136",45586:"blake2b-144",45587:"blake2b-152",45588:"blake2b-160",45589:"blake2b-168",45590:"blake2b-176",45591:"blake2b-184",45592:"blake2b-192",45593:"blake2b-200",45594:"blake2b-208",45595:"blake2b-216",45596:"blake2b-224",45597:"blake2b-232",45598:"blake2b-240",45599:"blake2b-248",45600:"blake2b-256",45601:"blake2b-264",45602:"blake2b-272",45603:"blake2b-280",45604:"blake2b-288",45605:"blake2b-296",45606:"blake2b-304",45607:"blake2b-312",45608:"blake2b-320",45609:"blake2b-328",45610:"blake2b-336",45611:"blake2b-344",45612:"blake2b-352",45613:"blake2b-360",45614:"blake2b-368",45615:"blake2b-376",45616:"blake2b-384",45617:"blake2b-392",45618:"blake2b-400",45619:"blake2b-408",45620:"blake2b-416",45621:"blake2b-424",45622:"blake2b-432",45623:"blake2b-440",45624:"blake2b-448",45625:"blake2b-456",45626:"blake2b-464",45627:"blake2b-472",45628:"blake2b-480",45629:"blake2b-488",45630:"blake2b-496",45631:"blake2b-504",45632:"blake2b-512",45633:"blake2s-8",45634:"blake2s-16",45635:"blake2s-24",45636:"blake2s-32",45637:"blake2s-40",45638:"blake2s-48",45639:"blake2s-56",45640:"blake2s-64",45641:"blake2s-72",45642:"blake2s-80",45643:"blake2s-88",45644:"blake2s-96",45645:"blake2s-104",45646:"blake2s-112",45647:"blake2s-120",45648:"blake2s-128",45649:"blake2s-136",45650:"blake2s-144",45651:"blake2s-152",45652:"blake2s-160",45653:"blake2s-168",45654:"blake2s-176",45655:"blake2s-184",45656:"blake2s-192",45657:"blake2s-200",45658:"blake2s-208",45659:"blake2s-216",45660:"blake2s-224",45661:"blake2s-232",45662:"blake2s-240",45663:"blake2s-248",45664:"blake2s-256"},exports.defaultLengths={17:20,18:32,19:64,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,45569:1,45570:2,45571:3,45572:4,45573:5,45574:6,45575:7,45576:8,45577:9,45578:10,45579:11,45580:12,45581:13,45582:14,45583:15,45584:16,45585:17,45586:18,45587:19,45588:20,45589:21,45590:22,45591:23,45592:24,45593:25,45594:26,45595:27,45596:28,45597:29,45598:30,45599:31,45600:32,45601:33,45602:34,45603:35,45604:36,45605:37,45606:38,45607:39,45608:40,45609:41,45610:42,45611:43,45612:44,45613:45,45614:46,45615:47,45616:48,45617:49,45618:50,45619:51,45620:52,45621:53,45622:54,45623:55,45624:56,45625:57,45626:58,45627:59,45628:60,45629:61,45630:62,45631:63,45632:64,45633:1,45634:2,45635:3,45636:4,45637:5,45638:6,45639:7,45640:8,45641:9,45642:10,45643:11,45644:12,45645:13,45646:14,45647:15,45648:16,45649:17,45650:18,45651:19,45652:20,45653:21,45654:22,45655:23,45656:24,45657:25,45658:26,45659:27,45660:28,45661:29,45662:30,45663:31,45664:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const blake=__webpack_require__(316),toCallback=__webpack_require__(246).toCallback,blake2b={init:blake.blake2bInit,update:blake.blake2bUpdate,digest:blake.blake2bFinal},blake2s={init:blake.blake2sInit,update:blake.blake2sUpdate,digest:blake.blake2sFinal},makeB2Hash=(size,hf)=>toCallback(buf=>{const ctx=hf.init(size,null);return hf.update(ctx,buf),new Buffer(hf.digest(ctx))});module.exports=(table=>{for(let i=0;i<64;i++)table[45569+i]=makeB2Hash(i+1,blake2b);for(let i=0;i<32;i++)table[45633+i]=makeB2Hash(i+1,blake2s)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function webCryptoHash(type){if(!webCrypto)throw new Error("Please use a browser with webcrypto support");return(data,callback)=>{const res=webCrypto.digest({name:type},data);if("function"!=typeof res.then)return res.onerror=(()=>{callback(`Error hashing data using ${type}`)}),void(res.oncomplete=(e=>{callback(null,e.target.result)}));nodeify(res.then(raw=>new Buffer(new Uint8Array(raw))),callback)}}function sha1(buf,callback){webCryptoHash("SHA-1")(buf,callback)}function sha2256(buf,callback){webCryptoHash("SHA-256")(buf,callback)}function sha2512(buf,callback){webCryptoHash("SHA-512")(buf,callback)}const nodeify=__webpack_require__(96),webCrypto=function(){return self.crypto?self.crypto.subtle||self.crypto.webkitSubtle:self.msCrypto?self.msCrypto.subtle:void 0}();module.exports={sha1:sha1,sha2256:sha2256,sha2512:sha2512}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const sha3=__webpack_require__(458),murmur3=__webpack_require__(600),utils=__webpack_require__(246),sha=__webpack_require__(584),toCallback=utils.toCallback,toBuf=utils.toBuf,fromString=utils.fromString,fromNumberTo32BitBuf=utils.fromNumberTo32BitBuf;module.exports={sha1:sha.sha1,sha2256:sha.sha2256,sha2512:sha.sha2512,sha3512:toCallback(toBuf(sha3.sha3_512)),sha3384:toCallback(toBuf(sha3.sha3_384)),sha3256:toCallback(toBuf(sha3.sha3_256)),sha3224:toCallback(toBuf(sha3.sha3_224)),shake128:toCallback(toBuf(sha3.shake_128,256)),shake256:toCallback(toBuf(sha3.shake_256,512)),keccak224:toCallback(toBuf(sha3.keccak_224)),keccak256:toCallback(toBuf(sha3.keccak_256)),keccak384:toCallback(toBuf(sha3.keccak_384)),keccak512:toCallback(toBuf(sha3.keccak_512)),murmur3128:toCallback(toBuf(fromString(murmur3.x64.hash128))),murmur332:toCallback(fromNumberTo32BitBuf(fromString(murmur3.x86.hash32))),addBlake:__webpack_require__(583)}},function(module,exports,__webpack_require__){function selectColor(namespace){var i,hash=0;for(i in namespace)hash=(hash<<5)-hash+namespace.charCodeAt(i),hash|=0;return exports.colors[Math.abs(hash)%exports.colors.length]}function createDebug(namespace){function debug(){if(debug.enabled){var self=debug,curr=+new Date,ms=curr-(prevTime||curr);self.diff=ms,self.prev=prevTime,self.curr=curr,prevTime=curr;for(var args=new Array(arguments.length),i=0;i=l)return read.bytes=0,void(read.bytesRead=0);b=buf[counter++],res+=shift<28?(b&REST)<=MSB);return read.bytes=counter-offset,res}module.exports=read;var MSB=128,REST=127},function(module,exports){function encode(num,out,offset){out=out||[],offset=offset||0;for(var oldOffset=offset;num>=INT;)out[offset++]=255&num|MSB,num/=128;for(;num&MSBALL;)out[offset++]=255&num|MSB,num>>>=7;return out[offset]=0|num,encode.bytes=offset-oldOffset+1,out}module.exports=encode;var MSB=128,MSBALL=-128,INT=Math.pow(2,31)},function(module,exports,__webpack_require__){module.exports={encode:__webpack_require__(588),decode:__webpack_require__(587),encodingLength:__webpack_require__(590)}},function(module,exports){var N1=Math.pow(2,7),N2=Math.pow(2,14),N3=Math.pow(2,21),N4=Math.pow(2,28),N5=Math.pow(2,35),N6=Math.pow(2,42),N7=Math.pow(2,49),N8=Math.pow(2,56),N9=Math.pow(2,63);module.exports=function(value){return value{this.log("end"),this._read(),this.destroyed||(ended=!0,finished?this._finalize():this.halfOpen||this.end())}),this.once("finish",function onfinish(){if(!this.destroyed){if(!this._opened)return this.once("open",onfinish);this._lazy&&this.initiator&&this._open(),this._multiplex._send(this.channel<<3|(this.initiator?4:3),null),finished=!0,ended&&this._finalize()}})}destroy(err){this._destroy(err,!0)}_destroy(err,local){if(this.log("_destroy:"+(local?"local":"remote")),this.destroyed)return void this.log("already destroyed");this.destroyed=!0;const hasErrorListeners=EventEmitter.listenerCount(this,"error")>0;if(!err||local&&!hasErrorListeners||this.emit("error",err),this.emit("close"),local&&this._opened){this._lazy&&this.initiator&&this._open();const msg=err?new Buffer(err.message):null;try{this._multiplex._send(this.channel<<3|(this.initiator?6:5),msg)}catch(e){}}this._finalize()}_finalize(){this.finalized||(this.finalized=!0,this.emit("finalize"))}_write(data,enc,cb){return this.log("write: ",data.length),this._opened?this.destroyed?void cb():(this._lazy&&this.initiator&&this._open(),this._multiplex._send(this._dataHeader,data)?void cb():void this._multiplex._ondrain.push(cb)):void this.once("open",()=>{this._write(data,enc,cb)})}_read(){if(this._awaitDrain){const drained=this._awaitDrain;this._awaitDrain=0,this._multiplex._onchanneldrain(drained)}} +_open(){let buf=null;Buffer.isBuffer(this.name)?buf=this.name:this.name!==this.channel.toString()&&(buf=new Buffer(this.name)),this._lazy=!1,this._multiplex._send(this.channel<<3|0,buf)}open(channel,initiator){this.log("open: "+channel),this.channel=channel,this.initiator=initiator,this._dataHeader=channel<<3|(initiator?2:1),this._opened=!0,!this._lazy&&this.initiator&&this._open(),this.emit("open")}}module.exports=Channel}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const stream=__webpack_require__(37),varint=__webpack_require__(589),duplexify=__webpack_require__(344),debug=__webpack_require__(247),Channel=__webpack_require__(591),SIGNAL_FLUSH=new Buffer([0]),empty=new Buffer(0);let pool=new Buffer(10240),used=0;class Multiplex extends stream.Duplex{constructor(opts,onchannel){super(),"function"==typeof opts&&(onchannel=opts,opts={}),opts||(opts={}),onchannel&&this.on("stream",onchannel),this.destroyed=!1,this.limit=opts.limit||0,null==opts.initiator&&(opts.initiator=!0),this.initiator=opts.initiator,this._corked=0,this._options=opts,this._binaryName=Boolean(opts.binaryName),this._local=[],this._remote=[],this._list=this._local,this._receiving=null,this._chunked=!1,this._state=0,this._type=0,this._channel=0,this._missing=0,this._message=null,this.log=debug("mplex:main:"+Math.floor(1e5*Math.random())),this.log("construction");let bufSize=100;this.limit&&(bufSize=varint.encodingLength(this.limit)),this._buf=new Buffer(bufSize),this._ptr=0,this._awaitChannelDrains=0,this._onwritedrain=null,this._ondrain=[],this._finished=!1,this.once("finish",this._clear),this._nextId=this.initiator?0:1}_nextStreamId(){let id=this._nextId;return this._nextId+=2,id}createStream(name,opts){if(this.destroyed)throw new Error("Multiplexer is destroyed");const id=this._nextStreamId();let channelName=this._name(name||id.toString());const options=Object.assign(this._options,opts);this.log("createStream: %s",id,channelName.toString(),options);const channel=new Channel(channelName,this,options);return this._addChannel(channel,id,this._local)}receiveStream(name,opts){if(this.destroyed)throw new Error("Multiplexer is destroyed");if(void 0===name||null===name)throw new Error("Name is needed when receiving a stream");const channelName=this._name(name);this.log("receiveStream: "+channelName.toString());const channel=new Channel(channelName,this,Object.assign(this._options,opts));if(this._receiving||(this._receiving={}),this._receiving[channel.name])throw new Error("You are already receiving this stream");return this._receiving[channel.name]=channel,channel}createSharedStream(name,opts){return this.log("createSharedStream"),duplexify(this.createStream(name,Object.assign(opts,{lazy:!0})),this.receiveStream(name,opts))}_name(name){return this._binaryName?Buffer.isBuffer(name)?name:new Buffer(name):name.toString()}_send(header,data){const len=data?data.length:0,oldUsed=used;let drained=!0;return this.log("_send",header,len),varint.encode(header,pool,used),used+=varint.encode.bytes,varint.encode(len,pool,used),used+=varint.encode.bytes,drained=this.push(pool.slice(oldUsed,used)),pool.length-used<100&&(pool=new Buffer(10240),used=0),data&&(drained=this.push(data)),drained}_addChannel(channel,id,list){return this.log("_addChannel",id),list[id]=channel,channel.on("finalize",()=>{this.log("_remove channel",id),list[id]=null}),channel.open(id,list===this._local),channel}_writeVarint(data,offset){for(offset;offset>3,this._list=1&this._type?this._local:this._remote;const chunked=this._list.length>this._channel&&this._list[this._channel]&&this._list[this._channel].chunked;this._chunked=!(1!==this._type&&2!==this._type)&&chunked}else if(this._missing=varint.decode(this._buf),this.limit&&this._missing>this.limit)return this._lengthError(data);return this._state++,this._ptr=0,offset+1}}return data.length}_lengthError(data){return this.destroy(new Error("Incoming message is too big")),data.length}_writeMessage(data,offset){const free=data.length-offset,missing=this._missing;if(!this._message){if(missing<=free)return this._missing=0,this._push(data.slice(offset,offset+missing)),offset+missing;if(this._chunked)return this._missing-=free,this._push(data.slice(offset,data.length)),data.length;this._message=new Buffer(missing)}return data.copy(this._message,this._ptr,offset,offset+missing),missing<=free?(this._missing=0,this._push(this._message),offset+missing):(this._missing-=free,this._ptr+=free,data.length)}_push(data){if(this.log("_push",data.length),this._missing||(this._ptr=0,this._state=0,this._message=null),0===this._type){if(this.log("open",this._channel),this.destroyed||this._finished)return;let name;name=this._binaryName?data:data.toString()||this._channel.toString(),this.log("open name",name);let channel;return void(this._receiving&&this._receiving[name]?(channel=this._receiving[name],delete this._receiving[name],this._addChannel(channel,this._channel,this._list)):(channel=new Channel(name,this,this._options),this.emit("stream",this._addChannel(channel,this._channel,this._list),channel.name)))}const stream=this._list[this._channel];if(stream)switch(this._type){case 5:case 6:const error=new Error(data.toString()||"Channel destroyed");return void stream._destroy(error,!1);case 3:case 4:return void stream.push(null);case 1:case 2:return void(stream.push(data)||(this._awaitChannelDrains++,stream._awaitDrain++))}}_onchanneldrain(drained){if(this._awaitChannelDrains-=drained,!this._awaitChannelDrains){const ondrain=this._onwritedrain;this._onwritedrain=null,ondrain&&ondrain()}}_write(data,enc,cb){if(this.log("_write",data.length),this._finished)return void cb();if(this._corked)return void this._onuncork(this._write.bind(this,data,enc,cb));if(data===SIGNAL_FLUSH)return void this._finish(cb);let offset=0;for(;offset{this._writableState.prefinished===!1&&(this._writableState.prefinished=!0),this.emit("prefinish"),this._onuncork(cb)})}cork(){1==++this._corked&&this.emit("cork")}uncork(){this._corked&&0==--this._corked&&this.emit("uncork")}end(data,enc,cb){return this.log("end"),"function"==typeof data&&(cb=data,data=void 0),"function"==typeof enc&&(cb=enc,enc=void 0),data&&this.write(data),this._writableState.ending||this.write(SIGNAL_FLUSH),stream.Writable.prototype.end.call(this,cb)}_onuncork(fn){if(this._corked)return void this.once("uncork",fn);fn()}_read(){for(;this._ondrain.length;)this._ondrain.shift()()}_clear(){if(this.log("_clear"),!this._finished){this._finished=!0;const list=this._local.concat(this._remote);this._local=[],this._remote=[],list.forEach(function(stream){stream&&stream._destroy(null,!1)}),this.push(null)}}finalize(){this._clear()}destroy(err){if(this.log("destroy"),this.destroyed)return void this.log("already destroyed");var list=this._local.concat(this._remote);this.destroyed=!0,err&&this.emit("error",err),this.emit("close"),list.forEach(function(stream){stream&&stream.emit("error",err||new Error("underlying socket has been closed"))}),this._clear()}}module.exports=Multiplex}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(process){function useColors(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(args){var useColors=this.useColors;if(args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff),useColors){var c="color: "+this.color;args.splice(1,0,c,"color: inherit");var index=0,lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){"%%"!==match&&(index++,"%c"===match&&(lastC=index))}),args.splice(lastC,0,c)}}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{null==namespaces?exports.storage.removeItem("debug"):exports.storage.debug=namespaces}catch(e){}}function load(){var r;try{r=exports.storage.debug}catch(e){}return!r&&void 0!==process&&"env"in process&&(r=process.env.DEBUG),r}exports=module.exports=__webpack_require__(594),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],exports.formatters.j=function(v){try{return JSON.stringify(v)}catch(err){return"[UnexpectedJSONParseError]: "+err.message}},exports.enable(load())}).call(exports,__webpack_require__(1))},function(module,exports,__webpack_require__){function selectColor(namespace){var i,hash=0;for(i in namespace)hash=(hash<<5)-hash+namespace.charCodeAt(i),hash|=0;return exports.colors[Math.abs(hash)%exports.colors.length]}function createDebug(namespace){function debug(){if(debug.enabled){var self=debug,curr=+new Date,ms=curr-(prevTime||curr);self.diff=ms,self.prev=prevTime,self.curr=curr,prevTime=curr;for(var args=new Array(arguments.length),i=0;i{return varint.decode(msg),counter=varint.decode(msg,varint.decode.bytes),!0})}const varint=__webpack_require__(14),pull=__webpack_require__(4),pullLP=__webpack_require__(24),Connection=__webpack_require__(29).Connection,util=__webpack_require__(95),select=__webpack_require__(250),once=__webpack_require__(57),PROTOCOL_ID=__webpack_require__(248).PROTOCOL_ID;class Dialer{constructor(){this.conn=null,this.log=util.log.dialer()}handle(rawConn,callback){this.log("dialer handle conn"),callback=once(callback),pull(rawConn,select(PROTOCOL_ID,(err,conn)=>{if(err)return callback(err);this.log("handshake success"),this.conn=new Connection(conn,rawConn),callback()},this.log),rawConn)}select(protocol,callback){if(this.log("dialer select "+protocol),callback=once(callback),!this.conn)return callback(new Error("multistream handshake has not finalized yet"));const s=select(protocol,(err,conn)=>{if(err)return this.conn=new Connection(conn,this.conn),callback(err);callback(null,new Connection(conn,this.conn))},this.log);pull(this.conn,s,this.conn)}ls(callback){callback=once(callback);const lsStream=select("ls",(err,conn)=>{if(err)return callback(err);pull(conn,pullLP.decode(),collectLs(conn),pull.map(stringify),pull.collect((err,list)=>{if(err)return callback(err);callback(null,list.slice(1))}))},this.log);pull(this.conn,lsStream,this.conn)}}module.exports=Dialer},function(module,exports,__webpack_require__){"use strict";const pull=__webpack_require__(4),isFunction=__webpack_require__(540),assert=__webpack_require__(9),select=__webpack_require__(250),selectHandler=__webpack_require__(599),lsHandler=__webpack_require__(597),matchExact=__webpack_require__(249),util=__webpack_require__(95),Connection=__webpack_require__(29).Connection,PROTOCOL_ID=__webpack_require__(248).PROTOCOL_ID;class Listener{constructor(){this.handlers={ls:{handlerFunc:(protocol,conn)=>lsHandler(this,conn),matchFunc:matchExact}},this.log=util.log.listener()}handle(rawConn,callback){this.log("listener handle conn"),pull(rawConn,select(PROTOCOL_ID,(err,conn)=>{if(err)return callback(err);const shConn=new Connection(conn,rawConn);pull(shConn,selectHandler(shConn,this.handlers,this.log),shConn),callback()},this.log),rawConn)}addHandler(protocol,handlerFunc,matchFunc){this.log("adding handler: "+protocol),assert(isFunction(handlerFunc),"handler must be a function"),this.handlers[protocol]&&this.log("overwriting handler for "+protocol),matchFunc||(matchFunc=matchExact),this.handlers[protocol]={handlerFunc:handlerFunc,matchFunc:matchFunc}}}module.exports=Listener},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function lsHandler(self,conn){const protos=Object.keys(self.handlers).filter(key=>"ls"!==key),nProtos=protos.length,size=protos.reduce((size,proto)=>{const p=new Buffer(proto+"\n");return size+varint.encodingLength(p.length)},0),buf=Buffer.concat([new Buffer(varint.encode(nProtos)),new Buffer(varint.encode(size)),new Buffer("\n")]),encodedProtos=protos.map(proto=>{return new Buffer(proto+"\n")}),values=[buf].concat(encodedProtos);pull(pull.values(values),pullLP.encode(),conn)}const pull=__webpack_require__(4),pullLP=__webpack_require__(24),varint=__webpack_require__(14);module.exports=lsHandler}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function matchSemver(myProtocol,senderProtocol,callback){const mps=myProtocol.split("/"),sps=senderProtocol.split("/"),myName=mps[1],myVersion=mps[2],senderName=sps[1],senderVersion=sps[2];if(myName!==senderName)return callback(null,!1);callback(null,semver.satisfies(myVersion,"~"+senderVersion))}const semver=__webpack_require__(669);module.exports=matchSemver},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function selectHandler(rawConn,handlersMap,log){function next(){lp.decodeFromReader(shake,(err,data)=>{if(err)return cb(err);log("received:",data.toString());const protocol=data.toString().slice(0,-1);matcher(protocol,handlersMap,(err,result)=>{if(err)return cb(err);const key=result;if(key){log("send ack back of: "+protocol),writeEncoded(shake,data,cb);const conn=new Connection(shake.rest(),rawConn);handlersMap[key].handlerFunc(protocol,conn)}else log("not supported protocol: "+protocol),writeEncoded(shake,new Buffer("na\n")),next()})})}const cb=err=>{log.error(err)},stream=handshake({timeout:6e4},cb),shake=stream.handshake;return next(),stream}function matcher(protocol,handlers,callback){const supportedProtocols=Object.keys(handlers);let supportedProtocol=!1;some(supportedProtocols,(sp,cb)=>{handlers[sp].matchFunc(sp,protocol,(err,result)=>{if(err)return cb(err);result&&(supportedProtocol=sp),cb()})},err=>{if(err)return callback(err);callback(null,supportedProtocol)})}const handshake=__webpack_require__(58),lp=__webpack_require__(24),Connection=__webpack_require__(29).Connection,writeEncoded=__webpack_require__(95).writeEncoded,some=__webpack_require__(306);module.exports=selectHandler}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(601)},function(module,exports,__webpack_require__){!function(root,undefined){"use strict";function _x86Multiply(m,n){return(65535&m)*n+(((m>>>16)*n&65535)<<16)}function _x86Rotl(m,n){return m<>>32-n}function _x86Fmix(h){return h^=h>>>16,h=_x86Multiply(h,2246822507),h^=h>>>13,h=_x86Multiply(h,3266489909),h^=h>>>16}function _x64Add(m,n){m=[m[0]>>>16,65535&m[0],m[1]>>>16,65535&m[1]],n=[n[0]>>>16,65535&n[0],n[1]>>>16,65535&n[1]];var o=[0,0,0,0];return o[3]+=m[3]+n[3],o[2]+=o[3]>>>16,o[3]&=65535,o[2]+=m[2]+n[2],o[1]+=o[2]>>>16,o[2]&=65535,o[1]+=m[1]+n[1],o[0]+=o[1]>>>16,o[1]&=65535,o[0]+=m[0]+n[0],o[0]&=65535,[o[0]<<16|o[1],o[2]<<16|o[3]]}function _x64Multiply(m,n){m=[m[0]>>>16,65535&m[0],m[1]>>>16,65535&m[1]],n=[n[0]>>>16,65535&n[0],n[1]>>>16,65535&n[1]];var o=[0,0,0,0];return o[3]+=m[3]*n[3],o[2]+=o[3]>>>16,o[3]&=65535,o[2]+=m[2]*n[3],o[1]+=o[2]>>>16,o[2]&=65535,o[2]+=m[3]*n[2],o[1]+=o[2]>>>16,o[2]&=65535,o[1]+=m[1]*n[3],o[0]+=o[1]>>>16,o[1]&=65535,o[1]+=m[2]*n[2],o[0]+=o[1]>>>16,o[1]&=65535,o[1]+=m[3]*n[1],o[0]+=o[1]>>>16,o[1]&=65535,o[0]+=m[0]*n[3]+m[1]*n[2]+m[2]*n[1]+m[3]*n[0],o[0]&=65535,[o[0]<<16|o[1],o[2]<<16|o[3]]}function _x64Rotl(m,n){return n%=64,32===n?[m[1],m[0]]:n<32?[m[0]<>>32-n,m[1]<>>32-n]:(n-=32,[m[1]<>>32-n,m[0]<>>32-n])}function _x64LeftShift(m,n){return n%=64,0===n?m:n<32?[m[0]<>>32-n,m[1]<>>1]),h=_x64Multiply(h,[4283543511,3981806797]),h=_x64Xor(h,[0,h[0]>>>1]),h=_x64Multiply(h,[3301882366,444984403]),h=_x64Xor(h,[0,h[0]>>>1])}var library={version:"3.0.1",x86:{},x64:{}};library.x86.hash32=function(key,seed){key=key||"",seed=seed||0;for(var remainder=key.length%4,bytes=key.length-remainder,h1=seed,k1=0,c1=3432918353,c2=461845907,i=0;i>>0},library.x86.hash128=function(key,seed){key=key||"",seed=seed||0;for(var remainder=key.length%16,bytes=key.length-remainder,h1=seed,h2=seed,h3=seed,h4=seed,k1=0,k2=0,k3=0,k4=0,c1=597399067,c2=2869860233,c3=951274213,c4=2716044179,i=0;i>>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)},library.x64.hash128=function(key,seed){key=key||"",seed=seed||0;for(var remainder=key.length%16,bytes=key.length-remainder,h1=[0,seed],h2=[0,seed],k1=[0,0],k2=[0,0],c1=[2277735313,289559509],c2=[1291169091,658871167],i=0;i>>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)},void 0!==module&&module.exports&&(exports=module.exports=library),exports.murmurHash3=library}()},function(module,exports,__webpack_require__){(function(global){var rvalidchars=/^[\],:{}\s]*$/;module.exports=function(data){return"string"==typeof data&&data?(data=data.replace(/^\s+/,"").replace(/\s+$/,""),global.JSON&&JSON.parse?JSON.parse(data):rvalidchars.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))?new Function("return "+data)():void 0):null}}).call(exports,__webpack_require__(3))},function(module,exports,__webpack_require__){"use strict";const ensureMultiaddr=__webpack_require__(254).ensureMultiaddr,uniqBy=__webpack_require__(545);class MultiaddrSet{constructor(multiaddrs){this._multiaddrs=multiaddrs||[],this._observedMultiaddrs=[]}add(ma){ma=ensureMultiaddr(ma),this.has(ma)||this._multiaddrs.push(ma)}addSafe(ma){ma=ensureMultiaddr(ma),this._observedMultiaddrs.some((m,i)=>{if(m.equals(ma))return this.add(ma),this._observedMultiaddrs.splice(i,1),!0})||this._observedMultiaddrs.push(ma)}toArray(){return this._multiaddrs.slice()}get size(){return this._multiaddrs.length}forEach(fn){return this._multiaddrs.forEach(fn)}has(ma){return ma=ensureMultiaddr(ma),this._multiaddrs.some(m=>m.equals(ma))}delete(ma){ma=ensureMultiaddr(ma),this._multiaddrs.some((m,i)=>{if(m.equals(ma))return this._multiaddrs.splice(i,1),!0})}replace(existing,fresh){Array.isArray(existing)||(existing=[existing]),Array.isArray(fresh)||(fresh=[fresh]),existing.forEach(m=>this.delete(m)),fresh.forEach(m=>this.add(m))}clear(){this._multiaddrs=[]}distinct(){return uniqBy(this._multiaddrs,ma=>{return[ma.toOptions().port,ma.toOptions().transport].join()})}}module.exports=MultiaddrSet},function(module,exports,__webpack_require__){(function(process){function Promise(fn){function next(skipTimeout){waiting.length?(running=!0,waiting.shift()(skipTimeout||!1)):running=!1}function then(cb,eb){return new Promise(function(resolver){function done(skipTimeout){function timeoutDone(){var val;try{val=callback(value)}catch(ex){return resolver.reject(ex),next()}resolver.fulfill(val),next(!0)}var callback=isFulfilled?cb:eb;"function"==typeof callback?skipTimeout?timeoutDone():nextTick(timeoutDone):isFulfilled?(resolver.fulfill(value),next(skipTimeout)):(resolver.reject(value),next(skipTimeout))}waiting.push(done),isResolved&&!running&&next()})}if(!(this instanceof Promise))return"function"==typeof fn?new Promise(fn):defer();var value,isResolved=!1,isFulfilled=!1,waiting=[],running=!1;this.then=then,function(){function fulfill(val){isResolved||(isPromise(val)?val.then(fulfill,reject):(isResolved=isFulfilled=!0,value=val,next()))}function reject(err){isResolved||(isResolved=!0,isFulfilled=!1,value=err,next())}for(var resolver={fulfill:fulfill,reject:reject},i=0;i"!==tokens[0])throw new Error("Unexpected token in map type: "+tokens[0]);tokens.shift(),field.name=tokens.shift();break;case"repeated":case"required":case"optional":var t=tokens.shift();field.required="required"===t,field.repeated="repeated"===t,field.type=tokens.shift(),field.name=tokens.shift();break;case"[":field.options=onfieldoptions(tokens);break;case";":if(null===field.name)throw new Error("Missing field name");if(null===field.type)throw new Error("Missing type in message field: "+field.name);if(field.tag===-1)throw new Error("Missing tag number in message field: "+field.name);return tokens.shift(),field;default:throw new Error("Unexpected token in message field: "+tokens[0])}throw new Error("No ; found for message field")},onmessagebody=function(tokens){for(var body={enums:[],messages:[],fields:[],extends:[],extensions:null};tokens.length;)switch(tokens[0]){case"map":case"repeated":case"optional":case"required":body.fields.push(onfield(tokens));break;case"enum":body.enums.push(onenum(tokens));break;case"message":body.messages.push(onmessage(tokens));break;case"extensions":body.extensions=onextensions(tokens);break;case"oneof":tokens.shift();var name=tokens.shift();if("{"!==tokens[0])throw new Error("Unexpected token in oneof: "+tokens[0]);for(tokens.shift();"}"!==tokens[0];){tokens.unshift("optional");var field=onfield(tokens);field.oneof=name,body.fields.push(field)}tokens.shift();break;case"extend":body.extends.push(onextend(tokens));break;case";":tokens.shift();break;case"reserved":case"option":for(tokens.shift();";"!==tokens[0];)tokens.shift();break;default:tokens.unshift("optional"),body.fields.push(onfield(tokens))}return body},onextend=function(tokens){return{name:tokens[1],message:onmessage(tokens)}},onextensions=function(tokens){tokens.shift();var from=Number(tokens.shift());if(isNaN(from))throw new Error("Invalid from in extensions definition");if("to"!==tokens.shift())throw new Error("Expected keyword 'to' in extensions definition");var to=tokens.shift();if("max"===to&&(to=536870911),to=Number(to),isNaN(to))throw new Error("Invalid to in extensions definition");if(";"!==tokens.shift())throw new Error("Missing ; in extensions definition");return{from:from,to:to}},onmessage=function(tokens){tokens.shift();var lvl=1,body=[],msg={name:tokens.shift(),enums:[],extends:[],messages:[],fields:[]};if("{"!==tokens[0])throw new Error("Expected { but found "+tokens[0]);for(tokens.shift();tokens.length;){if("{"===tokens[0]?lvl++:"}"===tokens[0]&&lvl--,!lvl)return tokens.shift(),body=onmessagebody(body),msg.enums=body.enums,msg.messages=body.messages, +msg.fields=body.fields,msg.extends=body.extends,msg.extensions=body.extensions,msg;body.push(tokens.shift())}if(lvl)throw new Error("No closing tag for message")},onpackagename=function(tokens){tokens.shift();var name=tokens.shift();if(";"!==tokens[0])throw new Error("Expected ; but found "+tokens[0]);return tokens.shift(),name},onsyntaxversion=function(tokens){if(tokens.shift(),"="!==tokens[0])throw new Error("Expected = but found "+tokens[0]);tokens.shift();var version=tokens.shift();switch(version){case'"proto2"':version=2;break;case'"proto3"':version=3;break;default:throw new Error("Expected protobuf syntax version but found "+version)}if(";"!==tokens[0])throw new Error("Expected ; but found "+tokens[0]);return tokens.shift(),version},onenumvalue=function(tokens){if(tokens.length<4)throw new Error("Invalid enum value: "+tokens.slice(0,3).join(" "));if("="!==tokens[1])throw new Error("Expected = but found "+tokens[1]);if(";"!==tokens[3]&&"["!==tokens[3])throw new Error("Expected ; or [ but found "+tokens[1]);var name=tokens.shift();tokens.shift();var val={value:null,options:{}};return val.value=Number(tokens.shift()),"["===tokens[0]&&(val.options=onfieldoptions(tokens)),tokens.shift(),{name:name,val:val}},onenum=function(tokens){tokens.shift();var options={},e={name:tokens.shift(),values:{},options:{}};if("{"!==tokens[0])throw new Error("Expected { but found "+tokens[0]);for(tokens.shift();tokens.length;){if("}"===tokens[0])return tokens.shift(),";"===tokens[0]&&tokens.shift(),e;if("option"!==tokens[0]){var val=onenumvalue(tokens);e.values[val.name]=val.val}else options=onoption(tokens),e.options[options.name]=options.value}throw new Error("No closing tag for enum")},onoption=function(tokens){for(var name=null,value=null;tokens.length;){if(";"===tokens[0])return tokens.shift(),{name:name,value:value};switch(tokens[0]){case"option":tokens.shift();var hasBracket="("===tokens[0];if(hasBracket&&tokens.shift(),name=tokens.shift(),hasBracket){if(")"!==tokens[0])throw new Error("Expected ) but found "+tokens[0]);tokens.shift()}"."===tokens[0][0]&&(name+=tokens.shift());break;case"=":if(tokens.shift(),null===name)throw new Error("Expected key for option with value: "+tokens[0]);if(value=function(value){return"true"===value||"false"!==value&&value.replace(/^"+|"+$/gm,"")}(tokens.shift()),"optimize_for"===name&&!/^(SPEED|CODE_SIZE|LITE_RUNTIME)$/.test(value))throw new Error("Unexpected value for option optimize_for: "+value);"{"===value&&(value=onoptionMap(tokens));break;default:throw new Error("Unexpected token in option: "+tokens[0])}}},onoptionMap=function(tokens){for(var map={};tokens.length;){if("}"===tokens[0])return tokens.shift(),map;var hasBracket="("===tokens[0];hasBracket&&tokens.shift();var key=tokens.shift();if(hasBracket){if(")"!==tokens[0])throw new Error("Expected ) but found "+tokens[0]);tokens.shift()}var value=null;switch(tokens[0]){case":":if(void 0!==map[key])throw new Error("Duplicate option map key "+key);tokens.shift(),value=function(value){return"true"===value||"false"!==value&&value.replace(/^"+|"+$/gm,"")}(tokens.shift()),"{"===value&&(value=onoptionMap(tokens)),map[key]=value;break;case"{":if(tokens.shift(),value=onoptionMap(tokens),void 0===map[key]&&(map[key]=[]),!Array.isArray(map[key]))throw new Error("Duplicate option map key "+key);map[key].push(value);break;default:throw new Error("Unexpected token in option map: "+tokens[0])}}throw new Error("No closing tag for option map")},onimport=function(tokens){tokens.shift();var file=tokens.shift().replace(/^"+|"+$/gm,"");if(";"!==tokens[0])throw new Error("Unexpected token: "+tokens[0]+'. Expected ";"');return tokens.shift(),file},onservice=function(tokens){tokens.shift();var service={name:tokens.shift(),methods:[],options:{}};if("{"!==tokens[0])throw new Error("Expected { but found "+tokens[0]);for(tokens.shift();tokens.length;){if("}"===tokens[0])return tokens.shift(),";"===tokens[0]&&tokens.shift(),service;switch(tokens[0]){case"option":var opt=onoption(tokens);if(void 0!==service.options[opt.name])throw new Error("Duplicate option "+opt.name);service.options[opt.name]=opt.value;break;case"rpc":service.methods.push(onrpc(tokens));break;default:throw new Error("Unexpected token in service: "+tokens[0])}}throw new Error("No closing tag for service")},onrpc=function(tokens){tokens.shift();var rpc={name:tokens.shift(),input_type:null,output_type:null,client_streaming:!1,server_streaming:!1,options:{}};if("("!==tokens[0])throw new Error("Expected ( but found "+tokens[0]);if(tokens.shift(),"stream"===tokens[0]&&(tokens.shift(),rpc.client_streaming=!0),rpc.input_type=tokens.shift(),")"!==tokens[0])throw new Error("Expected ) but found "+tokens[0]);if(tokens.shift(),"returns"!==tokens[0])throw new Error("Expected returns but found "+tokens[0]);if(tokens.shift(),"("!==tokens[0])throw new Error("Expected ( but found "+tokens[0]);if(tokens.shift(),"stream"===tokens[0]&&(tokens.shift(),rpc.server_streaming=!0),rpc.output_type=tokens.shift(),")"!==tokens[0])throw new Error("Expected ) but found "+tokens[0]);if(tokens.shift(),";"===tokens[0])return tokens.shift(),rpc;if("{"!==tokens[0])throw new Error("Expected { but found "+tokens[0]);for(tokens.shift();tokens.length;){if("}"===tokens[0])return tokens.shift(),";"===tokens[0]&&tokens.shift(),rpc;if("option"!==tokens[0])throw new Error("Unexpected token in rpc options: "+tokens[0]);var opt=onoption(tokens);if(void 0!==rpc.options[opt.name])throw new Error("Duplicate option "+opt.name);rpc.options[opt.name]=opt.value}throw new Error("No closing tag for rpc")},parse=function(buf){for(var tokens=tokenize(buf.toString()),i=0;imsg.extensions.to)throw new Error(msg.name+" does not declare "+field.tag+" as an extension number");msg.fields.push(field)})})}),schema.messages.forEach(function(msg){msg.fields.forEach(function(field){function enumNameIsFieldType(en){return en.name===field.type}function enumNameIsNestedEnumName(en){return en.name===nestedEnumName}var fieldSplit,messageName,nestedEnumName,message;if(field.options&&"true"===field.options.packed&&PACKABLE_TYPES.indexOf(field.type)===-1){if(field.type.indexOf(".")===-1){if(msg.enums&&msg.enums.some(enumNameIsFieldType))return}else{if(fieldSplit=field.type.split("."),fieldSplit.length>2)throw new Error("what is this?");if(messageName=fieldSplit[0],nestedEnumName=fieldSplit[1],schema.messages.some(function(msg){if(msg.name===messageName)return message=msg,msg}),message&&message.enums&&message.enums.some(enumNameIsNestedEnumName))return}throw new Error("Fields of type "+field.type+' cannot be declared [packed=true]. Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire types) can be declared "packed". See https://developers.google.com/protocol-buffers/docs/encoding#optional')}})}),schema};module.exports=parse},function(module,exports){var onfield=function(f,result){var prefix=f.repeated?"repeated":f.required?"required":"optional";"map"===f.type&&(prefix="map<"+f.map.from+","+f.map.to+">"),f.oneof&&(prefix="");var opts=Object.keys(f.options||{}).map(function(key){return key+" = "+f.options[key]}).join(",");return opts&&(opts=" ["+opts+"]"),result.push((prefix?prefix+" ":"")+("map"===f.map?"":f.type+" ")+f.name+" = "+f.tag+opts+";"),result},onmessage=function(m,result){result.push("message "+m.name+" {"),m.enums||(m.enums=[]),m.enums.forEach(function(e){result.push(onenum(e,[]))}),m.messages||(m.messages=[]),m.messages.forEach(function(m){result.push(onmessage(m,[]))});var oneofs={};return m.fields||(m.fields=[]),m.fields.forEach(function(f){f.oneof?(oneofs[f.oneof]||(oneofs[f.oneof]=[]),oneofs[f.oneof].push(onfield(f,[]))):result.push(onfield(f,[]))}),Object.keys(oneofs).forEach(function(n){oneofs[n].unshift("oneof "+n+" {"),oneofs[n].push("}"),result.push(oneofs[n])}),result.push("}",""),result},onenum=function(e,result){result.push("enum "+e.name+" {"),e.options||(e.options={});var options=onoption(e.options,[]);return options.length>1&&result.push(options.slice(0,-1)),Object.keys(e.values).map(function(v){var val=onenumvalue(e.values[v]);result.push([v+" = "+val+";"])}),result.push("}",""),result},onenumvalue=function(v,result){var opts=Object.keys(v.options||{}).map(function(key){return key+" = "+v.options[key]}).join(",");return opts&&(opts=" ["+opts+"]"),v.value+opts},onoption=function(o,result){var keys=Object.keys(o);return keys.forEach(function(option){var v=o[option];~option.indexOf(".")&&(option="("+option+")");var type=typeof v;"object"===type?(v=onoptionMap(v,[]),v.length&&result.push("option "+option+" = {",v,"};")):("string"===type&&"optimize_for"!==option&&(v='"'+v+'"'),result.push("option "+option+" = "+v+";"))}),keys.length>0&&result.push(""),result},onoptionMap=function(o,result){return Object.keys(o).forEach(function(k){var v=o[k],type=typeof v;"object"===type?Array.isArray(v)?v.forEach(function(v){v=onoptionMap(v,[]),v.length&&result.push(k+" {",v,"}")}):(v=onoptionMap(v,[]),v.length&&result.push(k+" {",v,"}")):("string"===type&&(v='"'+v+'"'),result.push(k+": "+v))}),result},onservices=function(s,result){return result.push("service "+s.name+" {"),s.options||(s.options={}),onoption(s.options,result),s.methods||(s.methods=[]),s.methods.forEach(function(m){result.push(onrpc(m,[]))}),result.push("}",""),result},onrpc=function(rpc,result){var def="rpc "+rpc.name+"(";rpc.client_streaming&&(def+="stream "),def+=rpc.input_type+") returns (",rpc.server_streaming&&(def+="stream "),def+=rpc.output_type+")",rpc.options||(rpc.options={});var options=onoption(rpc.options,[]);return options.length>1?result.push(def+" {",options.slice(0,-1),"}"):result.push(def+";"),result},indent=function(lvl){return function(line){return Array.isArray(line)?line.map(indent(lvl+" ")).join("\n"):lvl+line}};module.exports=function(schema){var result=[];return result.push('syntax = "proto'+schema.syntax+'";',""),schema.package&&result.push("package "+schema.package+";",""),schema.options||(schema.options={}),onoption(schema.options,result),schema.enums||(schema.enums=[]),schema.enums.forEach(function(e){onenum(e,result)}),schema.messages||(schema.messages=[]),schema.messages.forEach(function(m){onmessage(m,result)}),schema.services&&schema.services.forEach(function(s){onservices(s,result)}),result.map(indent("")).join("\n")}},function(module,exports){module.exports=function(sch){var noComments=function(line){var i=line.indexOf("//");return i>-1?line.slice(0,i):line},trim=function(line){return line.trim()};return sch.replace(/([;,{}\(\)=\:\[\]<>]|\/\*|\*\/)/g," $1 ").split(/\n/).map(trim).filter(Boolean).map(noComments).map(trim).filter(Boolean).join("\n").split(/\s+|\n+/gm).filter(function(){var inside=!1;return function(token){return"/*"===token?(inside=!0,!1):"*/"===token?(inside=!1,!1):!inside}}())}},function(module,exports,__webpack_require__){(function(Buffer){var encodings=__webpack_require__(610),varint=__webpack_require__(14),genobj=__webpack_require__(377),genfun=__webpack_require__(376),flatten=function(values){if(!values)return null;var result={};return Object.keys(values).forEach(function(k){result[k]=values[k].value}),result},skip=function(type,buffer,offset){switch(type){case 0:return varint.decode(buffer,offset),offset+varint.decode.bytes;case 1:return offset+8;case 2:var len=varint.decode(buffer,offset);return offset+varint.decode.bytes+len;case 3:case 4:throw new Error("Groups are not supported");case 5:return offset+4}throw new Error("Unknown wire type: "+type)},defined=function(val){return null!==val&&void 0!==val&&("number"!=typeof val||!isNaN(val))},isString=function(def){try{return!!def&&"string"==typeof JSON.parse(def)}catch(err){return!1}},defaultValue=function(f,def){if(f.map)return"{}";if(f.repeated)return"[]";switch(f.type){case"string":return isString(def)?def:'""';case"bool":return"true"===def?"true":"false";case"float":case"double":case"sfixed32":case"fixed32":case"varint":case"enum":case"uint64":case"uint32":case"int64":case"int32":case"sint64":case"sint32":return""+Number(def||0);default:return"null"}};module.exports=function(schema,extraEncodings){var messages={},enums={},cache={},visit=function(schema,prefix){schema.enums&&schema.enums.forEach(function(e){e.id=prefix+(prefix?".":"")+e.name,enums[e.id]=e,visit(e,e.id)}),schema.messages&&schema.messages.forEach(function(m){m.id=prefix+(prefix?".":"")+m.name,messages[m.id]=m,m.fields.forEach(function(f){if(f.map){var name="Map_"+f.map.from+"_"+f.map.to,map={name:name,enums:[],messages:[],fields:[{name:"key",type:f.map.from,tag:1,repeated:!1,required:!0},{name:"value",type:f.map.to,tag:2,repeated:!1,required:!1}],extensions:null,id:prefix+(prefix?".":"")+name};messages[map.id]||(messages[map.id]=map,schema.messages.push(map)),f.type=name,f.repeated=!0}}),visit(m,m.id)})};visit(schema,"");var compileEnum=function(e){var conditions=Object.keys(e.values).map(function(k){return"val !== "+parseInt(e.values[k].value,10)}).join(" && ");conditions||(conditions="true");var encode=genfun()("function encode (val, buf, offset) {")('if (%s) throw new Error("Invalid enum value: "+val)',conditions)("varint.encode(val, buf, offset)")("encode.bytes = varint.encode.bytes")("return buf")("}").toFunction({varint:varint}),decode=genfun()("function decode (buf, offset) {")("var val = varint.decode(buf, offset)")('if (%s) throw new Error("Invalid enum value: "+val)',conditions)("decode.bytes = varint.decode.bytes")("return val")("}").toFunction({varint:varint});return encodings.make(0,encode,decode,varint.encodingLength)},compileMessage=function(m,exports){m.messages.forEach(function(nested){exports[nested.name]=resolve(nested.name,m.id)}),m.enums.forEach(function(val){exports[val.name]=flatten(val.values)}),exports.type=2,exports.message=!0,exports.name=m.name;var oneofs={};m.fields.forEach(function(f){f.oneof&&(oneofs[f.oneof]||(oneofs[f.oneof]=[]),oneofs[f.oneof].push(f.name))});var enc=m.fields.map(function(f){return resolve(f.type,m.id)}),forEach=function(fn){for(var i=0;i 1) throw new Error(%s)",oneofs[name].map(function(prop){return"+defined("+genobj("obj",prop)+")"}).join(" + "),msg)}),forEach(function(e,f,val,i){var packed=f.repeated&&f.options&&f.options.packed&&"false"!==f.options.packed,hl=varint.encodingLength(f.tag<<3|e.type);f.required?encodingLength("if (!defined(%s)) throw new Error(%s)",val,JSON.stringify(f.name+" is required")):encodingLength("if (defined(%s)) {",val),f.map&&(encodingLength()("var tmp = Object.keys(%s)",val)("for (var i = 0; i < tmp.length; i++) {")("tmp[i] = {key: tmp[i], value: %s[tmp[i]]}",val)("}"),val="tmp"),packed?(encodingLength()("var packedLen = 0")("for (var i = 0; i < %s.length; i++) {",val)("if (!defined(%s)) continue",val+"[i]")("var len = enc[%d].encodingLength(%s)",i,val+"[i]")("packedLen += len"),e.message&&encodingLength("packedLen += varint.encodingLength(len)"),encodingLength("}")("if (packedLen) {")("length += %d + packedLen + varint.encodingLength(packedLen)",hl)("}")):(f.repeated&&(encodingLength("for (var i = 0; i < %s.length; i++) {",val),val+="[i]",encodingLength("if (!defined(%s)) continue",val)),encodingLength("var len = enc[%d].encodingLength(%s)",i,val),e.message&&encodingLength("length += varint.encodingLength(len)"),encodingLength("length += %d + len",hl),f.repeated&&encodingLength("}")),f.required||encodingLength("}")}),encodingLength()("return length")("}"),encodingLength=encodingLength.toFunction({defined:defined,varint:varint,enc:enc});var encode=genfun()("function encode (obj, buf, offset) {")("if (!offset) offset = 0")("if (!buf) buf = new Buffer(encodingLength(obj))")("var oldOffset = offset");Object.keys(oneofs).forEach(function(name){var msg=JSON.stringify("only one of the properties defined in oneof "+name+" can be set");encode("if ((%s) > 1) throw new Error(%s)",oneofs[name].map(function(prop){return"+defined("+genobj("obj",prop)+")"}).join(" + "),msg)}),forEach(function(e,f,val,i){f.required?encode("if (!defined(%s)) throw new Error(%s)",val,JSON.stringify(f.name+" is required")):encode("if (defined(%s)) {",val);var j,packed=f.repeated&&f.options&&f.options.packed&&"false"!==f.options.packed,p=varint.encode(f.tag<<3|2),h=varint.encode(f.tag<<3|e.type);if(f.map&&(encode()("var tmp = Object.keys(%s)",val)("for (var i = 0; i < tmp.length; i++) {")("tmp[i] = {key: tmp[i], value: %s[tmp[i]]}",val)("}"),val="tmp"),packed){for(encode()("var packedLen = 0")("for (var i = 0; i < %s.length; i++) {",val)("if (!defined(%s)) continue",val+"[i]")("packedLen += enc[%d].encodingLength(%s)",i,val+"[i]")("}"),encode("if (packedLen) {"),j=0;j> 3")("switch (tag) {"),forEach(function(e,f,val,i){var packed=f.repeated&&f.options&&f.options.packed&&"false"!==f.options.packed;decode("case %d:",f.tag),f.oneof&&m.fields.forEach(function(otherField){otherField.oneof===f.oneof&&f.name!==otherField.name&&decode("delete %s",genobj("obj",otherField.name))}),packed&&decode()("var packedEnd = varint.decode(buf, offset)")("offset += varint.decode.bytes")("packedEnd += offset")("while (offset < packedEnd) {"),e.message?(decode("var len = varint.decode(buf, offset)"),decode("offset += varint.decode.bytes"),f.map?(decode("var tmp = enc[%d].decode(buf, offset, offset + len)",i),decode("%s[tmp.key] = tmp.value",val)):f.repeated?decode("%s.push(enc[%d].decode(buf, offset, offset + len))",val,i):decode("%s = enc[%d].decode(buf, offset, offset + len)",val,i)):f.repeated?decode("%s.push(enc[%d].decode(buf, offset))",val,i):decode("%s = enc[%d].decode(buf, offset)",val,i),decode("offset += enc[%d].decode.bytes",i),packed&&decode("}"),f.required&&decode("found%d = true",i),decode("break")}),decode()("default:")("offset = skip(prefix & 7, buf, offset)")("}")("}")("}"),decode=decode.toFunction({varint:varint,skip:skip,enc:enc}),encode.bytes=decode.bytes=0,exports.buffer=!0,exports.encode=encode,exports.decode=decode,exports.encodingLength=encodingLength,exports},resolve=function(name,from,compile){if(extraEncodings&&extraEncodings[name])return extraEncodings[name];if(encodings[name])return encodings[name];var m=(from?from+"."+name:name).split(".").map(function(part,i,list){return list.slice(0,i).concat(name).join(".")}).reverse().reduce(function(result,id){return result||messages[id]||enums[id]},null);if(compile===!1)return m;if(!m)throw new Error("Could not resolve "+name);return m.values?compileEnum(m):cache[m.id]||compileMessage(m,cache[m.id]={})};return(schema.enums||[]).concat((schema.messages||[]).map(function(message){return resolve(message.id)}))}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){var varint=__webpack_require__(14),svarint=__webpack_require__(675),encoder=function(type,encode,decode,encodingLength){return encode.bytes=decode.bytes=0,{type:type,encode:encode,decode:decode,encodingLength:encodingLength}};exports.make=encoder,exports.bytes=function(tag){var bufferLength=function(val){return Buffer.isBuffer(val)?val.length:Buffer.byteLength(val)},encodingLength=function(val){var len=bufferLength(val);return varint.encodingLength(len)+len},encode=function(val,buffer,offset){var oldOffset=offset,len=bufferLength(val);return varint.encode(len,buffer,offset),offset+=varint.encode.bytes,Buffer.isBuffer(val)?val.copy(buffer,offset):buffer.write(val,offset,len),offset+=len,encode.bytes=offset-oldOffset,buffer},decode=function(buffer,offset){var oldOffset=offset,len=varint.decode(buffer,offset);offset+=varint.decode.bytes;var val=buffer.slice(offset,offset+len);return offset+=val.length,decode.bytes=offset-oldOffset,val};return encoder(2,encode,decode,encodingLength)}(),exports.string=function(){var encodingLength=function(val){var len=Buffer.byteLength(val);return varint.encodingLength(len)+len},encode=function(val,buffer,offset){var oldOffset=offset,len=Buffer.byteLength(val);return varint.encode(len,buffer,offset,"utf-8"),offset+=varint.encode.bytes,buffer.write(val,offset,len),offset+=len,encode.bytes=offset-oldOffset,buffer},decode=function(buffer,offset){var oldOffset=offset,len=varint.decode(buffer,offset);offset+=varint.decode.bytes;var val=buffer.toString("utf-8",offset,offset+len);return offset+=len,decode.bytes=offset-oldOffset,val};return encoder(2,encode,decode,encodingLength)}(),exports.bool=function(){var encodingLength=function(val){return 1},encode=function(val,buffer,offset){return buffer[offset]=val?1:0,encode.bytes=1,buffer},decode=function(buffer,offset){var bool=buffer[offset]>0;return decode.bytes=1,bool};return encoder(0,encode,decode,encodingLength)}(),exports.int32=function(){var decode=function(buffer,offset){var val=varint.decode(buffer,offset);return decode.bytes=varint.decode.bytes,val>2147483647?val-4294967296:val},encodingLength=function(val){return varint.encodingLength(val<0?val+4294967296:val)};return encoder(0,varint.encode,decode,encodingLength)}(),exports.int64=function(){var decode=function(buffer,offset){var val=varint.decode(buffer,offset);if(val>=Math.pow(2,63)){for(var limit=9;255===buffer[offset+limit-1];)limit--;limit=limit||9;var subset=new Buffer(limit);buffer.copy(subset,0,offset,offset+limit),subset[limit-1]=127&subset[limit-1],val=-1*varint.decode(subset,0),decode.bytes=10}else decode.bytes=varint.decode.bytes;return val},encode=function(val,buffer,offset){if(val<0){var last=offset+9;for(varint.encode(val*-1,buffer,offset),offset+=varint.encode.bytes-1,buffer[offset]=128|buffer[offset];offset-1};return{enumerable:op("enumerable"),configurable:op("configurable"),writable:op("writable"),value:value}};return function(obj,key,value,options){var k;if(options=makeOptions(value,options),"object"==typeof key){for(k in key)Object.hasOwnProperty.call(key,k)&&(options.value=key[k],setProperty(obj,k,options));return obj}return setProperty(obj,key,options)}})},function(module,exports,__webpack_require__){"use strict";var through=__webpack_require__(102),Buffer=__webpack_require__(5).Buffer;module.exports=function(size,opts){opts||(opts={}),"object"==typeof size&&(opts=size,size=opts.size),size=size||512;var zeroPadding;zeroPadding=!opts.nopad&&(void 0===opts.zeroPadding||opts.zeroPadding);var buffered=[],bufferedBytes=0,emittedChunk=!1;return through(function(data){for("number"==typeof data&&(data=Buffer([data])),bufferedBytes+=data.length,buffered.push(data);bufferedBytes>=size;){var b=Buffer.concat(buffered);bufferedBytes-=size,this.queue(b.slice(0,size)),buffered=[b.slice(size,b.length)],emittedChunk=!0}},function(end){if(opts.emitEmpty&&!emittedChunk||bufferedBytes){if(zeroPadding){var zeroes=Buffer.alloc(size-bufferedBytes);zeroes.fill(0),buffered.push(zeroes)}buffered&&(this.queue(Buffer.concat(buffered)),buffered=null)}this.queue(null)})}},function(module,exports){module.exports=function(onError){onError=onError||function(){};var errd;return function(read){return function(abort,cb){read(abort,function(end,data){if(errd)return cb(!0);if(end&&end!==!0){var _end=onError(end);return _end===!1?cb(end):_end&&_end!==!0?(errd=!0,cb(null,_end)):cb(!0)}cb(end,data)})}}}},function(module,exports){module.exports=function(){function delayed(_read){return stream?stream(_read):(read=_read,function(_abort,_cb){reader?reader(_abort,_cb):(abort=_abort,cb=_cb)})}var read,reader,cb,abort,stream;return delayed.resolve=function(_stream){if(stream)throw new Error("already resolved");if(!(stream=_stream))throw new Error("resolve *must* be passed a transform stream");read&&(reader=stream(read),cb&&reader(abort,cb))},delayed}},function(module,exports,__webpack_require__){"use strict";function decode(opts){let reader=new Reader,p=pushable(err=>{reader.abort(err)});return read=>{function next(){decodeFromReader(reader,opts,(err,msg)=>{if(err)return p.end(err);p.push(msg),next()})}return reader(read),next(),p}}function decodeFromReader(reader,opts,cb){"function"==typeof opts&&(cb=opts,opts={}),opts=Object.assign({fixed:!1,bytes:4},opts||{}),opts.fixed?readFixedMessage(reader,opts.bytes,opts.maxLength,cb):readVarintMessage(reader,opts.maxLength,cb)}function readFixedMessage(reader,byteLength,maxLength,cb){"function"==typeof maxLength&&(cb=maxLength,maxLength=MAX_LENGTH),reader.read(byteLength,(err,bytes)=>{if(err)return cb(err);const msgSize=bytes.readInt32BE(0);if(msgSize>maxLength)return cb("size longer than max permitted length of "+maxLength+"!");readMessage(reader,msgSize,cb)})}function readVarintMessage(reader,maxLength,cb){function readByte(){reader.read(1,(err,byte)=>{if(err)return cb(err);if(rawMsgSize.push(byte),byte&&!isEndByte(byte[0]))return void readByte();const msgSize=varint.decode(Buffer.concat(rawMsgSize));if(msgSize>maxLength)return cb("size longer than max permitted length of "+maxLength+"!");readMessage(reader,msgSize,(err,msg)=>{if(err)return cb(err);rawMsgSize=[],cb(null,msg)})})}"function"==typeof maxLength&&(cb=maxLength,maxLength=MAX_LENGTH);let rawMsgSize=[];0===rawMsgSize.length&&readByte()}function readMessage(reader,size,cb){reader.read(size,(err,msg)=>{if(err)return cb(err);cb(null,msg)})}const varint=__webpack_require__(14),Reader=__webpack_require__(258),Buffer=__webpack_require__(5).Buffer,pushable=__webpack_require__(31);exports.decode=decode,exports.decodeFromReader=decodeFromReader;const isEndByte=byte=>!(128&byte),MAX_LENGTH=4194304},function(module,exports,__webpack_require__){"use strict";function encode(opts){opts=Object.assign({fixed:!1,bytes:4},opts||{});const varint=__webpack_require__(14);let pool=opts.fixed?null:createPool(),used=0,ended=!1;return read=>(end,cb)=>{if(end&&(ended=end),ended)return cb(ended);read(null,(end,data)=>{if(end&&(ended=end),ended)return cb(ended);if(!Buffer.isBuffer(data))return ended=new Error("data must be a buffer"),cb(ended);let encodedLength +;opts.fixed?(encodedLength=Buffer.alloc(opts.bytes),encodedLength.writeInt32BE(data.length,0)):(varint.encode(data.length,pool,used),used+=varint.encode.bytes,encodedLength=pool.slice(used-varint.encode.bytes,used),pool.length-used<100&&(pool=createPool(),used=0)),cb(null,Buffer.concat([encodedLength,data]))})}}function createPool(){return Buffer.alloc(poolSize)}const Buffer=__webpack_require__(5).Buffer;module.exports=encode;const poolSize=10240},function(module,exports){module.exports=function(ary){function create(stream){return{ready:!1,reading:!1,ended:!1,read:stream,data:null}}function check(){if(cb){clean();var l=inputs.length,_cb=cb;if(0===l&&(abort||capped))return cb=null,void _cb(abort||!0);for(var j=0;jinputs.length)throw new Error("this should never happen");if(!(current.reading||current.ended||current.ready)){current.reading=!0;var sync=!0;current.read(abort,function next(end,data){current.data=data,current.ready=!0,current.reading=!1,end===!0||abort?current.ended=!0:end&&(abort=current.ended=end),abort&&!end&¤t.read(abort,next),sync||check()}),sync=!1}}(inputs[l]);check()}function read(_abort,_cb){abort=abort||_abort,cb=_cb,next()}var abort,cb,capped=!!ary,inputs=(ary||[]).map(create),i=0;return read.add=function(stream){if(!stream)return capped=!0,next();inputs.push(create(stream)),next()},read.cap=function(err){read.add(null)},read}},function(module,exports){module.exports=function(fn){var active=!1,called=0;return function(){if(called=!0,!active){for(active=!0;called;)called=!1,fn();active=!1}}}},function(module,exports,__webpack_require__){(function(Buffer){module.exports=function(){var buffers=[],length=0;return{length:length,data:this,add:function(data){if(!Buffer.isBuffer(data))throw new Error("data must be a buffer, was: "+JSON.stringify(data));return this.length=length+=data.length,buffers.push(data),this},has:function(n){return null==n?length>0:length>=n},get:function(n){var _length;if(null==n||n===length){length=0;var _buffers=buffers;return buffers=[],1==_buffers.length?_buffers[0]:Buffer.concat(_buffers)}if(buffers.length>1&&n<=(_length=buffers[0].length)){var buf=buffers[0].slice(0,n);return n===_length?buffers.shift():buffers[0]=buffers[0].slice(n,_length),length-=n,buf}if(nmax?cb(!0):void cb(null,i++)}}},function(module,exports,__webpack_require__){"use strict";module.exports=function(){return function(abort,cb){cb(!0)}}},function(module,exports,__webpack_require__){"use strict";module.exports=function(err){return function(abort,cb){cb(err)}}},function(module,exports,__webpack_require__){"use strict";module.exports={keys:__webpack_require__(632),once:__webpack_require__(261),values:__webpack_require__(146),count:__webpack_require__(627),infinite:__webpack_require__(631),empty:__webpack_require__(628),error:__webpack_require__(629)}},function(module,exports,__webpack_require__){"use strict";module.exports=function(generate){return generate=generate||Math.random,function(end,cb){return end?cb&&cb(end):cb(null,generate())}}},function(module,exports,__webpack_require__){"use strict";var values=__webpack_require__(146);module.exports=function(object){return values(Object.keys(object))}},function(module,exports,__webpack_require__){"use strict";function id(e){return e}var prop=__webpack_require__(72);module.exports=function(map){if(!map)return id;map=prop(map);var abortCb,aborted,busy=!1;return function(read){return function next(abort,cb){if(aborted)return cb(aborted);abort?(aborted=abort,busy?read(abort,function(){busy?abortCb=cb:cb(abort)}):read(abort,cb)):read(null,function(end,data){end?cb(end):aborted?cb(aborted):(busy=!0,map(data,function(err,data){busy=!1,aborted?(cb(aborted),abortCb(aborted)):err?next(err,cb):cb(null,data)}))})}}}},function(module,exports,__webpack_require__){"use strict";var tester=__webpack_require__(264),filter=__webpack_require__(147);module.exports=function(test){return test=tester(test),filter(function(data){return!test(data)})}},function(module,exports,__webpack_require__){"use strict";var values=__webpack_require__(146),once=__webpack_require__(261);module.exports=function(){return function(read){var _read;return function(abort,cb){function nextChunk(){_read(null,function(err,data){err===!0?nextStream():err?read(!0,function(abortErr){cb(err)}):cb(null,data)})}function nextStream(){_read=null,read(null,function(end,stream){if(end)return cb(end);Array.isArray(stream)||stream&&"object"==typeof stream?stream=values(stream):"function"!=typeof stream&&(stream=once(stream)),_read=stream,nextChunk()})}abort?_read?_read(abort,function(err){read(err||abort,cb)}):read(abort,cb):_read?nextChunk():nextStream()}}}},function(module,exports,__webpack_require__){"use strict";module.exports={map:__webpack_require__(637),asyncMap:__webpack_require__(633),filter:__webpack_require__(147),filterNot:__webpack_require__(634),through:__webpack_require__(640),take:__webpack_require__(639),unique:__webpack_require__(262),nonUnique:__webpack_require__(638),flatten:__webpack_require__(635)}},function(module,exports,__webpack_require__){"use strict";function id(e){return e}var prop=__webpack_require__(72);module.exports=function(mapper){return mapper?(mapper=prop(mapper),function(read){return function(abort,cb){read(abort,function(end,data){try{data=end?null:mapper(data)}catch(err){return read(err,function(){return cb(err)})}cb(end,data)})}}):id}},function(module,exports,__webpack_require__){"use strict";var unique=__webpack_require__(262);module.exports=function(field){return unique(field,!0)}},function(module,exports,__webpack_require__){"use strict";module.exports=function(test,opts){opts=opts||{};var last=opts.last||!1,ended=!1;if("number"==typeof test){last=!0;var n=test;test=function(){return--n}}return function(read){function terminate(cb){read(!0,function(err){last=!1,cb(err||!0)})}return function(end,cb){ended?last?terminate(cb):cb(ended):(ended=end)?read(ended,cb):read(null,function(end,data){(ended=ended||end)?cb(ended):test(data)?cb(null,data):(ended=!0,last?cb(null,data):terminate(cb))})}}}},function(module,exports,__webpack_require__){"use strict";module.exports=function(op,onEnd){function once(abort){!a&&onEnd&&(a=!0,onEnd(abort===!0?null:abort))}var a=!1;return function(read){return function(end,cb){return end&&once(end),read(end,function(end,data){end?once(end):op&&op(data),cb(end,data)})}}}},function(module,exports){module.exports=function(fn){var active=!1,called=0;return function(){if(called=!0,!active){for(active=!0;called;)called=!1,fn();active=!1}}}},function(module,exports,__webpack_require__){"use strict";function isFunction(f){return"function"==typeof f}var WebSocket=__webpack_require__(647),duplex=__webpack_require__(643),wsurl=__webpack_require__(648);module.exports=function(addr,opts){isFunction(opts)&&(opts={onConnect:opts});var location="undefined"==typeof window?{}:window.location,url=wsurl(addr,location),socket=new WebSocket(url),stream=duplex(socket,opts);return stream.remoteAddress=url,stream.close=function(cb){isFunction(cb)&&socket.addEventListener("close",cb),socket.close()},socket.addEventListener("open",function(e){opts&&isFunction(opts.onConnect)&&opts.onConnect(null,stream)}),stream},module.exports.connect=module.exports},function(module,exports,__webpack_require__){function duplex(ws,opts){var req=ws.upgradeReq||{};return opts&&opts.binaryType?ws.binaryType=opts.binaryType:opts&&opts.binary&&(ws.binaryType="arraybuffer"),{source:source(ws,opts&&opts.onConnect),sink:sink(ws,opts),headers:req.headers,url:req.url,upgrade:req.upgrade,method:req.method}}var source=__webpack_require__(646),sink=__webpack_require__(645);module.exports=duplex},function(module,exports){module.exports=function(socket,callback){function cleanup(){"function"==typeof remove&&(remove.call(socket,"open",handleOpen),remove.call(socket,"error",handleErr))}function handleOpen(evt){cleanup(),callback()}function handleErr(evt){cleanup(),callback(evt)}var remove=socket&&(socket.removeEventListener||socket.removeListener);return socket.readyState>=2?callback(!0):1===socket.readyState?callback():(socket.addEventListener("open",handleOpen),void socket.addEventListener("error",handleErr))}},function(module,exports,__webpack_require__){(function(setImmediate,process){var ready=__webpack_require__(644),nextTick=void 0!==setImmediate?setImmediate:process.nextTick;module.exports=function(socket,opts){return function(read){function next(end,data){if(end)return void(closeOnEnd&&socket.readyState<=1&&(onClose&&socket.addEventListener("close",function(ev){if(ev.wasClean||1006===ev.code)onClose();else{var err=new Error("ws error");err.event=ev,onClose(err)}}),socket.close()));ready(socket,function(end){if(end)return read(end,function(){});socket.send(data),nextTick(function(){read(null,next)})})}opts=opts||{};var closeOnEnd=opts.closeOnEnd!==!1,onClose="function"==typeof opts?opts:opts.onClose;read(null,next)}}}).call(exports,__webpack_require__(38).setImmediate,__webpack_require__(1))},function(module,exports,__webpack_require__){(function(Buffer){module.exports=function(socket,cb){function read(abort,cb){if(receiver=null,ended)return cb(ended);abort?(receiver=cb,socket.close()):buffer.length>0?cb(null,buffer.shift()):receiver=cb}var receiver,ended,buffer=[],started=!1;return socket.addEventListener("message",function(evt){var data=evt.data;if(data instanceof ArrayBuffer&&(data=new Buffer(data)),receiver)return receiver(null,data);buffer.push(data)}),socket.addEventListener("close",function(evt){ended||receiver&&receiver(ended=!0)}),socket.addEventListener("error",function(evt){ended||(ended=evt,started||(started=!0,cb&&cb(evt)),receiver&&receiver(ended))}),socket.addEventListener("open",function(evt){started||ended||(started=!0)}),read}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){module.exports="undefined"==typeof WebSocket?__webpack_require__(740):WebSocket},function(module,exports,__webpack_require__){var rurl=__webpack_require__(661),map={http:"ws",https:"wss"};module.exports=function(url,location){return rurl(url,location,map,"ws")}},function(module,exports,__webpack_require__){var once=__webpack_require__(57),eos=__webpack_require__(186),fs=__webpack_require__(741),noop=function(){},isFn=function(fn){return"function"==typeof fn},isFS=function(stream){return!!fs&&((stream instanceof(fs.ReadStream||noop)||stream instanceof(fs.WriteStream||noop))&&isFn(stream.close))},isRequest=function(stream){return stream.setHeader&&isFn(stream.abort)},destroyer=function(stream,reading,writing,callback){callback=once(callback);var closed=!1;stream.on("close",function(){closed=!0}),eos(stream,{readable:reading,writable:writing},function(err){if(err)return callback(err);closed=!0,callback()});var destroyed=!1;return function(err){if(!closed&&!destroyed)return destroyed=!0,isFS(stream)?stream.close():isRequest(stream)?stream.abort():isFn(stream.destroy)?stream.destroy():void callback(err||new Error("stream was destroyed"))}},call=function(fn){fn()},pipe=function(from,to){return from.pipe(to)},pump=function(){var streams=Array.prototype.slice.call(arguments),callback=isFn(streams[streams.length-1]||noop)&&streams.pop()||noop;if(Array.isArray(streams[0])&&(streams=streams[0]),streams.length<2)throw new Error("pump requires two streams per minimum");var error,destroys=streams.map(function(stream,i){var reading=i0,function(err){error||(error=err),err&&destroys.forEach(call),reading||(destroys.forEach(call),callback(error))})});return streams.reduce(pipe)};module.exports=pump},function(module,exports,__webpack_require__){(function(module,global){var __WEBPACK_AMD_DEFINE_RESULT__;!function(root){function error(type){throw new RangeError(errors[type])}function map(array,fn){for(var length=array.length,result=[];length--;)result[length]=fn(array[length]);return result}function mapDomain(string,fn){var parts=string.split("@"),result="";return parts.length>1&&(result=parts[0]+"@",string=parts[1]),string=string.replace(regexSeparators,"."),result+map(string.split("."),fn).join(".")}function ucs2decode(string){for(var value,extra,output=[],counter=0,length=string.length;counter=55296&&value<=56319&&counter65535&&(value-=65536,output+=stringFromCharCode(value>>>10&1023|55296),value=56320|1023&value),output+=stringFromCharCode(value)}).join("")}function basicToDigit(codePoint){return codePoint-48<10?codePoint-22:codePoint-65<26?codePoint-65:codePoint-97<26?codePoint-97:base}function digitToBasic(digit,flag){return digit+22+75*(digit<26)-((0!=flag)<<5)}function adapt(delta,numPoints,firstTime){var k=0;for(delta=firstTime?floor(delta/damp):delta>>1,delta+=floor(delta/numPoints);delta>baseMinusTMin*tMax>>1;k+=base)delta=floor(delta/baseMinusTMin);return floor(k+(baseMinusTMin+1)*delta/(delta+skew))}function decode(input){var out,basic,j,index,oldi,w,k,digit,t,baseMinusT,output=[],inputLength=input.length,i=0,n=initialN,bias=initialBias;for(basic=input.lastIndexOf(delimiter),basic<0&&(basic=0),j=0;j=128&&error("not-basic"),output.push(input.charCodeAt(j));for(index=basic>0?basic+1:0;index=inputLength&&error("invalid-input"),digit=basicToDigit(input.charCodeAt(index++)),(digit>=base||digit>floor((maxInt-i)/w))&&error("overflow"),i+=digit*w,t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias,!(digitfloor(maxInt/baseMinusT)&&error("overflow"),w*=baseMinusT;out=output.length+1,bias=adapt(i-oldi,out,0==oldi),floor(i/out)>maxInt-n&&error("overflow"),n+=floor(i/out),i%=out,output.splice(i++,0,n)}return ucs2encode(output)}function encode(input){var n,delta,handledCPCount,basicLength,bias,j,m,q,k,t,currentValue,inputLength,handledCPCountPlusOne,baseMinusT,qMinusT,output=[];for(input=ucs2decode(input),inputLength=input.length,n=initialN,delta=0,bias=initialBias,j=0;j=n&¤tValuefloor((maxInt-delta)/handledCPCountPlusOne)&&error("overflow"),delta+=(m-n)*handledCPCountPlusOne,n=m,j=0;jmaxInt&&error("overflow"),currentValue==n){for(q=delta,k=base;t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias,!(q= 0x80 (not a basic code point)","invalid-input":"Invalid input"},baseMinusTMin=base-tMin,floor=Math.floor,stringFromCharCode=String.fromCharCode;punycode={version:"1.4.1",ucs2:{decode:ucs2decode,encode:ucs2encode},decode:decode,encode:encode,toASCII:toASCII,toUnicode:toUnicode},void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(){return punycode}.call(exports,__webpack_require__,exports,module))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)}()}).call(exports,__webpack_require__(18)(module),__webpack_require__(3))},function(module,exports,__webpack_require__){"use strict";function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}module.exports=function(qs,sep,eq,options){sep=sep||"&",eq=eq||"=";var obj={};if("string"!=typeof qs||0===qs.length)return obj;qs=qs.split(sep);var maxKeys=1e3;options&&"number"==typeof options.maxKeys&&(maxKeys=options.maxKeys);var len=qs.length;maxKeys>0&&len>maxKeys&&(len=maxKeys);for(var i=0;i=0?(kstr=x.substr(0,idx),vstr=x.substr(idx+1)):(kstr=x,vstr=""),k=decodeURIComponent(kstr),v=decodeURIComponent(vstr),hasOwnProperty(obj,k)?isArray(obj[k])?obj[k].push(v):obj[k]=[obj[k],v]:obj[k]=v}return obj};var isArray=Array.isArray||function(xs){return"[object Array]"===Object.prototype.toString.call(xs)}},function(module,exports,__webpack_require__){"use strict";function map(xs,f){if(xs.map)return xs.map(f);for(var res=[],i=0;i65536)throw new Error("requested too many random bytes");var rawBytes=new global.Uint8Array(size);size>0&&crypto.getRandomValues(rawBytes);var bytes=Buffer.from(rawBytes.buffer);return"function"==typeof cb?process.nextTick(function(){cb(null,bytes)}):bytes}var Buffer=__webpack_require__(5).Buffer,crypto=global.crypto||global.msCrypto;crypto&&crypto.getRandomValues?module.exports=randomBytes:module.exports=oldBrowser}).call(exports,__webpack_require__(3),__webpack_require__(1))},function(module,exports,__webpack_require__){module.exports=__webpack_require__(45)},function(module,exports,__webpack_require__){"use strict";function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}module.exports=PassThrough;var Transform=__webpack_require__(267),util=__webpack_require__(27);util.inherits=__webpack_require__(2),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function copyBuffer(src,target,offset){src.copy(target,offset)}var Buffer=__webpack_require__(5).Buffer;module.exports=function(){function BufferList(){_classCallCheck(this,BufferList),this.head=null,this.tail=null,this.length=0}return BufferList.prototype.push=function(v){var entry={data:v,next:null};this.length>0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};0===this.length&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(0!==this.length){var ret=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s){if(0===this.length)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s+p.data;return ret},BufferList.prototype.concat=function(n){if(0===this.length)return Buffer.alloc(0);if(1===this.length)return this.head.data;for(var ret=Buffer.allocUnsafe(n>>>0),p=this.head,i=0;p;)copyBuffer(p.data,ret,i),i+=p.data.length,p=p.next;return ret},BufferList}()},function(module,exports,__webpack_require__){module.exports=__webpack_require__(37).PassThrough},function(module,exports,__webpack_require__){module.exports=__webpack_require__(37).Transform},function(module,exports,__webpack_require__){module.exports=__webpack_require__(148)},function(module,exports,__webpack_require__){var URL=__webpack_require__(152);module.exports=function(url,location,protocolMap,defaultProtocol){protocolMap=protocolMap||{};var proto,url=URL.parse(url,!1,!0);return url.protocol?proto=url.protocol:(proto=location.protocol?location.protocol.replace(/:$/,""):"http",proto=(protocolMap[proto]||defaultProtocol||proto)+":"),url.host&&":"===url.host[0]&&(url.host=null),url.hostname?URL.format({protocol:proto,slashes:!0,hostname:url.hostname,port:url.port,pathname:url.pathname,search:url.search}):(url.host=location.host,url.port?URL.format({protocol:proto,slashes:!0,host:location.hostname+":"+url.port,port:url.port,pathname:url.pathname,search:url.search}):url.pathname?URL.format({protocol:proto,slashes:!0,host:url.host,pathname:url.pathname,search:url.search}):(url.pathname=location.pathname,url.search?URL.format({protocol:proto,slashes:!0,host:url.host,pathname:url.pathname,search:url.search}):(url.search=location.search,url.format(url))))}},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(271)(__webpack_require__(668))},function(module,exports,__webpack_require__){"use strict";(function(Buffer){var toString=Object.prototype.toString;exports.isArray=function(value,message){if(!Array.isArray(value))throw TypeError(message)},exports.isBoolean=function(value,message){if("[object Boolean]"!==toString.call(value))throw TypeError(message)},exports.isBuffer=function(value,message){if(!Buffer.isBuffer(value))throw TypeError(message)},exports.isFunction=function(value,message){if("[object Function]"!==toString.call(value))throw TypeError(message)},exports.isNumber=function(value,message){if("[object Number]"!==toString.call(value))throw TypeError(message)},exports.isObject=function(value,message){if("[object Object]"!==toString.call(value))throw TypeError(message)},exports.isBufferLength=function(buffer,length,message){if(buffer.length!==length)throw RangeError(message)},exports.isBufferLength2=function(buffer,length1,length2,message){if(buffer.length!==length1&&buffer.length!==length2)throw RangeError(message)},exports.isLengthGTZero=function(value,message){if(0===value.length)throw RangeError(message)},exports.isNumberInInterval=function(number,x,y,message){if(number<=x||number>=y)throw RangeError(message)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";var Buffer=__webpack_require__(5).Buffer,bip66=__webpack_require__(313),EC_PRIVKEY_EXPORT_DER_COMPRESSED=Buffer.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),EC_PRIVKEY_EXPORT_DER_UNCOMPRESSED=Buffer.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),ZERO_BUFFER_32=Buffer.from([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);exports.privateKeyExport=function(privateKey,publicKey,compressed){var result=Buffer.from(compressed?EC_PRIVKEY_EXPORT_DER_COMPRESSED:EC_PRIVKEY_EXPORT_DER_UNCOMPRESSED);return privateKey.copy(result,compressed?8:9),publicKey.copy(result,compressed?181:214),result},exports.privateKeyImport=function(privateKey){var length=privateKey.length,index=0;if(!(length2||length1?privateKey[index+lenb-2]<<8:0);if(index+=lenb,!(length32||length1&&0===r[posR]&&!(128&r[posR+1]);--lenR,++posR);for(var s=Buffer.concat([Buffer.from([0]),sigObj.s]),lenS=33,posS=0;lenS>1&&0===s[posS]&&!(128&s[posS+1]);--lenS,++posS);return bip66.encode(r.slice(posR),s.slice(posS))},exports.signatureImport=function(sig){var r=Buffer.from(ZERO_BUFFER_32),s=Buffer.from(ZERO_BUFFER_32);try{var sigObj=bip66.decode(sig);if(33===sigObj.r.length&&0===sigObj.r[0]&&(sigObj.r=sigObj.r.slice(1)),sigObj.r.length>32)throw new Error("R length is too long");if(33===sigObj.s.length&&0===sigObj.s[0]&&(sigObj.s=sigObj.s.slice(1)),sigObj.s.length>32)throw new Error("S length is too long")}catch(err){return}return sigObj.r.copy(r,32-sigObj.r.length),sigObj.s.copy(s,32-sigObj.s.length),{r:r,s:s}},exports.signatureImportLax=function(sig){var r=Buffer.from(ZERO_BUFFER_32),s=Buffer.from(ZERO_BUFFER_32),length=sig.length,index=0;if(48===sig[index++]){var lenbyte=sig[index++];if(!(128&lenbyte&&(index+=lenbyte-128)>length)&&2===sig[index++]){var rlen=sig[index++];if(128&rlen){if(lenbyte=rlen-128,index+lenbyte>length)return;for(;lenbyte>0&&0===sig[index];index+=1,lenbyte-=1);for(rlen=0;lenbyte>0;index+=1,lenbyte-=1)rlen=(rlen<<8)+sig[index]}if(!(rlen>length-index)){var rindex=index;if(index+=rlen,2===sig[index++]){var slen=sig[index++];if(128&slen){if(lenbyte=slen-128,index+lenbyte>length)return;for(;lenbyte>0&&0===sig[index];index+=1,lenbyte-=1);for(slen=0;lenbyte>0;index+=1,lenbyte-=1)slen=(slen<<8)+sig[index]}if(!(slen>length-index)){var sindex=index;for(index+=slen;rlen>0&&0===sig[rindex];rlen-=1,rindex+=1);if(!(rlen>32)){var rvalue=sig.slice(rindex,rindex+rlen);for(rvalue.copy(r,32-rvalue.length);slen>0&&0===sig[sindex];slen-=1,sindex+=1);if(!(slen>32)){var svalue=sig.slice(sindex,sindex+slen);return svalue.copy(s,32-svalue.length),{r:r,s:s}}}}}}}}}},function(module,exports,__webpack_require__){"use strict";function loadCompressedPublicKey(first,xBuffer){var x=new BN(xBuffer);if(x.cmp(ecparams.p)>=0)return null;x=x.toRed(ecparams.red);var y=x.redSqr().redIMul(x).redIAdd(ecparams.b).redSqrt();return 3===first!==y.isOdd()&&(y=y.redNeg()),ec.keyPair({pub:{x:x,y:y}})}function loadUncompressedPublicKey(first,xBuffer,yBuffer){var x=new BN(xBuffer),y=new BN(yBuffer);if(x.cmp(ecparams.p)>=0||y.cmp(ecparams.p)>=0)return null;if(x=x.toRed(ecparams.red),y=y.toRed(ecparams.red),(6===first||7===first)&&y.isOdd()!==(7===first))return null;var x3=x.redSqr().redIMul(x);return y.redSqr().redISub(x3.redIAdd(ecparams.b)).isZero()?ec.keyPair({pub:{x:x,y:y}}):null}function loadPublicKey(publicKey){var first=publicKey[0];switch(first){case 2:case 3:return 33!==publicKey.length?null:loadCompressedPublicKey(first,publicKey.slice(1,33));case 4:case 6:case 7:return 65!==publicKey.length?null:loadUncompressedPublicKey(first,publicKey.slice(1,33),publicKey.slice(33,65));default:return null}} +var Buffer=__webpack_require__(5).Buffer,createHash=__webpack_require__(63),BN=__webpack_require__(13),EC=__webpack_require__(20).ec,messages=__webpack_require__(126),ec=new EC("secp256k1"),ecparams=ec.curve;exports.privateKeyVerify=function(privateKey){var bn=new BN(privateKey);return bn.cmp(ecparams.n)<0&&!bn.isZero()},exports.privateKeyExport=function(privateKey,compressed){var d=new BN(privateKey);if(d.cmp(ecparams.n)>=0||d.isZero())throw new Error(messages.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return Buffer.from(ec.keyFromPrivate(privateKey).getPublic(compressed,!0))},exports.privateKeyTweakAdd=function(privateKey,tweak){var bn=new BN(tweak);if(bn.cmp(ecparams.n)>=0)throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(bn.iadd(new BN(privateKey)),bn.cmp(ecparams.n)>=0&&bn.isub(ecparams.n),bn.isZero())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return bn.toArrayLike(Buffer,"be",32)},exports.privateKeyTweakMul=function(privateKey,tweak){var bn=new BN(tweak);if(bn.cmp(ecparams.n)>=0||bn.isZero())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);return bn.imul(new BN(privateKey)),bn.cmp(ecparams.n)&&(bn=bn.umod(ecparams.n)),bn.toArrayLike(Buffer,"be",32)},exports.publicKeyCreate=function(privateKey,compressed){var d=new BN(privateKey);if(d.cmp(ecparams.n)>=0||d.isZero())throw new Error(messages.EC_PUBLIC_KEY_CREATE_FAIL);return Buffer.from(ec.keyFromPrivate(privateKey).getPublic(compressed,!0))},exports.publicKeyConvert=function(publicKey,compressed){var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);return Buffer.from(pair.getPublic(compressed,!0))},exports.publicKeyVerify=function(publicKey){return null!==loadPublicKey(publicKey)},exports.publicKeyTweakAdd=function(publicKey,tweak,compressed){var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);if(tweak=new BN(tweak),tweak.cmp(ecparams.n)>=0)throw new Error(messages.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return Buffer.from(ecparams.g.mul(tweak).add(pair.pub).encode(!0,compressed))},exports.publicKeyTweakMul=function(publicKey,tweak,compressed){var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);if(tweak=new BN(tweak),tweak.cmp(ecparams.n)>=0||tweak.isZero())throw new Error(messages.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return Buffer.from(pair.pub.mul(tweak).encode(!0,compressed))},exports.publicKeyCombine=function(publicKeys,compressed){for(var pairs=new Array(publicKeys.length),i=0;i=0||s.cmp(ecparams.n)>=0)throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);var result=Buffer.from(signature);return 1===s.cmp(ec.nh)&&ecparams.n.sub(s).toArrayLike(Buffer,"be",32).copy(result,32),result},exports.signatureExport=function(signature){var r=signature.slice(0,32),s=signature.slice(32,64);if(new BN(r).cmp(ecparams.n)>=0||new BN(s).cmp(ecparams.n)>=0)throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);return{r:r,s:s}},exports.signatureImport=function(sigObj){var r=new BN(sigObj.r);r.cmp(ecparams.n)>=0&&(r=new BN(0));var s=new BN(sigObj.s);return s.cmp(ecparams.n)>=0&&(s=new BN(0)),Buffer.concat([r.toArrayLike(Buffer,"be",32),s.toArrayLike(Buffer,"be",32)])},exports.sign=function(message,privateKey,noncefn,data){if("function"==typeof noncefn){var getNonce=noncefn;noncefn=function(counter){var nonce=getNonce(message,privateKey,null,data,counter);if(!Buffer.isBuffer(nonce)||32!==nonce.length)throw new Error(messages.ECDSA_SIGN_FAIL);return new BN(nonce)}}var d=new BN(privateKey);if(d.cmp(ecparams.n)>=0||d.isZero())throw new Error(messages.ECDSA_SIGN_FAIL);var result=ec.sign(message,privateKey,{canonical:!0,k:noncefn,pers:data});return{signature:Buffer.concat([result.r.toArrayLike(Buffer,"be",32),result.s.toArrayLike(Buffer,"be",32)]),recovery:result.recoveryParam}},exports.verify=function(message,signature,publicKey){var sigObj={r:signature.slice(0,32),s:signature.slice(32,64)},sigr=new BN(sigObj.r),sigs=new BN(sigObj.s);if(sigr.cmp(ecparams.n)>=0||sigs.cmp(ecparams.n)>=0)throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);if(1===sigs.cmp(ec.nh)||sigr.isZero()||sigs.isZero())return!1;var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);return ec.verify(message,sigObj,{x:pair.pub.x,y:pair.pub.y})},exports.recover=function(message,signature,recovery,compressed){var sigObj={r:signature.slice(0,32),s:signature.slice(32,64)},sigr=new BN(sigObj.r),sigs=new BN(sigObj.s);if(sigr.cmp(ecparams.n)>=0||sigs.cmp(ecparams.n)>=0)throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);try{if(sigr.isZero()||sigs.isZero())throw new Error;var point=ec.recoverPubKey(message,sigObj,recovery);return Buffer.from(point.encode(!0,compressed))}catch(err){throw new Error(messages.ECDSA_RECOVER_FAIL)}},exports.ecdh=function(publicKey,privateKey){var shared=exports.ecdhUnsafe(publicKey,privateKey,!0);return createHash("sha256").update(shared).digest()},exports.ecdhUnsafe=function(publicKey,privateKey,compressed){var pair=loadPublicKey(publicKey);if(null===pair)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);var scalar=new BN(privateKey);if(scalar.cmp(ecparams.n)>=0||scalar.isZero())throw new Error(messages.ECDH_FAIL);return Buffer.from(pair.pub.mul(scalar).encode(!0,compressed))}},function(module,exports,__webpack_require__){"use strict";exports.umulTo10x10=function(num1,num2,out){var lo,mid,hi,a=num1.words,b=num2.words,o=out.words,c=0,a0=0|a[0],al0=8191&a0,ah0=a0>>>13,a1=0|a[1],al1=8191&a1,ah1=a1>>>13,a2=0|a[2],al2=8191&a2,ah2=a2>>>13,a3=0|a[3],al3=8191&a3,ah3=a3>>>13,a4=0|a[4],al4=8191&a4,ah4=a4>>>13,a5=0|a[5],al5=8191&a5,ah5=a5>>>13,a6=0|a[6],al6=8191&a6,ah6=a6>>>13,a7=0|a[7],al7=8191&a7,ah7=a7>>>13,a8=0|a[8],al8=8191&a8,ah8=a8>>>13,a9=0|a[9],al9=8191&a9,ah9=a9>>>13,b0=0|b[0],bl0=8191&b0,bh0=b0>>>13,b1=0|b[1],bl1=8191&b1,bh1=b1>>>13,b2=0|b[2],bl2=8191&b2,bh2=b2>>>13,b3=0|b[3],bl3=8191&b3,bh3=b3>>>13,b4=0|b[4],bl4=8191&b4,bh4=b4>>>13,b5=0|b[5],bl5=8191&b5,bh5=b5>>>13,b6=0|b[6],bl6=8191&b6,bh6=b6>>>13,b7=0|b[7],bl7=8191&b7,bh7=b7>>>13,b8=0|b[8],bl8=8191&b8,bh8=b8>>>13,b9=0|b[9],bl9=8191&b9,bh9=b9>>>13;out.length=19,lo=Math.imul(al0,bl0),mid=Math.imul(al0,bh0),mid+=Math.imul(ah0,bl0),hi=Math.imul(ah0,bh0);var w0=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w0>>>26),w0&=67108863,lo=Math.imul(al1,bl0),mid=Math.imul(al1,bh0),mid+=Math.imul(ah1,bl0),hi=Math.imul(ah1,bh0),lo+=Math.imul(al0,bl1),mid+=Math.imul(al0,bh1),mid+=Math.imul(ah0,bl1),hi+=Math.imul(ah0,bh1);var w1=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w1>>>26),w1&=67108863,lo=Math.imul(al2,bl0),mid=Math.imul(al2,bh0),mid+=Math.imul(ah2,bl0),hi=Math.imul(ah2,bh0),lo+=Math.imul(al1,bl1),mid+=Math.imul(al1,bh1),mid+=Math.imul(ah1,bl1),hi+=Math.imul(ah1,bh1),lo+=Math.imul(al0,bl2),mid+=Math.imul(al0,bh2),mid+=Math.imul(ah0,bl2),hi+=Math.imul(ah0,bh2);var w2=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w2>>>26),w2&=67108863,lo=Math.imul(al3,bl0),mid=Math.imul(al3,bh0),mid+=Math.imul(ah3,bl0),hi=Math.imul(ah3,bh0),lo+=Math.imul(al2,bl1),mid+=Math.imul(al2,bh1),mid+=Math.imul(ah2,bl1),hi+=Math.imul(ah2,bh1),lo+=Math.imul(al1,bl2),mid+=Math.imul(al1,bh2),mid+=Math.imul(ah1,bl2),hi+=Math.imul(ah1,bh2),lo+=Math.imul(al0,bl3),mid+=Math.imul(al0,bh3),mid+=Math.imul(ah0,bl3),hi+=Math.imul(ah0,bh3);var w3=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w3>>>26),w3&=67108863,lo=Math.imul(al4,bl0),mid=Math.imul(al4,bh0),mid+=Math.imul(ah4,bl0),hi=Math.imul(ah4,bh0),lo+=Math.imul(al3,bl1),mid+=Math.imul(al3,bh1),mid+=Math.imul(ah3,bl1),hi+=Math.imul(ah3,bh1),lo+=Math.imul(al2,bl2),mid+=Math.imul(al2,bh2),mid+=Math.imul(ah2,bl2),hi+=Math.imul(ah2,bh2),lo+=Math.imul(al1,bl3),mid+=Math.imul(al1,bh3),mid+=Math.imul(ah1,bl3),hi+=Math.imul(ah1,bh3),lo+=Math.imul(al0,bl4),mid+=Math.imul(al0,bh4),mid+=Math.imul(ah0,bl4),hi+=Math.imul(ah0,bh4);var w4=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w4>>>26),w4&=67108863,lo=Math.imul(al5,bl0),mid=Math.imul(al5,bh0),mid+=Math.imul(ah5,bl0),hi=Math.imul(ah5,bh0),lo+=Math.imul(al4,bl1),mid+=Math.imul(al4,bh1),mid+=Math.imul(ah4,bl1),hi+=Math.imul(ah4,bh1),lo+=Math.imul(al3,bl2),mid+=Math.imul(al3,bh2),mid+=Math.imul(ah3,bl2),hi+=Math.imul(ah3,bh2),lo+=Math.imul(al2,bl3),mid+=Math.imul(al2,bh3),mid+=Math.imul(ah2,bl3),hi+=Math.imul(ah2,bh3),lo+=Math.imul(al1,bl4),mid+=Math.imul(al1,bh4),mid+=Math.imul(ah1,bl4),hi+=Math.imul(ah1,bh4),lo+=Math.imul(al0,bl5),mid+=Math.imul(al0,bh5),mid+=Math.imul(ah0,bl5),hi+=Math.imul(ah0,bh5);var w5=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w5>>>26),w5&=67108863,lo=Math.imul(al6,bl0),mid=Math.imul(al6,bh0),mid+=Math.imul(ah6,bl0),hi=Math.imul(ah6,bh0),lo+=Math.imul(al5,bl1),mid+=Math.imul(al5,bh1),mid+=Math.imul(ah5,bl1),hi+=Math.imul(ah5,bh1),lo+=Math.imul(al4,bl2),mid+=Math.imul(al4,bh2),mid+=Math.imul(ah4,bl2),hi+=Math.imul(ah4,bh2),lo+=Math.imul(al3,bl3),mid+=Math.imul(al3,bh3),mid+=Math.imul(ah3,bl3),hi+=Math.imul(ah3,bh3),lo+=Math.imul(al2,bl4),mid+=Math.imul(al2,bh4),mid+=Math.imul(ah2,bl4),hi+=Math.imul(ah2,bh4),lo+=Math.imul(al1,bl5),mid+=Math.imul(al1,bh5),mid+=Math.imul(ah1,bl5),hi+=Math.imul(ah1,bh5),lo+=Math.imul(al0,bl6),mid+=Math.imul(al0,bh6),mid+=Math.imul(ah0,bl6),hi+=Math.imul(ah0,bh6);var w6=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w6>>>26),w6&=67108863,lo=Math.imul(al7,bl0),mid=Math.imul(al7,bh0),mid+=Math.imul(ah7,bl0),hi=Math.imul(ah7,bh0),lo+=Math.imul(al6,bl1),mid+=Math.imul(al6,bh1),mid+=Math.imul(ah6,bl1),hi+=Math.imul(ah6,bh1),lo+=Math.imul(al5,bl2),mid+=Math.imul(al5,bh2),mid+=Math.imul(ah5,bl2),hi+=Math.imul(ah5,bh2),lo+=Math.imul(al4,bl3),mid+=Math.imul(al4,bh3),mid+=Math.imul(ah4,bl3),hi+=Math.imul(ah4,bh3),lo+=Math.imul(al3,bl4),mid+=Math.imul(al3,bh4),mid+=Math.imul(ah3,bl4),hi+=Math.imul(ah3,bh4),lo+=Math.imul(al2,bl5),mid+=Math.imul(al2,bh5),mid+=Math.imul(ah2,bl5),hi+=Math.imul(ah2,bh5),lo+=Math.imul(al1,bl6),mid+=Math.imul(al1,bh6),mid+=Math.imul(ah1,bl6),hi+=Math.imul(ah1,bh6),lo+=Math.imul(al0,bl7),mid+=Math.imul(al0,bh7),mid+=Math.imul(ah0,bl7),hi+=Math.imul(ah0,bh7);var w7=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w7>>>26),w7&=67108863,lo=Math.imul(al8,bl0),mid=Math.imul(al8,bh0),mid+=Math.imul(ah8,bl0),hi=Math.imul(ah8,bh0),lo+=Math.imul(al7,bl1),mid+=Math.imul(al7,bh1),mid+=Math.imul(ah7,bl1),hi+=Math.imul(ah7,bh1),lo+=Math.imul(al6,bl2),mid+=Math.imul(al6,bh2),mid+=Math.imul(ah6,bl2),hi+=Math.imul(ah6,bh2),lo+=Math.imul(al5,bl3),mid+=Math.imul(al5,bh3),mid+=Math.imul(ah5,bl3),hi+=Math.imul(ah5,bh3),lo+=Math.imul(al4,bl4),mid+=Math.imul(al4,bh4),mid+=Math.imul(ah4,bl4),hi+=Math.imul(ah4,bh4),lo+=Math.imul(al3,bl5),mid+=Math.imul(al3,bh5),mid+=Math.imul(ah3,bl5),hi+=Math.imul(ah3,bh5),lo+=Math.imul(al2,bl6),mid+=Math.imul(al2,bh6),mid+=Math.imul(ah2,bl6),hi+=Math.imul(ah2,bh6),lo+=Math.imul(al1,bl7),mid+=Math.imul(al1,bh7),mid+=Math.imul(ah1,bl7),hi+=Math.imul(ah1,bh7),lo+=Math.imul(al0,bl8),mid+=Math.imul(al0,bh8),mid+=Math.imul(ah0,bl8),hi+=Math.imul(ah0,bh8);var w8=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w8>>>26),w8&=67108863,lo=Math.imul(al9,bl0),mid=Math.imul(al9,bh0),mid+=Math.imul(ah9,bl0),hi=Math.imul(ah9,bh0),lo+=Math.imul(al8,bl1),mid+=Math.imul(al8,bh1),mid+=Math.imul(ah8,bl1),hi+=Math.imul(ah8,bh1),lo+=Math.imul(al7,bl2),mid+=Math.imul(al7,bh2),mid+=Math.imul(ah7,bl2),hi+=Math.imul(ah7,bh2),lo+=Math.imul(al6,bl3),mid+=Math.imul(al6,bh3),mid+=Math.imul(ah6,bl3),hi+=Math.imul(ah6,bh3),lo+=Math.imul(al5,bl4),mid+=Math.imul(al5,bh4),mid+=Math.imul(ah5,bl4),hi+=Math.imul(ah5,bh4),lo+=Math.imul(al4,bl5),mid+=Math.imul(al4,bh5),mid+=Math.imul(ah4,bl5),hi+=Math.imul(ah4,bh5),lo+=Math.imul(al3,bl6),mid+=Math.imul(al3,bh6),mid+=Math.imul(ah3,bl6),hi+=Math.imul(ah3,bh6),lo+=Math.imul(al2,bl7),mid+=Math.imul(al2,bh7),mid+=Math.imul(ah2,bl7),hi+=Math.imul(ah2,bh7),lo+=Math.imul(al1,bl8),mid+=Math.imul(al1,bh8),mid+=Math.imul(ah1,bl8),hi+=Math.imul(ah1,bh8),lo+=Math.imul(al0,bl9),mid+=Math.imul(al0,bh9),mid+=Math.imul(ah0,bl9),hi+=Math.imul(ah0,bh9);var w9=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w9>>>26),w9&=67108863,lo=Math.imul(al9,bl1),mid=Math.imul(al9,bh1),mid+=Math.imul(ah9,bl1),hi=Math.imul(ah9,bh1),lo+=Math.imul(al8,bl2),mid+=Math.imul(al8,bh2),mid+=Math.imul(ah8,bl2),hi+=Math.imul(ah8,bh2),lo+=Math.imul(al7,bl3),mid+=Math.imul(al7,bh3),mid+=Math.imul(ah7,bl3),hi+=Math.imul(ah7,bh3),lo+=Math.imul(al6,bl4),mid+=Math.imul(al6,bh4),mid+=Math.imul(ah6,bl4),hi+=Math.imul(ah6,bh4),lo+=Math.imul(al5,bl5),mid+=Math.imul(al5,bh5),mid+=Math.imul(ah5,bl5),hi+=Math.imul(ah5,bh5),lo+=Math.imul(al4,bl6),mid+=Math.imul(al4,bh6),mid+=Math.imul(ah4,bl6),hi+=Math.imul(ah4,bh6),lo+=Math.imul(al3,bl7),mid+=Math.imul(al3,bh7),mid+=Math.imul(ah3,bl7),hi+=Math.imul(ah3,bh7),lo+=Math.imul(al2,bl8),mid+=Math.imul(al2,bh8),mid+=Math.imul(ah2,bl8),hi+=Math.imul(ah2,bh8),lo+=Math.imul(al1,bl9),mid+=Math.imul(al1,bh9),mid+=Math.imul(ah1,bl9),hi+=Math.imul(ah1,bh9);var w10=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w10>>>26),w10&=67108863,lo=Math.imul(al9,bl2),mid=Math.imul(al9,bh2),mid+=Math.imul(ah9,bl2),hi=Math.imul(ah9,bh2),lo+=Math.imul(al8,bl3),mid+=Math.imul(al8,bh3),mid+=Math.imul(ah8,bl3),hi+=Math.imul(ah8,bh3),lo+=Math.imul(al7,bl4),mid+=Math.imul(al7,bh4),mid+=Math.imul(ah7,bl4),hi+=Math.imul(ah7,bh4),lo+=Math.imul(al6,bl5),mid+=Math.imul(al6,bh5),mid+=Math.imul(ah6,bl5),hi+=Math.imul(ah6,bh5),lo+=Math.imul(al5,bl6),mid+=Math.imul(al5,bh6),mid+=Math.imul(ah5,bl6),hi+=Math.imul(ah5,bh6),lo+=Math.imul(al4,bl7),mid+=Math.imul(al4,bh7),mid+=Math.imul(ah4,bl7),hi+=Math.imul(ah4,bh7),lo+=Math.imul(al3,bl8),mid+=Math.imul(al3,bh8),mid+=Math.imul(ah3,bl8),hi+=Math.imul(ah3,bh8),lo+=Math.imul(al2,bl9),mid+=Math.imul(al2,bh9),mid+=Math.imul(ah2,bl9),hi+=Math.imul(ah2,bh9);var w11=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w11>>>26),w11&=67108863,lo=Math.imul(al9,bl3),mid=Math.imul(al9,bh3),mid+=Math.imul(ah9,bl3),hi=Math.imul(ah9,bh3),lo+=Math.imul(al8,bl4),mid+=Math.imul(al8,bh4),mid+=Math.imul(ah8,bl4),hi+=Math.imul(ah8,bh4),lo+=Math.imul(al7,bl5),mid+=Math.imul(al7,bh5),mid+=Math.imul(ah7,bl5),hi+=Math.imul(ah7,bh5),lo+=Math.imul(al6,bl6),mid+=Math.imul(al6,bh6),mid+=Math.imul(ah6,bl6),hi+=Math.imul(ah6,bh6),lo+=Math.imul(al5,bl7),mid+=Math.imul(al5,bh7),mid+=Math.imul(ah5,bl7),hi+=Math.imul(ah5,bh7),lo+=Math.imul(al4,bl8),mid+=Math.imul(al4,bh8),mid+=Math.imul(ah4,bl8),hi+=Math.imul(ah4,bh8),lo+=Math.imul(al3,bl9),mid+=Math.imul(al3,bh9),mid+=Math.imul(ah3,bl9),hi+=Math.imul(ah3,bh9);var w12=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w12>>>26),w12&=67108863,lo=Math.imul(al9,bl4),mid=Math.imul(al9,bh4),mid+=Math.imul(ah9,bl4),hi=Math.imul(ah9,bh4),lo+=Math.imul(al8,bl5),mid+=Math.imul(al8,bh5),mid+=Math.imul(ah8,bl5),hi+=Math.imul(ah8,bh5),lo+=Math.imul(al7,bl6),mid+=Math.imul(al7,bh6),mid+=Math.imul(ah7,bl6),hi+=Math.imul(ah7,bh6),lo+=Math.imul(al6,bl7),mid+=Math.imul(al6,bh7),mid+=Math.imul(ah6,bl7),hi+=Math.imul(ah6,bh7),lo+=Math.imul(al5,bl8),mid+=Math.imul(al5,bh8),mid+=Math.imul(ah5,bl8),hi+=Math.imul(ah5,bh8),lo+=Math.imul(al4,bl9),mid+=Math.imul(al4,bh9),mid+=Math.imul(ah4,bl9),hi+=Math.imul(ah4,bh9);var w13=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w13>>>26),w13&=67108863,lo=Math.imul(al9,bl5),mid=Math.imul(al9,bh5),mid+=Math.imul(ah9,bl5),hi=Math.imul(ah9,bh5),lo+=Math.imul(al8,bl6),mid+=Math.imul(al8,bh6),mid+=Math.imul(ah8,bl6),hi+=Math.imul(ah8,bh6),lo+=Math.imul(al7,bl7),mid+=Math.imul(al7,bh7),mid+=Math.imul(ah7,bl7),hi+=Math.imul(ah7,bh7),lo+=Math.imul(al6,bl8),mid+=Math.imul(al6,bh8),mid+=Math.imul(ah6,bl8),hi+=Math.imul(ah6,bh8),lo+=Math.imul(al5,bl9),mid+=Math.imul(al5,bh9),mid+=Math.imul(ah5,bl9),hi+=Math.imul(ah5,bh9);var w14=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w14>>>26),w14&=67108863,lo=Math.imul(al9,bl6),mid=Math.imul(al9,bh6),mid+=Math.imul(ah9,bl6),hi=Math.imul(ah9,bh6),lo+=Math.imul(al8,bl7),mid+=Math.imul(al8,bh7),mid+=Math.imul(ah8,bl7),hi+=Math.imul(ah8,bh7),lo+=Math.imul(al7,bl8),mid+=Math.imul(al7,bh8),mid+=Math.imul(ah7,bl8),hi+=Math.imul(ah7,bh8),lo+=Math.imul(al6,bl9),mid+=Math.imul(al6,bh9),mid+=Math.imul(ah6,bl9),hi+=Math.imul(ah6,bh9);var w15=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w15>>>26),w15&=67108863,lo=Math.imul(al9,bl7),mid=Math.imul(al9,bh7),mid+=Math.imul(ah9,bl7),hi=Math.imul(ah9,bh7),lo+=Math.imul(al8,bl8),mid+=Math.imul(al8,bh8),mid+=Math.imul(ah8,bl8),hi+=Math.imul(ah8,bh8),lo+=Math.imul(al7,bl9),mid+=Math.imul(al7,bh9),mid+=Math.imul(ah7,bl9),hi+=Math.imul(ah7,bh9);var w16=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w16>>>26),w16&=67108863,lo=Math.imul(al9,bl8),mid=Math.imul(al9,bh8),mid+=Math.imul(ah9,bl8),hi=Math.imul(ah9,bh8),lo+=Math.imul(al8,bl9),mid+=Math.imul(al8,bh9),mid+=Math.imul(ah8,bl9),hi+=Math.imul(ah8,bh9);var w17=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w17>>>26),w17&=67108863,lo=Math.imul(al9,bl9),mid=Math.imul(al9,bh9),mid+=Math.imul(ah9,bl9),hi=Math.imul(ah9,bh9);var w18=c+lo+((8191&mid)<<13);return c=hi+(mid>>>13)+(w18>>>26),w18&=67108863,o[0]=w0,o[1]=w1,o[2]=w2,o[3]=w3,o[4]=w4,o[5]=w5,o[6]=w6,o[7]=w7,o[8]=w8,o[9]=w9,o[10]=w10,o[11]=w11,o[12]=w12,o[13]=w13,o[14]=w14,o[15]=w15,o[16]=w16,o[17]=w17,o[18]=w18,0!==c&&(o[19]=c,out.length++),out}},function(module,exports,__webpack_require__){"use strict";function ECPointG(){this.x=BN.fromBuffer(Buffer.from("79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","hex")),this.y=BN.fromBuffer(Buffer.from("483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8","hex")),this.inf=!1,this._precompute()}var Buffer=__webpack_require__(5).Buffer,BN=__webpack_require__(104),ECPoint=__webpack_require__(273),ECJPoint=__webpack_require__(272);ECPointG.prototype._precompute=function(){for(var ecpoint=new ECPoint(this.x,this.y),points=new Array(1+Math.ceil(64.25)),acc=points[0]=ecpoint,i=1;i=j;k--)nafW=(nafW<<1)+naf[k];repr.push(nafW)}for(var a=new ECJPoint(null,null,null),b=new ECJPoint(null,null,null),i=I;i>0;i--){for(var jj=0;jj=0;i--){for(var k=0;i>=0&&(tmp[0]=0|naf[0][i],tmp[1]=0|naf[1][i],0===tmp[0]&&0===tmp[1]);++k,--i);if(i>=0&&(k+=1),acc=acc.dblp(k),i<0)break;for(var jj=0;jj<2;jj++){var p,z=tmp[jj];0!==z&&(z>0?p=wnd[jj][z>>1]:z<0&&(p=wnd[jj][-z>>1].neg()),acc=void 0===p.z?acc.mixedAdd(p):acc.add(p))}}return acc},module.exports=new ECPointG},function(module,exports,__webpack_require__){"use strict";var Buffer=__webpack_require__(5).Buffer,createHash=__webpack_require__(63),HmacDRBG=__webpack_require__(343),messages=__webpack_require__(126),BN=__webpack_require__(104),ECPoint=__webpack_require__(273),g=__webpack_require__(667);exports.privateKeyVerify=function(privateKey){var bn=BN.fromBuffer(privateKey);return!(bn.isOverflow()||bn.isZero())},exports.privateKeyExport=function(privateKey,compressed){var d=BN.fromBuffer(privateKey);if(d.isOverflow()||d.isZero())throw new Error(messages.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return g.mul(d).toPublicKey(compressed)},exports.privateKeyTweakAdd=function(privateKey,tweak){var bn=BN.fromBuffer(tweak);if(bn.isOverflow())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(bn.iadd(BN.fromBuffer(privateKey)),bn.isOverflow()&&bn.isub(BN.n),bn.isZero())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return bn.toBuffer()},exports.privateKeyTweakMul=function(privateKey,tweak){var bn=BN.fromBuffer(tweak);if(bn.isOverflow()||bn.isZero())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);var d=BN.fromBuffer(privateKey);return bn.umul(d).ureduce().toBuffer()},exports.publicKeyCreate=function(privateKey,compressed){var d=BN.fromBuffer(privateKey);if(d.isOverflow()||d.isZero())throw new Error(messages.EC_PUBLIC_KEY_CREATE_FAIL);return g.mul(d).toPublicKey(compressed)},exports.publicKeyConvert=function(publicKey,compressed){var point=ECPoint.fromPublicKey(publicKey);if(null===point)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);return point.toPublicKey(compressed)},exports.publicKeyVerify=function(publicKey){return null!==ECPoint.fromPublicKey(publicKey)},exports.publicKeyTweakAdd=function(publicKey,tweak,compressed){var point=ECPoint.fromPublicKey(publicKey);if(null===point)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);if(tweak=BN.fromBuffer(tweak),tweak.isOverflow())throw new Error(messages.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return g.mul(tweak).add(point).toPublicKey(compressed)},exports.publicKeyTweakMul=function(publicKey,tweak,compressed){var point=ECPoint.fromPublicKey(publicKey);if(null===point)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);if(tweak=BN.fromBuffer(tweak),tweak.isOverflow()||tweak.isZero())throw new Error(messages.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return point.mul(tweak).toPublicKey(compressed)},exports.publicKeyCombine=function(publicKeys,compressed){for(var points=new Array(publicKeys.length),i=0;i=0)&&0===sigr.iadd(BN.psn).redMul(z2).ucmp(point.x)},exports.recover=function(message,signature,recovery,compressed){var sigr=BN.fromBuffer(signature.slice(0,32)),sigs=BN.fromBuffer(signature.slice(32,64));if(sigr.isOverflow()||sigs.isOverflow())throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);do{if(sigr.isZero()||sigs.isZero())break;var kpx=sigr;if(recovery>>1){if(kpx.ucmp(BN.psn)>=0)break;kpx=sigr.add(BN.n)}var kpPublicKey=Buffer.concat([Buffer.from([2+(1&recovery)]),kpx.toBuffer()]),kp=ECPoint.fromPublicKey(kpPublicKey);if(null===kp)break;var rInv=sigr.uinvm(),s1=BN.n.sub(BN.fromBuffer(message)).umul(rInv).ureduce(),s2=sigs.umul(rInv).ureduce();return ECPoint.fromECJPoint(g.mulAdd(s1,kp,s2)).toPublicKey(compressed)}while(!1);throw new Error(messages.ECDSA_RECOVER_FAIL)},exports.ecdh=function(publicKey,privateKey){var shared=exports.ecdhUnsafe(publicKey,privateKey,!0);return createHash("sha256").update(shared).digest()},exports.ecdhUnsafe=function(publicKey,privateKey,compressed){var point=ECPoint.fromPublicKey(publicKey);if(null===point)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);var scalar=BN.fromBuffer(privateKey);if(scalar.isOverflow()||scalar.isZero())throw new Error(messages.ECDH_FAIL);return point.mul(scalar).toPublicKey(compressed)}},function(module,exports,__webpack_require__){(function(process){function parse(version,loose){if(version instanceof SemVer)return version;if("string"!=typeof version)return null;if(version.length>MAX_LENGTH)return null;if(!(loose?re[LOOSE]:re[FULL]).test(version))return null;try{return new SemVer(version,loose)}catch(er){return null}}function valid(version,loose){var v=parse(version,loose);return v?v.version:null}function clean(version,loose){var s=parse(version.trim().replace(/^[=v]+/,""),loose);return s?s.version:null}function SemVer(version,loose){if(version instanceof SemVer){if(version.loose===loose)return version;version=version.version}else if("string"!=typeof version)throw new TypeError("Invalid Version: "+version);if(version.length>MAX_LENGTH)throw new TypeError("version is longer than "+MAX_LENGTH+" characters");if(!(this instanceof SemVer))return new SemVer(version,loose);debug("SemVer",version,loose),this.loose=loose;var m=version.trim().match(loose?re[LOOSE]:re[FULL]);if(!m)throw new TypeError("Invalid Version: "+version);if(this.raw=version,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>MAX_SAFE_INTEGER||this.major<0)throw new TypeError("Invalid major version");if(this.minor>MAX_SAFE_INTEGER||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>MAX_SAFE_INTEGER||this.patch<0)throw new TypeError("Invalid patch version");m[4]?this.prerelease=m[4].split(".").map(function(id){if(/^[0-9]+$/.test(id)){var num=+id;if(num>=0&&numb?1:0}function rcompareIdentifiers(a,b){return compareIdentifiers(b,a)}function major(a,loose){return new SemVer(a,loose).major}function minor(a,loose){return new SemVer(a,loose).minor}function patch(a,loose){return new SemVer(a,loose).patch}function compare(a,b,loose){return new SemVer(a,loose).compare(new SemVer(b,loose))}function compareLoose(a,b){return compare(a,b,!0)}function rcompare(a,b,loose){return compare(b,a,loose)}function sort(list,loose){return list.sort(function(a,b){return exports.compare(a,b,loose)})}function rsort(list,loose){return list.sort(function(a,b){return exports.rcompare(a,b,loose)})}function gt(a,b,loose){return compare(a,b,loose)>0}function lt(a,b,loose){return compare(a,b,loose)<0}function eq(a,b,loose){return 0===compare(a,b,loose)}function neq(a,b,loose){return 0!==compare(a,b,loose)}function gte(a,b,loose){return compare(a,b,loose)>=0}function lte(a,b,loose){return compare(a,b,loose)<=0}function cmp(a,op,b,loose){var ret;switch(op){case"===":"object"==typeof a&&(a=a.version),"object"==typeof b&&(b=b.version),ret=a===b;break;case"!==":"object"==typeof a&&(a=a.version),"object"==typeof b&&(b=b.version),ret=a!==b;break;case"":case"=":case"==":ret=eq(a,b,loose);break;case"!=":ret=neq(a,b,loose);break;case">":ret=gt(a,b,loose);break;case">=":ret=gte(a,b,loose);break;case"<":ret=lt(a,b,loose);break;case"<=":ret=lte(a,b,loose);break;default:throw new TypeError("Invalid operator: "+op)}return ret}function Comparator(comp,loose){if(comp instanceof Comparator){if(comp.loose===loose)return comp;comp=comp.value}if(!(this instanceof Comparator))return new Comparator(comp,loose);debug("comparator",comp,loose),this.loose=loose,this.parse(comp),this.semver===ANY?this.value="":this.value=this.operator+this.semver.version,debug("comp",this)}function Range(range,loose){if(range instanceof Range)return range.loose===loose?range:new Range(range.raw,loose);if(range instanceof Comparator)return new Range(range.value,loose);if(!(this instanceof Range))return new Range(range,loose);if(this.loose=loose,this.raw=range,this.set=range.split(/\s*\|\|\s*/).map(function(range){return this.parseRange(range.trim())},this).filter(function(c){return c.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+range);this.format()}function toComparators(range,loose){return new Range(range,loose).set.map(function(comp){return comp.map(function(c){return c.value}).join(" ").trim().split(" ")})}function parseComparator(comp,loose){return debug("comp",comp),comp=replaceCarets(comp,loose),debug("caret",comp),comp=replaceTildes(comp,loose),debug("tildes",comp),comp=replaceXRanges(comp,loose),debug("xrange",comp),comp=replaceStars(comp,loose),debug("stars",comp),comp}function isX(id){return!id||"x"===id.toLowerCase()||"*"===id}function replaceTildes(comp,loose){return comp.trim().split(/\s+/).map(function(comp){return replaceTilde(comp,loose)}).join(" ")}function replaceTilde(comp,loose){var r=loose?re[TILDELOOSE]:re[TILDE];return comp.replace(r,function(_,M,m,p,pr){debug("tilde",comp,_,M,m,p,pr);var ret;return isX(M)?ret="":isX(m)?ret=">="+M+".0.0 <"+(+M+1)+".0.0":isX(p)?ret=">="+M+"."+m+".0 <"+M+"."+(+m+1)+".0":pr?(debug("replaceTilde pr",pr),"-"!==pr.charAt(0)&&(pr="-"+pr),ret=">="+M+"."+m+"."+p+pr+" <"+M+"."+(+m+1)+".0"):ret=">="+M+"."+m+"."+p+" <"+M+"."+(+m+1)+".0",debug("tilde return",ret),ret})}function replaceCarets(comp,loose){return comp.trim().split(/\s+/).map(function(comp){return replaceCaret(comp,loose)}).join(" ")}function replaceCaret(comp,loose){debug("caret",comp,loose);var r=loose?re[CARETLOOSE]:re[CARET];return comp.replace(r,function(_,M,m,p,pr){debug("caret",comp,_,M,m,p,pr);var ret +;return isX(M)?ret="":isX(m)?ret=">="+M+".0.0 <"+(+M+1)+".0.0":isX(p)?ret="0"===M?">="+M+"."+m+".0 <"+M+"."+(+m+1)+".0":">="+M+"."+m+".0 <"+(+M+1)+".0.0":pr?(debug("replaceCaret pr",pr),"-"!==pr.charAt(0)&&(pr="-"+pr),ret="0"===M?"0"===m?">="+M+"."+m+"."+p+pr+" <"+M+"."+m+"."+(+p+1):">="+M+"."+m+"."+p+pr+" <"+M+"."+(+m+1)+".0":">="+M+"."+m+"."+p+pr+" <"+(+M+1)+".0.0"):(debug("no pr"),ret="0"===M?"0"===m?">="+M+"."+m+"."+p+" <"+M+"."+m+"."+(+p+1):">="+M+"."+m+"."+p+" <"+M+"."+(+m+1)+".0":">="+M+"."+m+"."+p+" <"+(+M+1)+".0.0"),debug("caret return",ret),ret})}function replaceXRanges(comp,loose){return debug("replaceXRanges",comp,loose),comp.split(/\s+/).map(function(comp){return replaceXRange(comp,loose)}).join(" ")}function replaceXRange(comp,loose){comp=comp.trim();var r=loose?re[XRANGELOOSE]:re[XRANGE];return comp.replace(r,function(ret,gtlt,M,m,p,pr){debug("xRange",comp,ret,gtlt,M,m,p,pr);var xM=isX(M),xm=xM||isX(m),xp=xm||isX(p),anyX=xp;return"="===gtlt&&anyX&&(gtlt=""),xM?ret=">"===gtlt||"<"===gtlt?"<0.0.0":"*":gtlt&&anyX?(xm&&(m=0),xp&&(p=0),">"===gtlt?(gtlt=">=",xm?(M=+M+1,m=0,p=0):xp&&(m=+m+1,p=0)):"<="===gtlt&&(gtlt="<",xm?M=+M+1:m=+m+1),ret=gtlt+M+"."+m+"."+p):xm?ret=">="+M+".0.0 <"+(+M+1)+".0.0":xp&&(ret=">="+M+"."+m+".0 <"+M+"."+(+m+1)+".0"),debug("xRange return",ret),ret})}function replaceStars(comp,loose){return debug("replaceStars",comp,loose),comp.trim().replace(re[STAR],"")}function hyphenReplace($0,from,fM,fm,fp,fpr,fb,to,tM,tm,tp,tpr,tb){return from=isX(fM)?"":isX(fm)?">="+fM+".0.0":isX(fp)?">="+fM+"."+fm+".0":">="+from,to=isX(tM)?"":isX(tm)?"<"+(+tM+1)+".0.0":isX(tp)?"<"+tM+"."+(+tm+1)+".0":tpr?"<="+tM+"."+tm+"."+tp+"-"+tpr:"<="+to,(from+" "+to).trim()}function testSet(set,version){for(var i=0;i0){var allowed=set[i].semver;if(allowed.major===version.major&&allowed.minor===version.minor&&allowed.patch===version.patch)return!0}return!1}return!0}function satisfies(version,range,loose){try{range=new Range(range,loose)}catch(er){return!1}return range.test(version)}function maxSatisfying(versions,range,loose){var max=null,maxSV=null;try{var rangeObj=new Range(range,loose)}catch(er){return null}return versions.forEach(function(v){rangeObj.test(v)&&(max&&maxSV.compare(v)!==-1||(max=v,maxSV=new SemVer(max,loose)))}),max}function minSatisfying(versions,range,loose){var min=null,minSV=null;try{var rangeObj=new Range(range,loose)}catch(er){return null}return versions.forEach(function(v){rangeObj.test(v)&&(min&&1!==minSV.compare(v)||(min=v,minSV=new SemVer(min,loose)))}),min}function validRange(range,loose){try{return new Range(range,loose).range||"*"}catch(er){return null}}function ltr(version,range,loose){return outside(version,range,"<",loose)}function gtr(version,range,loose){return outside(version,range,">",loose)}function outside(version,range,hilo,loose){version=new SemVer(version,loose),range=new Range(range,loose);var gtfn,ltefn,ltfn,comp,ecomp;switch(hilo){case">":gtfn=gt,ltefn=lte,ltfn=lt,comp=">",ecomp=">=";break;case"<":gtfn=lt,ltefn=gte,ltfn=gt,comp="<",ecomp="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(satisfies(version,range,loose))return!1;for(var i=0;i=0.0.0")),high=high||comparator,low=low||comparator,gtfn(comparator.semver,high.semver,loose)?high=comparator:ltfn(comparator.semver,low.semver,loose)&&(low=comparator)}),high.operator===comp||high.operator===ecomp)return!1;if((!low.operator||low.operator===comp)&<efn(version,low.semver))return!1;if(low.operator===ecomp&<fn(version,low.semver))return!1}return!0}function prerelease(version,loose){var parsed=parse(version,loose);return parsed&&parsed.prerelease.length?parsed.prerelease:null}function intersects(r1,r2,loose){return r1=new Range(r1,loose),r2=new Range(r2,loose),r1.intersects(r2)}exports=module.exports=SemVer;var debug;debug="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var args=Array.prototype.slice.call(arguments,0);args.unshift("SEMVER"),console.log.apply(console,args)}:function(){},exports.SEMVER_SPEC_VERSION="2.0.0";var MAX_LENGTH=256,MAX_SAFE_INTEGER=Number.MAX_SAFE_INTEGER||9007199254740991,re=exports.re=[],src=exports.src=[],R=0,NUMERICIDENTIFIER=R++;src[NUMERICIDENTIFIER]="0|[1-9]\\d*";var NUMERICIDENTIFIERLOOSE=R++;src[NUMERICIDENTIFIERLOOSE]="[0-9]+";var NONNUMERICIDENTIFIER=R++;src[NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var MAINVERSION=R++;src[MAINVERSION]="("+src[NUMERICIDENTIFIER]+")\\.("+src[NUMERICIDENTIFIER]+")\\.("+src[NUMERICIDENTIFIER]+")";var MAINVERSIONLOOSE=R++;src[MAINVERSIONLOOSE]="("+src[NUMERICIDENTIFIERLOOSE]+")\\.("+src[NUMERICIDENTIFIERLOOSE]+")\\.("+src[NUMERICIDENTIFIERLOOSE]+")";var PRERELEASEIDENTIFIER=R++;src[PRERELEASEIDENTIFIER]="(?:"+src[NUMERICIDENTIFIER]+"|"+src[NONNUMERICIDENTIFIER]+")";var PRERELEASEIDENTIFIERLOOSE=R++;src[PRERELEASEIDENTIFIERLOOSE]="(?:"+src[NUMERICIDENTIFIERLOOSE]+"|"+src[NONNUMERICIDENTIFIER]+")";var PRERELEASE=R++;src[PRERELEASE]="(?:-("+src[PRERELEASEIDENTIFIER]+"(?:\\."+src[PRERELEASEIDENTIFIER]+")*))";var PRERELEASELOOSE=R++;src[PRERELEASELOOSE]="(?:-?("+src[PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+src[PRERELEASEIDENTIFIERLOOSE]+")*))";var BUILDIDENTIFIER=R++;src[BUILDIDENTIFIER]="[0-9A-Za-z-]+";var BUILD=R++;src[BUILD]="(?:\\+("+src[BUILDIDENTIFIER]+"(?:\\."+src[BUILDIDENTIFIER]+")*))";var FULL=R++,FULLPLAIN="v?"+src[MAINVERSION]+src[PRERELEASE]+"?"+src[BUILD]+"?";src[FULL]="^"+FULLPLAIN+"$";var LOOSEPLAIN="[v=\\s]*"+src[MAINVERSIONLOOSE]+src[PRERELEASELOOSE]+"?"+src[BUILD]+"?",LOOSE=R++;src[LOOSE]="^"+LOOSEPLAIN+"$";var GTLT=R++;src[GTLT]="((?:<|>)?=?)";var XRANGEIDENTIFIERLOOSE=R++;src[XRANGEIDENTIFIERLOOSE]=src[NUMERICIDENTIFIERLOOSE]+"|x|X|\\*";var XRANGEIDENTIFIER=R++;src[XRANGEIDENTIFIER]=src[NUMERICIDENTIFIER]+"|x|X|\\*";var XRANGEPLAIN=R++;src[XRANGEPLAIN]="[v=\\s]*("+src[XRANGEIDENTIFIER]+")(?:\\.("+src[XRANGEIDENTIFIER]+")(?:\\.("+src[XRANGEIDENTIFIER]+")(?:"+src[PRERELEASE]+")?"+src[BUILD]+"?)?)?";var XRANGEPLAINLOOSE=R++;src[XRANGEPLAINLOOSE]="[v=\\s]*("+src[XRANGEIDENTIFIERLOOSE]+")(?:\\.("+src[XRANGEIDENTIFIERLOOSE]+")(?:\\.("+src[XRANGEIDENTIFIERLOOSE]+")(?:"+src[PRERELEASELOOSE]+")?"+src[BUILD]+"?)?)?";var XRANGE=R++;src[XRANGE]="^"+src[GTLT]+"\\s*"+src[XRANGEPLAIN]+"$";var XRANGELOOSE=R++;src[XRANGELOOSE]="^"+src[GTLT]+"\\s*"+src[XRANGEPLAINLOOSE]+"$";var LONETILDE=R++;src[LONETILDE]="(?:~>?)";var TILDETRIM=R++;src[TILDETRIM]="(\\s*)"+src[LONETILDE]+"\\s+",re[TILDETRIM]=new RegExp(src[TILDETRIM],"g");var TILDE=R++;src[TILDE]="^"+src[LONETILDE]+src[XRANGEPLAIN]+"$";var TILDELOOSE=R++;src[TILDELOOSE]="^"+src[LONETILDE]+src[XRANGEPLAINLOOSE]+"$";var LONECARET=R++;src[LONECARET]="(?:\\^)";var CARETTRIM=R++;src[CARETTRIM]="(\\s*)"+src[LONECARET]+"\\s+",re[CARETTRIM]=new RegExp(src[CARETTRIM],"g");var CARET=R++;src[CARET]="^"+src[LONECARET]+src[XRANGEPLAIN]+"$";var CARETLOOSE=R++;src[CARETLOOSE]="^"+src[LONECARET]+src[XRANGEPLAINLOOSE]+"$";var COMPARATORLOOSE=R++;src[COMPARATORLOOSE]="^"+src[GTLT]+"\\s*("+LOOSEPLAIN+")$|^$";var COMPARATOR=R++;src[COMPARATOR]="^"+src[GTLT]+"\\s*("+FULLPLAIN+")$|^$";var COMPARATORTRIM=R++;src[COMPARATORTRIM]="(\\s*)"+src[GTLT]+"\\s*("+LOOSEPLAIN+"|"+src[XRANGEPLAIN]+")",re[COMPARATORTRIM]=new RegExp(src[COMPARATORTRIM],"g");var HYPHENRANGE=R++;src[HYPHENRANGE]="^\\s*("+src[XRANGEPLAIN]+")\\s+-\\s+("+src[XRANGEPLAIN]+")\\s*$";var HYPHENRANGELOOSE=R++;src[HYPHENRANGELOOSE]="^\\s*("+src[XRANGEPLAINLOOSE]+")\\s+-\\s+("+src[XRANGEPLAINLOOSE]+")\\s*$";var STAR=R++;src[STAR]="(<|>)?=?\\s*\\*";for(var i=0;i=0;)"number"==typeof this.prerelease[i]&&(this.prerelease[i]++,i=-2);i===-1&&this.prerelease.push(0)}identifier&&(this.prerelease[0]===identifier?isNaN(this.prerelease[1])&&(this.prerelease=[identifier,0]):this.prerelease=[identifier,0]);break;default:throw new Error("invalid increment argument: "+release)}return this.format(),this.raw=this.version,this},exports.inc=inc,exports.diff=diff,exports.compareIdentifiers=compareIdentifiers;var numeric=/^[0-9]+$/;exports.rcompareIdentifiers=rcompareIdentifiers,exports.major=major,exports.minor=minor,exports.patch=patch,exports.compare=compare,exports.compareLoose=compareLoose,exports.rcompare=rcompare,exports.sort=sort,exports.rsort=rsort,exports.gt=gt,exports.lt=lt,exports.eq=eq,exports.neq=neq,exports.gte=gte,exports.lte=lte,exports.cmp=cmp,exports.Comparator=Comparator;var ANY={};Comparator.prototype.parse=function(comp){var r=this.loose?re[COMPARATORLOOSE]:re[COMPARATOR],m=comp.match(r);if(!m)throw new TypeError("Invalid comparator: "+comp);this.operator=m[1],"="===this.operator&&(this.operator=""),m[2]?this.semver=new SemVer(m[2],this.loose):this.semver=ANY},Comparator.prototype.toString=function(){return this.value},Comparator.prototype.test=function(version){return debug("Comparator.test",version,this.loose),this.semver===ANY||("string"==typeof version&&(version=new SemVer(version,this.loose)),cmp(version,this.operator,this.semver,this.loose))},Comparator.prototype.intersects=function(comp,loose){if(!(comp instanceof Comparator))throw new TypeError("a Comparator is required");var rangeTmp;if(""===this.operator)return rangeTmp=new Range(comp.value,loose),satisfies(this.value,rangeTmp,loose);if(""===comp.operator)return rangeTmp=new Range(this.value,loose),satisfies(comp.semver,rangeTmp,loose);var sameDirectionIncreasing=!(">="!==this.operator&&">"!==this.operator||">="!==comp.operator&&">"!==comp.operator),sameDirectionDecreasing=!("<="!==this.operator&&"<"!==this.operator||"<="!==comp.operator&&"<"!==comp.operator),sameSemVer=this.semver.version===comp.semver.version,differentDirectionsInclusive=!(">="!==this.operator&&"<="!==this.operator||">="!==comp.operator&&"<="!==comp.operator),oppositeDirectionsLessThan=cmp(this.semver,"<",comp.semver,loose)&&(">="===this.operator||">"===this.operator)&&("<="===comp.operator||"<"===comp.operator),oppositeDirectionsGreaterThan=cmp(this.semver,">",comp.semver,loose)&&("<="===this.operator||"<"===this.operator)&&(">="===comp.operator||">"===comp.operator);return sameDirectionIncreasing||sameDirectionDecreasing||sameSemVer&&differentDirectionsInclusive||oppositeDirectionsLessThan||oppositeDirectionsGreaterThan},exports.Range=Range,Range.prototype.format=function(){return this.range=this.set.map(function(comps){return comps.join(" ").trim()}).join("||").trim(),this.range},Range.prototype.toString=function(){return this.range},Range.prototype.parseRange=function(range){var loose=this.loose;range=range.trim(),debug("range",range,loose);var hr=loose?re[HYPHENRANGELOOSE]:re[HYPHENRANGE];range=range.replace(hr,hyphenReplace),debug("hyphen replace",range),range=range.replace(re[COMPARATORTRIM],"$1$2$3"),debug("comparator trim",range,re[COMPARATORTRIM]),range=range.replace(re[TILDETRIM],"$1~"),range=range.replace(re[CARETTRIM],"$1^"),range=range.split(/\s+/).join(" ");var compRe=loose?re[COMPARATORLOOSE]:re[COMPARATOR],set=range.split(" ").map(function(comp){return parseComparator(comp,loose)}).join(" ").split(/\s+/);return this.loose&&(set=set.filter(function(comp){return!!comp.match(compRe)})),set=set.map(function(comp){return new Comparator(comp,loose)})},Range.prototype.intersects=function(range,loose){if(!(range instanceof Range))throw new TypeError("a Range is required");return this.set.some(function(thisComparators){return thisComparators.every(function(thisComparator){return range.set.some(function(rangeComparators){return rangeComparators.every(function(rangeComparator){return thisComparator.intersects(rangeComparator,loose)})})})})},exports.toComparators=toComparators,Range.prototype.test=function(version){if(!version)return!1;"string"==typeof version&&(version=new SemVer(version,this.loose));for(var i=0;i>>27}function rotl30(num){return num<<30|num>>>2}function ft(s,b,c,d){return 0===s?b&c|~b&d:2===s?b&c|b&d|c&d:b^c^d}var inherits=__webpack_require__(2),Hash=__webpack_require__(59),K=[1518500249,1859775393,-1894007588,-899497514],W=new Array(80);inherits(Sha,Hash),Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha.prototype._update=function(M){for(var W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<80;++i)W[i]=W[i-3]^W[i-8]^W[i-14]^W[i-16];for(var j=0;j<80;++j){var s=~~(j/20),t=rotl5(a)+ft(s,b,c,d)+e+W[j]+K[s]|0;e=d,d=c,c=rotl30(b),b=a,a=t}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0},Sha.prototype._hash=function(){var H=new Buffer(20);return H.writeInt32BE(0|this._a,0),H.writeInt32BE(0|this._b,4),H.writeInt32BE(0|this._c,8),H.writeInt32BE(0|this._d,12),H.writeInt32BE(0|this._e,16),H},module.exports=Sha}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Sha1(){this.init(),this._w=W,Hash.call(this,64,56)}function rotl1(num){return num<<1|num>>>31}function rotl5(num){return num<<5|num>>>27}function rotl30(num){return num<<30|num>>>2}function ft(s,b,c,d){return 0===s?b&c|~b&d:2===s?b&c|b&d|c&d:b^c^d}var inherits=__webpack_require__(2),Hash=__webpack_require__(59),K=[1518500249,1859775393,-1894007588,-899497514],W=new Array(80);inherits(Sha1,Hash),Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha1.prototype._update=function(M){for(var W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<80;++i)W[i]=rotl1(W[i-3]^W[i-8]^W[i-14]^W[i-16]);for(var j=0;j<80;++j){var s=~~(j/20),t=rotl5(a)+ft(s,b,c,d)+e+W[j]+K[s]|0;e=d,d=c,c=rotl30(b),b=a,a=t}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0},Sha1.prototype._hash=function(){var H=new Buffer(20);return H.writeInt32BE(0|this._a,0),H.writeInt32BE(0|this._b,4),H.writeInt32BE(0|this._c,8),H.writeInt32BE(0|this._d,12),H.writeInt32BE(0|this._e,16),H},module.exports=Sha1}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Sha224(){this.init(),this._w=W,Hash.call(this,64,56)}var inherits=__webpack_require__(2),Sha256=__webpack_require__(275),Hash=__webpack_require__(59),W=new Array(64);inherits(Sha224,Sha256),Sha224.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},Sha224.prototype._hash=function(){var H=new Buffer(28);return H.writeInt32BE(this._a,0),H.writeInt32BE(this._b,4),H.writeInt32BE(this._c,8),H.writeInt32BE(this._d,12),H.writeInt32BE(this._e,16),H.writeInt32BE(this._f,20),H.writeInt32BE(this._g,24),H},module.exports=Sha224}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Sha384(){this.init(),this._w=W,Hash.call(this,128,112)}var inherits=__webpack_require__(2),SHA512=__webpack_require__(276),Hash=__webpack_require__(59),W=new Array(160);inherits(Sha384,SHA512),Sha384.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},Sha384.prototype._hash=function(){function writeInt64BE(h,l,offset){H.writeInt32BE(h,offset),H.writeInt32BE(l,offset+4)}var H=new Buffer(48);return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),H},module.exports=Sha384}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){var varint=__webpack_require__(14);exports.encode=function encode(v,b,o){v=v>=0?2*v:v*-2-1;var r=varint.encode(v,b,o);return encode.bytes=varint.encode.bytes,r},exports.decode=function decode(b,o){var v=varint.decode(b,o);return decode.bytes=varint.decode.bytes,1&v?(v+1)/-2:v/2},exports.encodingLength=function(v){return varint.encodingLength(v>=0?2*v:v*-2-1)}},function(module,exports,__webpack_require__){(function(Buffer){function Peer(opts){var self=this;if(!(self instanceof Peer))return new Peer(opts);if(self._id=randombytes(4).toString("hex").slice(0,7),self._debug("new peer %o",opts),opts=Object.assign({allowHalfOpen:!1},opts),stream.Duplex.call(self,opts),self.channelName=opts.initiator?opts.channelName||randombytes(20).toString("hex"):null,self._isChromium="undefined"!=typeof window&&!!window.webkitRTCPeerConnection,self.initiator=opts.initiator||!1,self.channelConfig=opts.channelConfig||Peer.channelConfig,self.config=opts.config||Peer.config,self.constraints=self._transformConstraints(opts.constraints||Peer.constraints),self.offerConstraints=self._transformConstraints(opts.offerConstraints||{}),self.answerConstraints=self._transformConstraints(opts.answerConstraints||{}),self.reconnectTimer=opts.reconnectTimer||!1,self.sdpTransform=opts.sdpTransform||function(sdp){return sdp},self.stream=opts.stream||!1,self.trickle=void 0===opts.trickle||opts.trickle,self._earlyMessage=null,self.destroyed=!1,self.connected=!1,self.remoteAddress=void 0,self.remoteFamily=void 0,self.remotePort=void 0,self.localAddress=void 0,self.localPort=void 0,self._wrtc=opts.wrtc&&"object"==typeof opts.wrtc?opts.wrtc:getBrowserRTC(),!self._wrtc)throw"undefined"==typeof window?new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"):new Error("No WebRTC support: Not a supported browser");if(self._pcReady=!1,self._channelReady=!1,self._iceComplete=!1,self._channel=null,self._pendingCandidates=[],self._previousStreams=[],self._chunk=null,self._cb=null,self._interval=null,self._reconnectTimeout=null,self._pc=new self._wrtc.RTCPeerConnection(self.config,self.constraints),self._isWrtc=Array.isArray(self._pc.RTCIceConnectionStates),self._isReactNativeWebrtc="number"==typeof self._pc._peerConnectionId,self._pc.oniceconnectionstatechange=function(){self._onIceStateChange()},self._pc.onicegatheringstatechange=function(){self._onIceStateChange()},self._pc.onsignalingstatechange=function(){self._onSignalingStateChange()},self._pc.onicecandidate=function(event){self._onIceCandidate(event)},self.initiator){var createdOffer=!1;self._pc.onnegotiationneeded=function(){createdOffer||self._createOffer(),createdOffer=!0},self._setupData({channel:self._pc.createDataChannel(self.channelName,self.channelConfig)})}else self._pc.ondatachannel=function(event){self._setupData(event)};"addTrack"in self._pc?(self.stream&&self.stream.getTracks().forEach(function(track){self._pc.addTrack(track,self.stream)}),self._pc.ontrack=function(event){self._onTrack(event)}):(self.stream&&self._pc.addStream(self.stream),self._pc.onaddstream=function(event){self._onAddStream(event)}),self.initiator&&self._isWrtc&&self._pc.onnegotiationneeded(),self._onFinishBound=function(){self._onFinish()},self.once("finish",self._onFinishBound)}function noop(){}module.exports=Peer;var debug=__webpack_require__(677)("simple-peer"),getBrowserRTC=__webpack_require__(378),inherits=__webpack_require__(2),randombytes=__webpack_require__(654),stream=__webpack_require__(37);inherits(Peer,stream.Duplex),Peer.WEBRTC_SUPPORT=!!getBrowserRTC(),Peer.config={iceServers:[{urls:"stun:stun.l.google.com:19302"},{urls:"stun:global.stun.twilio.com:3478?transport=udp"}]},Peer.constraints={},Peer.channelConfig={},Object.defineProperty(Peer.prototype,"bufferSize",{get:function(){var self=this;return self._channel&&self._channel.bufferedAmount||0}}),Peer.prototype.address=function(){var self=this;return{port:self.localPort,family:"IPv4",address:self.localAddress}},Peer.prototype.signal=function(data){var self=this;if(self.destroyed)throw new Error("cannot signal after peer is destroyed");if("string"==typeof data)try{data=JSON.parse(data)}catch(err){data={}}self._debug("signal()"),data.candidate&&(self._pc.remoteDescription?self._addIceCandidate(data.candidate):self._pendingCandidates.push(data.candidate)),data.sdp&&self._pc.setRemoteDescription(new self._wrtc.RTCSessionDescription(data),function(){self.destroyed||(self._pendingCandidates.forEach(function(candidate){self._addIceCandidate(candidate)}),self._pendingCandidates=[],"offer"===self._pc.remoteDescription.type&&self._createAnswer())},function(err){self._destroy(err)}),data.sdp||data.candidate||self._destroy(new Error("signal() called with invalid signal data"))},Peer.prototype._addIceCandidate=function(candidate){var self=this;try{self._pc.addIceCandidate(new self._wrtc.RTCIceCandidate(candidate),noop,function(err){self._destroy(err)})}catch(err){self._destroy(new Error("error adding candidate: "+err.message))}},Peer.prototype.send=function(chunk){var self=this;self._isWrtc&&Buffer.isBuffer(chunk)&&(chunk=new Uint8Array(chunk)),self._channel.send(chunk)},Peer.prototype.destroy=function(onclose){this._destroy(null,onclose)},Peer.prototype._destroy=function(err,onclose){var self=this;if(!self.destroyed){if(onclose&&self.once("close",onclose),self._debug("destroy (error: %s)",err&&(err.message||err)),self.readable=self.writable=!1,self._readableState.ended||self.push(null),self._writableState.finished||self.end(),self.destroyed=!0,self.connected=!1,self._pcReady=!1,self._channelReady=!1,self._previousStreams=null,self._earlyMessage=null,clearInterval(self._interval),clearTimeout(self._reconnectTimeout),self._interval=null,self._reconnectTimeout=null,self._chunk=null,self._cb=null,self._onFinishBound&&self.removeListener("finish",self._onFinishBound),self._onFinishBound=null,self._pc){try{self._pc.close()}catch(err){}self._pc.oniceconnectionstatechange=null,self._pc.onicegatheringstatechange=null,self._pc.onsignalingstatechange=null,self._pc.onicecandidate=null,"addTrack"in self._pc?self._pc.ontrack=null:self._pc.onaddstream=null,self._pc.onnegotiationneeded=null,self._pc.ondatachannel=null}if(self._channel){try{self._channel.close()}catch(err){}self._channel.onmessage=null,self._channel.onopen=null,self._channel.onclose=null,self._channel.onerror=null}self._pc=null,self._channel=null,err&&self.emit("error",err),self.emit("close")}},Peer.prototype._setupData=function(event){var self=this;if(!event.channel)return self._destroy(new Error("Data channel event is missing `channel` property"));self._channel=event.channel,self._channel.binaryType="arraybuffer","number"==typeof self._channel.bufferedAmountLowThreshold&&(self._channel.bufferedAmountLowThreshold=65536),self.channelName=self._channel.label,self._channel.onmessage=function(event){self._channelReady?self._onChannelMessage(event):(self._earlyMessage=event,self._onChannelOpen())},self._channel.onbufferedamountlow=function(){self._onChannelBufferedAmountLow()},self._channel.onopen=function(){self._channelReady||self._onChannelOpen()},self._channel.onclose=function(){self._onChannelClose()},self._channel.onerror=function(err){self._destroy(err)}},Peer.prototype._read=function(){},Peer.prototype._write=function(chunk,encoding,cb){var self=this;if(self.destroyed)return cb(new Error("cannot write after peer is destroyed"));if(self.connected){try{self.send(chunk)}catch(err){return self._destroy(err)}self._channel.bufferedAmount>65536?(self._debug("start backpressure: bufferedAmount %d",self._channel.bufferedAmount),self._cb=cb):cb(null)}else self._debug("write before connect"),self._chunk=chunk,self._cb=cb},Peer.prototype._onFinish=function(){function destroySoon(){setTimeout(function(){self._destroy()},1e3)}var self=this;self.destroyed||(self.connected?destroySoon():self.once("connect",destroySoon))},Peer.prototype._createOffer=function(){var self=this;self.destroyed||self._pc.createOffer(function(offer){function onSuccess(){self.destroyed||(self.trickle||self._iceComplete?sendOffer():self.once("_iceComplete",sendOffer))}function onError(err){self._destroy(err)}function sendOffer(){var signal=self._pc.localDescription||offer;self._debug("signal"),self.emit("signal",{type:signal.type,sdp:signal.sdp})}self.destroyed||(offer.sdp=self.sdpTransform(offer.sdp),self._pc.setLocalDescription(offer,onSuccess,onError))},function(err){self._destroy(err)},self.offerConstraints)},Peer.prototype._createAnswer=function(){var self=this;self.destroyed||self._pc.createAnswer(function(answer){function onSuccess(){self.destroyed||(self.trickle||self._iceComplete?sendAnswer():self.once("_iceComplete",sendAnswer))}function onError(err){self._destroy(err)}function sendAnswer(){var signal=self._pc.localDescription||answer;self._debug("signal"),self.emit("signal",{type:signal.type,sdp:signal.sdp})}self.destroyed||(answer.sdp=self.sdpTransform(answer.sdp),self._pc.setLocalDescription(answer,onSuccess,onError))},function(err){self._destroy(err)},self.answerConstraints)},Peer.prototype._onIceStateChange=function(){var self=this;if(!self.destroyed){var iceConnectionState=self._pc.iceConnectionState,iceGatheringState=self._pc.iceGatheringState;self._debug("iceStateChange (connection: %s) (gathering: %s)",iceConnectionState,iceGatheringState),self.emit("iceStateChange",iceConnectionState,iceGatheringState),"connected"!==iceConnectionState&&"completed"!==iceConnectionState||(clearTimeout(self._reconnectTimeout),self._pcReady=!0,self._maybeReady()),"disconnected"===iceConnectionState&&(self.reconnectTimer?(clearTimeout(self._reconnectTimeout),self._reconnectTimeout=setTimeout(function(){self._destroy()},self.reconnectTimer)):self._destroy()),"failed"===iceConnectionState&&self._destroy(new Error("Ice connection failed.")),"closed"===iceConnectionState&&self._destroy()}},Peer.prototype.getStats=function(cb){var self=this;0===self._pc.getStats.length?self._pc.getStats().then(function(res){var reports=[];res.forEach(function(report){ +reports.push(report)}),cb(null,reports)},function(err){cb(err)}):self._isReactNativeWebrtc?self._pc.getStats(null,function(res){var reports=[];res.forEach(function(report){reports.push(report)}),cb(null,reports)},function(err){cb(err)}):self._pc.getStats.length>0?self._pc.getStats(function(res){var reports=[];res.result().forEach(function(result){var report={};result.names().forEach(function(name){report[name]=result.stat(name)}),report.id=result.id,report.type=result.type,report.timestamp=result.timestamp,reports.push(report)}),cb(null,reports)},function(err){cb(err)}):cb(null,[])},Peer.prototype._maybeReady=function(){var self=this;self._debug("maybeReady pc %s channel %s",self._pcReady,self._channelReady),!self.connected&&!self._connecting&&self._pcReady&&self._channelReady&&(self._connecting=!0,self.getStats(function(err,items){function setSelectedCandidatePair(selectedCandidatePair){var local=localCandidates[selectedCandidatePair.localCandidateId];local&&local.ip?(self.localAddress=local.ip,self.localPort=Number(local.port)):local&&local.ipAddress?(self.localAddress=local.ipAddress,self.localPort=Number(local.portNumber)):"string"==typeof selectedCandidatePair.googLocalAddress&&(local=selectedCandidatePair.googLocalAddress.split(":"),self.localAddress=local[0],self.localPort=Number(local[1]));var remote=remoteCandidates[selectedCandidatePair.remoteCandidateId];remote&&remote.ip?(self.remoteAddress=remote.ip,self.remotePort=Number(remote.port)):remote&&remote.ipAddress?(self.remoteAddress=remote.ipAddress,self.remotePort=Number(remote.portNumber)):"string"==typeof selectedCandidatePair.googRemoteAddress&&(remote=selectedCandidatePair.googRemoteAddress.split(":"),self.remoteAddress=remote[0],self.remotePort=Number(remote[1])),self.remoteFamily="IPv4",self._debug("connect local: %s:%s remote: %s:%s",self.localAddress,self.localPort,self.remoteAddress,self.remotePort)}if(!self.destroyed){err&&(items=[]),self._connecting=!1,self.connected=!0;var remoteCandidates={},localCandidates={},candidatePairs={};if(items.forEach(function(item){"remotecandidate"!==item.type&&"remote-candidate"!==item.type||(remoteCandidates[item.id]=item),"localcandidate"!==item.type&&"local-candidate"!==item.type||(localCandidates[item.id]=item),"candidatepair"!==item.type&&"candidate-pair"!==item.type||(candidatePairs[item.id]=item)}),items.forEach(function(item){"transport"===item.type&&setSelectedCandidatePair(candidatePairs[item.selectedCandidatePairId]),("googCandidatePair"===item.type&&"true"===item.googActiveConnection||("candidatepair"===item.type||"candidate-pair"===item.type)&&item.selected)&&setSelectedCandidatePair(item)}),self._chunk){try{self.send(self._chunk)}catch(err){return self._destroy(err)}self._chunk=null,self._debug('sent chunk from "write before connect"');var cb=self._cb;self._cb=null,cb(null)}"number"!=typeof self._channel.bufferedAmountLowThreshold&&(self._interval=setInterval(function(){self._onInterval()},150),self._interval.unref&&self._interval.unref()),self._debug("connect"),self.emit("connect"),self._earlyMessage&&(self._onChannelMessage(self._earlyMessage),self._earlyMessage=null)}}))},Peer.prototype._onInterval=function(){!this._cb||!this._channel||this._channel.bufferedAmount>65536||this._onChannelBufferedAmountLow()},Peer.prototype._onSignalingStateChange=function(){var self=this;self.destroyed||(self._debug("signalingStateChange %s",self._pc.signalingState),self.emit("signalingStateChange",self._pc.signalingState))},Peer.prototype._onIceCandidate=function(event){var self=this;self.destroyed||(event.candidate&&self.trickle?self.emit("signal",{candidate:{candidate:event.candidate.candidate,sdpMLineIndex:event.candidate.sdpMLineIndex,sdpMid:event.candidate.sdpMid}}):event.candidate||(self._iceComplete=!0,self.emit("_iceComplete")))},Peer.prototype._onChannelMessage=function(event){var self=this;if(!self.destroyed){var data=event.data;data instanceof ArrayBuffer&&(data=Buffer.from(data)),self.push(data)}},Peer.prototype._onChannelBufferedAmountLow=function(){var self=this;if(!self.destroyed&&self._cb){self._debug("ending backpressure: bufferedAmount %d",self._channel.bufferedAmount);var cb=self._cb;self._cb=null,cb(null)}},Peer.prototype._onChannelOpen=function(){var self=this;self.connected||self.destroyed||(self._debug("on channel open"),self._channelReady=!0,self._maybeReady())},Peer.prototype._onChannelClose=function(){var self=this;self.destroyed||(self._debug("on channel close"),self._destroy())},Peer.prototype._onAddStream=function(event){var self=this;self.destroyed||(self._debug("on add stream"),self.emit("stream",event.stream))},Peer.prototype._onTrack=function(event){var self=this;if(!self.destroyed){self._debug("on track");var id=event.streams[0].id;self._previousStreams.indexOf(id)===-1&&(self._previousStreams.push(id),self.emit("stream",event.streams[0]))}},Peer.prototype._debug=function(){var self=this,args=[].slice.call(arguments);args[0]="["+self._id+"] "+args[0],debug.apply(null,args)},Peer.prototype._transformConstraints=function(constraints){var self=this;if(0===Object.keys(constraints).length)return constraints;if((constraints.mandatory||constraints.optional)&&!self._isChromium){var newConstraints=Object.assign({},constraints.optional,constraints.mandatory);return void 0!==newConstraints.OfferToReceiveVideo&&(newConstraints.offerToReceiveVideo=newConstraints.OfferToReceiveVideo,delete newConstraints.OfferToReceiveVideo),void 0!==newConstraints.OfferToReceiveAudio&&(newConstraints.offerToReceiveAudio=newConstraints.OfferToReceiveAudio,delete newConstraints.OfferToReceiveAudio),newConstraints}return constraints.mandatory||constraints.optional||!self._isChromium?constraints:(void 0!==constraints.offerToReceiveVideo&&(constraints.OfferToReceiveVideo=constraints.offerToReceiveVideo,delete constraints.offerToReceiveVideo),void 0!==constraints.offerToReceiveAudio&&(constraints.OfferToReceiveAudio=constraints.offerToReceiveAudio,delete constraints.offerToReceiveAudio),{mandatory:constraints})}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(process){function useColors(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(args){var useColors=this.useColors;if(args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff),useColors){var c="color: "+this.color;args.splice(1,0,c,"color: inherit");var index=0,lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){"%%"!==match&&(index++,"%c"===match&&(lastC=index))}),args.splice(lastC,0,c)}}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{null==namespaces?exports.storage.removeItem("debug"):exports.storage.debug=namespaces}catch(e){}}function load(){var r;try{r=exports.storage.debug}catch(e){}return!r&&void 0!==process&&"env"in process&&(r=process.env.DEBUG),r}exports=module.exports=__webpack_require__(678),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],exports.formatters.j=function(v){try{return JSON.stringify(v)}catch(err){return"[UnexpectedJSONParseError]: "+err.message}},exports.enable(load())}).call(exports,__webpack_require__(1))},function(module,exports,__webpack_require__){function selectColor(namespace){var i,hash=0;for(i in namespace)hash=(hash<<5)-hash+namespace.charCodeAt(i),hash|=0;return exports.colors[Math.abs(hash)%exports.colors.length]}function createDebug(namespace){function debug(){if(debug.enabled){var self=debug,curr=+new Date,ms=curr-(prevTime||curr);self.diff=ms,self.prev=prevTime,self.curr=curr,prevTime=curr;for(var args=new Array(arguments.length),i=0;i=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(args){var useColors=this.useColors;if(args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff),useColors){var c="color: "+this.color;args.splice(1,0,c,"color: inherit");var index=0,lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){"%%"!==match&&(index++,"%c"===match&&(lastC=index))}),args.splice(lastC,0,c)}}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{null==namespaces?exports.storage.removeItem("debug"):exports.storage.debug=namespaces}catch(e){}}function load(){var r;try{r=exports.storage.debug}catch(e){}return!r&&void 0!==process&&"env"in process&&(r=process.env.DEBUG),r}exports=module.exports=__webpack_require__(684),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],exports.formatters.j=function(v){try{return JSON.stringify(v)}catch(err){return"[UnexpectedJSONParseError]: "+err.message}},exports.enable(load())}).call(exports,__webpack_require__(1))},function(module,exports,__webpack_require__){function selectColor(namespace){var i,hash=0;for(i in namespace)hash=(hash<<5)-hash+namespace.charCodeAt(i),hash|=0;return exports.colors[Math.abs(hash)%exports.colors.length]}function createDebug(namespace){function debug(){if(debug.enabled){var self=debug,curr=+new Date,ms=curr-(prevTime||curr);self.diff=ms,self.prev=prevTime,self.curr=curr,prevTime=curr;for(var args=new Array(arguments.length),i=0;i>1&1431655765,16843009*((v=(858993459&v)+(v>>2&858993459))+(v>>4)&252645135)>>24}function sortInternal(a,b){return a[0]-b[0]}function valueOnly(elem){return elem[1]}module.exports=class SparseArray{constructor(){this._bitArrays=[],this._data=[],this._length=0,this._changedLength=!1,this._changedData=!1}set(index,value){let pos=this._internalPositionFor(index,!1);if(void 0===value)pos!==-1&&(this._unsetInternalPos(pos),this._unsetBit(index),this._changedLength=!0,this._changedData=!0);else{let needsSort=!1;pos===-1?(pos=this._data.length,this._setBit(index),this._changedData=!0):needsSort=!0,this._setInternalPos(pos,index,value,needsSort),this._changedLength=!0}}unset(index){this.set(index,void 0)}get(index){this._sortData();const pos=this._internalPositionFor(index,!0);if(pos!==-1)return this._data[pos][1]}push(value){return this.set(this.length,value),this.length}get length(){if(this._sortData(),this._changedLength){const last=this._data[this._data.length-1];this._length=last?last[0]+1:0,this._changedLength=!1}return this._length}forEach(iterator){let i=0;for(;i=this._bitArrays.length)return-1;const byte=this._bitArrays[bytePos],bitPos=index-7*bytePos;return(byte&1<0?this._bitArrays.slice(0,bytePos).reduce(popCountReduce,0)+popCount(byte&~(4294967295<=index)data.push(elem);else if(data[0][0]<=index)data.unshift(elem);else{const randomIndex=Math.round(data.length/2);this._data=data.slice(0,randomIndex).concat(elem).concat(data.slice(randomIndex))}else this._data.push(elem);this._changedData=!0,this._changedLength=!0}}_unsetInternalPos(pos){this._data.splice(pos,1)}_sortData(){this._changedData&&this._data.sort(sortInternal)}bitField(){const bytes=[];let newByte,pendingBitsForResultingByte=8,pendingBitsForNewByte=0,resultingByte=0;const pending=this._bitArrays.slice();for(;pending.length||pendingBitsForNewByte;){0===pendingBitsForNewByte&&(newByte=pending.shift(),pendingBitsForNewByte=7);const usingBits=Math.min(pendingBitsForNewByte,pendingBitsForResultingByte),mask=~(255<>>=usingBits,pendingBitsForNewByte-=usingBits,pendingBitsForResultingByte-=usingBits,pendingBitsForResultingByte&&(pendingBitsForNewByte||pending.length)||(bytes.push(resultingByte),resultingByte=0,pendingBitsForResultingByte=8)}for(var i=bytes.length-1;i>0;i--){const value=bytes[i];if(0!==value)break;bytes.pop()}return bytes}compactArray(){return this._sortData(),this._data.map(valueOnly)}}},function(module,exports,__webpack_require__){!function(){function exec(arr,comp){"function"!=typeof comp&&(comp=function(a,b){return String(a).localeCompare(b)});var len=arr.length;if(len<=1)return arr;for(var buffer=new Array(len),chk=1;chklen&&(r=len),e>len&&(e=len),li=l,ri=r;;)if(li{entries.forEach((entry,key)=>{const v=entry.validity||validity;getTimeElapsed(entry.timestamp)>v&&entries.delete(key)})},200);this.put=((key,value,validity)=>{this.has(key)||entries.set(key,{value:value,timestamp:new Date,validity:validity}),sweep()}),this.get=(key=>{if(entries.has(key))return entries.get(key).value;throw new Error("key does not exist")}),this.has=(key=>{return entries.has(key)})}function getTimeElapsed(prevTime){const currentTime=new Date,a=currentTime.getTime()-prevTime.getTime();return Math.floor(a/1e3)}const throttle=__webpack_require__(544);module.exports=TimeCache},function(module,exports){function toArray(list,index){var array=[];index=index||0;for(var i=index||0;i>24&255,x[i+1]=h>>16&255,x[i+2]=h>>8&255,x[i+3]=255&h,x[i+4]=l>>24&255,x[i+5]=l>>16&255,x[i+6]=l>>8&255,x[i+7]=255&l}function vn(x,xi,y,yi,n){var i,d=0;for(i=0;i>>8)-1}function crypto_verify_16(x,xi,y,yi){return vn(x,xi,y,yi,16)}function crypto_verify_32(x,xi,y,yi){return vn(x,xi,y,yi,32)}function core_salsa20(o,p,k,c){for(var u,j0=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,j1=255&k[0]|(255&k[1])<<8|(255&k[2])<<16|(255&k[3])<<24,j2=255&k[4]|(255&k[5])<<8|(255&k[6])<<16|(255&k[7])<<24,j3=255&k[8]|(255&k[9])<<8|(255&k[10])<<16|(255&k[11])<<24,j4=255&k[12]|(255&k[13])<<8|(255&k[14])<<16|(255&k[15])<<24,j5=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,j6=255&p[0]|(255&p[1])<<8|(255&p[2])<<16|(255&p[3])<<24,j7=255&p[4]|(255&p[5])<<8|(255&p[6])<<16|(255&p[7])<<24,j8=255&p[8]|(255&p[9])<<8|(255&p[10])<<16|(255&p[11])<<24,j9=255&p[12]|(255&p[13])<<8|(255&p[14])<<16|(255&p[15])<<24,j10=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,j11=255&k[16]|(255&k[17])<<8|(255&k[18])<<16|(255&k[19])<<24,j12=255&k[20]|(255&k[21])<<8|(255&k[22])<<16|(255&k[23])<<24,j13=255&k[24]|(255&k[25])<<8|(255&k[26])<<16|(255&k[27])<<24,j14=255&k[28]|(255&k[29])<<8|(255&k[30])<<16|(255&k[31])<<24,j15=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,x0=j0,x1=j1,x2=j2,x3=j3,x4=j4,x5=j5,x6=j6,x7=j7,x8=j8,x9=j9,x10=j10,x11=j11,x12=j12,x13=j13,x14=j14,x15=j15,i=0;i<20;i+=2)u=x0+x12|0,x4^=u<<7|u>>>25,u=x4+x0|0,x8^=u<<9|u>>>23,u=x8+x4|0,x12^=u<<13|u>>>19,u=x12+x8|0,x0^=u<<18|u>>>14,u=x5+x1|0,x9^=u<<7|u>>>25,u=x9+x5|0,x13^=u<<9|u>>>23,u=x13+x9|0,x1^=u<<13|u>>>19,u=x1+x13|0,x5^=u<<18|u>>>14,u=x10+x6|0,x14^=u<<7|u>>>25,u=x14+x10|0,x2^=u<<9|u>>>23,u=x2+x14|0,x6^=u<<13|u>>>19,u=x6+x2|0,x10^=u<<18|u>>>14,u=x15+x11|0,x3^=u<<7|u>>>25,u=x3+x15|0,x7^=u<<9|u>>>23,u=x7+x3|0,x11^=u<<13|u>>>19,u=x11+x7|0,x15^=u<<18|u>>>14,u=x0+x3|0,x1^=u<<7|u>>>25,u=x1+x0|0,x2^=u<<9|u>>>23,u=x2+x1|0,x3^=u<<13|u>>>19,u=x3+x2|0,x0^=u<<18|u>>>14,u=x5+x4|0,x6^=u<<7|u>>>25,u=x6+x5|0,x7^=u<<9|u>>>23,u=x7+x6|0,x4^=u<<13|u>>>19,u=x4+x7|0,x5^=u<<18|u>>>14,u=x10+x9|0,x11^=u<<7|u>>>25,u=x11+x10|0,x8^=u<<9|u>>>23,u=x8+x11|0,x9^=u<<13|u>>>19,u=x9+x8|0,x10^=u<<18|u>>>14,u=x15+x14|0,x12^=u<<7|u>>>25,u=x12+x15|0,x13^=u<<9|u>>>23,u=x13+x12|0,x14^=u<<13|u>>>19,u=x14+x13|0,x15^=u<<18|u>>>14;x0=x0+j0|0,x1=x1+j1|0,x2=x2+j2|0,x3=x3+j3|0,x4=x4+j4|0,x5=x5+j5|0,x6=x6+j6|0,x7=x7+j7|0,x8=x8+j8|0,x9=x9+j9|0,x10=x10+j10|0,x11=x11+j11|0,x12=x12+j12|0,x13=x13+j13|0,x14=x14+j14|0,x15=x15+j15|0,o[0]=x0>>>0&255,o[1]=x0>>>8&255,o[2]=x0>>>16&255,o[3]=x0>>>24&255,o[4]=x1>>>0&255,o[5]=x1>>>8&255,o[6]=x1>>>16&255,o[7]=x1>>>24&255,o[8]=x2>>>0&255,o[9]=x2>>>8&255,o[10]=x2>>>16&255,o[11]=x2>>>24&255,o[12]=x3>>>0&255,o[13]=x3>>>8&255,o[14]=x3>>>16&255,o[15]=x3>>>24&255,o[16]=x4>>>0&255,o[17]=x4>>>8&255,o[18]=x4>>>16&255,o[19]=x4>>>24&255,o[20]=x5>>>0&255,o[21]=x5>>>8&255,o[22]=x5>>>16&255,o[23]=x5>>>24&255,o[24]=x6>>>0&255,o[25]=x6>>>8&255,o[26]=x6>>>16&255,o[27]=x6>>>24&255,o[28]=x7>>>0&255,o[29]=x7>>>8&255,o[30]=x7>>>16&255,o[31]=x7>>>24&255,o[32]=x8>>>0&255,o[33]=x8>>>8&255,o[34]=x8>>>16&255,o[35]=x8>>>24&255,o[36]=x9>>>0&255,o[37]=x9>>>8&255,o[38]=x9>>>16&255,o[39]=x9>>>24&255,o[40]=x10>>>0&255,o[41]=x10>>>8&255,o[42]=x10>>>16&255,o[43]=x10>>>24&255,o[44]=x11>>>0&255,o[45]=x11>>>8&255,o[46]=x11>>>16&255,o[47]=x11>>>24&255,o[48]=x12>>>0&255,o[49]=x12>>>8&255,o[50]=x12>>>16&255,o[51]=x12>>>24&255,o[52]=x13>>>0&255,o[53]=x13>>>8&255,o[54]=x13>>>16&255,o[55]=x13>>>24&255,o[56]=x14>>>0&255,o[57]=x14>>>8&255,o[58]=x14>>>16&255,o[59]=x14>>>24&255,o[60]=x15>>>0&255,o[61]=x15>>>8&255,o[62]=x15>>>16&255,o[63]=x15>>>24&255}function core_hsalsa20(o,p,k,c){for(var u,j0=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,j1=255&k[0]|(255&k[1])<<8|(255&k[2])<<16|(255&k[3])<<24,j2=255&k[4]|(255&k[5])<<8|(255&k[6])<<16|(255&k[7])<<24,j3=255&k[8]|(255&k[9])<<8|(255&k[10])<<16|(255&k[11])<<24,j4=255&k[12]|(255&k[13])<<8|(255&k[14])<<16|(255&k[15])<<24,j5=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,j6=255&p[0]|(255&p[1])<<8|(255&p[2])<<16|(255&p[3])<<24,j7=255&p[4]|(255&p[5])<<8|(255&p[6])<<16|(255&p[7])<<24,j8=255&p[8]|(255&p[9])<<8|(255&p[10])<<16|(255&p[11])<<24,j9=255&p[12]|(255&p[13])<<8|(255&p[14])<<16|(255&p[15])<<24,j10=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,j11=255&k[16]|(255&k[17])<<8|(255&k[18])<<16|(255&k[19])<<24,j12=255&k[20]|(255&k[21])<<8|(255&k[22])<<16|(255&k[23])<<24,j13=255&k[24]|(255&k[25])<<8|(255&k[26])<<16|(255&k[27])<<24,j14=255&k[28]|(255&k[29])<<8|(255&k[30])<<16|(255&k[31])<<24,j15=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,x0=j0,x1=j1,x2=j2,x3=j3,x4=j4,x5=j5,x6=j6,x7=j7,x8=j8,x9=j9,x10=j10,x11=j11,x12=j12,x13=j13,x14=j14,x15=j15,i=0;i<20;i+=2)u=x0+x12|0,x4^=u<<7|u>>>25,u=x4+x0|0,x8^=u<<9|u>>>23,u=x8+x4|0,x12^=u<<13|u>>>19,u=x12+x8|0,x0^=u<<18|u>>>14,u=x5+x1|0,x9^=u<<7|u>>>25,u=x9+x5|0,x13^=u<<9|u>>>23,u=x13+x9|0,x1^=u<<13|u>>>19,u=x1+x13|0,x5^=u<<18|u>>>14,u=x10+x6|0,x14^=u<<7|u>>>25,u=x14+x10|0,x2^=u<<9|u>>>23,u=x2+x14|0,x6^=u<<13|u>>>19,u=x6+x2|0,x10^=u<<18|u>>>14,u=x15+x11|0,x3^=u<<7|u>>>25,u=x3+x15|0,x7^=u<<9|u>>>23,u=x7+x3|0,x11^=u<<13|u>>>19,u=x11+x7|0,x15^=u<<18|u>>>14,u=x0+x3|0,x1^=u<<7|u>>>25,u=x1+x0|0,x2^=u<<9|u>>>23,u=x2+x1|0,x3^=u<<13|u>>>19,u=x3+x2|0,x0^=u<<18|u>>>14,u=x5+x4|0,x6^=u<<7|u>>>25,u=x6+x5|0,x7^=u<<9|u>>>23,u=x7+x6|0,x4^=u<<13|u>>>19,u=x4+x7|0,x5^=u<<18|u>>>14,u=x10+x9|0,x11^=u<<7|u>>>25,u=x11+x10|0,x8^=u<<9|u>>>23,u=x8+x11|0,x9^=u<<13|u>>>19,u=x9+x8|0,x10^=u<<18|u>>>14,u=x15+x14|0,x12^=u<<7|u>>>25,u=x12+x15|0,x13^=u<<9|u>>>23,u=x13+x12|0,x14^=u<<13|u>>>19,u=x14+x13|0,x15^=u<<18|u>>>14;o[0]=x0>>>0&255,o[1]=x0>>>8&255,o[2]=x0>>>16&255,o[3]=x0>>>24&255,o[4]=x5>>>0&255,o[5]=x5>>>8&255,o[6]=x5>>>16&255,o[7]=x5>>>24&255,o[8]=x10>>>0&255,o[9]=x10>>>8&255,o[10]=x10>>>16&255,o[11]=x10>>>24&255,o[12]=x15>>>0&255,o[13]=x15>>>8&255,o[14]=x15>>>16&255,o[15]=x15>>>24&255,o[16]=x6>>>0&255,o[17]=x6>>>8&255,o[18]=x6>>>16&255,o[19]=x6>>>24&255,o[20]=x7>>>0&255,o[21]=x7>>>8&255,o[22]=x7>>>16&255,o[23]=x7>>>24&255,o[24]=x8>>>0&255,o[25]=x8>>>8&255,o[26]=x8>>>16&255,o[27]=x8>>>24&255,o[28]=x9>>>0&255,o[29]=x9>>>8&255,o[30]=x9>>>16&255,o[31]=x9>>>24&255}function crypto_core_salsa20(out,inp,k,c){core_salsa20(out,inp,k,c)}function crypto_core_hsalsa20(out,inp,k,c){core_hsalsa20(out,inp,k,c)}function crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k){var u,i,z=new Uint8Array(16),x=new Uint8Array(64);for(i=0;i<16;i++)z[i]=0;for(i=0;i<8;i++)z[i]=n[i];for(;b>=64;){for(crypto_core_salsa20(x,z,k,sigma),i=0;i<64;i++)c[cpos+i]=m[mpos+i]^x[i];for(u=1,i=8;i<16;i++)u=u+(255&z[i])|0,z[i]=255&u,u>>>=8;b-=64,cpos+=64,mpos+=64}if(b>0)for(crypto_core_salsa20(x,z,k,sigma),i=0;i=64;){for(crypto_core_salsa20(x,z,k,sigma),i=0;i<64;i++)c[cpos+i]=x[i];for(u=1,i=8;i<16;i++)u=u+(255&z[i])|0,z[i]=255&u,u>>>=8;b-=64,cpos+=64}if(b>0)for(crypto_core_salsa20(x,z,k,sigma),i=0;i>16&1),m[i-1]&=65535;m[15]=t[15]-32767-(m[14]>>16&1),b=m[15]>>16&1,m[14]&=65535,sel25519(t,m,1-b)}for(i=0;i<16;i++)o[2*i]=255&t[i],o[2*i+1]=t[i]>>8}function neq25519(a,b){var c=new Uint8Array(32),d=new Uint8Array(32);return pack25519(c,a),pack25519(d,b),crypto_verify_32(c,0,d,0)}function par25519(a){var d=new Uint8Array(32);return pack25519(d,a),1&d[0]}function unpack25519(o,n){var i;for(i=0;i<16;i++)o[i]=n[2*i]+(n[2*i+1]<<8);o[15]&=32767}function A(o,a,b){for(var i=0;i<16;i++)o[i]=a[i]+b[i]}function Z(o,a,b){for(var i=0;i<16;i++)o[i]=a[i]-b[i]}function M(o,a,b){var v,c,t0=0,t1=0,t2=0,t3=0,t4=0,t5=0,t6=0,t7=0,t8=0,t9=0,t10=0,t11=0,t12=0,t13=0,t14=0,t15=0,t16=0,t17=0,t18=0,t19=0,t20=0,t21=0,t22=0,t23=0,t24=0,t25=0,t26=0,t27=0,t28=0,t29=0,t30=0,b0=b[0],b1=b[1],b2=b[2],b3=b[3],b4=b[4],b5=b[5],b6=b[6],b7=b[7],b8=b[8],b9=b[9],b10=b[10],b11=b[11],b12=b[12],b13=b[13],b14=b[14],b15=b[15];v=a[0],t0+=v*b0,t1+=v*b1,t2+=v*b2,t3+=v*b3,t4+=v*b4,t5+=v*b5,t6+=v*b6,t7+=v*b7,t8+=v*b8,t9+=v*b9,t10+=v*b10,t11+=v*b11,t12+=v*b12,t13+=v*b13,t14+=v*b14,t15+=v*b15,v=a[1],t1+=v*b0,t2+=v*b1,t3+=v*b2,t4+=v*b3,t5+=v*b4,t6+=v*b5,t7+=v*b6,t8+=v*b7,t9+=v*b8,t10+=v*b9,t11+=v*b10,t12+=v*b11,t13+=v*b12,t14+=v*b13,t15+=v*b14,t16+=v*b15,v=a[2],t2+=v*b0,t3+=v*b1,t4+=v*b2,t5+=v*b3,t6+=v*b4,t7+=v*b5,t8+=v*b6,t9+=v*b7,t10+=v*b8,t11+=v*b9,t12+=v*b10,t13+=v*b11,t14+=v*b12,t15+=v*b13,t16+=v*b14,t17+=v*b15,v=a[3],t3+=v*b0,t4+=v*b1,t5+=v*b2,t6+=v*b3,t7+=v*b4,t8+=v*b5,t9+=v*b6,t10+=v*b7,t11+=v*b8,t12+=v*b9,t13+=v*b10,t14+=v*b11,t15+=v*b12,t16+=v*b13,t17+=v*b14,t18+=v*b15,v=a[4],t4+=v*b0,t5+=v*b1,t6+=v*b2,t7+=v*b3,t8+=v*b4,t9+=v*b5,t10+=v*b6,t11+=v*b7,t12+=v*b8,t13+=v*b9,t14+=v*b10,t15+=v*b11,t16+=v*b12,t17+=v*b13,t18+=v*b14,t19+=v*b15,v=a[5],t5+=v*b0,t6+=v*b1,t7+=v*b2,t8+=v*b3,t9+=v*b4,t10+=v*b5,t11+=v*b6,t12+=v*b7,t13+=v*b8,t14+=v*b9,t15+=v*b10,t16+=v*b11,t17+=v*b12,t18+=v*b13,t19+=v*b14,t20+=v*b15,v=a[6],t6+=v*b0,t7+=v*b1,t8+=v*b2,t9+=v*b3,t10+=v*b4,t11+=v*b5,t12+=v*b6,t13+=v*b7,t14+=v*b8,t15+=v*b9,t16+=v*b10,t17+=v*b11,t18+=v*b12,t19+=v*b13,t20+=v*b14,t21+=v*b15,v=a[7],t7+=v*b0,t8+=v*b1,t9+=v*b2,t10+=v*b3,t11+=v*b4,t12+=v*b5,t13+=v*b6,t14+=v*b7,t15+=v*b8,t16+=v*b9,t17+=v*b10,t18+=v*b11,t19+=v*b12,t20+=v*b13,t21+=v*b14,t22+=v*b15,v=a[8],t8+=v*b0,t9+=v*b1,t10+=v*b2,t11+=v*b3,t12+=v*b4,t13+=v*b5,t14+=v*b6,t15+=v*b7,t16+=v*b8,t17+=v*b9,t18+=v*b10,t19+=v*b11,t20+=v*b12,t21+=v*b13,t22+=v*b14,t23+=v*b15,v=a[9],t9+=v*b0,t10+=v*b1,t11+=v*b2,t12+=v*b3,t13+=v*b4,t14+=v*b5,t15+=v*b6,t16+=v*b7,t17+=v*b8,t18+=v*b9,t19+=v*b10,t20+=v*b11,t21+=v*b12,t22+=v*b13,t23+=v*b14,t24+=v*b15,v=a[10],t10+=v*b0,t11+=v*b1,t12+=v*b2,t13+=v*b3,t14+=v*b4,t15+=v*b5,t16+=v*b6,t17+=v*b7,t18+=v*b8,t19+=v*b9,t20+=v*b10,t21+=v*b11,t22+=v*b12,t23+=v*b13,t24+=v*b14,t25+=v*b15,v=a[11],t11+=v*b0,t12+=v*b1,t13+=v*b2,t14+=v*b3,t15+=v*b4,t16+=v*b5,t17+=v*b6,t18+=v*b7,t19+=v*b8,t20+=v*b9,t21+=v*b10,t22+=v*b11;t23+=v*b12,t24+=v*b13,t25+=v*b14,t26+=v*b15,v=a[12],t12+=v*b0,t13+=v*b1,t14+=v*b2,t15+=v*b3,t16+=v*b4,t17+=v*b5,t18+=v*b6,t19+=v*b7,t20+=v*b8,t21+=v*b9,t22+=v*b10,t23+=v*b11,t24+=v*b12,t25+=v*b13,t26+=v*b14,t27+=v*b15,v=a[13],t13+=v*b0,t14+=v*b1,t15+=v*b2,t16+=v*b3,t17+=v*b4,t18+=v*b5,t19+=v*b6,t20+=v*b7,t21+=v*b8,t22+=v*b9,t23+=v*b10,t24+=v*b11,t25+=v*b12,t26+=v*b13,t27+=v*b14,t28+=v*b15,v=a[14],t14+=v*b0,t15+=v*b1,t16+=v*b2,t17+=v*b3,t18+=v*b4,t19+=v*b5,t20+=v*b6,t21+=v*b7,t22+=v*b8,t23+=v*b9,t24+=v*b10,t25+=v*b11,t26+=v*b12,t27+=v*b13,t28+=v*b14,t29+=v*b15,v=a[15],t15+=v*b0,t16+=v*b1,t17+=v*b2,t18+=v*b3,t19+=v*b4,t20+=v*b5,t21+=v*b6,t22+=v*b7,t23+=v*b8,t24+=v*b9,t25+=v*b10,t26+=v*b11,t27+=v*b12,t28+=v*b13,t29+=v*b14,t30+=v*b15,t0+=38*t16,t1+=38*t17,t2+=38*t18,t3+=38*t19,t4+=38*t20,t5+=38*t21,t6+=38*t22,t7+=38*t23,t8+=38*t24,t9+=38*t25,t10+=38*t26,t11+=38*t27,t12+=38*t28,t13+=38*t29,t14+=38*t30,c=1,v=t0+c+65535,c=Math.floor(v/65536),t0=v-65536*c,v=t1+c+65535,c=Math.floor(v/65536),t1=v-65536*c,v=t2+c+65535,c=Math.floor(v/65536),t2=v-65536*c,v=t3+c+65535,c=Math.floor(v/65536),t3=v-65536*c,v=t4+c+65535,c=Math.floor(v/65536),t4=v-65536*c,v=t5+c+65535,c=Math.floor(v/65536),t5=v-65536*c,v=t6+c+65535,c=Math.floor(v/65536),t6=v-65536*c,v=t7+c+65535,c=Math.floor(v/65536),t7=v-65536*c,v=t8+c+65535,c=Math.floor(v/65536),t8=v-65536*c,v=t9+c+65535,c=Math.floor(v/65536),t9=v-65536*c,v=t10+c+65535,c=Math.floor(v/65536),t10=v-65536*c,v=t11+c+65535,c=Math.floor(v/65536),t11=v-65536*c,v=t12+c+65535,c=Math.floor(v/65536),t12=v-65536*c,v=t13+c+65535,c=Math.floor(v/65536),t13=v-65536*c,v=t14+c+65535,c=Math.floor(v/65536),t14=v-65536*c,v=t15+c+65535,c=Math.floor(v/65536),t15=v-65536*c,t0+=c-1+37*(c-1),c=1,v=t0+c+65535,c=Math.floor(v/65536),t0=v-65536*c,v=t1+c+65535,c=Math.floor(v/65536),t1=v-65536*c,v=t2+c+65535,c=Math.floor(v/65536),t2=v-65536*c,v=t3+c+65535,c=Math.floor(v/65536),t3=v-65536*c,v=t4+c+65535,c=Math.floor(v/65536),t4=v-65536*c,v=t5+c+65535,c=Math.floor(v/65536),t5=v-65536*c,v=t6+c+65535,c=Math.floor(v/65536),t6=v-65536*c,v=t7+c+65535,c=Math.floor(v/65536),t7=v-65536*c,v=t8+c+65535,c=Math.floor(v/65536),t8=v-65536*c,v=t9+c+65535,c=Math.floor(v/65536),t9=v-65536*c,v=t10+c+65535,c=Math.floor(v/65536),t10=v-65536*c,v=t11+c+65535,c=Math.floor(v/65536),t11=v-65536*c,v=t12+c+65535,c=Math.floor(v/65536),t12=v-65536*c,v=t13+c+65535,c=Math.floor(v/65536),t13=v-65536*c,v=t14+c+65535,c=Math.floor(v/65536),t14=v-65536*c,v=t15+c+65535,c=Math.floor(v/65536),t15=v-65536*c,t0+=c-1+37*(c-1),o[0]=t0,o[1]=t1,o[2]=t2,o[3]=t3,o[4]=t4,o[5]=t5,o[6]=t6,o[7]=t7,o[8]=t8,o[9]=t9,o[10]=t10,o[11]=t11,o[12]=t12;o[13]=t13,o[14]=t14,o[15]=t15}function S(o,a){M(o,a,a)}function inv25519(o,i){var a,c=gf();for(a=0;a<16;a++)c[a]=i[a];for(a=253;a>=0;a--)S(c,c),2!==a&&4!==a&&M(c,c,i);for(a=0;a<16;a++)o[a]=c[a]}function pow2523(o,i){var a,c=gf();for(a=0;a<16;a++)c[a]=i[a];for(a=250;a>=0;a--)S(c,c),1!==a&&M(c,c,i);for(a=0;a<16;a++)o[a]=c[a]}function crypto_scalarmult(q,n,p){var r,i,z=new Uint8Array(32),x=new Float64Array(80),a=gf(),b=gf(),c=gf(),d=gf(),e=gf(),f=gf();for(i=0;i<31;i++)z[i]=n[i];for(z[31]=127&n[31]|64,z[0]&=248,unpack25519(x,p),i=0;i<16;i++)b[i]=x[i],d[i]=a[i]=c[i]=0;for(a[0]=d[0]=1,i=254;i>=0;--i)r=z[i>>>3]>>>(7&i)&1,sel25519(a,b,r),sel25519(c,d,r),A(e,a,c),Z(a,a,c),A(c,b,d),Z(b,b,d),S(d,e),S(f,a),M(a,c,a),M(c,b,e),A(e,a,c),Z(a,a,c),S(b,a),Z(c,d,f),M(a,c,_121665),A(a,a,d),M(c,c,a),M(a,d,f),M(d,b,x),S(b,e),sel25519(a,b,r),sel25519(c,d,r);for(i=0;i<16;i++)x[i+16]=a[i],x[i+32]=c[i],x[i+48]=b[i],x[i+64]=d[i];var x32=x.subarray(32),x16=x.subarray(16);return inv25519(x32,x32),M(x16,x16,x32),pack25519(q,x16),0}function crypto_scalarmult_base(q,n){return crypto_scalarmult(q,n,_9)}function crypto_box_keypair(y,x){return randombytes(x,32),crypto_scalarmult_base(y,x)}function crypto_box_beforenm(k,y,x){var s=new Uint8Array(32);return crypto_scalarmult(s,x,y),crypto_core_hsalsa20(k,_0,s,sigma)}function crypto_box(c,m,d,n,y,x){var k=new Uint8Array(32);return crypto_box_beforenm(k,y,x),crypto_box_afternm(c,m,d,n,k)}function crypto_box_open(m,c,d,n,y,x){var k=new Uint8Array(32);return crypto_box_beforenm(k,y,x),crypto_box_open_afternm(m,c,d,n,k)}function crypto_hashblocks_hl(hh,hl,m,n){for(var bh0,bh1,bh2,bh3,bh4,bh5,bh6,bh7,bl0,bl1,bl2,bl3,bl4,bl5,bl6,bl7,th,tl,i,j,h,l,a,b,c,d,wh=new Int32Array(16),wl=new Int32Array(16),ah0=hh[0],ah1=hh[1],ah2=hh[2],ah3=hh[3],ah4=hh[4],ah5=hh[5],ah6=hh[6],ah7=hh[7],al0=hl[0],al1=hl[1],al2=hl[2],al3=hl[3],al4=hl[4],al5=hl[5],al6=hl[6],al7=hl[7],pos=0;n>=128;){for(i=0;i<16;i++)j=8*i+pos,wh[i]=m[j+0]<<24|m[j+1]<<16|m[j+2]<<8|m[j+3],wl[i]=m[j+4]<<24|m[j+5]<<16|m[j+6]<<8|m[j+7];for(i=0;i<80;i++)if(bh0=ah0,bh1=ah1,bh2=ah2,bh3=ah3,bh4=ah4,bh5=ah5,bh6=ah6,bh7=ah7,bl0=al0,bl1=al1,bl2=al2,bl3=al3,bl4=al4,bl5=al5,bl6=al6,bl7=al7,h=ah7,l=al7,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=(ah4>>>14|al4<<18)^(ah4>>>18|al4<<14)^(al4>>>9|ah4<<23),l=(al4>>>14|ah4<<18)^(al4>>>18|ah4<<14)^(ah4>>>9|al4<<23),a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,h=ah4&ah5^~ah4&ah6,l=al4&al5^~al4&al6,a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,h=K[2*i],l=K[2*i+1],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,h=wh[i%16],l=wl[i%16],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,th=65535&c|d<<16,tl=65535&a|b<<16,h=th,l=tl,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=(ah0>>>28|al0<<4)^(al0>>>2|ah0<<30)^(al0>>>7|ah0<<25),l=(al0>>>28|ah0<<4)^(ah0>>>2|al0<<30)^(ah0>>>7|al0<<25),a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,h=ah0&ah1^ah0&ah2^ah1&ah2,l=al0&al1^al0&al2^al1&al2,a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,bh7=65535&c|d<<16,bl7=65535&a|b<<16,h=bh3,l=bl3,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=th,l=tl,a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,bh3=65535&c|d<<16,bl3=65535&a|b<<16,ah1=bh0,ah2=bh1,ah3=bh2,ah4=bh3,ah5=bh4,ah6=bh5,ah7=bh6,ah0=bh7,al1=bl0,al2=bl1,al3=bl2,al4=bl3,al5=bl4,al6=bl5,al7=bl6,al0=bl7,i%16==15)for(j=0;j<16;j++)h=wh[j],l=wl[j],a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=wh[(j+9)%16],l=wl[(j+9)%16],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,th=wh[(j+1)%16],tl=wl[(j+1)%16],h=(th>>>1|tl<<31)^(th>>>8|tl<<24)^th>>>7,l=(tl>>>1|th<<31)^(tl>>>8|th<<24)^(tl>>>7|th<<25),a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,th=wh[(j+14)%16],tl=wl[(j+14)%16],h=(th>>>19|tl<<13)^(tl>>>29|th<<3)^th>>>6,l=(tl>>>19|th<<13)^(th>>>29|tl<<3)^(tl>>>6|th<<26),a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,wh[j]=65535&c|d<<16,wl[j]=65535&a|b<<16;h=ah0,l=al0,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[0],l=hl[0],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[0]=ah0=65535&c|d<<16,hl[0]=al0=65535&a|b<<16,h=ah1,l=al1,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[1],l=hl[1],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[1]=ah1=65535&c|d<<16,hl[1]=al1=65535&a|b<<16,h=ah2,l=al2,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[2],l=hl[2],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[2]=ah2=65535&c|d<<16,hl[2]=al2=65535&a|b<<16,h=ah3,l=al3,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[3],l=hl[3],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[3]=ah3=65535&c|d<<16,hl[3]=al3=65535&a|b<<16,h=ah4,l=al4,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[4],l=hl[4],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[4]=ah4=65535&c|d<<16,hl[4]=al4=65535&a|b<<16,h=ah5,l=al5,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[5],l=hl[5],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[5]=ah5=65535&c|d<<16,hl[5]=al5=65535&a|b<<16,h=ah6,l=al6,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[6],l=hl[6],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[6]=ah6=65535&c|d<<16,hl[6]=al6=65535&a|b<<16,h=ah7,l=al7,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[7],l=hl[7],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[7]=ah7=65535&c|d<<16,hl[7]=al7=65535&a|b<<16,pos+=128,n-=128}return n}function crypto_hash(out,m,n){var i,hh=new Int32Array(8),hl=new Int32Array(8),x=new Uint8Array(256),b=n;for(hh[0]=1779033703,hh[1]=3144134277,hh[2]=1013904242,hh[3]=2773480762,hh[4]=1359893119,hh[5]=2600822924,hh[6]=528734635,hh[7]=1541459225,hl[0]=4089235720,hl[1]=2227873595,hl[2]=4271175723,hl[3]=1595750129,hl[4]=2917565137,hl[5]=725511199,hl[6]=4215389547,hl[7]=327033209,crypto_hashblocks_hl(hh,hl,m,n),n%=128,i=0;i=0;--i)b=s[i/8|0]>>(7&i)&1,cswap(p,q,b),add(q,p),add(p,p),cswap(p,q,b)}function scalarbase(p,s){var q=[gf(),gf(),gf(),gf()];set25519(q[0],X),set25519(q[1],Y),set25519(q[2],gf1),M(q[3],X,Y),scalarmult(p,q,s)}function crypto_sign_keypair(pk,sk,seeded){var i,d=new Uint8Array(64),p=[gf(),gf(),gf(),gf()];for(seeded||randombytes(sk,32),crypto_hash(d,sk,32),d[0]&=248,d[31]&=127,d[31]|=64,scalarbase(p,d),pack(pk,p),i=0;i<32;i++)sk[i+32]=pk[i];return 0}function modL(r,x){var carry,i,j,k;for(i=63;i>=32;--i){for(carry=0,j=i-32,k=i-12;j>8,x[j]-=256*carry;x[j]+=carry,x[i]=0}for(carry=0,j=0;j<32;j++)x[j]+=carry-(x[31]>>4)*L[j],carry=x[j]>>8,x[j]&=255;for(j=0;j<32;j++)x[j]-=carry*L[j];for(i=0;i<32;i++)x[i+1]+=x[i]>>8,r[i]=255&x[i]}function reduce(r){var i,x=new Float64Array(64);for(i=0;i<64;i++)x[i]=r[i];for(i=0;i<64;i++)r[i]=0;modL(r,x)}function crypto_sign(sm,m,n,sk){var i,j,d=new Uint8Array(64),h=new Uint8Array(64),r=new Uint8Array(64),x=new Float64Array(64),p=[gf(),gf(),gf(),gf()];crypto_hash(d,sk,32),d[0]&=248,d[31]&=127,d[31]|=64;var smlen=n+64;for(i=0;i>7&&Z(r[0],gf0,r[0]),M(r[3],r[0],r[1]),0)}function crypto_sign_open(m,sm,n,pk){var i,t=new Uint8Array(32),h=new Uint8Array(64),p=[gf(),gf(),gf(),gf()],q=[gf(),gf(),gf(),gf()];if(-1,n<64)return-1;if(unpackneg(q,pk))return-1;for(i=0;i>>13|t1<<3),t2=255&key[4]|(255&key[5])<<8,this.r[2]=7939&(t1>>>10|t2<<6),t3=255&key[6]|(255&key[7])<<8,this.r[3]=8191&(t2>>>7|t3<<9),t4=255&key[8]|(255&key[9])<<8,this.r[4]=255&(t3>>>4|t4<<12),this.r[5]=t4>>>1&8190,t5=255&key[10]|(255&key[11])<<8,this.r[6]=8191&(t4>>>14|t5<<2),t6=255&key[12]|(255&key[13])<<8,this.r[7]=8065&(t5>>>11|t6<<5),t7=255&key[14]|(255&key[15])<<8,this.r[8]=8191&(t6>>>8|t7<<8),this.r[9]=t7>>>5&127,this.pad[0]=255&key[16]|(255&key[17])<<8,this.pad[1]=255&key[18]|(255&key[19])<<8,this.pad[2]=255&key[20]|(255&key[21])<<8,this.pad[3]=255&key[22]|(255&key[23])<<8,this.pad[4]=255&key[24]|(255&key[25])<<8,this.pad[5]=255&key[26]|(255&key[27])<<8,this.pad[6]=255&key[28]|(255&key[29])<<8,this.pad[7]=255&key[30]|(255&key[31])<<8};poly1305.prototype.blocks=function(m,mpos,bytes){for(var t0,t1,t2,t3,t4,t5,t6,t7,c,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,hibit=this.fin?0:2048,h0=this.h[0],h1=this.h[1],h2=this.h[2],h3=this.h[3],h4=this.h[4],h5=this.h[5],h6=this.h[6],h7=this.h[7],h8=this.h[8],h9=this.h[9],r0=this.r[0],r1=this.r[1],r2=this.r[2],r3=this.r[3],r4=this.r[4],r5=this.r[5],r6=this.r[6],r7=this.r[7],r8=this.r[8],r9=this.r[9];bytes>=16;)t0=255&m[mpos+0]|(255&m[mpos+1])<<8,h0+=8191&t0,t1=255&m[mpos+2]|(255&m[mpos+3])<<8,h1+=8191&(t0>>>13|t1<<3),t2=255&m[mpos+4]|(255&m[mpos+5])<<8,h2+=8191&(t1>>>10|t2<<6),t3=255&m[mpos+6]|(255&m[mpos+7])<<8,h3+=8191&(t2>>>7|t3<<9),t4=255&m[mpos+8]|(255&m[mpos+9])<<8,h4+=8191&(t3>>>4|t4<<12),h5+=t4>>>1&8191,t5=255&m[mpos+10]|(255&m[mpos+11])<<8,h6+=8191&(t4>>>14|t5<<2),t6=255&m[mpos+12]|(255&m[mpos+13])<<8,h7+=8191&(t5>>>11|t6<<5),t7=255&m[mpos+14]|(255&m[mpos+15])<<8,h8+=8191&(t6>>>8|t7<<8),h9+=t7>>>5|hibit,c=0,d0=c,d0+=h0*r0,d0+=h1*(5*r9),d0+=h2*(5*r8),d0+=h3*(5*r7),d0+=h4*(5*r6),c=d0>>>13,d0&=8191,d0+=h5*(5*r5),d0+=h6*(5*r4),d0+=h7*(5*r3),d0+=h8*(5*r2),d0+=h9*(5*r1),c+=d0>>>13,d0&=8191,d1=c,d1+=h0*r1,d1+=h1*r0,d1+=h2*(5*r9),d1+=h3*(5*r8),d1+=h4*(5*r7),c=d1>>>13,d1&=8191,d1+=h5*(5*r6),d1+=h6*(5*r5),d1+=h7*(5*r4),d1+=h8*(5*r3),d1+=h9*(5*r2),c+=d1>>>13,d1&=8191,d2=c,d2+=h0*r2,d2+=h1*r1,d2+=h2*r0,d2+=h3*(5*r9),d2+=h4*(5*r8),c=d2>>>13,d2&=8191,d2+=h5*(5*r7),d2+=h6*(5*r6),d2+=h7*(5*r5),d2+=h8*(5*r4),d2+=h9*(5*r3),c+=d2>>>13,d2&=8191,d3=c,d3+=h0*r3,d3+=h1*r2,d3+=h2*r1,d3+=h3*r0,d3+=h4*(5*r9),c=d3>>>13,d3&=8191,d3+=h5*(5*r8),d3+=h6*(5*r7),d3+=h7*(5*r6),d3+=h8*(5*r5),d3+=h9*(5*r4),c+=d3>>>13,d3&=8191,d4=c,d4+=h0*r4,d4+=h1*r3,d4+=h2*r2,d4+=h3*r1,d4+=h4*r0,c=d4>>>13,d4&=8191,d4+=h5*(5*r9),d4+=h6*(5*r8),d4+=h7*(5*r7),d4+=h8*(5*r6),d4+=h9*(5*r5),c+=d4>>>13,d4&=8191,d5=c,d5+=h0*r5,d5+=h1*r4,d5+=h2*r3,d5+=h3*r2,d5+=h4*r1,c=d5>>>13,d5&=8191,d5+=h5*r0,d5+=h6*(5*r9),d5+=h7*(5*r8),d5+=h8*(5*r7),d5+=h9*(5*r6),c+=d5>>>13,d5&=8191,d6=c,d6+=h0*r6,d6+=h1*r5,d6+=h2*r4,d6+=h3*r3,d6+=h4*r2,c=d6>>>13,d6&=8191,d6+=h5*r1,d6+=h6*r0,d6+=h7*(5*r9),d6+=h8*(5*r8),d6+=h9*(5*r7),c+=d6>>>13,d6&=8191,d7=c,d7+=h0*r7,d7+=h1*r6,d7+=h2*r5,d7+=h3*r4,d7+=h4*r3,c=d7>>>13,d7&=8191,d7+=h5*r2,d7+=h6*r1,d7+=h7*r0,d7+=h8*(5*r9),d7+=h9*(5*r8),c+=d7>>>13,d7&=8191,d8=c,d8+=h0*r8,d8+=h1*r7,d8+=h2*r6,d8+=h3*r5,d8+=h4*r4,c=d8>>>13,d8&=8191,d8+=h5*r3,d8+=h6*r2,d8+=h7*r1,d8+=h8*r0,d8+=h9*(5*r9),c+=d8>>>13,d8&=8191,d9=c,d9+=h0*r9,d9+=h1*r8,d9+=h2*r7,d9+=h3*r6,d9+=h4*r5,c=d9>>>13,d9&=8191,d9+=h5*r4,d9+=h6*r3,d9+=h7*r2,d9+=h8*r1,d9+=h9*r0,c+=d9>>>13,d9&=8191,c=(c<<2)+c|0,c=c+d0|0,d0=8191&c,c>>>=13,d1+=c,h0=d0,h1=d1,h2=d2,h3=d3,h4=d4,h5=d5,h6=d6,h7=d7,h8=d8,h9=d9,mpos+=16,bytes-=16;this.h[0]=h0,this.h[1]=h1,this.h[2]=h2,this.h[3]=h3,this.h[4]=h4,this.h[5]=h5,this.h[6]=h6,this.h[7]=h7,this.h[8]=h8,this.h[9]=h9},poly1305.prototype.finish=function(mac,macpos){var c,mask,f,i,g=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(c=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=c,c=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*c,c=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=c,c=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=c,g[0]=this.h[0]+5,c=g[0]>>>13,g[0]&=8191,i=1;i<10;i++)g[i]=this.h[i]+c,c=g[i]>>>13,g[i]&=8191;for(g[9]-=8192,mask=(1^c)-1,i=0;i<10;i++)g[i]&=mask;for(mask=~mask,i=0;i<10;i++)this.h[i]=this.h[i]&mask|g[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),f=this.h[0]+this.pad[0],this.h[0]=65535&f,i=1;i<8;i++)f=(this.h[i]+this.pad[i]|0)+(f>>>16)|0,this.h[i]=65535&f;mac[macpos+0]=this.h[0]>>>0&255,mac[macpos+1]=this.h[0]>>>8&255,mac[macpos+2]=this.h[1]>>>0&255,mac[macpos+3]=this.h[1]>>>8&255,mac[macpos+4]=this.h[2]>>>0&255,mac[macpos+5]=this.h[2]>>>8&255,mac[macpos+6]=this.h[3]>>>0&255,mac[macpos+7]=this.h[3]>>>8&255,mac[macpos+8]=this.h[4]>>>0&255,mac[macpos+9]=this.h[4]>>>8&255,mac[macpos+10]=this.h[5]>>>0&255,mac[macpos+11]=this.h[5]>>>8&255,mac[macpos+12]=this.h[6]>>>0&255,mac[macpos+13]=this.h[6]>>>8&255,mac[macpos+14]=this.h[7]>>>0&255,mac[macpos+15]=this.h[7]>>>8&255},poly1305.prototype.update=function(m,mpos,bytes){var i,want;if(this.leftover){for(want=16-this.leftover,want>bytes&&(want=bytes),i=0;i=16&&(want=bytes-bytes%16,this.blocks(m,mpos,want),mpos+=want,bytes-=want),bytes){for(i=0;i=0},nacl.sign.keyPair=function(){var pk=new Uint8Array(32),sk=new Uint8Array(64);return crypto_sign_keypair(pk,sk),{publicKey:pk,secretKey:sk}},nacl.sign.keyPair.fromSecretKey=function(secretKey){if(checkArrayTypes(),64!==secretKey.length)throw new Error("bad secret key size");for(var pk=new Uint8Array(32),i=0;i>>((3&i)<<3)&255;return rnds}}module.exports=rng}).call(exports,__webpack_require__(3))},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const varint=__webpack_require__(14);module.exports=(buf=>{if(!Buffer.isBuffer(buf))throw new Error("arg needs to be a buffer");let result=[];for(;buf.length>0;){const num=varint.decode(buf);result.push(num),buf=buf.slice(varint.decode.bytes)}return result})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports){function read(buf,offset){var b,res=0,offset=offset||0,shift=0,counter=offset,l=buf.length;do{if(counter>=l)throw read.bytes=0,new RangeError("Could not decode varint");b=buf[counter++],res+=shift<28?(b&REST)<=MSB);return read.bytes=counter-offset,res}module.exports=read;var MSB=128,REST=127},function(module,exports){function encode(num,out,offset){out=out||[],offset=offset||0;for(var oldOffset=offset;num>=INT;)out[offset++]=255&num|MSB,num/=128;for(;num&MSBALL;)out[offset++]=255&num|MSB,num>>>=7;return out[offset]=0|num,encode.bytes=offset-oldOffset+1,out}module.exports=encode;var MSB=128,MSBALL=-128,INT=Math.pow(2,31)},function(module,exports){var N1=Math.pow(2,7),N2=Math.pow(2,14),N3=Math.pow(2,21),N4=Math.pow(2,28),N5=Math.pow(2,35),N6=Math.pow(2,42),N7=Math.pow(2,49),N8=Math.pow(2,56),N9=Math.pow(2,63);module.exports=function(value){return value2&&(prv=!0,info.shift());var jwk={ext:!0};switch(info[0][0]){case"1.2.840.113549.1.1.1":var rsaComp=["n","e","d","p","q","dp","dq","qi"],rsaKey=b2der(info[1]);prv&&rsaKey.shift();for(var i=0;i2&&(prv=!0,rsaKey.unshift(new Uint8Array([0]))),info[0][0]="1.2.840.113549.1.1.1",key=rsaKey;break;default:throw new TypeError("Unsupported key type")}return info.push(new Uint8Array(der2b(key)).buffer),prv?info.unshift(new Uint8Array([0])):info[1]={tag:3,value:info[1]},new Uint8Array(der2b(info)).buffer}function b2der(buf,ctx){if(buf instanceof ArrayBuffer&&(buf=new Uint8Array(buf)),ctx||(ctx={pos:0,end:buf.length}),ctx.end-ctx.pos<2||ctx.end>buf.length)throw new RangeError("Malformed DER");var tag=buf[ctx.pos++],len=buf[ctx.pos++];if(len>=128){if(len&=127,ctx.end-ctx.pos=128){var xlen=len,len=4;for(buf.splice(pos,0,xlen>>24&255,xlen>>16&255,xlen>>8&255,255&xlen);len>1&&!(xlen>>24);)xlen<<=8,len--;len<4&&buf.splice(pos,4-len),len|=128}return buf.splice(pos-2,2,tag,len),buf}function CryptoKey(key,alg,ext,use){Object.defineProperties(this,{_key:{value:key},type:{value:key.type,enumerable:!0},extractable:{value:void 0===ext?key.extractable:ext,enumerable:!0},algorithm:{value:void 0===alg?key.algorithm:alg,enumerable:!0},usages:{value:void 0===use?key.usages:use,enumerable:!0}})}function isPubKeyUse(u){return"verify"===u||"encrypt"===u||"wrapKey"===u}function isPrvKeyUse(u){return"sign"===u||"decrypt"===u||"unwrapKey"===u}if("function"!=typeof Promise)throw"Promise support required";var _crypto=global.crypto||global.msCrypto;if(_crypto){var _subtle=_crypto.subtle||_crypto.webkitSubtle;if(_subtle){var _Crypto=global.Crypto||_crypto.constructor||Object,_SubtleCrypto=global.SubtleCrypto||_subtle.constructor||Object,isEdge=(global.CryptoKey||global.Key||Object,global.navigator.userAgent.indexOf("Edge/")>-1),isIE=!!global.msCrypto&&!isEdge,isWebkit=!!_crypto.webkitSubtle;if(isIE||isWebkit){var oid2str={KoZIhvcNAQEB:"1.2.840.113549.1.1.1"},str2oid={"1.2.840.113549.1.1.1":"KoZIhvcNAQEB"};if(["generateKey","importKey","unwrapKey"].forEach(function(m){var _fn=_subtle[m];_subtle[m]=function(a,b,c){var ka,kx,ku,args=[].slice.call(arguments);switch(m){case"generateKey":ka=alg(a),kx=b,ku=c;break;case"importKey":ka=alg(c),kx=args[3],ku=args[4],"jwk"===a&&(b=b2jwk(b),b.alg||(b.alg=jwkAlg(ka)),b.key_ops||(b.key_ops="oct"!==b.kty?"d"in b?ku.filter(isPrvKeyUse):ku.filter(isPubKeyUse):ku.slice()),args[1]=jwk2b(b));break;case"unwrapKey":ka=args[4],kx=args[5],ku=args[6],args[2]=c._key}if("generateKey"===m&&"HMAC"===ka.name&&ka.hash)return ka.length=ka.length||{"SHA-1":512,"SHA-256":512,"SHA-384":1024,"SHA-512":1024}[ka.hash.name],_subtle.importKey("raw",_crypto.getRandomValues(new Uint8Array(ka.length+7>>3)),ka,kx,ku);if(isWebkit&&"generateKey"===m&&"RSASSA-PKCS1-v1_5"===ka.name&&(!ka.modulusLength||ka.modulusLength>=2048))return a=alg(a),a.name="RSAES-PKCS1-v1_5",delete a.hash,_subtle.generateKey(a,!0,["encrypt","decrypt"]).then(function(k){return Promise.all([_subtle.exportKey("jwk",k.publicKey),_subtle.exportKey("jwk",k.privateKey)])}).then(function(keys){return keys[0].alg=keys[1].alg=jwkAlg(ka),keys[0].key_ops=ku.filter(isPubKeyUse),keys[1].key_ops=ku.filter(isPrvKeyUse),Promise.all([_subtle.importKey("jwk",keys[0],ka,!0,keys[0].key_ops),_subtle.importKey("jwk",keys[1],ka,kx,keys[1].key_ops)])}).then(function(keys){return{publicKey:keys[0],privateKey:keys[1]}});if((isWebkit||isIE&&"SHA-1"===(ka.hash||{}).name)&&"importKey"===m&&"jwk"===a&&"HMAC"===ka.name&&"oct"===b.kty)return _subtle.importKey("raw",s2b(a2s(b.k)),c,args[3],args[4]);if(isWebkit&&"importKey"===m&&("spki"===a||"pkcs8"===a))return _subtle.importKey("jwk",pkcs2jwk(b),c,args[3],args[4]);if(isIE&&"unwrapKey"===m)return _subtle.decrypt(args[3],c,b).then(function(k){return _subtle.importKey(a,k,args[4],args[5],args[6])});var op;try{op=_fn.apply(_subtle,args)}catch(e){return Promise.reject(e)}return isIE&&(op=new Promise(function(res,rej){op.onabort=op.onerror=function(e){rej(e)},op.oncomplete=function(r){res(r.target.result)}})),op=op.then(function(k){return"HMAC"===ka.name&&(ka.length||(ka.length=8*k.algorithm.length)),0==ka.name.search("RSA")&&(ka.modulusLength||(ka.modulusLength=(k.publicKey||k).algorithm.modulusLength),ka.publicExponent||(ka.publicExponent=(k.publicKey||k).algorithm.publicExponent)),k=k.publicKey&&k.privateKey?{publicKey:new CryptoKey(k.publicKey,ka,kx,ku.filter(isPubKeyUse)),privateKey:new CryptoKey(k.privateKey,ka,kx,ku.filter(isPrvKeyUse))}:new CryptoKey(k,ka,kx,ku)})}}),["exportKey","wrapKey"].forEach(function(m){var _fn=_subtle[m];_subtle[m]=function(a,b,c){var args=[].slice.call(arguments);switch(m){case"exportKey":args[1]=b._key;break;case"wrapKey":args[1]=b._key,args[2]=c._key}if((isWebkit||isIE&&"SHA-1"===(b.algorithm.hash||{}).name)&&"exportKey"===m&&"jwk"===a&&"HMAC"===b.algorithm.name&&(args[0]="raw"),!isWebkit||"exportKey"!==m||"spki"!==a&&"pkcs8"!==a||(args[0]="jwk"),isIE&&"wrapKey"===m)return _subtle.exportKey(a,b).then(function(k){return"jwk"===a&&(k=s2b(unescape(encodeURIComponent(JSON.stringify(b2jwk(k)))))),_subtle.encrypt(args[3],c,k)});var op;try{op=_fn.apply(_subtle,args)}catch(e){return Promise.reject(e)}return isIE&&(op=new Promise(function(res,rej){op.onabort=op.onerror=function(e){rej(e)},op.oncomplete=function(r){res(r.target.result)}})),"exportKey"===m&&"jwk"===a&&(op=op.then(function(k){return(isWebkit||isIE&&"SHA-1"===(b.algorithm.hash||{}).name)&&"HMAC"===b.algorithm.name?{kty:"oct",alg:jwkAlg(b.algorithm),key_ops:b.usages.slice(),ext:!0,k:s2a(b2s(k))}:(k=b2jwk(k),k.alg||(k.alg=jwkAlg(b.algorithm)),k.key_ops||(k.key_ops="public"===b.type?b.usages.filter(isPubKeyUse):"private"===b.type?b.usages.filter(isPrvKeyUse):b.usages.slice()),k)})),!isWebkit||"exportKey"!==m||"spki"!==a&&"pkcs8"!==a||(op=op.then(function(k){return k=jwk2pkcs(b2jwk(k))})),op}}),["encrypt","decrypt","sign","verify"].forEach(function(m){var _fn=_subtle[m];_subtle[m]=function(a,b,c,d){if(isIE&&(!c.byteLength||d&&!d.byteLength))throw new Error("Empy input is not allowed");var args=[].slice.call(arguments),ka=alg(a);if(isIE&&"decrypt"===m&&"AES-GCM"===ka.name){var tl=a.tagLength>>3;args[2]=(c.buffer||c).slice(0,c.byteLength-tl),a.tag=(c.buffer||c).slice(c.byteLength-tl)}args[1]=b._key;var op;try{op=_fn.apply(_subtle,args)}catch(e){return Promise.reject(e)}return isIE&&(op=new Promise(function(res,rej){op.onabort=op.onerror=function(e){rej(e)},op.oncomplete=function(r){var r=r.target.result;if("encrypt"===m&&r instanceof AesGcmEncryptResult){var c=r.ciphertext,t=r.tag;r=new Uint8Array(c.byteLength+t.byteLength),r.set(new Uint8Array(c),0),r.set(new Uint8Array(t),c.byteLength),r=r.buffer}res(r)}})),op}}),isIE){var _digest=_subtle.digest;_subtle.digest=function(a,b){if(!b.byteLength)throw new Error("Empy input is not allowed");var op;try{op=_digest.call(_subtle,a,b)}catch(e){return Promise.reject(e)}return op=new Promise(function(res,rej){op.onabort=op.onerror=function(e){rej(e)},op.oncomplete=function(r){res(r.target.result)}})},global.crypto=Object.create(_crypto,{getRandomValues:{value:function(a){return _crypto.getRandomValues(a)}},subtle:{value:_subtle}}),global.CryptoKey=CryptoKey}isWebkit&&(_crypto.subtle=_subtle,global.Crypto=_Crypto,global.SubtleCrypto=_SubtleCrypto,global.CryptoKey=CryptoKey)}}}}},function(module,exports){var prefix,version;self.mozRTCPeerConnection||navigator.mozGetUserMedia?(prefix="moz",version=parseInt(navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1],10)):(self.webkitRTCPeerConnection||navigator.webkitGetUserMedia)&&(prefix="webkit",version=navigator.userAgent.match(/Chrom(e|ium)/)&&parseInt(navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)[2],10));var PC=self.RTCPeerConnection||self.mozRTCPeerConnection||self.webkitRTCPeerConnection,IceCandidate=self.mozRTCIceCandidate||self.RTCIceCandidate,SessionDescription=self.mozRTCSessionDescription||self.RTCSessionDescription,MediaStream=self.webkitMediaStream||self.MediaStream,screenSharing="https:"===self.location.protocol&&("webkit"===prefix&&version>=26||"moz"===prefix&&version>=33),AudioContext=self.AudioContext||self.webkitAudioContext,videoEl=self.document&&document.createElement("video"),supportVp8=videoEl&&videoEl.canPlayType&&"probably"===videoEl.canPlayType('video/webm; codecs="vp8", vorbis'),getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.msGetUserMedia||navigator.mozGetUserMedia;module.exports={prefix:prefix,browserVersion:version,support:!!PC&&!!getUserMedia,supportRTCPeerConnection:!!PC,supportVp8:supportVp8,supportGetUserMedia:!!getUserMedia,supportDataChannel:!!(PC&&PC.prototype&&PC.prototype.createDataChannel),supportWebAudio:!(!AudioContext||!AudioContext.prototype.createMediaStreamSource),supportMediaStream:!(!MediaStream||!MediaStream.prototype.removeTrack),supportScreenSharing:!!screenSharing,AudioContext:AudioContext,PeerConnection:PC,SessionDescription:SessionDescription,IceCandidate:IceCandidate,MediaStream:MediaStream,getUserMedia:getUserMedia}},function(module,exports){function wrappy(fn,cb){function wrapper(){for(var args=new Array(arguments.length),i=0;i{self.log("booting");const options=self._options,doInit=options.init,doStart=options.start,config=options.config,setConfig=config&&"object"==typeof config,repoOpen=!self._repo.closed,customInitOptions="object"==typeof options.init?options.init:{},initOptions=Object.assign({bits:2048},customInitOptions),maybeOpenRepo=cb=>{if(repoOpen)return cb(null,!0);series([cb=>self._repo.open(cb),cb=>self.preStart(cb),cb=>{self.state.initialized(),cb(null,!0)}],(err,res)=>{if(err)return err.message.match(/not found/)||err.message.match(/ENOENT/)||err.message.match(/No value/)?cb(null,!1):cb(err);cb(null,res)})},done=err=>{if(err)return self.emit("error",err);self.emit("ready"),self.log("boot:done",err)},tasks=[];maybeOpenRepo((err,hasRepo)=>{if(err)return done(err);if(doInit&&!hasRepo&&(tasks.push(cb=>self.init(initOptions,cb)),hasRepo=!0),setConfig&&(hasRepo?tasks.push(cb=>{waterfall([cb=>self.config.get(cb),(config,cb)=>{extend(config,options.config),self.config.replace(config,cb)}],cb)}):console.log('WARNING, trying to set config on uninitialized repo, maybe forgot to set "init: true"')),doStart){if(!hasRepo)return console.log('WARNING, trying to start ipfs node on uninitialized repo, maybe forgot to set "init: true"'),done(new Error("Uninitalized repo"));tasks.push(cb=>self.start(cb))}series(tasks,done)})})},function(module,exports,__webpack_require__){"use strict";function formatWantlist(list){return Array.from(list).map(e=>e[1])}const OFFLINE_ERROR=__webpack_require__(153).OFFLINE_ERROR;module.exports=function(self){return{wantlist:()=>{if(!self.isOnline())throw OFFLINE_ERROR;return formatWantlist(self._bitswap.getWantlist())},stat:()=>{if(!self.isOnline())throw OFFLINE_ERROR;const stats=self._bitswap.stat();return stats.wantlist=formatWantlist(stats.wantlist),stats.peers=stats.peers.map(id=>id.toB58String()),stats},unwant:key=>{if(!self.isOnline())throw OFFLINE_ERROR}}}},function(module,exports,__webpack_require__){"use strict";function cleanCid(cid){return CID.isCID(cid)?cid:new CID(cid)}const Block=__webpack_require__(65),multihash=__webpack_require__(11),multihashing=__webpack_require__(22),CID=__webpack_require__(8),waterfall=__webpack_require__(6);module.exports=function(self){return{get:(cid,callback)=>{cid=cleanCid(cid),self._blockService.get(cid,callback)},put:(block,options,callback)=>{if("function"==typeof options&&(callback=options,options={}),Array.isArray(block))return callback(new Error("Array is not supported"));waterfall([cb=>{if(Block.isBlock(block))return cb(null,block);if(options.cid&&CID.isCID(options.cid))return cb(null,new Block(block,options.cid));const mhtype=options.mhtype||"sha2-256",format=options.format||"dag-pb",cidVersion=options.version||0;multihashing(block,mhtype,(err,multihash)=>{if(err)return cb(err);cb(null,new Block(block,new CID(cidVersion,format,multihash)))})},(block,cb)=>self._blockService.put(block,err=>{if(err)return cb(err);cb(null,block)})],callback)},rm:(cid,callback)=>{cid=cleanCid(cid),self._blockService.delete(cid,callback)},stat:(cid,callback)=>{cid=cleanCid(cid),self._blockService.get(cid,(err,block)=>{ +if(err)return callback(err);callback(null,{key:multihash.toB58String(cid.multihash),size:block.data.length})})}}}},function(module,exports,__webpack_require__){"use strict";const defaultNodes=__webpack_require__(214).Bootstrap;module.exports=function(self){return{list:callback=>{self._repo.config.get((err,config)=>{if(err)return callback(err);callback(null,{Peers:config.Bootstrap})})},add:(multiaddr,args,callback)=>{"function"==typeof args&&(callback=args,args={default:!1}),self._repo.config.get((err,config)=>{if(err)return callback(err);args.default?config.Bootstrap=defaultNodes:multiaddr&&config.Bootstrap.indexOf(multiaddr)===-1&&config.Bootstrap.push(multiaddr),self._repo.config.set(config,err=>{if(err)return callback(err);callback(null,{Peers:args.default?defaultNodes:[multiaddr]})})})},rm:(multiaddr,args,callback)=>{"function"==typeof args&&(callback=args,args={all:!1}),self._repo.config.get((err,config)=>{if(err)return callback(err);args.all?config.Bootstrap=[]:config.Bootstrap=config.Bootstrap.filter(mh=>mh!==multiaddr),self._repo.config.set(config,err=>{if(err)return callback(err);const res=[];!args.all&&multiaddr&&res.push(multiaddr),callback(null,{Peers:res})})})}}}},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(17);module.exports=function(self){return{get:promisify((key,callback)=>{return"function"==typeof key&&(callback=key,key=void 0),self._repo.config.get(key,callback)}),set:promisify((key,value,callback)=>{self._repo.config.set(key,value,callback)}),replace:promisify((config,callback)=>{self._repo.config.set(config,callback)})}}},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(17),CID=__webpack_require__(8),pull=__webpack_require__(4);module.exports=function(self){return{put:promisify((dagNode,options,callback)=>{self._ipldResolver.put(dagNode,options,callback)}),get:promisify((cid,path,options,callback)=>{if("function"==typeof path&&(callback=path,path=void 0),"function"==typeof options&&(callback=options,options={}),options=options||{},"string"==typeof cid){const split=cid.split("/");cid=new CID(split[0]),split.shift(),path=split.length>0?split.join("/"):"/"}self._ipldResolver.get(cid,path,options,callback)}),tree:promisify((cid,path,options,callback)=>{if("object"==typeof path&&(callback=options,options=path,path=void 0),"function"==typeof path&&(callback=path,path=void 0),"function"==typeof options&&(callback=options,options={}),options=options||{},"string"==typeof cid){const split=cid.split("/");cid=new CID(split[0]),split.shift(),path=split.length>0?split.join("/"):void 0}pull(self._ipldResolver.treeStream(cid,path,options),pull.collect(callback))})}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const promisify=__webpack_require__(17),every=__webpack_require__(297),PeerId=__webpack_require__(23),CID=__webpack_require__(8),each=__webpack_require__(15);module.exports=(self=>{return{get:promisify((key,options,callback)=>{if(!Buffer.isBuffer(key))return callback(new Error("Not valid key"));"function"==typeof options&&(callback=options,options={}),self._libp2pNode.dht.get(key,options.timeout,callback)}),put:promisify((key,value,callback)=>{if(!Buffer.isBuffer(key))return callback(new Error("Not valid key"));self._libp2pNode.dht.put(key,value,callback)}),findprovs:promisify((key,callback)=>{"string"==typeof key&&(key=new CID(key)),self._libp2pNode.contentRouting.findProviders(key,callback)}),findpeer:promisify((peer,callback)=>{"string"==typeof peer&&(peer=PeerId.createFromB58String(peer)),self._libp2pNode.peerRouting.findPeer(peer,(err,info)=>{if(err)return callback(err);callback(null,[{Responses:[{ID:info.id.toB58String(),Addresses:info.multiaddrs.toArray().map(a=>a.toString())}]}])})}),provide:promisify((keys,options,callback)=>{Array.isArray(keys)||(keys=[keys]),"function"==typeof options&&(callback=options,options={}),every(keys,(key,cb)=>{self._repo.blocks.has(key,cb)},(err,has)=>{if(err)return callback(err);options.recursive||each(keys,(cid,cb)=>{self._libp2pNode.contentRouting.provide(cid,cb)},callback)})}),query:promisify((peerId,callback)=>{"string"==typeof peerId&&(peerId=PeerId.createFromB58String(peerId)),self._libp2pNode._dht.getClosestPeers(peerId.toBytes(),(err,peerIds)=>{if(err)return callback(err);callback(null,peerIds.map(id=>{return{ID:id.toB58String()}}))})})}})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function prepareFile(self,file,callback){const bs58mh=multihashes.toB58String(file.multihash);waterfall([cb=>self.object.get(file.multihash,cb),(node,cb)=>{cb(null,{path:file.path||bs58mh,hash:bs58mh,size:node.size})}],callback)}function normalizeContent(content){return Array.isArray(content)||(content=[content]),content.map(data=>{return Buffer.isBuffer(data)&&(data={path:"",content:pull.values([data])}),isStream.readable(data)&&(data={path:"",content:toPull.source(data)}),data&&data.content&&"function"!=typeof data.content&&(Buffer.isBuffer(data.content)&&(data.content=pull.values([data.content])),isStream.readable(data.content)&&(data.content=toPull.source(data.content))),data})}function noop(){}const unixfsEngine=__webpack_require__(438),importer=unixfsEngine.importer,exporter=unixfsEngine.exporter,promisify=__webpack_require__(17),multihashes=__webpack_require__(11),pull=__webpack_require__(4),sort=__webpack_require__(620),pushable=__webpack_require__(31),toStream=__webpack_require__(259),toPull=__webpack_require__(151),waterfall=__webpack_require__(6),isStream=__webpack_require__(457),Duplex=__webpack_require__(37).Duplex;module.exports=function(self){const createAddPullStream=options=>{const opts=Object.assign({},{shardSplitThreshold:self._options.EXPERIMENTAL.sharding?1e3:1/0},options);return pull(pull.map(normalizeContent),pull.flatten(),importer(self._ipldResolver,opts),pull.asyncMap(prepareFile.bind(null,self)))};return{createAddStream:(options,callback)=>{"function"==typeof options&&(callback=options,options=void 0);const addPullStream=createAddPullStream(options),p=pushable(),s=pull(p,addPullStream),retStream=new AddStreamDuplex(s,p);retStream.once("finish",()=>p.end()),callback(null,retStream)},createAddPullStream:createAddPullStream,add:promisify((data,options,callback)=>{if("function"==typeof options?(callback=options,options=void 0):callback&&"function"==typeof callback||(callback=noop),"object"!=typeof data&&!Buffer.isBuffer(data)&&!isStream(data))return callback(new Error("Invalid arguments, data must be an object, Buffer or readable stream"));pull(pull.values(normalizeContent(data)),importer(self._ipldResolver,options),pull.asyncMap(prepareFile.bind(null,self)),sort((a,b)=>{return a.pathb.path?-1:0}),pull.collect(callback))}),cat:promisify((ipfsPath,callback)=>{if("function"==typeof ipfsPath)return callback(new Error("You must supply a ipfsPath"));pull(exporter(ipfsPath,self._ipldResolver),pull.collect((err,files)=>{if(err)return callback(err);callback(null,toStream.source(files[files.length-1].content))}))}),get:promisify((ipfsPath,callback)=>{callback(null,toStream.source(pull(exporter(ipfsPath,self._ipldResolver),pull.map(file=>{return file.content&&(file.content=toStream.source(file.content),file.content.pause()),file}))))}),getPull:promisify((ipfsPath,callback)=>{callback(null,exporter(ipfsPath,self._ipldResolver))})}};class AddStreamDuplex extends Duplex{constructor(pullStream,push,options){super(Object.assign({objectMode:!0},options)),this._pullStream=pullStream,this._pushable=push,this._waitingPullFlush=[]}_read(){this._pullStream(null,(end,data)=>{for(;this._waitingPullFlush.length;){const cb=this._waitingPullFlush.shift();cb()}end?end instanceof Error&&this.emit("error",end):this.push(data)})}_write(chunk,encoding,callback){this._waitingPullFlush.push(callback),this._pushable.push(chunk)}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(17),setImmediate=__webpack_require__(7);module.exports=function(self){return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),setImmediate(()=>callback(null,{id:self._peerInfo.id.toB58String(),publicKey:self._peerInfo.id.pubKey.bytes.toString("base64"),addresses:self._peerInfo.multiaddrs.toArray().map(ma=>ma.toString()).filter(ma=>ma.indexOf("ipfs")>=0).sort(),agentVersion:"js-ipfs",protocolVersion:"9000"}))})}},function(module,exports,__webpack_require__){"use strict";exports.preStart=__webpack_require__(723),exports.start=__webpack_require__(726),exports.stop=__webpack_require__(727),exports.isOnline=__webpack_require__(719),exports.version=__webpack_require__(729),exports.id=__webpack_require__(716),exports.repo=__webpack_require__(725),exports.init=__webpack_require__(718),exports.bootstrap=__webpack_require__(711),exports.config=__webpack_require__(712),exports.block=__webpack_require__(710),exports.object=__webpack_require__(721),exports.dag=__webpack_require__(713),exports.libp2p=__webpack_require__(720),exports.swarm=__webpack_require__(728),exports.ping=__webpack_require__(722),exports.files=__webpack_require__(715),exports.bitswap=__webpack_require__(709),exports.pubsub=__webpack_require__(724),exports.dht=__webpack_require__(714)},function(module,exports,__webpack_require__){"use strict";const peerId=__webpack_require__(23),waterfall=__webpack_require__(6),parallel=__webpack_require__(40),promisify=__webpack_require__(17),config=__webpack_require__(214),addDefaultAssets=__webpack_require__(744);module.exports=function(self){return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={});const done=(err,res)=>{if(err)return self.emit("error",err),callback(err);self.state.initialized(),self.emit("init"),callback(null,res)};if("uninitalized"!==self.state.state())return done(new Error("Not able to init from state: "+self.state.state()));self.state.init(),self.log("init"),opts.emptyRepo=opts.emptyRepo||!1,opts.bits=Number(opts.bits)||2048,opts.log=opts.log||function(){},waterfall([cb=>self._repo.exists(cb),(exists,cb)=>{if(self.log("repo exists?",exists),exists===!0)return cb(new Error("repo already exists"));opts.log(`generating ${opts.bits}-bit RSA keypair...`,!1),self.log("generating peer id: %s bits",opts.bits),peerId.create({bits:opts.bits},cb)},(keys,cb)=>{self.log("identity generated"),config.Identity={PeerID:keys.toB58String(),PrivKey:keys.privKey.bytes.toString("base64")},opts.log("done"),opts.log("peer identity: "+config.Identity.PeerID),self._repo.init(config,cb)},(_,cb)=>self._repo.open(cb),cb=>{if(self.log("repo opened"),opts.emptyRepo)return cb(null,!0);const tasks=[cb=>self.object.new("unixfs-dir",cb)];"function"==typeof addDefaultAssets&&tasks.push(cb=>addDefaultAssets(self,opts.log,cb)),parallel(tasks,err=>{err?cb(err):cb(null,!0)})}],done)})}},function(module,exports,__webpack_require__){"use strict";module.exports=function(self){return()=>{return Boolean(self._bitswap&&self._libp2pNode&&self._libp2pNode.isStarted())}}},function(module,exports,__webpack_require__){"use strict";const Node=__webpack_require__(731),promisify=__webpack_require__(17),get=__webpack_require__(235);module.exports=function(self){return{start:promisify(callback=>{function gotConfig(err,config){if(err)return callback(err);const options={mdns:get(config,"Discovery.MDNS.Enabled"),webRTCStar:get(config,"Discovery.webRTCStar.Enabled"),bootstrap:get(config,"Bootstrap"),dht:get(self._options,"EXPERIMENTAL.dht"),modules:self._libp2pModules};self._libp2pNode=new Node(self._peerInfo,self._peerInfoBook,options),self._libp2pNode.on("peer:discovery",peerInfo=>{const dial=()=>{self._peerInfoBook.put(peerInfo),self._libp2pNode.dial(peerInfo,()=>{})};self.isOnline()?dial():self._libp2pNode.once("start",dial)}),self._libp2pNode.on("peer:connect",peerInfo=>{self._peerInfoBook.put(peerInfo)}),self._libp2pNode.start(err=>{if(err)return callback(err);self._libp2pNode.peerInfo.multiaddrs.forEach(ma=>{console.log("Swarm listening on",ma.toString())}),callback()})}self.config.get(gotConfig)}),stop:promisify(callback=>{self._libp2pNode.stop(callback)})}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function normalizeMultihash(multihash,enc){if("string"==typeof multihash)return"base58"!==enc&&enc?new Buffer(multihash,enc):multihash;if(Buffer.isBuffer(multihash))return multihash;throw new Error("unsupported multihash")}function parseBuffer(buf,encoding,callback){switch(encoding){case"json":return parseJSONBuffer(buf,callback);case"protobuf":return parseProtoBuffer(buf,callback);default:callback(new Error(`unkown encoding: ${encoding}`))}}function parseJSONBuffer(buf,callback){let data,links;try{const parsed=JSON.parse(buf.toString());links=(parsed.Links||[]).map(link=>{return new DAGLink(link.Name||link.name,link.Size||link.size,mh.fromB58String(link.Hash||link.hash||link.multihash))}),data=new Buffer(parsed.Data)}catch(err){return callback(new Error("failed to parse JSON: "+err))}DAGNode.create(data,links,callback)}function parseProtoBuffer(buf,callback){dagPB.util.deserialize(buf,callback)}const waterfall=__webpack_require__(6),promisify=__webpack_require__(17),dagPB=__webpack_require__(54),DAGNode=dagPB.DAGNode,DAGLink=dagPB.DAGLink,CID=__webpack_require__(8),mh=__webpack_require__(11),Unixfs=__webpack_require__(42),assert=__webpack_require__(9);module.exports=function(self){function editAndSave(edit){return(multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={}),waterfall([cb=>{self.object.get(multihash,options,cb)},(node,cb)=>{edit(node,(err,node)=>{if(err)return cb(err);self._ipldResolver.put(node,{cid:new CID(node.multihash)},err=>{cb(err,node)})})}],callback)}}return{new:promisify((template,callback)=>{"function"==typeof template&&(callback=template,template=void 0);let data;template?(assert("unixfs-dir"===template,"unkown template"),data=new Unixfs("directory").marshal()):data=new Buffer(0),DAGNode.create(data,(err,node)=>{if(err)return callback(err);self._ipldResolver.put(node,{cid:new CID(node.multihash)},err=>{if(err)return callback(err);callback(null,node)})})}),put:promisify((obj,options,callback)=>{function next(){self._ipldResolver.put(node,{cid:new CID(node.multihash)},err=>{if(err)return callback(err);self.object.get(node.multihash,callback)})}"function"==typeof options&&(callback=options,options={});const encoding=options.enc;let node;if(Buffer.isBuffer(obj))encoding?parseBuffer(obj,encoding,(err,_node)=>{if(err)return callback(err);node=_node,next()}):DAGNode.create(obj,(err,_node)=>{if(err)return callback(err);node=_node,next()});else if(obj.multihash)node=obj,next();else{if("object"!=typeof obj)return callback(new Error("obj not recognized"));DAGNode.create(obj.Data,obj.Links,(err,_node)=>{if(err)return callback(err);node=_node,next()})}}),get:promisify((multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={});let mh;try{mh=normalizeMultihash(multihash,options.enc)}catch(err){return callback(err)}const cid=new CID(mh);self._ipldResolver.get(cid,(err,result)=>{if(err)return callback(err);callback(null,result.value)})}),data:promisify((multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={}),self.object.get(multihash,options,(err,node)=>{if(err)return callback(err);callback(null,node.data)})}),links:promisify((multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={}),self.object.get(multihash,options,(err,node)=>{if(err)return callback(err);callback(null,node.links)})}),stat:promisify((multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={}),self.object.get(multihash,options,(err,node)=>{if(err)return callback(err);dagPB.util.serialize(node,(err,serialized)=>{if(err)return callback(err);const blockSize=serialized.length,linkLength=node.links.reduce((a,l)=>a+l.size,0);callback(null,{Hash:node.toJSON().multihash,NumLinks:node.links.length,BlockSize:blockSize,LinksSize:blockSize-node.data.length,DataSize:node.data.length,CumulativeSize:blockSize+linkLength})})})}),patch:promisify({addLink(multihash,link,options,callback){editAndSave((node,cb)=>{DAGNode.addLink(node,link,cb)})(multihash,options,callback)},rmLink(multihash,linkRef,options,callback){editAndSave((node,cb)=>{linkRef.constructor&&"DAGLink"===linkRef.constructor.name&&(linkRef=linkRef._name),DAGNode.rmLink(node,linkRef,cb)})(multihash,options,callback)},appendData(multihash,data,options,callback){editAndSave((node,cb)=>{const newData=Buffer.concat([node.data,data]);DAGNode.create(newData,node.links,cb)})(multihash,options,callback)},setData(multihash,data,options,callback){editAndSave((node,cb)=>{DAGNode.create(data,node.links,cb)})(multihash,options,callback)}})}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(17);module.exports=function(self){return promisify(callback=>{callback(new Error("Not implemented"))})}},function(module,exports,__webpack_require__){"use strict";const peerId=__webpack_require__(23),PeerInfo=__webpack_require__(36),multiaddr=__webpack_require__(26),waterfall=__webpack_require__(6),mafmt=__webpack_require__(93);module.exports=function(self){return callback=>{self.log("pre-start"),waterfall([cb=>self._repo.config.get(cb),(config,cb)=>{const privKey=config.Identity.PrivKey;peerId.createFromPrivKey(privKey,(err,id)=>cb(err,config,id))},(config,id,cb)=>{self._peerInfo=new PeerInfo(id),config.Addresses.Swarm.forEach(addr=>{let ma=multiaddr(addr);mafmt.IPFS.matches(ma)||(ma=ma.encapsulate("/ipfs/"+self._peerInfo.id.toB58String())),self._peerInfo.multiaddrs.add(ma)}),cb()}],callback)}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const promisify=__webpack_require__(17),setImmediate=__webpack_require__(7),OFFLINE_ERROR=__webpack_require__(153).OFFLINE_ERROR;module.exports=function(self){function subscribe(topic,options,handler,callback){const ps=self._pubsub;0===ps.listenerCount(topic)&&ps.subscribe(topic),ps.on(topic,handler),setImmediate(()=>callback())}return{subscribe:(topic,options,handler,callback)=>{if(!self.isOnline())throw OFFLINE_ERROR;if("function"==typeof options&&(callback=handler,handler=options,options={}),!callback)return new Promise((resolve,reject)=>{subscribe(topic,options,handler,err=>{if(err)return reject(err);resolve()})});subscribe(topic,options,handler,callback)},unsubscribe:(topic,handler)=>{const ps=self._pubsub;ps.removeListener(topic,handler),0===ps.listenerCount(topic)&&ps.unsubscribe(topic)},publish:promisify((topic,data,callback)=>{return self.isOnline()?Buffer.isBuffer(data)?(self._pubsub.publish(topic,data),void setImmediate(()=>callback())):setImmediate(()=>callback(new Error("data must be a Buffer"))):setImmediate(()=>callback(OFFLINE_ERROR))}),ls:promisify(callback=>{if(!self.isOnline())return setImmediate(()=>callback(OFFLINE_ERROR));const subscriptions=Array.from(self._pubsub.subscriptions);setImmediate(()=>callback(null,subscriptions))}),peers:promisify((topic,callback)=>{if(!self.isOnline())return setImmediate(()=>callback(OFFLINE_ERROR));const peers=Array.from(self._pubsub.peers.values()).filter(peer=>peer.topics.has(topic)).map(peer=>peer.info.id.toB58String());setImmediate(()=>callback(null,peers))}),setMaxListeners(n){return self._pubsub.setMaxListeners(n)}}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";module.exports=function(self){return{init:(bits,empty,callback)=>{},version:callback=>{self._repo.version.get(callback)},gc:function(){},path:()=>self._repo.path}}},function(module,exports,__webpack_require__){"use strict";const series=__webpack_require__(32),Bitswap=__webpack_require__(395),FloodSub=__webpack_require__(494),setImmediate=__webpack_require__(7),promisify=__webpack_require__(17);module.exports=(self=>{return promisify(callback=>{callback=callback||function(){};const done=err=>{if(err)return setImmediate(()=>self.emit("error",err)),callback(err);self.state.started(),setImmediate(()=>self.emit("start")),callback()};if("stopped"!==self.state.state())return done(new Error("Not able to start from state: "+self.state.state()));self.log("starting"),self.state.start(),series([cb=>{self._repo.closed?self._repo.open(cb):cb()},cb=>self.preStart(cb),cb=>self.libp2p.start(cb)],err=>{if(err)return done(err);self._bitswap=new Bitswap(self._libp2pNode,self._repo.blocks,self._peerInfoBook),self._bitswap.start(),self._blockService.setExchange(self._bitswap),self._options.EXPERIMENTAL.pubsub?(self._pubsub=new FloodSub(self._libp2pNode),self._pubsub.start(done)):done()})})})},function(module,exports,__webpack_require__){"use strict";const series=__webpack_require__(32);module.exports=(self=>{return callback=>{if(callback=callback||function(){},self.log("stop"),"stopped"===self.state.state())return callback();const done=err=>{if(err)return self.emit("error",err),callback(err);self.state.stopped(),self.emit("stop"),callback()};if("running"!==self.state.state())return done(new Error("Not able to stop from state: "+self.state.state()));self.state.stop(),self._blockService.unsetExchange(),self._bitswap.stop(),series([cb=>{self._options.EXPERIMENTAL.pubsub?self._pubsub.stop(cb):cb()},cb=>self.libp2p.stop(cb),cb=>self._repo.close(cb)],done)}})},function(module,exports,__webpack_require__){"use strict";const multiaddr=__webpack_require__(26),promisify=__webpack_require__(17),flatMap=__webpack_require__(536),values=__webpack_require__(134),OFFLINE_ERROR=__webpack_require__(153).OFFLINE_ERROR;module.exports=function(self){return{peers:promisify((opts,callback)=>{if("function"==typeof opts&&(callback=opts,opts={}),!self.isOnline())return callback(OFFLINE_ERROR);const verbose=opts.v||opts.verbose;callback(null,flatMap(values(self._peerInfoBook.getAll()).filter(peer=>peer.isConnected()),peer=>{return peer.multiaddrs.toArray().map(addr=>{const res={addr:addr,peer:peer};return verbose&&(res.latency="unknown"),res})}))}),addrs:promisify(callback=>{if(!self.isOnline())return callback(OFFLINE_ERROR);callback(null,values(self._peerInfoBook.getAll()))}),localAddrs:promisify(callback=>{if(!self.isOnline())return callback(OFFLINE_ERROR);callback(null,self._libp2pNode.peerInfo.multiaddrs.toArray())}),connect:promisify((maddr,callback)=>{if(!self.isOnline())return callback(OFFLINE_ERROR);"string"==typeof maddr&&(maddr=multiaddr(maddr)),self._libp2pNode.dial(maddr,callback)}),disconnect:promisify((maddr,callback)=>{if(!self.isOnline())return callback(OFFLINE_ERROR);"string"==typeof maddr&&(maddr=multiaddr(maddr)),self._libp2pNode.hangUp(maddr,callback)}),filters:promisify(callback=>callback(new Error("Not implemented")))}}},function(module,exports,__webpack_require__){"use strict";const pkg=__webpack_require__(461),promisify=__webpack_require__(17);module.exports=function(self){return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),callback(null,{version:pkg.version,repo:"",commit:""})})}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const BlockService=__webpack_require__(199),IPLDResolver=__webpack_require__(454),PeerId=__webpack_require__(23),PeerInfo=__webpack_require__(36),multiaddr=__webpack_require__(26),multihash=__webpack_require__(11),PeerBook=__webpack_require__(253),CID=__webpack_require__(8),debug=__webpack_require__(19),extend=__webpack_require__(181),EventEmitter=__webpack_require__(10),boot=__webpack_require__(708),components=__webpack_require__(717),defaultRepo=__webpack_require__(732);class IPFS extends EventEmitter{constructor(options){super(),this._options={init:!0,start:!0,EXPERIMENTAL:{}},options=options||{},this._libp2pModules=options.libp2p&&options.libp2p.modules,extend(this._options,options),options.init===!1&&(this._options.init=!1),options.start!==!1&&(this._options.start=!0),"string"==typeof options.repo||void 0===options.repo?this._repo=defaultRepo(options.repo):this._repo=options.repo,this.log=debug("jsipfs"),this.log.err=debug("jsipfs:err"),this.on("error",err=>this.log(err)),this.types={Buffer:Buffer,PeerId:PeerId,PeerInfo:PeerInfo,multiaddr:multiaddr,multihash:multihash,CID:CID},this._peerInfoBook=new PeerBook,this._peerInfo=void 0,this._libp2pNode=void 0,this._bitswap=void 0,this._blockService=new BlockService(this._repo),this._ipldResolver=new IPLDResolver(this._blockService),this._pubsub=void 0,this.init=components.init(this),this.preStart=components.preStart(this),this.start=components.start(this),this.stop=components.stop(this),this.isOnline=components.isOnline(this),this.version=components.version(this),this.id=components.id(this),this.repo=components.repo(this),this.bootstrap=components.bootstrap(this),this.config=components.config(this),this.block=components.block(this),this.object=components.object(this),this.dag=components.dag(this),this.libp2p=components.libp2p(this),this.swarm=components.swarm(this),this.files=components.files(this),this.bitswap=components.bitswap(this),this.ping=components.ping(this),this.pubsub=components.pubsub(this),this.dht=components.dht(this),this._options.EXPERIMENTAL.pubsub&&this.log("EXPERIMENTAL pubsub is enabled"),this._options.EXPERIMENTAL.sharding&&this.log("EXPERIMENTAL sharding is enabled"),this._options.EXPERIMENTAL.dht&&this.log("EXPERIMENTAL Kademlia DHT is enabled"),this.state=__webpack_require__(733)(this),boot(this)}}exports=module.exports=IPFS,exports.createNode=(options=>{return new IPFS(options)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const WS=__webpack_require__(530),WebRTCStar=__webpack_require__(528),Multiplex=__webpack_require__(502),SECIO=__webpack_require__(518),Railing=__webpack_require__(510),libp2p=__webpack_require__(533);class Node extends libp2p{constructor(peerInfo,peerBook,options){options=options||{};const wstar=new WebRTCStar,modules={transport:[new WS,wstar],connection:{muxer:[Multiplex],crypto:[SECIO]},discovery:[wstar.discovery]};if(options.bootstrap){const r=new Railing(options.bootstrap);modules.discovery.push(r)}super(modules,peerInfo,peerBook,options)}}module.exports=Node},function(module,exports,__webpack_require__){"use strict";const IPFSRepo=__webpack_require__(200);module.exports=(dir=>{return new IPFSRepo(dir||"ipfs")})},function(module,exports,__webpack_require__){"use strict";const debug=__webpack_require__(19),log=debug("jsipfs:state");log.error=debug("jsipfs:state:error");const fsm=__webpack_require__(374);module.exports=(self=>{const s=fsm("uninitalized",{uninitalized:{init:"initializing",initialized:"stopped"},initializing:{initialized:"stopped"},stopped:{start:"starting"},starting:{started:"running"},running:{stop:"stopping"},stopping:{stopped:"stopped"}});return s.on("error",err=>log.error(err)),s.on("done",()=>log("-> "+s._state)),s.init=(()=>{s("init")}),s.initialized=(()=>{s("initialized")}),s.stop=(()=>{s("stop")}),s.stopped=(()=>{s("stopped")}),s.start=(()=>{s("start")}),s.started=(()=>{s("started")}),s.state=(()=>s._state),s})},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports,__webpack_require__){module.exports=__webpack_require__(283)}]); \ No newline at end of file From e248f2de25700876f27f9dee66e5eee87b574ace Mon Sep 17 00:00:00 2001 From: David Dias Date: Mon, 28 Aug 2017 07:49:05 +0200 Subject: [PATCH 06/11] IPFS background page --- .gitignore | 3 +++ app/extensions/ipfs/ipfs.html | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 app/extensions/ipfs/ipfs.html diff --git a/.gitignore b/.gitignore index a6b436cfc9f..e93c465c14a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +package-lock.json +yarn.lock + # Logs logs *.log diff --git a/app/extensions/ipfs/ipfs.html b/app/extensions/ipfs/ipfs.html new file mode 100644 index 00000000000..5bcbfba57d1 --- /dev/null +++ b/app/extensions/ipfs/ipfs.html @@ -0,0 +1,17 @@ + + + + + + + + + IPFS + + + + + +

IPFS

+ + From faa9afebbc9d520d3fc00f4047c42f7a73d81a8a Mon Sep 17 00:00:00 2001 From: David Dias Date: Mon, 28 Aug 2017 09:02:53 +0200 Subject: [PATCH 07/11] feat: make it work with a background page instead --- app/extensions/ipfs/ipfs.html | 19 ++++++++++++++++++- app/extensions/ipfs/manifest.json | 6 +----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/app/extensions/ipfs/ipfs.html b/app/extensions/ipfs/ipfs.html index 5bcbfba57d1..38803869784 100644 --- a/app/extensions/ipfs/ipfs.html +++ b/app/extensions/ipfs/ipfs.html @@ -4,7 +4,24 @@ - + IPFS diff --git a/app/extensions/ipfs/manifest.json b/app/extensions/ipfs/manifest.json index 3b388875d41..34270d29131 100644 --- a/app/extensions/ipfs/manifest.json +++ b/app/extensions/ipfs/manifest.json @@ -11,11 +11,7 @@ }, "offline_enabled": true, "background": { - "scripts": [ - "js/some-other.js", - "js/ipfs.min.js", - "js/main.js" - ], + "page": "ipfs.html", "persistent": true }, "content_security_policy": "script-src 'self' 'unsafe-eval'" From 3952bebc97c9dca4dfbfa1fd7784e6e6541e8408 Mon Sep 17 00:00:00 2001 From: David Dias Date: Fri, 1 Sep 2017 08:28:45 +0100 Subject: [PATCH 08/11] rm csp from ipfs ext --- app/extensions/ipfs/ipfs.html | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/app/extensions/ipfs/ipfs.html b/app/extensions/ipfs/ipfs.html index 38803869784..0bda821730a 100644 --- a/app/extensions/ipfs/ipfs.html +++ b/app/extensions/ipfs/ipfs.html @@ -4,24 +4,6 @@ - IPFS From f2a0df97599211f922a110ad33a8029b622d0608 Mon Sep 17 00:00:00 2001 From: David Dias Date: Fri, 1 Sep 2017 08:31:53 +0100 Subject: [PATCH 09/11] add csp back again --- app/extensions/ipfs/ipfs.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/extensions/ipfs/ipfs.html b/app/extensions/ipfs/ipfs.html index 0bda821730a..7764835a1cf 100644 --- a/app/extensions/ipfs/ipfs.html +++ b/app/extensions/ipfs/ipfs.html @@ -4,6 +4,16 @@ + IPFS From ca10910731abf4be5eeb72d7ed9f8e8924943b7f Mon Sep 17 00:00:00 2001 From: David Dias Date: Fri, 1 Sep 2017 08:52:30 +0100 Subject: [PATCH 10/11] identify next steps, wait for node to be ready, remove WebRTC while brave doesnt fully support it yet --- app/extensions/ipfs/js/main.js | 68 ++++++++++++++++++++++------------ 1 file changed, 45 insertions(+), 23 deletions(-) diff --git a/app/extensions/ipfs/js/main.js b/app/extensions/ipfs/js/main.js index 2952d2f4682..540b5ef91cd 100644 --- a/app/extensions/ipfs/js/main.js +++ b/app/extensions/ipfs/js/main.js @@ -1,32 +1,54 @@ /* global Ipfs */ -// const ipc = window.chrome.ipcRenderer - chrome.protocol.registerStringProtocol('ipfs', handler) -chrome.protocol.registerStringProtocol('dweb', handler) -function handler (request, callback) { - // test to check if handling the protocol works +const node = new Ipfs({ + config: { + Addresses: { + Swarm: [] + } + } +}) + +// TODO: bring back once brave supports registerURIHandlers +// chrome.protocol.registerStringProtocol('dweb', handler) + +/* + * request is an object with: + * - method (e.g GET) + * - referrer (always empty for now) + * - url (full ipfs://) + * reply is a functin that takes one argument which is the response to the request + */ +function handler (request, reply) { + if (!node.isOnline()) { + node.once('ready', () => handler(request, reply)) + } + + const path = request.url.split('ipfs://')[1] + + // TODO check if it is valid IPFS Path // callback('hi there!' + test()) // eslint-disable-line - const node = new Ipfs() - - node.on('ready', () => { - node.files.cat('QmSmuETUoXzh4Qo5upHxJWZJK8AEpXXZdTqs34ttE3qMYn', (err, stream) => { - if (err) { - return callback('failed to get the hash') - } - let buf = '' - stream.on('data', (data) => { - buf += data.toString() - }) - stream.on('end', () => { - callback(buf) - }) + // TODO here I need to check if it is a directory or a file: + // if file load it + // if directory fetch it and look for an index.html + // if index.html load that + // if no index.html, load the directory listing just like the gateway + + node.files.cat(path, (err, stream) => { + if (err) { + // TODO create a nice error page + return reply('err: ' + err.message) + } + + // TODO replace this by something like BL + let buf = '' + + stream.on('data', (data) => { + buf += data.toString() }) - // callback('I am online!') // eslint-disable-line - }) - // test loading Ipfs into the background process scope - // callback('hi there!' + test() + Ipfs.toString()) // eslint-disable-line + stream.on('end', () => reply(buf)) + }) } From bc43e503dec38b3c07ddaba84c225d05540f0748 Mon Sep 17 00:00:00 2001 From: David Dias Date: Fri, 1 Sep 2017 09:12:31 +0100 Subject: [PATCH 11/11] only use unsafe-eval where it needs to be explicitely applied --- app/extensions/brave/index-dev.html | 35 ++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/app/extensions/brave/index-dev.html b/app/extensions/brave/index-dev.html index 55385630392..88ab2337a58 100644 --- a/app/extensions/brave/index-dev.html +++ b/app/extensions/brave/index-dev.html @@ -7,7 +7,40 @@ - + Brave